# include "config.h"
#endif
-#include "libcollectdclient/client.h"
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <strings.h>
#include <assert.h>
-
#include <errno.h>
-#include <getopt.h>
-
-#include <math.h>
+#if NAN_STATIC_DEFAULT
+# include <math.h>
+/* #endif NAN_STATIC_DEFAULT*/
+#elif NAN_STATIC_ISOC
+# ifndef __USE_ISOC99
+# define DISABLE_ISOC99 1
+# define __USE_ISOC99 1
+# endif /* !defined(__USE_ISOC99) */
+# include <math.h>
+# if DISABLE_ISOC99
+# undef DISABLE_ISOC99
+# undef __USE_ISOC99
+# endif /* DISABLE_ISOC99 */
+/* #endif NAN_STATIC_ISOC */
+#elif NAN_ZERO_ZERO
+# include <math.h>
+# ifdef NAN
+# undef NAN
+# endif
+# define NAN (0.0 / 0.0)
+# ifndef isnan
+# define isnan(f) ((f) != (f))
+# endif /* !defined(isnan) */
+# ifndef isfinite
+# define isfinite(f) (((f) - (f)) == 0.0)
+# endif
+# ifndef isinf
+# define isinf(f) (!isfinite(f) && !isnan(f))
+# endif
+#endif /* NAN_ZERO_ZERO */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <unistd.h>
+#include "libcollectdclient/client.h"
#define DEFAULT_SOCK LOCALSTATEDIR"/run/"PACKAGE_NAME"-unixsock"
if (strcasecmp (key, "timeout") == 0) {
char *endptr = NULL;
- timeout = strtol (value, &endptr, 0);
+ timeout = (int) strtol (value, &endptr, 0);
if (endptr == value) {
fprintf (stderr, "ERROR: Failed to parse timeout as number: %s.\n",
}
}
else if (strcasecmp (key, "plugin") == 0) {
- status = array_grow ((void **)&plugins, &plugins_num,
+ status = array_grow ((void *)&plugins, &plugins_num,
sizeof (*plugins));
if (status != 0)
BAIL_OUT (status);
plugins[plugins_num - 1] = value;
}
else if (strcasecmp (key, "identifier") == 0) {
- status = array_grow ((void **)&identifiers, &identifiers_num,
+ status = array_grow ((void *)&identifiers, &identifiers_num,
sizeof (*identifiers));
if (status != 0)
BAIL_OUT (status);
}
if (plugins_num == 0) {
- status = array_grow ((void **)&plugins, &plugins_num, sizeof (*plugins));
+ status = array_grow ((void *)&plugins, &plugins_num, sizeof (*plugins));
if (status != 0)
BAIL_OUT (status);
vl.time = strtol (argv[i], &endptr, 0);
- if (endptr == value) {
+ if (endptr == argv[i]) {
fprintf (stderr, "ERROR: Failed to parse time as number: %s.\n",
argv[i]);
return (-1);