Commit 05237ee5 by Edward Thomson

integer: use int64_t's for checks

Use int64_t internally for type visibility.
parent ee0c8618
...@@ -8,10 +8,10 @@ ...@@ -8,10 +8,10 @@
#define INCLUDE_integer_h__ #define INCLUDE_integer_h__
/** @return true if p fits into the range of a size_t */ /** @return true if p fits into the range of a size_t */
GIT_INLINE(int) git__is_sizet(git_off_t p) GIT_INLINE(int) git__is_sizet(int64_t p)
{ {
size_t r = (size_t)p; size_t r = (size_t)p;
return p == (git_off_t)r; return p == (int64_t)r;
} }
/** @return true if p fits into the range of an ssize_t */ /** @return true if p fits into the range of an ssize_t */
...@@ -36,10 +36,10 @@ GIT_INLINE(int) git__is_uint32(size_t p) ...@@ -36,10 +36,10 @@ GIT_INLINE(int) git__is_uint32(size_t p)
} }
/** @return true if p fits into the range of an unsigned long */ /** @return true if p fits into the range of an unsigned long */
GIT_INLINE(int) git__is_ulong(git_off_t p) GIT_INLINE(int) git__is_ulong(int64_t p)
{ {
unsigned long r = (unsigned long)p; unsigned long r = (unsigned long)p;
return p == (git_off_t)r; return p == (int64_t)r;
} }
/** @return true if p fits into the range of an int */ /** @return true if p fits into the range of an int */
......
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