chiark
/
gitweb
/
~mdw
/
secnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
integer arithmetic types: do not use unsigned for lengths
[secnet]
/
conffile.c
diff --git
a/conffile.c
b/conffile.c
index 565e37ff9b8ed608ea867106aaebc17156d3b8f9..5cce211415921556a5c384817d1278d9eb9dc158 100644
(file)
--- a/
conffile.c
+++ b/
conffile.c
@@
-35,7
+35,7
@@
struct dict {
struct dict *parent;
struct searchlist *search;
struct entry *entries;
struct dict *parent;
struct searchlist *search;
struct entry *entries;
-
u
int32_t size;
+ int32_t size;
};
static struct atomlist *atoms=NULL;
};
static struct atomlist *atoms=NULL;
@@
-173,9
+173,9
@@
static string_t ntype(uint32_t type)
return "**unknown**";
}
return "**unknown**";
}
-static void ptree_indent(
uint32_
t amount)
+static void ptree_indent(
in
t amount)
{
{
-
uint32_
t i;
+
in
t i;
for (i=0; i<amount; i++) printf(" . ");
}
for (i=0; i<amount; i++) printf(" . ");
}
@@
-561,9
+561,9
@@
list_t *list_new(void)
return NULL;
}
return NULL;
}
-
u
int32_t list_length(list_t *a)
+int32_t list_length(list_t *a)
{
{
-
u
int32_t l=0;
+ int32_t l=0;
list_t *i;
for (i=a; i; i=i->next) { assert(l < INT_MAX); l++; }
return l;
list_t *i;
for (i=a; i; i=i->next) { assert(l < INT_MAX); l++; }
return l;
@@
-608,7
+608,7
@@
list_t *list_append(list_t *list, item_t *item)
return list_append_list(list,l);
}
return list_append_list(list,l);
}
-item_t *list_elem(list_t *l,
u
int32_t index)
+item_t *list_elem(list_t *l, int32_t index)
{
if (!l) return NULL;
if (index==0) return l->item;
{
if (!l) return NULL;
if (index==0) return l->item;