Skip to content

Commit

Permalink
Replace longs in ag_stats struct with size_t. Should help with #1158.
Browse files Browse the repository at this point in the history
  • Loading branch information
ggreer committed Dec 27, 2017
1 parent a539c8e commit 5516568
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main.c
Expand Up @@ -213,7 +213,7 @@ int main(int argc, char **argv) {
double time_diff = ((long)stats.time_end.tv_sec * 1000000 + stats.time_end.tv_usec) -
((long)stats.time_start.tv_sec * 1000000 + stats.time_start.tv_usec);
time_diff /= 1000000;
printf("%ld matches\n%ld files contained matches\n%ld files searched\n%ld bytes searched\n%f seconds\n",
printf("%zu matches\n%zu files contained matches\n%zu files searched\n%zu bytes searched\n%f seconds\n",
stats.total_matches, stats.total_file_matches, stats.total_files, stats.total_bytes, time_diff);
pthread_mutex_destroy(&stats_mtx);
}
Expand Down
8 changes: 4 additions & 4 deletions src/util.h
Expand Up @@ -42,10 +42,10 @@ typedef struct {
} match_t;

typedef struct {
long total_bytes;
long total_files;
long total_matches;
long total_file_matches;
size_t total_bytes;
size_t total_files;
size_t total_matches;
size_t total_file_matches;
struct timeval time_start;
struct timeval time_end;
} ag_stats;
Expand Down

0 comments on commit 5516568

Please sign in to comment.