1. 28 May, 2015 2 commits
    • David Gibson's avatar
      asearch: Add context pointer to asearch comparison callback · e7519047
      David Gibson authored
      asearch, like the standard library bsearch, takes a comparison callback.
      Like bsearch() that callback doesn't include a user supplied context
      pointer.  As well as being generally limiting, that makes the comparison
      functions used by asearch gratuitously different from those used by the
      asort module.
      
      This patch alters this.  Note that this is an incompatible change to the
      asearch interface.  I think this is worth it to correct the oversight, but
      others might disagree.  At present the only user within ccan is ntdb, which
      is corrected to match.
      
      This means actually supplying a binary search implementation, rather than
      relying on bsearch() from the standard library.  We follow the lead of the
      asort module and steal^H^H^H^H^Hadapt the implementation from glibc.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      e7519047
    • David Gibson's avatar
      asearch: Correct license tag to LGPL 2.1+ · 8ad4e453
      David Gibson authored
      The _info file for asearch currently gives the license as just "LGPL".
      That gives a warning from ccanlint, because it interprets that as the
      latest LGPL 3 whereas asearch.h and the license link indicate it's actually
      LGPL 2.1+.
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      8ad4e453
  2. 27 May, 2015 4 commits
  3. 25 May, 2015 9 commits
  4. 24 May, 2015 1 commit
  5. 20 May, 2015 2 commits
  6. 19 May, 2015 4 commits
  7. 14 May, 2015 1 commit
  8. 12 May, 2015 1 commit
  9. 05 May, 2015 1 commit
  10. 25 Apr, 2015 1 commit
  11. 24 Apr, 2015 4 commits
  12. 13 Apr, 2015 1 commit
    • Delio Brignoli's avatar
      tal_stack · 73930140
      Delio Brignoli authored
      Hi Rusty,
      
      Thanks for reviewing the patch. V2 is attached, see my comments below.
      
      > On 31 Mar 2015, at 02:36, Rusty Russell <rusty@rustcorp.com.au> wrote:
      >
      > Delio Brignoli <brignoli.delio@gmail.com> writes:
      >> Hi All,
      >>
      >> tal_stack implements a (trivial) stack of tal contexts. Would this be a worthy addition to CCAN? (not necessarily in its current form).
      
      […]
      
      >        This is cute; I’ve seen similar used in Samba.  It's
      
      Indeed, it was inspired by talloc_stack.h ;-)
      
      […]
      
      > You are missing a _info file: I would create that, and put your example
      > in an Example: section there.
      
      I moved the module and tests under can/tal/stack and added a LICENSE and _info.
      
      > Other random advice:
      > 1) You should also document the tal_newframe function (particularly note
      >   that you're expected to tal_free the result, and that it will free
      >   any future unfreed frames).  And note that it’s not threadsafe.
      
      Done.
      
      > 2) You probably want tal_newframe to be a macro, and hand file and line
      >   thought to the tal_alloc_ call.  That makes debugging nicer when
      >   you iterate the tree.
      
      Done. The macro is calling a tal_newframe_() function because I’d rather not make the module’s stack variable ‘public’.
      
      > 3) Consider whether you want to declare a dummy type 'struct tal_stack'.
      >   Probably pretty unnecessary since it’s quite clear.
      
      Skipped this one. We can declare it later if we change our minds.
      
      Thanks
      —
      Delio
      
      From c2ceb9258d97b0dcb72e7b6986cfd2bd394b254e Mon Sep 17 00:00:00 2001
      From: Delio Brignoli <dbrignoli@audioscience.com>
      Date: Sun, 15 Mar 2015 13:26:40 +0100
      Subject: [PATCH] tal_stack: new module - V2
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      73930140
  13. 10 Apr, 2015 1 commit
    • Peter Barker's avatar
      ccanlint: avoid segfault when module_builds' linking fails · bdb8d751
      Peter Barker authored
      In the case that the objects built but linking failed, module_builds.c
      called score_file_error with a NULL ccan_file object and 0 for line
      number.
      
      score_file_error assumed that the ccan_file object it is passed was
      not-NULL when appending file errors to the score's aggregate error
      string.  It attempted to dereference it to get "fullname".
      
      score_error was factored out from score_file_error.  It takes a
      "source" parameter, which is the file's full name (and possibly line
      number) in the score_file_error case, and the ccan module name in the
      case of link failure.
      bdb8d751
  14. 30 Mar, 2015 8 commits