X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fdaemon%2Ftypes_list.c;h=8cfddda5dc4d268f04f19f8008b6ad857b515352;hb=7b8851b26928b609ce850e78c1eabb50ff319244;hp=b053157154cf74d18e012ed45152ddf73759233b;hpb=c3d354c58d56c4b2bb4138a227f3546928bd84f2;p=collectd.git diff --git a/src/daemon/types_list.c b/src/daemon/types_list.c index b0531571..8cfddda5 100644 --- a/src/daemon/types_list.c +++ b/src/daemon/types_list.c @@ -39,8 +39,8 @@ static int parse_ds(data_source_t *dsrc, char *buf, size_t buf_len) { int fields_num; if (buf_len < 11) { - ERROR("parse_ds: (buf_len = %zu) < 11", buf_len); - return (-1); + ERROR("parse_ds: (buf_len = %" PRIsz ") < 11", buf_len); + return -1; } if (buf[buf_len - 1] == ',') { @@ -61,7 +61,7 @@ static int parse_ds(data_source_t *dsrc, char *buf, size_t buf_len) { if (fields_num != 4) { ERROR("parse_ds: (fields_num = %i) != 4", fields_num); - return (-1); + return -1; } sstrncpy(dsrc->name, fields[0], sizeof(dsrc->name)); @@ -77,7 +77,7 @@ static int parse_ds(data_source_t *dsrc, char *buf, size_t buf_len) { else { ERROR("(fields[1] = %s) != (GAUGE || COUNTER || DERIVE || ABSOLUTE)", fields[1]); - return (-1); + return -1; } if (strcasecmp(fields[2], "U") == 0) @@ -90,7 +90,7 @@ static int parse_ds(data_source_t *dsrc, char *buf, size_t buf_len) { else dsrc->max = atof(fields[3]); - return (0); + return 0; } /* int parse_ds */ static void parse_line(char *buf) { @@ -121,8 +121,8 @@ static void parse_line(char *buf) { for (size_t i = 0; i < ds->ds_num; i++) if (parse_ds(ds->ds + i, fields[i + 1], strlen(fields[i + 1])) != 0) { - ERROR("types_list: parse_line: Cannot parse data source #%zu " - "of data set %s", + ERROR("types_list: parse_line: Cannot parse data source #%" PRIsz + " of data set %s", i, ds->type); sfree(ds->ds); sfree(ds); @@ -170,7 +170,7 @@ int read_types_list(const char *file) { FILE *fh; if (file == NULL) - return (-1); + return -1; fh = fopen(file, "r"); if (fh == NULL) { @@ -179,7 +179,7 @@ int read_types_list(const char *file) { sstrerror(errno, errbuf, sizeof(errbuf))); ERROR("Failed to open types database `%s': %s", file, sstrerror(errno, errbuf, sizeof(errbuf))); - return (-1); + return -1; } parse_file(fh); @@ -189,5 +189,5 @@ int read_types_list(const char *file) { DEBUG("Done parsing `%s'", file); - return (0); + return 0; } /* int read_types_list */