Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions examples/hashmap/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,11 @@ main(int argc, const char *argv[])
srand(time(NULL));
bfdev_log_info("Generate %u node:\n", TEST_SIZE);
for (count = 0; count < TEST_SIZE; ++count)
nodes[count].value = ((uint64_t)rand() << 32) | rand();
nodes[count].value = count;

bfdev_log_info("Insert nodes:\n");
EXAMPLE_TIME_STATISTICAL(
for (count = 0; count < TEST_SIZE; ++count) {
value = ((uint64_t)rand() << 32) | rand();
nodes[count].value = value;

retval = bfdev_hashmap_add(&test_map, &nodes[count].node);
if (retval)
return retval;
Expand Down
3 changes: 2 additions & 1 deletion examples/ratelimit/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ current_msec(void)

BFDEV_BUG_ON(clock_gettime(CLOCK_REALTIME, &ts));

return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
return (bfdev_time_t)ts.tv_sec * 1000 +
ts.tv_nsec / 1000000;
}

int
Expand Down
3 changes: 2 additions & 1 deletion examples/tokenbucket/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ current_msec(void)

BFDEV_BUG_ON(clock_gettime(CLOCK_REALTIME, &ts));

return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
return (bfdev_time_t)ts.tv_sec * 1000 +
ts.tv_nsec / 1000000;
}

int
Expand Down
11 changes: 8 additions & 3 deletions include/bfdev/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@

BFDEV_BEGIN_DECLS

extern void bfdev_cbfunc_noop(void);
extern long bfdev_cbfunc_ret0(void);
extern long bfdev_cbfunc_ret1(void);
extern void
bfdev_cbfunc_noop(void);

extern long
bfdev_cbfunc_ret0(void);

extern long
bfdev_cbfunc_ret1(void);

#define bfdev_dummy_noop ((void *)bfdev_cbfunc_noop)
#define bfdev_dummy_ret0 ((void *)bfdev_cbfunc_ret0)
Expand Down
Loading