diff options
| author | ame <[email protected]> | 2024-08-26 16:13:19 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-08-26 16:13:25 -0500 |
| commit | fda120441cabfefc511786d7a6af40eec9f181fa (patch) | |
| tree | 5d6e80abc948ba0034d3b4f32bba6746d95735e5 /src/hash/cityhash.c | |
| parent | 90c4b7dcbc57d2f86a77c997069d96158d54ca55 (diff) | |
use integer format macros
Diffstat (limited to 'src/hash/cityhash.c')
| -rw-r--r-- | src/hash/cityhash.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hash/cityhash.c b/src/hash/cityhash.c index f6f419a..18e35e5 100644 --- a/src/hash/cityhash.c +++ b/src/hash/cityhash.c @@ -1,5 +1,6 @@ #include <stdio.h>
#include <stdint.h>
+#include <inttypes.h>
#include "cityhash.h"
uint32_t rot32(uint32_t val, int shift) {
@@ -411,7 +412,7 @@ int l_cityhash64(lua_State* L){ char digest[64];
uint64_t u = cityhash64(a, len);
- sprintf(digest,"%016llx",u);
+ sprintf(digest,"%016"PRIx64,u);
lua_pushstring(L, digest);
return 1;
}
@@ -424,7 +425,7 @@ int l_cityhash128(lua_State* L){ uint64_t u1, u2;
cityhash128(a, len, &u1, &u2);
- sprintf(digest,"%08llx%08llx",u1, u2);
+ sprintf(digest,"%08"PRIx64"%08"PRIx64,u1, u2);
lua_pushstring(L, digest);
return 1;
}
|
