From 61f0a0211d4d20b3fbcb0f4a9227c0ad13029e99 Mon Sep 17 00:00:00 2001 From: skarg Date: Wed, 17 Aug 2011 03:59:31 +0000 Subject: [PATCH] Splinted files and corrected splint errors. --- bacnet-stack/.splintrc | 2 +- bacnet-stack/splint.sh | 2 +- bacnet-stack/src/bacstr.c | 6 +++--- bacnet-stack/src/wpm.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bacnet-stack/.splintrc b/bacnet-stack/.splintrc index 13f20b7f..ef788775 100644 --- a/bacnet-stack/.splintrc +++ b/bacnet-stack/.splintrc @@ -1 +1 @@ --Iinclude -Iports/linux -castfcnptr -fullinitblock -initallelements -weak +posixlib +-Iinclude -Idemo/object -Iports/linux -castfcnptr -fullinitblock -initallelements -weak +posixlib diff --git a/bacnet-stack/splint.sh b/bacnet-stack/splint.sh index d647259a..58eb3912 100755 --- a/bacnet-stack/splint.sh +++ b/bacnet-stack/splint.sh @@ -5,7 +5,7 @@ SPLINT=/usr/bin/splint [ -x ${SPLINT} ] || exit 0 -INCLUDES="-Iinclude -Iports/linux" +INCLUDES="-Iinclude -Idemo/object -Iports/linux" SETTINGS="-castfcnptr -fullinitblock -initallelements -weak +posixlib" if [ ! -x .splintrc ] diff --git a/bacnet-stack/src/bacstr.c b/bacnet-stack/src/bacstr.c index 33832b04..3d02b79f 100644 --- a/bacnet-stack/src/bacstr.c +++ b/bacnet-stack/src/bacstr.c @@ -519,11 +519,11 @@ static const char trailingBytesForUTF8[256] = { it's hard to know how many characters there are! */ static int utf8_isvalid( const char *str, - int length) + size_t length) { const unsigned char *p, *pend = (unsigned char *) str + length; unsigned char c; - int ab; + size_t ab; for (p = (unsigned char *) str; p < pend; p++) { c = *p; @@ -538,7 +538,7 @@ static int utf8_isvalid( if ((c & 0xc0) != 0xc0) { return 0; } - ab = trailingBytesForUTF8[c]; + ab = (size_t)trailingBytesForUTF8[c]; if (length < ab) { return 0; } diff --git a/bacnet-stack/src/wpm.c b/bacnet-stack/src/wpm.c index c6eda70a..a2c184f2 100644 --- a/bacnet-stack/src/wpm.c +++ b/bacnet-stack/src/wpm.c @@ -58,7 +58,7 @@ int wpm_decode_object_id( } else return -1; - return len; + return (int)len; } @@ -102,7 +102,7 @@ int wpm_decode_object_property( if ((tag_number == 2) && (decode_is_opening_tag(&apdu[len - 1]))) { len--; wp_data->application_data_len = - bacapp_data_len(&apdu[len], apdu_len - len, + bacapp_data_len(&apdu[len], (unsigned)(apdu_len - len), wp_data->object_property); len++;