]> git.ozlabs.org Git - ccan/log
ccan
13 years agoccanlint: override _info's Fails: with --target
Rusty Russell [Wed, 17 Nov 2010 09:57:37 +0000 (20:27 +1030)]
ccanlint: override _info's Fails: with --target

I wanted to see what happened with tdb2's valgrind test (suppressed in the
_info file).

13 years agoccanlint: run tests in alphabetical order
Rusty Russell [Wed, 17 Nov 2010 09:53:30 +0000 (20:23 +1030)]
ccanlint: run tests in alphabetical order

This allows tests (like in tdb2) to run the simpler tests first and build up,
making it easier to spot the root cause of errors.

13 years agoconfig: add HAVE_BUILTIN_FFSLL
Rusty Russell [Mon, 15 Nov 2010 09:46:40 +0000 (20:16 +1030)]
config: add HAVE_BUILTIN_FFSLL

13 years agonfs: remove trailing whitespace
Rusty Russell [Mon, 15 Nov 2010 02:47:55 +0000 (13:17 +1030)]
nfs: remove trailing whitespace

ccanlint complained about it; it's trivial but fixing it adds one point to
our score.

13 years agonfs: make headers idempotent
Rusty Russell [Mon, 15 Nov 2010 02:47:12 +0000 (13:17 +1030)]
nfs: make headers idempotent

ccanlint did this automatically.

13 years agonfs: Remove _U_, use ccan/compiler and UNUSED
Rusty Russell [Mon, 15 Nov 2010 02:46:46 +0000 (13:16 +1030)]
nfs: Remove _U_, use ccan/compiler and UNUSED

Also, add Author and License lines to _info (ccanlint complained).
Now ccanlint can build it as a module.

13 years agonfs: Add _info, remove -D_FILE_OFFSET_BITS=64, use nfs_off_t
Rusty Russell [Mon, 15 Nov 2010 02:45:36 +0000 (13:15 +1030)]
nfs: Add _info, remove -D_FILE_OFFSET_BITS=64, use nfs_off_t

This makes it closer to compiling under ccanlint.

13 years agoccanlint: remove -Werror, use output of compile command to detect warnings.
Rusty Russell [Mon, 15 Nov 2010 02:00:48 +0000 (12:30 +1030)]
ccanlint: remove -Werror, use output of compile command to detect warnings.

This means we can pass various compulation tests, but deduct points if
they get warnings.

13 years agoccanlint: make compile commands return output.
Rusty Russell [Sun, 14 Nov 2010 11:40:04 +0000 (22:10 +1030)]
ccanlint: make compile commands return output.

We want to distinguish between warnings and errors: the first step is to
return the output even if the command doesn't fail.

13 years agoccanlint: fix idempotent handler
Rusty Russell [Mon, 15 Nov 2010 02:23:00 +0000 (12:53 +1030)]
ccanlint: fix idempotent handler

Test for inserting idempotent header was wrong way around, and we check
all headers at once, rather than finishing after one.

Also, turn - into _ rather than removing.

13 years agoccanlint: only print 5 lines of output unless -vv
Rusty Russell [Sun, 14 Nov 2010 11:53:52 +0000 (22:23 +1030)]
ccanlint: only print 5 lines of output unless -vv

13 years agoccanlint: print error information even if we pass.
Rusty Russell [Mon, 15 Nov 2010 02:29:52 +0000 (12:59 +1030)]
ccanlint: print error information even if we pass.

This means we can see messages even if we don't fail; ie. for compiler warnings
once they are no longer fatal.

This means that various tests have to be more careful in not setting
score->error.

13 years agoccanlint: minor print formatting cleanup.
Rusty Russell [Sun, 14 Nov 2010 11:48:12 +0000 (22:18 +1030)]
ccanlint: minor print formatting cleanup.

13 years agoccanlint: don't skip every second question
Rusty Russell [Mon, 15 Nov 2010 02:48:57 +0000 (13:18 +1030)]
ccanlint: don't skip every second question

We only grabbed one character at a time from stdin, so "y<return>" answered
the next question as well.

