Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-05-31 00:19:49 +0400
committerRussell Belfer <rb@github.com>2014-05-31 21:14:14 +0400
commit947a58c17557d634f16f7efc547b5b236575a3b9 (patch)
treeffc10e73f079cc66131862f739c6dff466285f78 /src/util.h
parent4cf826850a2317e8eb95a42085c407c0e9daac7f (diff)
Clean up the handling of large binary diffs
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h7
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)