-only trigger check config if we actually need it
[oweals/gnunet.git] / src / fragmentation / fragmentation.c
index dd6e6774b7b88e4e4df55873e9b5c34a5ef8d980..3a55502e71b03adfcde7e71778b48c1b8a8af73a 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet
-     Copyright (C) 2009-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009-2013 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -167,11 +167,9 @@ GNUNET_FRAGMENT_print_ack (const struct GNUNET_MessageHeader *ack)
  * Transmit the next fragment to the other peer.
  *
  * @param cls the `struct GNUNET_FRAGMENT_Context`
- * @param tc scheduler context
  */
 static void
-transmit_next (void *cls,
-               const struct GNUNET_SCHEDULER_TaskContext *tc)
+transmit_next (void *cls)
 {
   struct GNUNET_FRAGMENT_Context *fc = cls;
   char msg[fc->mtu];
@@ -262,7 +260,7 @@ transmit_next (void *cls,
     delay = GNUNET_TIME_UNIT_ZERO;
   delay = GNUNET_TIME_relative_max (delay,
                                    GNUNET_TIME_relative_multiply (fc->msg_delay,
-                                                                  (1 << fc->num_rounds)));
+                                                                  (1ULL << fc->num_rounds)));
   if (wrap)
   {
     /* full round transmitted wait 2x delay for ACK before going again */
@@ -420,10 +418,10 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc,
     snd_cnt = 0;
     for (i=0;i<64;i++)
     {
-      if (1 == (fc->acks_mask & (1 << i)))
+      if (1 == (fc->acks_mask & (1ULL << i)))
       {
        snd_cnt++;
-       if (0 == (abits & (1 << i)))
+       if (0 == (abits & (1ULL << i)))
          ack_cnt++;
       }
     }