diff options
author | Calvin Buckley <calvin@cmpct.info> | 2021-07-07 19:12:02 -0300 |
---|---|---|
committer | Calvin Buckley <calvin@cmpct.info> | 2021-07-07 19:12:02 -0300 |
commit | 52505ab5a2f0235d73553b6e8ecaa45943d1efc6 (patch) | |
tree | b4c6f5f4883cce7c68dd5d9201e6b22e075b35e8 /src | |
parent | c1aca3fedaf2cfe6d9bc7f5dbf5828a872dd74e5 (diff) | |
download | libgit2-52505ab5a2f0235d73553b6e8ecaa45943d1efc6.tar.gz |
Convert long long constant specifiers to stdint macros
Diffstat (limited to 'src')
-rw-r--r-- | src/commit_graph.c | 2 | ||||
-rw-r--r-- | src/diff_xdiff.h | 2 | ||||
-rw-r--r-- | src/hashsig.c | 2 | ||||
-rw-r--r-- | src/mwindow.c | 2 | ||||
-rw-r--r-- | src/util.h | 2 | ||||
-rw-r--r-- | src/win32/w32_util.h | 10 |
6 files changed, 10 insertions, 10 deletions
diff --git a/src/commit_graph.c b/src/commit_graph.c index b301d3d49..70b5b8c5f 100644 --- a/src/commit_graph.c +++ b/src/commit_graph.c @@ -304,7 +304,7 @@ static int git_commit_graph_entry_get_byindex( e->generation = ntohl(*((uint32_t *)(commit_data + GIT_OID_RAWSZ + 2 * sizeof(uint32_t)))); e->commit_time = ntohl(*((uint32_t *)(commit_data + GIT_OID_RAWSZ + 3 * sizeof(uint32_t)))); - e->commit_time |= (e->generation & 0x3ull) << 32ull; + e->commit_time |= (e->generation & UINT64_C(0x3)) << UINT64_C(32); e->generation >>= 2u; if (e->parent_indices[1] & 0x80000000u) { uint32_t extra_edge_list_pos = e->parent_indices[1] & 0x7fffffff; diff --git a/src/diff_xdiff.h b/src/diff_xdiff.h index aca80b131..9b303e9dc 100644 --- a/src/diff_xdiff.h +++ b/src/diff_xdiff.h @@ -16,7 +16,7 @@ /* xdiff cannot cope with large files. these files should not be passed to * xdiff. callers should treat these large files as binary. */ -#define GIT_XDIFF_MAX_SIZE (1024LL * 1024 * 1023) +#define GIT_XDIFF_MAX_SIZE (INT64_C(1024) * 1024 * 1023) /* A git_xdiff_output is a git_patch_generate_output with extra fields * necessary to use libxdiff. Calling git_xdiff_init() will set the diff_cb diff --git a/src/hashsig.c b/src/hashsig.c index a5fbeee10..43310ca48 100644 --- a/src/hashsig.c +++ b/src/hashsig.c @@ -17,7 +17,7 @@ typedef uint64_t hashsig_state; #define HASHSIG_SCALE 100 #define HASHSIG_MAX_RUN 80 -#define HASHSIG_HASH_START 0x012345678ABCDEF0LL +#define HASHSIG_HASH_START INT64_C(0x012345678ABCDEF0) #define HASHSIG_HASH_SHIFT 5 #define HASHSIG_HASH_MIX(S,CH) \ diff --git a/src/mwindow.c b/src/mwindow.c index 5fcae2eed..1ef35621e 100644 --- a/src/mwindow.c +++ b/src/mwindow.c @@ -20,7 +20,7 @@ : 32 * 1024 * 1024) #define DEFAULT_MAPPED_LIMIT \ - ((1024 * 1024) * (sizeof(void*) >= 8 ? 8192ULL : 256UL)) + ((1024 * 1024) * (sizeof(void*) >= 8 ? UINT64_C(8192) : 256UL)) /* default is unlimited */ #define DEFAULT_FILE_LIMIT 0 diff --git a/src/util.h b/src/util.h index dabd4c94a..56a60a4a2 100644 --- a/src/util.h +++ b/src/util.h @@ -22,7 +22,7 @@ #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define bitsizeof(x) (CHAR_BIT * sizeof(x)) -#define MSB(x, bits) ((x) & (~0ULL << (bitsizeof(x) - (bits)))) +#define MSB(x, bits) ((x) & (~UINT64_C(0) << (bitsizeof(x) - (bits)))) #ifndef min # define min(a,b) ((a) < (b) ? (a) : (b)) #endif diff --git a/src/win32/w32_util.h b/src/win32/w32_util.h index 060504ea0..1321d30e6 100644 --- a/src/win32/w32_util.h +++ b/src/win32/w32_util.h @@ -75,7 +75,7 @@ GIT_INLINE(void) git_win32__filetime_to_timespec( struct timespec *ts) { int64_t winTime = ((int64_t)ft->dwHighDateTime << 32) + ft->dwLowDateTime; - winTime -= 116444736000000000LL; /* Windows to Unix Epoch conversion */ + winTime -= INT64_C(116444736000000000); /* Windows to Unix Epoch conversion */ ts->tv_sec = (time_t)(winTime / 10000000); #ifdef GIT_USE_NSEC ts->tv_nsec = (winTime % 10000000) * 100; @@ -87,11 +87,11 @@ GIT_INLINE(void) git_win32__filetime_to_timespec( GIT_INLINE(void) git_win32__timeval_to_filetime( FILETIME *ft, const struct p_timeval tv) { - int64_t ticks = (tv.tv_sec * 10000000LL) + - (tv.tv_usec * 10LL) + 116444736000000000LL; + int64_t ticks = (tv.tv_sec * INT64_C(10000000)) + + (tv.tv_usec * INT64_C(10)) + INT64_C(116444736000000000); - ft->dwHighDateTime = ((ticks >> 32) & 0xffffffffLL); - ft->dwLowDateTime = (ticks & 0xffffffffLL); + ft->dwHighDateTime = ((ticks >> 32) & INT64_C(0xffffffff)); + ft->dwLowDateTime = (ticks & INT64_C(0xffffffff)); } GIT_INLINE(void) git_win32__stat_init( |