From 5e70eeecfc1d57a58233e14507da72e03fc1f1e9 Mon Sep 17 00:00:00 2001 From: Steve Karg Date: Sun, 27 Feb 2022 16:02:17 -0600 Subject: [PATCH] Issue 10 ci add support for code spelling checks (#231) * added make targets spell and codespell for spelling checks * fix spelling errors detected by codespell * added codespell to github workflow Co-authored-by: Steve Karg --- .github/workflows/lint.yml | 12 +++++++++++- Makefile | 12 ++++++++++++ src/bacnet/bacapp.c | 4 ++-- src/bacnet/bacdcode.c | 2 +- src/bacnet/bacstr.c | 4 ++-- src/bacnet/basic/bbmd/h_bbmd.c | 4 ++-- src/bacnet/basic/binding/address.c | 12 ++++++------ src/bacnet/basic/npdu/s_router.c | 2 +- src/bacnet/basic/object/ai.h | 2 +- src/bacnet/basic/object/av.h | 2 +- src/bacnet/basic/object/command.c | 4 ++-- src/bacnet/basic/object/device.h | 2 +- src/bacnet/basic/object/gateway/gw_device.c | 2 +- src/bacnet/basic/object/lc.c | 8 ++++---- src/bacnet/basic/object/schedule.c | 2 +- src/bacnet/basic/object/trendlog.c | 21 ++++++++++----------- src/bacnet/basic/object/trendlog.h | 2 +- src/bacnet/basic/service/h_getevent.c | 2 +- src/bacnet/basic/service/h_rp.c | 2 +- src/bacnet/basic/service/h_rr.c | 2 +- src/bacnet/basic/sys/bigend.c | 6 +++--- src/bacnet/basic/sys/fifo.c | 2 +- src/bacnet/basic/sys/keylist.h | 2 +- src/bacnet/basic/sys/ringbuf.c | 4 ++-- src/bacnet/basic/tsm/tsm.c | 2 +- src/bacnet/datalink/bvlc.c | 2 +- src/bacnet/datalink/cobs.c | 2 +- src/bacnet/event.h | 2 +- src/bacnet/lso.c | 2 +- src/bacnet/rp.c | 2 +- src/bacnet/rpm.c | 4 ++-- src/bacnet/wpm.c | 4 ++-- 32 files changed, 79 insertions(+), 58 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 582f679c..2a81fc14 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,5 +30,15 @@ jobs: sudo apt-get install -qq cppcheck - name: cppcheck run: make clean cppcheck - + + codespell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Create Build Environment + run: | + sudo apt-get update -qq + sudo apt-get install -qq codespell + - name: codespell + run: make spell diff --git a/Makefile b/Makefile index 4a5ab32e..f8fc3641 100644 --- a/Makefile +++ b/Makefile @@ -230,6 +230,18 @@ CPPCHECK_OPTIONS += --suppress=selfAssignment cppcheck: cppcheck $(CPPCHECK_OPTIONS) --quiet --force ./src/ +IGNORE_WORDS = ba +CODESPELL_OPTIONS = --write-changes --interactive 3 --enable-colors +CODESPELL_OPTIONS += --ignore-words-list $(IGNORE_WORDS) +.PHONY: codespell +codespell: + codespell $(CODESPELL_OPTIONS) ./src + +SPELL_OPTIONS = --enable-colors --ignore-words-list $(IGNORE_WORDS) +.PHONY: spell +spell: + codespell $(SPELL_OPTIONS) ./src + .PHONY: clean clean: ports-clean $(MAKE) -s -C src clean diff --git a/src/bacnet/bacapp.c b/src/bacnet/bacapp.c index 2db1a938..a251fcbc 100644 --- a/src/bacnet/bacapp.c +++ b/src/bacnet/bacapp.c @@ -383,7 +383,7 @@ bool bacapp_decode_application_data_safe(uint8_t *new_apdu, apdu_len += tag_len; apdu_len_remaining -= tag_len; /* The tag is boolean then len_value_type is interpreted as value, - *not length, so dont bother + *not length, so don't bother ** checking with apdu_len_remaining */ if (tag_number == BACNET_APPLICATION_TAG_BOOLEAN || len_value_type <= apdu_len_remaining) { @@ -937,7 +937,7 @@ bool bacapp_copy(BACNET_APPLICATION_DATA_VALUE *dest_value, * * @param Pointer to the APDU buffer * @param apdu_len_max Bytes valid in the buffer - * @param property ID of the propery to get the length for. + * @param property ID of the property to get the length for. * * @return Length in bytes or BACNET_STATUS_ERROR. */ diff --git a/src/bacnet/bacdcode.c b/src/bacnet/bacdcode.c index db49c9c4..d4a620e9 100644 --- a/src/bacnet/bacdcode.c +++ b/src/bacnet/bacdcode.c @@ -840,7 +840,7 @@ int decode_bitstring( bitstring_set_octet(bit_string, (uint8_t) i, byte_reverse_bits(apdu[len++])); } - /* Erase the remaining unsed bits. */ + /* Erase the remaining unused bits. */ unused_bits = (uint8_t) (apdu[0] & 0x07); bitstring_set_bits_used(bit_string, (uint8_t) bytes_used, unused_bits); diff --git a/src/bacnet/bacstr.c b/src/bacnet/bacstr.c index 937aa095..c80bbe38 100644 --- a/src/bacnet/bacstr.c +++ b/src/bacnet/bacstr.c @@ -673,7 +673,7 @@ char *characterstring_value(BACNET_CHARACTER_STRING *char_string) * * @param char_string Pointer to the character string. * - * @return Length of the charcater string, but + * @return Length of the character string, but * maximum MAX_CHARACTER_STRING_BYTES. */ size_t characterstring_length(BACNET_CHARACTER_STRING *char_string) @@ -1117,7 +1117,7 @@ bool octetstring_append( * function returns false. * * @param octet_string Pointer to the octet string. - * @param length New length the octet string is trucated to. + * @param length New length the octet string is truncated to. * * @return tur on success, false otherwise. */ diff --git a/src/bacnet/basic/bbmd/h_bbmd.c b/src/bacnet/basic/bbmd/h_bbmd.c index 48c23e19..127fbe66 100644 --- a/src/bacnet/basic/bbmd/h_bbmd.c +++ b/src/bacnet/basic/bbmd/h_bbmd.c @@ -355,7 +355,7 @@ static uint16_t bbmd_bdt_forward_npdu(BACNET_IP_ADDRESS *bip_src, /* If we are forwarding an original broadcast message and the NAT * handling is enabled, change the source address to NAT routers * global IP address so the recipient can reply (local IP address - * is not accesible from internet side. + * is not accessible from internet side. * * If we are forwarding a message from peer BBMD or foreign device * or the NAT handling is disabled, leave the source address as is. @@ -420,7 +420,7 @@ static uint16_t bbmd_fdt_forward_npdu(BACNET_IP_ADDRESS *bip_src, /* If we are forwarding an original broadcast message and the NAT * handling is enabled, change the source address to NAT routers * global IP address so the recipient can reply (local IP address - * is not accesible from internet side. + * is not accessible from internet side. * * If we are forwarding a message from peer BBMD or foreign device * or the NAT handling is disabled, leave the source address as is. diff --git a/src/bacnet/basic/binding/address.c b/src/bacnet/basic/binding/address.c index 7c354ee1..d19ee8d9 100644 --- a/src/bacnet/basic/binding/address.c +++ b/src/bacnet/basic/binding/address.c @@ -96,7 +96,7 @@ static struct Address_Cache_Entry { #define BAC_ADDR_LONG_TIME BAC_ADDR_SECS_1DAY #define BAC_ADDR_SHORT_TIME BAC_ADDR_SECS_1HOUR -#define BAC_ADDR_FOREVER 0xFFFFFFFF /* Permenant entry */ +#define BAC_ADDR_FOREVER 0xFFFFFFFF /* Permanent entry */ /** * @brief Set the index of the first (top) address being protected. @@ -410,7 +410,7 @@ static void address_file_init(const char *pFilename) /** * Clear down the cache and make sure the full complement of entries are - * available. Assume no persistance of memory. + * available. Assume no persistence of memory. */ void address_init(void) { @@ -431,7 +431,7 @@ void address_init(void) /** * Clear down the cache of any non bound, expired or reserved entries. * Leave static and unexpired bound entries alone. For use where the cache - * is held in persistant memory which can survive a reset or power cycle. + * is held in persistent memory which can survive a reset or power cycle. * This reduces the network traffic on restarts as the cache will have much * of its entries intact. */ @@ -465,7 +465,7 @@ void address_init_partial(void) /** * Set the TTL info for the given device entry. If it is a bound entry we * set it to static or normal and can change the TTL. If it is unbound we - * can only set the TTL. This is done as a seperate function at the moment + * can only set the TTL. This is done as a separate function at the moment * to avoid breaking the current API. * * @param device_id Device-Id @@ -940,7 +940,7 @@ int address_list_encode(uint8_t *apdu, unsigned apdu_len) * * We take the simple approach here to filling the buffer by taking a max * * size for a single entry and then stopping if there is less than that - * left in the buffer. You could build each entry in a seperate buffer and + * left in the buffer. You could build each entry in a separate buffer and * determine the exact length before copying but this is time consuming, * requires more memory and would probably only let you sqeeeze one more * entry in on occasion. The value is calculated as 5 bytes for the device @@ -1131,7 +1131,7 @@ int rr_address_list_encode(uint8_t *apdu, BACNET_READ_RANGE_DATA *pRequest) * Scan the cache and eliminate any expired entries. Should be called * periodically to ensure the cache is managed correctly. If this function * is never called at all the whole cache is effectivly rendered static and - * entries never expire unless explictely deleted. + * entries never expire unless explicitly deleted. * * @param uSeconds Approximate number of seconds since last call to this * function diff --git a/src/bacnet/basic/npdu/s_router.c b/src/bacnet/basic/npdu/s_router.c index 7afcb4a9..1fc26f99 100644 --- a/src/bacnet/basic/npdu/s_router.c +++ b/src/bacnet/basic/npdu/s_router.c @@ -258,7 +258,7 @@ void Send_I_Am_Router_To_Network(const int DNET_list[]) * network. Otherwise, designates a particular router * destination. * @param reject_reason [in] One of the BACNET_NETWORK_REJECT_REASONS codes. - * @param dnet [in] Which BACnet network orginated the message. + * @param dnet [in] Which BACnet network originated the message. */ void Send_Reject_Message_To_Network( BACNET_ADDRESS *dst, uint8_t reject_reason, int dnet) diff --git a/src/bacnet/basic/object/ai.h b/src/bacnet/basic/object/ai.h index f2d42b72..14127930 100644 --- a/src/bacnet/basic/object/ai.h +++ b/src/bacnet/basic/object/ai.h @@ -65,7 +65,7 @@ extern "C" { BACNET_DATE_TIME Event_Time_Stamps[MAX_BACNET_EVENT_TRANSITION]; /* time to generate event notification */ uint32_t Remaining_Time_Delay; - /* AckNotification informations */ + /* AckNotification information */ ACK_NOTIFICATION Ack_notify_data; #endif } ANALOG_INPUT_DESCR; diff --git a/src/bacnet/basic/object/av.h b/src/bacnet/basic/object/av.h index 58f28996..39981586 100644 --- a/src/bacnet/basic/object/av.h +++ b/src/bacnet/basic/object/av.h @@ -65,7 +65,7 @@ extern "C" { BACNET_DATE_TIME Event_Time_Stamps[MAX_BACNET_EVENT_TRANSITION]; /* time to generate event notification */ uint32_t Remaining_Time_Delay; - /* AckNotification informations */ + /* AckNotification information */ ACK_NOTIFICATION Ack_notify_data; #endif } ANALOG_VALUE_DESCR; diff --git a/src/bacnet/basic/object/command.c b/src/bacnet/basic/object/command.c index e6945f8c..4417cf1e 100644 --- a/src/bacnet/basic/object/command.c +++ b/src/bacnet/basic/object/command.c @@ -682,7 +682,7 @@ int Command_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata) for (i = 0; i < MAX_COMMAND_ACTIONS; i++) { BACNET_ACTION_LIST *Curr_CL_Member = &CurrentCommand->Action[0]; - /* another loop, for aditional actions in the list */ + /* another loop, for additional actions in the list */ for (; Curr_CL_Member != NULL; Curr_CL_Member = Curr_CL_Member->next) { len = cl_encode_apdu( @@ -703,7 +703,7 @@ int Command_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata) if (rpdata->array_index < MAX_COMMAND_ACTIONS) { BACNET_ACTION_LIST *Curr_CL_Member = &CurrentCommand->Action[rpdata->array_index]; - /* another loop, for aditional actions in the list */ + /* another loop, for additional actions in the list */ for (; Curr_CL_Member != NULL; Curr_CL_Member = Curr_CL_Member->next) { len = cl_encode_apdu( diff --git a/src/bacnet/basic/object/device.h b/src/bacnet/basic/object/device.h index a3cff7ff..bb7937e6 100644 --- a/src/bacnet/basic/object/device.h +++ b/src/bacnet/basic/object/device.h @@ -91,7 +91,7 @@ typedef bool( /** Helper function to step through an array of objects and find either the * first one or the next one of a given type. Used to step through an array - * of objects which is not necessarily contiguious for each type i.e. the + * of objects which is not necessarily contiguous for each type i.e. the * index for the 'n'th object of a given type is not necessarily 'n'. * @ingroup ObjHelpers * @param [in] The index of the current object or a value of ~0 to indicate diff --git a/src/bacnet/basic/object/gateway/gw_device.c b/src/bacnet/basic/object/gateway/gw_device.c index c8957773..798916cc 100644 --- a/src/bacnet/basic/object/gateway/gw_device.c +++ b/src/bacnet/basic/object/gateway/gw_device.c @@ -59,7 +59,7 @@ #if defined(BACFILE) #include "bacnet/basic/object/bacfile.h" /* object list dependency */ #endif -/* os specfic includes */ +/* os specific includes */ #include "bacnet/basic/sys/mstimer.h" /* local forward and external prototypes */ diff --git a/src/bacnet/basic/object/lc.c b/src/bacnet/basic/object/lc.c index 7e005496..8d8d7365 100644 --- a/src/bacnet/basic/object/lc.c +++ b/src/bacnet/basic/object/lc.c @@ -867,8 +867,8 @@ bool Load_Control_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data) unsigned int object_index = 0; int len = 0; BACNET_APPLICATION_DATA_VALUE value; - BACNET_DATE - TempDate; /* build here in case of error in time half of datetime */ + /* build here in case of error in time half of datetime */ + BACNET_DATE start_date; PRINTF("Load_Control_Write_Property(wp_data=%p)\n", wp_data); if (wp_data == NULL) { @@ -954,7 +954,7 @@ bool Load_Control_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data) break; } /* Hold the date until we are sure the time is also there */ - TempDate = value.type.Date; + start_date = value.type.Date; len = bacapp_decode_application_data(wp_data->application_data + len, wp_data->application_data_len - len, &value); @@ -963,7 +963,7 @@ bool Load_Control_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data) BACNET_APPLICATION_TAG_TIME); if (status) { /* Write time and date and set written flag */ - Start_Time[object_index].date = TempDate; + Start_Time[object_index].date = start_date; Start_Time[object_index].time = value.type.Time; Start_Time_Property_Written[object_index] = true; } diff --git a/src/bacnet/basic/object/schedule.c b/src/bacnet/basic/object/schedule.c index bc6decf9..e6427cf4 100644 --- a/src/bacnet/basic/object/schedule.c +++ b/src/bacnet/basic/object/schedule.c @@ -74,7 +74,7 @@ void Schedule_Init(void) SCHEDULE_DESCR *psched = &Schedule_Descr[0]; for (i = 0; i < MAX_SCHEDULES; i++, psched++) { - /* whole year, change as neccessary */ + /* whole year, change as necessary */ psched->Start_Date.year = 0xFF; psched->Start_Date.month = 1; psched->Start_Date.day = 1; diff --git a/src/bacnet/basic/object/trendlog.c b/src/bacnet/basic/object/trendlog.c index 4ee35da6..44979b73 100644 --- a/src/bacnet/basic/object/trendlog.c +++ b/src/bacnet/basic/object/trendlog.c @@ -231,7 +231,7 @@ void Trend_Log_Init(void) /* * Note: we use the instance number here and build the name based - * on the assumption that there is a 1 to 1 correspondance. If there + * on the assumption that there is a 1 to 1 correspondence. If there * is not we need to convert to index before proceeding. */ bool Trend_Log_Object_Name( @@ -419,8 +419,7 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data) int len = 0; BACNET_APPLICATION_DATA_VALUE value; TL_LOG_INFO *CurrentLog; - BACNET_DATE - TempDate; /* build here in case of error in time half of datetime */ + BACNET_DATE start_date, stop_date; BACNET_DEVICE_OBJECT_PROPERTY_REFERENCE TempSource; bool bEffectiveEnable; int log_index; @@ -574,7 +573,7 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data) if (!status) { break; } - TempDate = value.type.Date; + start_date = value.type.Date; /* Then decode the time part */ len = bacapp_decode_application_data(wp_data->application_data + len, @@ -588,8 +587,8 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data) } /* First record the current enable state of the log */ bEffectiveEnable = TL_Is_Enabled(log_index); - CurrentLog->StartTime.date = - TempDate; /* Safe to copy the date now */ + /* Safe to copy the date now */ + CurrentLog->StartTime.date = start_date; CurrentLog->StartTime.time = value.type.Time; if (datetime_wildcard_present(&CurrentLog->StartTime)) { @@ -625,7 +624,7 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data) if (!status) { break; } - TempDate = value.type.Date; + stop_date = value.type.Date; /* Then decode the time part */ len = bacapp_decode_application_data(wp_data->application_data + len, @@ -639,8 +638,8 @@ bool Trend_Log_Write_Property(BACNET_WRITE_PROPERTY_DATA *wp_data) } /* First record the current enable state of the log */ bEffectiveEnable = TL_Is_Enabled(log_index); - CurrentLog->StopTime.date = - TempDate; /* Safe to copy the date now */ + /* Safe to copy the date now */ + CurrentLog->StopTime.date = stop_date; CurrentLog->StopTime.time = value.type.Time; if (datetime_wildcard_present(&CurrentLog->StopTime)) { @@ -988,7 +987,7 @@ void TL_Local_Time_To_BAC(BACNET_DATE_TIME *DestTime, time_t SourceTime) * * * We take the simple approach here to filling the buffer by taking a max * * size for a single entry and then stopping if there is less than that * - * left in the buffer. You could build each entry in a seperate buffer and * + * left in the buffer. You could build each entry in a separate buffer and * * determine the exact length before copying but this is time consuming, * * requires more memory and would probably only let you sqeeeze one more * * entry in on occasion. The value is calculated as 10 bytes for the time * @@ -1740,7 +1739,7 @@ void trend_log_timer(uint16_t uSeconds) * and the offset to decide when to log. Also log a reading * if more than interval time has elapsed since last reading * to ensure we don't miss a reading if we aren't called at - * the precise second when the match occurrs. + * the precise second when the match occurs. */ /* if(((tNow % CurrentLog->ulLogInterval) >= * (CurrentLog->ulIntervalOffset % diff --git a/src/bacnet/basic/object/trendlog.h b/src/bacnet/basic/object/trendlog.h index 00210e48..2d99e7f9 100644 --- a/src/bacnet/basic/object/trendlog.h +++ b/src/bacnet/basic/object/trendlog.h @@ -53,7 +53,7 @@ extern "C" { /* Storage structure for Trend Log data * - * Note. I've tried to minimise the storage requirements here + * Note. I've tried to minimize the storage requirements here * as the memory requirements for logging in embedded * implementations are frequently a big issue. For PC or * embedded Linux type setupz this may seem like overkill diff --git a/src/bacnet/basic/service/h_getevent.c b/src/bacnet/basic/service/h_getevent.c index 60c7373f..5d682c74 100644 --- a/src/bacnet/basic/service/h_getevent.c +++ b/src/bacnet/basic/service/h_getevent.c @@ -169,7 +169,7 @@ void handler_get_event_information(uint8_t *service_request, (apdu_len >= MAX_APDU - 2)) { /* Device must be able to fit minimum one event information. - Length of one event informations needs + Length of one event information needs more than 50 octets. */ if ((service_data->max_resp < 128) || (MAX_APDU < 128)) { diff --git a/src/bacnet/basic/service/h_rp.c b/src/bacnet/basic/service/h_rp.c index 2c5705c2..2ecd67f6 100644 --- a/src/bacnet/basic/service/h_rp.c +++ b/src/bacnet/basic/service/h_rp.c @@ -157,7 +157,7 @@ void handler_read_property(uint8_t *service_request, if (apdu_len > service_data->max_resp) { /* too big for the sender - send an abort! Setting of error code needed here as read property - processing may have overriden the default set at start */ + processing may have overridden the default set at start */ rpdata.error_code = ERROR_CODE_ABORT_SEGMENTATION_NOT_SUPPORTED; len = BACNET_STATUS_ABORT; diff --git a/src/bacnet/basic/service/h_rr.c b/src/bacnet/basic/service/h_rr.c index 8b0a9e8e..fab1ebf0 100644 --- a/src/bacnet/basic/service/h_rr.c +++ b/src/bacnet/basic/service/h_rr.c @@ -116,7 +116,7 @@ static int Encode_RR_payload(uint8_t *apdu, BACNET_READ_RANGE_DATA *pRequest) * * @param service_request Pointer to the service request. * @param service_len Bytes valid in the service request. - * @param src Pointer to the BACnet addresss. + * @param src Pointer to the BACnet address. * @param service_data Pointer to the service data, * taken from the request. */ diff --git a/src/bacnet/basic/sys/bigend.c b/src/bacnet/basic/sys/bigend.c index 84b680ee..01479112 100644 --- a/src/bacnet/basic/sys/bigend.c +++ b/src/bacnet/basic/sys/bigend.c @@ -1,7 +1,7 @@ /* Derived from "Unix Incompatibility Notes: Byte Order" by Jan Wolter */ /* http://unixpapa.com/incnote/byteorder.html */ -/** @file bigend.c Determination of Endianess */ +/** @file bigend.c Determination of Endianness */ #include "bacnet/basic/sys/bigend.h" @@ -9,7 +9,7 @@ /* Big-Endian systems save the most significant byte first. */ /* Sun and Motorola processors, IBM-370s and PDP-10s are big-endian. */ /* "Network Byte Order" is also know as "Big-Endian Byte Order" */ -/* for example, a 4 byte integer 67305985 is 0x04030201 in hexidecimal. */ +/* for example, a 4 byte integer 67305985 is 0x04030201 in hexadecimal. */ /* x[0] = 0x04 */ /* x[1] = 0x03 */ /* x[2] = 0x02 */ @@ -17,7 +17,7 @@ /* Little-Endian systems save the least significant byte first. */ /* The entire Intel x86 family, Vaxes, Alphas and PDP-11s are little-endian. */ -/* for example, a 4 byte integer 67305985 is 0x04030201 in hexidecimal. */ +/* for example, a 4 byte integer 67305985 is 0x04030201 in hexadecimal. */ /* x[0] = 0x01 */ /* x[1] = 0x02 */ /* x[2] = 0x03 */ diff --git a/src/bacnet/basic/sys/fifo.c b/src/bacnet/basic/sys/fifo.c index 3e06c2b6..566875a9 100644 --- a/src/bacnet/basic/sys/fifo.c +++ b/src/bacnet/basic/sys/fifo.c @@ -58,7 +58,7 @@ * FIFO_Init(&queue, data_store, sizeof(data_store)); * } * - * Then begin to use the FIFO queue by giving it data, retreiving data, + * Then begin to use the FIFO queue by giving it data, retrieving data, * and checking the FIFO queue to see if it is empty or full: * {@code * uint8_t in_data = 0; diff --git a/src/bacnet/basic/sys/keylist.h b/src/bacnet/basic/sys/keylist.h index 9bd5304f..e764e741 100644 --- a/src/bacnet/basic/sys/keylist.h +++ b/src/bacnet/basic/sys/keylist.h @@ -39,7 +39,7 @@ struct Keylist_Node { typedef struct Keylist { struct Keylist_Node **array; /* array of nodes */ - int count; /* number of nodes in this list - more effecient than loop */ + int count; /* number of nodes in this list - more efficient than loop */ int size; /* number of available nodes on this list - can grow or shrink */ } KEYLIST_TYPE; typedef KEYLIST_TYPE *OS_Keylist; diff --git a/src/bacnet/basic/sys/ringbuf.c b/src/bacnet/basic/sys/ringbuf.c index ed9a5790..c6b40fa6 100644 --- a/src/bacnet/basic/sys/ringbuf.c +++ b/src/bacnet/basic/sys/ringbuf.c @@ -297,7 +297,7 @@ bool Ringbuf_Pop_Element( * * @param b - pointer to RING_BUFFER structure * @param data_element - one element that is copied to the ring buffer - * @return true on succesful add, false if not added + * @return true on successful add, false if not added */ bool Ringbuf_Put(RING_BUFFER *b, uint8_t *data_element) { @@ -331,7 +331,7 @@ bool Ringbuf_Put(RING_BUFFER *b, uint8_t *data_element) * * @param b - pointer to RING_BUFFER structure * @param data_element - one element to copy to the front of the ring - * @return true on succesful add, false if not added + * @return true on successful add, false if not added */ bool Ringbuf_Put_Front(RING_BUFFER *b, uint8_t *data_element) { diff --git a/src/bacnet/basic/tsm/tsm.c b/src/bacnet/basic/tsm/tsm.c index 4c8f16c5..c4a1eea6 100644 --- a/src/bacnet/basic/tsm/tsm.c +++ b/src/bacnet/basic/tsm/tsm.c @@ -316,7 +316,7 @@ bool tsm_get_transaction_pdu(uint8_t invokeID, /** Called once a millisecond or slower. * This function calls the handler for a - * timeout 'Timeout_Function', if neccessary. + * timeout 'Timeout_Function', if necessary. * * @param milliseconds - Count of milliseconds passed, since the last call. */ diff --git a/src/bacnet/datalink/bvlc.c b/src/bacnet/datalink/bvlc.c index 128e971d..72e9a5a3 100644 --- a/src/bacnet/datalink/bvlc.c +++ b/src/bacnet/datalink/bvlc.c @@ -1252,7 +1252,7 @@ bool bvlc_foreign_device_table_entry_copy( } /** - * @brief Foreign-Device-Table timer maintainence + * @brief Foreign-Device-Table timer maintenance * @param fdt_list - first element in list of FDT entries * @param seconds - number of elapsed seconds since the last call */ diff --git a/src/bacnet/datalink/cobs.c b/src/bacnet/datalink/cobs.c index 87e0c151..df8c6b61 100644 --- a/src/bacnet/datalink/cobs.c +++ b/src/bacnet/datalink/cobs.c @@ -50,7 +50,7 @@ size_t cobs_crc32k_encode(uint8_t *buffer, size_t buffer_size, uint32_t crc) /** * @brief Accumulate "dataValue" into the CRC in "crc32kValue". * @param dataValue new data value equivalent to one octet. - * @param crc32kValue accumulated alue equivalent to four octets. + * @param crc32kValue accumulated value equivalent to four octets. * @return value is updated CRC. * @note This function is copied directly from the BACnet standard. */ diff --git a/src/bacnet/event.h b/src/bacnet/event.h index f4175806..62673e61 100644 --- a/src/bacnet/event.h +++ b/src/bacnet/event.h @@ -220,7 +220,7 @@ extern "C" { /*************************************************** ** -** Sends an Unconfirmed Event Notifcation to a dest +** Sends an Unconfirmed Event Notification to a dest ** ****************************************************/ BACNET_STACK_EXPORT diff --git a/src/bacnet/lso.c b/src/bacnet/lso.c index 6f91686b..8529af99 100644 --- a/src/bacnet/lso.c +++ b/src/bacnet/lso.c @@ -105,7 +105,7 @@ int lso_decode_service_request( data->operation = (BACNET_LIFE_SAFETY_OPERATION)operation; len += section_length; /* - ** This is an optional parameter, so dont fail if it doesnt exist + ** This is an optional parameter, so don't fail if it doesn't exist */ if (decode_is_context_tag(&apdu[len], 3)) { section_length = decode_context_object_id(&apdu[len], 3, diff --git a/src/bacnet/rp.c b/src/bacnet/rp.c index 785eabcc..043f56d7 100644 --- a/src/bacnet/rp.c +++ b/src/bacnet/rp.c @@ -91,7 +91,7 @@ int rp_encode_apdu( /** Decode the service request only * * @param apdu Pointer to the buffer for encoding. - * @param apdu_len Count of valid bytes inthe buffer. + * @param apdu_len Count of valid bytes in the buffer. * @param rpdata Pointer to the property data to be encoded. * * @return Bytes decoded or zero on error. diff --git a/src/bacnet/rpm.c b/src/bacnet/rpm.c index 165ab90a..8d0ba156 100644 --- a/src/bacnet/rpm.c +++ b/src/bacnet/rpm.c @@ -162,7 +162,7 @@ int rpm_encode_apdu(uint8_t *apdu, rpm_object = read_access_data; while (rpm_object) { /* The encode function will return a length not more than 12. So the - * temp buffer being 16 bytes is fine enought. */ + * temp buffer being 16 bytes is fine enough. */ len = encode_context_object_id(&apdu_temp[0], 0, rpm_object->object_type, rpm_object->object_instance); len = (int)memcopy(&apdu[0], &apdu_temp[0], (size_t)apdu_len, @@ -182,7 +182,7 @@ int rpm_encode_apdu(uint8_t *apdu, rpm_property = rpm_object->listOfProperties; while (rpm_property) { /* The encode function will return a length not more than 12. So the - * temp buffer being 16 bytes is fine enought. Stuff as many + * temp buffer being 16 bytes is fine enough. Stuff as many * properties into it as APDU length will allow. */ len = encode_context_enumerated( &apdu_temp[0], 0, rpm_property->propertyIdentifier); diff --git a/src/bacnet/wpm.c b/src/bacnet/wpm.c index bcd65302..64657b75 100644 --- a/src/bacnet/wpm.c +++ b/src/bacnet/wpm.c @@ -47,7 +47,7 @@ * @param apdu [in] The contents of the APDU buffer. * @param apdu_len [in] The length of the APDU buffer. * @param wp_data [out] The BACNET_WRITE_PROPERTY_DATA structure - * which will contain the reponse values or error. + * which will contain the response values or error. * * @return Count of decoded bytes. */ @@ -152,7 +152,7 @@ int wpm_decode_object_property( len++; if (imax != BACNET_STATUS_ERROR) { - /* copy application data, check max lengh */ + /* copy application data, check max length */ if (imax > (apdu_len - len)) { imax = (apdu_len - len); }