Commit 6af4d7dd authored by william's avatar william

fix remaining internal spelling from timer to timeout

parent e71fad93
all: timer timer8 timer16 timer32 timer64
all: timeout timeout8 timeout16 timeout32 timeout64
WHEEL_BIT = 6
WHEEL_NUM = 4
CPPFLAGS = -DTIMER_DEBUG -DTIMER_MAIN
CPPFLAGS = -DTIMEOUT_DEBUG -DTIMEOUT_MAIN
CFLAGS = -O2 -g -Wall -Wextra
timer: CPPFLAGS+=-DWHEEL_BIT=$(WHEEL_BIT) -DWHEEL_NUM=$(WHEEL_NUM)
timeout: CPPFLAGS+=-DWHEEL_BIT=$(WHEEL_BIT) -DWHEEL_NUM=$(WHEEL_NUM)
timer8: CPPFLAGS+=-DWHEEL_BIT=3 -DWHEEL_NUM=$(WHEEL_NUM)
timeout8: CPPFLAGS+=-DWHEEL_BIT=3 -DWHEEL_NUM=$(WHEEL_NUM)
timer16: CPPFLAGS+=-DWHEEL_BIT=4 -DWHEEL_NUM=$(WHEEL_NUM)
timeout16: CPPFLAGS+=-DWHEEL_BIT=4 -DWHEEL_NUM=$(WHEEL_NUM)
timer32: CPPFLAGS+=-DWHEEL_BIT=5 -DWHEEL_NUM=$(WHEEL_NUM)
timeout32: CPPFLAGS+=-DWHEEL_BIT=5 -DWHEEL_NUM=$(WHEEL_NUM)
timer64: CPPFLAGS+=-DWHEEL_BIT=6 -DWHEEL_NUM=$(WHEEL_NUM)
timeout64: CPPFLAGS+=-DWHEEL_BIT=6 -DWHEEL_NUM=$(WHEEL_NUM)
timer64 timer32 timer16 timer8 timer: timer.c
timeout64 timeout32 timeout16 timeout8 timeout: timeout.c
$(CC) $(CFLAGS) -o $@ $^ $(CPPFLAGS)
......@@ -25,7 +25,7 @@ timer64 timer32 timer16 timer8 timer: timer.c
.PHONY: clean clean!
clean:
$(RM) -r timer timer8 timer16 timer32 timer64 *.dSYM
$(RM) -r timeout timeout8 timeout16 timeout32 timeout64 *.dSYM
clean~: clean
$(RM) *~
......@@ -3,15 +3,15 @@
*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#if TIMER_DEBUG - 0 || TIMER_MAIN - 0
#if TIMEOUT_DEBUG - 0 || TIMEOUT_MAIN - 0
#include <stdlib.h>
#include <stdio.h>
#undef TIMER_DEBUG
#define TIMER_DEBUG 1
#define DEBUG_LEVEL timer_debug
#undef TIMEOUT_DEBUG
#define TIMEOUT_DEBUG 1
#define DEBUG_LEVEL timeout_debug
static int timer_debug;
static int timeout_debug;
#define SAYit_(lvl, fmt, ...) do { \
if (DEBUG_LEVEL >= (lvl)) \
......@@ -25,8 +25,8 @@ static int timer_debug;
_Exit(EXIT_FAILURE); \
} while (0)
#else
#undef TIMER_DEBUG
#define TIMER_DEBUG 0
#undef TIMEOUT_DEBUG
#define TIMEOUT_DEBUG 0
#define DEBUG_LEVEL 0
#define SAYit(...) (void)0
......
/* ==========================================================================
* timer.c - Tickless hierarchical timing wheel.
* timeout.c - Tickless hierarchical timing wheel.
* --------------------------------------------------------------------------
* Copyright (c) 2013 William Ahern
*
......@@ -32,9 +32,9 @@
#include <sys/queue.h>
#include "timer.h"
#include "timeout.h"
#if TIMER_DEBUG - 0 || TIMER_MAIN - 0
#if TIMEOUT_DEBUG - 0 || TIMEOUT_MAIN - 0
#include "debug.h"
#endif
......@@ -572,7 +572,7 @@ void timeout_del(struct timeout *to) {
} /* timeout_del() */
#if TIMER_MAIN - 0
#if TIMEOUT_MAIN - 0
#include <stdio.h>
#include <stdlib.h>
......@@ -615,7 +615,7 @@ int main(int argc, char **argv) {
break;
case 'v':
timer_debug++;
timeout_debug++;
break;
}
......@@ -656,4 +656,4 @@ int main(int argc, char **argv) {
return 0;
} /* main() */
#endif /* TIMER_MAIN */
#endif /* TIMEOUT_MAIN */
/* ==========================================================================
* timer.h - Tickless hierarchical timing wheel.
* timeout.h - Tickless hierarchical timing wheel.
* --------------------------------------------------------------------------
* Copyright (c) 2013 William Ahern
*
......@@ -23,8 +23,8 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE.
* ==========================================================================
*/
#ifndef TIMER_H
#define TIMER_H
#ifndef TIMEOUT_H
#define TIMEOUT_H
#include <stdbool.h> /* bool */
#include <stdio.h> /* FILE */
......@@ -153,4 +153,4 @@ bool timeouts_check(struct timeouts *, FILE *);
/* return true if invariants hold. describes failures to optional file handle. */
#endif /* TIMER_H */
#endif /* TIMEOUT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment