@cryptotaxi247 / netdata-1 / commits / 47953b26e

fix compilation warnings for 32bit machines

Costa Tsaousis (ktsaou) committed Jan 28, 2017 at 04:31 UTC 47953b26e118df0e23909d222ee788fbd264e254
5 files changed +8 -6
src/apps_plugin.c
+1 -1
@@ -598,7 +598,7 @@ static int read_apps_groups_conf(const char *file)
598 // add this target
599 struct target *n = get_apps_groups_target(s, w, name);
600 if(!n) {
601 - error("Cannot create target '%s' (line %lu, word %lu)", s, line, word);
601 + error("Cannot create target '%s' (line %zu, word %zu)", s, line, word);
602 continue;
603 }
604
src/proc_diskstats.c
+3 -3
@@ -170,7 +170,7 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
170 }
171
172 static inline int is_major_enabled(int major) {
173 - static char *major_configs = NULL;
173 + static int8_t *major_configs = NULL;
174 static size_t major_size = 0;
175
176 if(major < 0) return 1;
@@ -178,7 +178,7 @@ static inline int is_major_enabled(int major) {
178 size_t wanted_size = (size_t)major + 1;
179
180 if(major_size < wanted_size) {
181 - major_configs = reallocz(major_configs, wanted_size);
181 + major_configs = reallocz(major_configs, wanted_size * sizeof(int8_t));
182
183 size_t i;
184 for(i = major_size; i < wanted_size ; i++)
@@ -193,7 +193,7 @@ static inline int is_major_enabled(int major) {
193 major_configs[major] = (char)config_get_boolean("plugin:proc:/proc/diskstats", buffer, 1);
194 }
195
196 - return major_configs[major];
196 + return (int)major_configs[major];
197 }
198
199 int do_proc_diskstats(int update_every, usec_t dt) {
src/procfile.c
+1 -1
@@ -285,7 +285,7 @@ procfile *procfile_readall(procfile *ff) {
285 ff->size += PROCFILE_INCREMENT_BUFFER;
286 }
287
288 - debug(D_PROCFILE, "Reading file '%s', from position %ld with length %lu", procfile_filename(ff), s, ff->size - s);
288 + debug(D_PROCFILE, "Reading file '%s', from position %ld with length %zu", procfile_filename(ff), s, ff->size - s);
289 r = read(ff->fd, &ff->data[s], ff->size - s);
290 if(unlikely(r == -1)) {
291 if(unlikely(!(ff->flags & PROCFILE_FLAG_NO_ERROR_ON_FILE_IO))) error(PF_PREFIX ": Cannot read from file '%s'", procfile_filename(ff));
src/rrd.c
+2
@@ -1042,8 +1042,10 @@ void rrdset_next_usec(RRDSET *st, usec_t microseconds)
1042 }
1043 else {
1044 // microseconds has the time since the last collection
1045 +#ifdef NETDATA_INTERNAL_CHECKS
1046 usec_t now_usec = timeval_usec(&now);
1047 usec_t last_usec = timeval_usec(&st->last_collected_time);
1048 +#endif
1049 usec_t since_last_usec = dt_usec(&now, &st->last_collected_time);
1050
1051 // verify the microseconds given is good
src/rrd2json.c
+1 -1
@@ -2305,7 +2305,7 @@ time_t rrd_stats_json(int type, RRDSET *st, BUFFER *wb, long points, long group,
2305
2306 } // max_loop
2307
2308 - debug(D_RRD_STATS, "RRD_STATS_JSON: %s total %lu bytes", st->name, wb->len);
2308 + debug(D_RRD_STATS, "RRD_STATS_JSON: %s total %zu bytes", st->name, wb->len);
2309
2310 pthread_rwlock_unlock(&st->rwlock);
2311 return last_timestamp;