State is signed char.

test->state is an explicitly signed char, so the two routines that
manipulate it must use explicitly signed chars too.

One could argue that the two negative state values should have been
positive like the rest, but changing them now would be a protocol change.
This commit is contained in:
Jef Poskanzer 2013-11-06 10:33:26 -08:00
parent 3651fa29e2
commit 2944aaa05b
2 changed files with 4 additions and 4 deletions

View File

@ -231,7 +231,7 @@ iperf_set_test_stats_interval(struct iperf_test *ipt, double stats_interval)
}
void
iperf_set_test_state(struct iperf_test *ipt, char state)
iperf_set_test_state(struct iperf_test *ipt, signed char state)
{
ipt->state = state;
}
@ -752,7 +752,7 @@ iperf_parse_arguments(struct iperf_test *test, int argc, char **argv)
}
int
iperf_set_send_state(struct iperf_test *test, char state)
iperf_set_send_state(struct iperf_test *test, signed char state)
{
test->state = state;
if (Nwrite(test->ctrl_sck, &state, sizeof(state), Ptcp) < 0) {

View File

@ -70,7 +70,7 @@ void iperf_set_test_omit( struct iperf_test* ipt, int omit );
void iperf_set_test_duration( struct iperf_test* ipt, int duration );
void iperf_set_test_reporter_interval( struct iperf_test* ipt, double reporter_interval );
void iperf_set_test_stats_interval( struct iperf_test* ipt, double stats_interval );
void iperf_set_test_state( struct iperf_test* ipt, char state );
void iperf_set_test_state( struct iperf_test* ipt, signed char state );
void iperf_set_test_blksize( struct iperf_test* ipt, int blksize );
void iperf_set_test_rate( struct iperf_test* ipt, uint64_t rate );
void iperf_set_test_server_port( struct iperf_test* ipt, int server_port );
@ -165,7 +165,7 @@ long get_total_retransmits(int socket);
void print_tcpinfo(struct iperf_test *test);
void build_tcpinfo_message(struct iperf_interval_results *r, char *message);
int iperf_set_send_state(struct iperf_test *test, char state);
int iperf_set_send_state(struct iperf_test *test, signed char state);
void iperf_check_throttle(struct iperf_stream *sp, struct timeval *nowP);
int iperf_send(struct iperf_test *, fd_set *) /* __attribute__((hot)) */;
int iperf_recv(struct iperf_test *, fd_set *);