Merge pull request #1816 from octo/grpc-free-iter
[collectd.git] / src / rrdtool.c
index b45f8d9..348f287 100644 (file)
 
 #include <rrd.h>
 
-#if HAVE_PTHREAD_H
-# include <pthread.h>
-#endif
-
 /*
  * Private types
  */
@@ -588,7 +584,7 @@ static void rrd_cache_flush (cdtime_t timeout)
                }
                else /* ancient and no values -> waste of memory */
                {
-                       char **tmp = (char **) realloc ((void *) keys,
+                       char **tmp = realloc (keys,
                                        (keys_num + 1) * sizeof (char *));
                        if (tmp == NULL)
                        {
@@ -692,7 +688,7 @@ static int64_t rrd_get_random_variation (void)
   long min;
   long max;
 
-  if (random_timeout <= 0)
+  if (random_timeout == 0)
     return (0);
 
   /* Assure that "cache_timeout + random_variation" is never negative. */
@@ -756,7 +752,7 @@ static int rrd_cache_insert (const char *filename,
                return (-1);
        }
 
-       values_new = (char **) realloc ((void *) rc->values,
+       values_new = realloc ((void *) rc->values,
                        (rc->values_num + 1) * sizeof (char *));
        if (values_new == NULL)
        {