commit 8bbbb381017811e36c43fd08b802ec6c293e4255
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Thu Apr 28 21:38:57 2016 +0200
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Thu Apr 28 21:38:57 2016 +0200
Fix warnings
Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
diff --git a/bench/benchmark-func.c b/bench/benchmark-func.c
index 016aa70..1dc9272 100644
--- a/bench/benchmark-func.c
+++ b/bench/benchmark-func.c
_AT_@ -16,10 +16,10 @@ struct function {
size_t a_start;
size_t a_end;
size_t a_step;
- int a_mode;
size_t b_start;
size_t b_end;
size_t b_step;
+ int a_mode;
int b_mode;
size_t runs;
size_t measurements;
_AT_@ -85,7 +85,7 @@ gettime(size_t m)
#endif
#define FUNCTION_2D(NAME, INSTRUCTION, PREINSTRUCTION)\
- void\
+ static void\
NAME(z_t *as, z_t* bs, struct function *f)\
{\
size_t i, j, k, n = f->a_end - f->a_start + 1;\
_AT_@ -114,8 +114,8 @@ gettime(size_t m)
(void) bs;\
}
-#define FAST2D(P) 1, 4097, 64, P, 0, 0, 0, 0, 1000, M_MAX
-#define SLOW2D(P) 1, 4097, 64, P, 0, 0, 0, 0, 10, 20
+#define FAST2D(P) 1, 4097, 64, 0, 0, 0, P, 0, 1000, M_MAX
+#define SLOW2D(P) 1, 4097, 64, 0, 0, 0, P, 0, 10, 20
#define LIST_2D_FUNCTIONS\
X(zset, FAST2D(FULL), zset(temp, *a),)\
_AT_@ -197,10 +197,10 @@ LIST_2D_FUNCTIONS
static z_t *
create_ints(size_t start, size_t end, int mode)
{
- z_t *array = malloc((end - start + 1) * sizeof(z_t));
+ z_t *array = malloc((++end - start) * sizeof(z_t));
z_t *rc = array;
ssize_t n;
- for (; start <= end; start++, array++) {
+ for (; start < end; start++, array++) {
zinit(*array);
switch (mode) {
case HIGH_ONLY:
diff --git a/bench/benchmark.h b/bench/benchmark.h
index 6d6aa87..cb42777 100644
--- a/bench/benchmark.h
+++ b/bench/benchmark.h
_AT_@ -101,11 +101,10 @@ rdtsc_join(unsigned int low, unsigned int high)
rdtsc(&end_low, &end_high);\
dur_cycles = rdtsc_join(end_low, end_high);\
dur_cycles -= rdtsc_join(start_low, start_high);\
- dur_seconds = dur_cycles;\
- dur_seconds /= freq;\
- dur_seconds /= 1000;\
- dur_seconds -= dur.tv_sec = (int)dur_seconds;\
- dur.tv_nsec = dur_seconds * 1000000000L;\
+ dur_seconds = (double)dur_cycles;\
+ dur_seconds /= 1000 * (double)freq;\
+ dur_seconds -= (double)(dur.tv_sec = (int)dur_seconds);\
+ dur.tv_nsec = (long int)(dur_seconds * 1000000000L);\
} while (0)
#elif defined(USE_CLOCK)
# define TIC (start = clock())
_AT_@ -130,5 +129,5 @@ rdtsc_join(unsigned int low, unsigned int high)
#endif
-#define TICKS (dur.tv_sec * 1000000000ULL + dur.tv_nsec)
+#define TICKS ((unsigned long long int)(dur.tv_sec) * 1000000000ULL + (unsigned long long int)(dur.tv_nsec))
#define STIME (sprintf(timebuf, "%lli.%09li", (long long)(dur.tv_sec), dur.tv_nsec), timebuf)
diff --git a/src/internals.h b/src/internals.h
index b055dbd..3213441 100644
--- a/src/internals.h
+++ b/src/internals.h
_AT_@ -144,7 +144,7 @@ libzahl_failure(int error)
}
static inline void
-libzahl_memfailure()
+libzahl_memfailure(void)
{
if (!errno) /* sigh... */
errno = ENOENT;
_AT_@ -317,7 +317,6 @@ zsplit_unsigned_fast_small_auto(z_t high, z_t low, z_t a, size_t n)
* zfree_temp(c);
* zfree_temp(a);
*
- *
* And not (swap the two last lines)
*
* zinit_temp(a);
Received on Thu Apr 28 2016 - 21:39:23 CEST
This archive was generated by hypermail 2.3.0
: Thu Apr 28 2016 - 21:48:15 CEST