"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
use INT32_MAX for GOT_FILEIDX_MAX_ENTRIES
To:
gameoftrees@openbsd.org
Date:
Fri, 28 Jul 2023 10:46:37 +0200

Download raw body.

Thread
it's a different way to spell the same number, but since the on-disk
format uses a 32 bit wide integer stored as big-endian for this field
it seems better to use an explicit INT32_MAX rather than INT_MAX.

-----------------------------------------------
commit af5ed940ae274f2f8598563c1e9fb2da1bc95080
from: Omar Polo <op@omarpolo.com>
date: Thu Jul 27 16:07:57 2023 UTC
 
 use INT32_MAX for the maximum number of entries
 
diff c2ba7aa6808a2583895c024f5c85fff03948494e af5ed940ae274f2f8598563c1e9fb2da1bc95080
commit - c2ba7aa6808a2583895c024f5c85fff03948494e
commit + af5ed940ae274f2f8598563c1e9fb2da1bc95080
blob - e989c6b7cd01f55aa6173b8bbf04441802b11fe6
blob + 1575b0dd69dc7a97d0d393fa46ba56957b8ee0b7
--- lib/fileindex.c
+++ lib/fileindex.c
@@ -23,6 +23,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <string.h>
 #include <sha1.h>
 #include <sha2.h>
@@ -53,7 +54,7 @@ struct got_fileindex {
 struct got_fileindex {
 	struct got_fileindex_tree entries;
 	int nentries; /* Does not include entries marked for removal. */
-#define GOT_FILEIDX_MAX_ENTRIES INT_MAX
+#define GOT_FILEIDX_MAX_ENTRIES INT32_MAX
 };
 
 mode_t