Commit 1715b32c authored by Lev Walkin's avatar Lev Walkin
Browse files

format and signedness mismatch fixes

parent 7f35fd8c
......@@ -43,7 +43,7 @@ check_xer(e_Enum2 eval, char *xer_string) {
xer_encode(&asn_DEF_Enum2, e, XER_F_CANONICAL, buf_writer, 0);
buf[buf_offset] = 0;
sprintf(buf2, "<Enum2>%s</Enum2>", xer_string);
printf("%ld -> %s == %s\n", eval, buf, buf2);
printf("%d -> %s == %s\n", eval, buf, buf2);
assert(0 == strcmp(buf, buf2));
}
......
......@@ -27,7 +27,7 @@ enum expectation {
};
static unsigned char buf[4096];
static int buf_offset;
static size_t buf_offset;
static int
_buf_writer(const void *buffer, size_t size, void *app_key) {
......@@ -44,7 +44,7 @@ _buf_writer(const void *buffer, size_t size, void *app_key) {
else
fprintf(stderr, "%%%02x", *b);
}
fprintf(stderr, "]:%ld\n", (long)size);
fprintf(stderr, "]:%zd\n", size);
buf_offset += size;
return 0;
}
......@@ -73,7 +73,7 @@ save_object_as(PDU_t *st, enum expectation exp, enum enctype how) {
assert(rval.encoded == -1);
else
assert(rval.encoded > 0);
fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset);
fprintf(stderr, "SAVED OBJECT IN SIZE %zd\n", buf_offset);
return;
case AS_DER:
rval = der_encode(&asn_DEF_PDU, st,
......@@ -97,14 +97,14 @@ save_object_as(PDU_t *st, enum expectation exp, enum enctype how) {
return;
}
fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset);
fprintf(stderr, "SAVED OBJECT IN SIZE %zd\n", buf_offset);
}
static PDU_t *
load_object_from(const char *fname, enum expectation expectation, char *fbuf, int size, enum enctype how) {
load_object_from(const char *fname, enum expectation expectation, char *fbuf, size_t size, enum enctype how) {
asn_dec_rval_t rval;
PDU_t *st = 0;
int csize = 1;
size_t csize = 1;
if(getenv("INITIAL_CHUNK_SIZE"))
csize = atoi(getenv("INITIAL_CHUNK_SIZE"));
......@@ -116,7 +116,7 @@ load_object_from(const char *fname, enum expectation expectation, char *fbuf, in
int fbuf_chunk = csize;
fprintf(stderr, "LOADING OBJECT OF SIZE %d FROM [%s] as %s,"
" chunks %d\n",
" chunks %zd\n",
size, fname, how==AS_PER?"PER":"XER", csize);
if(st) asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0);
......@@ -151,7 +151,7 @@ load_object_from(const char *fname, enum expectation expectation, char *fbuf, in
st = 0;
fprintf(stderr, "-> PER wants more\n");
} else {
fprintf(stderr, "-> PER ret %d/%d\n",
fprintf(stderr, "-> PER ret %d/%ld\n",
rval.code, rval.consumed);
/* uper_decode() returns _bits_ */
rval.consumed += 7;
......@@ -227,9 +227,8 @@ xer_encoding_equal(char *obuf, size_t osize, char *nbuf, size_t nsize) {
}
static void
process_XER_data(const char *fname, enum expectation expectation, char *fbuf, int size) {
process_XER_data(const char *fname, enum expectation expectation, char *fbuf, size_t size) {
PDU_t *st;
int ret;
st = load_object_from(fname, expectation, fbuf, size, AS_XER);
if(!st) return;
......@@ -286,7 +285,6 @@ process(const char *fname) {
char fbuf[4096];
char *ext = strrchr(fname, '.');
enum expectation expectation;
int ret;
int rd;
FILE *fp;
......
......@@ -27,7 +27,7 @@ enum expectation {
};
static unsigned char buf[4096];
static int buf_offset;
static size_t buf_offset;
static int
_buf_writer(const void *buffer, size_t size, void *app_key) {
......@@ -44,7 +44,7 @@ _buf_writer(const void *buffer, size_t size, void *app_key) {
else
fprintf(stderr, "%%%02x", *b);
}
fprintf(stderr, "]:%ld\n", (long)size);
fprintf(stderr, "]:%zd\n", size);
buf_offset += size;
return 0;
}
......@@ -73,7 +73,7 @@ save_object_as(PDU_t *st, enum expectation exp, enum enctype how) {
assert(rval.encoded == -1);
else
assert(rval.encoded > 0);
fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset);
fprintf(stderr, "SAVED OBJECT IN SIZE %zd\n", buf_offset);
return;
case AS_DER:
rval = der_encode(&asn_DEF_PDU, st,
......@@ -97,14 +97,14 @@ save_object_as(PDU_t *st, enum expectation exp, enum enctype how) {
return;
}
fprintf(stderr, "SAVED OBJECT IN SIZE %d\n", buf_offset);
fprintf(stderr, "SAVED OBJECT IN SIZE %zd\n", buf_offset);
}
static PDU_t *
load_object_from(const char *fname, enum expectation expectation, char *fbuf, int size, enum enctype how) {
load_object_from(const char *fname, enum expectation expectation, char *fbuf, size_t size, enum enctype how) {
asn_dec_rval_t rval;
PDU_t *st = 0;
int csize = 1;
size_t csize = 1;
if(getenv("INITIAL_CHUNK_SIZE"))
csize = atoi(getenv("INITIAL_CHUNK_SIZE"));
......@@ -116,7 +116,7 @@ load_object_from(const char *fname, enum expectation expectation, char *fbuf, in
int fbuf_chunk = csize;
fprintf(stderr, "LOADING OBJECT OF SIZE %d FROM [%s] as %s,"
" chunks %d\n",
" chunks %zd\n",
size, fname, how==AS_PER?"PER":"XER", csize);
if(st) asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0);
......@@ -151,7 +151,7 @@ load_object_from(const char *fname, enum expectation expectation, char *fbuf, in
st = 0;
fprintf(stderr, "-> PER wants more\n");
} else {
fprintf(stderr, "-> PER ret %d/%d\n",
fprintf(stderr, "-> PER ret %d/%zd\n",
rval.code, rval.consumed);
/* uper_decode() returns _bits_ */
rval.consumed += 7;
......@@ -227,9 +227,8 @@ xer_encoding_equal(char *obuf, size_t osize, char *nbuf, size_t nsize) {
}
static void
process_XER_data(const char *fname, enum expectation expectation, char *fbuf, int size) {
process_XER_data(const char *fname, enum expectation expectation, char *fbuf, ssize_t size) {
PDU_t *st;
int ret;
st = load_object_from(fname, expectation, fbuf, size, AS_XER);
if(!st) return;
......@@ -286,7 +285,6 @@ process(const char *fname) {
char fbuf[4096];
char *ext = strrchr(fname, '.');
enum expectation expectation;
int ret;
int rd;
FILE *fp;
......
......@@ -34,7 +34,7 @@ _buf_writer(const void *buffer, size_t size, void *app_key) {
else
fprintf(stderr, "%%%02x", *b);
}
fprintf(stderr, "]:%ld\n", (long)size);
fprintf(stderr, "]:%zd\n", size);
buf_offset += size;
return 0;
}
......@@ -82,10 +82,10 @@ save_object_as(PDU_t *st, enum enctype how) {
}
static PDU_t *
load_object_from(const char *fname, char *fbuf, int size, enum enctype how, int mustfail) {
load_object_from(const char *fname, char *fbuf, size_t size, enum enctype how, int mustfail) {
asn_dec_rval_t rval;
PDU_t *st = 0;
int csize = 1;
ssize_t csize = 1;
if(getenv("INITIAL_CHUNK_SIZE"))
csize = atoi(getenv("INITIAL_CHUNK_SIZE"));
......@@ -96,8 +96,8 @@ load_object_from(const char *fname, char *fbuf, int size, enum enctype how, int
int fbuf_left = size;
int fbuf_chunk = csize;
fprintf(stderr, "LOADING OBJECT OF SIZE %d FROM [%s] as %s,"
" chunks %d\n",
fprintf(stderr, "LOADING OBJECT OF SIZE %zd FROM [%s] as %s,"
" chunks %zd\n",
size, fname, how==AS_PER?"PER":"XER", csize);
if(st) asn_DEF_PDU.free_struct(&asn_DEF_PDU, st, 0);
......@@ -132,7 +132,7 @@ load_object_from(const char *fname, char *fbuf, int size, enum enctype how, int
? fbuf_chunk : fbuf_left, 0, 0);
if(rval.code == RC_WMORE) {
if(fbuf_chunk == fbuf_left) {
fprintf(stderr, "-> PER decode error (%d bits of %d bytes (c=%d,l=%d)) \n", rval.consumed, size, fbuf_chunk, fbuf_left);
fprintf(stderr, "-> PER decode error (%zd bits of %zd bytes (c=%d,l=%d)) \n", rval.consumed, size, fbuf_chunk, fbuf_left);
rval.code = RC_FAIL;
rval.consumed += 7;
rval.consumed /= 8;
......@@ -147,7 +147,7 @@ load_object_from(const char *fname, char *fbuf, int size, enum enctype how, int
fprintf(stderr, "-> PER wants more\n");
}
} else {
fprintf(stderr, "-> PER ret %d/%d mf=%d\n",
fprintf(stderr, "-> PER ret %d/%zd mf=%d\n",
rval.code, rval.consumed, mustfail);
/* uper_decode() returns _bits_ */
rval.consumed += 7;
......@@ -174,7 +174,7 @@ load_object_from(const char *fname, char *fbuf, int size, enum enctype how, int
assert(rval.code == RC_OK);
if(how == AS_PER) {
fprintf(stderr, "[left %d, off %d, size %d]\n",
fprintf(stderr, "[left %d, off %d, size %zd]\n",
fbuf_left, fbuf_offset, size);
assert(fbuf_offset == size);
} else {
......@@ -225,7 +225,7 @@ xer_encoding_equal(char *obuf, size_t osize, char *nbuf, size_t nsize) {
}
static void
compare_with_data_out(const char *fname, char *buf, int size) {
compare_with_data_out(const char *fname, char *buf, size_t size) {
char outName[256];
char fbuf[1024];
size_t rd;
......@@ -269,7 +269,7 @@ compare_with_data_out(const char *fname, char *buf, int size) {
}
static void
process_XER_data(const char *fname, char *fbuf, int size) {
process_XER_data(const char *fname, char *fbuf, size_t size) {
PDU_t *st;
st = load_object_from(fname, fbuf, size, AS_XER, 0);
......
......@@ -26,7 +26,7 @@ main() {
printf("Checking uper_open_type_put():\n");
assert(0 == uper_open_type_put(&asn_DEF_T, 0, &t, &po));
assert(po.nbits == (-1 + sizeof(po.tmpspace)) * 8);
printf("po{nboff=%d; nbits=%d; buffer=%p; tmpspace=%p}\n",
printf("po{nboff=%zd; nbits=%zd; buffer=%p; tmpspace=%p}\n",
po.nboff, po.nbits, po.buffer, po.tmpspace);
/* One byte length and one byte 0x00 */
assert( (po.nboff == 8 && po.buffer == &po.tmpspace[1])
......
......@@ -17,8 +17,7 @@ verify(int testNo, T_t *ti) {
T_t *to = 0;
er = uper_encode_to_buffer(&asn_DEF_T, ti, buf, sizeof buf);
fprintf(stderr, "%d IN: %d => %d\n", testNo,
ti->present, (int)er.encoded);
fprintf(stderr, "%d IN: %d => %zd\n", testNo, ti->present, er.encoded);
assert(er.encoded >= 1 && er.encoded <= 8 * sizeof(buf));
rv = uper_decode(0, &asn_DEF_T, (void *)&to, buf, sizeof buf, 0, 0);
......
......@@ -45,7 +45,7 @@ buf2_fill(const void *buffer, size_t size, void *app_key) {
}
static void
check(int is_ok, uint8_t *buf, int size, size_t consumed) {
check(int is_ok, uint8_t *buf, size_t size, size_t consumed) {
T1_t t, *tp;
void *tpp = &tp;
asn_dec_rval_t rval;
......@@ -116,7 +116,7 @@ check(int is_ok, uint8_t *buf, int size, size_t consumed) {
}
static void
try_corrupt(uint8_t *buf, int size) {
try_corrupt(uint8_t *buf, size_t size) {
uint8_t *tmp;
int i;
......
......@@ -34,7 +34,7 @@ uint8_t buf1[] = {
};
static void
check(int is_ok, uint8_t *buf, int size, size_t consumed) {
check(int is_ok, uint8_t *buf, size_t size, size_t consumed) {
T_t t, *tp;
asn_dec_rval_t rval;
......@@ -42,8 +42,8 @@ check(int is_ok, uint8_t *buf, int size, size_t consumed) {
fprintf(stderr, "Buf %p\n", buf);
rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size);
fprintf(stderr, "Returned code %d, consumed %d\n",
(int)rval.code, (int)rval.consumed);
fprintf(stderr, "Returned code %d, consumed %zd\n",
(int)rval.code, rval.consumed);
if(is_ok) {
assert(rval.code == RC_OK);
......@@ -61,7 +61,7 @@ check(int is_ok, uint8_t *buf, int size, size_t consumed) {
}
static void
try_corrupt(uint8_t *buf, int size) {
try_corrupt(uint8_t *buf, size_t size) {
uint8_t *tmp;
int i;
......
......@@ -87,16 +87,16 @@ uint8_t buf1[] = {
};
static void
check(int is_ok, uint8_t *buf, int size, size_t consumed) {
check(int is_ok, uint8_t *buf, size_t size, size_t consumed) {
T_t t, *tp;
asn_dec_rval_t rval;
tp = memset(&t, 0, sizeof(t));
fprintf(stderr, "Buf %p (%d)\n", buf, (int)size);
fprintf(stderr, "Buf %p (%zd)\n", buf, size);
rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size);
fprintf(stderr, "Returned code %d, consumed %d, expected %d\n",
(int)rval.code, (int)rval.consumed, (int)consumed);
fprintf(stderr, "Returned code %d, consumed %zd, expected %zd\n",
(int)rval.code, rval.consumed, consumed);
if(is_ok) {
assert(rval.code == RC_OK);
......@@ -132,7 +132,7 @@ check(int is_ok, uint8_t *buf, int size, size_t consumed) {
|| t.h->size != 3
);
}
fprintf(stderr, "%d %d\n", (int)rval.consumed, (int)consumed);
fprintf(stderr, "%zd %zd\n", rval.consumed, consumed);
assert(rval.consumed <= consumed);
}
......@@ -140,7 +140,7 @@ check(int is_ok, uint8_t *buf, int size, size_t consumed) {
}
static void
try_corrupt(uint8_t *buf, int size, int allow_consume) {
try_corrupt(uint8_t *buf, size_t size, int allow_consume) {
uint8_t *tmp;
int i;
......
......@@ -142,7 +142,7 @@ uint8_t buf5[] = {
};
static void
check(int is_ok, uint8_t *buf, int size, size_t consumed) {
check(int is_ok, uint8_t *buf, size_t size, size_t consumed) {
T_t t, *tp;
asn_dec_rval_t rval;
......@@ -152,8 +152,8 @@ check(int is_ok, uint8_t *buf, int size, size_t consumed) {
fprintf(stderr, "Buf %p\n", buf);
rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size);
fprintf(stderr, "Returned code %d, consumed %d (out of %d)\n",
(int)rval.code, (int)rval.consumed, size);
fprintf(stderr, "Returned code %d, consumed %zd (out of %zd)\n",
(int)rval.code, rval.consumed, size);
if(is_ok) {
assert(rval.code == RC_OK);
......@@ -215,7 +215,7 @@ check_xer(uint8_t *buf, uint8_t size, char *xer_sample) {
}
static void
try_corrupt(uint8_t *buf, int size) {
try_corrupt(uint8_t *buf, size_t size) {
uint8_t *tmp;
int i;
......
......@@ -69,14 +69,14 @@ uint8_t buf1_reconstr[] = {
};
int buf_pos;
sie_t buf_pos;
static int bytes_compare(const void *bufferp, size_t size, void *key) {
const uint8_t *buffer = bufferp;
assert(buf_pos + size <= sizeof(buf1_reconstr));
(void)key; /* Unused argument */
fprintf(stderr, " writing %d (%d)\n", (int)size, buf_pos + (int)size);
fprintf(stderr, " writing %zd (%zd)\n", size, buf_pos + size);
for(; size; buf_pos++, size--, buffer++) {
if(buf1_reconstr[buf_pos] != *buffer) {
......@@ -94,7 +94,7 @@ static int bytes_compare(const void *bufferp, size_t size, void *key) {
}
static void
check(int is_ok, uint8_t *buf, int size, size_t consumed) {
check(int is_ok, uint8_t *buf, size_t size, size_t consumed) {
Forest_t t, *tp;
asn_dec_rval_t rval;
......@@ -177,7 +177,7 @@ check_xer(uint8_t *buf, uint8_t size, char *xer_sample) {
static void
try_corrupt(uint8_t *buf, int size) {
try_corrupt(uint8_t *buf, size_t size) {
uint8_t *tmp;
int i;
......
......@@ -123,15 +123,15 @@ uint8_t buf2_reconstr[] = {
};
static void
check(T_t *tp, uint8_t *buf, int size, size_t consumed) {
check(T_t *tp, uint8_t *buf, size_t size, size_t consumed) {
asn_dec_rval_t rval;
tp = memset(tp, 0, sizeof(*tp));
fprintf(stderr, "Buf %p (%d)\n", buf, (int)size);
fprintf(stderr, "Buf %p (%zd)\n", buf, size);
rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size);
fprintf(stderr, "Returned code %d, consumed %d\n",
(int)rval.code, (int)rval.consumed);
fprintf(stderr, "Returned code %d, consumed %zd\n",
(int)rval.code, rval.consumed);
assert(rval.code == RC_OK);
assert(rval.consumed == consumed);
......@@ -154,20 +154,20 @@ buf_fill(const void *buffer, size_t size, void *app_key) {
(void)app_key;
if(buf_pos + size > buf_size) {
fprintf(stderr, "%d + %d > %d\n",
(int)buf_pos, (int)size, (int)buf_size);
fprintf(stderr, "%zd + %zd > %zd\n",
buf_pos, size, buf_size);
return -1;
}
memcpy(buf + buf_pos, buffer, size);
buf_pos += size;
fprintf(stderr, " written %d (%d)\n", (int)size, (int)buf_pos);
fprintf(stderr, " written %zd (%zd)\n", size, buf_pos);
return 0;
}
static void
compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) {
compare(T_t *tp, uint8_t *cmp_buf, size_t cmp_buf_size) {
asn_enc_rval_t erval;
int i;
......@@ -181,7 +181,7 @@ compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) {
erval = der_encode(&asn_DEF_T, tp, buf_fill, 0);
assert(erval.encoded != -1);
if(erval.encoded != cmp_buf_size) {
printf("%d != %d\n", erval.encoded, cmp_buf_size);
printf("%zd != %zd\n", erval.encoded, cmp_buf_size);
}
assert(erval.encoded == cmp_buf_size);
for(i = 0; i < cmp_buf_size; i++) {
......@@ -223,8 +223,8 @@ partial_read(uint8_t *buf, size_t size) {
uint8_t *chunk3 = buf + size1 + size2;
size_t size3 = size - size1 - size2;
fprintf(stderr, "\n%d:{%d, %d, %d}...\n",
(int)size, (int)size1, (int)size2, (int)size3);
fprintf(stderr, "\n%zd:{%zd, %zd, %zd}...\n",
size, size1, size2, size3);
memset(buf1, 0, size);
memset(buf2, 0, size);
......@@ -235,7 +235,7 @@ partial_read(uint8_t *buf, size_t size) {
tp = memset(&t, 0, sizeof(t));
fprintf(stderr, "=> Chunk 1 (%d):\n", (int)size1);
fprintf(stderr, "=> Chunk 1 (%zd):\n", size1);
rval = ber_decode(0, &asn_DEF_T, (void **)&tp,
buf1, size1);
assert(rval.code == RC_WMORE);
......@@ -247,7 +247,7 @@ partial_read(uint8_t *buf, size_t size) {
size2 += leftover;
}
fprintf(stderr, "=> Chunk 2 (%d):\n", (int)size2);
fprintf(stderr, "=> Chunk 2 (%zd):\n", size2);
rval = ber_decode(0, &asn_DEF_T, (void **)&tp,
buf2, size2);
assert(rval.code == RC_WMORE);
......@@ -259,7 +259,7 @@ partial_read(uint8_t *buf, size_t size) {
size3 += leftover;
}
fprintf(stderr, "=> Chunk 3 (%d):\n", (int)size3);
fprintf(stderr, "=> Chunk 3 (%zd):\n", size3);
rval = ber_decode(0, &asn_DEF_T, (void **)&tp,
buf3, size3);
assert(rval.code == RC_OK);
......@@ -271,7 +271,7 @@ partial_read(uint8_t *buf, size_t size) {
}
static char xer_buf[128];
static int xer_off;
static size_t xer_off;
static int
xer_cb(const void *buffer, size_t size, void *key) {
......@@ -287,7 +287,7 @@ check_xer(uint8_t *buf, uint8_t size, char *xer_sample) {
T_t *tp = 0;
asn_dec_rval_t rval;
asn_enc_rval_t er;
int xer_sample_len = strlen(xer_sample);
size_t xer_sample_len = strlen(xer_sample);
rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size);
assert(rval.code == RC_OK);
......@@ -298,7 +298,7 @@ check_xer(uint8_t *buf, uint8_t size, char *xer_sample) {
er = xer_encode(&asn_DEF_T, tp, XER_F_CANONICAL, xer_cb, 0);
assert(xer_off);
xer_buf[xer_off] = 0;
printf("[%s] (%d/%d) vs [%s] (%d)\n",
printf("[%s] (%zd/%zd) vs [%s] (%zd)\n",
xer_buf, er.encoded, xer_off, xer_sample, xer_sample_len);
assert(er.encoded == xer_off);
assert(xer_off == xer_sample_len);
......
......@@ -130,16 +130,16 @@ uint8_t buf2_reconstr[] = {
static void
check(T_t *tp, uint8_t *buf, int size, size_t consumed) {
check(T_t *tp, uint8_t *buf, size_t size, size_t consumed) {
asn_dec_rval_t rval;
int ret;
tp = memset(tp, 0, sizeof(*tp));
fprintf(stderr, "Buf %p (%d)\n", (int)buf, (int)size);
fprintf(stderr, "Buf %p (%zd)\n", buf, size);
rval = ber_decode(0, &asn_DEF_T, (void **)&tp, buf, size);
fprintf(stderr, "Returned code %d, consumed %d\n",
(int)rval.code, (int)rval.consumed);
fprintf(stderr, "Returned code %d, consumed %zd\n",
(int)rval.code, rval.consumed);
assert(rval.code == RC_OK);
assert(rval.consumed == consumed);
......@@ -170,20 +170,20 @@ buf_fill(const void *bufp, size_t size, void *app_key) {
(void)app_key; /* Unused argument */
if(buf_pos + size > buf_size) {
fprintf(stderr, "%d + %d > %d\n",
(int)buf_pos, (int)size, (int)buf_size);
fprintf(stderr, "%zd + %zd > %zd\n",
buf_pos, size, buf_size);
return -1;
}
memcpy(buffer + buf_pos, bufp, size);
buf_pos += size;
fprintf(stderr, " written %d (%d)\n", (int)size, (int)buf_pos);
fprintf(stderr, " written %zd (%zd)\n", size, buf_pos);
return 0;
}
static void
compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) {
compare(T_t *tp, uint8_t *cmp_buf, size_t cmp_buf_size) {
asn_enc_rval_t erval;
int i;
......@@ -197,7 +197,7 @@ compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) {
erval = der_encode(&asn_DEF_T, tp, buf_fill, 0);
assert(erval.encoded != -1);
if(erval.encoded != cmp_buf_size) {
printf("%d != %d\n", (int)erval.encoded, (int)cmp_buf_size);
printf("%zd != %zd\n", erval.encoded, cmp_buf_size);
}
assert(erval.encoded == cmp_buf_size);
for(i = 0; i < cmp_buf_size; i++) {
......@@ -239,8 +239,8 @@ partial_read(uint8_t *buf, size_t size) {
uint8_t *chunk3 = buf + size1 + size2;
size_t size3 = size - size1 - size2;
fprintf(stderr, "\n%d:{%d, %d, %d}...\n",
(int)size, (int)size1, (int)size2, (int)size3);
fprintf(stderr, "\n%zd:{%zd, %zd, %zd}...\n",
size, size1, size2, size3);
memset(buf1, 0, size);
memset(buf2, 0, size);
......@@ -251,7 +251,7 @@ partial_read(uint8_t *buf, size_t size) {
tp = memset(&t, 0, sizeof(t));
fprintf(stderr, "=> Chunk 1 (%d):\n", (int)size1);
fprintf(stderr, "=> Chunk 1 (%zd):\n", size1);
rval = ber_decode(0, &asn_DEF_T, (