use PRId64 instead of INT64_PRINTF_FORMAT

pull/48/head
yuqing 2014-08-09 11:36:57 +08:00
parent bb4a0730c7
commit fd38a009da
35 changed files with 384 additions and 383 deletions

View File

@ -266,7 +266,7 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
printf("file crc32=%u\n", file_info.crc32); printf("file crc32=%u\n", file_info.crc32);
printf("file url: %s\n", file_url); printf("file url: %s\n", file_url);
@ -288,13 +288,13 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
printf("file crc32=%u\n", file_info.crc32); printf("file crc32=%u\n", file_info.crc32);
printf("file url: %s\n", file_url); printf("file url: %s\n", file_url);
if (file_info.file_size != file_size / 2) if (file_info.file_size != file_size / 2)
{ {
fprintf(stderr, "file size: "INT64_PRINTF_FORMAT \ fprintf(stderr, "file size: %"PRId64 \
" != "INT64_PRINTF_FORMAT"!!!", file_info.file_size, file_size / 2); " != %"PRId64"!!!", file_info.file_size, file_size / 2);
} }
//sleep(100); //sleep(100);
@ -354,11 +354,11 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
if (file_info.file_size != file_size + file_size / 2) if (file_info.file_size != file_size + file_size / 2)
{ {
fprintf(stderr, "file size: "INT64_PRINTF_FORMAT \ fprintf(stderr, "file size: %"PRId64 \
" != "INT64_PRINTF_FORMAT"!!!", file_info.file_size, \ " != %"PRId64"!!!", file_info.file_size, \
file_size + file_size / 2); file_size + file_size / 2);
} }
@ -421,11 +421,11 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
if (file_info.file_size != 2 * file_size + file_size / 2) if (file_info.file_size != 2 * file_size + file_size / 2)
{ {
fprintf(stderr, "file size: "INT64_PRINTF_FORMAT \ fprintf(stderr, "file size: %"PRId64 \
" != "INT64_PRINTF_FORMAT"!!!", file_info.file_size, \ " != %"PRId64"!!!", file_info.file_size, \
2 * file_size + file_size /2); 2 * file_size + file_size /2);
} }

View File

@ -262,7 +262,7 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
printf("file crc32=%u\n", file_info.crc32); printf("file crc32=%u\n", file_info.crc32);
printf("file url: %s\n", file_url); printf("file url: %s\n", file_url);
@ -284,12 +284,12 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
printf("file crc32=%u\n", file_info.crc32); printf("file crc32=%u\n", file_info.crc32);
printf("file url: %s\n", file_url); printf("file url: %s\n", file_url);
if (file_info.file_size != 0) if (file_info.file_size != 0)
{ {
fprintf(stderr, "file size: "INT64_PRINTF_FORMAT \ fprintf(stderr, "file size: %"PRId64 \
" != 0!!!", file_info.file_size); " != 0!!!", file_info.file_size);
} }
@ -350,11 +350,11 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
if (file_info.file_size != file_size) if (file_info.file_size != file_size)
{ {
fprintf(stderr, "file size: "INT64_PRINTF_FORMAT \ fprintf(stderr, "file size: %"PRId64 \
" != "INT64_PRINTF_FORMAT"!!!", file_info.file_size, \ " != %"PRId64"!!!", file_info.file_size, \
file_size); file_size);
} }
@ -417,11 +417,11 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
if (file_info.file_size != 2 * file_size) if (file_info.file_size != 2 * file_size)
{ {
fprintf(stderr, "file size: "INT64_PRINTF_FORMAT \ fprintf(stderr, "file size: %"PRId64 \
" != "INT64_PRINTF_FORMAT"!!!", file_info.file_size, \ " != %"PRId64"!!!", file_info.file_size, \
2 * file_size); 2 * file_size);
} }

View File

@ -57,7 +57,7 @@ int main(int argc, char *argv[])
printf("file create timestamp: %s\n", formatDatetime( printf("file create timestamp: %s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size: "INT64_PRINTF_FORMAT"\n", \ printf("file size: %"PRId64"\n", \
file_info.file_size); file_info.file_size);
printf("file crc32: %u (0x%08X)\n", \ printf("file crc32: %u (0x%08X)\n", \
file_info.crc32, file_info.crc32); file_info.crc32, file_info.crc32);

View File

@ -265,9 +265,9 @@ static int list_storages(FDFSGroupStat *pGroupStat)
int max_last_source_update; int max_last_source_update;
printf( "group name = %s\n" \ printf( "group name = %s\n" \
"disk total space = "INT64_PRINTF_FORMAT" MB\n" \ "disk total space = %"PRId64" MB\n" \
"disk free space = "INT64_PRINTF_FORMAT" MB\n" \ "disk free space = %"PRId64" MB\n" \
"trunk free space = "INT64_PRINTF_FORMAT" MB\n" \ "trunk free space = %"PRId64" MB\n" \
"storage server count = %d\n" \ "storage server count = %d\n" \
"active server count = %d\n" \ "active server count = %d\n" \
"storage server port = %d\n" \ "storage server port = %d\n" \
@ -407,44 +407,44 @@ static int list_storages(FDFSGroupStat *pGroupStat)
"\t\tcurrent_write_path = %d\n" \ "\t\tcurrent_write_path = %d\n" \
"\t\tsource storage id= %s\n" \ "\t\tsource storage id= %s\n" \
"\t\tif_trunk_server= %d\n" \ "\t\tif_trunk_server= %d\n" \
"\t\ttotal_upload_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_upload_count = %"PRId64"\n" \
"\t\tsuccess_upload_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_upload_count = %"PRId64"\n" \
"\t\ttotal_append_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_append_count = %"PRId64"\n" \
"\t\tsuccess_append_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_append_count = %"PRId64"\n" \
"\t\ttotal_modify_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_modify_count = %"PRId64"\n" \
"\t\tsuccess_modify_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_modify_count = %"PRId64"\n" \
"\t\ttotal_truncate_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_truncate_count = %"PRId64"\n" \
"\t\tsuccess_truncate_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_truncate_count = %"PRId64"\n" \
"\t\ttotal_set_meta_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_set_meta_count = %"PRId64"\n" \
"\t\tsuccess_set_meta_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_set_meta_count = %"PRId64"\n" \
"\t\ttotal_delete_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_delete_count = %"PRId64"\n" \
"\t\tsuccess_delete_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_delete_count = %"PRId64"\n" \
"\t\ttotal_download_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_download_count = %"PRId64"\n" \
"\t\tsuccess_download_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_download_count = %"PRId64"\n" \
"\t\ttotal_get_meta_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_get_meta_count = %"PRId64"\n" \
"\t\tsuccess_get_meta_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_get_meta_count = %"PRId64"\n" \
"\t\ttotal_create_link_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_create_link_count = %"PRId64"\n" \
"\t\tsuccess_create_link_count = "INT64_PRINTF_FORMAT"\n"\ "\t\tsuccess_create_link_count = %"PRId64"\n"\
"\t\ttotal_delete_link_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_delete_link_count = %"PRId64"\n" \
"\t\tsuccess_delete_link_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_delete_link_count = %"PRId64"\n" \
"\t\ttotal_upload_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_upload_bytes = %"PRId64"\n" \
"\t\tsuccess_upload_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_upload_bytes = %"PRId64"\n" \
"\t\ttotal_append_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_append_bytes = %"PRId64"\n" \
"\t\tsuccess_append_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_append_bytes = %"PRId64"\n" \
"\t\ttotal_modify_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_modify_bytes = %"PRId64"\n" \
"\t\tsuccess_modify_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_modify_bytes = %"PRId64"\n" \
"\t\tstotal_download_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\tstotal_download_bytes = %"PRId64"\n" \
"\t\tsuccess_download_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_download_bytes = %"PRId64"\n" \
"\t\ttotal_sync_in_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_sync_in_bytes = %"PRId64"\n" \
"\t\tsuccess_sync_in_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_sync_in_bytes = %"PRId64"\n" \
"\t\ttotal_sync_out_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_sync_out_bytes = %"PRId64"\n" \
"\t\tsuccess_sync_out_bytes = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_sync_out_bytes = %"PRId64"\n" \
"\t\ttotal_file_open_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_file_open_count = %"PRId64"\n" \
"\t\tsuccess_file_open_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_file_open_count = %"PRId64"\n" \
"\t\ttotal_file_read_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_file_read_count = %"PRId64"\n" \
"\t\tsuccess_file_read_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_file_read_count = %"PRId64"\n" \
"\t\ttotal_file_write_count = "INT64_PRINTF_FORMAT"\n" \ "\t\ttotal_file_write_count = %"PRId64"\n" \
"\t\tsuccess_file_write_count = "INT64_PRINTF_FORMAT"\n" \ "\t\tsuccess_file_write_count = %"PRId64"\n" \
"\t\tlast_heart_beat_time = %s\n" \ "\t\tlast_heart_beat_time = %s\n" \
"\t\tlast_source_update = %s\n" \ "\t\tlast_source_update = %s\n" \
"\t\tlast_sync_update = %s\n" \ "\t\tlast_sync_update = %s\n" \

View File

@ -303,7 +303,7 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
printf("file crc32=%u\n", file_info.crc32); printf("file crc32=%u\n", file_info.crc32);
printf("example file url: %s\n", file_url); printf("example file url: %s\n", file_url);
@ -396,7 +396,7 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
printf("file crc32=%u\n", file_info.crc32); printf("file crc32=%u\n", file_info.crc32);
printf("example file url: %s\n", file_url); printf("example file url: %s\n", file_url);
@ -561,7 +561,7 @@ int main(int argc, char *argv[])
if (result == 0) if (result == 0)
{ {
printf("download file success, " \ printf("download file success, " \
"file size="INT64_PRINTF_FORMAT", file save to %s\n", \ "file size=%"PRId64", file save to %s\n", \
file_size, local_filename); file_size, local_filename);
} }
else else

View File

@ -293,7 +293,7 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
printf("file crc32=%u\n", file_info.crc32); printf("file crc32=%u\n", file_info.crc32);
printf("example file url: %s\n", file_url); printf("example file url: %s\n", file_url);
@ -378,7 +378,7 @@ int main(int argc, char *argv[])
printf("file timestamp=%s\n", formatDatetime( printf("file timestamp=%s\n", formatDatetime(
file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \
szDatetime, sizeof(szDatetime))); szDatetime, sizeof(szDatetime)));
printf("file size="INT64_PRINTF_FORMAT"\n", file_info.file_size); printf("file size=%"PRId64"\n", file_info.file_size);
printf("file crc32=%u\n", file_info.crc32); printf("file crc32=%u\n", file_info.crc32);
printf("example file url: %s\n", file_url); printf("example file url: %s\n", file_url);
@ -528,7 +528,7 @@ int main(int argc, char *argv[])
if (result == 0) if (result == 0)
{ {
printf("download file success, " \ printf("download file success, " \
"file size="INT64_PRINTF_FORMAT", file save to %s\n", \ "file size=%"PRId64", file save to %s\n", \
file_size, local_filename); file_size, local_filename);
} }
else else

View File

@ -371,7 +371,7 @@ int storage_query_file_info_ex(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"recv data from storage server %s:%d fail, " \ "recv data from storage server %s:%d fail, " \
"recv bytes: "INT64_PRINTF_FORMAT" != %d", __LINE__, \ "recv bytes: %"PRId64" != %d", __LINE__, \
pStorageServer->ip_addr, pStorageServer->port, \ pStorageServer->ip_addr, pStorageServer->port, \
in_bytes, (int)sizeof(in_buff)); in_bytes, (int)sizeof(in_buff));
result = EINVAL; result = EINVAL;
@ -980,7 +980,7 @@ int storage_do_upload_file(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"storage server %s:%d response data " \ "storage server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"should > %d", __LINE__, \ "should > %d", __LINE__, \
pStorageServer->ip_addr, pStorageServer->port, \ pStorageServer->ip_addr, pStorageServer->port, \
in_bytes, FDFS_GROUP_NAME_MAX_LEN); in_bytes, FDFS_GROUP_NAME_MAX_LEN);
@ -1433,7 +1433,7 @@ int storage_client_create_link(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"storage server %s:%d response data " \ "storage server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"should > %d", __LINE__, \ "should > %d", __LINE__, \
pStorageServer->ip_addr, pStorageServer->port, \ pStorageServer->ip_addr, pStorageServer->port, \
in_bytes, FDFS_GROUP_NAME_MAX_LEN); in_bytes, FDFS_GROUP_NAME_MAX_LEN);
@ -1757,7 +1757,7 @@ int storage_do_append_file(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"storage server %s:%d response data " \ "storage server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"should == 0", __LINE__, pStorageServer->ip_addr, \ "should == 0", __LINE__, pStorageServer->ip_addr, \
pStorageServer->port, in_bytes); pStorageServer->port, in_bytes);
result = EINVAL; result = EINVAL;
@ -1885,7 +1885,7 @@ int storage_do_modify_file(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"storage server %s:%d response data " \ "storage server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"should == 0", __LINE__, pStorageServer->ip_addr, \ "should == 0", __LINE__, pStorageServer->ip_addr, \
pStorageServer->port, in_bytes); pStorageServer->port, in_bytes);
result = EINVAL; result = EINVAL;
@ -2297,7 +2297,7 @@ int storage_truncate_file(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"storage server %s:%d response data " \ "storage server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"should == 0", __LINE__, pStorageServer->ip_addr, \ "should == 0", __LINE__, pStorageServer->ip_addr, \
pStorageServer->port, in_bytes); pStorageServer->port, in_bytes);
result = EINVAL; result = EINVAL;

View File

@ -334,7 +334,7 @@ int tracker_list_servers(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid", \ "length: %"PRId64" is invalid", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
*storage_count = 0; *storage_count = 0;
@ -523,7 +523,7 @@ int tracker_list_one_group(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid", \ "length: %"PRId64" is invalid", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
return EINVAL; return EINVAL;
@ -598,7 +598,7 @@ int tracker_list_groups(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid", \ "length: %"PRId64" is invalid", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
*group_count = 0; *group_count = 0;
@ -708,7 +708,7 @@ int tracker_do_query_storage(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"expect length: %d", __LINE__, \ "expect length: %d", __LINE__, \
pTrackerServer->ip_addr, \ pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes, \ pTrackerServer->port, in_bytes, \
@ -787,7 +787,7 @@ int tracker_query_storage_list(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid", \ "length: %"PRId64" is invalid", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
return EINVAL; return EINVAL;
@ -879,7 +879,7 @@ int tracker_query_storage_store_without_group(ConnectionInfo *pTrackerServer,
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"expect length: %d", __LINE__, \ "expect length: %d", __LINE__, \
pTrackerServer->ip_addr, pTrackerServer->port, \ pTrackerServer->ip_addr, pTrackerServer->port, \
in_bytes, TRACKER_QUERY_STORAGE_STORE_BODY_LEN); in_bytes, TRACKER_QUERY_STORAGE_STORE_BODY_LEN);
@ -956,7 +956,7 @@ int tracker_query_storage_store_with_group(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"expect length: %d", __LINE__, \ "expect length: %d", __LINE__, \
pTrackerServer->ip_addr, pTrackerServer->port, \ pTrackerServer->ip_addr, pTrackerServer->port, \
in_bytes, TRACKER_QUERY_STORAGE_STORE_BODY_LEN); in_bytes, TRACKER_QUERY_STORAGE_STORE_BODY_LEN);
@ -1045,7 +1045,7 @@ int tracker_query_storage_store_list_with_group( \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"expect length >= %d", __LINE__, \ "expect length >= %d", __LINE__, \
pTrackerServer->ip_addr, pTrackerServer->port, \ pTrackerServer->ip_addr, pTrackerServer->port, \
in_bytes, TRACKER_QUERY_STORAGE_STORE_BODY_LEN); in_bytes, TRACKER_QUERY_STORAGE_STORE_BODY_LEN);
@ -1059,7 +1059,7 @@ int tracker_query_storage_store_list_with_group( \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid", \ "length: %"PRId64" is invalid", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
return EINVAL; return EINVAL;
@ -1382,7 +1382,7 @@ int tracker_get_storage_status(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid", \ "length: %"PRId64" is invalid", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
return EINVAL; return EINVAL;
@ -1463,7 +1463,7 @@ int tracker_get_storage_id(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid", \ "length: %"PRId64" is invalid", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
return EINVAL; return EINVAL;

View File

@ -28,6 +28,7 @@ typedef DWORD (WINAPI *ThreadEntranceFunc)(LPVOID lpThreadParameter);
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h> #include <stdbool.h>
#include <inttypes.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sys/types.h> #include <sys/types.h>

View File

@ -195,7 +195,7 @@ int free_queue_init(const int max_connections, const int min_buff_size, \
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"max_connections: %d, min_buff_size: %d, max_buff_size: %d, " \ "max_connections: %d, min_buff_size: %d, max_buff_size: %d, " \
"block_size: %d, arg_size: %d, max_data_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, \ max_connections, aligned_min_size, aligned_max_size, \
block_size, aligned_arg_size, (int)max_data_size, total_size); block_size, aligned_arg_size, (int)max_data_size, total_size);

View File

@ -757,12 +757,12 @@ int64_t hash_inc_value(const HashData *old_data, const int inc,
{ {
n = inc; n = inc;
} }
*new_value_len = sprintf(new_value, INT64_PRINTF_FORMAT, n); *new_value_len = sprintf(new_value, "%"PRId64, n);
} }
else else
{ {
n = inc; n = inc;
*new_value_len = sprintf(new_value, INT64_PRINTF_FORMAT, n); *new_value_len = sprintf(new_value, "%"PRId64, n);
} }
return n; return n;

View File

@ -1024,7 +1024,7 @@ int getFileContentEx(const char *filename, char *buff, \
if (*size <= 0) if (*size <= 0)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"invalid size: "INT64_PRINTF_FORMAT, \ "invalid size: %"PRId64, \
__LINE__, *size); __LINE__, *size);
return EINVAL; return EINVAL;
} }
@ -1770,7 +1770,7 @@ int parse_bytes(char *pStr, const int default_unit_bytes, int64_t *bytes)
if (*bytes < 0) if (*bytes < 0)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"bytes: "INT64_PRINTF_FORMAT" < 0", \ "bytes: %"PRId64" < 0", \
__LINE__, *bytes); __LINE__, *bytes);
return EINVAL; return EINVAL;
} }

View File

@ -546,7 +546,7 @@ static int php_fdfs_get_upload_callback_from_hash(HashTable *callback_hash, \
if (pUploadCallback->file_size < 0) if (pUploadCallback->file_size < 0)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"file_size: "INT64_PRINTF_FORMAT" is invalid!", \ "file_size: %"PRId64" is invalid!", \
__LINE__, pUploadCallback->file_size); __LINE__, pUploadCallback->file_size);
return EINVAL; return EINVAL;
} }

View File

@ -591,7 +591,7 @@ int dio_truncate_file(struct fast_task_info *pTask)
result = errno != 0 ? errno : EIO; result = errno != 0 ? errno : EIO;
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"truncate file: %s fail, fd=%d, " \ "truncate file: %s fail, fd=%d, " \
"remain_bytes="INT64_PRINTF_FORMAT", " \ "remain_bytes=%"PRId64", " \
"errno: %d, error info: %s", \ "errno: %d, error info: %s", \
__LINE__, pFileContext->filename, \ __LINE__, pFileContext->filename, \
pFileContext->fd, pFileContext->offset, \ pFileContext->fd, pFileContext->offset, \
@ -693,7 +693,7 @@ void dio_append_finish_clean_up(struct fast_task_info *pTask)
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"client ip: %s, append file fail, " \ "client ip: %s, append file fail, " \
"call ftruncate of file %s to size: "\ "call ftruncate of file %s to size: "\
INT64_PRINTF_FORMAT, \ "%"PRId64, \
__LINE__, pTask->client_ip, \ __LINE__, pTask->client_ip, \
pFileContext->filename, \ pFileContext->filename, \
pFileContext->start); pFileContext->start);
@ -883,7 +883,7 @@ int dio_check_trunk_file_ex(int fd, const char *filename, const int64_t offset)
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"trunk file: %s, offset: " \ "trunk file: %s, offset: " \
INT64_PRINTF_FORMAT" already occupied" \ "%"PRId64" already occupied" \
" by other file, trunk header info: %s"\ " by other file, trunk header info: %s"\
, __LINE__, filename, offset, buff); , __LINE__, filename, offset, buff);
return EEXIST; return EEXIST;

