summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-05-08 15:34:37 -0400
committerNick Mathewson <nickm@torproject.org>2017-05-08 15:34:37 -0400
commit4d6c79d1de5e242c000f28a71c706734d1a2da0b (patch)
tree65630c986788b35029d2345a0942e15a8fff2803 /src/or
parentfb97f76e71ab06abe4b4927f743f6683e7aaedab (diff)
downloadtor-4d6c79d1de5e242c000f28a71c706734d1a2da0b.tar.gz
tor-4d6c79d1de5e242c000f28a71c706734d1a2da0b.zip
Fix some clang-i386 warnings in master.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/channel.c6
-rw-r--r--src/or/channel.h2
-rw-r--r--src/or/channelpadding.c5
3 files changed, 8 insertions, 5 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index 5b184f1e22..0b99dc9d6e 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -88,7 +88,7 @@ static smartlist_t *finished_listeners = NULL;
/** Map from channel->global_identifier to channel. Contains the same
* elements as all_channels. */
-HT_HEAD(channel_gid_map, channel_s) channel_gid_map = HT_INITIALIZER();
+static HT_HEAD(channel_gid_map, channel_s) channel_gid_map = HT_INITIALIZER();
static unsigned
channel_id_hash(const channel_t *chan)
@@ -101,10 +101,10 @@ channel_id_eq(const channel_t *a, const channel_t *b)
return a->global_identifier == b->global_identifier;
}
HT_PROTOTYPE(channel_gid_map, channel_s, gidmap_node,
- channel_id_hash, channel_id_eq);
+ channel_id_hash, channel_id_eq)
HT_GENERATE2(channel_gid_map, channel_s, gidmap_node,
channel_id_hash, channel_id_eq,
- 0.6, tor_reallocarray_, tor_free_);
+ 0.6, tor_reallocarray_, tor_free_)
HANDLE_IMPL(channel, channel_s,);
diff --git a/src/or/channel.h b/src/or/channel.h
index bfcdafb276..ea280f2fd2 100644
--- a/src/or/channel.h
+++ b/src/or/channel.h
@@ -716,7 +716,7 @@ int packed_cell_is_destroy(channel_t *chan,
circid_t *circid_out);
/* Declare the handle helpers */
-HANDLE_DECL(channel, channel_s,);
+HANDLE_DECL(channel, channel_s,)
#endif
diff --git a/src/or/channelpadding.c b/src/or/channelpadding.c
index e57408ad5c..481d937423 100644
--- a/src/or/channelpadding.c
+++ b/src/or/channelpadding.c
@@ -727,13 +727,16 @@ channelpadding_decide_to_pad_channel(channel_t *chan)
chan->currently_padding = 1;
return CHANNELPADDING_PADLATER;
} else {
+ if (BUG(pad_time_ms > INT_MAX)) {
+ pad_time_ms = INT_MAX;
+ }
/* We have to schedule a callback because we're called exactly once per
* second, but we don't want padding packets to go out exactly on an
* integer multiple of seconds. This callback will only be scheduled
* if we're within 1.1 seconds of the padding time.
*/
chan->currently_padding = 1;
- return channelpadding_schedule_padding(chan, pad_time_ms);
+ return channelpadding_schedule_padding(chan, (int)pad_time_ms);
}
} else {
chan->currently_padding = 0;