diff options
author | Russell Belfer <rb@github.com> | 2014-05-31 00:19:49 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-05-31 21:14:14 +0400 |
commit | 947a58c17557d634f16f7efc547b5b236575a3b9 (patch) | |
tree | ffc10e73f079cc66131862f739c6dff466285f78 /src/util.h | |
parent | 4cf826850a2317e8eb95a42085c407c0e9daac7f (diff) |
Clean up the handling of large binary diffs
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index 6fb2dc0f4..ca676c039 100644 --- a/src/util.h +++ b/src/util.h @@ -133,6 +133,13 @@ GIT_INLINE(int) git__is_uint32(size_t p) return p == (size_t)r; } +/** @return true if p fits into the range of an unsigned long */ +GIT_INLINE(int) git__is_ulong(git_off_t p) +{ + unsigned long r = (unsigned long)p; + return p == (git_off_t)r; +} + /* 32-bit cross-platform rotl */ #ifdef _MSC_VER /* use built-in method in MSVC */ # define git__rotl(v, s) (uint32_t)_rotl(v, s) |