projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix return value or loglevel for several plugins
[collectd.git]
/
src
/
liboconfig
/
oconfig.c
diff --git
a/src/liboconfig/oconfig.c
b/src/liboconfig/oconfig.c
index
079adcf
..
e05ced8
100644
(file)
--- a/
src/liboconfig/oconfig.c
+++ b/
src/liboconfig/oconfig.c
@@
-62,7
+62,7
@@
static oconfig_item_t *oconfig_parse_fh(FILE *fh) {
status = yyparse();
if (status != 0) {
fprintf(stderr, "yyparse returned error #%i\n", status);
status = yyparse();
if (status != 0) {
fprintf(stderr, "yyparse returned error #%i\n", status);
- return
(NULL)
;
+ return
NULL
;
}
c_file = NULL;
}
c_file = NULL;
@@
-71,7
+71,7
@@
static oconfig_item_t *oconfig_parse_fh(FILE *fh) {
ci_root = NULL;
yyset_in((FILE *)0);
ci_root = NULL;
yyset_in((FILE *)0);
- return
(ret)
;
+ return
ret
;
} /* oconfig_item_t *oconfig_parse_fh */
oconfig_item_t *oconfig_parse_file(const char *file) {
} /* oconfig_item_t *oconfig_parse_fh */
oconfig_item_t *oconfig_parse_file(const char *file) {
@@
-83,7
+83,7
@@
oconfig_item_t *oconfig_parse_file(const char *file) {
fh = fopen(file, "r");
if (fh == NULL) {
fprintf(stderr, "fopen (%s) failed: %s\n", file, strerror(errno));
fh = fopen(file, "r");
if (fh == NULL) {
fprintf(stderr, "fopen (%s) failed: %s\n", file, strerror(errno));
- return
(NULL)
;
+ return
NULL
;
}
ret = oconfig_parse_fh(fh);
}
ret = oconfig_parse_fh(fh);
@@
-91,7
+91,7
@@
oconfig_item_t *oconfig_parse_file(const char *file) {
c_file = NULL;
c_file = NULL;
- return
(ret)
;
+ return
ret
;
} /* oconfig_item_t *oconfig_parse_file */
oconfig_item_t *oconfig_clone(const oconfig_item_t *ci_orig) {
} /* oconfig_item_t *oconfig_parse_file */
oconfig_item_t *oconfig_clone(const oconfig_item_t *ci_orig) {
@@
-100,7
+100,7
@@
oconfig_item_t *oconfig_clone(const oconfig_item_t *ci_orig) {
ci_copy = calloc(1, sizeof(*ci_copy));
if (ci_copy == NULL) {
fprintf(stderr, "calloc failed.\n");
ci_copy = calloc(1, sizeof(*ci_copy));
if (ci_copy == NULL) {
fprintf(stderr, "calloc failed.\n");
- return
(NULL)
;
+ return
NULL
;
}
ci_copy->values = NULL;
ci_copy->parent = NULL;
}
ci_copy->values = NULL;
ci_copy->parent = NULL;
@@
-110,18
+110,17
@@
oconfig_item_t *oconfig_clone(const oconfig_item_t *ci_orig) {
if (ci_copy->key == NULL) {
fprintf(stderr, "strdup failed.\n");
free(ci_copy);
if (ci_copy->key == NULL) {
fprintf(stderr, "strdup failed.\n");
free(ci_copy);
- return
(NULL)
;
+ return
NULL
;
}
if (ci_orig->values_num > 0) /* {{{ */
{
}
if (ci_orig->values_num > 0) /* {{{ */
{
- ci_copy->values = (oconfig_value_t *)calloc((size_t)ci_orig->values_num,
- sizeof(*ci_copy->values));
+ ci_copy->values = calloc(ci_orig->values_num, sizeof(*ci_copy->values));
if (ci_copy->values == NULL) {
fprintf(stderr, "calloc failed.\n");
free(ci_copy->key);
free(ci_copy);
if (ci_copy->values == NULL) {
fprintf(stderr, "calloc failed.\n");
free(ci_copy->key);
free(ci_copy);
- return
(NULL)
;
+ return
NULL
;
}
ci_copy->values_num = ci_orig->values_num;
}
ci_copy->values_num = ci_orig->values_num;
@@
-133,7
+132,7
@@
oconfig_item_t *oconfig_clone(const oconfig_item_t *ci_orig) {
if (ci_copy->values[i].value.string == NULL) {
fprintf(stderr, "strdup failed.\n");
oconfig_free(ci_copy);
if (ci_copy->values[i].value.string == NULL) {
fprintf(stderr, "strdup failed.\n");
oconfig_free(ci_copy);
- return
(NULL)
;
+ return
NULL
;
}
} else /* ci_copy->values[i].type != OCONFIG_TYPE_STRING) */
{
}
} else /* ci_copy->values[i].type != OCONFIG_TYPE_STRING) */
{
@@
-144,12
+143,12
@@
oconfig_item_t *oconfig_clone(const oconfig_item_t *ci_orig) {
if (ci_orig->children_num > 0) /* {{{ */
{
if (ci_orig->children_num > 0) /* {{{ */
{
- ci_copy->children =
(oconfig_item_t *)calloc((size_t)ci_orig->children_num,
-
sizeof(*ci_copy->children));
+ ci_copy->children =
+
calloc(ci_orig->children_num,
sizeof(*ci_copy->children));
if (ci_copy->children == NULL) {
fprintf(stderr, "calloc failed.\n");
oconfig_free(ci_copy);
if (ci_copy->children == NULL) {
fprintf(stderr, "calloc failed.\n");
oconfig_free(ci_copy);
- return
(NULL)
;
+ return
NULL
;
}
ci_copy->children_num = ci_orig->children_num;
}
ci_copy->children_num = ci_orig->children_num;
@@
-159,7
+158,7
@@
oconfig_item_t *oconfig_clone(const oconfig_item_t *ci_orig) {
child = oconfig_clone(ci_orig->children + i);
if (child == NULL) {
oconfig_free(ci_copy);
child = oconfig_clone(ci_orig->children + i);
if (child == NULL) {
oconfig_free(ci_copy);
- return
(NULL)
;
+ return
NULL
;
}
child->parent = ci_copy;
ci_copy->children[i] = *child;
}
child->parent = ci_copy;
ci_copy->children[i] = *child;
@@
-167,7
+166,7
@@
oconfig_item_t *oconfig_clone(const oconfig_item_t *ci_orig) {
} /* for (i = 0; i < ci_copy->children_num; i++) */
} /* }}} if (ci_orig->children_num > 0) */
} /* for (i = 0; i < ci_copy->children_num; i++) */
} /* }}} if (ci_orig->children_num > 0) */
- return
(ci_copy)
;
+ return
ci_copy
;
} /* oconfig_item_t *oconfig_clone */
static void oconfig_free_all(oconfig_item_t *ci) {
} /* oconfig_item_t *oconfig_clone */
static void oconfig_free_all(oconfig_item_t *ci) {