Skip to content

Commit

Permalink
fixing build fail in jenkins.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joey Andres committed Nov 17, 2016
1 parent 4a3d255 commit 6c890b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions lib/unh/UNH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@

#include "UNH.h"

rl::INT hashUNH(rl::INT *coordinates, size_t num_indices, size_t memory_size) {
static rl::INT first_call = 1;
static rl::INT rndseq[2048];
int64_t hashUNH(int64_t *coordinates, size_t num_indices, size_t memory_size) {
static int64_t first_call = 1;
static int64_t rndseq[2048];
size_t i, k;
rl::INT index;
rl::INT sum = 0;
int64_t index;
int64_t sum = 0;

std::default_random_engine randomEngine;

/* if first call to hashing, initialize table of random numbers */
if (first_call) {
for (k = 0; k < 2048; k++) {
rndseq[k] = 0;
for (i = 0; i < sizeof(rl::INT); ++i)
for (i = 0; i < sizeof(int64_t); ++i)
rndseq[k] = (rndseq[k] << 8) | (randomEngine() & 0xff);
}
first_call = 0;
Expand All @@ -37,9 +37,9 @@ rl::INT hashUNH(rl::INT *coordinates, size_t num_indices, size_t memory_size) {
index += 2048;

/* add selected random number to sum */
sum += (rl::INT) rndseq[(rl::INT) index];
sum += (int64_t) rndseq[(int64_t) index];
}
index = (rl::INT) (sum % memory_size);
index = (int64_t) (sum % memory_size);
while (index < 0)
index += memory_size;

Expand Down
4 changes: 2 additions & 2 deletions lib/unh/UNH.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
#pragma once

#include "declares.h"
#include <cstdint>

/**
* Hash function from University New Hampshire CMAC program.
Expand All @@ -15,4 +15,4 @@
* @param memory_size
* @return
*/
extern rl::INT hashUNH(rl::INT *coordinates, size_t num_indices, size_t memory_size);
extern int64_t hashUNH(int64_t *coordinates, size_t num_indices, size_t memory_size);

0 comments on commit 6c890b6

Please sign in to comment.