13 years agociniparser: add LICENSE symlink
Rusty Russell [Thu, 11 Nov 2010 02:18:09 +0000 (12:48 +1030)]
ciniparser: add LICENSE symlink

13 years agoforeach, iscsi, jbitset, jmap, opt, rbtree, sparse_bsearch, tally, tdb2: add LICENSE...
Rusty Russell [Wed, 10 Nov 2010 12:45:14 +0000 (23:15 +1030)]
foreach, iscsi, jbitset, jmap, opt, rbtree, sparse_bsearch, tally, tdb2: add LICENSE symlinks

13 years agoccanlint: check license and LICENSE symlink.
Rusty Russell [Wed, 10 Nov 2010 12:44:30 +0000 (23:14 +1030)]
ccanlint: check license and LICENSE symlink.

Michael Ellerman noted that ccan/opt has no symlink, so add ccanlint test.

13 years agoccanlint: clarify different -v levels.
Rusty Russell [Wed, 10 Nov 2010 12:16:12 +0000 (22:46 +1030)]
ccanlint: clarify different -v levels.

13 years agoccanlint: fix --target=examples-compile
Rusty Russell [Wed, 10 Nov 2010 12:08:02 +0000 (22:38 +1030)]
ccanlint: fix --target=examples-compile

13 years agoccanlint: use isspace instead of isblank
Rusty Russell [Wed, 10 Nov 2010 11:51:06 +0000 (22:21 +1030)]
ccanlint: use isspace instead of isblank

I am told that CentOS 5.3 doesn't like isblank (it's ISO C).

13 years agoccan_tokenizer, check_type, container_of, typesafe_cb: handle !HAVE_TYPEOF
Rusty Russell [Wed, 10 Nov 2010 11:40:03 +0000 (22:10 +1030)]
ccan_tokenizer, check_type, container_of, typesafe_cb: handle !HAVE_TYPEOF

Delio Brignoli points out that check_type fails when HAVE_TYPEOF is 0,
so turn that off here and see what else breaks...

13 years agoccanlint: typo fix and fix errant description parsing.
Rusty Russell [Wed, 10 Nov 2010 11:38:15 +0000 (22:08 +1030)]
ccanlint: typo fix and fix errant description parsing.

"C has fairly weak typing:" from check_type/_info is not a new section heading!
Enforce that each word in multi-word sections must be caps.

13 years agoccanlint: tweak example compilation.
Rusty Russell [Wed, 10 Nov 2010 06:38:29 +0000 (17:08 +1030)]
ccanlint: tweak example compilation.

We used to prefer to build up examples using previous ones, but this broke
for tests which were to be executed.  But list.h relied on the buildup
behavior, so return to that unless we see "// Given" comments indicating
an execution test.

13 years agolist: fix uninitialized variable in list_add example.
Rusty Russell [Wed, 10 Nov 2010 06:37:29 +0000 (17:07 +1030)]
list: fix uninitialized variable in list_add example.

gcc with optimization complained (correctly) about this.

13 years agoccanlint: list file errors in order they are encountered.
Rusty Russell [Wed, 10 Nov 2010 06:25:24 +0000 (16:55 +1030)]
ccanlint: list file errors in order they are encountered.

13 years agoccanlint: fix abort when -vv used and examples don't compile.
Rusty Russell [Wed, 10 Nov 2010 06:24:59 +0000 (16:54 +1030)]
ccanlint: fix abort when -vv used and examples don't compile.

13 years agoMakefile: exclude Judy-depending libraries as well as nfs
Rusty Russell [Wed, 10 Nov 2010 05:18:31 +0000 (15:48 +1030)]
Makefile: exclude Judy-depending libraries as well as nfs

(nfs gives warnings on build, make ccanlint unhappy).

13 years agoMerge branch 'ronnie'
Rusty Russell [Wed, 10 Nov 2010 05:17:12 +0000 (15:47 +1030)]
Merge branch 'ronnie'

13 years agocompiler: shorten names of attributes, add UNUSED
Rusty Russell [Tue, 9 Nov 2010 22:35:58 +0000 (09:05 +1030)]
compiler: shorten names of attributes, add UNUSED

The long names were unwieldy in practice; at risk of clashing, replace
with shorter versions.

