Commit 069f84d5cf33b800b44c6c2507c1730df9ea5446

Stefan Sperling 2018-06-11T03:31:01

use signed int for max numer of object idset elements

diff --git a/lib/got_lib_object_idset.h b/lib/got_lib_object_idset.h
index ce9c832..68c9c90 100644
--- a/lib/got_lib_object_idset.h
+++ b/lib/got_lib_object_idset.h
@@ -28,4 +28,4 @@ int got_object_idset_contains(struct got_object_idset *,
     struct got_object_id *);
 void got_object_idset_for_each(struct got_object_idset *,
     void (*cb)(struct got_object_id *, void *, void *), void *);
-unsigned int got_object_idset_num_elements(struct got_object_idset *);
+int got_object_idset_num_elements(struct got_object_idset *);
diff --git a/lib/object_idset.c b/lib/object_idset.c
index 2fa47df..e7e8b1b 100644
--- a/lib/object_idset.c
+++ b/lib/object_idset.c
@@ -48,8 +48,8 @@ struct got_object_idset {
 	 * which of these lists an object ID is stored in.
 	 */
 	TAILQ_HEAD(, got_object_idset_element) entries[0xff + 1];
-	unsigned int nelem;
-#define GOT_OBJECT_IDSET_MAX_ELEM UINT_MAX
+	int nelem;
+#define GOT_OBJECT_IDSET_MAX_ELEM INT_MAX
 };
 
 struct got_object_idset *
@@ -207,7 +207,7 @@ void got_object_idset_for_each(struct got_object_idset *set,
 	}
 }
 
-unsigned int
+int
 got_object_idset_num_elements(struct got_object_idset *set)
 {
 	return set->nelem;