Commit 4ce78cae authored by Lev Walkin's avatar Lev Walkin
Browse files

avoided compilation warnings on gcc 3.3.x systems

parent c7d17be4
0.9.2: 2004-Aug-24
* Indirect references in constraints resolver code fixed.
* Avoided compilation warning on gcc 3.3.3 systems.
0.9.1: 2004-Aug-23
* Documentation updated: doc/asn1c-usage.pdf
......
......@@ -43,26 +43,8 @@ CFLAGS=\${COMMON_FLAGS} ${CFLAGS}
CXXFLAGS=\${COMMON_FLAGS} ${CXXFLAGS}
all: check-executable
check-executable: compiled-module object-files
\$(CC) \$(CFLAGS) -o check-executable *.o
# Cannot track dependencies automatically because files are not known beforehand
object-files: *.c*
@for sfile in *.c; do \\
ofile=\`echo "\$\$sfile" | sed -e 's/\.c[c]*\$\$/.o/'\`; \\
if [ "\$\$sfile" -nt "\$\$ofile" ]; then \\
echo "\$(CC) \$(CFLAGS) -o \$\$ofile -c \$\$sfile"; \\
\$(CC) \$(CFLAGS) -o \$\$ofile -c \$\$sfile; \\
fi; \\
done
@for sfile in *.cc; do \\
ofile=\`echo "\$\$sfile" | sed -e 's/\.c[c]*\$\$/.o/'\`; \\
if [ "\$\$sfile" -nt "\$\$ofile" ]; then \\
echo "\$(CXX) \$(CXXFLAGS) -o \$\$ofile -c \$\$sfile";\\
\$(CXX) \$(CXXFLAGS) -o \$\$ofile -c \$\$sfile; \\
fi; \\
done
@touch object-files
check-executable: compiled-module *.c*
\$(CC) \$(CFLAGS) -o check-executable *.c*
# Compile the corresponding .asn1 spec.
compiled-module: ${asn_module} ../../asn1c
......
......@@ -3,7 +3,7 @@ AC_INIT(libasn1parser/asn1p_y.y)
AC_CANONICAL_BUILD
AC_CANONICAL_TARGET
AC_PREREQ(2.53)
AM_INIT_AUTOMAKE(asn1c, 0.9.1)
AM_INIT_AUTOMAKE(asn1c, 0.9.2)
AC_SUBST(PATH)
......@@ -40,14 +40,14 @@ AM_PROG_LEX
dnl *** Building mingw32 with cygwin compiler ***
case "$host_os" in
cygwin*)
CFLAGS="$CFLAGS -DWIN32"
dnl CFLAGS="$CFLAGS -DWIN32"
case "$target" in
*mingw*)
CC="$CC -mno-cygwin"
esac
;;
mingw* | p32*)
CFLAGS="$CFLAGS -DWIN32"
dnl CFLAGS="$CFLAGS -DWIN32"
;;
esac
......
......@@ -61,7 +61,7 @@ BOOLEAN_decode_ber(asn1_TYPE_descriptor_t *td,
ASN_DEBUG("Boolean length is %d bytes", (int)length);
(char *)buf_ptr += rval.consumed;
buf_ptr = ((char *)buf_ptr) + rval.consumed;
size -= rval.consumed;
if(length > (ber_tlv_len_t)size) {
rval.code = RC_WMORE;
......
......@@ -67,7 +67,7 @@ INTEGER_decode_ber(asn1_TYPE_descriptor_t *td,
/*
* Make sure we have this length.
*/
(char *)buf_ptr += rval.consumed;
buf_ptr = ((char *)buf_ptr) + rval.consumed;
size -= rval.consumed;
if(length > (ber_tlv_len_t)size) {
rval.code = RC_WMORE;
......
......@@ -74,7 +74,7 @@ NativeInteger_decode_ber(asn1_TYPE_descriptor_t *td,
/*
* Make sure we have this length.
*/
(char *)buf_ptr += rval.consumed;
buf_ptr = ((char *)buf_ptr) + rval.consumed;
size -= rval.consumed;
if(length > (ber_tlv_len_t)size) {
rval.code = RC_WMORE;
......
......@@ -332,7 +332,7 @@ OBJECT_IDENTIFIER_get_arcs(OBJECT_IDENTIFIER_t *oid, void *arcs,
*(unsigned char *)((char *)arcs
+ ((*(char *)&LE)?0:(arc_type_size - 1)))
= first_arc;
(char *)arcs += arc_type_size;
arcs = ((char *)arcs) + arc_type_size;
}
/* Decode, if has space */
......@@ -342,7 +342,7 @@ OBJECT_IDENTIFIER_get_arcs(OBJECT_IDENTIFIER_t *oid, void *arcs,
arcs, arc_type_size))
return -1;
startn = i + 1;
(char *)arcs += arc_type_size;
arcs = ((char *)arcs) + arc_type_size;
add = 0;
}
num_arcs++;
......@@ -538,7 +538,7 @@ OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *oid, void *arcs, unsigned int ar
*/
/* Copy the second (1'st) arcs[1] into the first_value */
*fv++ = 0;
(char *)arcs += arc_type_size;
arcs = ((char *)arcs) + arc_type_size;
if(isLittleEndian) {
uint8_t *aend = (unsigned char *)arcs - 1;
uint8_t *a1 = (unsigned char *)arcs + arc_type_size - 1;
......@@ -567,8 +567,9 @@ OBJECT_IDENTIFIER_set_arcs(OBJECT_IDENTIFIER_t *oid, void *arcs, unsigned int ar
/*
* Save the rest of arcs.
*/
for((char *)arcs += arc_type_size, i = 2;
i < arc_slots; i++, (char *)arcs += arc_type_size) {
for(arcs = ((char *)arcs) + arc_type_size, i = 2;
i < arc_slots;
i++, arcs = ((char *)arcs) + arc_type_size) {
bp += OBJECT_IDENTIFIER_set_single_arc(bp,
arcs, arc_type_size, 0);
}
......
......@@ -37,11 +37,11 @@ asn1_TYPE_descriptor_t asn1_DEF_OCTET_STRING = {
#define NEXT_PHASE(ctx) _CH_PHASE(ctx, +1)
#define PREV_PHASE(ctx) _CH_PHASE(ctx, -1)
#define ADVANCE(num_bytes) do { \
size_t num = num_bytes; \
(char *)buf_ptr += num; \
size -= num; \
consumed_myself += num; \
#define ADVANCE(num_bytes) do { \
size_t num = num_bytes; \
buf_ptr = ((char *)buf_ptr) + num; \
size -= num; \
consumed_myself += num; \
} while(0)
#define RETURN(_code) do { \
......
......@@ -87,7 +87,7 @@ RELATIVE_OID_get_arcs(RELATIVE_OID_t *roid,
i - startn + 1, 0,
arcs, arc_type_size))
return -1;
(char *)arcs += arc_type_size;
arcs = ((char *)arcs) + arc_type_size;
num_arcs++;
}
......@@ -122,7 +122,7 @@ RELATIVE_OID_set_arcs(RELATIVE_OID_t *roid, void *arcs, unsigned int arc_type_si
/*
* Encode the arcs.
*/
for(i = 0; i < arcs_slots; i++, (char *)arcs += arc_type_size) {
for(i = 0; i < arcs_slots; i++, arcs = ((char *)arcs) + arc_type_size) {
bp += OBJECT_IDENTIFIER_set_single_arc(bp,
arcs, arc_type_size, 0);
}
......
......@@ -7,7 +7,7 @@
#define ADVANCE(num_bytes) do { \
size_t num = num_bytes; \
(char *)ptr += num; \
ptr = ((char *)ptr) + num; \
size -= num; \
consumed_myself += num; \
} while(0)
......
......@@ -87,7 +87,7 @@ ber_skip_length(int _is_constructed, void *ptr, size_t size) {
* Indefinite length!
*/
ASN_DEBUG("Skipping indefinite length");
for(skip = ll, (char *)ptr += ll, size -= ll;;) {
for(skip = ll, ptr = ((char *)ptr) + ll, size -= ll;;) {
ber_tlv_tag_t tag;
/* Fetch the tag */
......@@ -95,7 +95,7 @@ ber_skip_length(int _is_constructed, void *ptr, size_t size) {
if(tl <= 0) return tl;
ll = ber_skip_length(BER_TLV_CONSTRUCTED(ptr),
(char *)ptr + tl, size - tl);
((char *)ptr) + tl, size - tl);
if(ll <= 0) return ll;
skip += tl + ll;
......@@ -109,7 +109,7 @@ ber_skip_length(int _is_constructed, void *ptr, size_t size) {
&& ((uint8_t *)ptr)[1] == 0)
return skip;
(char *)ptr += tl + ll;
ptr = ((char *)ptr) + tl + ll;
size -= tl + ll;
}
......
......@@ -30,8 +30,8 @@ ber_fetch_tag(void *ptr, size_t size, ber_tlv_tag_t *tag_r) {
* Each octet contains 7 bits of useful information.
* The MSB is 0 if it is the last octet of the tag.
*/
for(val = 0, ((char *)ptr)++, skipped = 2;
skipped <= size; ((char *)ptr)++, skipped++) {
for(val = 0, ptr = ((char *)ptr) + 1, skipped = 2;
skipped <= size; ptr = ((char *)ptr) + 1, skipped++) {
unsigned int oct = *(uint8_t *)ptr;
if(oct & 0x80) {
val = (val << 7) | (oct & 0x7F);
......
......@@ -31,7 +31,7 @@
*/
#define ADVANCE(num_bytes) do { \
size_t num = num_bytes; \
(char *)ptr += num; \
ptr = ((char *)ptr) + num; \
size -= num; \
if(ctx->left >= 0) \
ctx->left -= num; \
......
......@@ -31,7 +31,7 @@
*/
#define ADVANCE(num_bytes) do { \
size_t num = num_bytes; \
(char *)ptr += num; \
ptr = ((char *)ptr) + num; \
size -= num; \
if(ctx->left >= 0) \
ctx->left -= num; \
......
......@@ -37,7 +37,7 @@
*/
#define ADVANCE(num_bytes) do { \
size_t num = num_bytes; \
(char *)ptr += num; \
ptr = ((char *)ptr) + num; \
size -= num; \
if(ctx->left >= 0) \
ctx->left -= num; \
......
......@@ -31,7 +31,7 @@
*/
#define ADVANCE(num_bytes) do { \
size_t num = num_bytes; \
(char *)ptr += num; \
ptr = ((char *)ptr) + num; \
size -= num; \
if(ctx->left >= 0) \
ctx->left -= num; \
......
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