diff --git a/bacnet-stack/splint.sh b/bacnet-stack/splint.sh index f091b139..d647259a 100755 --- a/bacnet-stack/splint.sh +++ b/bacnet-stack/splint.sh @@ -1,6 +1,9 @@ #!/bin/sh # splint is a static code checker -[ -x /usr/bin/splint ] || exit 0 + +SPLINT=/usr/bin/splint + +[ -x ${SPLINT} ] || exit 0 INCLUDES="-Iinclude -Iports/linux" SETTINGS="-castfcnptr -fullinitblock -initallelements -weak +posixlib" @@ -14,6 +17,6 @@ directory=${1-`pwd`}/src for filename in $( find $directory -name '*.c' ) do echo splinting ${filename} - /usr/bin/splint ${filename} + ${SPLINT} ${filename} done diff --git a/bacnet-stack/src/apdu.c b/bacnet-stack/src/apdu.c index fa91e80e..69935230 100644 --- a/bacnet-stack/src/apdu.c +++ b/bacnet-stack/src/apdu.c @@ -169,7 +169,7 @@ bool apdu_service_supported( /** Function to translate a SERVICE_SUPPORTED_ enum to its SERVICE_CONFIRMED_ * or SERVICE_UNCONFIRMED_ index. * Useful with the bactext_confirmed_service_name() functions. - * + * * @param service_supported [in] The SERVICE_SUPPORTED_ enum value to convert. * @param index [out] The SERVICE_CONFIRMED_ or SERVICE_UNCONFIRMED_ index, * if found. @@ -190,7 +190,7 @@ bool apdu_service_supported_to_index( for (i = 0; i < MAX_BACNET_CONFIRMED_SERVICE; i++) { if (confirmed_service_supported[i] == service_supported) { found = true; - *index = i; + *index = (size_t)i; *bIsConfirmed = true; break; } @@ -201,7 +201,7 @@ bool apdu_service_supported_to_index( for (i = 0; i < MAX_BACNET_UNCONFIRMED_SERVICE; i++) { if (unconfirmed_service_supported[i] == service_supported) { found = true; - *index = i; + *index = (size_t)i; break; } } @@ -380,7 +380,7 @@ void apdu_handler( /* PDU Type */ switch (apdu[0] & 0xF0) { case PDU_TYPE_CONFIRMED_SERVICE_REQUEST: - len = apdu_decode_confirmed_service_request(&apdu[0], /* APDU data */ + len = (int)apdu_decode_confirmed_service_request(&apdu[0], apdu_len, &service_data, &service_choice, &service_request, &service_request_len); /* When network communications are completely disabled,