Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile without warnings #218

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
Open
30 changes: 30 additions & 0 deletions external/googletest/include/gtest/gtest.h
Original file line number Diff line number Diff line change
Expand Up @@ -1398,6 +1398,36 @@ GTEST_DISABLE_MSC_WARNINGS_POP_()
actual);
}

template <>
inline AssertionResult CmpHelperEQ(const char* expected_expression,
const char* actual_expression,
const unsigned int& expected,
const int& actual) {
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */)
if (((int) expected) == actual) {
return AssertionSuccess();
}
GTEST_DISABLE_MSC_WARNINGS_POP_()

return CmpHelperEQFailure(expected_expression, actual_expression, expected,
actual);
}

template <>
inline AssertionResult CmpHelperEQ(const char* expected_expression,
const char* actual_expression,
const long long unsigned int& expected,
const int& actual) {
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */)
if (expected == ((long long unsigned int) actual)) {
return AssertionSuccess();
}
GTEST_DISABLE_MSC_WARNINGS_POP_()

return CmpHelperEQFailure(expected_expression, actual_expression, expected,
actual);
}

// With this overloaded version, we allow anonymous enums to be used
// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
// can be implicitly cast to BiggestInt.
Expand Down
6 changes: 3 additions & 3 deletions lib/compat/inc/luc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define _LUC_H

void luc_io_init (void);
void luc_snapin (const char*, void*, size_t);
void luc_snapout (const char*, void*, size_t);
void luc_stat (const char*, size_t*);
void luc_snapin (const char*, void*, off_t);
void luc_snapout (const char*, void*, off_t);
void luc_stat (const char*, off_t*);

#endif /* _LUC_H */
20 changes: 10 additions & 10 deletions lib/compat/src/luc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

extern "C" {
void luc_io_init (void);
void luc_snapin (const char*, void*, size_t);
void luc_snapout (const char*, void*, size_t);
void luc_stat (const char*, size_t*);
void luc_snapin (const char*, void*, off_t);
void luc_snapout (const char*, void*, off_t);
void luc_stat (const char*, off_t*);
}

using namespace std;
Expand All @@ -24,7 +24,7 @@ luc_io_init (void)


static void
read_in (const char *fname, void* buf, size_t sz)
read_in (const char *fname, void* buf, off_t sz)
{
char * tmpbuf = (char *) buf;
int fd;
Expand All @@ -34,7 +34,7 @@ read_in (const char *fname, void* buf, size_t sz)
fname, strerror (errno));
abort ();
}
size_t bytes_read = 0;
off_t bytes_read = 0;
while (bytes_read < sz) {
int last = read(fd, tmpbuf, sz);
bytes_read += last;
Expand All @@ -52,14 +52,14 @@ read_in (const char *fname, void* buf, size_t sz)


void
luc_snapin (const char *fname, void* buf, size_t sz)
luc_snapin (const char *fname, void* buf, off_t sz)
{
read_in (fname, buf, sz);
}


static void
write_out (const char *fname, void* buf, size_t sz)
write_out (const char *fname, void* buf, off_t sz)
{
int fd;
fd = open (fname, O_WRONLY|O_CREAT|O_TRUNC, 0666);
Expand All @@ -78,14 +78,14 @@ write_out (const char *fname, void* buf, size_t sz)


void
luc_snapout (const char *fname, void* buf, size_t sz)
luc_snapout (const char *fname, void* buf, off_t sz)
{
write_out (fname, buf, sz);
}


static void
stat_fname (const char *fname, size_t *sz)
stat_fname (const char *fname, off_t *sz)
{
struct stat st;

Expand All @@ -99,7 +99,7 @@ stat_fname (const char *fname, size_t *sz)


void
luc_stat (const char *fname, size_t *sz)
luc_stat (const char *fname, off_t *sz)
{
stat_fname (fname, sz);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/int_hm_seq/inc/int_hm_seq.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ int_hm_seq_new(int64_t size);
int_hm_seq_t *
int_hm_seq_free(int_hm_seq_t * ht);

int_hm_seq_t *
void
int_hm_seq_expand(int_hm_seq_t * ht, int64_t new_size);

int_hm_seq_t *
void
int_hm_seq_expand_versioned(int_hm_seq_t * ht, int64_t new_size, int64_t v);

int_hm_seq_t *
int_hm_seq_insert_versioned(int_hm_seq_t * ht, int64_t k, int64_t v);

int_hm_seq_t *
void
int_hm_seq_insert(int_hm_seq_t * ht, int64_t k, int64_t v);

int64_t *
Expand Down
6 changes: 3 additions & 3 deletions lib/int_hm_seq/src/int-hm-seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int_hm_seq_free(int_hm_seq_t * ht) {
return NULL;
}

int_hm_seq_t *
void
int_hm_seq_expand(int_hm_seq_t * ht, int64_t new_size) {
int64_t pow = ht->size;

Expand Down Expand Up @@ -78,7 +78,7 @@ int_hm_seq_expand(int_hm_seq_t * ht, int64_t new_size) {
*ht = tmp;
}

int_hm_seq_t *
void
int_hm_seq_expand_versioned(int_hm_seq_t * ht, int64_t new_size, int64_t v) {
int64_t pow = ht->size;

Expand Down Expand Up @@ -131,7 +131,7 @@ int_hm_seq_insert_versioned(int_hm_seq_t * ht, int64_t k, int64_t v) {
return ht;
}

int_hm_seq_t *
void
int_hm_seq_insert(int_hm_seq_t * ht, int64_t k, int64_t v) {
if(((double)(ht->elements + ht->removed)) > (0.7f) * ((double)ht->size)) {
int_hm_seq_expand(ht, ht->size * 2);
Expand Down
2 changes: 1 addition & 1 deletion lib/int_ht_seq/inc/int_ht_seq.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int_ht_seq_free_internal(int_ht_seq_t * ht);
int_ht_seq_t *
int_ht_seq_free(int_ht_seq_t * ht);

int_ht_seq_t *
void
int_ht_seq_expand(int_ht_seq_t * ht, int64_t new_size);

int_ht_seq_t *
Expand Down
5 changes: 3 additions & 2 deletions lib/int_ht_seq/src/int-ht-seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>

static int64_t
mix(int64_t n) {
Expand Down Expand Up @@ -69,7 +70,7 @@ int_ht_seq_free(int_ht_seq_t * ht) {
return NULL;
}

int_ht_seq_t *
void
int_ht_seq_expand(int_ht_seq_t * ht, int64_t new_size) {
int_ht_seq_t tmp;

Expand Down Expand Up @@ -125,7 +126,7 @@ int_ht_seq_print_contents(int_ht_seq_t * ht) {
int first = 1;
for(uint64_t i = 0; i < ht->size; i++) {
if(ht->keys[i] != INT_HT_SEQ_EMPTY) {
printf("%s%ld", first ? "" : ", ", ht->keys[i]);
printf("%s%" PRId64, first ? "" : ", ", ht->keys[i]);
first = 0;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/kv_store/inc/kv_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ kv_return_t
kv_tracker_free_internal(kv_element_t * track);

kv_return_t
kv_tracker_hash(kv_element_t * track, int64_t * hash);
kv_tracker_hash(kv_element_t * track, uint64_t * hash);

kv_return_t
kv_tracker_is(kv_element_t * a, kv_element_t * b);
Expand Down
Loading