aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/libgamma-method.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;
}