diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2018-06-15 10:46:15 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2018-06-18 12:27:01 +0000 |
| commit | f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43 (patch) | |
| tree | 7c6044fd3a17a2665841959dac9b3b2110b27924 /src/trace/imagemap-gdk.cpp | |
| parent | Run clang-tidy’s modernize-use-override pass. (diff) | |
| download | inkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.tar.gz inkscape-f4349fb3e45bd44cef0e2b69af4c9b4cf35dcf43.zip | |
Run clang-tidy’s modernize-use-nullptr pass.
This replaces all NULL or 0 with nullptr when assigned to or returned as
a pointer.
Diffstat (limited to 'src/trace/imagemap-gdk.cpp')
| -rw-r--r-- | src/trace/imagemap-gdk.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/trace/imagemap-gdk.cpp b/src/trace/imagemap-gdk.cpp index 298414074..db8bbdd99 100644 --- a/src/trace/imagemap-gdk.cpp +++ b/src/trace/imagemap-gdk.cpp @@ -10,7 +10,7 @@ GrayMap *gdkPixbufToGrayMap(GdkPixbuf *buf) { if (!buf) - return NULL; + return nullptr; int width = gdk_pixbuf_get_width(buf); int height = gdk_pixbuf_get_height(buf); @@ -20,7 +20,7 @@ GrayMap *gdkPixbufToGrayMap(GdkPixbuf *buf) GrayMap *grayMap = GrayMapCreate(width, height); if (!grayMap) - return NULL; + return nullptr; //### Fill in the odd cells with RGB values int x,y; @@ -46,19 +46,19 @@ GrayMap *gdkPixbufToGrayMap(GdkPixbuf *buf) GdkPixbuf *grayMapToGdkPixbuf(GrayMap *grayMap) { if (!grayMap) - return NULL; + return nullptr; guchar *pixdata = (guchar *) malloc(sizeof(guchar) * grayMap->width * grayMap->height * 3); if (!pixdata) - return NULL; + return nullptr; int n_channels = 3; int rowstride = grayMap->width * 3; GdkPixbuf *buf = gdk_pixbuf_new_from_data(pixdata, GDK_COLORSPACE_RGB, 0, 8, grayMap->width, grayMap->height, - rowstride, (GdkPixbufDestroyNotify)g_free, NULL); + rowstride, (GdkPixbufDestroyNotify)g_free, nullptr); //### Fill in the odd cells with RGB values int x,y; @@ -87,7 +87,7 @@ GdkPixbuf *grayMapToGdkPixbuf(GrayMap *grayMap) PackedPixelMap *gdkPixbufToPackedPixelMap(GdkPixbuf *buf) { if (!buf) - return NULL; + return nullptr; int width = gdk_pixbuf_get_width(buf); int height = gdk_pixbuf_get_height(buf); @@ -97,7 +97,7 @@ PackedPixelMap *gdkPixbufToPackedPixelMap(GdkPixbuf *buf) PackedPixelMap *ppMap = PackedPixelMapCreate(width, height); if (!ppMap) - return NULL; + return nullptr; //### Fill in the cells with RGB values int x,y; @@ -130,7 +130,7 @@ PackedPixelMap *gdkPixbufToPackedPixelMap(GdkPixbuf *buf) RgbMap *gdkPixbufToRgbMap(GdkPixbuf *buf) { if (!buf) - return NULL; + return nullptr; int width = gdk_pixbuf_get_width(buf); int height = gdk_pixbuf_get_height(buf); @@ -140,7 +140,7 @@ RgbMap *gdkPixbufToRgbMap(GdkPixbuf *buf) RgbMap *rgbMap = RgbMapCreate(width, height); if (!rgbMap) - return NULL; + return nullptr; //### Fill in the cells with RGB values int x,y; @@ -175,19 +175,19 @@ RgbMap *gdkPixbufToRgbMap(GdkPixbuf *buf) GdkPixbuf *indexedMapToGdkPixbuf(IndexedMap *iMap) { if (!iMap) - return NULL; + return nullptr; guchar *pixdata = (guchar *) malloc(sizeof(guchar) * iMap->width * iMap->height * 3); if (!pixdata) - return NULL; + return nullptr; int n_channels = 3; int rowstride = iMap->width * 3; GdkPixbuf *buf = gdk_pixbuf_new_from_data(pixdata, GDK_COLORSPACE_RGB, 0, 8, iMap->width, iMap->height, - rowstride, (GdkPixbufDestroyNotify)g_free, NULL); + rowstride, (GdkPixbufDestroyNotify)g_free, nullptr); //### Fill in the cells with RGB values int x,y; |
