# HG changeset patch # User Ivo Smits # Date 1300313887 -3600 # Node ID 24e09485a8a3b5f13c66c9084d4b302d3f8f9453 # Parent dfac56805c777f606016686e355da1586ffab378 Clean up in build script, fixed compiler warnings in nacltai protocol debug code diff -r dfac56805c77 -r 24e09485a8a3 build.sh --- a/build.sh Mon Feb 28 19:28:18 2011 +0100 +++ b/build.sh Wed Mar 16 23:18:07 2011 +0100 @@ -71,3 +71,5 @@ cd .. fi fi + +rm -rf obj tmp diff -r dfac56805c77 -r 24e09485a8a3 src/proto.nacltai.c --- a/src/proto.nacltai.c Mon Feb 28 19:28:18 2011 +0100 +++ b/src/proto.nacltai.c Wed Mar 16 23:18:07 2011 +0100 @@ -118,7 +118,7 @@ } static int encode(struct qtsession* sess, char* raw, char* enc, int len) { - if (debug) fprintf(stderr, "Encoding packet of %d bytes from %d to %d\n", len, raw, enc); + if (debug) fprintf(stderr, "Encoding packet of %d bytes from %d to %d\n", len, (int)raw, (int)enc); struct qt_proto_data_nacltai* d = (struct qt_proto_data_nacltai*)sess->protocol_data; memset(raw, 0, crypto_box_curve25519xsalsa20poly1305_ZEROBYTES); taia_now(&d->cdtaic); @@ -126,12 +126,12 @@ if (crypto_box_curve25519xsalsa20poly1305_afternm(enc, raw, len + crypto_box_curve25519xsalsa20poly1305_ZEROBYTES, d->cenonce, d->cbefore)) return errorexit("Encryption failed"); memcpy((void*)(enc + crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES - noncelength), d->cenonce + nonceoffset, noncelength); len += overhead; - if (debug) fprintf(stderr, "Encoded packet of %d bytes from %d to %d\n", len, raw, enc); + if (debug) fprintf(stderr, "Encoded packet of %d bytes from %d to %d\n", len, (int)raw, (int)enc); return len; } static int decode(struct qtsession* sess, char* enc, char* raw, int len) { - if (debug) fprintf(stderr, "Decoding packet of %d bytes from %d to %d\n", len, enc, raw); + if (debug) fprintf(stderr, "Decoding packet of %d bytes from %d to %d\n", len, (int)enc, (int)raw); struct qt_proto_data_nacltai* d = (struct qt_proto_data_nacltai*)sess->protocol_data; int i; if (len < overhead) { @@ -140,7 +140,7 @@ } len -= overhead; taia_unpack((char*)(enc + crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES - noncelength), &d->cdtaic); - if (d->cdtaic.sec.x <= d->cdtaip.sec.x && d->cdtaic.nano <= d->cdtaip.nano && d->cdtaic.atto <= d->cdtaip.atto) { + if (d->cdtaic.sec.x <= d->cdtaip.sec.x && d->cdtaic.nano <= d->cdtaip.nano && d->cdtaic.atto <= d->cdtaip.atto) { fprintf(stderr, "Timestamp going back, ignoring packet\n"); return 0; } @@ -151,7 +151,7 @@ return 0; } d->cdtaip = d->cdtaic; - if (debug) fprintf(stderr, "Decoded packet of %d bytes from %d to %d\n", len, enc, raw); + if (debug) fprintf(stderr, "Decoded packet of %d bytes from %d to %d\n", len, (int)enc, (int)raw); return len; }