Skip to content

Commit

Permalink
Fix a series of compile warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
huitema committed Feb 29, 2024
1 parent d987aa5 commit 3b6434d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
8 changes: 5 additions & 3 deletions picoquic/bbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,13 +1463,15 @@ static uint64_t BBRRandomIntBetween(picoquic_bbr_state_t* bbr_state, uint64_t lo
{
return (low + picoquic_test_uniform_random(&bbr_state->random_context, (high - low) + 1));
}

#if 0
/* Apprently this code is not needed. */
static double BBRRandomFloatBetween(picoquic_bbr_state_t* bbr_state, double low, double high)
{
uint32_t random_32_bits = (uint32_t)picoquic_test_random(&bbr_state->random_context);
double random_float = ((double)random_32_bits) / ((double)UINT32_MAX);
return (low + random_float * (high - low));
}
#endif

static void BBRPickProbeWait(picoquic_bbr_state_t* bbr_state)
{
Expand Down Expand Up @@ -1935,7 +1937,7 @@ void BBRSetBdpSeed(picoquic_bbr_state_t* bbr_state, uint64_t bdp_seed)
* TODO: this is part of "path" model
*/


#if 0
/* At what prefix of packet did losses exceed BBRLossThresh? */
static uint64_t BBRInflightHiFromLostPacket(bbr_per_ack_state_t * rs, picoquic_per_ack_state_t* packet_state)
{
Expand All @@ -1950,7 +1952,7 @@ static uint64_t BBRInflightHiFromLostPacket(bbr_per_ack_state_t * rs, picoquic_p
uint64_t inflight = inflight_prev + (uint64_t)lost_prefix;
return inflight;
}

#endif
#if 1
/* TODO: reconcile this direct handling of path->cwin with the handling
* of the "inflight too high" variable.
Expand Down
2 changes: 0 additions & 2 deletions picoquic/frames.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,6 @@ int picoquic_process_ack_of_retire_connection_id_frame(picoquic_cnx_t* cnx, cons
picoquic_remote_cnxid_stash_t* remote_cnxid_stash = picoquic_find_or_create_remote_cnxid_stash(cnx, unique_path_id, 0);
if (remote_cnxid_stash != NULL) {
picoquic_remote_cnxid_t* stashed = remote_cnxid_stash->cnxid_stash_first;
picoquic_remote_cnxid_t* previous_stash = NULL;
*consumed = bytes_next - bytes;

while (stashed != NULL) {
Expand All @@ -751,7 +750,6 @@ int picoquic_process_ack_of_retire_connection_id_frame(picoquic_cnx_t* cnx, cons
(void)picoquic_remove_cnxid_from_stash(cnx, remote_cnxid_stash, stashed, NULL, 1);
break;
}
previous_stash = stashed;
stashed = stashed->next;
}
}
Expand Down
2 changes: 1 addition & 1 deletion picoquic/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1860,7 +1860,7 @@ int picoquic_find_incoming_unique_path(picoquic_cnx_t* cnx, picoquic_packet_head
path_x->nat_challenge[ichal] = picoquic_public_random_64();
}
path_x->nat_challenge_time = 0;
path_x->nat_challenge_repeat_count;
path_x->nat_challenge_repeat_count = 0;
path_x->p_remote_nat_cnxid = picoquic_obtain_stashed_cnxid(cnx, path_x->unique_path_id);
}
}
Expand Down
3 changes: 3 additions & 0 deletions picoquic/sockloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
#include <netinet/in.h>
#include <sys/select.h>

#ifndef __APPLE__
#define _GNU_SOURCE
#endif
#include <pthread.h>

#ifndef SOCKET_TYPE
Expand Down

0 comments on commit 3b6434d

Please sign in to comment.