diff --git a/src/klib/ksort.h b/src/klib/ksort.h index a0ea6256..d2fb3532 100644 --- a/src/klib/ksort.h +++ b/src/klib/ksort.h @@ -240,7 +240,7 @@ typedef struct { static void ks_shuffle_##name(size_t n, type_t a[]) \ { \ int i, j; \ - for (i = n; i > 1; --i) { \ + for (i = (int)n; i > 1; --i) { \ type_t tmp; \ j = (int)(drand48() * i); \ tmp = a[j]; a[j] = a[i-1]; a[i-1] = tmp; \ @@ -248,7 +248,7 @@ typedef struct { } \ static void ks_sample_##name(size_t n, size_t r, type_t a[]) /* FIXME: NOT TESTED!!! */ \ { /* reference: http://code.activestate.com/recipes/272884/ */ \ - int i, k, pop = n; \ + int i, k, pop = (int)n; \ for (i = (int)r, k = 0; i >= 0; --i) { \ double z = 1., x = drand48(); \ type_t tmp; \