Fixed EOL and performed standard indentation.

This commit is contained in:
skarg
2010-09-16 22:00:47 +00:00
parent 092834b2d9
commit 9569f2c536
53 changed files with 523 additions and 530 deletions
+4 -2
View File
@@ -149,7 +149,8 @@ static struct Address_Cache_Entry *address_remove_oldest(
pMatch = Address_Cache;
while (pMatch <= &Address_Cache[MAX_ADDRESS_CACHE - 1]) {
if ((pMatch->Flags & (BAC_ADDR_IN_USE | BAC_ADDR_BIND_REQ |
if ((pMatch->
Flags & (BAC_ADDR_IN_USE | BAC_ADDR_BIND_REQ |
BAC_ADDR_STATIC)) == BAC_ADDR_IN_USE) {
if (pMatch->TimeToLive <= ulTime) { /* Shorter lived entry found */
ulTime = pMatch->TimeToLive;
@@ -168,7 +169,8 @@ static struct Address_Cache_Entry *address_remove_oldest(
/* Second pass - try in use and un bound as last resort */
pMatch = Address_Cache;
while (pMatch <= &Address_Cache[MAX_ADDRESS_CACHE - 1]) {
if ((pMatch->Flags & (BAC_ADDR_IN_USE | BAC_ADDR_BIND_REQ |
if ((pMatch->
Flags & (BAC_ADDR_IN_USE | BAC_ADDR_BIND_REQ |
BAC_ADDR_STATIC)) ==
((uint8_t) (BAC_ADDR_IN_USE | BAC_ADDR_BIND_REQ))) {
if (pMatch->TimeToLive <= ulTime) { /* Shorter lived entry found */
+13 -13
View File
@@ -820,7 +820,7 @@ int bacapp_data_len(
#ifdef BACAPP_PRINT_ENABLED
bool bacapp_print_value(
FILE * stream,
BACNET_OBJECT_PROPERTY_VALUE *object_value)
BACNET_OBJECT_PROPERTY_VALUE * object_value)
{
bool status = true; /*return value */
size_t len = 0, i = 0;
@@ -896,8 +896,8 @@ bool bacapp_print_value(
case PROP_OBJECT_TYPE:
if (value->type.Enumerated < MAX_ASHRAE_OBJECT_TYPE) {
fprintf(stream, "%s",
bactext_object_type_name(value->
type.Enumerated));
bactext_object_type_name(value->type.
Enumerated));
} else if (value->type.Enumerated < 128) {
fprintf(stream, "reserved %lu",
(unsigned long) value->type.Enumerated);
@@ -913,8 +913,8 @@ bool bacapp_print_value(
case PROP_UNITS:
if (value->type.Enumerated < 256) {
fprintf(stream, "%s",
bactext_engineering_unit_name(value->type.
Enumerated));
bactext_engineering_unit_name(value->
type.Enumerated));
} else {
fprintf(stream, "proprietary %lu",
(unsigned long) value->type.Enumerated);
@@ -922,14 +922,14 @@ bool bacapp_print_value(
break;
case PROP_POLARITY:
fprintf(stream, "%s",
bactext_binary_polarity_name(value->type.
Enumerated));
bactext_binary_polarity_name(value->
type.Enumerated));
break;
case PROP_PRESENT_VALUE:
if (object_type < PROPRIETARY_BACNET_OBJECT_TYPE) {
fprintf(stream, "%s",
bactext_binary_present_value_name(
value->type.Enumerated));
bactext_binary_present_value_name(value->type.
Enumerated));
} else {
fprintf(stream, "%lu",
(unsigned long) value->type.Enumerated);
@@ -941,8 +941,8 @@ bool bacapp_print_value(
break;
case PROP_SYSTEM_STATUS:
fprintf(stream, "%s",
bactext_device_status_name(value->type.
Enumerated));
bactext_device_status_name(value->
type.Enumerated));
break;
case PROP_SEGMENTATION_SUPPORTED:
fprintf(stream, "%s",
@@ -1313,8 +1313,8 @@ void testBACnetApplicationData_Safe(
break;
case BACNET_APPLICATION_TAG_CHARACTER_STRING:
characterstring_init_ansi(&input_value[i].
type.Character_String, "Hello There!");
characterstring_init_ansi(&input_value[i].type.
Character_String, "Hello There!");
break;
case BACNET_APPLICATION_TAG_BIT_STRING:
+2 -2
View File
@@ -944,8 +944,8 @@ INDTEXT_DATA bacnet_property_names[] = {
{PROP_BINARY_INACTIVE_VALUE, "binary-inactive-value"}
,
/* enumeration 326 is used in Addendum j to ANSI/ASHRAE 135-2004 */
{PROP_VERIFICATION_TIME, "verification-time"}
,
{PROP_VERIFICATION_TIME, "verification-time"}
,
{PROP_BIT_MASK, "bit-mask"}
,
{PROP_BIT_TEXT, "bit-text"}
+2 -2
View File
@@ -678,8 +678,8 @@ static void bvlc_bdt_forward_npdu(
mask in the BDT entry and logically ORing it with the
BBMD address of the same entry. */
bip_dest.sin_addr.s_addr =
htonl(((~BBMD_Table[i].broadcast_mask.s_addr) | BBMD_Table[i].
dest_address.s_addr));
htonl(((~BBMD_Table[i].broadcast_mask.
s_addr) | BBMD_Table[i].dest_address.s_addr));
bip_dest.sin_port = htons(BBMD_Table[i].dest_port);
/* don't send to my broadcast address and same port */
if ((bip_dest.sin_addr.s_addr == htonl(bip_get_broadcast_addr()))
+139 -134
View File
@@ -192,14 +192,14 @@ int event_notify_encode_service_request(
len =
encode_context_bitstring(&apdu[apdu_len], 0,
&data->notificationParams.changeOfBitstring.
referencedBitString);
&data->notificationParams.
changeOfBitstring.referencedBitString);
apdu_len += len;
len =
encode_context_bitstring(&apdu[apdu_len], 1,
&data->notificationParams.changeOfBitstring.
statusFlags);
&data->notificationParams.
changeOfBitstring.statusFlags);
apdu_len += len;
len = encode_closing_tag(&apdu[apdu_len], 0);
@@ -223,8 +223,8 @@ int event_notify_encode_service_request(
len =
encode_context_bitstring(&apdu[apdu_len], 1,
&data->notificationParams.changeOfState.
statusFlags);
&data->notificationParams.
changeOfState.statusFlags);
apdu_len += len;
len = encode_closing_tag(&apdu[apdu_len], 1);
@@ -242,8 +242,8 @@ int event_notify_encode_service_request(
case CHANGE_OF_VALUE_REAL:
len =
encode_context_real(&apdu[apdu_len], 1,
data->notificationParams.changeOfValue.
newValue.changeValue);
data->notificationParams.
changeOfValue.newValue.changeValue);
apdu_len += len;
break;
@@ -251,8 +251,8 @@ int event_notify_encode_service_request(
len =
encode_context_bitstring(&apdu[apdu_len],
0,
&data->notificationParams.changeOfValue.
newValue.changedBits);
&data->notificationParams.
changeOfValue.newValue.changedBits);
apdu_len += len;
break;
@@ -265,8 +265,8 @@ int event_notify_encode_service_request(
len =
encode_context_bitstring(&apdu[apdu_len], 1,
&data->notificationParams.changeOfValue.
statusFlags);
&data->notificationParams.
changeOfValue.statusFlags);
apdu_len += len;
len = encode_closing_tag(&apdu[apdu_len], 2);
@@ -280,20 +280,20 @@ int event_notify_encode_service_request(
len =
encode_context_real(&apdu[apdu_len], 0,
data->notificationParams.floatingLimit.
referenceValue);
data->notificationParams.
floatingLimit.referenceValue);
apdu_len += len;
len =
encode_context_bitstring(&apdu[apdu_len], 1,
&data->notificationParams.floatingLimit.
statusFlags);
&data->notificationParams.
floatingLimit.statusFlags);
apdu_len += len;
len =
encode_context_real(&apdu[apdu_len], 2,
data->notificationParams.floatingLimit.
setPointValue);
data->notificationParams.
floatingLimit.setPointValue);
apdu_len += len;
len =
@@ -312,8 +312,8 @@ int event_notify_encode_service_request(
len =
encode_context_real(&apdu[apdu_len], 0,
data->notificationParams.outOfRange.
exceedingValue);
data->notificationParams.
outOfRange.exceedingValue);
apdu_len += len;
len =
@@ -341,26 +341,26 @@ int event_notify_encode_service_request(
len =
encode_context_enumerated(&apdu[apdu_len], 0,
data->notificationParams.changeOfLifeSafety.
newState);
data->notificationParams.
changeOfLifeSafety.newState);
apdu_len += len;
len =
encode_context_enumerated(&apdu[apdu_len], 1,
data->notificationParams.changeOfLifeSafety.
newMode);
data->notificationParams.
changeOfLifeSafety.newMode);
apdu_len += len;
len =
encode_context_bitstring(&apdu[apdu_len], 2,
&data->notificationParams.changeOfLifeSafety.
statusFlags);
&data->notificationParams.
changeOfLifeSafety.statusFlags);
apdu_len += len;
len =
encode_context_enumerated(&apdu[apdu_len], 3,
data->notificationParams.changeOfLifeSafety.
operationExpected);
data->notificationParams.
changeOfLifeSafety.operationExpected);
apdu_len += len;
len = encode_closing_tag(&apdu[apdu_len], 8);
@@ -374,20 +374,20 @@ int event_notify_encode_service_request(
len =
bacapp_encode_context_device_obj_property_ref(&apdu
[apdu_len], 0,
&data->notificationParams.bufferReady.
bufferProperty);
&data->notificationParams.
bufferReady.bufferProperty);
apdu_len += len;
len =
encode_context_unsigned(&apdu[apdu_len], 1,
data->notificationParams.bufferReady.
previousNotification);
data->notificationParams.
bufferReady.previousNotification);
apdu_len += len;
len =
encode_context_unsigned(&apdu[apdu_len], 2,
data->notificationParams.bufferReady.
currentNotification);
data->notificationParams.
bufferReady.currentNotification);
apdu_len += len;
len = encode_closing_tag(&apdu[apdu_len], 10);
@@ -399,20 +399,20 @@ int event_notify_encode_service_request(
len =
encode_context_unsigned(&apdu[apdu_len], 0,
data->notificationParams.unsignedRange.
exceedingValue);
data->notificationParams.
unsignedRange.exceedingValue);
apdu_len += len;
len =
encode_context_bitstring(&apdu[apdu_len], 1,
&data->notificationParams.unsignedRange.
statusFlags);
&data->notificationParams.
unsignedRange.statusFlags);
apdu_len += len;
len =
encode_context_unsigned(&apdu[apdu_len], 2,
data->notificationParams.unsignedRange.
exceededLimit);
data->notificationParams.
unsignedRange.exceededLimit);
apdu_len += len;
len = encode_closing_tag(&apdu[apdu_len], 11);
@@ -595,16 +595,18 @@ int event_notify_decode_service_request(
case EVENT_CHANGE_OF_BITSTRING:
if (-1 == (section_length =
decode_context_bitstring(&apdu[len], 0,
&data->notificationParams.
changeOfBitstring.referencedBitString))) {
&data->
notificationParams.changeOfBitstring.
referencedBitString))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_bitstring(&apdu[len], 1,
&data->notificationParams.
changeOfBitstring.statusFlags))) {
&data->
notificationParams.changeOfBitstring.
statusFlags))) {
return -1;
}
len += section_length;
@@ -615,16 +617,16 @@ int event_notify_decode_service_request(
if (-1 == (section_length =
bacapp_decode_context_property_state(&apdu
[len], 0,
&data->notificationParams.changeOfState.
newState))) {
&data->notificationParams.
changeOfState.newState))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_bitstring(&apdu[len], 1,
&data->notificationParams.changeOfState.
statusFlags))) {
&data->notificationParams.
changeOfState.statusFlags))) {
return -1;
}
len += section_length;
@@ -642,8 +644,9 @@ int event_notify_decode_service_request(
if (-1 == (section_length =
decode_context_bitstring(&apdu[len], 0,
&data->notificationParams.
changeOfValue.newValue.changedBits))) {
&data->
notificationParams.changeOfValue.
newValue.changedBits))) {
return -1;
}
@@ -654,8 +657,9 @@ int event_notify_decode_service_request(
CHANGE_OF_VALUE_REAL)) {
if (-1 == (section_length =
decode_context_real(&apdu[len], 1,
&data->notificationParams.
changeOfValue.newValue.changeValue))) {
&data->
notificationParams.changeOfValue.
newValue.changeValue))) {
return -1;
}
@@ -673,8 +677,8 @@ int event_notify_decode_service_request(
if (-1 == (section_length =
decode_context_bitstring(&apdu[len], 1,
&data->notificationParams.changeOfValue.
statusFlags))) {
&data->notificationParams.
changeOfValue.statusFlags))) {
return -1;
}
len += section_length;
@@ -683,31 +687,31 @@ int event_notify_decode_service_request(
case EVENT_FLOATING_LIMIT:
if (-1 == (section_length =
decode_context_real(&apdu[len], 0,
&data->notificationParams.floatingLimit.
referenceValue))) {
&data->notificationParams.
floatingLimit.referenceValue))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_bitstring(&apdu[len], 1,
&data->notificationParams.floatingLimit.
statusFlags))) {
&data->notificationParams.
floatingLimit.statusFlags))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_real(&apdu[len], 2,
&data->notificationParams.floatingLimit.
setPointValue))) {
&data->notificationParams.
floatingLimit.setPointValue))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_real(&apdu[len], 3,
&data->notificationParams.floatingLimit.
errorLimit))) {
&data->notificationParams.
floatingLimit.errorLimit))) {
return -1;
}
len += section_length;
@@ -716,31 +720,31 @@ int event_notify_decode_service_request(
case EVENT_OUT_OF_RANGE:
if (-1 == (section_length =
decode_context_real(&apdu[len], 0,
&data->notificationParams.outOfRange.
exceedingValue))) {
&data->notificationParams.
outOfRange.exceedingValue))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_bitstring(&apdu[len], 1,
&data->notificationParams.outOfRange.
statusFlags))) {
&data->notificationParams.
outOfRange.statusFlags))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_real(&apdu[len], 2,
&data->notificationParams.outOfRange.
deadband))) {
&data->notificationParams.
outOfRange.deadband))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_real(&apdu[len], 3,
&data->notificationParams.outOfRange.
exceededLimit))) {
&data->notificationParams.
outOfRange.exceededLimit))) {
return -1;
}
len += section_length;
@@ -768,8 +772,9 @@ int event_notify_decode_service_request(
if (-1 == (section_length =
decode_context_bitstring(&apdu[len], 2,
&data->notificationParams.
changeOfLifeSafety.statusFlags))) {
&data->
notificationParams.changeOfLifeSafety.
statusFlags))) {
return -1;
}
len += section_length;
@@ -779,8 +784,8 @@ int event_notify_decode_service_request(
&value))) {
return -1;
}
data->notificationParams.changeOfLifeSafety.
operationExpected =
data->notificationParams.
changeOfLifeSafety.operationExpected =
(BACNET_LIFE_SAFETY_OPERATION) value;
len += section_length;
break;
@@ -789,24 +794,24 @@ int event_notify_decode_service_request(
if (-1 == (section_length =
bacapp_decode_context_device_obj_property_ref
(&apdu[len], 0,
&data->notificationParams.bufferReady.
bufferProperty))) {
&data->notificationParams.
bufferReady.bufferProperty))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_unsigned(&apdu[len], 1,
&data->notificationParams.bufferReady.
previousNotification))) {
&data->notificationParams.
bufferReady.previousNotification))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_unsigned(&apdu[len], 2,
&data->notificationParams.bufferReady.
currentNotification))) {
&data->notificationParams.
bufferReady.currentNotification))) {
return -1;
}
len += section_length;
@@ -815,24 +820,24 @@ int event_notify_decode_service_request(
case EVENT_UNSIGNED_RANGE:
if (-1 == (section_length =
decode_context_unsigned(&apdu[len], 0,
&data->notificationParams.unsignedRange.
exceedingValue))) {
&data->notificationParams.
unsignedRange.exceedingValue))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_bitstring(&apdu[len], 1,
&data->notificationParams.unsignedRange.
statusFlags))) {
&data->notificationParams.
unsignedRange.statusFlags))) {
return -1;
}
len += section_length;
if (-1 == (section_length =
decode_context_unsigned(&apdu[len], 2,
&data->notificationParams.unsignedRange.
exceededLimit))) {
&data->notificationParams.
unsignedRange.exceededLimit))) {
return -1;
}
len += section_length;
@@ -1091,16 +1096,16 @@ void testEventEventState(
data.eventType = EVENT_CHANGE_OF_BITSTRING;
bitstring_init(&data.notificationParams.changeOfBitstring.
referencedBitString);
bitstring_set_bit(&data.notificationParams.changeOfBitstring.
referencedBitString, 0, true);
bitstring_set_bit(&data.notificationParams.changeOfBitstring.
referencedBitString, 1, false);
bitstring_set_bit(&data.notificationParams.changeOfBitstring.
referencedBitString, 2, true);
bitstring_set_bit(&data.notificationParams.changeOfBitstring.
referencedBitString, 2, false);
bitstring_init(&data.notificationParams.
changeOfBitstring.referencedBitString);
bitstring_set_bit(&data.notificationParams.
changeOfBitstring.referencedBitString, 0, true);
bitstring_set_bit(&data.notificationParams.
changeOfBitstring.referencedBitString, 1, false);
bitstring_set_bit(&data.notificationParams.
changeOfBitstring.referencedBitString, 2, true);
bitstring_set_bit(&data.notificationParams.
changeOfBitstring.referencedBitString, 2, false);
bitstring_init(&data.notificationParams.changeOfBitstring.statusFlags);
@@ -1186,16 +1191,16 @@ void testEventEventState(
data.notificationParams.changeOfValue.tag = CHANGE_OF_VALUE_BITS;
bitstring_init(&data.notificationParams.changeOfValue.newValue.
changedBits);
bitstring_set_bit(&data.notificationParams.changeOfValue.newValue.
changedBits, 0, true);
bitstring_set_bit(&data.notificationParams.changeOfValue.newValue.
changedBits, 1, false);
bitstring_set_bit(&data.notificationParams.changeOfValue.newValue.
changedBits, 2, false);
bitstring_set_bit(&data.notificationParams.changeOfValue.newValue.
changedBits, 3, false);
bitstring_init(&data.notificationParams.changeOfValue.
newValue.changedBits);
bitstring_set_bit(&data.notificationParams.changeOfValue.
newValue.changedBits, 0, true);
bitstring_set_bit(&data.notificationParams.changeOfValue.
newValue.changedBits, 1, false);
bitstring_set_bit(&data.notificationParams.changeOfValue.
newValue.changedBits, 2, false);
bitstring_set_bit(&data.notificationParams.changeOfValue.
newValue.changedBits, 3, false);
memset(buffer, 0, MAX_APDU);
inLen = event_notify_encode_service_request(&buffer[0], &data);
@@ -1435,12 +1440,12 @@ void testEventEventState(
data.notificationParams.bufferReady.currentNotification = 2345;
data.notificationParams.bufferReady.bufferProperty.deviceIndentifier.type =
OBJECT_DEVICE;
data.notificationParams.bufferReady.bufferProperty.deviceIndentifier.
instance = 500;
data.notificationParams.bufferReady.bufferProperty.
deviceIndentifier.instance = 500;
data.notificationParams.bufferReady.bufferProperty.objectIdentifier.type =
OBJECT_ANALOG_INPUT;
data.notificationParams.bufferReady.bufferProperty.objectIdentifier.
instance = 100;
data.notificationParams.bufferReady.bufferProperty.
objectIdentifier.instance = 100;
data.notificationParams.bufferReady.bufferProperty.propertyIdentifier =
PROP_PRESENT_VALUE;
data.notificationParams.bufferReady.bufferProperty.arrayIndex = 0;
@@ -1465,34 +1470,34 @@ void testEventEventState(
ct_test(pTest,
data.notificationParams.bufferReady.bufferProperty.deviceIndentifier.
type ==
data2.notificationParams.bufferReady.bufferProperty.deviceIndentifier.
type);
ct_test(pTest,
data.notificationParams.bufferReady.bufferProperty.deviceIndentifier.
instance ==
data2.notificationParams.bufferReady.bufferProperty.deviceIndentifier.
instance);
ct_test(pTest,
data.notificationParams.bufferReady.bufferProperty.objectIdentifier.
instance ==
data2.notificationParams.bufferReady.bufferProperty.objectIdentifier.
instance);
ct_test(pTest,
data.notificationParams.bufferReady.bufferProperty.objectIdentifier.
type ==
data2.notificationParams.bufferReady.bufferProperty.objectIdentifier.
type);
data.notificationParams.bufferReady.bufferProperty.
deviceIndentifier.type ==
data2.notificationParams.bufferReady.bufferProperty.
deviceIndentifier.type);
ct_test(pTest,
data.notificationParams.bufferReady.bufferProperty.
propertyIdentifier ==
deviceIndentifier.instance ==
data2.notificationParams.bufferReady.bufferProperty.
propertyIdentifier);
deviceIndentifier.instance);
ct_test(pTest,
data.notificationParams.bufferReady.bufferProperty.
objectIdentifier.instance ==
data2.notificationParams.bufferReady.bufferProperty.
objectIdentifier.instance);
ct_test(pTest,
data.notificationParams.bufferReady.bufferProperty.
objectIdentifier.type ==
data2.notificationParams.bufferReady.bufferProperty.
objectIdentifier.type);
ct_test(pTest,
data.notificationParams.bufferReady.
bufferProperty.propertyIdentifier ==
data2.notificationParams.bufferReady.
bufferProperty.propertyIdentifier);
ct_test(pTest,
data.notificationParams.bufferReady.bufferProperty.arrayIndex ==
+2 -2
View File
@@ -52,12 +52,12 @@
unsigned FIFO_Count(
FIFO_BUFFER const *b)
{
unsigned head, tail; /* used to avoid volatile decision */
unsigned head, tail; /* used to avoid volatile decision */
if (b) {
head = b->head;
tail = b->tail;
return head-tail;
return head - tail;
} else {
return 0;
}