diff options
author | Radu Voicilas <rvoicilas@users.noreply.github.com> | 2018-03-06 10:26:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-06 10:26:28 +0200 |
commit | 501a806c9fa2cccb90ee55b7d36c00a78fac5527 (patch) | |
tree | 5b00972e3c98a3faeff92b51c15119c5cb45cb15 | |
parent | e203934e46784bb34c213078423ba1678e0c4936 (diff) | |
parent | ddd225d0445df2f65e8fb2b3d8e331ea28c9c769 (diff) | |
download | inotify-tools-501a806c9fa2cccb90ee55b7d36c00a78fac5527.zip inotify-tools-501a806c9fa2cccb90ee55b7d36c00a78fac5527.tar.gz inotify-tools-501a806c9fa2cccb90ee55b7d36c00a78fac5527.tar.bz2 |
Merge pull request #86 from rvoicilas/issues/85/fix-clang-warnings
Fix clang warnings
-rw-r--r-- | libinotifytools/src/inotifytools.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libinotifytools/src/inotifytools.c b/libinotifytools/src/inotifytools.c index b5bc4a1..81b58a6 100644 --- a/libinotifytools/src/inotifytools.c +++ b/libinotifytools/src/inotifytools.c @@ -19,6 +19,7 @@ #include <string.h> #include <strings.h> #include <stdlib.h> +#include <stdint.h> #include <stdio.h> #include <errno.h> #include <sys/select.h> @@ -894,6 +895,7 @@ watch *create_watch(int wd, char *filename) { w->filename = strdup(filename); rbsearch(w, tree_wd); rbsearch(w, tree_filename); + return NULL; } /** @@ -1451,7 +1453,7 @@ void record_stats( struct inotify_event const * event ) { } -int *stat_ptr(watch *w, int event) +unsigned int *stat_ptr(watch *w, int event) { if ( IN_ACCESS == event ) return &w->hit_access; @@ -1504,7 +1506,7 @@ int inotifytools_get_stat_by_wd( int wd, int event ) { watch *w = watch_from_wd(wd); if (!w) return -1; - int *i = stat_ptr(w, event); + unsigned int *i = stat_ptr(w, event); if (!i) return -1; return *i; } @@ -2072,8 +2074,8 @@ int event_compare(const void *p1, const void *p2, const void *config) sort_event = -sort_event; asc = 0; } - int *i1 = stat_ptr((watch*)p1, sort_event); - int *i2 = stat_ptr((watch*)p2, sort_event); + unsigned int *i1 = stat_ptr((watch*)p1, sort_event); + unsigned int *i2 = stat_ptr((watch*)p2, sort_event); if (0 == *i1 - *i2) { return ((watch*)p1)->wd - ((watch*)p2)->wd; } @@ -2085,7 +2087,7 @@ int event_compare(const void *p1, const void *p2, const void *config) struct rbtree *inotifytools_wd_sorted_by_event(int sort_event) { - struct rbtree *ret = rbinit(event_compare, (void*)sort_event); + struct rbtree *ret = rbinit(event_compare, (void*)(uintptr_t)sort_event); RBLIST *all = rbopenlist(tree_wd); void const *p = rbreadlist(all); while (p) { |