summaryrefslogtreecommitdiff
path: root/items.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2014-04-28 00:13:02 -0700
committerdormando <dormando@rydia.net>2016-06-23 21:35:38 -0700
commit181ef834151a37587faf2ee59079af1b8cf610af (patch)
treed98650b46db4f943198b7edb5a792d49833c03d8 /items.c
parenta1d04fbafc575ed711b5b2a399bb76a3be4b52c0 (diff)
downloadmemcached-181ef834151a37587faf2ee59079af1b8cf610af.tar.gz
treat and print item flags as unsigned int
most of the code would parse and handle flags as unsigned int, but passed into alloc functions as a signed int... which would then continue to print it as unsigned up until a change made in 2007. Now treat it fully as unsigned and print as unsigned.
Diffstat (limited to 'items.c')
-rw-r--r--items.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/items.c b/items.c
index 0984f16..97e0ac7 100644
--- a/items.c
+++ b/items.c
@@ -144,14 +144,14 @@ static unsigned int noexp_lru_size(int slabs_clsid) {
*
* Returns the total size of the header.
*/
-static size_t item_make_header(const uint8_t nkey, const int flags, const int nbytes,
+static size_t item_make_header(const uint8_t nkey, const unsigned int flags, const int nbytes,
char *suffix, uint8_t *nsuffix) {
/* suffix is defined at 40 chars elsewhere.. */
- *nsuffix = (uint8_t) snprintf(suffix, 40, " %d %d\r\n", flags, nbytes - 2);
+ *nsuffix = (uint8_t) snprintf(suffix, 40, " %u %d\r\n", flags, nbytes - 2);
return sizeof(item) + nkey + *nsuffix + nbytes;
}
-item *do_item_alloc(char *key, const size_t nkey, const int flags,
+item *do_item_alloc(char *key, const size_t nkey, const unsigned int flags,
const rel_time_t exptime, const int nbytes,
const uint32_t cur_hv) {
int i;