jmap: fix aliasing issues, one real testcase bug
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Nov 2010 00:11:07 +0000 (10:41 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 3 Nov 2010 00:11:07 +0000 (10:41 +1030)
commit09fde153ba7a68715dcad3b53cbbb8804c3d2356
tree182ec5c60de9266f96937fb4b4c85642b5252fd7
parentdaddafe53685b0b6f90a7746cbbd1a2e7df59216
jmap: fix aliasing issues, one real testcase bug

Compiling with gcc -O3 added some more warnings, especially about aliasing.

By setting Word_t to size_t we fix some of them, but jmap_@name_firstval
in JMAP_DEFINE_PTRIDX_TYPE we need to use a real size_t rather than lazily
casting our index to a size_t *.

Gcc also spotted taht we used idx[NUM] in test/run-ptridx-type.c; allocate
that and make the usage explicit.
ccan/jmap/jmap.c
ccan/jmap/jmap.h
ccan/jmap/jmap_type.h
ccan/jmap/test/run-ptridx-type.c