gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r15568 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r15568 - gnunet/src/util
Date: Tue, 14 Jun 2011 13:42:07 +0200

Author: grothoff
Date: 2011-06-14 13:42:07 +0200 (Tue, 14 Jun 2011)
New Revision: 15568

Modified:
   gnunet/src/util/peer.c
Log:
fixing 1692

Modified: gnunet/src/util/peer.c
===================================================================
--- gnunet/src/util/peer.c      2011-06-14 11:22:49 UTC (rev 15567)
+++ gnunet/src/util/peer.c      2011-06-14 11:42:07 UTC (rev 15568)
@@ -85,12 +85,14 @@
   GNUNET_PEER_Id ret;
   struct PeerEntry *e;
   unsigned int i;
+  long off;
 
   if (pid == NULL)
     return 0;
   if (NULL == map)
     map = GNUNET_CONTAINER_multihashmap_create (32);
-  e = GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey);
+  off = (long) GNUNET_CONTAINER_multihashmap_get (map, &pid->hashPubKey);
+  e = (off == 0) ? NULL : &table[off];
   if (e != NULL)
     {
       GNUNET_assert (e->rc > 0);
@@ -119,7 +121,7 @@
   GNUNET_break (GNUNET_OK ==
                GNUNET_CONTAINER_multihashmap_put (map,
                                                   &pid->hashPubKey,
-                                                  &table[ret],
+                                                  (void *) (long) ret,
                                                   
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY));
   return ret;
 }
@@ -152,7 +154,7 @@
           GNUNET_break (GNUNET_OK ==
                        GNUNET_CONTAINER_multihashmap_remove (map,
                                                              
&table[id].id.hashPubKey,
-                                                             &table[id]));
+                                                             (void*) (long) 
id));
           table[id].pid = free_list_start;
           free_list_start = id;
         }
@@ -180,7 +182,7 @@
       GNUNET_break (GNUNET_OK ==
                    GNUNET_CONTAINER_multihashmap_remove (map,
                                                          
&table[id].id.hashPubKey,
-                                                         &table[id]));
+                                                         (void*) (long) id));
       table[id].pid = free_list_start;
       free_list_start = id;
     }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]