Fix non-compiling code by proper pre-compiler usage
authorJulius Bünger <buenger@mytum.de>
Thu, 6 Sep 2018 01:17:01 +0000 (03:17 +0200)
committerJulius Bünger <buenger@mytum.de>
Thu, 6 Sep 2018 01:20:55 +0000 (03:20 +0200)
src/rps/gnunet-rps-profiler.c

index 073d26ffd59908f2aefeb967efb8ca705930f6fd..d2640225adb48b068ffa18530fc8b1a5a39c9dda 100644 (file)
@@ -1821,6 +1821,7 @@ profiler_reply_handle (void *cls,
     tofile (file_name_dh,
              "%" PRIu32 "\n",
              (uint32_t) rcv_rps_peer->index);
+#ifdef TO_FILE
     to_file_raw (file_name_dhr,
                 (char *) &rcv_rps_peer->index,
                  sizeof (uint32_t));
@@ -1828,6 +1829,7 @@ profiler_reply_handle (void *cls,
                           (char *) &rcv_rps_peer->index,
                            sizeof (uint32_t),
                            bits_needed);
+#endif /* TO_FILE */
   }
   default_reply_handle (cls, n, recv_peers);
 }
@@ -1871,7 +1873,7 @@ profiler_cb (struct RPSPeer *rps_peer)
  *  #GNUNET_NO to stop iteration with no error,
  *  #GNUNET_SYSERR to abort iteration with error!
  */
-int
+static int
 file_name_cb (void *cls, const char *filename)
 {
   if (NULL != strstr (filename, "sampler_el"))
@@ -1903,14 +1905,16 @@ file_name_cb (void *cls, const char *filename)
  *
  * Compute all perfect samples.
  */
-int
+static int
 profiler_eval (void)
 {
+#ifdef TO_FILE
   /* Compute perfect sample for each sampler element */
   if (-1 == GNUNET_DISK_directory_scan ("/tmp/rps/", file_name_cb, NULL))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Scan of directory failed\n");
   }
+#endif /* TO_FILE */
 
   return evaluate ();
 }