git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Use correct U*MAX.

From
Junio C Hamano <junkio@cox.net>
Date
Jun 2, 2005, 16:47 UTC
Message-ID
<7vwtpc7lju.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7vis0xkjn4.fsf@assigned-by-dhcp.cox.net>
The largest "unsigned long" value is ULONG_MAX, not UINT_MAX.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
*** Linus, you may be unable to spell, but I cannot type ;-).
 count-delta.c     |    4 ++--
 diff.c            |    4 ++--
 diffcore-break.c  |    2 +-
 diffcore-rename.c |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/count-delta.c b/count-delta.c
--- a/count-delta.c
+++ b/count-delta.c
@@ -46,7 +46,7 @@ unsigned long count_delta(void *delta_bu
 
 	/* the smallest delta size possible is 6 bytes */
 	if (delta_size < 6)
-		return UINT_MAX;
+		return ULONG_MAX;
 
 	data = delta_buf;
 	top = delta_buf + delta_size;
@@ -83,7 +83,7 @@ unsigned long count_delta(void *delta_bu
 
 	/* sanity check */
 	if (data != top || out != dst_size)
-		return UINT_MAX;
+		return ULONG_MAX;
 
 	/* delete size is what was _not_ copied from source.
 	 * edit size is that and literal additions.
diff --git a/diff.c b/diff.c
--- a/diff.c
+++ b/diff.c
@@ -256,7 +256,7 @@ static struct sha1_size_cache *locate_si
 		first = next+1;
 	}
 	/* not found */
-	if (size == UINT_MAX)
+	if (size == ULONG_MAX)
 		return NULL;
 	/* insert to make it at "first" */
 	if (sha1_size_cache_alloc <= sha1_size_cache_nr) {
@@ -338,7 +338,7 @@ int diff_populate_filespec(struct diff_f
 		struct sha1_size_cache *e;
 
 		if (size_only) {
-			e = locate_size_cache(s->sha1, UINT_MAX);
+			e = locate_size_cache(s->sha1, ULONG_MAX);
 			if (e) {
 				s->size = e->size;
 				return 0;
diff --git a/diffcore-break.c b/diffcore-break.c
--- a/diffcore-break.c
+++ b/diffcore-break.c
@@ -63,7 +63,7 @@ static int very_different(struct diff_fi
 	/* Estimate the edit size by interpreting delta. */
 	delta_size = count_delta(delta, delta_size);
 	free(delta);
-	if (delta_size == UINT_MAX)
+	if (delta_size == ULONG_MAX)
 		return 0; /* error in delta computation */
 
 	if (base_size < delta_size)
diff --git a/diffcore-rename.c b/diffcore-rename.c
--- a/diffcore-rename.c
+++ b/diffcore-rename.c
@@ -176,7 +176,7 @@ static int estimate_similarity(struct di
 	/* Estimate the edit size by interpreting delta. */
 	delta_size = count_delta(delta, delta_size);
 	free(delta);
-	if (delta_size == UINT_MAX)
+	if (delta_size == ULONG_MAX)
 		return 0;
 
 	/*
------------
Previous: Junio C HamanoNext: Petr Baudis
Message 15 of 20 in “diff: mode bits fixes”
  1. diff: mode bits fixesJunio C Hamano, Jun 1, 2005
  2. Handle deltified object correctly in git-*-pull family.Junio C Hamano, Jun 2, 2005
  3. Linus TorvaldsJun 2, 2005
  4. Handle deltified object correctly in git-*-pull family.Junio C Hamano, Jun 2, 2005
  5. Nicolas PitreJun 2, 2005
  6. Nicolas PitreJun 2, 2005
  7. 1/2 Handle deltified object correctly in git-*-pull family.Junio C Hamano, Jun 2, 2005
  8. Linus TorvaldsJun 2, 2005
  9. 2/2 Find size of SHA1 object without inflating everything.Junio C Hamano, Jun 2, 2005
  10. Find size of SHA1 object without inflating everything.Junio C Hamano, Jun 2, 2005
  11. Linus TorvaldsJun 2, 2005
  12. Junio C HamanoJun 2, 2005
  13. McMullan, JasonJun 2, 2005
  14. Junio C HamanoJun 2, 2005
  15. Use correct U*MAX.Junio C Hamano, Jun 2, 2005
  16. Petr BaudisJun 3, 2005
  17. Junio C HamanoJun 3, 2005
  18. Petr BaudisJun 4, 2005
  19. Junio C HamanoJun 4, 2005
  20. Find size of SHA1 object without inflating everything.Junio C Hamano, Jun 2, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.