Commit Graph

13 Commits (0345aba082c83e9950f9dd8b7ea3bf91fe566a02)

Author SHA1 Message Date
Adrian Perez de Castro 9e3045c7f5 MSVC: Provide an implementation of gettimeofday() 2019-12-28 16:12:15 +02:00
Ran Benita d1e39c111e test/atom: use correct format specifier for size_t
From MSVC:

test\atom.c(98): note: consider using '%zu' in the format string
test\atom.c(98): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(100): note: consider using '%zu' in the format string
test\atom.c(100): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(114): note: consider using '%zu' in the format string
test\atom.c(114): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(128): note: consider using '%zu' in the format string
test\atom.c(128): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(130): note: consider using '%zu' in the format string
test\atom.c(130): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'size_t'
test\atom.c(137): note: consider using '%zu' in the format string
test\atom.c(137): warning C4477: 'fprintf' : format string '%lu' requires an argument of type 'unsigned long', but variadic argument 2 has type 'size_t'

Signed-off-by: Ran Benita <ran@unusedvar.com>
2019-12-28 14:13:52 +02:00
Ran Benita da4a90c13e Open files in binary mode
This turns off some misfeatures on Windows, and does nothing on POSIX.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2019-12-28 13:49:40 +02:00
Ran Benita 40aab05e77 build: include config.h manually
Previously we included it with an `-include` compiler directive. But
that's not portable. And it's better to be explicit anyway.

Every .c file should have `include "config.h"` first thing.

Signed-off-by: Ran Benita <ran@unusedvar.com>
2019-12-27 13:09:11 +02:00
Ran Benita c8e17eede5 bench: simplify the bench helpers
Trim the API a bit.

Also, just always use gettimeofday(), which is portable. Hopefully the
system clock doesn't change while a benchmark is running.

Signed-off-by: Ran Benita <ran234@gmail.com>
2018-07-05 18:29:39 +03:00
Ran Benita d44ba481d7 build: remove unneeded preprocessor include flags
Better to avoid these unexpected include paths.

Signed-off-by: Ran Benita <ran234@gmail.com>
2017-07-31 15:55:48 +03:00
Ran Benita fe81dcbd2f bench: fix compilation on hurd
Patch by Samuel Thibault.

https://github.com/xkbcommon/libxkbcommon/issues/39

Signed-off-by: Ran Benita <ran234@gmail.com>
2016-09-19 10:09:12 +03:00
Ran Benita 853b7502f4 bench/compose: tabs -> spaces
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-09-16 09:36:27 +03:00
Bryce Harrington ea9a5bcfd7 bench: Check for errors opening Compose file
Otherwise it can segfault e.g. running ./compose inside the bench
directory.

Signed-off-by: Bryce Harrington <bryce@bryceharrington.org>
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-09-16 09:23:43 +03:00
Ran Benita 4c24f7faa8 test: assert/ignore some warn_unused_result's
Signed-off-by: Ran Benita <ran234@gmail.com>
2016-03-15 20:45:05 +02:00
Kazunobu Kuriyama 3c12d671cc bench: Modify benchmarks for a wider range of platforms
- Add the new files bench.c and bench.h to implement a timer module.
 - Implement the module with clock_gettime(), mach_absolute_time(), or
   gettimeofday(), depending on a given platform.
 - Replace the time measurement code of the benchmark programs with the
   functions of the module.
2015-08-28 20:02:26 +09:00
Ran Benita 8d58e250b0 bench/compose: add new benchmark
Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-05 12:56:46 +03:00
Ran Benita bc3b4c084a Move benchmarks from tests to their own files in bench/
The tests only contain tests, and the benchmarks are more visible.

Signed-off-by: Ran Benita <ran234@gmail.com>
2014-10-02 22:03:28 +03:00