Some code cleanups

This commit is contained in:
Ingo Weyrich
2019-11-21 21:36:57 +01:00
parent 89d8c341a6
commit 7b54c7f2a4
5 changed files with 5 additions and 8 deletions

View File

@@ -445,9 +445,7 @@ static unsigned char* ensure(printbuffer * const p, size_t needed)
p->buffer = NULL; p->buffer = NULL;
return NULL; return NULL;
} } else {
if (newbuffer)
{
memcpy(newbuffer, p->buffer, p->offset + 1); memcpy(newbuffer, p->buffer, p->offset + 1);
} }
p->hooks.deallocate(p->buffer); p->hooks.deallocate(p->buffer);
@@ -1436,7 +1434,7 @@ fail:
static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer)
{ {
unsigned char *output_pointer = NULL; unsigned char *output_pointer = NULL;
size_t length = 0; size_t length;
cJSON *current_element = item->child; cJSON *current_element = item->child;
if (output_buffer == NULL) if (output_buffer == NULL)

View File

@@ -404,7 +404,7 @@ void Ciecam02::calculate_abfloat ( vfloat &aa, vfloat &bb, vfloat h, vfloat e, v
#endif #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, 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; n = yb / yw;

View File

@@ -84,7 +84,7 @@ public:
* Forward transform from XYZ to CIECAM02 JCh. * 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, 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, 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); float &cz, float &aw, float &fl);

View File

@@ -186,7 +186,6 @@ protected:
MyMutex minit; // to gain mutually exclusive access to ... to what exactly? MyMutex minit; // to gain mutually exclusive access to ... to what exactly?
void progress (Glib::ustring str, int pr);
void reallocAll (); void reallocAll ();
void updateLRGBHistograms (); void updateLRGBHistograms ();
void setScale (int prevscale); void setScale (int prevscale);

View File

@@ -64,7 +64,7 @@ class pana_cs6_page_decoder
unsigned char current, *buffer; unsigned char current, *buffer;
public: public:
pana_cs6_page_decoder(unsigned char *_buffer, unsigned int bsize) 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 void read_page(); // will throw IO error if not enough space in buffer