aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-08 16:48:10 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-08 16:48:10 +0000
commit0f3caa49abab25613b9adb60427929882a17eabc (patch)
tree26dcca19169fe2fde7b4bc3136ab81007f8f5be6 /src
parentc82072eaae70a10f46dfc448e9aefd80cde2ae45 (diff)
downloadgnunet-0f3caa49abab25613b9adb60427929882a17eabc.tar.gz
gnunet-0f3caa49abab25613b9adb60427929882a17eabc.zip
-fix shifting issues
Diffstat (limited to 'src')
-rw-r--r--src/datacache/plugin_datacache_heap.c3
-rw-r--r--src/fragmentation/defragmentation.c8
-rw-r--r--src/statistics/statistics.h2
3 files changed, 7 insertions, 6 deletions
diff --git a/src/datacache/plugin_datacache_heap.c b/src/datacache/plugin_datacache_heap.c
index a32835cf4..afc320b20 100644
--- a/src/datacache/plugin_datacache_heap.c
+++ b/src/datacache/plugin_datacache_heap.c
@@ -245,7 +245,8 @@ heap_plugin_put (void *cls,
245 GNUNET_array_grow (val->path_info, 245 GNUNET_array_grow (val->path_info,
246 val->path_info_len, 246 val->path_info_len,
247 path_info_len); 247 path_info_len);
248 memcpy (val->path_info, path_info, 248 memcpy (val->path_info,
249 path_info,
249 path_info_len * sizeof (struct GNUNET_PeerIdentity)); 250 path_info_len * sizeof (struct GNUNET_PeerIdentity));
250 (void) GNUNET_CONTAINER_multihashmap_put (plugin->map, 251 (void) GNUNET_CONTAINER_multihashmap_put (plugin->map,
251 &val->key, 252 &val->key,
diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c
index 5433ffb5a..50fc4a1d5 100644
--- a/src/fragmentation/defragmentation.c
+++ b/src/fragmentation/defragmentation.c
@@ -506,7 +506,7 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
506 if (n == 64) 506 if (n == 64)
507 mc->bits = UINT64_MAX; /* set all 64 bit */ 507 mc->bits = UINT64_MAX; /* set all 64 bit */
508 else 508 else
509 mc->bits = (1LL << n) - 1; /* set lowest 'bits' bit */ 509 mc->bits = (1LLU << n) - 1; /* set lowest 'bits' bit */
510 if (dc->list_size >= dc->num_msgs) 510 if (dc->list_size >= dc->num_msgs)
511 discard_oldest_mc (dc); 511 discard_oldest_mc (dc);
512 GNUNET_CONTAINER_DLL_insert (dc->head, 512 GNUNET_CONTAINER_DLL_insert (dc->head,
@@ -516,9 +516,9 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
516 } 516 }
517 517
518 /* copy data to 'mc' */ 518 /* copy data to 'mc' */
519 if (0 != (mc->bits & (1LL << bit))) 519 if (0 != (mc->bits & (1LLU << bit)))
520 { 520 {
521 mc->bits -= 1LL << bit; 521 mc->bits -= 1LLU << bit;
522 mbuf = (char *) &mc[1]; 522 mbuf = (char *) &mc[1];
523 memcpy (&mbuf[bit * (dc->mtu - sizeof (struct FragmentHeader))], &fh[1], 523 memcpy (&mbuf[bit * (dc->mtu - sizeof (struct FragmentHeader))], &fh[1],
524 ntohs (msg->size) - sizeof (struct FragmentHeader)); 524 ntohs (msg->size) - sizeof (struct FragmentHeader));
@@ -543,7 +543,7 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
543 /* count number of missing fragments after the current one */ 543 /* count number of missing fragments after the current one */
544 bc = 0; 544 bc = 0;
545 for (b = bit; b < 64; b++) 545 for (b = bit; b < 64; b++)
546 if (0 != (mc->bits & (1LL << b))) 546 if (0 != (mc->bits & (1LLU << b)))
547 bc++; 547 bc++;
548 else 548 else
549 bc = 0; 549 bc = 0;
diff --git a/src/statistics/statistics.h b/src/statistics/statistics.h
index ac88aadef..41863a64f 100644
--- a/src/statistics/statistics.h
+++ b/src/statistics/statistics.h
@@ -63,7 +63,7 @@ struct GNUNET_STATISTICS_ReplyMessage
63 * Flag for the `struct GNUNET_STATISTICS_ReplyMessage` UID only. 63 * Flag for the `struct GNUNET_STATISTICS_ReplyMessage` UID only.
64 * Note that other messages use #GNUNET_STATISTICS_SETFLAG_PERSISTENT. 64 * Note that other messages use #GNUNET_STATISTICS_SETFLAG_PERSISTENT.
65 */ 65 */
66#define GNUNET_STATISTICS_PERSIST_BIT (1<<31) 66#define GNUNET_STATISTICS_PERSIST_BIT ((uint32_t) (1LLU<<31))
67 67
68/** 68/**
69 * The value being set is an absolute change. 69 * The value being set is an absolute change.