Skip to content

Commit 0a97164

Browse files
change int32_t to int
1 parent f22e658 commit 0a97164

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

cmd_in_second.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ typedef struct cmd_in_second_log {
2727

2828
typedef struct cmd_in_second_buffer {
2929
logtype* ring;
30-
int32_t front;
31-
int32_t rear;
32-
int32_t capacity;
30+
int front;
31+
int rear;
32+
int capacity;
3333
} buffertype;
3434

3535
typedef struct cmd_in_second_timer {
3636
struct timeval* ring;
37-
int32_t front;
38-
int32_t rear;
39-
int32_t capacity;
40-
int32_t last_elem_idx;
41-
int32_t circular_counter;
37+
int front;
38+
int rear;
39+
int capacity;
40+
int last_elem_idx;
41+
int circular_counter;
4242
} timertype;
4343

4444
typedef struct cmd_in_second_flush_thread {
@@ -54,8 +54,8 @@ struct cmd_in_second {
5454
char cmd_str[50];
5555
struct cmd_in_second_buffer buffer;
5656
timertype timer;
57-
int32_t bulk_limit;
58-
int32_t log_per_timer;
57+
int bulk_limit;
58+
int log_per_timer;
5959
state cur_state;
6060
flush_thread flusher;
6161
pthread_mutex_t lock;
@@ -123,7 +123,7 @@ static void wake_flusher_up(){
123123

124124
static void* flush_buffer()
125125
{
126-
const int32_t fd = open("cmd_in_second.log", O_CREAT | O_WRONLY | O_TRUNC, 0644);
126+
const int fd = open("cmd_in_second.log", O_CREAT | O_WRONLY | O_TRUNC, 0644);
127127

128128
while(1) {
129129
if (fd < 0) {
@@ -147,10 +147,10 @@ static void* flush_buffer()
147147
}
148148

149149
const size_t cmd_len = strlen(this.cmd_str);
150-
const int32_t whitespaces = 3;
150+
const int whitespaces = 3;
151151

152152
size_t expected_write_length = 0;
153-
int32_t circular_log_counter = 0;
153+
int circular_log_counter = 0;
154154

155155
while (!buffer_empty()) {
156156

@@ -173,7 +173,7 @@ static void* flush_buffer()
173173
}
174174

175175
sprintf(time_str, "%04d-%02d-%02d %02d:%02d:%02d.%06d\n", lt ->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday,
176-
lt->tm_hour, lt->tm_min, lt->tm_sec, (int32_t)front_time->tv_usec);
176+
lt->tm_hour, lt->tm_min, lt->tm_sec, (int)front_time->tv_usec);
177177
expected_write_length += 27;
178178
}
179179

@@ -326,7 +326,7 @@ int cmd_in_second_start(const int operation, const char cmd_str[], const int bul
326326

327327
this.operation = operation;
328328
this.bulk_limit = bulk_limit;
329-
snprintf(this.cmd_str, CMD_STR_LEN, cmd_str);
329+
snprintf(this.cmd_str, CMD_STR_LEN, "%s", cmd_str);
330330

331331
this.buffer.capacity = bulk_limit+1;
332332
this.buffer.ring = (logtype*)malloc(this.buffer.capacity * sizeof(logtype));

include/memcached/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct iovec {
3838
#define SUPPORT_BOP_SMGET
3939
#define JHPARK_OLD_SMGET_INTERFACE
4040
#define MAX_EFLAG_COMPARE_COUNT 100
41-
#define CMD_IN_SECOND 1
41+
#define CMD_IN_SECOND
4242

4343
#ifdef __cplusplus
4444
extern "C" {

memcached.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11686,7 +11686,7 @@ static void process_bop_arithmetic(conn *c, char *key, size_t nkey, bkey_range *
1168611686
}
1168711687
} else {
1168811688
cmd_in_second_write(OPERATION_BOP_DECR, key, c->client_ip);
11689-
11689+
1169011690
if (settings.detail_enabled) {
1169111691
stats_prefix_record_bop_decr(key, nkey, (ret==ENGINE_SUCCESS || ret==ENGINE_ELEM_ENOENT));
1169211692
}

0 commit comments

Comments
 (0)