diff options
author | Peter Meerwald <p.meerwald@bct-electronic.com> | 2014-10-23 11:35:29 +0200 |
---|---|---|
committer | Peter Meerwald <p.meerwald@bct-electronic.com> | 2014-10-28 17:36:22 +0100 |
commit | 72e5671eceacda19bc490be19fd8afa505418ed4 (patch) | |
tree | 1ccf1283095d6cafe06e8ef58466ab072d2d950e /src/tests | |
parent | 974fd3bcfd04f51ac0a640a0fae10f7df32b709e (diff) |
tests: Be careful with data types to avoid cast
use unsigned and size_t for counters and packet length, resp.
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/srbchannel-test.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tests/srbchannel-test.c b/src/tests/srbchannel-test.c index 7fd793f4f..bf7b0f0fb 100644 --- a/src/tests/srbchannel-test.c +++ b/src/tests/srbchannel-test.c @@ -32,23 +32,23 @@ #include <pulsecore/iochannel.h> #include <pulsecore/memblock.h> -static int packets_received; -static int packets_checksum; -static int packets_length; +static unsigned packets_received; +static unsigned packets_checksum; +static size_t packets_length; static void packet_received(pa_pstream *p, pa_packet *packet, const pa_ancil *ancil, void *userdata) { - unsigned int i; - fail_unless(packets_length == (int) packet->length); + unsigned i; + fail_unless(packets_length == packet->length); packets_received++; for (i = 0; i < packet->length; i++) packets_checksum += packet->data[i]; } -static void packet_test(int npackets, int plength, pa_mainloop *ml, pa_pstream *p1, pa_pstream *p2) { +static void packet_test(unsigned npackets, size_t plength, pa_mainloop *ml, pa_pstream *p1, pa_pstream *p2) { pa_packet *packet = pa_packet_new(plength); - int i; - int psum = 0, totalsum = 0; - pa_log_info("Sending %d packets of length %d", npackets, plength); + unsigned i; + unsigned psum = 0, totalsum = 0; + pa_log_info("Sending %d packets of length %zd", npackets, plength); packets_received = 0; packets_checksum = 0; packets_length = plength; |