From 947a58c17557d634f16f7efc547b5b236575a3b9 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Fri, 30 May 2014 13:19:49 -0700 Subject: Clean up the handling of large binary diffs --- src/util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/util.h') 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) -- cgit v1.2.3