Ran the comment and indent tools on the source code.

This commit is contained in:
skarg
2008-04-24 01:07:23 +00:00
parent 2ed87c2e0c
commit 3d3d7e420d
11 changed files with 345 additions and 350 deletions
+1 -1
View File
@@ -1 +1 @@
-Iinclude -Idemo/handler -Idemo/object -Iports/linux -castfcnptr -fullinitblock -weak +posixlib -Iinclude -Iports/linux -castfcnptr -fullinitblock -weak +posixlib
+2 -2
View File
@@ -211,8 +211,8 @@ int main(int argc, char *argv[]) {
filename_remove_path(argv[0]), filename_remove_path(argv[0])); filename_remove_path(argv[0]), filename_remove_path(argv[0]));
return 0; return 0;
} }
/* decode the command line parameters */ /* decode the command line parameters */ cov_data.
cov_data.subscriberProcessIdentifier = strtol(argv[1], NULL, 0); subscriberProcessIdentifier = strtol(argv[1], NULL, 0);
cov_data.initiatingDeviceIdentifier = strtol(argv[2], NULL, 0); cov_data.initiatingDeviceIdentifier = strtol(argv[2], NULL, 0);
cov_data.monitoredObjectIdentifier.type = strtol(argv[3], NULL, 0); cov_data.monitoredObjectIdentifier.type = strtol(argv[3], NULL, 0);
cov_data.monitoredObjectIdentifier.instance = strtol(argv[4], NULL, 0); cov_data.monitoredObjectIdentifier.instance = strtol(argv[4], NULL, 0);
+2 -1
View File
@@ -203,7 +203,8 @@ bool Binary_Value_Write_Property(
Binary_Value_Instance_To_Index(wp_data-> Binary_Value_Instance_To_Index(wp_data->
object_instance); object_instance);
/* NOTE: this Binary value has no priority array */ /* NOTE: this Binary value has no priority array */
Present_Value[object_index] = (BACNET_BINARY_PV)value.type.Enumerated; Present_Value[object_index] =
(BACNET_BINARY_PV) value.type.Enumerated;
/* Note: you could set the physical output here if we /* Note: you could set the physical output here if we
are the highest priority. are the highest priority.
However, if Out of Service is TRUE, then don't set the However, if Out of Service is TRUE, then don't set the
+5 -5
View File
@@ -338,8 +338,7 @@ int Device_Encode_Property_APDU(
/* to return an error if the number of encoded objects exceeds */ /* to return an error if the number of encoded objects exceeds */
/* your maximum APDU size. */ /* your maximum APDU size. */
for (i = 1; i <= count; i++) { for (i = 1; i <= count; i++) {
len = len = encode_application_unsigned(&apdu[0], *(&_end + i));
encode_application_unsigned(&apdu[0], *(&_end+i));
apdu_len += len; apdu_len += len;
/* assume next one is the same size as this one */ /* assume next one is the same size as this one */
/* can we all fit into the APDU? */ /* can we all fit into the APDU? */
@@ -351,7 +350,9 @@ int Device_Encode_Property_APDU(
} }
} }
} else if (array_index <= count) { } else if (array_index <= count) {
apdu_len = encode_application_unsigned(&apdu[0], *(&_end+array_index)); apdu_len =
encode_application_unsigned(&apdu[0],
*(&_end + array_index));
} else { } else {
*error_class = ERROR_CLASS_PROPERTY; *error_class = ERROR_CLASS_PROPERTY;
*error_code = ERROR_CODE_INVALID_ARRAY_INDEX; *error_code = ERROR_CODE_INVALID_ARRAY_INDEX;
@@ -445,8 +446,7 @@ bool Device_Write_Property(
encoding = encoding =
characterstring_encoding(&value.type.Character_String); characterstring_encoding(&value.type.Character_String);
if (encoding == CHARACTER_ANSI_X34) { if (encoding == CHARACTER_ANSI_X34) {
if (characterstring_ansi_copy( if (characterstring_ansi_copy(&Object_Name[0],
&Object_Name[0],
sizeof(Object_Name), sizeof(Object_Name),
&value.type.Character_String)) { &value.type.Character_String)) {
status = true; status = true;
+10 -16
View File
@@ -143,31 +143,25 @@ static void input_switch_read(
extern uint8_t _end; extern uint8_t _end;
extern uint8_t __stack; extern uint8_t __stack;
#define STACK_CANARY (0xC5) #define STACK_CANARY (0xC5)
void StackPaint(void) __attribute__ ((naked)) __attribute__ ((section (".init1"))); void StackPaint(
void) __attribute__ ((naked)) __attribute__ ((section(".init1")));
void StackPaint(void) void StackPaint(
void)
{ {
#if 0 #if 0
uint8_t *p = &_end; uint8_t *p = &_end;
while(p <= &__stack) while (p <= &__stack) {
{
*p = STACK_CANARY; *p = STACK_CANARY;
p++; p++;
} }
#else #else
__asm volatile (" ldi r30,lo8(_end)\n" __asm volatile (
" ldi r31,hi8(_end)\n" " ldi r30,lo8(_end)\n" " ldi r31,hi8(_end)\n" " ldi r24,lo8(0xc5)\n" /* STACK_CANARY = 0xc5 */
" ldi r24,lo8(0xc5)\n" /* STACK_CANARY = 0xc5 */ " ldi r25,hi8(__stack)\n" " rjmp .cmp\n" ".loop:\n"
" ldi r25,hi8(__stack)\n" " st Z+,r24\n" ".cmp:\n" " cpi r30,lo8(__stack)\n"
" rjmp .cmp\n" " cpc r31,r25\n" " brlo .loop\n" " breq .loop"::);
".loop:\n"
" st Z+,r24\n"
".cmp:\n"
" cpi r30,lo8(__stack)\n"
" cpc r31,r25\n"
" brlo .loop\n"
" breq .loop"::);
#endif #endif
} }
#endif #endif
+1 -2
View File
@@ -253,8 +253,7 @@ bool characterstring_ansi_copy(
{ {
size_t i; /* counter */ size_t i; /* counter */
if (dest && src && if (dest && src && (src->encoding == CHARACTER_ANSI_X34) &&
(src->encoding == CHARACTER_ANSI_X34) &&
(src->length < dest_max_len)) { (src->length < dest_max_len)) {
for (i = 0; i < src->length; i++) { for (i = 0; i < src->length; i++) {
dest[i] = src->value[i]; dest[i] = src->value[i];
+2 -1
View File
@@ -400,7 +400,8 @@ int bvlc_encode_read_fdt_ack(
pdu_len += len; pdu_len += len;
encode_unsigned16(&pdu[pdu_len], FD_Table[i].time_to_live); encode_unsigned16(&pdu[pdu_len], FD_Table[i].time_to_live);
pdu_len += len; pdu_len += len;
encode_unsigned16(&pdu[pdu_len], (uint16_t)FD_Table[i].seconds_remaining); encode_unsigned16(&pdu[pdu_len],
(uint16_t) FD_Table[i].seconds_remaining);
pdu_len += len; pdu_len += len;
} }
} }