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 | |
| 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')
| -rw-r--r-- | src/trace/filterset.cpp | 10 | ||||
| -rw-r--r-- | src/trace/imagemap-gdk.cpp | 24 | ||||
| -rw-r--r-- | src/trace/imagemap.cpp | 24 | ||||
| -rw-r--r-- | src/trace/pool.h | 4 | ||||
| -rw-r--r-- | src/trace/potrace/bitmap.h | 8 | ||||
| -rw-r--r-- | src/trace/potrace/inkscape-potrace.cpp | 12 | ||||
| -rw-r--r-- | src/trace/quantize.cpp | 26 | ||||
| -rw-r--r-- | src/trace/siox.cpp | 22 | ||||
| -rw-r--r-- | src/trace/siox.h | 2 | ||||
| -rw-r--r-- | src/trace/trace.cpp | 38 | ||||
| -rw-r--r-- | src/trace/trace.h | 2 |
11 files changed, 86 insertions, 86 deletions
diff --git a/src/trace/filterset.cpp b/src/trace/filterset.cpp index f6c025956..db6d16eea 100644 --- a/src/trace/filterset.cpp +++ b/src/trace/filterset.cpp @@ -48,7 +48,7 @@ GrayMap *grayMapGaussian(GrayMap *me) GrayMap *newGm = GrayMapCreate(width, height); if (!newGm) - return NULL; + return nullptr; for (int y = 0 ; y<height ; y++) { @@ -98,7 +98,7 @@ RgbMap *rgbMapGaussian(RgbMap *me) RgbMap *newGm = RgbMapCreate(width, height); if (!newGm) - return NULL; + return nullptr; for (int y = 0 ; y<height ; y++) { @@ -178,7 +178,7 @@ static GrayMap *grayMapSobel(GrayMap *gm, GrayMap *newGm = GrayMapCreate(width, height); if (!newGm) - return NULL; + return nullptr; for (int y = 0 ; y<height ; y++) { @@ -353,11 +353,11 @@ GrayMap * grayMapCanny(GrayMap *gm, double lowThreshold, double highThreshold) { if (!gm) - return NULL; + return nullptr; GrayMap *cannyGm = grayMapSobel(gm, lowThreshold, highThreshold); if (!cannyGm) - return NULL; + return nullptr; /*cannyGm->writePPM(cannyGm, "canny.ppm");*/ return cannyGm; 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; diff --git a/src/trace/imagemap.cpp b/src/trace/imagemap.cpp index a8d8a8c8f..e2e97d5ec 100644 --- a/src/trace/imagemap.cpp +++ b/src/trace/imagemap.cpp @@ -65,7 +65,7 @@ GrayMap *GrayMapCreate(int width, int height) GrayMap *me = (GrayMap *)malloc(sizeof(GrayMap)); if (!me) - return NULL; + return nullptr; /** methods **/ me->setPixel = gSetPixel; @@ -81,7 +81,7 @@ GrayMap *GrayMapCreate(int width, int height) if (!me->pixels) { free(me); - return NULL; + return nullptr; } me->rows = (unsigned long **) malloc(sizeof(unsigned long *) * height); @@ -89,7 +89,7 @@ GrayMap *GrayMapCreate(int width, int height) { free(me->pixels); free(me); - return NULL; + return nullptr; } unsigned long *row = me->pixels; @@ -179,7 +179,7 @@ PackedPixelMap *PackedPixelMapCreate(int width, int height) PackedPixelMap *me = (PackedPixelMap *)malloc(sizeof(PackedPixelMap)); if (!me) - return NULL; + return nullptr; /** methods **/ me->setPixel = ppSetPixel; @@ -195,13 +195,13 @@ PackedPixelMap *PackedPixelMapCreate(int width, int height) me->pixels = (unsigned long *) malloc(sizeof(unsigned long) * width * height); if (!me->pixels){ free(me); - return NULL; + return nullptr; } me->rows = (unsigned long **) malloc(sizeof(unsigned long *) * height); if (!me->rows){ free(me->pixels); //allocated as me->pixels is not NULL here: see previous check free(me); - return NULL; + return nullptr; } unsigned long *row = me->pixels; @@ -288,7 +288,7 @@ RgbMap *RgbMapCreate(int width, int height) RgbMap *me = (RgbMap *)malloc(sizeof(RgbMap)); if (!me){ - return NULL; + return nullptr; } /** methods **/ @@ -305,13 +305,13 @@ RgbMap *RgbMapCreate(int width, int height) me->pixels = (RGB *) malloc(sizeof(RGB) * width * height); if (!me->pixels){ free(me); - return NULL; + return nullptr; } me->rows = (RGB **) malloc(sizeof(RGB *) * height); if (!me->rows){ free(me->pixels); //allocated as me->pixels is not NULL here: see previous check free(me); - return NULL; + return nullptr; } RGB *row = me->pixels; @@ -398,7 +398,7 @@ IndexedMap *IndexedMapCreate(int width, int height) IndexedMap *me = (IndexedMap *)malloc(sizeof(IndexedMap)); if (!me) - return NULL; + return nullptr; /** methods **/ me->setPixel = iSetPixel; @@ -414,13 +414,13 @@ IndexedMap *IndexedMapCreate(int width, int height) me->pixels = (unsigned int *) malloc(sizeof(unsigned int) * width * height); if (!me->pixels){ free(me); - return NULL; + return nullptr; } me->rows = (unsigned int **) malloc(sizeof(unsigned int *) * height); if (!me->rows){ free(me->pixels); //allocated as me->pixels is not NULL here: see previous check free(me); - return NULL; + return nullptr; } unsigned int *row = me->pixels; diff --git a/src/trace/pool.h b/src/trace/pool.h index 88fd82bcd..b4693d941 100644 --- a/src/trace/pool.h +++ b/src/trace/pool.h @@ -62,9 +62,9 @@ class pool { { cblock = 0; size = sizeof(T) > sizeof(void *) ? sizeof(T) : sizeof(void *); - next = NULL; + next = nullptr; for (int k = 0; k < 64; k++) { - block[k] = NULL; + block[k] = nullptr; } } 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); diff --git a/src/trace/quantize.cpp b/src/trace/quantize.cpp index c386c0ee9..a7868fd03 100644 --- a/src/trace/quantize.cpp +++ b/src/trace/quantize.cpp @@ -165,10 +165,10 @@ inline int childIndex(RGB rgb) inline Ocnode *ocnodeNew(pool<Ocnode> *pool) { Ocnode *node = pool->draw(); - node->ref = NULL; - node->parent = NULL; + node->ref = nullptr; + node->parent = nullptr; node->nchild = 0; - for (int i = 0; i < 8; i++) node->child[i] = NULL; + for (int i = 0; i < 8; i++) node->child[i] = nullptr; node->mi = 0; return node; } @@ -363,7 +363,7 @@ static void ocnodeStrip(pool<Ocnode> *pool, Ocnode **ref, int *count, unsigned l if (!node->mi) ocnodeMi(node); //mi generation may be required if (node->mi > lvl) return; //leaf is above strip level ocnodeFree(pool, node); - *ref = NULL; + *ref = nullptr; (*count)--; } else @@ -373,7 +373,7 @@ static void ocnodeStrip(pool<Ocnode> *pool, Ocnode **ref, int *count, unsigned l node->nchild = 0; node->nleaf = 0; node->mi = 0; - Ocnode **lonelychild = NULL; + Ocnode **lonelychild = nullptr; for (int i = 0; i < 8; i++) if (node->child[i]) { ocnodeStrip(pool, &node->child[i], count, lvl); @@ -402,7 +402,7 @@ static void ocnodeStrip(pool<Ocnode> *pool, Ocnode **ref, int *count, unsigned l node->nleaf = 1; ocnodeMi(node); ocnodeFree(pool, *lonelychild); - *lonelychild = NULL; + *lonelychild = nullptr; } else { @@ -444,21 +444,21 @@ static void octreeBuildArea(pool<Ocnode> *pool, RgbMap *rgbmap, Ocnode **ref, { int dx = x2 - x1, dy = y2 - y1; int xm = x1 + dx/2, ym = y1 + dy/2; - Ocnode *ref1 = NULL; - Ocnode *ref2 = NULL; + Ocnode *ref1 = nullptr; + Ocnode *ref2 = nullptr; if (dx == 1 && dy == 1) ocnodeLeaf(pool, ref, rgbmap->getPixel(rgbmap, x1, y1)); else if (dx > dy) { octreeBuildArea(pool, rgbmap, &ref1, x1, y1, xm, y2, ncolor); octreeBuildArea(pool, rgbmap, &ref2, xm, y1, x2, y2, ncolor); - octreeMerge(pool, NULL, ref, ref1, ref2); + octreeMerge(pool, nullptr, ref, ref1, ref2); } else { octreeBuildArea(pool, rgbmap, &ref1, x1, y1, x2, ym, ncolor); octreeBuildArea(pool, rgbmap, &ref2, x1, ym, x2, y2, ncolor); - octreeMerge(pool, NULL, ref, ref1, ref2); + octreeMerge(pool, nullptr, ref, ref1, ref2); } //octreePrune(ref, 2*ncolor); @@ -472,7 +472,7 @@ static void octreeBuildArea(pool<Ocnode> *pool, RgbMap *rgbmap, Ocnode **ref, static Ocnode *octreeBuild(pool<Ocnode> *pool, RgbMap *rgbmap, int ncolor) { //create the octree - Ocnode *node = NULL; + Ocnode *node = nullptr; octreeBuildArea(pool, rgbmap, &node, 0, 0, rgbmap->width, rgbmap->height, ncolor @@ -549,11 +549,11 @@ IndexedMap *rgbMapQuantize(RgbMap *rgbmap, int ncolor) assert(rgbmap); assert(ncolor > 0); - IndexedMap *newmap = 0; + IndexedMap *newmap = nullptr; pool<Ocnode> pool; - Ocnode *tree = 0; + Ocnode *tree = nullptr; try { tree = octreeBuild(&pool, rgbmap, ncolor); } diff --git a/src/trace/siox.cpp b/src/trace/siox.cpp index 9df4e561c..9501da3c4 100644 --- a/src/trace/siox.cpp +++ b/src/trace/siox.cpp @@ -344,8 +344,8 @@ SioxImage::SioxImage(unsigned int widthArg, unsigned int heightArg) */ SioxImage::SioxImage(const SioxImage &other) { - pixdata = NULL; - cmdata = NULL; + pixdata = nullptr; + cmdata = nullptr; assign(other); } @@ -654,14 +654,14 @@ GdkPixbuf *SioxImage::getGdkPixbuf() guchar *pixdata = (guchar *) malloc(sizeof(guchar) * width * height * n_channels); if (!pixdata) - return NULL; + return nullptr; int rowstride = width * n_channels; GdkPixbuf *buf = gdk_pixbuf_new_from_data(pixdata, GDK_COLORSPACE_RGB, has_alpha, 8, width, height, - rowstride, NULL, NULL); + rowstride, nullptr, nullptr); //### Fill in the cells with RGB values int row = 0; @@ -728,14 +728,14 @@ const float Siox::CERTAIN_BACKGROUND_CONFIDENCE=0.0f; * Construct a Siox engine */ Siox::Siox() : - sioxObserver(0), + sioxObserver(nullptr), keepGoing(true), width(0), height(0), pixelCount(0), - image(0), - cm(0), - labelField(0) + image(nullptr), + cm(nullptr), + labelField(nullptr) { init(); } @@ -749,9 +749,9 @@ Siox::Siox(SioxObserver *observer) : width(0), height(0), pixelCount(0), - image(0), - cm(0), - labelField(0) + image(nullptr), + cm(nullptr), + labelField(nullptr) { init(); } diff --git a/src/trace/siox.h b/src/trace/siox.h index fa18ac238..6f3f89a83 100644 --- a/src/trace/siox.h +++ b/src/trace/siox.h @@ -388,7 +388,7 @@ public: * used to point to a C++ object or C state object, to delegate * callback processing to something else. Use NULL to ignore. */ - SioxObserver(void *contextArg) : context(NULL) + SioxObserver(void *contextArg) : context(nullptr) { context = contextArg; } /** diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp index bd52d7a57..a76be208e 100644 --- a/src/trace/trace.cpp +++ b/src/trace/trace.cpp @@ -49,7 +49,7 @@ SPImage *Tracer::getSelectedSPImage() if (!desktop) { g_warning("Trace: No active desktop"); - return NULL; + return nullptr; } Inkscape::MessageStack *msgStack = desktop->getMessageStack(); @@ -60,12 +60,12 @@ SPImage *Tracer::getSelectedSPImage() char *msg = _("Select an <b>image</b> to trace"); msgStack->flash(Inkscape::ERROR_MESSAGE, msg); //g_warning(msg); - return NULL; + return nullptr; } if (sioxEnabled) { - SPImage *img = NULL; + SPImage *img = nullptr; auto list = sel->items(); std::vector<SPItem *> items; sioxShapes.clear(); @@ -94,7 +94,7 @@ SPImage *Tracer::getSelectedSPImage() { char *msg = _("Select only one <b>image</b> to trace"); msgStack->flash(Inkscape::ERROR_MESSAGE, msg); - return NULL; + return nullptr; } img = SP_IMAGE(item); } @@ -112,7 +112,7 @@ SPImage *Tracer::getSelectedSPImage() { char *msg = _("Select one image and one or more shapes above it"); msgStack->flash(Inkscape::ERROR_MESSAGE, msg); - return NULL; + return nullptr; } return img; } @@ -125,7 +125,7 @@ SPImage *Tracer::getSelectedSPImage() char *msg = _("Select an <b>image</b> to trace"); //same as above msgStack->flash(Inkscape::ERROR_MESSAGE, msg); //g_warning(msg); - return NULL; + return nullptr; } if (!SP_IS_IMAGE(item)) @@ -133,7 +133,7 @@ SPImage *Tracer::getSelectedSPImage() char *msg = _("Select an <b>image</b> to trace"); msgStack->flash(Inkscape::ERROR_MESSAGE, msg); //g_warning(msg); - return NULL; + return nullptr; } SPImage *img = SP_IMAGE(item); @@ -215,7 +215,7 @@ Glib::RefPtr<Gdk::Pixbuf> Tracer::sioxProcessImage(SPImage *img, Glib::RefPtr<Gd if (!desktop) { g_warning("%s", _("Trace: No active desktop")); - return Glib::RefPtr<Gdk::Pixbuf>(NULL); + return Glib::RefPtr<Gdk::Pixbuf>(nullptr); } Inkscape::MessageStack *msgStack = desktop->getMessageStack(); @@ -226,7 +226,7 @@ Glib::RefPtr<Gdk::Pixbuf> Tracer::sioxProcessImage(SPImage *img, Glib::RefPtr<Gd char *msg = _("Select an <b>image</b> to trace"); msgStack->flash(Inkscape::ERROR_MESSAGE, msg); //g_warning(msg); - return Glib::RefPtr<Gdk::Pixbuf>(NULL); + return Glib::RefPtr<Gdk::Pixbuf>(nullptr); } Inkscape::DrawingItem *aImg = img->get_arenaitem(desktop->dkey); @@ -313,7 +313,7 @@ Glib::RefPtr<Gdk::Pixbuf> Tracer::sioxProcessImage(SPImage *img, Glib::RefPtr<Gd if (!result.isValid()) { g_warning("%s", _("Invalid SIOX result")); - return Glib::RefPtr<Gdk::Pixbuf>(NULL); + return Glib::RefPtr<Gdk::Pixbuf>(nullptr); } //result.writePPM("siox2.ppm"); @@ -334,10 +334,10 @@ Glib::RefPtr<Gdk::Pixbuf> Tracer::getSelectedImage() SPImage *img = getSelectedSPImage(); if (!img) - return Glib::RefPtr<Gdk::Pixbuf>(NULL); + return Glib::RefPtr<Gdk::Pixbuf>(nullptr); if (!img->pixbuf) - return Glib::RefPtr<Gdk::Pixbuf>(NULL); + return Glib::RefPtr<Gdk::Pixbuf>(nullptr); GdkPixbuf *raw_pb = img->pixbuf->getPixbufRaw(false); GdkPixbuf *trace_pb = gdk_pixbuf_copy(raw_pb); @@ -408,7 +408,7 @@ void Tracer::traceThread() char *msg = _("Trace: No active document"); msgStack->flash(Inkscape::ERROR_MESSAGE, msg); //g_warning(msg); - engine = NULL; + engine = nullptr; return; } SPDocument *doc = SP_ACTIVE_DOCUMENT; @@ -418,7 +418,7 @@ void Tracer::traceThread() SPImage *img = getSelectedSPImage(); if (!img) { - engine = NULL; + engine = nullptr; return; } @@ -440,7 +440,7 @@ void Tracer::traceThread() char *msg = _("Trace: Image has no bitmap data"); msgStack->flash(Inkscape::ERROR_MESSAGE, msg); //g_warning(msg); - engine = NULL; + engine = nullptr; return; } @@ -455,7 +455,7 @@ void Tracer::traceThread() //### Check if we should stop if (!keepGoing || nrPaths<1) { - engine = NULL; + engine = nullptr; return; } @@ -498,7 +498,7 @@ void Tracer::traceThread() //#OK. Now let's start making new nodes Inkscape::XML::Document *xml_doc = desktop->doc()->getReprDoc(); - Inkscape::XML::Node *groupRepr = NULL; + Inkscape::XML::Node *groupRepr = nullptr; //# if more than 1, make a <g>roup of <path>s if (nrPaths > 1) @@ -519,7 +519,7 @@ void Tracer::traceThread() pathRepr->setAttribute("d", result.getPathData().c_str()); if (nrPaths > 1) - groupRepr->addChild(pathRepr, NULL); + groupRepr->addChild(pathRepr, nullptr); else par->addChild(pathRepr, imgRepr); @@ -549,7 +549,7 @@ void Tracer::traceThread() //## inform the document, so we can undo DocumentUndo::done(doc, SP_VERB_SELECTION_TRACE, _("Trace bitmap")); - engine = NULL; + engine = nullptr; char *msg = g_strdup_printf(_("Trace: Done. %ld nodes created"), totalNodeCount); msgStack->flash(Inkscape::NORMAL_MESSAGE, msg); diff --git a/src/trace/trace.h b/src/trace/trace.h index b6b7684d0..790298261 100644 --- a/src/trace/trace.h +++ b/src/trace/trace.h @@ -167,7 +167,7 @@ public: */ Tracer() { - engine = NULL; + engine = nullptr; sioxEnabled = false; } |
