From cf55d98142850ef5fdc0a3ecd2c771bf0f45f3f8 Mon Sep 17 00:00:00 2001 From: yuqing Date: Tue, 5 Aug 2014 15:52:17 +0800 Subject: [PATCH] replace INT64_PRINTF_FORMAT with PRId64 --- src/fast_task_queue.c | 3 ++- src/hash.c | 5 +++-- src/shared_func.c | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/fast_task_queue.c b/src/fast_task_queue.c index b55bc46..2319fc3 100644 --- a/src/fast_task_queue.c +++ b/src/fast_task_queue.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "fast_task_queue.h" #include "logger.h" #include "shared_func.h" @@ -195,7 +196,7 @@ int free_queue_init(const int max_connections, const int min_buff_size, \ logDebug("file: "__FILE__", line: %d, " \ "max_connections: %d, min_buff_size: %d, max_buff_size: %d, " \ "block_size: %d, arg_size: %d, max_data_size: %d, " \ - "total_size: "INT64_PRINTF_FORMAT, __LINE__, \ + "total_size: %"PRId64, __LINE__, \ max_connections, aligned_min_size, aligned_max_size, \ block_size, aligned_arg_size, (int)max_data_size, total_size); diff --git a/src/hash.c b/src/hash.c index b8a49d5..47a0af9 100644 --- a/src/hash.c +++ b/src/hash.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "pthread_func.h" #include "hash.h" @@ -757,12 +758,12 @@ int64_t hash_inc_value(const HashData *old_data, const int inc, { n = inc; } - *new_value_len = sprintf(new_value, INT64_PRINTF_FORMAT, n); + *new_value_len = sprintf(new_value, "%"PRId64, n); } else { n = inc; - *new_value_len = sprintf(new_value, INT64_PRINTF_FORMAT, n); + *new_value_len = sprintf(new_value, "%"PRId64, n); } return n; diff --git a/src/shared_func.c b/src/shared_func.c index 8ed40d9..814e346 100644 --- a/src/shared_func.c +++ b/src/shared_func.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -1024,7 +1025,7 @@ int getFileContentEx(const char *filename, char *buff, \ if (*size <= 0) { logError("file: "__FILE__", line: %d, " \ - "invalid size: "INT64_PRINTF_FORMAT, \ + "invalid size: %"PRId64, \ __LINE__, *size); return EINVAL; } @@ -1770,8 +1771,7 @@ int parse_bytes(char *pStr, const int default_unit_bytes, int64_t *bytes) if (*bytes < 0) { logError("file: "__FILE__", line: %d, " \ - "bytes: "INT64_PRINTF_FORMAT" < 0", \ - __LINE__, *bytes); + "bytes: %"PRId64" < 0", __LINE__, *bytes); return EINVAL; }