Commit 31da3f37 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Get rid of some compiler warnings. Addresses #1185.

git-svn-id: file:///svn/tokudb.1131b+1080a+1185@6370 c7de825b-a66e-492c-adef-691d508d4ae1
parent 620fe5fd
...@@ -42,6 +42,7 @@ ifneq ($(CC),icc) ...@@ -42,6 +42,7 @@ ifneq ($(CC),icc)
CFLAGS += -Werror -Wextra -Wcast-align -Wbad-function-cast -Wmissing-noreturn -g3 -ggdb3 CFLAGS += -Werror -Wextra -Wcast-align -Wbad-function-cast -Wmissing-noreturn -g3 -ggdb3
else else
CFLAGS += -g CFLAGS += -g
CFLAGS += -diag-disable 177 # Don't complain about static variables that are not used
endif endif
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lz -lpthread LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lz -lpthread
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500 CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500
......
...@@ -38,7 +38,6 @@ static inline u_int64_t alignup (u_int64_t a, u_int64_t b) { ...@@ -38,7 +38,6 @@ static inline u_int64_t alignup (u_int64_t a, u_int64_t b) {
} }
static void maybe_preallocate_in_file (int fd, u_int64_t size) { static void maybe_preallocate_in_file (int fd, u_int64_t size) {
return;
struct stat sbuf; struct stat sbuf;
{ {
int r = fstat(fd, &sbuf); int r = fstat(fd, &sbuf);
......
...@@ -50,7 +50,7 @@ enum le_state { LE_COMMITTED=1, // A committed pair. ...@@ -50,7 +50,7 @@ enum le_state { LE_COMMITTED=1, // A committed pair.
u_int32_t leafentry_memsize (LEAFENTRY); u_int32_t leafentry_memsize (LEAFENTRY);
static inline enum le_state get_le_state(LEAFENTRY le) { static inline enum le_state get_le_state(LEAFENTRY le) {
return *(unsigned char *)le; return (enum le_state)*(unsigned char *)le;
} }
static inline void putint (unsigned char *p, u_int32_t i) { static inline void putint (unsigned char *p, u_int32_t i) {
...@@ -75,7 +75,9 @@ static inline u_int32_t getint (unsigned char *p) { ...@@ -75,7 +75,9 @@ static inline u_int32_t getint (unsigned char *p) {
#endif #endif
} }
static inline u_int64_t getint64 (unsigned char *p) { static inline u_int64_t getint64 (unsigned char *p) {
return (((u_int64_t)getint(p))<<32) + getint(p+4); u_int64_t H = getint(p);
u_int64_t L = getint(p+4);
return (H<<32) + L;
} }
#define LESWITCHCALL(le,funname, ...) ({ \ #define LESWITCHCALL(le,funname, ...) ({ \
......
...@@ -30,7 +30,7 @@ static inline void wbuf_init (struct wbuf *w, void *buf, DISKOFF size) { ...@@ -30,7 +30,7 @@ static inline void wbuf_init (struct wbuf *w, void *buf, DISKOFF size) {
} }
/* Write a character. */ /* Write a character. */
static inline void wbuf_char (struct wbuf *w, unsigned int ch) { static inline void wbuf_char (struct wbuf *w, unsigned char ch) {
assert(w->ndone<w->size); assert(w->ndone<w->size);
w->buf[w->ndone++]=ch; w->buf[w->ndone++]=ch;
x1764_add(&w->checksum, &w->buf[w->ndone-1], 1); x1764_add(&w->checksum, &w->buf[w->ndone-1], 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment