Compiled with -Werror -Wall -O3 and -Wconversion flags
This commit is contained in:
12
src/cmph.c
12
src/cmph.c
@@ -75,7 +75,7 @@ static int key_nlfile_read(void *data, char **key, cmph_uint32 *keylen)
|
||||
(*key)[(*keylen) - 1] = 0;
|
||||
--(*keylen);
|
||||
}
|
||||
return *keylen;
|
||||
return (int)(*keylen);
|
||||
}
|
||||
|
||||
static int key_byte_vector_read(void *data, char **key, cmph_uint32 *keylen)
|
||||
@@ -88,7 +88,7 @@ static int key_byte_vector_read(void *data, char **key, cmph_uint32 *keylen)
|
||||
*key = (char *)malloc(size);
|
||||
memcpy(*key, keys_vd[cmph_vector->position] + sizeof(*keylen), size);
|
||||
cmph_vector->position = cmph_vector->position + 1;
|
||||
return *keylen;
|
||||
return (int)(*keylen);
|
||||
|
||||
}
|
||||
|
||||
@@ -101,8 +101,8 @@ static int key_struct_vector_read(void *data, char **key, cmph_uint32 *keylen)
|
||||
size = *keylen;
|
||||
*key = (char *)malloc(size);
|
||||
memcpy(*key, (keys_vd + (cmph_struct_vector->position * cmph_struct_vector->struct_size) + cmph_struct_vector->key_offset), size);
|
||||
cmph_struct_vector->position = cmph_struct_vector->position + 1;
|
||||
return *keylen;
|
||||
cmph_struct_vector->position = cmph_struct_vector->position + 1;
|
||||
return (int)(*keylen);
|
||||
}
|
||||
|
||||
static int key_vector_read(void *data, char **key, cmph_uint32 *keylen)
|
||||
@@ -110,12 +110,12 @@ static int key_vector_read(void *data, char **key, cmph_uint32 *keylen)
|
||||
cmph_vector_t *cmph_vector = (cmph_vector_t *)data;
|
||||
char **keys_vd = (char **)cmph_vector->vector;
|
||||
size_t size;
|
||||
*keylen = strlen(keys_vd[cmph_vector->position]);
|
||||
*keylen = (cmph_uint32)strlen(keys_vd[cmph_vector->position]);
|
||||
size = *keylen;
|
||||
*key = (char *)malloc(size + 1);
|
||||
strcpy(*key, keys_vd[cmph_vector->position]);
|
||||
cmph_vector->position = cmph_vector->position + 1;
|
||||
return *keylen;
|
||||
return (int)(*keylen);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user