summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2015-09-14strgrp: Fix compile errors in exampleHEADmasterDavid Gibson
Commit 63f13d6 "strgrp: Tidy up kerneldoc in _info" introduced some compile errors into the example in strgrp/_info. This fixes them. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-09-13mem: Add memswap() functionDavid Gibson
Add a memswap() function to the mem module, which exchanges two (equal sized, non-overlapping) memory regions. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-09-13mem: Add function to check whether memory ranges overlapDavid Gibson
The test is simple, but every time I do it by hand, I always spend ages convincing myself it's actually correct. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-09-13mem: Remove array_size dependencyDavid Gibson
The mem module declares array_size as a test dependency, and includes it in test/api.c, but doesn't actually use it. This removes the unneeded dependency. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-09-12strgrp: Tidy up kerneldoc in _infoAndrew Jeffery
The documentation as it stood rendered badly in HTML due to a lack of knowledge of kerneldoc formatting.
2015-09-10strgrp: Optionally include OpenMP pragmaAndrew Jeffery
2015-09-10ccanlint: Add cflags support to _infoAndrew Jeffery
2015-09-09configurator: Add OpenMP detectionAndrew Jeffery
2015-09-09strgrp: new moduleAndrew Jeffery
2015-09-07mem: add memends_str() helper for symmetryCody P Schafer
Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-09-07mem: mark all functions as PURECody P Schafer
This might allow compilers that support the anotation to make better choices when optimizing, and all these functions meet the requirements for being marked pure. Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-09-07bytestring: use newly added mem helpersCody P Schafer
Reviwed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-09-07mem: add mem helper functionsCody P Schafer
Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-08-20array_size: fix spurious test fail with gcc-5Rusty Russell
It now warns about sizeof(function-param-not-really-an-array). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-20pr_log: a new module that provides a simple run-time controlled logging ↵Cody P Schafer
interface A simple printf logging infra where levels are determined by the value of the "DEBUG" environment variable. This is loosely based on the interfaces & functionality of Linux's printk() and pr_*() wrapper macros. Note that the current implementation uses "<N>" prefixes (where N is a syslog level in ascii), allowing other programs that parse log output (like systemd's journald) to know what the priority level is. Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-19list: suppress unused argument warningsCody P Schafer
Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-19configurator: avoid potential unused parameter warnings hosing our config.hCody P Schafer
Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-19configurator: sometimes _GNU_SOURCE is already defined, in those cases avoid ↵Cody P Schafer
redefinition Config defines are disabled if a warning is emitted (we may want to reconsider that), and warnings are emitted for define redefinition. Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-19configurator: hide type punningCody P Schafer
As for the type punning: gcc-5.1 with optimization (at least) warns about type punning in the previous example. The new usage should be exactly equivalent to the old, but just seperates the cast and deref into 2 statements. Frankly, I'm suprised gcc's type-punning analysis is so limited. Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-18bytestring: Add rational comment to testcaseDavid Gibson
Reviewing the previous patch it took me some time to work out what the purpose of the compile_fail-BYTESTRING-2.c test. Add a comment to avoid that in future. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-08-18bytestring: avoid compile_fail failure due to uninitialized warningCody P Schafer
bytestring: Module tests compile (tests_compile): FAIL /home/x/g/ccc/ccan/ccan/bytestring/test/compile_fail-BYTESTRING-2.c:Compile gave warnings without -DFAIL: /home/x/g/ccc/ccan/ccan/bytestring/test/compile_fail-BYTESTRING-2.c: In function ‘main’: /home/x/g/ccc/ccan/ccan/bytestring/test/compile_fail-BYTESTRING-2.c:15:2: warning: ‘bs.len’ is used uninitialized in this function [-Wuninitialized] printf("%zd %s\n", bs.len, x); ^ Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-08-17talloc: avoid a comparison mismatch & at the same time switch to non-legacy ↵Cody P Schafer
sysconf() Without this, gcc warns about a sign mismatch in the comparison. Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-17configurator: avoid leaks that LeakSanitizer doesn't likeCody P Schafer
These leaks aren't really an issue since they are completely bounded, but if one is building with leak sanitizer enabled (as -fsanitize=address does in gcc-5.1), it kills the configurator, which isn't very useful for us. Add the few free() calls it's looking for. This is not an actual code issue, they just workaround some optional compiler peculiarities. Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (split off leak change)
2015-08-15cpuid: update inline docsA. Samy
Signed-off-by: A. Samy <f.fallen45@gmail.com>
2015-08-15cpuid: use a hardcoded constant when comparing CPU namesA. Samy
Signed-off-by: A. Samy <f.fallen45@gmail.com>
2015-08-14cpuid: fix test.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-12cpuid: namespacize some functions and define them as null if unsupportedA. Samy
2015-08-12cpuid: cpuid_write_info(): have outfile a file pointer insteadA. Samy
2015-08-12cpuid: rename ___cpuid to get_cpuidA. Samy
2015-08-12cpuid: minor clean upA. Samy
2015-08-12Makefile-ccan: add new modules.Rusty Russell
I really need to get rid of this... Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-02agar: Re-entrant Abstract Graph AlgorithmsDavid Gibson
New module Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-08-02aga: Add lazytrie testcaseDavid Gibson
This adds a more complex testcase to the aga module. This one is a trie (basically a radix tree for strings). It demonstrates different ways of constructing edge information from an internal representation than the existing testcases. Importantly, it also demonstrates aga's ability to cope with the edge function lazily constructing nodes on the fly. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-08-02aga: Testcase for attempt to run concurrent algorithmsDavid Gibson
The aga algorithms can't be run concurrently, because they store state information in the aga_node structures. However, they are supposed to detect an attempt to re-enter and safely report an error. This adds a testcase for this. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-08-02aga: Breadth first searchDavid Gibson
This implements breadth first search for the abstract graph algorithms module. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-08-02aga: Depth first searchDavid Gibson
This implements depth first search for the abstract graph algorithms module. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-08-02aga: Simple test graphsDavid Gibson
This adds code for a number of example graphs for use in tests of the aga module. They also demonstrate several different ways of constructing graphs using the aga callbacks. It adds one actual testcase, which just verifies that the example graph look like what they're supposed to. Specifically it computes a set of adjacency lists for the example graphs from the callback code, then compares that to a canned example of what it should be. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-08-02aga: Abstract Graph AlgorithmsDavid Gibson
New module. This patch just adds the module, with some generic helper routines, no actual algorithms are implemented yet. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-07-30daemonize: check setsid() return valueMaxim Zakharov
2015-07-30daemonize: exit parent without triggering atexit() processingMaxim Zakharov
2015-07-20short_types: Fix warning in testJoel Stanley
Our project builds the ccan tests with -Wextra, so we get warnings about the unused variables. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools/modfiles: include _info (unless requested not to)Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools/create-ccan-tree: clean up modfiles binary after use.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools/create-ccan-tree: fix nested modules with -aRusty Russell
The cp -a would copy nested submodules, and worse, if that submodule was copied later it would end up duplicated in a subdir, eg. "ccan/tal/str/str/". Using modfiles handles this properly, and also uses git to filter out ignored files & other junk. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools/modfiles: list files in a module.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools: include LICENSE file in manifest.Rusty Russell
It's generally a symlink, so the lstat & S_ISREG tests were eliminating it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools: don't include submodules in manifest.Rusty Russell
They currently get classed as "other_files"; they should be entirely ignored. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09crypto/sha256: add license file for intel code in benchmarks/Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-08Makefile-ccan: add order to MOD list.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-08crypto/ripemd160: new module.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>