[fix] warnings in klib/ksort.h
This commit is contained in:
@@ -240,7 +240,7 @@ typedef struct {
|
|||||||
static void ks_shuffle_##name(size_t n, type_t a[]) \
|
static void ks_shuffle_##name(size_t n, type_t a[]) \
|
||||||
{ \
|
{ \
|
||||||
int i, j; \
|
int i, j; \
|
||||||
for (i = n; i > 1; --i) { \
|
for (i = (int)n; i > 1; --i) { \
|
||||||
type_t tmp; \
|
type_t tmp; \
|
||||||
j = (int)(drand48() * i); \
|
j = (int)(drand48() * i); \
|
||||||
tmp = a[j]; a[j] = a[i-1]; a[i-1] = tmp; \
|
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!!! */ \
|
static void ks_sample_##name(size_t n, size_t r, type_t a[]) /* FIXME: NOT TESTED!!! */ \
|
||||||
{ /* reference: http://code.activestate.com/recipes/272884/ */ \
|
{ /* 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) { \
|
for (i = (int)r, k = 0; i >= 0; --i) { \
|
||||||
double z = 1., x = drand48(); \
|
double z = 1., x = drand48(); \
|
||||||
type_t tmp; \
|
type_t tmp; \
|
||||||
|
|||||||
Reference in New Issue
Block a user