1. 07 Jan, 2011 5 commits
    • Rusty Russell's avatar
      ccanlint: rename test keys · f9423c17
      Rusty Russell authored
      Joey Adams rightly points out that the current keys are a mess: ideally the
      filenames, test keys and structure names in ccanlint should be the same.
      
      First step is to make the test names all regular, of basic form <noun>_<verb>
      (eg "tests_exist" rather than "has-tests").
      f9423c17
    • Rusty Russell's avatar
      Add scores/ directory to .gitignore. · 1e7c49e0
      Rusty Russell authored
      1e7c49e0
    • Joey Adams's avatar
      ccanlint: added --test-dep-graph option · 0ea24c23
      Joey Adams authored
      This option prints the dependency graph of ccanlint's tests
      in Graphviz .dot format.
      
      Sample usage:
      
      ccanlint --test-dep-graph | dot -Tpng > out.png && eog out.png
      0ea24c23
    • Joey Adams's avatar
      ccanlint: fix segfault caused by tests not depending on the "info" test. · 5f4051ea
      Joey Adams authored
      These tests:
      
      	"depends-exist"      (compulsory_tests/check_depends_exist.c)
      	"info-documentation" (tests/has_info_documentation.c)
      
      used m->info_file without checking if it was NULL,
      leading to a segfault when no _info file was present.
      
      Some other tests also used m->info_file without depending on "info",
      but are taken care of indirectly by this patch.
      5f4051ea
    • Joey Adams's avatar
      opt: Fix warnings with gcc-4.5 (same approach as commit 6535bdee) · af15570a
      Joey Adams authored
      &*ptr is used in some other macros, but at a glance, they look like
      cases where the pointer shouldn't be NULL .  Didn't change those,
      and if we get more warnings, we'll cross that bridge when we get to it.
      For now, I suppose they are just free NULL checks.
      af15570a
  2. 06 Jan, 2011 5 commits
  3. 04 Jan, 2011 4 commits
  4. 01 Jan, 2011 9 commits
  5. 23 Dec, 2010 4 commits
  6. 16 Dec, 2010 1 commit
    • Rusty Russell's avatar
      typesafe_cb: Fix warnings with gcc-4.5: · 6535bdee
      Rusty Russell authored
      Test compiled with warnings:
      /home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:/home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c: In function ‘main’:
      /home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
      /home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
      /home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
      /home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
      /home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
      /home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
      /home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:18:2: warning: taking address of expression of type ‘void’
      /home/rusty/devel/cvs/ccan/ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c:19:2: warning: taking address of expression of type ‘void’
      6535bdee
  7. 13 Dec, 2010 4 commits
  8. 08 Dec, 2010 4 commits
    • Rusty Russell's avatar
      rbtree: remove unused variable in tests. · 73cc6ce4
      Rusty Russell authored
      73cc6ce4
    • Ronnie Sahlberg's avatar
      rb_tree: fix trbt_delete · 90768177
      Ronnie Sahlberg authored
      trbt_delete32() was broken and caused SEGV as soon as you tried to
      delete an object from a tree.
      
      Rework trbt_delete32() to instead just call talloc_free() instread of trying
      to call delete_node() directly.
      This makes the "from_destructor" argument to delete_node() redundant
      so that parameter is removed too.
      Signed-off-by: default avatarRonnie Sahlberg <sahlberg@lenovo-laptop.(none)>
      90768177
    • Rusty Russell's avatar
      configurator: warnings count as failures too. · 2cae94de
      Rusty Russell authored
      Unfortunately, gcc only warns if it sees an unknown attribute (in this case, gcc 4.1 vs "cold").
      2cae94de
    • Rusty Russell's avatar
      ccanlint: fix compile on x86-64 · c102d5ec
      Rusty Russell authored
      cc -g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -I. -MD -Werror   -c -o tools/ccanlint/tests/examples_run.o tools/ccanlint/tests/examples_run.c
      cc1: warnings being treated as errors
      tools/ccanlint/tests/examples_run.c: In function ‘scan_forv’:
      tools/ccanlint/tests/examples_run.c:37: warning: passing argument 2 of ‘__builtin_va_copy’ discards qualifiers from pointer target type
      tools/ccanlint/tests/examples_run.c:43: warning: passing argument 4 of ‘scan_forv’ from incompatible pointer type
      tools/ccanlint/tests/examples_run.c:52: warning: passing argument 4 of ‘scan_forv’ from incompatible pointer type
      tools/ccanlint/tests/examples_run.c:60: warning: passing argument 4 of ‘scan_forv’ from incompatible pointer type
      tools/ccanlint/tests/examples_run.c: In function ‘scan_for’:
      tools/ccanlint/tests/examples_run.c:78: warning: passing argument 4 of ‘scan_forv’ from incompatible pointer type
      make: *** [tools/ccanlint/tests/examples_run.o] Error 1
      
      It really doesn't like constifying a va_arg, so remove the const declaration.
      c102d5ec
  9. 07 Dec, 2010 1 commit
  10. 06 Dec, 2010 3 commits
    • Rusty Russell's avatar
      idtree: fix overflow for v. large ids on allocation and removal · c5074939
      Rusty Russell authored
      Chris Cowan tracked down a SEGV in sub_alloc: idp->level can actually
      be equal to 7 (MAX_LEVEL) there, as it can be in sub_remove.
      c5074939
    • Rusty Russell's avatar
      idtree: fix right shift of signed ints · 9ad912e2
      Rusty Russell authored
      (Imported from SAMBA commit 2db1987f5a3a)
      
      Right-shifting signed integers in undefined; indeed it seems that on
      AIX with their compiler, doing a 30-bit shift on (INT_MAX-200) gives
      0, not 1 as we might expect (THIS WAS WRONG, REAL FIX LATER).
      
      The obvious fix is to make id and oid unsigned: l (level count) is also
      logically unsigned.
      
      (Note: Samba doesn't generally get to ids > 1 billion, but ctdb does)
      Reported-by: default avatarChris Cowan <cc@us.ibm.com>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      9ad912e2
    • Rusty Russell's avatar
      idtree: import fix from SAMBA source · 6994f3d0
      Rusty Russell authored
      (Imported from b53f8c187de8)
      
      Author: Rusty Russell <rusty@rustorp.com.au>
      Date:   Thu Jun 10 13:27:51 2010 -0700
      
      Since idtree assigns sequentially, it rarely reaches high numbers.
      But such numbers can be forced with idr_get_new_above(), and that
      reveals two bugs:
      
      1) Crash in sub_remove() caused by pa array being too short.
      2) Shift by more than 32 in _idr_find(), which is undefined, causing
         the "outside the current tree" optimization to misfire and return NULL.
      6994f3d0