aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/libgamma-method.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-06-01 02:00:16 +0200
committerMattias Andrée <maandree@operamail.com>2014-06-01 02:00:16 +0200
commitcba9a65ed4157417b84f2d3e9b912f315a45c584 (patch)
tree4ad75a9d1f4f5bd0aff86a4d13726ef76fb4c7fe /src/lib/libgamma-method.c
parentwhitespace (diff)
downloadlibgamma-cba9a65ed4157417b84f2d3e9b912f315a45c584.tar.gz
libgamma-cba9a65ed4157417b84f2d3e9b912f315a45c584.tar.bz2
libgamma-cba9a65ed4157417b84f2d3e9b912f315a45c584.tar.xz
m + doc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/lib/libgamma-method.c')
-rw-r--r--src/lib/libgamma-method.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libgamma-method.c b/src/lib/libgamma-method.c
index 4c81549..f9fa7a3 100644
--- a/src/lib/libgamma-method.c
+++ b/src/lib/libgamma-method.c
@@ -40,7 +40,7 @@ int libgamma_gamma_ramps_initialise(libgamma_gamma_ramps_t* restrict this)
this->red = malloc(n * sizeof(uint16_t));
this->green = this-> red + this-> red_size;
this->blue = this->green + this->green_size;
- return this->red ? 0 : -1;
+ return this->red == NULL ? -1 : 0;
}
@@ -89,7 +89,7 @@ int libgamma_gamma_ramps32_initialise(libgamma_gamma_ramps32_t* restrict this)
this->red = malloc(n * sizeof(uint32_t));
this->green = this-> red + this-> red_size;
this->blue = this->green + this->green_size;
- return this->red ? 0 : -1;
+ return this->red == NULL ? -1 : 0;
}
@@ -138,7 +138,7 @@ int libgamma_gamma_ramps64_initialise(libgamma_gamma_ramps64_t* restrict this)
this->red = malloc(n * sizeof(uint64_t));
this->green = this-> red + this-> red_size;
this->blue = this->green + this->green_size;
- return this->red ? 0 : -1;
+ return this->red == NULL ? -1 : 0;
}
@@ -187,7 +187,7 @@ int libgamma_gamma_rampsf_initialise(libgamma_gamma_rampsf_t* restrict this)
this->red = malloc(n * sizeof(float));
this->green = this-> red + this-> red_size;
this->blue = this->green + this->green_size;
- return this->red ? 0 : -1;
+ return this->red == NULL ? -1 : 0;
}