13 years agonfs: add generates C files
Rusty Russell [Tue, 9 Nov 2010 11:37:58 +0000 (22:07 +1030)]
nfs: add generates C files

ccanlint won't run rpcgen, so we need the C source in the repo anyway.

13 years agonfs: ccanize a little more.
Rusty Russell [Tue, 9 Nov 2010 08:24:45 +0000 (18:54 +1030)]
nfs: ccanize a little more.

rename libnfs.h to nfs.h (CCAN expects "main" header to match module name).
tools move into tools/, .x file move into rpc/
Don't sed the rpcgen files, generate headers in rpc/
Make tools use <ccan/nfs/nfs.h> as per normal ccan usage.

13 years agonfs: initial import.
Rusty Russell [Tue, 9 Nov 2010 08:04:21 +0000 (18:34 +1030)]
nfs: initial import.

Another Ronnie module!

13 years agoccanlint: rework so checks have more structure.
Rusty Russell [Tue, 9 Nov 2010 02:44:39 +0000 (13:14 +1030)]
ccanlint: rework so checks have more structure.

Previously each check returned a void *, but in fact most of them fell into
similar patterns.  So define 'struct score' and a helper to add files to it,
and use that.

Under these rules, you get 0/1 if you skip a test because a dependency failed
which in theory means your score (as a percentage) could drop if you fix
a test.

13 years agoccanlint: fix up creation of test/run.c
Rusty Russell [Mon, 8 Nov 2010 22:20:21 +0000 (08:50 +1030)]
ccanlint: fix up creation of test/run.c

Make test directory correctly, and #include <ccan/...> not #include "".

13 years agolikely: switch from using ccan/hashtable to ccan/htable
Rusty Russell [Mon, 8 Nov 2010 11:35:42 +0000 (22:05 +1030)]
likely: switch from using ccan/hashtable to ccan/htable

13 years agorbtree: new module from Ronnie.
Rusty Russell [Mon, 8 Nov 2010 11:30:04 +0000 (22:00 +1030)]
rbtree: new module from Ronnie.

13 years agohashtable: replaced by htable.
Rusty Russell [Mon, 8 Nov 2010 11:27:41 +0000 (21:57 +1030)]
hashtable: replaced by htable.

13 years agotalloc: define TALLOC_CTX
Rusty Russell [Mon, 8 Nov 2010 10:14:06 +0000 (20:44 +1030)]
talloc: define TALLOC_CTX

I'm not a fan of the SHOUTING, but it's upstream.

13 years agoiscsi: add LICENCE link
Rusty Russell [Mon, 8 Nov 2010 09:59:17 +0000 (20:29 +1030)]
iscsi: add LICENCE link

13 years agoiscsi: ccanize a little more, add silly simple test case.
Rusty Russell [Mon, 8 Nov 2010 09:54:47 +0000 (20:24 +1030)]
iscsi: ccanize a little more, add silly simple test case.

13 years agoiscsi: new module from Ronnie.
Rusty Russell [Mon, 8 Nov 2010 09:19:41 +0000 (19:49 +1030)]
iscsi: new module from Ronnie.

13 years agohtable: push capacity limit from 66 to 75%
Rusty Russell [Mon, 8 Nov 2010 03:02:51 +0000 (13:32 +1030)]
htable: push capacity limit from 66 to 75%

With the extra bits, long runs don't hurt our cache very much on search,
so we can pack quite a few in.  Here are the runs at maximal density before
and after:

Before:
$ ./speed 3145000
Initial insert:  248 ns
Details: hash size 4194304, mask bits 9, perfect 63%
Initial lookup (match):  122 ns
Initial lookup (miss):  142 ns
Initial lookup (random):  170 ns
Initial delete all:  134 ns
Details: rehashes 3145000
Initial re-inserting:  149 ns
Deleting first half:  73 ns
Details: rehashes 1572500, delete markers 1572500
Adding (a different) half:  128 ns
Details: delete markers 0, perfect 62%
Lookup after half-change (match):  129 ns
Lookup after half-change (miss):  145 ns
Details: initial churn
Churning second time:  703 ns
Churning third time:  725 ns
Churning fourth time:  717 ns
Churning fifth time:  710 ns
Details: reinserting with spread
Details: delete markers 149261, perfect 57%
Details: worst run 254 (2 deleted)
Lookup after churn & spread (match):  132 ns
Lookup after churn & spread (miss):  159 ns
Lookup after churn & spread (random):  184 ns
Deleting half after churn & spread:  71 ns
Adding (a different) half after churn & spread:  129 ns
Details: delete markers 0, perfect 62%

After:
$ ./speed 3145727
Initial insert:  232 ns
Details: hash size 4194304, mask bits 9, perfect 63%
Initial lookup (match):  122 ns
Initial lookup (miss):  141 ns
Initial lookup (random):  234 ns
Initial delete all:  129 ns
Details: rehashes 3145727
Initial re-inserting:  153 ns
Deleting first half:  80 ns
Details: rehashes 1572864, delete markers 1572864
Adding (a different) half:  137 ns
Details: delete markers 0, perfect 62%
Lookup after half-change (match):  125 ns
Lookup after half-change (miss):  145 ns
Details: initial churn
Churning second time:  702 ns
Churning third time:  719 ns
Churning fourth time:  712 ns
Churning fifth time:  709 ns
Details: reinserting with spread
Details: delete markers 169474, perfect 56%
Details: worst run 248 (12 deleted)
Lookup after churn & spread (match):  129 ns
Lookup after churn & spread (miss):  159 ns
Lookup after churn & spread (random):  242 ns
Deleting half after churn & spread:  70 ns
Adding (a different) half after churn & spread:  133 ns
Details: delete markers 0, perfect 62%

13 years agohtable: restore perfect bit when resizing.
Rusty Russell [Mon, 8 Nov 2010 05:54:31 +0000 (16:24 +1030)]
htable: restore perfect bit when resizing.

If the lower bit differs between pointers, we can lose our "perfect"
bit.  Since we're rehashing the entire thing anyway, we can pick
another bit when we double the hash table.

13 years agohtable: use "perfect" bit to reduce rehashes.
Rusty Russell [Mon, 8 Nov 2010 05:54:06 +0000 (16:24 +1030)]
htable: use "perfect" bit to reduce rehashes.

Steal one bit to indicate an entry is in its perfect position.  This
means we don't have to rehash it when we are rehashing the entire
table to get rid of deleted records, and we can still use it for
comparison during lookup.

Before: $ ./speed 50000000
Initial insert:  462 ns
Details: hash size 134217728, mask bits 5, perfect 81%
Initial lookup (match):  161 ns
Initial lookup (miss):  168 ns
Initial lookup (random):  326 ns
Initial delete all:  164 ns
Details: rehashes 50000000
Initial re-inserting:  167 ns
Deleting first half:  86 ns
Details: rehashes 25000000, delete markers 25000000
Adding (a different) half:  217 ns
Details: delete markers 0, perfect 81%
Lookup after half-change (match):  169 ns
Lookup after half-change (miss):  180 ns
Details: initial churn
Churning second time:  593 ns
Churning third time:  611 ns
Churning fourth time:  619 ns
Churning fifth time:  622 ns
Details: reinserting with spread
Details: delete markers 13800468, perfect 73%
Details: worst run 48 (4 deleted)
Lookup after churn & spread (match):  192 ns
Lookup after churn & spread (miss):  211 ns
Lookup after churn & spread (random):  373 ns
Deleting half after churn & spread:  103 ns
Adding (a different) half after churn & spread:  102 ns
Details: delete markers 29539689, perfect 72%

After:
Initial insert:  467 ns
Details: hash size 134217728, mask bits 5, perfect 81%
Initial lookup (match):  163 ns
Initial lookup (miss):  171 ns
Initial lookup (random):  326 ns
Initial delete all:  170 ns
Details: rehashes 50000000
Initial re-inserting:  169 ns
Deleting first half:  88 ns
Details: rehashes 25000000, delete markers 25000000
Adding (a different) half:  141 ns
Details: delete markers 0, perfect 81%
Lookup after half-change (match):  166 ns
Lookup after half-change (miss):  171 ns
Details: initial churn
Churning second time:  441 ns
Churning third time:  469 ns
Churning fourth time:  466 ns
Churning fifth time:  490 ns
Details: reinserting with spread
Details: delete markers 13800468, perfect 73%
Details: worst run 48 (4 deleted)
Lookup after churn & spread (match):  197 ns
Lookup after churn & spread (miss):  209 ns
Lookup after churn & spread (random):  369 ns
Deleting half after churn & spread:  98 ns
Adding (a different) half after churn & spread:  100 ns
Details: delete markers 29539689, perfect 72%

13 years agohtable: rehash to clear delete markers
Rusty Russell [Mon, 8 Nov 2010 05:53:17 +0000 (16:23 +1030)]
htable: rehash to clear delete markers

Delete markers build up over time, even if we try to clean as we go.
So just garbage collect them when there are too many.

Before:
rusty@vivaldi:~/devel/cvs/ccan/ccan/htable/tools (htable)$ ./speed 50000000
Initial insert:  467 ns
Details: hash size 134217728, mask bits 5, perfect 81%
Initial lookup (match):  160 ns
Initial lookup (miss):  169 ns
Initial lookup (random):  328 ns
Initial delete all:  165 ns
Details: rehashes 50000000
Initial re-inserting:  317 ns
Deleting first half:  86 ns
Details: rehashes 25000000, delete markers 25000000
Adding (a different) half:  89 ns
Details: delete markers 18894324, perfect 76%
Lookup after half-change (match):  174 ns
Lookup after half-change (miss):  203 ns
Details: initial churn
Churning second time:  816 ns
Churning third time:  615 ns
Churning fourth time:  621 ns
Churning fifth time:  846 ns
Details: reinserting with spread
Details: delete markers 11078719, perfect 74%
Details: worst run 48 (4 deleted)
Lookup after churn & spread (match):  191 ns
Lookup after churn & spread (miss):  208 ns
Lookup after churn & spread (random):  374 ns
Deleting half after churn & spread:  102 ns
Adding (a different) half after churn & spread:  103 ns
Details: delete markers 27442234, perfect 73%

After:
Initial insert:  462 ns
Details: hash size 134217728, mask bits 5, perfect 81%
Initial lookup (match):  161 ns
Initial lookup (miss):  168 ns
Initial lookup (random):  326 ns
Initial delete all:  164 ns
Details: rehashes 50000000
Initial re-inserting:  167 ns
Deleting first half:  86 ns
Details: rehashes 25000000, delete markers 25000000
Adding (a different) half:  217 ns
Details: delete markers 0, perfect 81%
Lookup after half-change (match):  169 ns
Lookup after half-change (miss):  180 ns
Details: initial churn
Churning second time:  593 ns
Churning third time:  611 ns
Churning fourth time:  619 ns
Churning fifth time:  622 ns
Details: reinserting with spread
Details: delete markers 13800468, perfect 73%
Details: worst run 48 (4 deleted)
Lookup after churn & spread (match):  192 ns
Lookup after churn & spread (miss):  211 ns
Lookup after churn & spread (random):  373 ns
Deleting half after churn & spread:  103 ns
Adding (a different) half after churn & spread:  102 ns
Details: delete markers 29539689, perfect 72%

13 years agohtable: speed benchmark
Rusty Russell [Mon, 8 Nov 2010 05:51:20 +0000 (16:21 +1030)]
htable: speed benchmark

13 years agohtable: first implementation
Rusty Russell [Mon, 8 Nov 2010 05:52:19 +0000 (16:22 +1030)]
htable: first implementation

13 years agojmap: a speed benchmark
Rusty Russell [Mon, 8 Nov 2010 05:51:06 +0000 (16:21 +1030)]
jmap: a speed benchmark

13 years agojmap: fix incorrect prototype in header documentation.
Rusty Russell [Mon, 8 Nov 2010 05:51:58 +0000 (16:21 +1030)]
jmap: fix incorrect prototype in header documentation.

13 years agojmap: just use unsigned long, not size_t
Rusty Russell [Sun, 7 Nov 2010 01:45:10 +0000 (12:15 +1030)]
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.

