-help seaspider some more
authorChristian Grothoff <christian@grothoff.org>
Tue, 15 May 2012 00:49:26 +0000 (00:49 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 15 May 2012 00:49:26 +0000 (00:49 +0000)
21 files changed:
src/arm/gnunet-service-arm.c
src/ats/gnunet-service-ats_addresses_mlp.c
src/exit/gnunet-daemon-exit.c
src/fs/fs_uri.c
src/fs/gnunet-download.c
src/fs/gnunet-pseudonym.c
src/hostlist/hostlist-server.c
src/integration-tests/connection_watchdog.c
src/mesh/gnunet-service-mesh.c
src/mesh/mesh_api.c
src/transport/plugin_transport_smtp.c
src/transport/plugin_transport_udp.c
src/util/common_logging.c
src/util/container_slist.c
src/util/disk.c
src/util/getopt.c
src/util/network.c
src/util/os_priority.c
src/util/program.c
src/util/pseudonym.c
src/util/server.c

index 45650188ff0d43fdd6cc02daa2beef22ed8c378b..ce9104334c9948f21f9e5b4296d113790b97b0de 100644 (file)
@@ -494,7 +494,7 @@ static void
 create_listen_socket (struct sockaddr *sa, socklen_t addr_len,
                      struct ServiceList *sl)
 {
-  const static int on = 1;
+  static int on = 1;
   struct GNUNET_NETWORK_Handle *sock;
   struct ServiceListeningInfo *sli;
 
index d4c2c177afc62ce2bb745a0d10446a7500562318..532fadadf9d47c9f1f64413acfea74fefdd30ee7 100644 (file)
@@ -1126,7 +1126,7 @@ GAS_mlp_init (const struct GNUNET_CONFIGURATION_Handle *cfg,
   double D;
   double R;
   double U;
-  long long unsigned int tmp;
+  unsigned long long tmp;
   unsigned int b_min;
   unsigned int n_min;
   struct GNUNET_TIME_Relative i_exec;
index 861742ee82483be74edd8b26cfaa0006a56560f2..e58611cc62b37fd68fc1981b2b9afa3f90281722 100644 (file)
@@ -284,7 +284,7 @@ static struct GNUNET_CONTAINER_Heap *connections_heap;
 /**
  * If there are at least this many connections, old ones will be removed
  */
-static long long unsigned int max_connections;
+static unsigned long long max_connections;
 
 /**
  * This hashmaps saves interesting things about the configured UDP services
index dc6d195caf44d1d32371a4c9d013a45adc27d6a3..0c2d64caca85186b4c5247e039e62ac935c994e1 100644 (file)
@@ -1377,7 +1377,8 @@ GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg,
                                    const struct GNUNET_FS_Uri *uri)
 {
   char *ret;
-  char *name, *unique_name;
+  char *name;
+  char *unique_name;
 
   if (uri->type != sks)
     return NULL;
index ff10c39c667ce0a116e6898ad521217b781c6e78..5a66aea27c3c02b8d961e3663aa784f152501377 100644 (file)
@@ -90,7 +90,8 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 static void *
 progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info)
 {
-  char *s, *s2;
+  char *s;
+  char *s2;
   char *t;
 
   switch (info->status)
index 247a5a0d85e34ffff98dbef569daeecd9104bfa1..38826d1de18ec18992d721994e600bbb5e733025 100644 (file)
@@ -109,7 +109,8 @@ pseudo_printer (void *cls, const GNUNET_HashCode * pseudonym,
                 const char *name, const char *unique_name,
                 const struct GNUNET_CONTAINER_MetaData *md, int rating)
 {
-  char *id, *unique_id;
+  char *id;
+  char *unique_id;
   int getinfo_result;
 
   /* While we get a name from the caller, it might be NULL.
index af46110ca27a45e62a709fdeed8aa771e1d06306..66263e1a354b6ee7630f3242690e8d54d972b247 100644 (file)
@@ -481,7 +481,7 @@ prepare_daemon (struct MHD_Daemon *daemon_handle)
   struct GNUNET_NETWORK_FDSet *wws;
   struct GNUNET_NETWORK_FDSet *wes;
   int max;
-  unsigned MHD_LONG_LONG timeout;
+  MHD_LONG_LONG timeout;
   int haveto;
   struct GNUNET_TIME_Relative tv;
 
index 00da55eeef5c7d86414e1a75af0aa29425a61ca4..709ca4eebd49751d0a88e48e910cef82d9806262 100644 (file)
@@ -971,7 +971,7 @@ init ()
   char *pos;
   char *secname;
   int counter;
-  long long unsigned int port;
+  unsigned long long port;
 
   have_tcp = GNUNET_NO;
   have_udp = GNUNET_NO;
index 31e0dc901548ea2b4c426d170bd1d328c601b5a8..aa9ae888cf7feb8972d0854f28f21c3c82f099f8 100644 (file)
@@ -623,7 +623,7 @@ announce_application (void *cls, const GNUNET_HashCode * key, void *value)
 {
   /* FIXME are hashes in multihash map equal on all aquitectures? */
   /* FIXME: keep return value of 'put' to possibly cancel!? */
-  GNUNET_DHT_put (dht_handle, key, 10U,
+  GNUNET_DHT_put (dht_handle, key, 10,
                   GNUNET_DHT_RO_RECORD_ROUTE |
                   GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE, GNUNET_BLOCK_TYPE_TEST,
                   sizeof (struct GNUNET_PeerIdentity),
@@ -692,12 +692,8 @@ announce_id (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                   (char *) &my_full_id, /* Data itself */
                   GNUNET_TIME_absolute_get_forever (),  /* Data expiration */
                   GNUNET_TIME_UNIT_FOREVER_REL, /* Retry time */
-#if MESH_DEBUG_DHT
-                  &mesh_debug, "DHT_put for id completed");
-#else
                   NULL,         /* Continuation */
                   NULL);        /* Continuation closure */
-#endif
   announce_id_task =
       GNUNET_SCHEDULER_add_delayed (ID_ANNOUNCE_TIME, &announce_id, cls);
 }
index 7332d0c3d6057ca39cdaa245fd4b050600b65394..de931db7cc792d203d3300498716c463aec36447 100644 (file)
  * - SEND FUNCTIONS
  * - API CALL DEFINITIONS
  */
-#ifdef __cplusplus
-extern "C"
-{
-#if 0                           /* keep Emacsens' auto-indent happy */
-}
-#endif
-#endif
-
 #include "platform.h"
 #include "gnunet_common.h"
 #include "gnunet_client_lib.h"
@@ -45,13 +37,8 @@ extern "C"
 #include "mesh.h"
 #include "mesh_protocol.h"
 
-#define MESH_API_DEBUG GNUNET_YES
-
-#if MESH_API_DEBUG
 #define LOG(kind,...) GNUNET_log_from (kind, "mesh-api",__VA_ARGS__)
-#else
-#define LOG(kind,...)
-#endif
+
 
 /******************************************************************************/
 /************************      DATA STRUCTURES     ****************************/
@@ -1717,9 +1704,3 @@ GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel)
 }
 
 
-#if 0                           /* keep Emacsens' auto-indent happy */
-{
-#endif
-#ifdef __cplusplus
-}
-#endif
index b589e117786b61ae6e49e1b7149f4609c02511ca..609b1159620103d7aa8ce1c0a9771ccd010c307a 100644 (file)
@@ -774,7 +774,7 @@ api_associate (GNUNET_TSession * tsession)
  * frequency limits to SMTP in the future!).
  */
 static int
