Commit 67c2aec9 authored by Lev Walkin's avatar Lev Walkin
Browse files

enforsed compilation with -W -Werror

parent 51b67e09
0.8.11: 2004-Jun-05
* Enforsed stricter conformance with C standards.
0.8.10: 2004-Jun-02
* Added const qualifier where necessary.
......
......@@ -74,6 +74,8 @@ 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);
for(; size; buf_pos++, size--, buffer++) {
......
......@@ -133,13 +133,15 @@ check(T_t *tp, uint8_t *buf, int size, size_t consumed) {
&& strcmp(tp->b.choice.b2.buf, "z") == 0);
}
int buf_pos;
int buf_size;
size_t buf_pos;
size_t buf_size;
uint8_t *buf;
static int
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", buf_pos, (int)size, buf_size);
return -1;
......@@ -184,10 +186,10 @@ compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) {
}
static void
partial_read(uint8_t *buf, int size) {
partial_read(uint8_t *buf, size_t size) {
T_t t, *tp;
ber_dec_rval_t rval;
int i1, i2;
size_t i1, i2;
uint8_t *buf1 = alloca(size);
uint8_t *buf2 = alloca(size);
uint8_t *buf3 = alloca(size);
......@@ -203,11 +205,11 @@ partial_read(uint8_t *buf, int size) {
for(i1 = 0; i1 < size; i1++) {
for(i2 = i1; i2 < size; i2++) {
uint8_t *chunk1 = buf;
int size1 = i1;
size_t size1 = i1;
uint8_t *chunk2 = buf + size1;
int size2 = i2 - i1;
size_t size2 = i2 - i1;
uint8_t *chunk3 = buf + size1 + size2;
int size3 = size - size1 - size2;
size_t size3 = size - size1 - size2;
fprintf(stderr, "\n%d:{%d, %d, %d}...\n",
size, size1, size2, size3);
......
......@@ -151,13 +151,15 @@ check(T_t *tp, uint8_t *buf, int size, size_t consumed) {
*/
}
int buf_pos;
int buf_size;
size_t buf_pos;
size_t buf_size;
uint8_t *buf;
static int
buf_fill(const void *buffer, size_t size, void *app_key) {
(void)app_key; /* Unused argument */
if(buf_pos + size > buf_size) {
fprintf(stderr, "%d + %d > %d\n", buf_pos, (int)size, buf_size);
return -1;
......@@ -202,10 +204,10 @@ compare(T_t *tp, uint8_t *cmp_buf, int cmp_buf_size) {
}
static void
partial_read(uint8_t *buf, int size) {
partial_read(uint8_t *buf, size_t size) {
T_t t, *tp;
ber_dec_rval_t rval;
int i1, i2;
size_t i1, i2;
uint8_t *buf1 = alloca(size);
uint8_t *buf2 = alloca(size);
uint8_t *buf3 = alloca(size);
......@@ -221,11 +223,11 @@ partial_read(uint8_t *buf, int size) {
for(i1 = 0; i1 < size; i1++) {
for(i2 = i1; i2 < size; i2++) {
uint8_t *chunk1 = buf;
int size1 = i1;
size_t size1 = i1;
uint8_t *chunk2 = buf + size1;
int size2 = i2 - i1;
size_t size2 = i2 - i1;
uint8_t *chunk3 = buf + size1 + size2;
int size3 = size - size1 - size2;
size_t size3 = size - size1 - size2;
fprintf(stderr, "\n%d:{%d, %d, %d}...\n",
size, size1, size2, size3);
......
......@@ -1650,7 +1650,7 @@ fi
# Define the identity of the package.
PACKAGE=asn1c
VERSION=0.8.10
VERSION=0.8.11
cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
......@@ -4756,7 +4756,7 @@ esac
# Check whether --enable-autoconf or --disable-autoconf was given.
if test "${enable_autoconf+set}" = set; then
enableval="$enable_autoconf"
ADD_CFLAGS="-Werror"
ADD_CFLAGS="-Werror -W"
fi;
......
......@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(libasn1parser/asn1p_y.y)
AC_CANONICAL_SYSTEM
AC_PREREQ(2.53)
AM_INIT_AUTOMAKE(asn1c, 0.8.10)
AM_INIT_AUTOMAKE(asn1c, 0.8.11)
AC_SUBST(PATH)
......@@ -45,7 +45,7 @@ esac
AC_ARG_ENABLE(autoconf,
[ --enable-Werror abort compilation after any C compiler warning],
ADD_CFLAGS="-Werror")
ADD_CFLAGS="-Werror -W")
AC_SUBST(ADD_CFLAGS)
dnl Add these flags if we're using GCC.
......
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