(rarchdb) Fix printf warnings

This commit is contained in:
twinaphex 2014-12-31 10:56:57 +01:00
parent fd74816e81
commit 8d1bfa20db
2 changed files with 17 additions and 3 deletions

View File

@ -86,7 +86,13 @@ int rarchdb_create(int fd, rarchdb_value_provider value_provider, void *ctx)
rarchdb_write_metadata(fd, &md);
lseek(fd, root, SEEK_SET);
write(fd, &header, sizeof(header));
printf("Created DB with %llu entries\n", item_count);
printf(
#ifdef _WIN32
"Created DB with %I64u entries\n"
#else
"Created DB with %llu entries\n"
#endif
,(unsigned long long)item_count);
return 0;
}

View File

@ -265,10 +265,18 @@ void rmsgpack_dom_value_print(struct rmsgpack_dom_value *obj)
printf("false");
break;
case RDT_INT:
printf("%lld", obj->int_);
#ifdef _WIN32
printf("%I64d", (signed long long)obj->int_);
#else
printf("%lld", (signed long long)obj->int_);
#endif
break;
case RDT_UINT:
printf("%llu", obj->uint_);
#ifdef _WIN32
printf("%I64u", (unsigned long long)obj->uint_);
#else
printf("%llu", (unsigned long long)obj->uint_);
#endif
break;
case RDT_STRING:
printf("\"%s\"", obj->string.buff);