Commit b1f4f33a authored by Lev Walkin's avatar Lev Walkin

remove gcc-7 compiler warnings

parent 0afbd325
......@@ -13,12 +13,9 @@ static int buf_offset;
static int
buf_writer(const void *buffer, size_t size, void *app_key) {
char *b, *bend;
(void)app_key;
assert(buf_offset + size < sizeof(buf));
memcpy(buf + buf_offset, buffer, size);
b = buf + buf_offset;
bend = b + size;
buf_offset += size;
return 0;
}
......
......@@ -39,13 +39,13 @@ static size_t buf_offset;
static int
_buf_writer(const void *buffer, size_t size, void *app_key) {
unsigned char *b, *bend;
(void)app_key;
assert(buf_offset + size < sizeof(buf));
memcpy(buf + buf_offset, buffer, size);
#ifdef EMIT_ASN_DEBUG
unsigned char *b, *bend;
b = buf + buf_offset;
bend = b + size;
#ifdef EMIT_ASN_DEBUG
fprintf(stderr, "=> [");
for(; b < bend; b++) {
if(*b >= 32 && *b < 127 && *b != '%')
......@@ -97,6 +97,8 @@ save_object_as(PDU_t *st, enum expectation exp, enum enctype how) {
rval = xer_encode(&asn_DEF_PDU, st, XER_F_CANONICAL,
_buf_writer, 0);
break;
default:
assert(!"Unreachable");
}
if (rval.encoded == -1) {
......@@ -173,6 +175,8 @@ load_object_from(const char *fname, enum expectation expectation, unsigned char
case AS_DER:
case AS_CXER:
assert(!"DER or CXER not supported for load");
default:
assert(!"Unreachable");
}
fbuf_offset += rval.consumed;
fbuf_left -= rval.consumed;
......
......@@ -39,13 +39,13 @@ static size_t buf_offset;
static int
_buf_writer(const void *buffer, size_t size, void *app_key) {
unsigned char *b, *bend;
(void)app_key;
assert(buf_offset + size < sizeof(buf));
memcpy(buf + buf_offset, buffer, size);
#ifdef EMIT_ASN_DEBUG
unsigned char *b, *bend;
b = buf + buf_offset;
bend = b + size;
#ifdef EMIT_ASN_DEBUG
fprintf(stderr, "=> [");
for(; b < bend; b++) {
if(*b >= 32 && *b < 127 && *b != '%')
......@@ -97,6 +97,8 @@ save_object_as(PDU_t *st, enum expectation exp, enum enctype how) {
rval = xer_encode(&asn_DEF_PDU, st, XER_F_CANONICAL,
_buf_writer, 0);
break;
default:
assert(!"Unreachable");
}
if (rval.encoded == -1) {
......@@ -173,6 +175,8 @@ load_object_from(const char *fname, enum expectation expectation, unsigned char
case AS_DER:
case AS_CXER:
assert(!"Unexpected DER or CXER load request");
default:
assert(!"Unreachable");
}
fbuf_offset += rval.consumed;
fbuf_left -= rval.consumed;
......
......@@ -29,13 +29,13 @@ static int buf_offset;
static int
_buf_writer(const void *buffer, size_t size, void *app_key) {
unsigned char *b, *bend;
(void)app_key;
assert(buf_offset + size < sizeof(buf));
memcpy(buf + buf_offset, buffer, size);
#ifdef EMIT_ASN_DEBUG
unsigned char *b, *bend;
b = buf + buf_offset;
bend = b + size;
#ifdef EMIT_ASN_DEBUG
fprintf(stderr, "=> [");
for(; b < bend; b++) {
if(*b >= 32 && *b < 127 && *b != '%')
......@@ -78,6 +78,8 @@ save_object_as(PDU_t *st, enum enctype how) {
rval = xer_encode(&asn_DEF_PDU, st, XER_F_BASIC,
_buf_writer, 0);
break;
default:
assert(!"Unreachable");
}
if (rval.encoded == -1) {
......@@ -177,6 +179,8 @@ load_object_from(const char *fname, unsigned char *fbuf, size_t size, enum encty
}
}
break;
default:
assert(!"Unreachable");
}
fbuf_offset += rval.consumed;
fbuf_left -= rval.consumed;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment