* @param dta the data to store with the key
* @param dtalen the length of the data to store with the key
* @param flags the flags to store along with the key
- * @param exp the expiry time for the key
+ * @param exptime the expiry time for the key
*/
static void storage_command(command *cmd,
uint8_t cc,
const void* dta,
size_t dtalen,
uint32_t flags,
- uint32_t exp)
+ uint32_t exptime)
{
/* all of the storage commands use the same command layout */
protocol_binary_request_set *request= &cmd->set;
request->message.header.request.bodylen= (uint32_t)(keylen + 8 + dtalen);
request->message.header.request.opaque= 0xdeadbeef;
request->message.body.flags= flags;
- request->message.body.expiration= exp;
+ request->message.body.expiration= exptime;
off_t key_offset= sizeof (protocol_binary_request_no_extras) + 8;
memcpy(cmd->bytes + key_offset, key, keylen);
* @param keylen the number of bytes in the key
* @param delta the number to add/subtract
* @param initial the initial value if the key doesn't exist
- * @param exp when the key should expire if it isn't set
+ * @param exptime when the key should expire if it isn't set
*/
static void arithmetic_command(command *cmd,
uint8_t cc,
size_t keylen,
uint64_t delta,
uint64_t initial,
- uint32_t exp)
+ uint32_t exptime)
{
memset(cmd, 0, sizeof (cmd->incr));
cmd->incr.message.header.request.magic= PROTOCOL_BINARY_REQ;
cmd->incr.message.header.request.opaque= 0xdeadbeef;
cmd->incr.message.body.delta= htonll(delta);
cmd->incr.message.body.initial= htonll(initial);
- cmd->incr.message.body.expiration= htonl(exp);
+ cmd->incr.message.body.expiration= htonl(exptime);
off_t key_offset= sizeof (protocol_binary_request_no_extras) + 20;
memcpy(cmd->bytes + key_offset, key, keylen);
static int ms_check_para(void);
static void ms_statistic_init(void);
static void ms_stats_init(void);
-static void ms_print_statistics(int time);
+static void ms_print_statistics(int in_time);
static void ms_print_memslap_stats(struct timeval *start_time,
struct timeval *end_time);
static void ms_monitor_slap_mode(void);
* that otherwise mess things up.
*/
memset(&hints, 0, sizeof(hints));
+#ifdef AI_ADDRCONFIG
hints.ai_flags= AI_PASSIVE | AI_ADDRCONFIG;
+#else
++ hints.ai_flags= AI_PASSIVE;
+#endif /* AI_ADDRCONFIG */
if (is_udp)
{
hints.ai_protocol= IPPROTO_UDP;
#include "byteorder.h"
/* Byte swap a 64-bit number. */
+#ifndef swap64
static inline uint64_t swap64(uint64_t in)
{
#ifndef WORDS_BIGENDIAN
/* Little endian, flip the bytes around until someone makes a faster/better
* way to do this. */
uint64_t rv= 0;
- uint8_t x= 0;
- for(x= 0; x < 8; x++)
+ for (uint8_t x= 0; x < 8; x++)
{
rv= (rv << 8) | (in & 0xff);
in >>= 8;
#else
/* big-endian machines don't need byte swapping */
return in;
-#endif
+#endif // WORDS_BIGENDIAN
}
+#endif
uint64_t ntohll(uint64_t value)
{