- 06 Nov, 2016 4 commits
-
-
Rusty Russell authored
Make register_timer "use" my_timer_callback and its own args. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Many are because argc is 'int' not 'unsigned', others just laziness. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
This allows examples to refer to them, but we cast them to void at the end to avoid -Wunused warnings. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Either with UNNEEDED (if the module already used ccan/compiler) or with (void) casting. The only other change is in ccan/list/test/run-CCAN_LIST_DEBUG.c, because the linenumbers change and thus it needs updating. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 04 Nov, 2016 9 commits
-
-
Rusty Russell authored
This avoids the warning about it being unused with -Wunused. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
This makes us closer to compiling cleanly with -Wunused (as used by -Wextra). 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
Found by PCS Suite. Reported-by: Jon Griffiths Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Ahmed Samy <f.fallen45@gmail.com>
-
David Gibson authored
Adds a new test graph which includes a negative weight cycle. This means that shortest paths are not well defined, and both Dijkstra's algorithm and the Bellman-Ford algorithm (which can handle some negative edge weights) will fail. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
David Gibson authored
This adds the Bellman-Ford single-source shortest path algorithm to the aga and agar modules. The Bellman-Ford algorithm is (usually) slower than Dijkstra's algorithm, but unlike Dijkstra's is able to cope with negative edge costs, unless they form a negative cost cycle. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
David Gibson authored
aga_dijkstra_all_paths() runs Dijkstra's algorithm to completion (as opposed to aga_dijkstra_path(), which operates lazily). In effect this computes the shortest path to all (reachable) nodes from the start node. So, in this context the name makes sense. But for an analogous function for future algorithms (e.g. Bellman-Ford), the name doesn't make sense. So, in the interests of consistency with those future extensions, change the name of this to aga_dijkstra_complete(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Rusty Russell authored
Not really a bug, but stylistically questionable and makes PCS Suite complain. Reported-by: Jon Griffiths Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 02 Nov, 2016 1 commit
-
-
David Gibson authored
The list of additional packages in our .travis.yml (mostly libraries needed for specific modules) was incorrectly formatted. So travis was attempting to install the "libjudy-dev libvorbis-dev libportaudio-dev libtalloc-dev" packagde (spaces included) which obviously didn't work. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
- 31 Oct, 2016 4 commits
-
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Remove timer_add() in favor of explicit timer_addrel and timer_addmono. Someone hit a real-life case where time went backwards, and we asserted. The correct fix is to use time_mono() where available, but as all known users actually want a relative timeout, have a helper for that case. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Include assert checks, implement timemono_eq(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 30 Oct, 2016 1 commit
-
-
Rusty Russell authored
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 28 Oct, 2016 1 commit
-
-
Rusty Russell authored
Minor fixes on top of patch from rocco@tecsiel.it: Hi Rusty, latest git version of the file ccan/jmap/tools/speed.c does not compile. Please find attacched my own version with the following differences: 1. deleted inclusion of <ccan/jmap/jmap_type.h> which is no longer in ccan/ 2. added inclusion of <ccan/time/time.h> 3. added definition of struct jmap_obj in terms of JMAP_MEMBERS(); 4. deleted use of macro JMAP_DEFINE_UINTIDX_TYPE() which is no longer needed 5. changed function normalize() to be aligned with ccan/htable/tools/speed.c 6. repleaced gettimeofday() in favour of time_now() 7. added memory cleanup at the end of the program in terms of jmap_free(jmap); free(objs); to be valgrind safe Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 25 Oct, 2016 6 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
/home/rusty/devel/cvs/ccan/ccan/io/test/run-01-start-finish.c: In function ‘main’: /home/rusty/devel/cvs/ccan/ccan/io/test/run-01-start-finish.c:89:7: warning: ‘addrinfo’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (connect(fd, addrinfo->ai_addr, addrinfo->ai_addrlen) != 0) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
/home/rusty/devel/cvs/ccan/ccan/tap/tap.h:57:59: warning: ‘max_iters’ may be used uninitialized in this function [-Wmaybe-uninitialized] _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \ ^ /home/rusty/devel/cvs/ccan/ccan/foreach/test/run-nested.c:47:17: note: ‘max_iters’ was declared here int i, j, sum, max_iters; Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
/home/rusty/devel/cvs/ccan/ccan/err/test/run.c:124:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result] pipe(pfd); Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
Rusty Russell authored
/home/rusty/devel/cvs/ccan/ccan/cdump/cdump.c: In function ‘get_type’: /home/rusty/devel/cvs/ccan/ccan/strmap/strmap.h:88:39: warning: ‘m’ may be used uninitialized in this function [-Wmaybe-uninitialized] tcon_cast((map), canary, strmap_get_(&(map)->raw, (member))) ^ /home/rusty/devel/cvs/ccan/ccan/cdump/cdump.c:216:20: note: ‘m’ was declared here cdump_map_t *m; ^ Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-
- 30 Sep, 2016 7 commits
-
-
Kevin Locke authored
This file defines the AppVeyor CI (appveyor.com) settings. It builds using make+bash under MSYS2 so that the current build system can be used with minimal changes. It currently only builds configurator and generates config.h. The build and test commands for more thorough testing are left as comments in appveyor.yml so interested parties can use them as a starting point for future work. Note that several compiler errors not related to configurator are printed due to make attempting to generate and include test-depends. Although Windows-specific code could be added to Makefile to avoid these, it seemed unwarranted if the compile errors may be fixed soon. Changes since v2: - Add reference to AppVeyor results for canonical repo and basic instructions to setup AppVeyor for forks. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
This macro holds the C compiler flag(s) to force input files to be recognized as C sources regardless of extension. It is defined to allow overriding on the make command line. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
When compiling with Visual Studio, use default compiler name and flags which are likely to work with the known-available compiler. This is also a convenience for users who may not know what arguments cl.exe may need to compile the tests. Changes since v1: - Use "-option" instead of "/option" to avoid issues running under msys. - Disable C4200 warning for use of flexible array members, which MSVC considers an extension (since it does not fully support C99). Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
Unfortunately, not all compilers support -o as a command-line option for specifying the output file. Visual Studio cl.exe issues warning D9035 when -o is given, which is detected as a compile warning by the configurator. To support such compilers, add the command-line option -O to configurator which can be used to specify the cflag for setting the output executable file name. Additionally define the macro CCAN_OUTPUT_EXE_CFLAG in config.h and use it when invoking the compiler (e.g. from ccanlint). For reference, the name CCAN_OUTPUT_EXE_CFLAG was chosen to avoid potential name conflicts in the future due to cl.exe requiring different flags for different types of output[1] (e.g. object files are /Fo:). 1. https://msdn.microsoft.com/en-us/library/f1cb223a.aspxSigned-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
Windows does not provide cat. Instead, copy the test source to stdout using the file stream to which it was written. Changes since v1: - Create fwrite_noeintr to avoid EINTR in fwrite without writing any data. - Handle short reads from fread. This can happen with non-conformant libc or if EINTR occurs after reading some data. - Handle short writes from fwrite. This can happen with non-conformant libc or if EINTR occurs after writing some data. Changes since v2: - Revert fwrite_noeintr and short read/write changes. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
On systems where err.h is not provided (e.g. MSVC) configurator must provide its own definition. The err module can not be used by configurator due to its dependency on config.h, so the relevant source is copied into configurator with the minimum changes necessary. Changes since v2: - Use the CCAN err module sources instead of musl libc sources to avoid introducing another implementation of these functions. - Prefix err.h functions with "c12r_" to avoid name conflicts and "static declaration follows non-static" errors. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
Rather than using fork+pipe+system+waitpid, most of which are only available on POSIX-like systems, use popen which is also available on Windows (under the name _popen). Changes since v1: - Create fread_noeintr to avoid EINTR in fread without reading any data. - Handle short reads from fread. This can happen with non-conformant libc or if EINTR occurs after reading some data. - Define _POSIX_C_SOURCE for popen/pclose with strict implementations which require it (e.g. gcc with -std=c11). Changes since v2: - Revert fread_noeintr and short read changes in v1 as unnecessary. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
- 29 Sep, 2016 1 commit
-
-
Emilio G. Cota authored
Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
- 28 Sep, 2016 1 commit
-
-
Emilio G. Cota authored
time_mono()'s documentation references time_since(), which is nowhere to be found. A possible fix would be to just remove that stale reference. Instead, this patch adds timemono_since(), which hopefully captures the meaning of the original time_since(). Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
- 27 Sep, 2016 5 commits
-
-
Kevin Locke authored
On LLP64 systems (like 64-bit Windows) long is 32 bits while pointers are 64 bits, which results in a warning similar to the following: warning C4244: 'return': conversion from '__int64' to 'long', possible loss of data for HAVE_STACK_GROWS_UPWARDS. Fix this by using the ptrdiff_t type introduced by C99 for this purpose. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
Visual C++ prints "warning C4702: unreachable code" due to the return statement after the for loop which is never reached. Fix this by setting a variable returned by a single return statement at the end. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
Visual Studio prints warning C4706 "assignment within conditional expression" when there is an assignment without a comparison in a conditional expression. Therefore, to silence the warning, add an explicit comparison. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
Several of the EXECUTABLE tests depend on headers not available on Windows. Mark these tests MAY_NOT_COMPILE to handle this. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-
Kevin Locke authored
Although Windows APIs generally permit "/" or "\\" for directory separators in paths, cmd.exe does not recognize "./" when invoking executables using a relative path and prints the following error: '.' is not recognized as an internal or external command, operable program or batch file. Therefore, use "\\" when invoking tests on Windows. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-