]> arthur.barton.de Git - netdata.git/commitdiff
fix compilation warnings for 32bit machines
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 28 Jan 2017 02:31:02 +0000 (04:31 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sat, 28 Jan 2017 02:31:02 +0000 (04:31 +0200)
src/apps_plugin.c
src/proc_diskstats.c
src/procfile.c
src/rrd.c
src/rrd2json.c

index 1a43d29ca5f307e849495fc90b628cb2c04707bc..b69171395085b375bf39530c920677ccc3881e4c 100644 (file)
@@ -598,7 +598,7 @@ static int read_apps_groups_conf(const char *file)
             // add this target
             struct target *n = get_apps_groups_target(s, w, name);
             if(!n) {
-                error("Cannot create target '%s' (line %lu, word %lu)", s, line, word);
+                error("Cannot create target '%s' (line %zu, word %zu)", s, line, word);
                 continue;
             }
 
index 9ccac6dc7cd0804771274bf4ebf23fd0d93498eb..4cd45df83840d73d39ebe51f1e86ed3cd16ab265 100644 (file)
@@ -170,7 +170,7 @@ static struct disk *get_disk(unsigned long major, unsigned long minor, char *dis
 }
 
 static inline int is_major_enabled(int major) {
-    static char *major_configs = NULL;
+    static int8_t *major_configs = NULL;
     static size_t major_size = 0;
 
     if(major < 0) return 1;
@@ -178,7 +178,7 @@ static inline int is_major_enabled(int major) {
     size_t wanted_size = (size_t)major + 1;
 
     if(major_size < wanted_size) {
-        major_configs = reallocz(major_configs, wanted_size);
+        major_configs = reallocz(major_configs, wanted_size * sizeof(int8_t));
 
         size_t i;
         for(i = major_size; i < wanted_size ; i++)
@@ -193,7 +193,7 @@ static inline int is_major_enabled(int major) {
         major_configs[major] = (char)config_get_boolean("plugin:proc:/proc/diskstats", buffer, 1);
     }
 
-    return major_configs[major];
+    return (int)major_configs[major];
 }
 
 int do_proc_diskstats(int update_every, usec_t dt) {
index 736a35de95b1d294b86547044f37419f8cf143d8..e493bff98ba98187955b4ed8bf9ab0eb7adff4b4 100644 (file)
@@ -285,7 +285,7 @@ procfile *procfile_readall(procfile *ff) {
             ff->size += PROCFILE_INCREMENT_BUFFER;
         }
 
-        debug(D_PROCFILE, "Reading file '%s', from position %ld with length %lu", procfile_filename(ff), s, ff->size - s);
+        debug(D_PROCFILE, "Reading file '%s', from position %ld with length %zu", procfile_filename(ff), s, ff->size - s);
         r = read(ff->fd, &ff->data[s], ff->size - s);
         if(unlikely(r == -1)) {
             if(unlikely(!(ff->flags & PROCFILE_FLAG_NO_ERROR_ON_FILE_IO))) error(PF_PREFIX ": Cannot read from file '%s'", procfile_filename(ff));
index bd0175efc0fca47dc30aaeec187b8a706eb05459..658ad46bae226e8d60eb206ab8f5ad16c58ef80a 100644 (file)
--- a/src/rrd.c
+++ b/src/rrd.c
@@ -1042,8 +1042,10 @@ void rrdset_next_usec(RRDSET *st, usec_t microseconds)
     }
     else {
         // microseconds has the time since the last collection
+#ifdef NETDATA_INTERNAL_CHECKS
         usec_t now_usec = timeval_usec(&now);
         usec_t last_usec = timeval_usec(&st->last_collected_time);
+#endif
         usec_t since_last_usec = dt_usec(&now, &st->last_collected_time);
 
         // verify the microseconds given is good
index aa07b6fc34cb2aefbac84ce9fbda28ca27c0a0b2..4bbf61e8db8a87f5bbf4d5cd1bb1e505cbd9c4bd 100644 (file)
@@ -2305,7 +2305,7 @@ time_t rrd_stats_json(int type, RRDSET *st, BUFFER *wb, long points, long group,
 
     } // max_loop
 
-    debug(D_RRD_STATS, "RRD_STATS_JSON: %s total %lu bytes", st->name, wb->len);
+    debug(D_RRD_STATS, "RRD_STATS_JSON: %s total %zu bytes", st->name, wb->len);
 
     pthread_rwlock_unlock(&st->rwlock);
     return last_timestamp;