From 4ff99a6780aa39d310836ab21381b2f587b4dd1d Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:54:01 +0200 Subject: [PATCH] Fix tab/space inconsistencies --- IDE/HEXAGON/ecc-verify-benchmark.c | 2 +- IDE/MDK-ARM/LPC43xx/time-LCP43xx.c | 28 +++++++++------------ IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c | 6 ++--- IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c | 18 ++++++------- IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c | 2 +- mqx/util_lib/Sources/util.c | 4 +-- mqx/util_lib/Sources/util.h | 8 +++--- wolfcrypt/src/port/Renesas/renesas_common.c | 2 +- wolfcrypt/src/port/kcapi/kcapi_hash.c | 2 +- wolfcrypt/src/sp_dsp32.c | 12 ++++----- 10 files changed, 40 insertions(+), 44 deletions(-) diff --git a/IDE/HEXAGON/ecc-verify-benchmark.c b/IDE/HEXAGON/ecc-verify-benchmark.c index c87f915b23..24f9125702 100644 --- a/IDE/HEXAGON/ecc-verify-benchmark.c +++ b/IDE/HEXAGON/ecc-verify-benchmark.c @@ -133,7 +133,7 @@ static int hash_firmware_verify_dsp(int numThreads, int domain) ret = wolfSSL_open(sp_URI_value, &(handle[i])); if (ret != 0) { printf("unable to open CDSP? retVal = %d\n", ret); - return -1; + return -1; } wc_ecc_set_handle(&(eccKey[i]), handle[i]); } diff --git a/IDE/MDK-ARM/LPC43xx/time-LCP43xx.c b/IDE/MDK-ARM/LPC43xx/time-LCP43xx.c index 258f8a432f..1e7fba4f12 100644 --- a/IDE/MDK-ARM/LPC43xx/time-LCP43xx.c +++ b/IDE/MDK-ARM/LPC43xx/time-LCP43xx.c @@ -34,9 +34,9 @@ static void init_RTC() { - /* Enable GPIO register interface clock */ - LPC_CCU1->CLK_M4_GPIO_CFG |= 1; - while (!(LPC_CCU1->CLK_M4_GPIO_STAT & 1)) ; + /* Enable GPIO register interface clock */ + LPC_CCU1->CLK_M4_GPIO_CFG |= 1; + while (!(LPC_CCU1->CLK_M4_GPIO_STAT & 1)) ; /* RTC Block section ------------------------------------------------------ */ /* Init RTC module */ @@ -82,7 +82,7 @@ double current_time() void init_time(void) { - init_RTC() ; + init_RTC() ; init_TIM() ; } @@ -93,7 +93,7 @@ struct tm *Cyassl_MDK_gmtime(const time_t *c) static struct tm date ; RTC_TIME_Type RTCFullTime; - RTC_GetFullTime (LPC_RTC, &RTCFullTime); + RTC_GetFullTime (LPC_RTC, &RTCFullTime); date.tm_year = RTCFullTime.YEAR + 100 ; date.tm_mon = RTCFullTime.MONTH - 1 ; @@ -104,7 +104,7 @@ struct tm *Cyassl_MDK_gmtime(const time_t *c) #if defined(DEBUG_CYASSL) { - extern void CYASSL_MSG(char *msg) ; + extern void CYASSL_MSG(char *msg) ; char msg[100] ; sprintf(msg, "Debug::Cyassl_KEIL_gmtime(DATE=/%4d/%02d/%02d TIME=%02d:%02d:%02d)\n", RTCFullTime.YEAR+2000, RTCFullTime.MONTH, RTCFullTime.DOM, @@ -127,14 +127,14 @@ typedef struct func_args { void time_main(void *args) { char * datetime ; - int year ; + int year ; RTC_TIME_Type RTCFullTime; if( args == NULL || ((func_args *)args)->argc == 1) { - RTC_GetFullTime (LPC_RTC, &RTCFullTime); + RTC_GetFullTime (LPC_RTC, &RTCFullTime); printf("Date: %d/%d/%d, Time: %02d:%02d:%02d\n", - RTCFullTime.MONTH, RTCFullTime.DOM, RTCFullTime.YEAR+2000, - RTCFullTime.HOUR, RTCFullTime.MIN, RTCFullTime.SEC) ; + RTCFullTime.MONTH, RTCFullTime.DOM, RTCFullTime.YEAR+2000, + RTCFullTime.HOUR, RTCFullTime.MIN, RTCFullTime.SEC) ; } else if(((func_args *)args)->argc == 3 && ((func_args *)args)->argv[1][0] == '-' && ((func_args *)args)->argv[1][1] == 'd' ) { @@ -143,13 +143,13 @@ void time_main(void *args) sscanf(datetime, "%d/%d/%d", (int *)&RTCFullTime.MONTH, (int *)&RTCFullTime.DOM, &year) ; RTCFullTime.YEAR = year - 2000 ; - RTC_SetTime (LPC_RTC, RTC_TIMETYPE_MONTH, RTCFullTime.MONTH); + RTC_SetTime (LPC_RTC, RTC_TIMETYPE_MONTH, RTCFullTime.MONTH); RTC_SetTime (LPC_RTC, RTC_TIMETYPE_YEAR, RTCFullTime.YEAR); RTC_SetTime (LPC_RTC, RTC_TIMETYPE_DAYOFMONTH, RTCFullTime.DOM); } else if(((func_args *)args)->argc == 3 && ((func_args *)args)->argv[1][0] == '-' && ((func_args *)args)->argv[1][1] == 't' ) { - RTC_GetFullTime (LPC_RTC, &RTCFullTime); + RTC_GetFullTime (LPC_RTC, &RTCFullTime); datetime = ((func_args *)args)->argv[2]; sscanf(datetime, "%d:%d:%d", (int *)&RTCFullTime.HOUR, @@ -161,7 +161,3 @@ void time_main(void *args) RTC_SetTime (LPC_RTC, RTC_TIMETYPE_HOUR, RTCFullTime.HOUR); } else printf("Invalid argument\n") ; } - - - - diff --git a/IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c b/IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c index 7eed772050..9eab03cc69 100644 --- a/IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c +++ b/IDE/MDK5-ARM/Projects/wolfSSL-Full/main.c @@ -90,10 +90,10 @@ int main() { void *arg = NULL; - SystemClock_Config(); - #if !defined(NO_FILESYSTEM) + SystemClock_Config(); + #if !defined(NO_FILESYSTEM) init_filesystem (); - #endif + #endif netInitialize(); osDelay(300); diff --git a/IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c b/IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c index 3a89b912e5..3958f4a23e 100644 --- a/IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c +++ b/IDE/MDK5-ARM/Projects/wolfSSL-Full/shell.c @@ -531,7 +531,7 @@ static wolfSSL_Mutex command_mutex ; #endif void exit_command(void) { - printf("Command Aborted\n") ; + printf("Command Aborted\n") ; #ifdef WOLFSSL_CMSIS_RTOS osThreadTerminate(osThreadGetId()) ; #else @@ -617,7 +617,7 @@ void shell_main(void *arg) { func_args args ; int bf_flg ; #if defined(WOLFSSL_CMSIS_RTOS) - osThreadId cmd ; + osThreadId cmd ; #endif i = BackGround ; /* Dummy for avoiding warning: BackGround is defined but not used. */ @@ -641,14 +641,14 @@ void shell_main(void *arg) { os_tsk_pass (); #else #if defined(WOLFSSL_CMSIS_RTOS) - wc_UnLockMutex((wolfSSL_Mutex *)&command_mutex) ; - cmd = osThreadCreate (osThread (command_invoke) , &args); - if(cmd == NULL) { - printf("Cannon create command thread\n") ; - } - osThreadYield (); + wc_UnLockMutex((wolfSSL_Mutex *)&command_mutex) ; + cmd = osThreadCreate (osThread (command_invoke) , &args); + if(cmd == NULL) { + printf("Cannon create command thread\n") ; + } + osThreadYield (); #else - command_invoke(&args) ; + command_invoke(&args) ; #endif #endif #ifdef HAVE_KEIL_RTX diff --git a/IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c b/IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c index 26381848e4..2e1d7707bc 100644 --- a/IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c +++ b/IDE/ROWLEY-CROSSWORKS-ARM/arm_startup.c @@ -51,7 +51,7 @@ void memcpy32(uint32_t* src, uint32_t* dst_beg, uint32_t* dst_end) void meminit32(uint32_t* start, uint32_t* end) { while (start < end) { - *start++ = 0; + *start++ = 0; } } diff --git a/mqx/util_lib/Sources/util.c b/mqx/util_lib/Sources/util.c index c7ce08bcaa..47943b54e3 100644 --- a/mqx/util_lib/Sources/util.c +++ b/mqx/util_lib/Sources/util.c @@ -134,8 +134,8 @@ int sdcard_open(MQX_FILE_PTR *com_handle, MQX_FILE_PTR *sdcard_handle, } int sdcard_close(MQX_FILE_PTR *sdcard_handle, MQX_FILE_PTR *partman_handle, - MQX_FILE_PTR *filesystem_handle, - char *partman_name, char *filesystem_name) + MQX_FILE_PTR *filesystem_handle, + char *partman_name, char *filesystem_name) { _mqx_int error_code; diff --git a/mqx/util_lib/Sources/util.h b/mqx/util_lib/Sources/util.h index 67bdca2fe1..bd7a676149 100644 --- a/mqx/util_lib/Sources/util.h +++ b/mqx/util_lib/Sources/util.h @@ -4,11 +4,11 @@ #define UTIL_H_ int sdcard_open(MQX_FILE_PTR *com_handle, MQX_FILE_PTR *sdcard_handle, - MQX_FILE_PTR *partman_handle, MQX_FILE_PTR *filesystem_handle, - char *partman_name, char *filesystem_name); + MQX_FILE_PTR *partman_handle, MQX_FILE_PTR *filesystem_handle, + char *partman_name, char *filesystem_name); int sdcard_close(MQX_FILE_PTR *sdcard_handle, MQX_FILE_PTR *partman_handle, - MQX_FILE_PTR *filesystem_handle, - char *partman_name, char *filesystem_name); + MQX_FILE_PTR *filesystem_handle, + char *partman_name, char *filesystem_name); #endif /* UTIL_H_ */ diff --git a/wolfcrypt/src/port/Renesas/renesas_common.c b/wolfcrypt/src/port/Renesas/renesas_common.c index 92401bd045..85aedec04e 100644 --- a/wolfcrypt/src/port/Renesas/renesas_common.c +++ b/wolfcrypt/src/port/Renesas/renesas_common.c @@ -543,7 +543,7 @@ void wc_CryptoCb_CleanupRenesasCmn(int* id) #endif /* WOLF_CRYPTO_CB */ #endif /* WOLFSSL_RENESAS_SCEPROTECT || WOLFSSL_RENESAS_SCEPROTECT_CRYPTONLY - /* WOLFSSL_RENESAS_TSIP_TLS*/ + /* WOLFSSL_RENESAS_TSIP_TLS*/ #if defined(WOLFSSL_RENESAS_SCEPROTECT) || defined(WOLFSSL_RENESAS_TSIP_TLS) diff --git a/wolfcrypt/src/port/kcapi/kcapi_hash.c b/wolfcrypt/src/port/kcapi/kcapi_hash.c index 72265d7b74..844f1f6f76 100644 --- a/wolfcrypt/src/port/kcapi/kcapi_hash.c +++ b/wolfcrypt/src/port/kcapi/kcapi_hash.c @@ -113,7 +113,7 @@ static int KcapiHashUpdate(wolfssl_KCAPI_Hash* hash, const byte* in, word32 sz) hash->heap, DYNAMIC_TYPE_TMP_BUFFER); if (pt == NULL) { ret = MEMORY_E; - } + } else { hash->msg = pt; } diff --git a/wolfcrypt/src/sp_dsp32.c b/wolfcrypt/src/sp_dsp32.c index c94da1bd1a..1912995407 100644 --- a/wolfcrypt/src/sp_dsp32.c +++ b/wolfcrypt/src/sp_dsp32.c @@ -4464,10 +4464,10 @@ int wolfSSL_DSP_ECC_Verify_256(remote_handle64 h, int32 *u1, int hashLen, int32* u2 = u2d; tmp = tmpd; - XMEMCPY(u2, r, 40); - XMEMCPY(p2->x, x, 40); - XMEMCPY(p2->y, y, 40); - XMEMCPY(p2->z, z, 40); + XMEMCPY(u2, r, 40); + XMEMCPY(p2->x, x, 40); + XMEMCPY(p2->y, y, 40); + XMEMCPY(p2->z, z, 40); sp_256_mul_10(s, s, p256_norm_order); err = sp_256_mod_10(s, s, p256_order); @@ -4492,7 +4492,7 @@ int wolfSSL_DSP_ECC_Verify_256(remote_handle64 h, int32 *u1, int hashLen, int32* /* (r + n*order).z'.z' mod prime == (u1.G + u2.Q)->x' */ /* Reload r and convert to Montgomery form. */ - XMEMCPY(u2, r, 40); + XMEMCPY(u2, r, 40); err = sp_256_mod_mul_norm_10(u2, u2, p256_mod); } @@ -4503,7 +4503,7 @@ int wolfSSL_DSP_ECC_Verify_256(remote_handle64 h, int32 *u1, int hashLen, int32* *res = (int)(sp_256_cmp_10(p1->x, u1) == 0); if (*res == 0) { /* Reload r and add order. */ - XMEMCPY(u2, r, 40); + XMEMCPY(u2, r, 40); carry = sp_256_add_10(u2, u2, p256_order); /* Carry means result is greater than mod and is not valid. */ if (carry == 0) {