- 23 Jun, 2014 5 commits
-
-
Rusty Russell authored
HAVE_CLOCK_GETTIME_IN_LIBRT now implies HAVE_CLOCK_GETTIME. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
This avoids conflicts with autoconf and other config.h sources. Based on the work by Cody P Schafer <dev@codyps.com>. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Douglas Bagnall authored
Instead show '(nil)', like other people do. This is distinguishable from a similar looking string value, because the latter is shown with double quotes while NULL's nil has no quotes. Signed-off-by: Douglas Bagnall <douglas@halo.gen.nz> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Douglas Bagnall authored
opt_dec_intval decrements an int value, just as opt_inc_intval increments. There is not much more to say, other than it allows this kind of thing, with balanced opposing options: static int opt_verbosity = 0; static struct opt_table options[] = { OPT_WITHOUT_ARG("-q|--quiet", opt_dec_intval, &opt_verbosity, "print less"), OPT_WITHOUT_ARG("-v|--verbose", opt_inc_intval, &opt_verbosity, "print more"), OPT_ENDTABLE }; which is an occasionally seen idiom. It allows, e.g., people who like quiet to use `alias foo='foo -q'`, while letting them get back to normal and verbose modes with various amounts of '-v's. Signed-off-by: Douglas Bagnall <douglas@halo.gen.nz> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Douglas Bagnall authored
The helper API functions based on set_llong_with_suffix() left the value uninitialised in the case of an empty string argument. This is quite unlikely to have caused problem in practice, as most values will have already been set to a default and the non-NULL error message should have triggered an early exit or some other emergency action. Nevertheless, it caused a compiler warning on some minor version of GCC 4.8 which I no longer seem to have, and the complaint seemed reasonable at the time. If an empty string (or any other non-numeric value) is passed to strtoll(), the result is zero. As far as I know, the strtoll() call is only short-circuited here to form a more specific error message, not because there is a good reason for the empty string to be a special non-initialising case. So let's set it to zero. Signed-off-by: Douglas Bagnall <douglas@halo.gen.nz> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 22 Jun, 2014 1 commit
-
-
David Gibson authored
When I fixed up the includes in _info for nearly everything, I managed to leave out a couple of my own modules. This fixes them up. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
- 21 Jun, 2014 3 commits
-
-
Cody P Schafer authored
CC: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Cody P Schafer authored
Add a bunch of __ for all the attribute members. Lets us keep working even if configurator is called with different CFLAGS than the build of a file which includes compiler.h Idealy, we (people using ccan) wouldn't let this happen, however I don't see any reason /not/ to avoid build breakage in the above case. Long term, it might make sense to plug some logic into configurator's config.h (or a cc wrapper, so something else) to warn when the current flags don't look the same as the ones used to generate config.h CC: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Cody P Schafer authored
CC: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 16 Jun, 2014 4 commits
-
-
David Gibson authored
haystack is a void *, so we can't do pointer arithmetic on it uncasted. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
David Gibson authored
There are a couple of small problems with the includes used in most of ccan's _info files. * _info routinely uses printf(), and so should include <stdio.h>, but only some of them do. We get away with it, because they do include <string.h>, which apparently includes <stdio.h> indirectly, but we should be explicit about it. * Most _info files were including config.h after the system headers. That _seems_ sensible, but actually causes problems. Because config.h defines _GNU_SOURCE it can change the behaviour of the system headers. More specifically it can make them behave differently to how the individual module headers (which have included config.h) expects them to behave. This patch adjusts all the existing _info files and, more importantly, the template constructed by ccanlint. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
David Gibson authored
This changes rfc822 to use the memmem module to supply a memmem() function if the C library lacks it, instead of rolling our own locally. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
David Gibson authored
glibc includes a memmem() function which, by analogy with strstr() searches for a byte sequence within a larger byte sequence. The function isn't standard, however, so other C libraries may not include it. This adds a trivial module providing the memmem() function, if the C library doesn't already do so. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 13 Jun, 2014 2 commits
-
-
David Gibson authored
Forgot the 'inline' in 'static inline' in the functions defined in the header, which means that lots of warnings will be generated, if you include the header but don't use the functions. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 12 Jun, 2014 1 commit
-
-
Rusty Russell authored
time_between()'s ordering matches time_sub, for better or worse. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 10 Jun, 2014 21 commits
-
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
From patch by David Gibson, rewritten on new ccan/time. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
As suggested by David Gibson. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
ccanlint now detects more missing dependencies. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Arguably a bug in talloc_realloc_array, which uses an unsigned for size, resulting in silent truncation and a memcpy into a too-small buffer. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
All the cool kids are using tal/str now... Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Broken since commit 7c69053b which normalized API. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Broken since commit 2012d45e which switched to timespec. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
tal variant of grab_file (which uses talloc). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
It's a prototype unused by anything else. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Showing its origins in talloc_link. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Cut & paste bug. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 04 Jun, 2014 2 commits
-
-
David Gibson authored
A straightforward implementation of the Jacobson/Karels algorithm for estimating round-trip time on a network link. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
David Gibson authored
Add a 'minmax' module with typesafe macros to compute minimum, maximum and clamping. Inspired by the versions used in the Linux kernel, but using a different implementation based on __builtin_types_compatible_p() and the build_assert module. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 02 Jun, 2014 1 commit
-
-
Rusty Russell authored
Somehow, it was a normal file. Reported-by: Sam Watkins <sam@nipl.net> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-