Commit a2cf4eae authored by Yoni Fogel's avatar Yoni Fogel

Minor modifications to remove some warnings.

git-svn-id: file:///svn/tokudb@2032 c7de825b-a66e-492c-adef-691d508d4ae1
parent 90d4f3a8
......@@ -8,7 +8,7 @@
// zlib crc32 has a bug: If len==0 then it should return oldcrc32, but crc32 returns 0.
static inline u_int32_t toku_crc32 (u_int32_t oldcrc32, const void *data, u_int32_t len) {
if (len==0) return oldcrc32;
else return crc32(oldcrc32, data, len);
else return crc32((unsigned long)oldcrc32, data, len);
}
static const u_int32_t toku_null_crc = 0;
......
......@@ -23,9 +23,9 @@ static inline int kv_pair_size(struct kv_pair *pair) {
static inline void kv_pair_init(struct kv_pair *pair, const void *key, unsigned int keylen, const void *val, unsigned int vallen) {
pair->keylen = keylen;
memcpy(pair->key, key, keylen);
memcpy(pair->key, key, (size_t)keylen);
pair->vallen = vallen;
memcpy(pair->key + keylen, val, vallen);
memcpy(pair->key + keylen, val, (size_t)vallen);
}
static inline struct kv_pair *kv_pair_malloc(const void *key, unsigned int keylen, const void *val, unsigned int vallen) {
......@@ -40,7 +40,7 @@ static inline struct kv_pair *kv_pair_realloc_same_key(struct kv_pair *p, void *
struct kv_pair *pair = toku_realloc(p, sizeof (struct kv_pair) + p->keylen + newvallen);
if (pair) {
pair->vallen = newvallen;
memcpy(pair->key + pair->keylen, newval, newvallen);
memcpy(pair->key + pair->keylen, newval, (size_t)newvallen);
}
return pair;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment