- 22 Mar, 2011 19 commits
-
-
Rusty Russell authored
Just grab the tokens for the simple case: this allows the ccanlint reduce_features test to work on eg. ccan/cast.
-
Rusty Russell authored
This means we change some minor tests to "never fail", eg. whitespace or documentation tests. Note that pass/fail is independent of the score for a test.
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
Be a little more careful with const.
-
Rusty Russell authored
Shown up by -Wwrite-strings.
-
Rusty Russell authored
Wpointer-arith is useful for spotting GCC-isms which do arithmetic on void pointers. Wwrite-strings treats string constants as const char *, which is sane (but bad for legacy code).
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
Same fix as we used for ccan/typesafe_cb.
-
Rusty Russell authored
No only does this give us one more ccanlint point, it clears the way to see if we introduce a *real* memory leak later.
-
Rusty Russell authored
This need shows up most clearly with opt_usage_and_exit and gcc's -Wwrite-strings, where string literals become "const char *". Our callbacks should take const void *: since we overload the arg field already (to hold table size) it make sense to turn it into a proper union.
-
Rusty Russell authored
Headers should stand alone; we use NULL, so we should make sure it's defined.
-
Rusty Russell authored
I thought using sizeof() comparison to compare the types was clever, but it doesn't work on void pointers, as sizeof(void) is illegal.
-
Rusty Russell authored
In this case, "work" means "fail to compile cleanly".
-
Rusty Russell authored
-
Rusty Russell authored
-
- 21 Mar, 2011 12 commits
-
-
Rusty Russell authored
-
Rusty Russell authored
Don't implicitly cast away const in the tests.
-
Rusty Russell authored
In particular, avoid doing arithmetic on NULL; decay the function to a pointer using a trinary conditional instead.
-
Rusty Russell authored
It's common to want to create a struct tdb_data which contains a const pointer, so add a helper to do so, and use it to clean up other -Wcast-qual warnings.
-
Rusty Russell authored
-
Rusty Russell authored
Samba uses -Wcast-qual to warn about casting away const. The kind of coders who care about const correctness are likely to turn that option on, so we should make sure it's compatible with cast_const().
-
Rusty Russell authored
-
Rusty Russell authored
-
Rusty Russell authored
The foreach garbage collection assumed that iterators were all on the stack, but they could be on the heap or a global (or static) variable. We can prevent the heap case by tricky use of macros to complain on any iterator which isn't a single token, but we can't prevent globals/statics. So, if an iterator already seems to be "off" the stack, mark it as such and simply never free it.
-
Rusty Russell authored
-
Rusty Russell authored
David Gibson noted that foreach requires more than one argument. There's no particularly good reason for this, other than lack of imagination on my part.
-
Rusty Russell authored
-
- 17 Mar, 2011 9 commits
-
-
Rusty Russell authored
-
Rusty Russell authored
This makes transition from tdb1 much simpler.
-
Rusty Russell authored
As per TDB1, except that the sequence number is 63 bit.
-
Rusty Russell authored
As per TDB1, with one enhancement: a non-NULL name argument passed to tdb_open() with the TDB_INTERNAL flag is preserved so you can identify internal TDBs too.
-
Rusty Russell authored
We don't need this now, since we use explicit error numbers.
-
Rusty Russell authored
Everyone writes their own, so provide a standard one.
-
Rusty Russell authored
These are the same as the TDB1 functions; but note that there is no reliable way to tell if tdb_exists() fails due to an error. This simplifies the API, but means you have to use tdb_fetch() if you really care.
-
Rusty Russell authored
-
Rusty Russell authored
Finally, we enable sharing of the struct tdb_file. We add a reference count so we can free the struct tdb_file when the last tdb is closed.
-