-api_test_would_try (GNUNET_TSession * tsession, const unsigned int size,
+api_test_would_try (GNUNET_TSession * tsession, unsigned int size,
                     int important)
 {
   return GNUNET_OK;             /* we always try... */
@@ -785,10 +785,8 @@ api_test_would_try (GNUNET_TSession * tsession, const unsigned int size,
  * returns the smtp transport API.
  */
 GNUNET_TransportAPI *
-inittransport_smtp (GNUNET_CoreAPIForTransport * core)
+inittransport_smtp (struct GNUNET_CoreAPIForTransport * core)
 {
-
-
   unsigned long long mtu;
   struct sigaction sa;
 
index ae710c73cf1b81806b5a6f88b8a66b76a9a4ccb6..76fd1a6cda7645d78cdf3375200cfbece9e3307c 100644 (file)
@@ -1760,8 +1760,6 @@ udp_select_send (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *sock)
   ssize_t sent;
   size_t slen;
   struct GNUNET_TIME_Absolute max;
-  struct GNUNET_TIME_Absolute ;
-
   struct UDPMessageWrapper *udpw = NULL;
 
   if (sock == plugin->sockv4)
@@ -1859,9 +1857,9 @@ udp_select_send (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *sock)
        * have a valid global IPv6 address assigned
        */
        LOG (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
-           _("UDP could not message to `%s': `%s'\n, " \
-           "Please check your network configuration and disable IPv6 if your\n" \
-           "connection does not have a global IPv6 address"),
+           _("UDP could not message to `%s': `%s'. "
+            "Please check your network configuration and disable IPv6 if your "
+            "connection does not have a global IPv6 address\n"),
            GNUNET_a2s (sa, slen),
            STRERROR (errno));
     }
index 995f2e88a84a62f37517c7168e684624d5fa020d..2c0fd57a817845ca4313d650f36544cc5fc9798e 100644 (file)
@@ -530,6 +530,8 @@ parse_all_definitions ()
   gnunet_force_log_parsed = GNUNET_YES;
 }
 #endif
+
+
 /**
  * Setup logging.
  *
@@ -569,17 +571,16 @@ GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile)
   if (NULL == fn)
     return GNUNET_SYSERR;
   dirwarn = (GNUNET_OK != GNUNET_DISK_directory_create_for_file (fn));
-  altlog_fd = OPEN (fn, O_APPEND |
 #if WINDOWS
+  altlog_fd = OPEN (fn, O_APPEND |
                         O_BINARY |
-#endif
                         O_WRONLY | O_CREAT,
-#if WINDOWS
-                        _S_IREAD | _S_IWRITE
+                        _S_IREAD | _S_IWRITE);
 #else
-                        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH
+  altlog_fd = OPEN (fn, O_APPEND |
+                        O_WRONLY | O_CREAT,
+                        S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
 #endif
-                   );
   if (altlog_fd != -1)
   {
     int dup_return;
index 950c4245efd1fc8634a8f1b0aaa54a4a582d7249..6b583258376ce101a49d76ec1072cc3f2564aeb5 100644 (file)
@@ -268,6 +268,7 @@ GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l,
   return GNUNET_NO;
 }
 
+typedef int (*Comparator)(const void *,  size_t, const void *,  size_t);
 
 /**
  * Check if a list contains a certain element
@@ -283,7 +284,7 @@ GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l,
 void *
 GNUNET_CONTAINER_slist_contains2 (const struct GNUNET_CONTAINER_SList *l,
                                   const void *buf, size_t len,
-                                  int (*compare)(const void *, const size_t, const void *, const size_t))
+                                  Comparator compare)
 {
   struct GNUNET_CONTAINER_SList_Elem *e;
 
index 847dad457ec141101c37a79e035054e2a1edc220..cba0d4467ba4731c06a4644f85c79aaec7143506 100644 (file)
@@ -270,7 +270,8 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle * h, OFF_T offset,
   }
 
 #ifdef MINGW
-  LARGE_INTEGER li, new_pos;
+  LARGE_INTEGER li;
+  LARGE_INTEGER new_pos;
   BOOL b;
 
   static DWORD t[] = {[GNUNET_DISK_SEEK_SET] = FILE_BEGIN,
index 169949821ed2a432299c1fea66552a0e98b66c5e..572e534c5b75ce0ac02416a5817462ca9b654b5b 100644 (file)
@@ -202,9 +202,8 @@ char *
 getenv ();
 
 static char *
-my_index (str, chr)
-  const char *str;
-  int chr;
+my_index (const char *str,
+         int chr)
 {
   while (*str)
   {
@@ -294,8 +293,7 @@ exchange (char **);
 #endif
 
 static void
-exchange (argv)
-  char **argv;
+exchange (char **argv)
 {
   int bottom = first_nonopt;
   int middle = last_nonopt;
@@ -381,10 +379,9 @@ static const char *
 _getopt_initialize (int, char *const *, const char *);
 #endif
 static const char *
-_getopt_initialize (argc, argv, optstring)
-  int argc;
-  char *const *argv;
-  const char *optstring;
+_getopt_initialize (int argc,
+                   char *const *argv,
+                   const char *optstring)
 {
   /* Start processing options with ARGV-element 1 (since ARGV-element 0
    * is the program name); the sequence of previously skipped
index 54abcaba15eff7dd25812ce174cf3364b2d661f6..9323389ee0fc3691a0bb9579aa8c7ab8efe0f813 100644 (file)
@@ -508,15 +508,16 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle *
 
   error = ioctl (desc->fd, FIONREAD, &pending);
   if (error == 0)
+    return (ssize_t) pending;
+  return GNUNET_NO;
 #else
   u_long pending;
 
   error = ioctlsocket (desc->fd, FIONREAD, &pending);
   if (error != SOCKET_ERROR)
+    return (ssize_t) pending;
+  return GNUNET_NO;
 #endif
-    return pending;
-  else
-    return GNUNET_NO;
 }
 
 
@@ -1079,7 +1080,6 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
                               const struct GNUNET_TIME_Relative timeout)
 {
   int nfds = 0;
-
 #ifdef MINGW
   int handles = 0;
   int ex_handles = 0;
@@ -1090,7 +1090,9 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
   int retcode = 0;
   DWORD ms_total = 0;
 
-  int nsock = 0, nhandles = 0, nSockEvents = 0;
+  int nsock = 0;
+  int nhandles = 0;
+  int nSockEvents = 0;
 
   static HANDLE hEventRead = 0;
   static HANDLE hEventWrite = 0;
@@ -1106,12 +1108,18 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds,
   DWORD newretcode = 0;
   int returnedpos = 0;
 
-  struct GNUNET_CONTAINER_SList *handles_read, *handles_write, *handles_except;
+  struct GNUNET_CONTAINER_SList *handles_read;
+  struct GNUNET_CONTAINER_SList *handles_write;
+  struct GNUNET_CONTAINER_SList *handles_except;
 
-  fd_set aread, awrite, aexcept;
+  fd_set aread;
+  fd_set awrite;
+  fd_set except;
 
 #if DEBUG_NETWORK
-  fd_set bread, bwrite, bexcept;
+  fd_set bread;
+  fd_set bwrite;
+  fd_set bexcept;
 #endif
 
   /* TODO: Make this growable */
index f374ca56d0b9189205fce6d8e04e10a53db43ad2..9def6ca54d899cd0b59920a2afc54090f6ec9b10 100644 (file)
@@ -649,10 +649,15 @@ GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc,
 static char *
 CreateCustomEnvTable (char **vars)
 {
-  char *win32_env_table, *ptr, **var_ptr, *result, *result_ptr;
+  char *win32_env_table;
+  char *ptr;
+  char **var_ptr;
+  char *result;
+  char *result_ptr;
   size_t tablesize = 0;
   size_t items_count = 0;
-  size_t n_found = 0, n_var;
+  size_t n_found = 0;
+  size_t n_var;
   char *index = NULL;
   size_t c;
   size_t var_len;
index bfa58dc65c3eeebfbb91d7601b7aa327e537f493..b6d0c78c6aee81c6e5e896624391afda49dd620a 100644 (file)
@@ -95,10 +95,10 @@ program_main (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
  * @param a2 second command line option
  */
 static int
-cmd_sorter (__const void *a1, __const void *a2)
+cmd_sorter (const void *a1, const void *a2)
 {
-  __const struct GNUNET_GETOPT_CommandLineOption *c1 = a1;
-  __const struct GNUNET_GETOPT_CommandLineOption *c2 = a2;
+  const struct GNUNET_GETOPT_CommandLineOption *c1 = a1;
+  const struct GNUNET_GETOPT_CommandLineOption *c2 = a2;
 
   if (toupper ((unsigned char) c1->shortName) >
       toupper ((unsigned char) c2->shortName))
index d2efdc98f8fa58dfb4752d59f9c3e6f2042f24b4..016573845574a96d4aee9b68c514d1a7b1b033b5 100644 (file)
@@ -539,7 +539,8 @@ list_pseudonym_helper (void *cls, const char *fullname)
   int32_t rating;
   struct GNUNET_CONTAINER_MetaData *meta;
   const char *fn;
-  char *str, *name_unique;
+  char *str;
+  char *name_unique;
 
   if (strlen (fullname) < sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded))
     return GNUNET_OK;
index 6226dea6d27f6db5ceeb79f77e88d0d8bec27112..f707d1bf3eb588631d74316a94c6894db47fe419 100644 (file)
@@ -391,7 +391,7 @@ process_listen_socket (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 static struct GNUNET_NETWORK_Handle *
 open_listen_socket (const struct sockaddr *serverAddr, socklen_t socklen)
 {
-  const static int on = 1;
+  static int on = 1;
   struct GNUNET_NETWORK_Handle *sock;
   uint16_t port;
   int eno;