Turn on 'sign-compare' error check for tests.

This commit is contained in:
Suresh Sundriyal 2015-04-04 17:34:43 -07:00
parent b1a2a88d98
commit bfee33b7fd
5 changed files with 6 additions and 5 deletions

View File

@ -92,7 +92,7 @@ retry:
state.push_back(index);
}
return this->sm_count == state.size();
return (size_t)this->sm_count == state.size();
};
private:

View File

@ -15,6 +15,7 @@ simple-db.db: simple-db.sql
$(DBGEN_V)$(SQLITE3_CMD) $@ < $(srcdir)/simple-db.sql
AM_CPPFLAGS = \
-Werror=sign-compare \
-I$(top_srcdir)/src \
$(READLINE_CFLAGS) \
$(SQLITE3_CFLAGS)

View File

@ -135,7 +135,7 @@ int main(int argc, char *argv[])
while (lb.read_line(offset, lv)) {
lv.terminate();
printf("%s", lv.lv_start);
if ((last_offset + lv.lv_len) < offset)
if ((off_t)(last_offset + lv.lv_len) < offset)
printf("\n");
last_offset = offset;
}
@ -155,7 +155,7 @@ int main(int argc, char *argv[])
while (lb.read_line(seq_offset, lv)) { }
do {
bool ret;
int lpc;
size_t lpc;
random_shuffle(index.begin(), index.end());
for (lpc = 0; lpc < index.size(); lpc++) {

View File

@ -213,7 +213,7 @@ static char *hex2bits(const char *src)
len = strlen(src) / 2;
retval = new char[sizeof(uint32_t) + len];
*((uint32_t *)retval) = len;
while (pos < (sizeof(uint32_t) + len)) {
while ((size_t)pos < (sizeof(uint32_t) + len)) {
int val;
sscanf(src, "%2x", &val);

View File

@ -52,7 +52,7 @@ static void single_line(const char *data, int lendiff)
lb.set_fd(pi[0]);
ret = lb.read_line(off, lv);
assert(ret);
assert(off == strlen(data));
assert(off == (off_t)strlen(data));
assert(lv.lv_len == strlen(data) - lendiff);
ret = lb.read_line(off, lv);