summaryrefslogtreecommitdiff
path: root/src/proplist.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-08-14 19:09:33 +0200
committerLennart Poettering <lennart@poettering.net>2008-08-14 19:09:33 +0200
commitf059c857b202a2428b1b4757de2d3d9f23fdf9a3 (patch)
tree7298fdb125cfbb1543616cd46b63442d50a3f4ba /src/proplist.c
parent876bbf8c2f3ea26e6553a431f5042cd9d2c99723 (diff)
enable a few additional gcc warnings and fix all problems found
Diffstat (limited to 'src/proplist.c')
-rw-r--r--src/proplist.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/proplist.c b/src/proplist.c
index 15c6993..4488c57 100644
--- a/src/proplist.c
+++ b/src/proplist.c
@@ -33,7 +33,7 @@ static unsigned calc_hash(const char *c) {
unsigned hash = 0;
for (; *c; c++)
- hash = 31 * hash + *c;
+ hash = 31 * hash + (unsigned) *c;
return hash;
}
@@ -134,7 +134,7 @@ int ca_proplist_setf(ca_proplist *p, const char *key, const char *format, ...) {
int ret;
char *k;
ca_prop *prop;
- int size = 100;
+ size_t size = 100;
unsigned h;
ca_return_val_if_fail(p, CA_ERROR_INVALID);
@@ -160,13 +160,13 @@ int ca_proplist_setf(ca_proplist *p, const char *key, const char *format, ...) {
((char*) CA_PROP_DATA(prop))[size-1] = 0;
- if (r > -1 && r < size) {
- prop->nbytes = r+1;
+ if (r > -1 && (size_t) r < size) {
+ prop->nbytes = (size_t) r+1;
break;
}
if (r > -1) /* glibc 2.1 */
- size = r+1;
+ size = (size_t) r+1;
else /* glibc 2.0 */
size *= 2;
@@ -359,8 +359,8 @@ int ca_proplist_merge(ca_proplist **_a, ca_proplist *b, ca_proplist *c) {
ca_bool_t ca_proplist_contains(ca_proplist *p, const char *key) {
ca_bool_t b;
- ca_return_val_if_fail(p, CA_ERROR_INVALID);
- ca_return_val_if_fail(key, CA_ERROR_INVALID);
+ ca_return_val_if_fail(p, FALSE);
+ ca_return_val_if_fail(key, FALSE);
ca_mutex_lock(p->mutex);
b = !!ca_proplist_get_unlocked(p, key);