]> granicus.if.org Git - check/commitdiff
The number of elements in a list is now unsigned
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 23 Sep 2013 17:58:11 +0000 (17:58 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 23 Sep 2013 17:58:11 +0000 (17:58 +0000)
there can never be a negative number of elements in a list.
Changing the values to unsigned to enforce this.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@793 64e312b2-a51f-0410-8e61-82d0ca0eb02a

src/check_list.c

index fceb03a837b01a85f249661e3f4736f6f9488299..df5847866aefb177084d9d7974b12835502b2d76 100644 (file)
@@ -33,8 +33,8 @@ enum {
 };
 
 struct List {
-  int n_elts;
-  int max_elts;
+  unsigned int n_elts;
+  unsigned int max_elts;
   int current; /* pointer to the current node */
   int last; /* pointer to the node before END */
   const void **data;