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/potrace | |
| 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/potrace')
| -rw-r--r-- | src/trace/potrace/bitmap.h | 8 | ||||
| -rw-r--r-- | src/trace/potrace/inkscape-potrace.cpp | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/trace/potrace/bitmap.h b/src/trace/potrace/bitmap.h index 7b5a94bb1..a47de24d0 100644 --- a/src/trace/potrace/bitmap.h +++ b/src/trace/potrace/bitmap.h @@ -63,12 +63,12 @@ static inline potrace_bitmap_t *bm_new(int w, int h) { /* check for overflow error */ if (size < 0 || (h != 0 && dy != 0 && size / h / dy != BM_WORDSIZE)) { errno = ENOMEM; - return NULL; + return nullptr; } bm = (potrace_bitmap_t *) malloc(sizeof(potrace_bitmap_t)); if (!bm) { - return NULL; + return nullptr; } bm->w = w; bm->h = h; @@ -76,7 +76,7 @@ static inline potrace_bitmap_t *bm_new(int w, int h) { bm->map = (potrace_word *) malloc(size); if (!bm->map) { free(bm); - return NULL; + return nullptr; } return bm; } @@ -94,7 +94,7 @@ static inline potrace_bitmap_t *bm_dup(const potrace_bitmap_t *bm) { potrace_bitmap_t *bm1 = bm_new(bm->w, bm->h); ptrdiff_t size = (ptrdiff_t)bm->dy * (ptrdiff_t)bm->h * (ptrdiff_t)BM_WORDSIZE; if (!bm1) { - return NULL; + return nullptr; } memcpy(bm1->map, bm->map, size); return bm1; diff --git a/src/trace/potrace/inkscape-potrace.cpp b/src/trace/potrace/inkscape-potrace.cpp index b438be248..86658653a 100644 --- a/src/trace/potrace/inkscape-potrace.cpp +++ b/src/trace/potrace/inkscape-potrace.cpp @@ -207,9 +207,9 @@ static long writePaths(PotraceTracingEngine *engine, potrace_path_t *plist, static GrayMap *filter(PotraceTracingEngine &engine, GdkPixbuf * pixbuf) { if (!pixbuf) - return NULL; + return nullptr; - GrayMap *newGm = NULL; + GrayMap *newGm = nullptr; /*### Color quantization -- banding ###*/ if (engine.getTraceType() == TRACE_QUANT) @@ -281,9 +281,9 @@ static GrayMap *filter(PotraceTracingEngine &engine, GdkPixbuf * pixbuf) static IndexedMap *filterIndexed(PotraceTracingEngine &engine, GdkPixbuf * pixbuf) { if (!pixbuf) - return NULL; + return nullptr; - IndexedMap *newGm = NULL; + IndexedMap *newGm = nullptr; RgbMap *gm = gdkPixbufToRgbMap(pixbuf); if (engine.getMultiScanSmooth()) @@ -326,7 +326,7 @@ PotraceTracingEngine::preview(Glib::RefPtr<Gdk::Pixbuf> thePixbuf) { IndexedMap *gm = filterIndexed(*this, pixbuf); if (!gm) - return Glib::RefPtr<Gdk::Pixbuf>(NULL); + return Glib::RefPtr<Gdk::Pixbuf>(nullptr); Glib::RefPtr<Gdk::Pixbuf> newBuf = Glib::wrap(indexedMapToGdkPixbuf(gm), false); @@ -339,7 +339,7 @@ PotraceTracingEngine::preview(Glib::RefPtr<Gdk::Pixbuf> thePixbuf) { GrayMap *gm = filter(*this, pixbuf); if (!gm) - return Glib::RefPtr<Gdk::Pixbuf>(NULL); + return Glib::RefPtr<Gdk::Pixbuf>(nullptr); Glib::RefPtr<Gdk::Pixbuf> newBuf = Glib::wrap(grayMapToGdkPixbuf(gm), false); |
