]> arthur.barton.de Git - netdata.git/commitdiff
fix for format string signess
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 16 Jun 2016 22:34:16 +0000 (01:34 +0300)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Thu, 16 Jun 2016 22:34:16 +0000 (01:34 +0300)
src/proc_net_snmp.c
src/proc_net_snmp6.c
src/proc_net_stat_conntrack.c
src/proc_stat.c
src/proc_vmstat.c
src/rrd.c
src/rrd2json.c
src/sys_fs_cgroup.c

index e0ac6a263eee9636959e13e622e02e2df8ee2576..69b2938aae159f005267d1f525cfbf6fc1ce2025 100644 (file)
@@ -60,7 +60,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
 
                        words = procfile_linewords(ff, l);
                        if(words < 20) {
-                               error("Cannot read /proc/net/snmp Ip line. Expected 20 params, read %d.", words);
+                               error("Cannot read /proc/net/snmp Ip line. Expected 20 params, read %u.", words);
                                continue;
                        }
 
@@ -193,7 +193,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
 
                        words = procfile_linewords(ff, l);
                        if(words < 15) {
-                               error("Cannot read /proc/net/snmp Tcp line. Expected 15 params, read %d.", words);
+                               error("Cannot read /proc/net/snmp Tcp line. Expected 15 params, read %u.", words);
                                continue;
                        }
 
@@ -306,7 +306,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
 
                        words = procfile_linewords(ff, l);
                        if(words < 7) {
-                               error("Cannot read /proc/net/snmp Udp line. Expected 7 params, read %d.", words);
+                               error("Cannot read /proc/net/snmp Udp line. Expected 7 params, read %u.", words);
                                continue;
                        }
 
index 885835a8cc807f26a130ec71af012141c1bdb5f0..4586ee7d0d638dd9216f81833159bb5be55ad755 100644 (file)
@@ -361,7 +361,7 @@ int do_proc_net_snmp6(int update_every, unsigned long long dt) {
        for(l = 0; l < lines ;l++) {
                words = procfile_linewords(ff, l);
                if(words < 2) {
-                       if(words) error("Cannot read /proc/net/snmp6 line %d. Expected 2 params, read %d.", l, words);
+                       if(words) error("Cannot read /proc/net/snmp6 line %u. Expected 2 params, read %u.", l, words);
                        continue;
                }
 
index 7d754a1d92f6f3438b15c43c548da49a606dc67b..1fcf6ffceaf27491401ea539bf5265fcc4c3ee4d 100644 (file)
@@ -48,7 +48,7 @@ int do_proc_net_stat_conntrack(int update_every, unsigned long long dt) {
        for(l = 1; l < lines ;l++) {
                words = procfile_linewords(ff, l);
                if(words < 17) {
-                       if(words) error("Cannot read /proc/net/stat/nf_conntrack line. Expected 17 params, read %d.", words);
+                       if(words) error("Cannot read /proc/net/stat/nf_conntrack line. Expected 17 params, read %u.", words);
                        continue;
                }
 
index 154ba167d12176951f7ceeb3a2da31e0eb4f4fe6..9272dd3c29c4e58bd50aaa7de8ddaa1e9d4df66f 100644 (file)
@@ -48,7 +48,7 @@ int do_proc_stat(int update_every, unsigned long long dt) {
                if(strncmp(procfile_lineword(ff, l, 0), "cpu", 3) == 0) {
                        words = procfile_linewords(ff, l);
                        if(words < 9) {
-                               error("Cannot read /proc/stat cpu line. Expected 9 params, read %d.", words);
+                               error("Cannot read /proc/stat cpu line. Expected 9 params, read %u.", words);
                                continue;
                        }
 
index 7b20ed8cff4d72c55cf0d71579bb9616106be2f1..a63caf2765de96a18983e0fdd46999cfddc8f128 100644 (file)
@@ -321,7 +321,7 @@ int do_proc_vmstat(int update_every, unsigned long long dt) {
        for(l = 0; l < lines ;l++) {
                words = procfile_linewords(ff, l);
                if(words < 2) {
-                       if(words) error("Cannot read /proc/vmstat line %d. Expected 2 params, read %d.", l, words);
+                       if(words) error("Cannot read /proc/vmstat line %d. Expected 2 params, read %u.", l, words);
                        continue;
                }
 
index 28efff0a15074992287fba30a053c58eb9974da9..c0f4f363353436b8a50bd915ffee39cd8d4eb2a1 100644 (file)
--- a/src/rrd.c
+++ b/src/rrd.c
@@ -876,7 +876,7 @@ unsigned long long rrdset_done(RRDSET *st)
 
        // check if we will re-write the entire data set
        if(unlikely(usecdiff(&st->last_collected_time, &st->last_updated) > st->update_every * st->entries * 1000000ULL)) {
-               info("%s: too old data (last updated at %zu.%zu, last collected at %zu.%zu). Reseting it. Will not store the next entry.", st->name, st->last_updated.tv_sec, st->last_updated.tv_usec, st->last_collected_time.tv_sec, st->last_collected_time.tv_usec);
+               info("%s: too old data (last updated at %ld.%ld, last collected at %ld.%ld). Reseting it. Will not store the next entry.", st->name, st->last_updated.tv_sec, st->last_updated.tv_usec, st->last_collected_time.tv_sec, st->last_collected_time.tv_usec);
                rrdset_reset(st);
 
                st->usec_since_last_update = st->update_every * 1000000ULL;
index 7c160a9a82240c7a443da4e4254e29b86383541a..f0b1f97deff0ce926515b7543faed1f2605f5ecd 100644 (file)
@@ -32,8 +32,8 @@ void rrd_stats_api_v1_chart(RRDSET *st, BUFFER *wb)
                "\t\t\t\"data_url\": \"/api/v1/data?chart=%s\",\n"
                "\t\t\t\"chart_type\": \"%s\",\n"
                "\t\t\t\"duration\": %ld,\n"
-               "\t\t\t\"first_entry\": %lu,\n"
-               "\t\t\t\"last_entry\": %lu,\n"
+               "\t\t\t\"first_entry\": %ld,\n"
+               "\t\t\t\"last_entry\": %ld,\n"
                "\t\t\t\"update_every\": %d,\n"
                "\t\t\t\"dimensions\": {\n"
                , st->id
@@ -132,12 +132,12 @@ unsigned long rrd_stats_one_json(RRDSET *st, char *options, BUFFER *wb)
                "\t\t\t\"units\": \"%s\",\n"
                "\t\t\t\"url\": \"/data/%s/%s\",\n"
                "\t\t\t\"chart_type\": \"%s\",\n"
-               "\t\t\t\"counter\": %ld,\n"
+               "\t\t\t\"counter\": %lu,\n"
                "\t\t\t\"entries\": %ld,\n"
-               "\t\t\t\"first_entry_t\": %lu,\n"
-               "\t\t\t\"last_entry\": %ld,\n"
-               "\t\t\t\"last_entry_t\": %lu,\n"
-               "\t\t\t\"last_entry_secs_ago\": %lu,\n"
+               "\t\t\t\"first_entry_t\": %ld,\n"
+               "\t\t\t\"last_entry\": %lu,\n"
+               "\t\t\t\"last_entry_t\": %ld,\n"
+               "\t\t\t\"last_entry_secs_ago\": %ld,\n"
                "\t\t\t\"update_every\": %d,\n"
                "\t\t\t\"isdetail\": %d,\n"
                "\t\t\t\"usec_since_last_update\": %llu,\n"
@@ -184,7 +184,7 @@ unsigned long rrd_stats_one_json(RRDSET *st, char *options, BUFFER *wb)
                        "\t\t\t\t\t\"algorithm\": \"%s\",\n"
                        "\t\t\t\t\t\"multiplier\": %ld,\n"
                        "\t\t\t\t\t\"divisor\": %ld,\n"
-                       "\t\t\t\t\t\"last_entry_t\": %lu,\n"
+                       "\t\t\t\t\t\"last_entry_t\": %ld,\n"
                        "\t\t\t\t\t\"collected_value\": " COLLECTED_NUMBER_FORMAT ",\n"
                        "\t\t\t\t\t\"calculated_value\": " CALCULATED_NUMBER_FORMAT ",\n"
                        "\t\t\t\t\t\"last_collected_value\": " COLLECTED_NUMBER_FORMAT ",\n"
@@ -1429,7 +1429,7 @@ RRDR *rrd2rrdr(RRDSET *st, long points, long long after, long long before, int g
                if(unlikely(slot < 0)) slot = st->entries - 1;
                if(unlikely(slot == stop_at_slot)) stop_now = counter;
 
-               if(unlikely(debug)) debug(D_RRD_STATS, "ROW %s slot: %ld, entries_counter: %ld, group_count: %ld, added: %ld, now: %lu, %s %s"
+               if(unlikely(debug)) debug(D_RRD_STATS, "ROW %s slot: %ld, entries_counter: %ld, group_count: %ld, added: %ld, now: %ld, %s %s"
                                , st->id
                                , slot
                                , counter
@@ -1822,7 +1822,7 @@ time_t rrd_stats_json(int type, RRDSET *st, BUFFER *wb, long points, long group,
        // checks for debugging
 
        if(st->debug) {
-               debug(D_RRD_STATS, "%s first_entry_t = %lu, last_entry_t = %lu, duration = %lu, after = %lu, before = %lu, duration = %lu, entries_to_show = %lu, group = %lu"
+               debug(D_RRD_STATS, "%s first_entry_t = %ld, last_entry_t = %ld, duration = %ld, after = %ld, before = %ld, duration = %ld, entries_to_show = %ld, group = %ld"
                        , st->id
                        , rrdset_first_entry_t(st)
                        , rrdset_last_entry_t(st)
@@ -1835,10 +1835,10 @@ time_t rrd_stats_json(int type, RRDSET *st, BUFFER *wb, long points, long group,
                        );
 
                if(before < after)
-                       debug(D_RRD_STATS, "WARNING: %s The newest value in the database (%lu) is earlier than the oldest (%lu)", st->name, before, after);
+                       debug(D_RRD_STATS, "WARNING: %s The newest value in the database (%ld) is earlier than the oldest (%ld)", st->name, before, after);
 
                if((before - after) > st->entries * st->update_every)
-                       debug(D_RRD_STATS, "WARNING: %s The time difference between the oldest and the newest entries (%lu) is higher than the capacity of the database (%lu)", st->name, before - after, st->entries * st->update_every);
+                       debug(D_RRD_STATS, "WARNING: %s The time difference between the oldest and the newest entries (%ld) is higher than the capacity of the database (%ld)", st->name, before - after, st->entries * st->update_every);
        }
 
 
@@ -1934,7 +1934,7 @@ time_t rrd_stats_json(int type, RRDSET *st, BUFFER *wb, long points, long group,
 
                        int print_this = 0;
 
-                       if(st->debug) debug(D_RRD_STATS, "%s t = %ld, count = %ld, group_count = %ld, printed = %ld, now = %lu, %s %s"
+                       if(st->debug) debug(D_RRD_STATS, "%s t = %ld, count = %ld, group_count = %ld, printed = %ld, now = %ld, %s %s"
                                        , st->id
                                        , t
                                        , count + 1
@@ -2070,7 +2070,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 %ld bytes", st->name, wb->len);
+       debug(D_RRD_STATS, "RRD_STATS_JSON: %s total %lu bytes", st->name, wb->len);
 
        pthread_rwlock_unlock(&st->rwlock);
        return last_timestamp;
index b585376fa2d11b1085b7bd0f4de04d87bdca54e3..9ce6e33d08a619861e6f2f2a111eaa2900028bfd 100644 (file)
@@ -252,7 +252,7 @@ void cgroup_read_cpuacct_usage(struct cpuacct_usage *ca) {
                if(!ff) return;
 
                if(procfile_lines(ff) < 1) {
-                       error("File '%s' should have 1+ lines but has %d.", ca->filename, procfile_lines(ff));
+                       error("File '%s' should have 1+ lines but has %u.", ca->filename, procfile_lines(ff));
                        return;
                }