Commit 7766154a authored by Rusty Russell's avatar Rusty Russell

jmap: just use unsigned long, not size_t

Judy.h uses "Word_t" which it defines to an "unsigned long", so just use that.

If I were writing Judy from scratch, I'd use size_t or uintptr_t.
parent 68ff5715
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
* jmap_opt_add(opt, argv[i], d); * jmap_opt_add(opt, argv[i], d);
* } * }
* *
* printf("Found %u options:\n", jmap_opt_count(opt)); * printf("Found %lu options:\n", jmap_opt_count(opt));
* for (i = jmap_arg_first(arg,-1); i!=-1; i = jmap_arg_next(arg,i,-1)) { * for (i = jmap_arg_first(arg,-1); i!=-1; i = jmap_arg_next(arg,i,-1)) {
* char *a = jmap_arg_get(arg, i); * char *a = jmap_arg_get(arg, i);
* d = jmap_opt_get(opt, a); * d = jmap_opt_get(opt, a);
......
...@@ -7,8 +7,10 @@ struct jmap *jmap_new(void) ...@@ -7,8 +7,10 @@ struct jmap *jmap_new(void)
{ {
struct jmap *map; struct jmap *map;
/* Judy uses unsigned long for Word_t, we use size_t. */ /* Judy uses unsigned long for Word_t, we use unsigned long. */
BUILD_ASSERT(sizeof(size_t) == sizeof(unsigned long)); BUILD_ASSERT(sizeof(Word_t) == sizeof(unsigned long));
/* We also put pointers into Judy, in jmap_types.h */
BUILD_ASSERT(sizeof(Word_t) >= sizeof(void *));
map = malloc(sizeof(*map)); map = malloc(sizeof(*map));
if (map) { if (map) {
......
This diff is collapsed.
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
struct jmap *map; struct jmap *map;
size_t *value; unsigned long *value;
int status; int status;
plan_tests(9); plan_tests(9);
......
...@@ -12,7 +12,7 @@ int main(int argc, char *argv[]) ...@@ -12,7 +12,7 @@ int main(int argc, char *argv[])
{ {
struct jmap_foo *map; struct jmap_foo *map;
struct foo *foo[NUM], **foop; struct foo *foo[NUM], **foop;
unsigned int i; unsigned long i;
plan_tests(37 + NUM*2 + 19); plan_tests(37 + NUM*2 + 19);
for (i = 0; i < NUM; i++) for (i = 0; i < NUM; i++)
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
struct jmap *map; struct jmap *map;
size_t i, *value; unsigned long i, *value;
const char *err; const char *err;
plan_tests(53); plan_tests(53);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment