clean-up; removed unnecessary field from type descriptor
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@400 59561ff5-6e30-0410-9f3c-9617f08c8826
diff --git a/skeletons/BIT_STRING.c b/skeletons/BIT_STRING.c
index 274dec9..e0e2507 100644
--- a/skeletons/BIT_STRING.c
+++ b/skeletons/BIT_STRING.c
@@ -4,6 +4,7 @@
*/
#include <asn_internal.h>
#include <BIT_STRING.h>
+#include <asn_internal.h>
/*
* BIT STRING basic type description.
@@ -27,9 +28,8 @@
asn1_DEF_BIT_STRING_tags, /* Same as above */
sizeof(asn1_DEF_BIT_STRING_tags)
/ sizeof(asn1_DEF_BIT_STRING_tags[0]),
- -1, /* Both ways are fine */
0, 0, /* No members */
- (void *)-1 /* Special indicator that this is a BIT STRING */
+ (void *)1 /* Special indicator that this is a BIT STRING */
};
/*
@@ -144,9 +144,10 @@
(void)td; /* Unused argument */
- if(!st || !st->buf) return cb("<absent>", 8, app_key);
+ if(!st || !st->buf)
+ return (cb("<absent>", 8, app_key) < 0) ? -1 : 0;
- ilevel += 4;
+ ilevel++;
buf = st->buf;
end = buf + st->size;
@@ -156,12 +157,9 @@
for(buf++; buf < end; buf++) {
if(((buf - st->buf) - 1) % 16 == 0 && (st->size > 17)
&& buf != st->buf+1) {
- int i;
- /* Indentation */
- if(cb("\n", 1, app_key)) return -1;
- for(i = 0; i < ilevel; i++) cb(" ", 1, app_key);
+ _i_INDENT(1);
/* Dump the string */
- if(cb(scratch, p - scratch, app_key)) return -1;
+ if(cb(scratch, p - scratch, app_key) < 0) return -1;
p = scratch;
}
*p++ = h2c[*buf >> 4];
@@ -173,13 +171,11 @@
p--; /* Eat the tailing space */
if((st->size > 17)) {
- int i;
- if(cb("\n", 1, app_key)) return -1;
- for(i = 0; i < ilevel; i++) cb(" ", 1, app_key);
+ _i_INDENT(1);
}
/* Dump the incomplete 16-bytes row */
- if(cb(scratch, p - scratch, app_key))
+ if(cb(scratch, p - scratch, app_key) < 0)
return -1;
}