summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorlinbaiye <linbaiye@gmail.com>2012-09-21 16:50:34 +0800
committerAnand Avati <avati@redhat.com>2012-10-01 16:23:10 -0700
commit5b896df0543e484b4de4de0a6ffa1053c5f92273 (patch)
tree3f504e0d7337185b871c62e40e1c72dfa6151abc /libglusterfs
parentc2c7db16704a1da97ffe2e411c8014c856231a2a (diff)
Fix problems of mismatch type.
Checking if an uint32_t is less than zero is unnecessary, so we change the parameter and return value to int. Change-Id: I5c08eaf8fd4c33768a366b22f0f5db9575056a1e BUG: 789278 Signed-off-by: linbaiye <linbaiye@gmail.com> Reviewed-on: http://review.gluster.org/3965 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.c6
-rw-r--r--libglusterfs/src/common-utils.h5
2 files changed, 6 insertions, 5 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index cf5991e1084..791ecefe62b 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -1925,9 +1925,9 @@ out:
*/
inline int32_t
-gf_roundup_power_of_two (uint32_t nr)
+gf_roundup_power_of_two (int32_t nr)
{
- uint32_t result = 1;
+ int32_t result = 1;
if (nr < 0) {
gf_log ("common-utils", GF_LOG_WARNING,
@@ -1949,7 +1949,7 @@ out:
*/
inline int32_t
-gf_roundup_next_power_of_two (uint32_t nr)
+gf_roundup_next_power_of_two (int32_t nr)
{
int32_t result = 1;
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 5968cd0608d..56483984dc3 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -112,6 +112,7 @@ void gf_print_trace (int32_t signal, glusterfs_ctx_t *ctx);
#define VECTORSIZE(count) (count * (sizeof (struct iovec)))
#define STRLEN_0(str) (strlen(str) + 1)
+
#define VALIDATE_OR_GOTO(arg,label) do { \
if (!arg) { \
errno = EINVAL; \
@@ -463,14 +464,14 @@ mkdir_p (char *path, mode_t mode, gf_boolean_t allow_symlinks);
* nr
*/
-int32_t gf_roundup_power_of_two (uint32_t nr);
+int32_t gf_roundup_power_of_two (int32_t nr);
/*
* rounds up nr to next power of two. If nr is already a power of two, next
* power of two is returned.
*/
-int32_t gf_roundup_next_power_of_two (uint32_t nr);
+int32_t gf_roundup_next_power_of_two (int32_t nr);
char *gf_trim (char *string);
int gf_strsplit (const char *str, const char *delim,