Added splint script, and started splinting...
This commit is contained in:
Executable
+13
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# splint is a static code checker
|
||||||
|
[ -x /usr/bin/splint ] || exit 0
|
||||||
|
|
||||||
|
INCLUDES="-Iinclude -Idemo/handler -Idemo/object -Iports/linux"
|
||||||
|
|
||||||
|
directory=${1-`pwd`}
|
||||||
|
for filename in $( find $directory -name '*.c' )
|
||||||
|
do
|
||||||
|
echo splinting ${filename}
|
||||||
|
/usr/bin/splint ${INCLUDES} ${filename}
|
||||||
|
done
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ int abort_decode_service_request(uint8_t * apdu,
|
|||||||
{
|
{
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
if (apdu_len) {
|
if (apdu_len > 0) {
|
||||||
if (invoke_id)
|
if (invoke_id)
|
||||||
*invoke_id = apdu[0];
|
*invoke_id = apdu[0];
|
||||||
if (abort_reason)
|
if (abort_reason)
|
||||||
@@ -86,7 +86,7 @@ int abort_decode_apdu(uint8_t * apdu,
|
|||||||
if (!apdu)
|
if (!apdu)
|
||||||
return -1;
|
return -1;
|
||||||
/* optional checking - most likely was already done prior to this call */
|
/* optional checking - most likely was already done prior to this call */
|
||||||
if (apdu_len) {
|
if (apdu_len > 0) {
|
||||||
if ((apdu[0] & 0xF0) != PDU_TYPE_ABORT)
|
if ((apdu[0] & 0xF0) != PDU_TYPE_ABORT)
|
||||||
return -1;
|
return -1;
|
||||||
if (apdu[0] & 1)
|
if (apdu[0] & 1)
|
||||||
|
|||||||
@@ -116,9 +116,7 @@ void apdu_set_unrecognized_service_handler_handler(confirmed_function
|
|||||||
/* Unconfirmed Function Handlers */
|
/* Unconfirmed Function Handlers */
|
||||||
/* If they are not set, they are not handled */
|
/* If they are not set, they are not handled */
|
||||||
static unconfirmed_function
|
static unconfirmed_function
|
||||||
Unconfirmed_Function[MAX_BACNET_UNCONFIRMED_SERVICE] = {
|
Unconfirmed_Function[MAX_BACNET_UNCONFIRMED_SERVICE];
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
void apdu_set_unconfirmed_handler(BACNET_UNCONFIRMED_SERVICE
|
void apdu_set_unconfirmed_handler(BACNET_UNCONFIRMED_SERVICE
|
||||||
service_choice, unconfirmed_function pFunction)
|
service_choice, unconfirmed_function pFunction)
|
||||||
|
|||||||
Reference in New Issue
Block a user