Commit 99ee1ca5 authored by Gabriel Krisman Bertazi's avatar Gabriel Krisman Bertazi
Browse files

libcasefold: Fixes to support building with -Wall


Reported-by: Arnaud Rebillout's avatarArnaud Rebillout <arnaud.rebillout@collabora.com>
Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@collabora.co.uk>
parent 19aa376f
......@@ -42,7 +42,7 @@ DEJAGNU="\$(top_srcdir)/testsuite/global-conf.exp"
fi
AC_SUBST(DEJAGNU)
AC_SUBST(AC_CFLAGS, ["-Werror -std=gnu11"])
AC_SUBST(AC_CFLAGS, ["-Wall -Werror -std=gnu11"])
AC_CONFIG_FILES([Makefile
lib/Makefile
......
......@@ -73,8 +73,7 @@ int create_files(char *root, int n, struct inode_vec *inode_vec)
struct stat st;
int r;
int i;
struct timeval t1, t2, elapsed, sum;
double usecs;
struct timeval t1, t2, elapsed;
gettimeofday(&t1, NULL);
......@@ -97,7 +96,9 @@ int create_files(char *root, int n, struct inode_vec *inode_vec)
gettimeofday(&t2, NULL);
timersub(&t2, &t1, &elapsed);
printf("[CREATED] %d files. TIME: %d.%.3d\n", i, elapsed.tv_sec, elapsed.tv_usec/1000);
printf("[CREATED] %d files. TIME: %ld.%.3ld\n", i, elapsed.tv_sec, elapsed.tv_usec/1000);
return 0;
}
/* we do it in a separate step to not affect measurements*/
......@@ -113,6 +114,7 @@ int modify_target(int n, struct inode_vec *inode_vec)
for (j = 0; s[j] != '\0'; j++)
s[j] = ((coin++)%2) ? ((char) tolower((unsigned char) s[j])):s[j];
}
return 0;
}
int search_files(char *root, int n, struct inode_vec *inode_vec)
......@@ -121,8 +123,7 @@ int search_files(char *root, int n, struct inode_vec *inode_vec)
struct stat st;
int r;
char buf[BUFSIZ];
struct timeval t1, t2, elapsed, sum;
double usecs;
struct timeval t1, t2, elapsed;
gettimeofday(&t1, NULL);
......@@ -135,14 +136,16 @@ int search_files(char *root, int n, struct inode_vec *inode_vec)
}
if(st.st_ino != inode_vec[i].ino) {
printf("%d != %d\n", st.st_ino, inode_vec[i].ino);
printf("%ld != %ld\n", st.st_ino, inode_vec[i].ino);
assert(0);
}
}
gettimeofday(&t2, NULL);
timersub(&t2, &t1, &elapsed);
printf("found %d files. TIME: %d.%.3d\n", i, elapsed.tv_sec, elapsed.tv_usec/1000);
printf("found %d files. TIME: %ld.%.3ld\n", i, elapsed.tv_sec, elapsed.tv_usec/1000);
return 0;
}
......
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