From 7b54c7f2a42da28f38bdaf5399c0ef3e339e58dc Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Thu, 21 Nov 2019 21:36:57 +0100 Subject: [PATCH] Some code cleanups --- rtengine/cJSON.c | 6 ++---- rtengine/ciecam02.cc | 2 +- rtengine/ciecam02.h | 2 +- rtengine/improccoordinator.h | 1 - rtengine/panasonic_decoders.cc | 2 +- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/rtengine/cJSON.c b/rtengine/cJSON.c index fb8ce27e8..130c8e2a5 100644 --- a/rtengine/cJSON.c +++ b/rtengine/cJSON.c @@ -445,9 +445,7 @@ static unsigned char* ensure(printbuffer * const p, size_t needed) p->buffer = NULL; return NULL; - } - if (newbuffer) - { + } else { memcpy(newbuffer, p->buffer, p->offset + 1); } p->hooks.deallocate(p->buffer); @@ -1436,7 +1434,7 @@ fail: static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) { unsigned char *output_pointer = NULL; - size_t length = 0; + size_t length; cJSON *current_element = item->child; if (output_buffer == NULL) diff --git a/rtengine/ciecam02.cc b/rtengine/ciecam02.cc index 8314e5e8f..c7e49b2ed 100644 --- a/rtengine/ciecam02.cc +++ b/rtengine/ciecam02.cc @@ -404,7 +404,7 @@ void Ciecam02::calculate_abfloat ( vfloat &aa, vfloat &bb, vfloat h, vfloat e, v #endif void Ciecam02::initcam1float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, - float &cz, float &aw, float &wh, float &pfl, float &fl, float &c) + float &cz, float &aw, float &wh, float &pfl, float &fl, float c) { n = yb / yw; diff --git a/rtengine/ciecam02.h b/rtengine/ciecam02.h index 8b532fba0..75ccfaa8c 100644 --- a/rtengine/ciecam02.h +++ b/rtengine/ciecam02.h @@ -84,7 +84,7 @@ public: * Forward transform from XYZ to CIECAM02 JCh. */ static void initcam1float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, - float &cz, float &aw, float &wh, float &pfl, float &fl, float &c); + float &cz, float &aw, float &wh, float &pfl, float &fl, float c); static void initcam2float (float yb, float pilotd, float f, float la, float xw, float yw, float zw, float &n, float &d, float &nbb, float &ncb, float &cz, float &aw, float &fl); diff --git a/rtengine/improccoordinator.h b/rtengine/improccoordinator.h index c27cfe76e..96d1f80ce 100644 --- a/rtengine/improccoordinator.h +++ b/rtengine/improccoordinator.h @@ -186,7 +186,6 @@ protected: MyMutex minit; // to gain mutually exclusive access to ... to what exactly? - void progress (Glib::ustring str, int pr); void reallocAll (); void updateLRGBHistograms (); void setScale (int prevscale); diff --git a/rtengine/panasonic_decoders.cc b/rtengine/panasonic_decoders.cc index 37f586a6b..bbbfb7c20 100644 --- a/rtengine/panasonic_decoders.cc +++ b/rtengine/panasonic_decoders.cc @@ -64,7 +64,7 @@ class pana_cs6_page_decoder unsigned char current, *buffer; public: pana_cs6_page_decoder(unsigned char *_buffer, unsigned int bsize) - : lastoffset(0), maxoffset(bsize), current(0), buffer(_buffer) + : pixelbuffer{}, lastoffset(0), maxoffset(bsize), current(0), buffer(_buffer) { } void read_page(); // will throw IO error if not enough space in buffer