Skip to content

Commit

Permalink
Fix following splint warning.
Browse files Browse the repository at this point in the history
src/tree.c: (in function rewrite_a)
src/tree.c:2077:16: Operands of < have incompatible types (unsigned int,
                       size_t): i < a->count
src/tree.c:2082:16: Operands of < have incompatible types (unsigned int,
                       size_t): i < a->count
src/tree.c:2086:4: Assignment of unsigned int to size_t: a->count = n
  • Loading branch information
hiyuh authored and nickg committed May 13, 2012
1 parent 2162d3e commit 685f9d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tree.c
Expand Up @@ -2044,12 +2044,12 @@ static tree_t tree_rewrite_aux(tree_t t, struct rewrite_ctx *ctx);


static void rewrite_a(struct tree_array *a, struct rewrite_ctx *ctx) static void rewrite_a(struct tree_array *a, struct rewrite_ctx *ctx)
{ {
for (unsigned i = 0; i < a->count; i++) for (size_t i = 0; i < a->count; i++)
a->items[i] = tree_rewrite_aux(a->items[i], ctx); a->items[i] = tree_rewrite_aux(a->items[i], ctx);


// If an item was rewritten to NULL then delete it // If an item was rewritten to NULL then delete it
unsigned n = 0; size_t n = 0;
for (unsigned i = 0; i < a->count; i++) { for (size_t i = 0; i < a->count; i++) {
if (a->items[i] != NULL) if (a->items[i] != NULL)
a->items[n++] = a->items[i]; a->items[n++] = a->items[i];
} }
Expand Down

0 comments on commit 685f9d7

Please sign in to comment.