View File

@ -106,7 +106,7 @@ static int storage_do_fetch_binlog(ConnectionInfo *pSrcStorage, \
} }
logInfo("file: "__FILE__", line: %d, " \ logInfo("file: "__FILE__", line: %d, " \
"recovery binlog file size: "INT64_PRINTF_FORMAT, \ "recovery binlog file size: %"PRId64, \
__LINE__, file_bytes); __LINE__, file_bytes);
return 0; return 0;
@ -361,7 +361,7 @@ static int recovery_write_to_mark_file(const char *pBasePath, \
len = sprintf(buff, \ len = sprintf(buff, \
"%s=%d\n" \ "%s=%d\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s=1\n", \ "%s=1\n", \
MARK_ITEM_SAVED_STORAGE_STATUS, saved_storage_status, \ MARK_ITEM_SAVED_STORAGE_STATUS, saved_storage_status, \
MARK_ITEM_BINLOG_OFFSET, pReader->binlog_offset, \ MARK_ITEM_BINLOG_OFFSET, pReader->binlog_offset, \
@ -469,7 +469,7 @@ static int recovery_reader_init(const char *pBasePath, \
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"in mark file \"%s\", %s: "\ "in mark file \"%s\", %s: "\
INT64_PRINTF_FORMAT" < 0", __LINE__, \ "%"PRId64" < 0", __LINE__, \
full_mark_filename, MARK_ITEM_BINLOG_OFFSET, \ full_mark_filename, MARK_ITEM_BINLOG_OFFSET, \
pReader->binlog_offset); pReader->binlog_offset);
return EINVAL; return EINVAL;
@ -691,8 +691,8 @@ static int storage_do_recovery(const char *pBasePath, StorageBinLogReader *pRead
{ {
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"disk recovery: recover path: %s, " \ "disk recovery: recover path: %s, " \
"file count: "INT64_PRINTF_FORMAT \ "file count: %"PRId64 \
", success count: "INT64_PRINTF_FORMAT, \ ", success count: %"PRId64, \
__LINE__, pBasePath, total_count, \ __LINE__, pBasePath, total_count, \
success_count); success_count);
recovery_write_to_mark_file(pBasePath, pReader); recovery_write_to_mark_file(pBasePath, pReader);
@ -708,8 +708,8 @@ static int storage_do_recovery(const char *pBasePath, StorageBinLogReader *pRead
logInfo("file: "__FILE__", line: %d, " \ logInfo("file: "__FILE__", line: %d, " \
"disk recovery: recover path: %s, " \ "disk recovery: recover path: %s, " \
"file count: "INT64_PRINTF_FORMAT \ "file count: %"PRId64 \
", success count: "INT64_PRINTF_FORMAT, \ ", success count: %"PRId64, \
__LINE__, pBasePath, total_count, success_count); __LINE__, pBasePath, total_count, success_count);
} }
else else

View File

@ -109,7 +109,7 @@ static int fdfs_dump_global_vars(char *buff, const int buffSize)
"g_current_trunk_file_id=%d\n" "g_current_trunk_file_id=%d\n"
"g_trunk_sync_thread_count=%d\n" "g_trunk_sync_thread_count=%d\n"
"g_trunk_server=%s:%d\n" "g_trunk_server=%s:%d\n"
"g_trunk_total_free_space="INT64_PRINTF_FORMAT"\n" "g_trunk_total_free_space=%"PRId64"\n"
"g_use_connection_pool=%d\n" "g_use_connection_pool=%d\n"
"g_connection_pool_max_idle_time=%d\n" "g_connection_pool_max_idle_time=%d\n"
"connection_pool_conn_count=%d\n" "connection_pool_conn_count=%d\n"
@ -331,20 +331,20 @@ static int fdfs_dump_storage_stat(char *buff, const int buffSize)
total_len = snprintf(buff, buffSize, total_len = snprintf(buff, buffSize,
"\ng_stat_change_count=%d\n" "\ng_stat_change_count=%d\n"
"g_sync_change_count=%d\n" "g_sync_change_count=%d\n"
"total_upload_count="INT64_PRINTF_FORMAT"\n" "total_upload_count=%"PRId64"\n"
"success_upload_count="INT64_PRINTF_FORMAT"\n" "success_upload_count=%"PRId64"\n"
"total_set_meta_count="INT64_PRINTF_FORMAT"\n" "total_set_meta_count=%"PRId64"\n"
"success_set_meta_count="INT64_PRINTF_FORMAT"\n" "success_set_meta_count=%"PRId64"\n"
"total_delete_count="INT64_PRINTF_FORMAT"\n" "total_delete_count=%"PRId64"\n"
"success_delete_count="INT64_PRINTF_FORMAT"\n" "success_delete_count=%"PRId64"\n"
"total_download_count="INT64_PRINTF_FORMAT"\n" "total_download_count=%"PRId64"\n"
"success_download_count="INT64_PRINTF_FORMAT"\n" "success_download_count=%"PRId64"\n"
"total_get_meta_count="INT64_PRINTF_FORMAT"\n" "total_get_meta_count=%"PRId64"\n"
"success_get_meta_count="INT64_PRINTF_FORMAT"\n" "success_get_meta_count=%"PRId64"\n"
"total_create_link_count="INT64_PRINTF_FORMAT"\n" "total_create_link_count=%"PRId64"\n"
"success_create_link_count="INT64_PRINTF_FORMAT"\n" "success_create_link_count=%"PRId64"\n"
"total_delete_link_count="INT64_PRINTF_FORMAT"\n" "total_delete_link_count=%"PRId64"\n"
"success_delete_link_count="INT64_PRINTF_FORMAT"\n" "success_delete_link_count=%"PRId64"\n"
"last_source_update=%s\n" "last_source_update=%s\n"
"last_sync_update=%s\n" "last_sync_update=%s\n"
"last_synced_timestamp=%s\n" "last_synced_timestamp=%s\n"

View File

@ -404,44 +404,44 @@ int storage_write_to_stat_file()
int write_ret; int write_ret;
len = sprintf(buff, len = sprintf(buff,
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s=%d\n" \ "%s=%d\n" \
"%s=%d\n" \ "%s=%d\n" \
"%s=%d\n" \ "%s=%d\n" \
@ -1597,7 +1597,7 @@ int storage_func_init(const char *filename, \
{ {
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"item \"rotate_access_log_size\": " \ "item \"rotate_access_log_size\": " \
INT64_PRINTF_FORMAT" is too small, " \ "%"PRId64" is too small, " \
"change to 1 MB", __LINE__, \ "change to 1 MB", __LINE__, \
rotate_access_log_size); rotate_access_log_size);
rotate_access_log_size = FDFS_ONE_MB; rotate_access_log_size = FDFS_ONE_MB;
@ -1620,7 +1620,7 @@ int storage_func_init(const char *filename, \
{ {
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"item \"rotate_error_log_size\": " \ "item \"rotate_error_log_size\": " \
INT64_PRINTF_FORMAT" is too small, " \ "%"PRId64" is too small, " \
"change to 1 MB", __LINE__, \ "change to 1 MB", __LINE__, \
rotate_error_log_size); rotate_error_log_size);
rotate_error_log_size = FDFS_ONE_MB; rotate_error_log_size = FDFS_ONE_MB;
@ -1693,8 +1693,8 @@ int storage_func_init(const char *filename, \
"access_log_rotate_time=%02d:%02d, " \ "access_log_rotate_time=%02d:%02d, " \
"rotate_error_log=%d, " \ "rotate_error_log=%d, " \
"error_log_rotate_time=%02d:%02d, " \ "error_log_rotate_time=%02d:%02d, " \
"rotate_access_log_size="INT64_PRINTF_FORMAT", " \ "rotate_access_log_size=%"PRId64", " \
"rotate_error_log_size="INT64_PRINTF_FORMAT", " \ "rotate_error_log_size=%"PRId64", " \
"file_sync_skip_invalid_record=%d, " \ "file_sync_skip_invalid_record=%d, " \
"use_connection_pool=%d, " \ "use_connection_pool=%d, " \
"g_connection_pool_max_idle_time=%ds", \ "g_connection_pool_max_idle_time=%ds", \

View File

@ -310,7 +310,7 @@ static void client_sock_read(int sock, short event, void *arg)
} }
/* /*
logInfo("total_length="INT64_PRINTF_FORMAT", recv_bytes=%d, " logInfo("total_length=%"PRId64", recv_bytes=%d, "
"pTask->length=%d, pTask->offset=%d", "pTask->length=%d, pTask->offset=%d",
pClientInfo->total_length, recv_bytes, pClientInfo->total_length, recv_bytes,
pTask->length, pTask->offset); pTask->length, pTask->offset);
@ -364,7 +364,7 @@ static void client_sock_read(int sock, short event, void *arg)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, pkg length: " \ "client ip: %s, pkg length: " \
INT64_PRINTF_FORMAT" < 0", \ "%"PRId64" < 0", \
__LINE__, pTask->client_ip, \ __LINE__, pTask->client_ip, \
pClientInfo->total_length); pClientInfo->total_length);

View File

@ -272,8 +272,8 @@ static void storage_log_access_log(struct fast_task_info *pTask, \
+ (tv_end.tv_usec - pClientInfo->file_context. \ + (tv_end.tv_usec - pClientInfo->file_context. \
tv_deal_start.tv_usec) / 1000; tv_deal_start.tv_usec) / 1000;
logAccess(&g_access_log_context, &(pClientInfo->file_context. \ logAccess(&g_access_log_context, &(pClientInfo->file_context. \
tv_deal_start), "%s %s %s %d %d "INT64_PRINTF_FORMAT" " \ tv_deal_start), "%s %s %s %d %d %"PRId64" " \
INT64_PRINTF_FORMAT, pTask->client_ip, action, \ "%"PRId64, pTask->client_ip, action, \
pClientInfo->file_context.fname2log, status, time_used, \ pClientInfo->file_context.fname2log, status, time_used, \
pClientInfo->request_length, pClientInfo->total_length); pClientInfo->request_length, pClientInfo->total_length);
} }
@ -1328,7 +1328,7 @@ static void storage_append_file_done_callback(struct fast_task_info *pTask, \
"regular", pFileContext->filename) "regular", pFileContext->filename)
} }
sprintf(extra, INT64_PRINTF_FORMAT" "INT64_PRINTF_FORMAT, \ sprintf(extra, "%"PRId64" %"PRId64, \
pFileContext->start, \ pFileContext->start, \
pFileContext->end - pFileContext->start); pFileContext->end - pFileContext->start);
result = storage_binlog_write_ex(pFileContext->timestamp2log, \ result = storage_binlog_write_ex(pFileContext->timestamp2log, \
@ -1398,7 +1398,7 @@ static void storage_modify_file_done_callback(struct fast_task_info *pTask, \
"regular", pFileContext->filename) "regular", pFileContext->filename)
} }
sprintf(extra, INT64_PRINTF_FORMAT" "INT64_PRINTF_FORMAT, \ sprintf(extra, "%"PRId64" %"PRId64, \
pFileContext->start, \ pFileContext->start, \
pFileContext->end - pFileContext->start); pFileContext->end - pFileContext->start);
result = storage_binlog_write_ex(pFileContext->timestamp2log, \ result = storage_binlog_write_ex(pFileContext->timestamp2log, \
@ -1467,7 +1467,7 @@ static void storage_do_truncate_file_done_callback(struct fast_task_info *pTask,
STORAGE_STAT_FILE_FAIL_LOG(result, pTask->client_ip, STORAGE_STAT_FILE_FAIL_LOG(result, pTask->client_ip,
"regular", pFileContext->filename) "regular", pFileContext->filename)
} }
sprintf(extra, INT64_PRINTF_FORMAT" "INT64_PRINTF_FORMAT, \ sprintf(extra, "%"PRId64" %"PRId64, \
pFileContext->end - pFileContext->start, pFileContext->end - pFileContext->start,
pFileContext->offset); pFileContext->offset);
result = storage_binlog_write_ex(pFileContext->timestamp2log, \ result = storage_binlog_write_ex(pFileContext->timestamp2log, \
@ -3201,7 +3201,7 @@ static int storage_server_set_metadata(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", \ "expect length > %d", \
__LINE__, STORAGE_PROTO_CMD_SET_METADATA, \ __LINE__, STORAGE_PROTO_CMD_SET_METADATA, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
@ -3215,7 +3215,7 @@ static int storage_server_set_metadata(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length < %d", \ "expect length < %d", \
__LINE__, STORAGE_PROTO_CMD_SET_METADATA, \ __LINE__, STORAGE_PROTO_CMD_SET_METADATA, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
@ -3347,7 +3347,7 @@ static int storage_server_report_server_id(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length: %d", __LINE__, \ "expect length: %d", __LINE__, \
STORAGE_PROTO_CMD_REPORT_SERVER_ID, \ STORAGE_PROTO_CMD_REPORT_SERVER_ID, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
@ -3390,7 +3390,7 @@ static int storage_server_trunk_sync_binlog(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct", __LINE__, \ "%"PRId64" is not correct", __LINE__, \
STORAGE_PROTO_CMD_TRUNK_SYNC_BINLOG, \ STORAGE_PROTO_CMD_TRUNK_SYNC_BINLOG, \
pTask->client_ip, nInPackLen); pTask->client_ip, nInPackLen);
return EINVAL; return EINVAL;
@ -3456,7 +3456,7 @@ static int storage_server_query_file_info(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_QUERY_FILE_INFO, \ STORAGE_PROTO_CMD_QUERY_FILE_INFO, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
@ -3718,7 +3718,7 @@ static int storage_server_trunk_alloc_space(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length: %d", __LINE__, \ "expect length: %d", __LINE__, \
STORAGE_PROTO_CMD_TRUNK_ALLOC_SPACE, \ STORAGE_PROTO_CMD_TRUNK_ALLOC_SPACE, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
@ -3790,7 +3790,7 @@ static int storage_server_trunk_get_binlog_size(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length: 0", __LINE__, \ "expect length: 0", __LINE__, \
pHeader->cmd, pTask->client_ip, nInPackLen); pHeader->cmd, pTask->client_ip, nInPackLen);
pClientInfo->total_length = sizeof (TrackerHeader); pClientInfo->total_length = sizeof (TrackerHeader);
@ -3842,7 +3842,7 @@ static int storage_server_trunk_truncate_binlog_file(struct fast_task_info *pTas
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length: 0", __LINE__, \ "expect length: 0", __LINE__, \
pHeader->cmd, pTask->client_ip, nInPackLen); pHeader->cmd, pTask->client_ip, nInPackLen);
return EINVAL; return EINVAL;
@ -3884,7 +3884,7 @@ static int storage_server_trunk_delete_binlog_marks(struct fast_task_info *pTask
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length: 0", __LINE__, \ "expect length: 0", __LINE__, \
pHeader->cmd, pTask->client_ip, nInPackLen); pHeader->cmd, pTask->client_ip, nInPackLen);
return EINVAL; return EINVAL;
@ -3947,7 +3947,7 @@ static int storage_server_trunk_confirm_or_free(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length: %d", __LINE__, \ "expect length: %d", __LINE__, \
pHeader->cmd, pTask->client_ip, nInPackLen, \ pHeader->cmd, pTask->client_ip, nInPackLen, \
(int)STORAGE_TRUNK_ALLOC_CONFIRM_REQ_BODY_LEN); (int)STORAGE_TRUNK_ALLOC_CONFIRM_REQ_BODY_LEN);
@ -4310,7 +4310,7 @@ static int storage_server_fetch_one_path_binlog(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length = %d", __LINE__, \ "expect length = %d", __LINE__, \
STORAGE_PROTO_CMD_FETCH_ONE_PATH_BINLOG, \ STORAGE_PROTO_CMD_FETCH_ONE_PATH_BINLOG, \
pTask->client_ip, \ pTask->client_ip, \
@ -4376,7 +4376,7 @@ static int storage_upload_file(struct fast_task_info *pTask, bool bAppenderFile)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length >= %d", __LINE__, \ "expect length >= %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, \ STORAGE_PROTO_CMD_UPLOAD_FILE, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
@ -4421,8 +4421,8 @@ static int storage_upload_file(struct fast_task_info *pTask, bool bAppenderFile)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, pkg length is not correct, " \ "client ip: %s, pkg length is not correct, " \
"invalid file bytes: "INT64_PRINTF_FORMAT \ "invalid file bytes: %"PRId64 \
", total body length: "INT64_PRINTF_FORMAT, \ ", total body length: %"PRId64, \
__LINE__, pTask->client_ip, file_bytes, nInPackLen); __LINE__, pTask->client_ip, file_bytes, nInPackLen);
pClientInfo->total_length = sizeof(TrackerHeader); pClientInfo->total_length = sizeof(TrackerHeader);
return EINVAL; return EINVAL;
@ -4505,7 +4505,7 @@ static int storage_upload_file(struct fast_task_info *pTask, bool bAppenderFile)
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"no space to upload file, " "no space to upload file, "
"free space: %d MB is too small, file bytes: " \ "free space: %d MB is too small, file bytes: " \
INT64_PRINTF_FORMAT", reserved space: %s", \ "%"PRId64", reserved space: %s", \
__LINE__, g_path_space_list[store_path_index].\ __LINE__, g_path_space_list[store_path_index].\
free_mb, file_bytes, \ free_mb, file_bytes, \
fdfs_storage_reserved_space_to_string_ex( \ fdfs_storage_reserved_space_to_string_ex( \
@ -4559,7 +4559,7 @@ static int storage_deal_active_test(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length 0", __LINE__, \ "expect length 0", __LINE__, \
FDFS_PROTO_CMD_ACTIVE_TEST, pTask->client_ip, \ FDFS_PROTO_CMD_ACTIVE_TEST, pTask->client_ip, \
nInPackLen); nInPackLen);
@ -4603,7 +4603,7 @@ static int storage_append_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_APPEND_FILE, \ STORAGE_PROTO_CMD_APPEND_FILE, \
pTask->client_ip, \ pTask->client_ip, \
@ -4633,7 +4633,7 @@ static int storage_append_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, pkg length is not correct, " \ "client ip: %s, pkg length is not correct, " \
"invalid file bytes: "INT64_PRINTF_FORMAT, \ "invalid file bytes: %"PRId64, \
__LINE__, pTask->client_ip, file_bytes); __LINE__, pTask->client_ip, file_bytes);
return EINVAL; return EINVAL;
} }
@ -4705,7 +4705,7 @@ static int storage_append_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, file: %s is not a valid " \ "client ip: %s, file: %s is not a valid " \
"appender file, file size: "INT64_PRINTF_FORMAT, \ "appender file, file size: %"PRId64, \
__LINE__, pTask->client_ip, appender_filename, \ __LINE__, pTask->client_ip, appender_filename, \
appender_file_size); appender_file_size);
@ -4779,7 +4779,7 @@ static int storage_modify_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_MODIFY_FILE, \ STORAGE_PROTO_CMD_MODIFY_FILE, \
pTask->client_ip, \ pTask->client_ip, \
@ -4810,7 +4810,7 @@ static int storage_modify_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"file offset: "INT64_PRINTF_FORMAT" is invalid, "\ "file offset: %"PRId64" is invalid, "\
"which < 0", __LINE__, pTask->client_ip, file_offset); "which < 0", __LINE__, pTask->client_ip, file_offset);
return EINVAL; return EINVAL;
} }
@ -4820,7 +4820,7 @@ static int storage_modify_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, pkg length is not correct, " \ "client ip: %s, pkg length is not correct, " \
"invalid file bytes: "INT64_PRINTF_FORMAT, \ "invalid file bytes: %"PRId64, \
__LINE__, pTask->client_ip, file_bytes); __LINE__, pTask->client_ip, file_bytes);
return EINVAL; return EINVAL;
} }
@ -4892,7 +4892,7 @@ static int storage_modify_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, file: %s is not a valid " \ "client ip: %s, file: %s is not a valid " \
"appender file, file size: "INT64_PRINTF_FORMAT, \ "appender file, file size: %"PRId64, \
__LINE__, pTask->client_ip, appender_filename, \ __LINE__, pTask->client_ip, appender_filename, \
appender_file_size); appender_file_size);
@ -4902,7 +4902,7 @@ static int storage_modify_file(struct fast_task_info *pTask)
if (file_offset > stat_buf.st_size) if (file_offset > stat_buf.st_size)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, file offset: "INT64_PRINTF_FORMAT \ "client ip: %s, file offset: %"PRId64 \
" is invalid, which > appender file size: " \ " is invalid, which > appender file size: " \
OFF_PRINTF_FORMAT, __LINE__, pTask->client_ip, \ OFF_PRINTF_FORMAT, __LINE__, pTask->client_ip, \
file_offset, stat_buf.st_size); file_offset, stat_buf.st_size);
@ -4973,7 +4973,7 @@ static int storage_do_truncate_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_TRUNCATE_FILE, \ STORAGE_PROTO_CMD_TRUNCATE_FILE, \
pTask->client_ip, \ pTask->client_ip, \
@ -5002,7 +5002,7 @@ static int storage_do_truncate_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, pkg length is not correct, " \ "client ip: %s, pkg length is not correct, " \
"invalid file bytes: "INT64_PRINTF_FORMAT, \ "invalid file bytes: %"PRId64, \
__LINE__, pTask->client_ip, remain_bytes); __LINE__, pTask->client_ip, remain_bytes);
return EINVAL; return EINVAL;
} }
@ -5074,7 +5074,7 @@ static int storage_do_truncate_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, file: %s is not a valid " \ "client ip: %s, file: %s is not a valid " \
"appender file, file size: "INT64_PRINTF_FORMAT, \ "appender file, file size: %"PRId64, \
__LINE__, pTask->client_ip, appender_filename, \ __LINE__, pTask->client_ip, appender_filename, \
appender_file_size); appender_file_size);
@ -5085,7 +5085,7 @@ static int storage_do_truncate_file(struct fast_task_info *pTask)
{ {
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"client ip: %s, truncated file size: " \ "client ip: %s, truncated file size: " \
INT64_PRINTF_FORMAT" == appender file size: " \ "%"PRId64" == appender file size: " \
OFF_PRINTF_FORMAT", skip truncate file", \ OFF_PRINTF_FORMAT", skip truncate file", \
__LINE__, pTask->client_ip, \ __LINE__, pTask->client_ip, \
remain_bytes, stat_buf.st_size); remain_bytes, stat_buf.st_size);
@ -5095,7 +5095,7 @@ static int storage_do_truncate_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, truncated file size: " \ "client ip: %s, truncated file size: " \
INT64_PRINTF_FORMAT" is invalid, " \ "%"PRId64" is invalid, " \
"which > appender file size: " \ "which > appender file size: " \
OFF_PRINTF_FORMAT, __LINE__, pTask->client_ip, \ OFF_PRINTF_FORMAT, __LINE__, pTask->client_ip, \
remain_bytes, stat_buf.st_size); remain_bytes, stat_buf.st_size);
@ -5167,7 +5167,7 @@ static int storage_upload_slave_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, \ STORAGE_PROTO_CMD_UPLOAD_FILE, \
pTask->client_ip, \ pTask->client_ip, \
@ -5201,7 +5201,7 @@ static int storage_upload_slave_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, pkg length is not correct, " \ "client ip: %s, pkg length is not correct, " \
"invalid file bytes: "INT64_PRINTF_FORMAT, \ "invalid file bytes: %"PRId64, \
__LINE__, pTask->client_ip, file_bytes); __LINE__, pTask->client_ip, file_bytes);
pClientInfo->total_length = sizeof(TrackerHeader); pClientInfo->total_length = sizeof(TrackerHeader);
return EINVAL; return EINVAL;
@ -5266,7 +5266,7 @@ static int storage_upload_slave_file(struct fast_task_info *pTask)
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"no space to upload file, " "no space to upload file, "
"free space: %d MB is too small, file bytes: " \ "free space: %d MB is too small, file bytes: " \
INT64_PRINTF_FORMAT", reserved space: %s", __LINE__,\ "%"PRId64", reserved space: %s", __LINE__,\
g_path_space_list[store_path_index].free_mb, \ g_path_space_list[store_path_index].free_mb, \
file_bytes, fdfs_storage_reserved_space_to_string_ex(\ file_bytes, fdfs_storage_reserved_space_to_string_ex(\
g_storage_reserved_space.flag, \ g_storage_reserved_space.flag, \
@ -5415,7 +5415,7 @@ static int storage_sync_copy_file(struct fast_task_info *pTask, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT"is not correct, " \ "%"PRId64"is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
proto_cmd, pTask->client_ip, nInPackLen, \ proto_cmd, pTask->client_ip, nInPackLen, \
2 * FDFS_PROTO_PKG_LEN_SIZE + 4+FDFS_GROUP_NAME_MAX_LEN); 2 * FDFS_PROTO_PKG_LEN_SIZE + 4+FDFS_GROUP_NAME_MAX_LEN);
@ -5442,7 +5442,7 @@ static int storage_sync_copy_file(struct fast_task_info *pTask, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"file size: "INT64_PRINTF_FORMAT" is invalid, "\ "file size: %"PRId64" is invalid, "\
"which < 0", __LINE__, pTask->client_ip, file_bytes); "which < 0", __LINE__, pTask->client_ip, file_bytes);
return EINVAL; return EINVAL;
} }
@ -5470,8 +5470,8 @@ static int storage_sync_copy_file(struct fast_task_info *pTask, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"file size: "INT64_PRINTF_FORMAT \ "file size: %"PRId64 \
" != remain bytes: "INT64_PRINTF_FORMAT"", \ " != remain bytes: %"PRId64"", \
__LINE__, pTask->client_ip, file_bytes, \ __LINE__, pTask->client_ip, file_bytes, \
nInPackLen - (2*FDFS_PROTO_PKG_LEN_SIZE + \ nInPackLen - (2*FDFS_PROTO_PKG_LEN_SIZE + \
FDFS_GROUP_NAME_MAX_LEN + filename_len)); FDFS_GROUP_NAME_MAX_LEN + filename_len));
@ -5485,7 +5485,7 @@ static int storage_sync_copy_file(struct fast_task_info *pTask, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
" remain bytes: "INT64_PRINTF_FORMAT" != 0 ", \ " remain bytes: %"PRId64" != 0 ", \
__LINE__, pTask->client_ip, \ __LINE__, pTask->client_ip, \
nInPackLen - (2*FDFS_PROTO_PKG_LEN_SIZE + \ nInPackLen - (2*FDFS_PROTO_PKG_LEN_SIZE + \
FDFS_GROUP_NAME_MAX_LEN + filename_len)); FDFS_GROUP_NAME_MAX_LEN + filename_len));
@ -5560,7 +5560,7 @@ static int storage_sync_copy_file(struct fast_task_info *pTask, \
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"client ip: %s, logic file %s, " \ "client ip: %s, logic file %s, " \
"my file size: "OFF_PRINTF_FORMAT \ "my file size: "OFF_PRINTF_FORMAT \
" != src file size: "INT64_PRINTF_FORMAT \ " != src file size: %"PRId64 \
", will be overwrited", __LINE__, \ ", will be overwrited", __LINE__, \
pTask->client_ip, filename, \ pTask->client_ip, filename, \
stat_buf.st_size, file_bytes); stat_buf.st_size, file_bytes);
@ -5618,7 +5618,7 @@ static int storage_sync_copy_file(struct fast_task_info *pTask, \
pthread_mutex_lock(&g_storage_thread_lock); pthread_mutex_lock(&g_storage_thread_lock);
sprintf(pFileContext->filename, "%s/data/.cp" \ sprintf(pFileContext->filename, "%s/data/.cp" \
INT64_PRINTF_FORMAT".tmp", \ "%"PRId64".tmp", \
g_fdfs_store_paths.paths[store_path_index], \ g_fdfs_store_paths.paths[store_path_index], \
temp_file_sequence++); temp_file_sequence++);
@ -5737,7 +5737,7 @@ static int storage_sync_append_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT"is not correct, " \ "%"PRId64"is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_SYNC_APPEND_FILE, \ STORAGE_PROTO_CMD_SYNC_APPEND_FILE, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
@ -5767,7 +5767,7 @@ static int storage_sync_append_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"start offset: "INT64_PRINTF_FORMAT" is invalid, "\ "start offset: %"PRId64" is invalid, "\
"which < 0", __LINE__, pTask->client_ip, start_offset); "which < 0", __LINE__, pTask->client_ip, start_offset);
return EINVAL; return EINVAL;
} }
@ -5776,7 +5776,7 @@ static int storage_sync_append_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"append bytes: "INT64_PRINTF_FORMAT" is invalid, "\ "append bytes: %"PRId64" is invalid, "\
"which < 0", __LINE__, pTask->client_ip, append_bytes); "which < 0", __LINE__, pTask->client_ip, append_bytes);
return EINVAL; return EINVAL;
} }
@ -5801,8 +5801,8 @@ static int storage_sync_append_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"file size: "INT64_PRINTF_FORMAT \ "file size: %"PRId64 \
" != remain bytes: "INT64_PRINTF_FORMAT"", \ " != remain bytes: %"PRId64"", \
__LINE__, pTask->client_ip, append_bytes, \ __LINE__, pTask->client_ip, append_bytes, \
nInPackLen - (3 * FDFS_PROTO_PKG_LEN_SIZE + \ nInPackLen - (3 * FDFS_PROTO_PKG_LEN_SIZE + \
FDFS_GROUP_NAME_MAX_LEN + filename_len)); FDFS_GROUP_NAME_MAX_LEN + filename_len));
@ -5867,7 +5867,7 @@ static int storage_sync_append_file(struct fast_task_info *pTask)
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"client ip: %s, file %s, my file size: " \ "client ip: %s, file %s, my file size: " \
OFF_PRINTF_FORMAT" >= src file size: " \ OFF_PRINTF_FORMAT" >= src file size: " \
INT64_PRINTF_FORMAT", do not append", \ "%"PRId64", do not append", \
__LINE__, pTask->client_ip, pFileContext->filename, \ __LINE__, pTask->client_ip, pFileContext->filename, \
stat_buf.st_size, start_offset + append_bytes); stat_buf.st_size, start_offset + append_bytes);
} }
@ -5875,8 +5875,8 @@ static int storage_sync_append_file(struct fast_task_info *pTask)
{ {
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"client ip: %s, file %s, my file size: " \ "client ip: %s, file %s, my file size: " \
OFF_PRINTF_FORMAT" > "INT64_PRINTF_FORMAT \ OFF_PRINTF_FORMAT" > %"PRId64 \
", but < "INT64_PRINTF_FORMAT", need be resynced", \ ", but < %"PRId64", need be resynced", \
__LINE__, pTask->client_ip, pFileContext->filename, \ __LINE__, pTask->client_ip, pFileContext->filename, \
stat_buf.st_size, start_offset, \ stat_buf.st_size, start_offset, \
start_offset + append_bytes); start_offset + append_bytes);
@ -5890,7 +5890,7 @@ static int storage_sync_append_file(struct fast_task_info *pTask)
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"client ip: %s, file %s, my file size: " \ "client ip: %s, file %s, my file size: " \
OFF_PRINTF_FORMAT" < start offset " \ OFF_PRINTF_FORMAT" < start offset " \
INT64_PRINTF_FORMAT", need to resync this file!", \ "%"PRId64", need to resync this file!", \
__LINE__, pTask->client_ip, pFileContext->filename, \ __LINE__, pTask->client_ip, pFileContext->filename, \
stat_buf.st_size, start_offset); stat_buf.st_size, start_offset);
need_write_file = false; need_write_file = false;
@ -5906,7 +5906,7 @@ static int storage_sync_append_file(struct fast_task_info *pTask)
snprintf(pFileContext->fname2log, \ snprintf(pFileContext->fname2log, \
sizeof(pFileContext->fname2log), \ sizeof(pFileContext->fname2log), \
"%s "INT64_PRINTF_FORMAT" "INT64_PRINTF_FORMAT, \ "%s %"PRId64" %"PRId64, \
filename, start_offset, append_bytes); filename, start_offset, append_bytes);
} }
else else
@ -5965,7 +5965,7 @@ static int storage_sync_modify_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT"is not correct, " \ "%"PRId64"is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_SYNC_MODIFY_FILE, \ STORAGE_PROTO_CMD_SYNC_MODIFY_FILE, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
@ -5996,7 +5996,7 @@ static int storage_sync_modify_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"start offset: "INT64_PRINTF_FORMAT" is invalid, "\ "start offset: %"PRId64" is invalid, "\
"which < 0", __LINE__, pTask->client_ip, start_offset); "which < 0", __LINE__, pTask->client_ip, start_offset);
return EINVAL; return EINVAL;
} }
@ -6005,7 +6005,7 @@ static int storage_sync_modify_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"modify file bytes: "INT64_PRINTF_FORMAT" is invalid, "\ "modify file bytes: %"PRId64" is invalid, "\
"which < 0", __LINE__, pTask->client_ip, modify_bytes); "which < 0", __LINE__, pTask->client_ip, modify_bytes);
return EINVAL; return EINVAL;
} }
@ -6030,8 +6030,8 @@ static int storage_sync_modify_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"file size: "INT64_PRINTF_FORMAT \ "file size: %"PRId64 \
" != remain bytes: "INT64_PRINTF_FORMAT"", \ " != remain bytes: %"PRId64"", \
__LINE__, pTask->client_ip, modify_bytes, \ __LINE__, pTask->client_ip, modify_bytes, \
nInPackLen - (3 * FDFS_PROTO_PKG_LEN_SIZE + \ nInPackLen - (3 * FDFS_PROTO_PKG_LEN_SIZE + \
FDFS_GROUP_NAME_MAX_LEN + filename_len)); FDFS_GROUP_NAME_MAX_LEN + filename_len));
@ -6090,7 +6090,7 @@ static int storage_sync_modify_file(struct fast_task_info *pTask)
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"client ip: %s, file %s, my file size: " \ "client ip: %s, file %s, my file size: " \
OFF_PRINTF_FORMAT" < start offset " \ OFF_PRINTF_FORMAT" < start offset " \
INT64_PRINTF_FORMAT", need to resync this file!", \ "%"PRId64", need to resync this file!", \
__LINE__, pTask->client_ip, pFileContext->filename, \ __LINE__, pTask->client_ip, pFileContext->filename, \
stat_buf.st_size, start_offset); stat_buf.st_size, start_offset);
need_write_file = false; need_write_file = false;
@ -6109,7 +6109,7 @@ static int storage_sync_modify_file(struct fast_task_info *pTask)
snprintf(pFileContext->fname2log, \ snprintf(pFileContext->fname2log, \
sizeof(pFileContext->fname2log), \ sizeof(pFileContext->fname2log), \
"%s "INT64_PRINTF_FORMAT" "INT64_PRINTF_FORMAT, \ "%s %"PRId64" %"PRId64, \
filename, start_offset, modify_bytes); filename, start_offset, modify_bytes);
} }
else else
@ -6165,7 +6165,7 @@ static int storage_sync_truncate_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT"is not correct, " \ "%"PRId64"is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_SYNC_TRUNCATE_FILE, \ STORAGE_PROTO_CMD_SYNC_TRUNCATE_FILE, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
@ -6209,7 +6209,7 @@ static int storage_sync_truncate_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"start offset: "INT64_PRINTF_FORMAT \ "start offset: %"PRId64 \
"is invalid, which < 0", __LINE__, \ "is invalid, which < 0", __LINE__, \
pTask->client_ip, old_file_size); pTask->client_ip, old_file_size);
return EINVAL; return EINVAL;
@ -6219,7 +6219,7 @@ static int storage_sync_truncate_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"modify file bytes: "INT64_PRINTF_FORMAT \ "modify file bytes: %"PRId64 \
" is invalid, which < 0", __LINE__, \ " is invalid, which < 0", __LINE__, \
pTask->client_ip, new_file_size); pTask->client_ip, new_file_size);
return EINVAL; return EINVAL;
@ -6291,7 +6291,7 @@ static int storage_sync_truncate_file(struct fast_task_info *pTask)
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"client ip: %s, file %s, my file size: " \ "client ip: %s, file %s, my file size: " \
OFF_PRINTF_FORMAT" != before truncated size: " \ OFF_PRINTF_FORMAT" != before truncated size: " \
INT64_PRINTF_FORMAT", skip!", __LINE__, \ "%"PRId64", skip!", __LINE__, \
pTask->client_ip, pFileContext->filename, \ pTask->client_ip, pFileContext->filename, \
stat_buf.st_size, old_file_size); stat_buf.st_size, old_file_size);
return EEXIST; return EEXIST;
@ -6303,7 +6303,7 @@ static int storage_sync_truncate_file(struct fast_task_info *pTask)
snprintf(pFileContext->fname2log, \ snprintf(pFileContext->fname2log, \
sizeof(pFileContext->fname2log), \ sizeof(pFileContext->fname2log), \
"%s "INT64_PRINTF_FORMAT" "INT64_PRINTF_FORMAT, \ "%s %"PRId64" %"PRId64, \
filename, old_file_size, new_file_size); filename, old_file_size, new_file_size);
pFileContext->calc_crc32 = false; pFileContext->calc_crc32 = false;
@ -6398,7 +6398,7 @@ static int storage_do_sync_link_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"pgk length: "INT64_PRINTF_FORMAT \ "pgk length: %"PRId64 \
" != bytes: %d", __LINE__, pTask->client_ip, \ " != bytes: %d", __LINE__, pTask->client_ip, \
nInPackLen, 2 * FDFS_PROTO_PKG_LEN_SIZE + \ nInPackLen, 2 * FDFS_PROTO_PKG_LEN_SIZE + \
FDFS_GROUP_NAME_MAX_LEN + dest_filename_len + \ FDFS_GROUP_NAME_MAX_LEN + dest_filename_len + \
@ -6579,7 +6579,7 @@ static int storage_sync_link_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, package size " \ "client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
pTask->client_ip, nInPackLen, \ pTask->client_ip, nInPackLen, \
2 * FDFS_PROTO_PKG_LEN_SIZE + \ 2 * FDFS_PROTO_PKG_LEN_SIZE + \
@ -6615,7 +6615,7 @@ static int storage_sync_link_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, in request pkg, " \ "client ip: %s, in request pkg, " \
"pgk length: "INT64_PRINTF_FORMAT \ "pgk length: %"PRId64 \
" != bytes: %d", __LINE__, pTask->client_ip, \ " != bytes: %d", __LINE__, pTask->client_ip, \
nInPackLen, 2 * FDFS_PROTO_PKG_LEN_SIZE + \ nInPackLen, 2 * FDFS_PROTO_PKG_LEN_SIZE + \
FDFS_GROUP_NAME_MAX_LEN + dest_filename_len + \ FDFS_GROUP_NAME_MAX_LEN + dest_filename_len + \
@ -6693,7 +6693,7 @@ static int storage_server_get_metadata(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, \ STORAGE_PROTO_CMD_UPLOAD_FILE, \
pTask->client_ip, nInPackLen, FDFS_GROUP_NAME_MAX_LEN); pTask->client_ip, nInPackLen, FDFS_GROUP_NAME_MAX_LEN);
@ -6704,7 +6704,7 @@ static int storage_server_get_metadata(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is too large, " \ "%"PRId64" is too large, " \
"expect length should < %d", __LINE__, \ "expect length should < %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, \ STORAGE_PROTO_CMD_UPLOAD_FILE, \
pTask->client_ip, \ pTask->client_ip, \
@ -6819,7 +6819,7 @@ static int storage_server_download_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, \ STORAGE_PROTO_CMD_UPLOAD_FILE, \
pTask->client_ip, \ pTask->client_ip, \
@ -6831,7 +6831,7 @@ static int storage_server_download_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is too large, " \ "%"PRId64" is too large, " \
"expect length should < %d", __LINE__, \ "expect length should < %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, \ STORAGE_PROTO_CMD_UPLOAD_FILE, \
pTask->client_ip, \ pTask->client_ip, \
@ -6849,7 +6849,7 @@ static int storage_server_download_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip:%s, invalid file offset: " \ "client ip:%s, invalid file offset: " \
INT64_PRINTF_FORMAT, __LINE__, \ "%"PRId64, __LINE__, \
pTask->client_ip, file_offset); pTask->client_ip, file_offset);
return EINVAL; return EINVAL;
} }
@ -6857,7 +6857,7 @@ static int storage_server_download_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip:%s, invalid download file bytes: " \ "client ip:%s, invalid download file bytes: " \
INT64_PRINTF_FORMAT, __LINE__, \ "%"PRId64, __LINE__, \
pTask->client_ip, download_bytes); pTask->client_ip, download_bytes);
return EINVAL; return EINVAL;
} }
@ -6937,8 +6937,8 @@ static int storage_server_download_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip:%s, invalid download file bytes: " \ "client ip:%s, invalid download file bytes: " \
INT64_PRINTF_FORMAT" > file remain bytes: " \ "%"PRId64" > file remain bytes: " \
INT64_PRINTF_FORMAT, __LINE__, \ "%"PRId64, __LINE__, \
pTask->client_ip, download_bytes, \ pTask->client_ip, download_bytes, \
file_bytes - file_offset); file_bytes - file_offset);
if (pFileContext->fd >= 0) if (pFileContext->fd >= 0)
@ -7121,7 +7121,7 @@ static int storage_sync_delete_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length <= %d", __LINE__, \ "expect length <= %d", __LINE__, \
STORAGE_PROTO_CMD_SYNC_DELETE_FILE, \ STORAGE_PROTO_CMD_SYNC_DELETE_FILE, \
pTask->client_ip, \ pTask->client_ip, \
@ -7133,7 +7133,7 @@ static int storage_sync_delete_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is too large, " \ "%"PRId64" is too large, " \
"expect length should < %d", __LINE__, \ "expect length should < %d", __LINE__, \
STORAGE_PROTO_CMD_SYNC_DELETE_FILE, \ STORAGE_PROTO_CMD_SYNC_DELETE_FILE, \
pTask->client_ip, nInPackLen, pTask->size); pTask->client_ip, nInPackLen, pTask->size);
@ -7247,7 +7247,7 @@ static int storage_server_delete_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length <= %d", __LINE__, \ "expect length <= %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, \ STORAGE_PROTO_CMD_UPLOAD_FILE, \
pTask->client_ip, \ pTask->client_ip, \
@ -7259,7 +7259,7 @@ static int storage_server_delete_file(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is too large, " \ "%"PRId64" is too large, " \
"expect length should < %d", __LINE__, \ "expect length should < %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, \ STORAGE_PROTO_CMD_UPLOAD_FILE, \
pTask->client_ip, nInPackLen, pTask->size); pTask->client_ip, nInPackLen, pTask->size);
@ -7674,7 +7674,7 @@ static int storage_do_create_link(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, pTask->client_ip, \ STORAGE_PROTO_CMD_UPLOAD_FILE, pTask->client_ip, \
nInPackLen, 4 * FDFS_PROTO_PKG_LEN_SIZE + \ nInPackLen, 4 * FDFS_PROTO_PKG_LEN_SIZE + \
@ -7861,7 +7861,7 @@ static int storage_create_link(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"cmd=%d, client ip: %s, package size " \ "cmd=%d, client ip: %s, package size " \
INT64_PRINTF_FORMAT" is not correct, " \ "%"PRId64" is not correct, " \
"expect length > %d", __LINE__, \ "expect length > %d", __LINE__, \
STORAGE_PROTO_CMD_UPLOAD_FILE, pTask->client_ip, \ STORAGE_PROTO_CMD_UPLOAD_FILE, pTask->client_ip, \
nInPackLen, 4 * FDFS_PROTO_PKG_LEN_SIZE + \ nInPackLen, 4 * FDFS_PROTO_PKG_LEN_SIZE + \

View File

@ -150,7 +150,7 @@ static int storage_sync_copy_file(ConnectionInfo *pStorageServer, \
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"sync data file, logic file: %s " \ "sync data file, logic file: %s " \
"on dest server %s:%d already exists, "\ "on dest server %s:%d already exists, "\
"but file size: "INT64_PRINTF_FORMAT \ "but file size: %"PRId64 \
" not same as mine: "OFF_PRINTF_FORMAT\ " not same as mine: "OFF_PRINTF_FORMAT\
", need re-sync it", __LINE__, \ ", need re-sync it", __LINE__, \
pRecord->filename, pStorageServer->ip_addr,\ pRecord->filename, pStorageServer->ip_addr,\
@ -366,8 +366,8 @@ static int storage_sync_modify_file(ConnectionInfo *pStorageServer, \
if (stat_buf.st_size < start_offset + modify_length) if (stat_buf.st_size < start_offset + modify_length)
{ {
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"appender file: %s 'size: "INT64_PRINTF_FORMAT \ "appender file: %s 'size: %"PRId64 \
" < "INT64_PRINTF_FORMAT", maybe some mistakes " \ " < %"PRId64", maybe some mistakes " \
"happened, skip sync this appender file", __LINE__, \ "happened, skip sync this appender file", __LINE__, \
full_filename, stat_buf.st_size, \ full_filename, stat_buf.st_size, \
start_offset + modify_length); start_offset + modify_length);
@ -533,8 +533,8 @@ static int storage_sync_truncate_file(ConnectionInfo *pStorageServer, \
if (stat_buf.st_size != new_file_size) if (stat_buf.st_size != new_file_size)
{ {
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"appender file: %s 'size: "INT64_PRINTF_FORMAT \ "appender file: %s 'size: %"PRId64 \
" != "INT64_PRINTF_FORMAT", maybe append/modify later",\ " != %"PRId64", maybe append/modify later",\
__LINE__, full_filename, stat_buf.st_size, __LINE__, full_filename, stat_buf.st_size,
new_file_size); new_file_size);
} }
@ -1524,7 +1524,7 @@ int storage_open_readable_binlog(StorageBinLogReader *pReader, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"seek binlog file \"%s\" fail, file offset=" \ "seek binlog file \"%s\" fail, file offset=" \
INT64_PRINTF_FORMAT", errno: %d, error info: %s", \ "%"PRId64", errno: %d, error info: %s", \
__LINE__, full_filename, pReader->binlog_offset, \ __LINE__, full_filename, pReader->binlog_offset, \
errno, STRERROR(errno)); errno, STRERROR(errno));
@ -2008,7 +2008,7 @@ int storage_reader_init(FDFSStorageBrief *pStorage, StorageBinLogReader *pReader
iniFreeContext(&iniContext); iniFreeContext(&iniContext);
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"in mark file \"%s\", binlog_offset: "\ "in mark file \"%s\", binlog_offset: "\
INT64_PRINTF_FORMAT" < 0", \ "%"PRId64" < 0", \
__LINE__, full_filename, \ __LINE__, full_filename, \
pReader->binlog_offset); pReader->binlog_offset);
return EINVAL; return EINVAL;
@ -2095,12 +2095,12 @@ static int storage_write_to_mark_file(StorageBinLogReader *pReader)
len = sprintf(buff, \ len = sprintf(buff, \
"%s=%d\n" \ "%s=%d\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s=%d\n" \ "%s=%d\n" \
"%s=%d\n" \ "%s=%d\n" \
"%s=%d\n" \ "%s=%d\n" \
"%s="INT64_PRINTF_FORMAT"\n" \ "%s=%"PRId64"\n" \
"%s="INT64_PRINTF_FORMAT"\n", \ "%s=%"PRId64"\n", \
MARK_ITEM_BINLOG_FILE_INDEX, pReader->binlog_index, \ MARK_ITEM_BINLOG_FILE_INDEX, pReader->binlog_index, \
MARK_ITEM_BINLOG_FILE_OFFSET, pReader->binlog_offset, \ MARK_ITEM_BINLOG_FILE_OFFSET, pReader->binlog_offset, \
MARK_ITEM_NEED_SYNC_OLD, pReader->need_sync_old, \ MARK_ITEM_NEED_SYNC_OLD, pReader->need_sync_old, \
@ -2125,7 +2125,7 @@ static int rewind_to_prev_rec_end(StorageBinLogReader *pReader)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"seek binlog file \"%s\"fail, " \ "seek binlog file \"%s\"fail, " \
"file offset: "INT64_PRINTF_FORMAT", " \ "file offset: %"PRId64", " \
"errno: %d, error info: %s", \ "errno: %d, error info: %s", \
__LINE__, get_binlog_readable_filename(pReader, NULL), \ __LINE__, get_binlog_readable_filename(pReader, NULL), \
pReader->binlog_offset, \ pReader->binlog_offset, \
@ -2170,7 +2170,7 @@ static int storage_binlog_preread(StorageBinLogReader *pReader)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"read from binlog file \"%s\" fail, " \ "read from binlog file \"%s\" fail, " \
"file offset: "INT64_PRINTF_FORMAT", " \ "file offset: %"PRId64", " \
"error no: %d, error info: %s", __LINE__, \ "error no: %d, error info: %s", __LINE__, \
get_binlog_readable_filename(pReader, NULL), \ get_binlog_readable_filename(pReader, NULL), \
pReader->binlog_offset + pReader->binlog_buff.length, \ pReader->binlog_offset + pReader->binlog_buff.length, \
@ -2211,7 +2211,7 @@ static int storage_binlog_do_line_read(StorageBinLogReader *pReader, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"read from binlog file \"%s\" fail, " \ "read from binlog file \"%s\" fail, " \
"file offset: "INT64_PRINTF_FORMAT", " \ "file offset: %"PRId64", " \
"line buffer size: %d is too small! " \ "line buffer size: %d is too small! " \
"<= line length: %d", __LINE__, \ "<= line length: %d", __LINE__, \
get_binlog_readable_filename(pReader, NULL), \ get_binlog_readable_filename(pReader, NULL), \
@ -2279,7 +2279,7 @@ int storage_binlog_read(StorageBinLogReader *pReader, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"binlog file \"%s\" not ended by \\n, " \ "binlog file \"%s\" not ended by \\n, " \
"file offset: "INT64_PRINTF_FORMAT, __LINE__, \ "file offset: %"PRId64, __LINE__, \
get_binlog_readable_filename(pReader, NULL), \ get_binlog_readable_filename(pReader, NULL), \
pReader->binlog_offset); pReader->binlog_offset);
return ENOENT; return ENOENT;
@ -2305,7 +2305,7 @@ int storage_binlog_read(StorageBinLogReader *pReader, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"read data from binlog file \"%s\" fail, " \ "read data from binlog file \"%s\" fail, " \
"file offset: "INT64_PRINTF_FORMAT", " \ "file offset: %"PRId64", " \
"read item count: %d < 3", \ "read item count: %d < 3", \
__LINE__, get_binlog_readable_filename(pReader, NULL), \ __LINE__, get_binlog_readable_filename(pReader, NULL), \
pReader->binlog_offset, result); pReader->binlog_offset, result);
@ -2320,7 +2320,7 @@ int storage_binlog_read(StorageBinLogReader *pReader, \
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"item \"filename\" in binlog " \ "item \"filename\" in binlog " \
"file \"%s\" is invalid, file offset: " \ "file \"%s\" is invalid, file offset: " \
INT64_PRINTF_FORMAT", filename length: %d > %d", \ "%"PRId64", filename length: %d > %d", \
__LINE__, get_binlog_readable_filename(pReader, NULL), \ __LINE__, get_binlog_readable_filename(pReader, NULL), \
pReader->binlog_offset, \ pReader->binlog_offset, \
pRecord->filename_len, (int)sizeof(pRecord->filename)-1); pRecord->filename_len, (int)sizeof(pRecord->filename)-1);
@ -2915,7 +2915,7 @@ static void* storage_sync_thread_entrance(void* arg)
{ {
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"skip invalid record, binlog index: " \ "skip invalid record, binlog index: " \
"%d, offset: "INT64_PRINTF_FORMAT, \ "%d, offset: %"PRId64, \
__LINE__, reader.binlog_index, \ __LINE__, reader.binlog_index, \
reader.binlog_offset); reader.binlog_offset);
} }
@ -2930,8 +2930,8 @@ static void* storage_sync_thread_entrance(void* arg)
{ {
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"binlog index: %d, current record " \ "binlog index: %d, current record " \
"offset: "INT64_PRINTF_FORMAT", next " \ "offset: %"PRId64", next " \
"record offset: "INT64_PRINTF_FORMAT, \ "record offset: %"PRId64, \
__LINE__, reader.binlog_index, \ __LINE__, reader.binlog_index, \
reader.binlog_offset, \ reader.binlog_offset, \
reader.binlog_offset + record_len); reader.binlog_offset + record_len);

View File

@ -1029,7 +1029,7 @@ static int tracker_check_response(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, " \ "tracker server %s:%d, " \
"package size "INT64_PRINTF_FORMAT" is not correct", \ "package size %"PRId64" is not correct", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, nInPackLen); pTrackerServer->port, nInPackLen);
return EINVAL; return EINVAL;
@ -1039,7 +1039,7 @@ static int tracker_check_response(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, package size " \ "tracker server %s:%d, package size " \
INT64_PRINTF_FORMAT" is too large, " \ "%"PRId64" is too large, " \
"exceed max: %d", \ "exceed max: %d", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, \ pTrackerServer->port, \
@ -1374,7 +1374,7 @@ int tracker_sync_src_req(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, " \ "tracker server %s:%d, " \
"recv body length: "INT64_PRINTF_FORMAT" is invalid, " \ "recv body length: %"PRId64" is invalid, " \
"expect body length: %d", \ "expect body length: %d", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes, \ pTrackerServer->port, in_bytes, \
@ -1430,7 +1430,7 @@ static int tracker_sync_dest_req(ConnectionInfo *pTrackerServer)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, " \ "tracker server %s:%d, " \
"recv body length: "INT64_PRINTF_FORMAT" is invalid, " \ "recv body length: %"PRId64" is invalid, " \
"expect body length: %d", \ "expect body length: %d", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes, \ pTrackerServer->port, in_bytes, \
@ -1486,7 +1486,7 @@ static int tracker_sync_dest_query(ConnectionInfo *pTrackerServer)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, " \ "tracker server %s:%d, " \
"recv body length: "INT64_PRINTF_FORMAT" is invalid, " \ "recv body length: %"PRId64" is invalid, " \
"expect body length: %d", \ "expect body length: %d", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes, \ pTrackerServer->port, in_bytes, \
@ -1536,7 +1536,7 @@ static int tracker_report_trunk_fid(ConnectionInfo *pTrackerServer)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, recv body length: " \ "tracker server %s:%d, recv body length: " \
INT64_PRINTF_FORMAT" != 0", \ "%"PRId64" != 0", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
return EINVAL; return EINVAL;
@ -1579,7 +1579,7 @@ static int tracker_report_trunk_free_space(ConnectionInfo *pTrackerServer)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, recv body length: " \ "tracker server %s:%d, recv body length: " \
INT64_PRINTF_FORMAT" != 0", \ "%"PRId64" != 0", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
return EINVAL; return EINVAL;
@ -1624,7 +1624,7 @@ static int tracker_fetch_trunk_fid(ConnectionInfo *pTrackerServer)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, recv body length: " \ "tracker server %s:%d, recv body length: " \
INT64_PRINTF_FORMAT" != %d", \ "%"PRId64" != %d", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes, (int)sizeof(in_buff)); pTrackerServer->port, in_bytes, (int)sizeof(in_buff));
return EINVAL; return EINVAL;
@ -1693,7 +1693,7 @@ static int tracker_sync_notify(ConnectionInfo *pTrackerServer)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, recv body length: " \ "tracker server %s:%d, recv body length: " \
INT64_PRINTF_FORMAT" != 0", \ "%"PRId64" != 0", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes); pTrackerServer->port, in_bytes);
return EINVAL; return EINVAL;
@ -1827,7 +1827,7 @@ int tracker_report_join(ConnectionInfo *pTrackerServer, \
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, recv data fail, " \ "tracker server %s:%d, recv data fail, " \
"expect %d bytes, but recv " \ "expect %d bytes, but recv " \
INT64_PRINTF_FORMAT" bytes", \ "%"PRId64" bytes", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, \ pTrackerServer->port, \
(int)sizeof(respBody), in_bytes); (int)sizeof(respBody), in_bytes);

View File

@ -183,7 +183,7 @@ static int trunk_client_trunk_confirm_or_free(ConnectionInfo *pTrunkServer,\
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"storage server %s:%d response data " \ "storage server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"should == 0", __LINE__, pTrunkServer->ip_addr, \ "should == 0", __LINE__, pTrunkServer->ip_addr, \
pTrunkServer->port, in_bytes); pTrunkServer->port, in_bytes);
return EINVAL; return EINVAL;

View File

@ -253,7 +253,7 @@ int storage_trunk_init()
logInfo("file: "__FILE__", line: %d, " \ logInfo("file: "__FILE__", line: %d, " \
"tree by space size node count: %d, tree by trunk file id " \ "tree by space size node count: %d, tree by trunk file id " \
"node count: %d, free block count: %d, " \ "node count: %d, free block count: %d, " \
"trunk_total_free_space: "INT64_PRINTF_FORMAT, __LINE__, \ "trunk_total_free_space: %"PRId64, __LINE__, \
count, trunk_free_block_tree_node_count(), \ count, trunk_free_block_tree_node_count(), \
trunk_free_block_total_count(), \ trunk_free_block_total_count(), \
g_trunk_total_free_space); g_trunk_total_free_space);
@ -422,7 +422,7 @@ static int storage_trunk_do_save()
return result; return result;
} }
len = sprintf(callback_args.pCurrent, INT64_PRINTF_FORMAT"\n", \ len = sprintf(callback_args.pCurrent, "%"PRId64"\n", \
trunk_binlog_size); trunk_binlog_size);
callback_args.pCurrent += len; callback_args.pCurrent += len;
@ -682,16 +682,16 @@ static int storage_trunk_restore(const int64_t restore_offset)
if (restore_offset > trunk_binlog_size) if (restore_offset > trunk_binlog_size)
{ {
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"restore_offset: "INT64_PRINTF_FORMAT \ "restore_offset: %"PRId64 \
" > trunk_binlog_size: "INT64_PRINTF_FORMAT, \ " > trunk_binlog_size: %"PRId64, \
__LINE__, restore_offset, trunk_binlog_size); __LINE__, restore_offset, trunk_binlog_size);
return storage_trunk_save(); return storage_trunk_save();
} }
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"trunk metadata recovering, start offset: " \ "trunk metadata recovering, start offset: " \
INT64_PRINTF_FORMAT", need recovery binlog bytes: " \ "%"PRId64", need recovery binlog bytes: " \
INT64_PRINTF_FORMAT, __LINE__, \ "%"PRId64, __LINE__, \
restore_offset, trunk_binlog_size - restore_offset); restore_offset, trunk_binlog_size - restore_offset);
trunk_init_reload_from_binlog = (restore_offset == 0); trunk_init_reload_from_binlog = (restore_offset == 0);
@ -739,8 +739,8 @@ static int storage_trunk_restore(const int64_t restore_offset)
if (result != 0) if (result != 0)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"binlog offset: "INT64_PRINTF_FORMAT \ "binlog offset: %"PRId64 \
" < binlog size: "INT64_PRINTF_FORMAT \ " < binlog size: %"PRId64 \
", please check the end of trunk " \ ", please check the end of trunk " \
"binlog", __LINE__, \ "binlog", __LINE__, \
reader.binlog_offset, trunk_binlog_size); reader.binlog_offset, trunk_binlog_size);
@ -794,7 +794,7 @@ static int storage_trunk_restore(const int64_t restore_offset)
buff, sizeof(buff)); buff, sizeof(buff));
logWarning("file: "__FILE__", line: %d"\ logWarning("file: "__FILE__", line: %d"\
", trunk data line: " \ ", trunk data line: " \
INT64_PRINTF_FORMAT", trunk "\ "%"PRId64", trunk "\
"space already exist, "\ "space already exist, "\
"trunk info: %s", \ "trunk info: %s", \
__LINE__, line_count, buff); __LINE__, line_count, buff);
@ -819,8 +819,8 @@ static int storage_trunk_restore(const int64_t restore_offset)
trunk_info_dump(&(record.trunk), \ trunk_info_dump(&(record.trunk), \
buff, sizeof(buff)); buff, sizeof(buff));
logWarning("file: "__FILE__", line: %d"\ logWarning("file: "__FILE__", line: %d"\
", binlog offset: "INT64_PRINTF_FORMAT \ ", binlog offset: %"PRId64 \
", trunk data line: "INT64_PRINTF_FORMAT \ ", trunk data line: %"PRId64 \
" trunk node not exist, " \ " trunk node not exist, " \
"trunk info: %s", __LINE__, \ "trunk info: %s", __LINE__, \
reader.binlog_offset, \ reader.binlog_offset, \
@ -833,8 +833,8 @@ static int storage_trunk_restore(const int64_t restore_offset)
if (result == ENOENT) if (result == ENOENT)
{ {
logDebug("file: "__FILE__", line: %d, "\ logDebug("file: "__FILE__", line: %d, "\
"binlog offset: "INT64_PRINTF_FORMAT \ "binlog offset: %"PRId64 \
", trunk data line: "INT64_PRINTF_FORMAT,\ ", trunk data line: %"PRId64,\
__LINE__, reader.binlog_offset, \ __LINE__, reader.binlog_offset, \
line_count); line_count);
@ -890,8 +890,8 @@ static int storage_trunk_restore(const int64_t restore_offset)
{ {
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"trunk metadata recovery done. start offset: " \ "trunk metadata recovery done. start offset: " \
INT64_PRINTF_FORMAT", recovery file size: " \ "%"PRId64", recovery file size: " \
INT64_PRINTF_FORMAT, __LINE__, \ "%"PRId64, __LINE__, \
restore_offset, trunk_binlog_size - restore_offset); restore_offset, trunk_binlog_size - restore_offset);
return storage_trunk_save(); return storage_trunk_save();
} }
@ -1814,8 +1814,8 @@ int trunk_check_and_init_file_ex(const char *filename, const int64_t file_size)
} }
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"file: %s, file size: "INT64_PRINTF_FORMAT \ "file: %s, file size: %"PRId64 \
" < "INT64_PRINTF_FORMAT", should be resize", \ " < %"PRId64", should be resize", \
__LINE__, filename, (int64_t)file_stat.st_size, file_size); __LINE__, filename, (int64_t)file_stat.st_size, file_size);
fd = open(filename, O_WRONLY, 0644); fd = open(filename, O_WRONLY, 0644);

View File

@ -810,7 +810,7 @@ int trunk_open_readable_binlog(TrunkBinLogReader *pReader, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"seek binlog file \"%s\" fail, file offset=" \ "seek binlog file \"%s\" fail, file offset=" \
INT64_PRINTF_FORMAT", errno: %d, error info: %s", \ "%"PRId64", errno: %d, error info: %s", \
__LINE__, full_filename, pReader->binlog_offset, \ __LINE__, full_filename, pReader->binlog_offset, \
errno, STRERROR(errno)); errno, STRERROR(errno));
@ -971,7 +971,7 @@ int trunk_reader_init(FDFSStorageBrief *pStorage, TrunkBinLogReader *pReader)
iniFreeContext(&iniContext); iniFreeContext(&iniContext);
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"in mark file \"%s\", binlog_offset: "\ "in mark file \"%s\", binlog_offset: "\
INT64_PRINTF_FORMAT" < 0", \ "%"PRId64" < 0", \
__LINE__, full_filename, \ __LINE__, full_filename, \
pReader->binlog_offset); pReader->binlog_offset);
return EINVAL; return EINVAL;
@ -1046,7 +1046,7 @@ static int trunk_write_to_mark_file(TrunkBinLogReader *pReader)
int result; int result;
len = sprintf(buff, \ len = sprintf(buff, \
"%s="INT64_PRINTF_FORMAT"\n", \ "%s=%"PRId64"\n", \
MARK_ITEM_BINLOG_FILE_OFFSET, pReader->binlog_offset); MARK_ITEM_BINLOG_FILE_OFFSET, pReader->binlog_offset);
if ((result=storage_write_to_fd(pReader->mark_fd, \ if ((result=storage_write_to_fd(pReader->mark_fd, \
@ -1094,7 +1094,7 @@ static int trunk_binlog_preread(TrunkBinLogReader *pReader)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"read from binlog file \"%s\" fail, " \ "read from binlog file \"%s\" fail, " \
"file offset: "INT64_PRINTF_FORMAT", " \ "file offset: %"PRId64", " \
"error no: %d, error info: %s", __LINE__, \ "error no: %d, error info: %s", __LINE__, \
get_binlog_readable_filename(pReader, NULL), \ get_binlog_readable_filename(pReader, NULL), \
pReader->binlog_offset + pReader->binlog_buff.length, \ pReader->binlog_offset + pReader->binlog_buff.length, \
@ -1133,7 +1133,7 @@ static int trunk_binlog_do_line_read(TrunkBinLogReader *pReader, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"read from binlog file \"%s\" fail, " \ "read from binlog file \"%s\" fail, " \
"file offset: "INT64_PRINTF_FORMAT", " \ "file offset: %"PRId64", " \
"line buffer size: %d is too small! " \ "line buffer size: %d is too small! " \
"<= line length: %d", __LINE__, \ "<= line length: %d", __LINE__, \
get_binlog_readable_filename(pReader, NULL), \ get_binlog_readable_filename(pReader, NULL), \
@ -1191,7 +1191,7 @@ int trunk_binlog_read(TrunkBinLogReader *pReader, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"read data from binlog file \"%s\" fail, " \ "read data from binlog file \"%s\" fail, " \
"file offset: "INT64_PRINTF_FORMAT", " \ "file offset: %"PRId64", " \
"read item count: %d < %d", \ "read item count: %d < %d", \
__LINE__, get_binlog_readable_filename(pReader, NULL), \ __LINE__, get_binlog_readable_filename(pReader, NULL), \
pReader->binlog_offset, result, COL_COUNT); pReader->binlog_offset, result, COL_COUNT);

View File

@ -156,13 +156,13 @@ static int combine_stat_by(const char *file_prefix, EntryStat *stats, const int
continue; continue;
} }
if (sscanf(buff, "%s %d %d "INT64_PRINTF_FORMAT, id, \ if (sscanf(buff, "%s %d %d %"PRId64, id, \
&total_count, &success_count, &time_used) != 4) &total_count, &success_count, &time_used) != 4)
{ {
if (*buff == ' ') //empty id (eg. storage ip) if (*buff == ' ') //empty id (eg. storage ip)
{ {
*id = '\0'; *id = '\0';
if (sscanf(buff+1, "%d %d "INT64_PRINTF_FORMAT, \ if (sscanf(buff+1, "%d %d %"PRId64, \
&total_count, &success_count, &time_used) != 3) &total_count, &success_count, &time_used) != 3)
{ {
printf("sscanf %s fail, errno: %d, error info: %s\n", printf("sscanf %s fail, errno: %d, error info: %s\n",

View File

@ -212,7 +212,7 @@ static int save_stats_by_file_type()
fprintf(fp, "#file_type total_count success_count time_used(ms)\n"); fprintf(fp, "#file_type total_count success_count time_used(ms)\n");
for (k=0; k<FILE_TYPE_COUNT; k++) for (k=0; k<FILE_TYPE_COUNT; k++)
{ {
fprintf(fp, "%s %d %d "INT64_PRINTF_FORMAT"\n", \ fprintf(fp, "%s %d %d %"PRId64"\n", \
files[k].filename, files[k].delete_count, \ files[k].filename, files[k].delete_count, \
files[k].success_count, files[k].time_used); files[k].success_count, files[k].time_used);
} }
@ -238,7 +238,7 @@ static int save_stats_by_storage_ip()
fprintf(fp, "#ip_addr total_count success_count time_used(ms)\n"); fprintf(fp, "#ip_addr total_count success_count time_used(ms)\n");
for (k=0; k<storage_count; k++) for (k=0; k<storage_count; k++)
{ {
fprintf(fp, "%s %d %d "INT64_PRINTF_FORMAT"\n", \ fprintf(fp, "%s %d %d %"PRId64"\n", \
storages[k].ip_addr, storages[k].total_count, \ storages[k].ip_addr, storages[k].total_count, \
storages[k].success_count, storages[k].time_used); storages[k].success_count, storages[k].time_used);
} }

View File

@ -236,7 +236,7 @@ static int save_stats_by_file_type()
fprintf(fp, "#file_type total_count success_count time_used(ms)\n"); fprintf(fp, "#file_type total_count success_count time_used(ms)\n");
for (k=0; k<FILE_TYPE_COUNT; k++) for (k=0; k<FILE_TYPE_COUNT; k++)
{ {
fprintf(fp, "%s %d %d "INT64_PRINTF_FORMAT"\n", \ fprintf(fp, "%s %d %d %"PRId64"\n", \
files[k].filename, files[k].download_count, \ files[k].filename, files[k].download_count, \
files[k].success_count, files[k].time_used); files[k].success_count, files[k].time_used);
} }
@ -262,7 +262,7 @@ static int save_stats_by_storage_ip()
fprintf(fp, "#ip_addr total_count success_count time_used(ms)\n"); fprintf(fp, "#ip_addr total_count success_count time_used(ms)\n");
for (k=0; k<storage_count; k++) for (k=0; k<storage_count; k++)
{ {
fprintf(fp, "%s %d %d "INT64_PRINTF_FORMAT"\n", \ fprintf(fp, "%s %d %d %"PRId64"\n", \
storages[k].ip_addr, storages[k].total_count, \ storages[k].ip_addr, storages[k].total_count, \
storages[k].success_count, storages[k].time_used); storages[k].success_count, storages[k].time_used);
} }

View File

@ -241,7 +241,7 @@ static int save_stats_by_file_type()
fprintf(fp, "#file_type total_count success_count time_used(ms)\n"); fprintf(fp, "#file_type total_count success_count time_used(ms)\n");
for (k=0; k<FILE_TYPE_COUNT; k++) for (k=0; k<FILE_TYPE_COUNT; k++)
{ {
fprintf(fp, "%s %d %d "INT64_PRINTF_FORMAT"\n", \ fprintf(fp, "%s %d %d %"PRId64"\n", \
files[k].filename, files[k].upload_count, \ files[k].filename, files[k].upload_count, \
files[k].success_count, files[k].time_used); files[k].success_count, files[k].time_used);
} }
@ -267,7 +267,7 @@ static int save_stats_by_storage_ip()
fprintf(fp, "#ip_addr total_count success_count time_used(ms)\n"); fprintf(fp, "#ip_addr total_count success_count time_used(ms)\n");
for (k=0; k<storage_count; k++) for (k=0; k<storage_count; k++)
{ {
fprintf(fp, "%s %d %d "INT64_PRINTF_FORMAT"\n", \ fprintf(fp, "%s %d %d %"PRId64"\n", \
storages[k].ip_addr, storages[k].total_count, \ storages[k].ip_addr, storages[k].total_count, \
storages[k].success_count, storages[k].time_used); storages[k].success_count, storages[k].time_used);
} }

View File

@ -230,8 +230,8 @@ bool fdfs_check_reserved_space_path(const int64_t total_mb, \
} }
/* /*
logInfo("storage path, free_mb="INT64_PRINTF_FORMAT \ logInfo("storage path, free_mb=%"PRId64 \
", total_mb="INT64_PRINTF_FORMAT", " \ ", total_mb=%"PRId64", " \
"real ratio=%.4f, rs.ratio=%.4f", \ "real ratio=%.4f, rs.ratio=%.4f", \
free_mb, total_mb, ((double)free_mb / total_mb), \ free_mb, total_mb, ((double)free_mb / total_mb), \
pStorageReservedSpace->rs.ratio); pStorageReservedSpace->rs.ratio);

View File

@ -40,8 +40,8 @@ static int fdfs_dump_group_stat(FDFSGroupInfo *pGroup, char *buff, const int buf
total_len = snprintf(buff, buffSize, total_len = snprintf(buff, buffSize,
"group_name=%s\n" "group_name=%s\n"
"total_mb="INT64_PRINTF_FORMAT"\n" "total_mb=%"PRId64"\n"
"free_mb="INT64_PRINTF_FORMAT"\n" "free_mb=%"PRId64"\n"
"alloc_size=%d\n" "alloc_size=%d\n"
"server count=%d\n" "server count=%d\n"
"active server count=%d\n" "active server count=%d\n"
@ -178,9 +178,9 @@ static int fdfs_dump_storage_stat(FDFSStorageDetail *pServer,
"sync_until_timestamp=%s\n" "sync_until_timestamp=%s\n"
"join_time=%s\n" "join_time=%s\n"
"up_time=%s\n" "up_time=%s\n"
"total_mb="INT64_PRINTF_FORMAT" MB\n" "total_mb=%"PRId64" MB\n"
"free_mb="INT64_PRINTF_FORMAT" MB\n" "free_mb=%"PRId64" MB\n"
"changelog_offset="INT64_PRINTF_FORMAT"\n" "changelog_offset=%"PRId64"\n"
"store_path_count=%d\n" "store_path_count=%d\n"
"storage_port=%d\n" "storage_port=%d\n"
"storage_http_port=%d\n" "storage_http_port=%d\n"
@ -195,20 +195,20 @@ static int fdfs_dump_storage_stat(FDFSStorageDetail *pServer,
"http_check_error_info=%s\n" "http_check_error_info=%s\n"
#endif #endif
"total_upload_count="INT64_PRINTF_FORMAT"\n" "total_upload_count=%"PRId64"\n"
"success_upload_count="INT64_PRINTF_FORMAT"\n" "success_upload_count=%"PRId64"\n"
"total_set_meta_count="INT64_PRINTF_FORMAT"\n" "total_set_meta_count=%"PRId64"\n"
"success_set_meta_count="INT64_PRINTF_FORMAT"\n" "success_set_meta_count=%"PRId64"\n"
"total_delete_count="INT64_PRINTF_FORMAT"\n" "total_delete_count=%"PRId64"\n"
"success_delete_count="INT64_PRINTF_FORMAT"\n" "success_delete_count=%"PRId64"\n"
"total_download_count="INT64_PRINTF_FORMAT"\n" "total_download_count=%"PRId64"\n"
"success_download_count="INT64_PRINTF_FORMAT"\n" "success_download_count=%"PRId64"\n"
"total_get_meta_count="INT64_PRINTF_FORMAT"\n" "total_get_meta_count=%"PRId64"\n"
"success_get_meta_count="INT64_PRINTF_FORMAT"\n" "success_get_meta_count=%"PRId64"\n"
"total_create_link_count="INT64_PRINTF_FORMAT"\n" "total_create_link_count=%"PRId64"\n"
"success_create_link_count="INT64_PRINTF_FORMAT"\n" "success_create_link_count=%"PRId64"\n"
"total_delete_link_count="INT64_PRINTF_FORMAT"\n" "total_delete_link_count=%"PRId64"\n"
"success_delete_link_count="INT64_PRINTF_FORMAT"\n" "success_delete_link_count=%"PRId64"\n"
"last_source_update=%s\n" "last_source_update=%s\n"
"last_sync_update=%s\n" "last_sync_update=%s\n"
"last_synced_timestamp=%s\n" "last_synced_timestamp=%s\n"
@ -275,8 +275,8 @@ static int fdfs_dump_storage_stat(FDFSStorageDetail *pServer,
for (i=0; i<pServer->store_path_count; i++) for (i=0; i<pServer->store_path_count; i++)
{ {
total_len += snprintf(buff + total_len, buffSize - total_len, total_len += snprintf(buff + total_len, buffSize - total_len,
"disk %d: total_mb="INT64_PRINTF_FORMAT" MB, " "disk %d: total_mb=%"PRId64" MB, "
"free_mb="INT64_PRINTF_FORMAT" MB\n", "free_mb=%"PRId64" MB\n",
i+1, pServer->path_total_mbs[i], i+1, pServer->path_total_mbs[i],
pServer->path_free_mbs[i]); pServer->path_free_mbs[i]);
} }
@ -313,7 +313,7 @@ static int fdfs_dump_global_vars(char *buff, const int buffSize)
"slot_min_size=%d\n" "slot_min_size=%d\n"
"slot_max_size=%d MB\n" "slot_max_size=%d MB\n"
"trunk_file_size=%d MB\n" "trunk_file_size=%d MB\n"
"g_changelog_fsize="INT64_PRINTF_FORMAT"\n" "g_changelog_fsize=%"PRId64"\n"
"g_storage_sync_file_max_delay=%ds\n" "g_storage_sync_file_max_delay=%ds\n"
"g_storage_sync_file_max_time=%ds\n" "g_storage_sync_file_max_time=%ds\n"
"g_up_time=%d\n" "g_up_time=%d\n"

View File

@ -599,7 +599,7 @@ int tracker_load_from_conf_file(const char *filename, \
{ {
logWarning("file: "__FILE__", line: %d, " \ logWarning("file: "__FILE__", line: %d, " \
"item \"rotate_error_log_size\": " \ "item \"rotate_error_log_size\": " \
INT64_PRINTF_FORMAT" is too small, " \ "%"PRId64" is too small, " \
"change to 1 MB", __LINE__, \ "change to 1 MB", __LINE__, \
rotate_error_log_size); rotate_error_log_size);
rotate_error_log_size = FDFS_ONE_MB; rotate_error_log_size = FDFS_ONE_MB;
@ -691,7 +691,7 @@ int tracker_load_from_conf_file(const char *filename, \
"storage_id_count=%d, " \ "storage_id_count=%d, " \
"rotate_error_log=%d, " \ "rotate_error_log=%d, " \
"error_log_rotate_time=%02d:%02d, " \ "error_log_rotate_time=%02d:%02d, " \
"rotate_error_log_size="INT64_PRINTF_FORMAT", " \ "rotate_error_log_size=%"PRId64", " \
"store_slave_file_use_link=%d, " \ "store_slave_file_use_link=%d, " \
"use_connection_pool=%d, " \ "use_connection_pool=%d, " \
"g_connection_pool_max_idle_time=%ds", \ "g_connection_pool_max_idle_time=%ds", \

View File

@ -1917,45 +1917,45 @@ int tracker_save_storages()
"\t%s=%d\n" \ "\t%s=%d\n" \
"\t%s=%d\n" \ "\t%s=%d\n" \
"\t%s=%d\n" \ "\t%s=%d\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s="INT64_PRINTF_FORMAT"\n" \ "\t%s=%"PRId64"\n" \
"\t%s=%d\n" \ "\t%s=%d\n" \
"\t%s=%d\n" \ "\t%s=%d\n" \
"\t%s=%d\n" \ "\t%s=%d\n" \
"\t%s=%d\n" \ "\t%s=%d\n" \
"\t%s="INT64_PRINTF_FORMAT"\n\n", \ "\t%s=%"PRId64"\n\n", \
pStorage->ip_addr, pStorage->storage_port, \ pStorage->ip_addr, pStorage->storage_port, \
STORAGE_SECTION_NAME_PREFIX, count, id_buff, \ STORAGE_SECTION_NAME_PREFIX, count, id_buff, \
STORAGE_ITEM_GROUP_NAME, \ STORAGE_ITEM_GROUP_NAME, \
@ -3699,7 +3699,7 @@ int tracker_mem_get_status(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"expect length: %d.", __LINE__, \ "expect length: %d.", __LINE__, \
pTrackerServer->ip_addr, pTrackerServer->port, \ pTrackerServer->ip_addr, pTrackerServer->port, \
in_bytes, (int)sizeof(in_buff)); in_bytes, (int)sizeof(in_buff));
@ -3787,7 +3787,7 @@ static int tracker_mem_get_sys_file_piece(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"expect length >= %d.", __LINE__, \ "expect length >= %d.", __LINE__, \
pTrackerServer->ip_addr, pTrackerServer->port, \ pTrackerServer->ip_addr, pTrackerServer->port, \
in_bytes, FDFS_PROTO_PKG_LEN_SIZE); in_bytes, FDFS_PROTO_PKG_LEN_SIZE);
@ -3800,7 +3800,7 @@ static int tracker_mem_get_sys_file_piece(ConnectionInfo *pTrackerServer, \
if (*file_size < 0) if (*file_size < 0)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, file size: "INT64_PRINTF_FORMAT\ "tracker server %s:%d, file size: %"PRId64\
" < 0", __LINE__, pTrackerServer->ip_addr, \ " < 0", __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, *file_size); pTrackerServer->port, *file_size);
return EINVAL; return EINVAL;
@ -3809,7 +3809,7 @@ static int tracker_mem_get_sys_file_piece(ConnectionInfo *pTrackerServer, \
if (*file_size > 0 && write_bytes == 0) if (*file_size > 0 && write_bytes == 0)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d, file size: "INT64_PRINTF_FORMAT\ "tracker server %s:%d, file size: %"PRId64\
" > 0, but file content is empty", __LINE__, \ " > 0, but file content is empty", __LINE__, \
pTrackerServer->ip_addr, pTrackerServer->port, \ pTrackerServer->ip_addr, pTrackerServer->port, \
*file_size); *file_size);
@ -4647,7 +4647,7 @@ int tracker_mem_add_group_and_storage(TrackerClientInfo *pClientInfo, \
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"storage server %s::%s join in, remain changelog bytes: " \ "storage server %s::%s join in, remain changelog bytes: " \
INT64_PRINTF_FORMAT, __LINE__, \ "%"PRId64, __LINE__, \
pClientInfo->pGroup->group_name, ip_addr, \ pClientInfo->pGroup->group_name, ip_addr, \
g_changelog_fsize - pStorageServer->changelog_offset); g_changelog_fsize - pStorageServer->changelog_offset);
@ -4828,7 +4828,7 @@ static int _storage_get_trunk_binlog_size(
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"storage server %s:%d, recv body length: " \ "storage server %s:%d, recv body length: " \
INT64_PRINTF_FORMAT" != %d", \ "%"PRId64" != %d", \
__LINE__, pStorageServer->ip_addr, \ __LINE__, pStorageServer->ip_addr, \
pStorageServer->port, in_bytes, (int)sizeof(in_buff)); pStorageServer->port, in_bytes, (int)sizeof(in_buff));
return EINVAL; return EINVAL;
@ -4859,7 +4859,7 @@ static int tracker_mem_get_trunk_binlog_size(
logDebug("file: "__FILE__", line: %d, " \ logDebug("file: "__FILE__", line: %d, " \
"storage %s:%d, trunk binlog file size: "INT64_PRINTF_FORMAT, \ "storage %s:%d, trunk binlog file size: %"PRId64, \
__LINE__, storage_server.ip_addr, storage_server.port, \ __LINE__, storage_server.ip_addr, storage_server.port, \
*file_size); *file_size);
return result; return result;

View File

@ -57,7 +57,7 @@ int fdfs_recv_header(ConnectionInfo *pTrackerServer, int64_t *in_bytes)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"server: %s:%d, recv package size " \ "server: %s:%d, recv package size " \
INT64_PRINTF_FORMAT" is not correct", \ "%"PRId64" is not correct", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, *in_bytes); pTrackerServer->port, *in_bytes);
*in_bytes = 0; *in_bytes = 0;
@ -93,7 +93,7 @@ int fdfs_recv_response(ConnectionInfo *pTrackerServer, \
*in_bytes = 0; *in_bytes = 0;
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"malloc "INT64_PRINTF_FORMAT" bytes fail", \ "malloc %"PRId64" bytes fail", \
__LINE__, (*in_bytes) + 1); __LINE__, (*in_bytes) + 1);
return errno != 0 ? errno : ENOMEM; return errno != 0 ? errno : ENOMEM;
} }
@ -106,7 +106,7 @@ int fdfs_recv_response(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"server: %s:%d, recv body bytes: " \ "server: %s:%d, recv body bytes: " \
INT64_PRINTF_FORMAT" exceed max: %d", \ "%"PRId64" exceed max: %d", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, *in_bytes, buff_size); pTrackerServer->port, *in_bytes, buff_size);
*in_bytes = 0; *in_bytes = 0;
@ -194,7 +194,7 @@ int fdfs_deal_no_body_cmd(ConnectionInfo *pTrackerServer, const int cmd)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"server ip: %s, expect body length 0, " \ "server ip: %s, expect body length 0, " \
"but received: "INT64_PRINTF_FORMAT, __LINE__, \ "but received: %"PRId64, __LINE__, \
pTrackerServer->ip_addr, in_bytes); pTrackerServer->ip_addr, in_bytes);
return EINVAL; return EINVAL;
} }
@ -498,7 +498,7 @@ static int fdfs_do_parameter_req(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"server: %s:%d, recv body bytes: " \ "server: %s:%d, recv body bytes: " \
INT64_PRINTF_FORMAT" exceed max: %d", \ "%"PRId64" exceed max: %d", \
__LINE__, pTrackerServer->ip_addr, \ __LINE__, pTrackerServer->ip_addr, \
pTrackerServer->port, in_bytes, buff_size); pTrackerServer->port, in_bytes, buff_size);
return ENOSPC; return ENOSPC;

View File

@ -76,7 +76,7 @@ static int fdfs_ping_leader(ConnectionInfo *pTrackerServer)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server ip: %s, invalid body length: " \ "tracker server ip: %s, invalid body length: " \
INT64_PRINTF_FORMAT, __LINE__, \ "%"PRId64, __LINE__, \
pTrackerServer->ip_addr, in_bytes); pTrackerServer->ip_addr, in_bytes);
return EINVAL; return EINVAL;
} }
@ -289,7 +289,7 @@ static int do_notify_leader_changed(ConnectionInfo *pTrackerServer, \
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"tracker server %s:%d response data " \ "tracker server %s:%d response data " \
"length: "INT64_PRINTF_FORMAT" is invalid, " \ "length: %"PRId64" is invalid, " \
"expect length: %d.", __LINE__, \ "expect length: %d.", __LINE__, \
pTrackerServer->ip_addr, pTrackerServer->port, \ pTrackerServer->ip_addr, pTrackerServer->port, \
in_bytes, 0); in_bytes, 0);

View File

@ -672,7 +672,7 @@ static int tracker_deal_parameter_req(struct fast_task_info *pTask)
"trunk_create_file_advance=%d\n" \ "trunk_create_file_advance=%d\n" \
"trunk_create_file_time_base=%02d:%02d\n" \ "trunk_create_file_time_base=%02d:%02d\n" \
"trunk_create_file_interval=%d\n" \ "trunk_create_file_interval=%d\n" \
"trunk_create_file_space_threshold="INT64_PRINTF_FORMAT"\n" \ "trunk_create_file_space_threshold=%"PRId64"\n" \
"trunk_init_check_occupying=%d\n" \ "trunk_init_check_occupying=%d\n" \
"trunk_init_reload_from_binlog=%d\n" \ "trunk_init_reload_from_binlog=%d\n" \
"trunk_compress_binlog_min_interval=%d\n" \ "trunk_compress_binlog_min_interval=%d\n" \
@ -808,7 +808,7 @@ static int tracker_deal_report_trunk_free_space(struct fast_task_info *pTask)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, invalid trunk free space: " \ "client ip: %s, invalid trunk free space: " \
INT64_PRINTF_FORMAT, __LINE__, pTask->client_ip, \ "%"PRId64, __LINE__, pTask->client_ip, \
trunk_free_space); trunk_free_space);
return EINVAL; return EINVAL;
} }
@ -1820,7 +1820,7 @@ static int tracker_deal_get_one_sys_file(struct fast_task_info *pTask)
if (offset < 0 || offset > file_stat.st_size) if (offset < 0 || offset > file_stat.st_size)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, invalid offset: "INT64_PRINTF_FORMAT "client ip: %s, invalid offset: %"PRId64
" < 0 or > "OFF_PRINTF_FORMAT, \ " < 0 or > "OFF_PRINTF_FORMAT, \
__LINE__, pTask->client_ip, offset, \ __LINE__, pTask->client_ip, offset, \
file_stat.st_size); file_stat.st_size);
@ -1850,8 +1850,8 @@ static int tracker_deal_get_one_sys_file(struct fast_task_info *pTask)
if (bytes != read_bytes) if (bytes != read_bytes)
{ {
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, " \
"client ip: %s, read bytes: "INT64_PRINTF_FORMAT "client ip: %s, read bytes: %"PRId64
" != expect bytes: "INT64_PRINTF_FORMAT, \ " != expect bytes: %"PRId64, \
__LINE__, pTask->client_ip, bytes, read_bytes); __LINE__, pTask->client_ip, bytes, read_bytes);
pTask->length = sizeof(TrackerHeader); pTask->length = sizeof(TrackerHeader);