Commit 52505ab5 by Calvin Buckley

Convert long long constant specifiers to stdint macros

parent c1aca3fe
...@@ -304,7 +304,7 @@ static int git_commit_graph_entry_get_byindex( ...@@ -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->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 = 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; e->generation >>= 2u;
if (e->parent_indices[1] & 0x80000000u) { if (e->parent_indices[1] & 0x80000000u) {
uint32_t extra_edge_list_pos = e->parent_indices[1] & 0x7fffffff; uint32_t extra_edge_list_pos = e->parent_indices[1] & 0x7fffffff;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/* xdiff cannot cope with large files. these files should not be passed to /* xdiff cannot cope with large files. these files should not be passed to
* xdiff. callers should treat these large files as binary. * 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 /* 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 * necessary to use libxdiff. Calling git_xdiff_init() will set the diff_cb
......
...@@ -17,7 +17,7 @@ typedef uint64_t hashsig_state; ...@@ -17,7 +17,7 @@ typedef uint64_t hashsig_state;
#define HASHSIG_SCALE 100 #define HASHSIG_SCALE 100
#define HASHSIG_MAX_RUN 80 #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_SHIFT 5
#define HASHSIG_HASH_MIX(S,CH) \ #define HASHSIG_HASH_MIX(S,CH) \
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
: 32 * 1024 * 1024) : 32 * 1024 * 1024)
#define DEFAULT_MAPPED_LIMIT \ #define DEFAULT_MAPPED_LIMIT \
((1024 * 1024) * (sizeof(void*) >= 8 ? 8192ULL : 256UL)) ((1024 * 1024) * (sizeof(void*) >= 8 ? UINT64_C(8192) : 256UL))
/* default is unlimited */ /* default is unlimited */
#define DEFAULT_FILE_LIMIT 0 #define DEFAULT_FILE_LIMIT 0
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
#define bitsizeof(x) (CHAR_BIT * sizeof(x)) #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 #ifndef min
# define min(a,b) ((a) < (b) ? (a) : (b)) # define min(a,b) ((a) < (b) ? (a) : (b))
#endif #endif
......
...@@ -75,7 +75,7 @@ GIT_INLINE(void) git_win32__filetime_to_timespec( ...@@ -75,7 +75,7 @@ GIT_INLINE(void) git_win32__filetime_to_timespec(
struct timespec *ts) struct timespec *ts)
{ {
int64_t winTime = ((int64_t)ft->dwHighDateTime << 32) + ft->dwLowDateTime; 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); ts->tv_sec = (time_t)(winTime / 10000000);
#ifdef GIT_USE_NSEC #ifdef GIT_USE_NSEC
ts->tv_nsec = (winTime % 10000000) * 100; ts->tv_nsec = (winTime % 10000000) * 100;
...@@ -87,11 +87,11 @@ GIT_INLINE(void) git_win32__filetime_to_timespec( ...@@ -87,11 +87,11 @@ GIT_INLINE(void) git_win32__filetime_to_timespec(
GIT_INLINE(void) git_win32__timeval_to_filetime( GIT_INLINE(void) git_win32__timeval_to_filetime(
FILETIME *ft, const struct p_timeval tv) FILETIME *ft, const struct p_timeval tv)
{ {
int64_t ticks = (tv.tv_sec * 10000000LL) + int64_t ticks = (tv.tv_sec * INT64_C(10000000)) +
(tv.tv_usec * 10LL) + 116444736000000000LL; (tv.tv_usec * INT64_C(10)) + INT64_C(116444736000000000);
ft->dwHighDateTime = ((ticks >> 32) & 0xffffffffLL); ft->dwHighDateTime = ((ticks >> 32) & INT64_C(0xffffffff));
ft->dwLowDateTime = (ticks & 0xffffffffLL); ft->dwLowDateTime = (ticks & INT64_C(0xffffffff));
} }
GIT_INLINE(void) git_win32__stat_init( GIT_INLINE(void) git_win32__stat_init(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment