/*
- * Copyright (c) 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2011, 2012, 2013 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
shuffle(unsigned int *p, size_t n)
{
for (; n > 1; n--, p++) {
- unsigned int *q = &p[rand() % n];
+ unsigned int *q = &p[random_range(n)];
unsigned int tmp = *p;
*p = *q;
*q = tmp;
/* Change a random 0-bit into a 1-bit. */
do {
- bit = htonll(UINT64_C(1) << (random_uint32() % 64));
+ bit = htonll(UINT64_C(1) << (random_range(64)));
} while (x & bit);
x |= bit;
enum {
VLOG_OPTION_ENUMS
};
- static struct option long_options[] = {
+ static const struct option long_options[] = {
VLOG_LONG_OPTIONS,
{NULL, 0, NULL, 0},
};