13 years agojbitset: just use unsigned long, not size_t
Rusty Russell [Sun, 7 Nov 2010 01:44:55 +0000 (12:14 +1030)]
jbitset: 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.

13 years agoccanlint: fix compilation of chained examples.
Rusty Russell [Sun, 7 Nov 2010 01:42:31 +0000 (12:12 +1030)]
ccanlint: fix compilation of chained examples.

Broken in 5378c864f9c37f39d906f599285da25a7db0c9fe: we were trying to
recompile the previous failed version.  And the message we printed out
was unclear.

13 years agoantithread, foreach, grab_file, hashtable, str_talloc: fix _info depends.
Rusty Russell [Thu, 4 Nov 2010 10:22:42 +0000 (20:52 +1030)]
antithread, foreach, grab_file, hashtable, str_talloc: fix _info depends.

For str_talloc and grab_file, avoid using ccan/str (it's just for tests).

13 years agoccanlint: add --target
Rusty Russell [Thu, 4 Nov 2010 10:14:00 +0000 (20:44 +1030)]
ccanlint: add --target

Much easier to run just a single test across the tree.

13 years agoccanlint: add test to look for modules we use but don't list in _info.
Rusty Russell [Thu, 4 Nov 2010 10:13:17 +0000 (20:43 +1030)]
ccanlint: add test to look for modules we use but don't list in _info.

13 years agoccanlint: fix wrong initialization in example compilation.
Rusty Russell [Thu, 4 Nov 2010 10:11:44 +0000 (20:41 +1030)]
ccanlint: fix wrong initialization in example compilation.

I moved the code around and missed this.

13 years agoMakefile: make non-optimized variant comment a bit clearer.
Rusty Russell [Thu, 4 Nov 2010 10:10:52 +0000 (20:40 +1030)]
Makefile: make non-optimized variant comment a bit clearer.

13 years agoalignof, array_size, crc: provide comments to allow testing examples.
Rusty Russell [Thu, 4 Nov 2010 04:32:13 +0000 (15:02 +1030)]
alignof, array_size, crc: provide comments to allow testing examples.

13 years agoccanlint: try running example code.
Rusty Russell [Thu, 4 Nov 2010 03:25:15 +0000 (13:55 +1030)]
ccanlint: try running example code.

Comments of form "// [given x] outputs y" we can check the examples do as expected.

13 years agoopt: fix junk after string in opt_show_charp.
Rusty Russell [Thu, 4 Nov 2010 02:11:13 +0000 (12:41 +1030)]
opt: fix junk after string in opt_show_charp.

13 years agocleanup: get rid of unwanted tap/ toplevel which crept in.
Rusty Russell [Wed, 3 Nov 2010 22:34:58 +0000 (09:04 +1030)]
cleanup: get rid of unwanted tap/ toplevel which crept in.

13 years agoweb: point to the configurator to generate config.h
Rusty Russell [Wed, 3 Nov 2010 13:14:48 +0000 (23:44 +1030)]
web: point to the configurator to generate config.h

13 years ago.gitignore: ignore configurator
Rusty Russell [Wed, 3 Nov 2010 13:07:33 +0000 (23:37 +1030)]
.gitignore: ignore configurator

13 years agomakefiles: add "scores" target.
Rusty Russell [Wed, 3 Nov 2010 12:48:10 +0000 (23:18 +1030)]
makefiles: add "scores" target.

13 years agoalloc: fix missing header in compilation of example.
Rusty Russell [Wed, 3 Nov 2010 12:48:10 +0000 (23:18 +1030)]
alloc: fix missing header in compilation of example.

13 years agoccanlint: make tests non-compulsory, always print score.
Rusty Russell [Wed, 3 Nov 2010 12:55:57 +0000 (23:25 +1030)]
ccanlint: make tests non-compulsory, always print score.

No longer abort ccanlint because a test fails, but you will get a low
score if there are no tests.

(Note: total_score is filled in, even if it's overridden when the test is
 run.  This means that if the prereq fails, that total counts so there is
 still a penalty!)

13 years agoccanlint: with -vv, give details on attempts to compile examples.
Rusty Russell [Wed, 3 Nov 2010 12:51:18 +0000 (23:21 +1030)]
ccanlint: with -vv, give details on attempts to compile examples.

The heuristics can be hinky, so tell people what we're doing.

13 years agotools: new "configurator" tool.
Rusty Russell [Wed, 3 Nov 2010 00:21:07 +0000 (10:51 +1030)]
tools: new "configurator" tool.

A simple C program to generate config.h.  It also saves the compiler and
flags for use by ccanlint (though they have to accept -c and -o).

13 years agotdb2: fix gcc -O3 warnings on test/layout.c
Rusty Russell [Wed, 3 Nov 2010 00:20:03 +0000 (10:50 +1030)]
tdb2: fix gcc -O3 warnings on test/layout.c

Warnings about ignored returns, and uninitialized len after case statement.

13 years agotdb: fix warnings with gcc -O3, and one test crash.
Rusty Russell [Wed, 3 Nov 2010 00:17:39 +0000 (10:47 +1030)]
tdb: fix warnings with gcc -O3, and one test crash.

unsigned char * is allowed to alias, so we use that for byte reversing
rather than uint32_t.  This is portable.

Remove warnings about ignoring pread/pwrite return values.

And initialize tdb before setjmp: with optimization, gcc validly saw this
as NULL and crashed.

13 years agotalloc: fix gcc -O3 aliasing warnings
Rusty Russell [Wed, 3 Nov 2010 00:16:42 +0000 (10:46 +1030)]
talloc: fix gcc -O3 aliasing warnings

A void * could point to anything, but a void ** can't point to any pointer.
So we use a void * and memcpy, which I believe is safe.

13 years agoopt: fix gcc -O3 warnings.
Rusty Russell [Wed, 3 Nov 2010 00:16:02 +0000 (10:46 +1030)]
opt: fix gcc -O3 warnings.

13 years agojmap: fix aliasing issues, one real testcase bug
Rusty Russell [Wed, 3 Nov 2010 00:11:07 +0000 (10:41 +1030)]
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.

13 years agoforeach: new module
Rusty Russell [Tue, 2 Nov 2010 01:25:33 +0000 (11:55 +1030)]
foreach: new module

13 years agoMerge branch 'judy'
Rusty Russell [Sat, 30 Oct 2010 10:15:59 +0000 (20:45 +1030)]
Merge branch 'judy'

13 years agojmap: new module
Rusty Russell [Sat, 30 Oct 2010 10:15:36 +0000 (20:45 +1030)]
jmap: new module

13 years agojbitset: new module.
Rusty Russell [Sat, 30 Oct 2010 10:14:42 +0000 (20:44 +1030)]
jbitset: new module.

13 years agoweb: don't try to link to old bzr repository, use git.
Rusty Russell [Fri, 29 Oct 2010 09:16:33 +0000 (19:46 +1030)]
web: don't try to link to old bzr repository, use git.

13 years agotap: restore buffering to stdout
Rusty Russell [Wed, 27 Oct 2010 11:49:44 +0000 (22:19 +1030)]
tap: restore buffering to stdout

I noticed this when I straced something; we're doing 1-byte writes.
This reduced the time for "make check" from 12m37s to 11m48s.

13 years agogitify the tree, especially the web makefile.
Rusty Russell [Tue, 26 Oct 2010 07:37:22 +0000 (18:07 +1030)]
gitify the tree, especially the web makefile.

13 years agoweb: clean up directory
Rusty Russell [Tue, 26 Oct 2010 09:00:27 +0000 (19:30 +1030)]
web: clean up directory

13 years agoilog: rework to reduce interface.
Rusty Russell [Tue, 26 Oct 2010 03:59:36 +0000 (14:29 +1030)]
ilog: rework to reduce interface.

If you've not got gcc, this is a bit of a lose.  But for everyone else,
it's far simpler.

13 years agoopt: wean off getopt_long, beef up tests.
Rusty Russell [Mon, 25 Oct 2010 03:28:50 +0000 (13:58 +1030)]
opt: wean off getopt_long, beef up tests.

Doing our own parsing lost a few lines of code, too.

Our coverage is over 99% now.

13 years agotdb2: extend test/layout to be able to place in file.
Rusty Russell [Mon, 25 Oct 2010 00:08:55 +0000 (10:38 +1030)]
tdb2: extend test/layout to be able to place in file.

This was for lockcheck, but that didn't work very well.  Seems like a useful
addition nonetheless.

13 years agotdb2: fix intermittent test fail.
Rusty Russell [Sun, 24 Oct 2010 22:51:51 +0000 (09:21 +1030)]
tdb2: fix intermittent test fail.

With correct seed, we could expand hash and break test.

13 years agoopt: change / separator to |
Rusty Russell [Fri, 22 Oct 2010 01:25:43 +0000 (11:55 +1030)]
opt: change / separator to |

Paul Wayper points out that "or" has a better mental mapping, and more
importantly that this is how Perl's Getopt::Long does it.

I'm still leaving the - and -- in there, for reasons previously articulated
(grep-friendly and harder to get wrong).

13 years agoavl: I attached a patch changing the AVL module to the MIT license.
Joey Adams [Thu, 21 Oct 2010 07:55:46 +0000 (18:25 +1030)]
avl: I attached a patch changing the AVL module to the MIT license.

13 years agolicense: more changing of licence -> license.
Rusty Russell [Thu, 21 Oct 2010 07:54:19 +0000 (18:24 +1030)]
license: more changing of licence -> license.

13 years agowebpages: make sure target of licence links is included in tarballs.
Rusty Russell [Thu, 21 Oct 2010 07:51:27 +0000 (18:21 +1030)]
webpages: make sure target of licence links is included in tarballs.

13 years agoavl: new module
Rusty Russell [Wed, 20 Oct 2010 05:40:16 +0000 (16:10 +1030)]
avl: new module

13 years agotdb2: 64 bit fixes.
Rusty Russell [Wed, 20 Oct 2010 03:49:11 +0000 (14:19 +1030)]
tdb2: 64 bit fixes.

13 years agotypesafe_cb: 64 bit fixes.
Rusty Russell [Wed, 20 Oct 2010 02:28:49 +0000 (12:58 +1030)]
typesafe_cb: 64 bit fixes.

In particular, gcc warns about cast from int to pointer.

13 years agotdb: 64-bit fixes.
Rusty Russell [Wed, 20 Oct 2010 02:28:20 +0000 (12:58 +1030)]
tdb: 64-bit fixes.

13 years agotally: fixes for 64 bit machines.
Rusty Russell [Wed, 20 Oct 2010 02:21:50 +0000 (12:51 +1030)]
tally: fixes for 64 bit machines.

13 years agoread_write_all: don't rely on write to pipe blocking in tests.
Rusty Russell [Wed, 20 Oct 2010 02:20:18 +0000 (12:50 +1030)]
read_write_all: don't rely on write to pipe blocking in tests.

Instead, directly control write().

13 years agoopt: 64-bit compile fixes
Rusty Russell [Wed, 20 Oct 2010 02:10:00 +0000 (12:40 +1030)]
opt: 64-bit compile fixes

%.* => unsigned, not size_t.

13 years agoccan_tokenizer: 64-bit compile fixes.
Rusty Russell [Wed, 20 Oct 2010 02:09:21 +0000 (12:39 +1030)]
ccan_tokenizer: 64-bit compile fixes.

%zu for size_t printf.

13 years agoalloc: fix 64-bit
Rusty Russell [Wed, 20 Oct 2010 02:08:39 +0000 (12:38 +1030)]
alloc: fix 64-bit

Make sure we use 1UL to bitshift, not 1.

13 years agotools: fixes for 64-bit.
Rusty Russell [Wed, 20 Oct 2010 02:07:45 +0000 (12:37 +1030)]
tools: fixes for 64-bit.

printf's %.* means an unsigned arg, not a size_t.

13 years agotdb2: fix infinite loop in tdb_check
Rusty Russell [Mon, 18 Oct 2010 02:54:20 +0000 (13:24 +1030)]
tdb2: fix infinite loop in tdb_check

check_free_list returns a length, not bool.