[clang-format] use AllowShortFunctionsOnASingleLine: All (#8502)

This commit updates `AllowShortFunctionsOnASingleLine` to `All`
from `InlineOnly`.
This commit is contained in:
Abtin Keshavarzian
2022-12-08 09:34:05 -08:00
committed by GitHub
parent 48c0582e4e
commit 99a615bec2
229 changed files with 1285 additions and 4964 deletions
+60 -209
View File
@@ -76,28 +76,16 @@ bool sDiagMode = false;
extern "C" {
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize)
{
return calloc(aNum, aSize);
}
OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize) { return calloc(aNum, aSize); }
OT_TOOL_WEAK void otPlatFree(void *aPtr)
{
free(aPtr);
}
OT_TOOL_WEAK void otPlatFree(void *aPtr) { free(aPtr); }
#endif
OT_TOOL_WEAK void otTaskletsSignalPending(otInstance *)
{
}
OT_TOOL_WEAK void otTaskletsSignalPending(otInstance *) {}
OT_TOOL_WEAK void otPlatAlarmMilliStop(otInstance *)
{
}
OT_TOOL_WEAK void otPlatAlarmMilliStop(otInstance *) {}
OT_TOOL_WEAK void otPlatAlarmMilliStartAt(otInstance *, uint32_t, uint32_t)
{
}
OT_TOOL_WEAK void otPlatAlarmMilliStartAt(otInstance *, uint32_t, uint32_t) {}
OT_TOOL_WEAK uint32_t otPlatAlarmMilliGetNow(void)
{
@@ -108,13 +96,9 @@ OT_TOOL_WEAK uint32_t otPlatAlarmMilliGetNow(void)
return (uint32_t)((tv.tv_sec * 1000) + (tv.tv_usec / 1000) + 123456);
}
OT_TOOL_WEAK void otPlatAlarmMicroStop(otInstance *)
{
}
OT_TOOL_WEAK void otPlatAlarmMicroStop(otInstance *) {}
OT_TOOL_WEAK void otPlatAlarmMicroStartAt(otInstance *, uint32_t, uint32_t)
{
}
OT_TOOL_WEAK void otPlatAlarmMicroStartAt(otInstance *, uint32_t, uint32_t) {}
OT_TOOL_WEAK uint32_t otPlatAlarmMicroGetNow(void)
{
@@ -125,122 +109,55 @@ OT_TOOL_WEAK uint32_t otPlatAlarmMicroGetNow(void)
return (uint32_t)((tv.tv_sec * 1000000) + tv.tv_usec + 123456);
}
OT_TOOL_WEAK void otPlatRadioGetIeeeEui64(otInstance *, uint8_t *)
{
}
OT_TOOL_WEAK void otPlatRadioGetIeeeEui64(otInstance *, uint8_t *) {}
OT_TOOL_WEAK void otPlatRadioSetPanId(otInstance *, uint16_t)
{
}
OT_TOOL_WEAK void otPlatRadioSetPanId(otInstance *, uint16_t) {}
OT_TOOL_WEAK void otPlatRadioSetExtendedAddress(otInstance *, const otExtAddress *)
{
}
OT_TOOL_WEAK void otPlatRadioSetExtendedAddress(otInstance *, const otExtAddress *) {}
OT_TOOL_WEAK void otPlatRadioSetShortAddress(otInstance *, uint16_t)
{
}
OT_TOOL_WEAK void otPlatRadioSetShortAddress(otInstance *, uint16_t) {}
OT_TOOL_WEAK void otPlatRadioSetPromiscuous(otInstance *, bool)
{
}
OT_TOOL_WEAK void otPlatRadioSetPromiscuous(otInstance *, bool) {}
OT_TOOL_WEAK bool otPlatRadioIsEnabled(otInstance *)
{
return true;
}
OT_TOOL_WEAK bool otPlatRadioIsEnabled(otInstance *) { return true; }
OT_TOOL_WEAK otError otPlatRadioEnable(otInstance *)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatRadioEnable(otInstance *) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otError otPlatRadioDisable(otInstance *)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatRadioDisable(otInstance *) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otError otPlatRadioSleep(otInstance *)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatRadioSleep(otInstance *) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otError otPlatRadioReceive(otInstance *, uint8_t)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatRadioReceive(otInstance *, uint8_t) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otError otPlatRadioTransmit(otInstance *, otRadioFrame *)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatRadioTransmit(otInstance *, otRadioFrame *) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *)
{
return nullptr;
}
OT_TOOL_WEAK otRadioFrame *otPlatRadioGetTransmitBuffer(otInstance *) { return nullptr; }
OT_TOOL_WEAK int8_t otPlatRadioGetRssi(otInstance *)
{
return 0;
}
OT_TOOL_WEAK int8_t otPlatRadioGetRssi(otInstance *) { return 0; }
OT_TOOL_WEAK otRadioCaps otPlatRadioGetCaps(otInstance *)
{
return OT_RADIO_CAPS_NONE;
}
OT_TOOL_WEAK otRadioCaps otPlatRadioGetCaps(otInstance *) { return OT_RADIO_CAPS_NONE; }
OT_TOOL_WEAK bool otPlatRadioGetPromiscuous(otInstance *)
{
return false;
}
OT_TOOL_WEAK bool otPlatRadioGetPromiscuous(otInstance *) { return false; }
OT_TOOL_WEAK void otPlatRadioEnableSrcMatch(otInstance *, bool)
{
}
OT_TOOL_WEAK void otPlatRadioEnableSrcMatch(otInstance *, bool) {}
OT_TOOL_WEAK otError otPlatRadioAddSrcMatchShortEntry(otInstance *, uint16_t)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatRadioAddSrcMatchShortEntry(otInstance *, uint16_t) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otError otPlatRadioAddSrcMatchExtEntry(otInstance *, const otExtAddress *)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatRadioAddSrcMatchExtEntry(otInstance *, const otExtAddress *) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otError otPlatRadioClearSrcMatchShortEntry(otInstance *, uint16_t)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatRadioClearSrcMatchShortEntry(otInstance *, uint16_t) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otError otPlatRadioClearSrcMatchExtEntry(otInstance *, const otExtAddress *)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatRadioClearSrcMatchExtEntry(otInstance *, const otExtAddress *) { return OT_ERROR_NONE; }
OT_TOOL_WEAK void otPlatRadioClearSrcMatchShortEntries(otInstance *)
{
}
OT_TOOL_WEAK void otPlatRadioClearSrcMatchShortEntries(otInstance *) {}
OT_TOOL_WEAK void otPlatRadioClearSrcMatchExtEntries(otInstance *)
{
}
OT_TOOL_WEAK void otPlatRadioClearSrcMatchExtEntries(otInstance *) {}
OT_TOOL_WEAK otError otPlatRadioEnergyScan(otInstance *, uint8_t, uint16_t)
{
return OT_ERROR_NOT_IMPLEMENTED;
}
OT_TOOL_WEAK otError otPlatRadioEnergyScan(otInstance *, uint8_t, uint16_t) { return OT_ERROR_NOT_IMPLEMENTED; }
OT_TOOL_WEAK otError otPlatRadioSetTransmitPower(otInstance *, int8_t)
{
return OT_ERROR_NOT_IMPLEMENTED;
}
OT_TOOL_WEAK otError otPlatRadioSetTransmitPower(otInstance *, int8_t) { return OT_ERROR_NOT_IMPLEMENTED; }
OT_TOOL_WEAK int8_t otPlatRadioGetReceiveSensitivity(otInstance *)
{
return -100;
}
OT_TOOL_WEAK int8_t otPlatRadioGetReceiveSensitivity(otInstance *) { return -100; }
OT_TOOL_WEAK otError otPlatEntropyGet(uint8_t *aOutput, uint16_t aOutputLength)
{
@@ -281,84 +198,44 @@ OT_TOOL_WEAK void otPlatDiagProcess(otInstance *, uint8_t, char *aArgs[], char *
sprintf(aOutput, "diag feature '%s' is not supported\r\n", aArgs[0]);
}
OT_TOOL_WEAK void otPlatDiagModeSet(bool aMode)
{
sDiagMode = aMode;
}
OT_TOOL_WEAK void otPlatDiagModeSet(bool aMode) { sDiagMode = aMode; }
OT_TOOL_WEAK bool otPlatDiagModeGet()
{
return sDiagMode;
}
OT_TOOL_WEAK bool otPlatDiagModeGet() { return sDiagMode; }
OT_TOOL_WEAK void otPlatDiagChannelSet(uint8_t)
{
}
OT_TOOL_WEAK void otPlatDiagChannelSet(uint8_t) {}
OT_TOOL_WEAK void otPlatDiagTxPowerSet(int8_t)
{
}
OT_TOOL_WEAK void otPlatDiagTxPowerSet(int8_t) {}
OT_TOOL_WEAK void otPlatDiagRadioReceived(otInstance *, otRadioFrame *, otError)
{
}
OT_TOOL_WEAK void otPlatDiagRadioReceived(otInstance *, otRadioFrame *, otError) {}
OT_TOOL_WEAK void otPlatDiagAlarmCallback(otInstance *)
{
}
OT_TOOL_WEAK void otPlatDiagAlarmCallback(otInstance *) {}
OT_TOOL_WEAK void otPlatUartSendDone(void)
{
}
OT_TOOL_WEAK void otPlatUartSendDone(void) {}
OT_TOOL_WEAK void otPlatUartReceived(const uint8_t *, uint16_t)
{
}
OT_TOOL_WEAK void otPlatUartReceived(const uint8_t *, uint16_t) {}
OT_TOOL_WEAK void otPlatReset(otInstance *)
{
}
OT_TOOL_WEAK void otPlatReset(otInstance *) {}
OT_TOOL_WEAK otPlatResetReason otPlatGetResetReason(otInstance *)
{
return OT_PLAT_RESET_REASON_POWER_ON;
}
OT_TOOL_WEAK otPlatResetReason otPlatGetResetReason(otInstance *) { return OT_PLAT_RESET_REASON_POWER_ON; }
OT_TOOL_WEAK void otPlatLog(otLogLevel, otLogRegion, const char *, ...)
{
}
OT_TOOL_WEAK void otPlatLog(otLogLevel, otLogRegion, const char *, ...) {}
OT_TOOL_WEAK void otPlatSettingsInit(otInstance *, const uint16_t *, uint16_t)
{
}
OT_TOOL_WEAK void otPlatSettingsInit(otInstance *, const uint16_t *, uint16_t) {}
OT_TOOL_WEAK void otPlatSettingsDeinit(otInstance *)
{
}
OT_TOOL_WEAK void otPlatSettingsDeinit(otInstance *) {}
OT_TOOL_WEAK otError otPlatSettingsGet(otInstance *, uint16_t, int, uint8_t *, uint16_t *)
{
return OT_ERROR_NOT_FOUND;
}
OT_TOOL_WEAK otError otPlatSettingsSet(otInstance *, uint16_t, const uint8_t *, uint16_t)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatSettingsSet(otInstance *, uint16_t, const uint8_t *, uint16_t) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otError otPlatSettingsAdd(otInstance *, uint16_t, const uint8_t *, uint16_t)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatSettingsAdd(otInstance *, uint16_t, const uint8_t *, uint16_t) { return OT_ERROR_NONE; }
OT_TOOL_WEAK otError otPlatSettingsDelete(otInstance *, uint16_t, int)
{
return OT_ERROR_NONE;
}
OT_TOOL_WEAK otError otPlatSettingsDelete(otInstance *, uint16_t, int) { return OT_ERROR_NONE; }
OT_TOOL_WEAK void otPlatSettingsWipe(otInstance *)
{
}
OT_TOOL_WEAK void otPlatSettingsWipe(otInstance *) {}
uint8_t *GetFlash(void)
{
@@ -374,14 +251,9 @@ uint8_t *GetFlash(void)
return sFlash;
}
OT_TOOL_WEAK void otPlatFlashInit(otInstance *)
{
}
OT_TOOL_WEAK void otPlatFlashInit(otInstance *) {}
OT_TOOL_WEAK uint32_t otPlatFlashGetSwapSize(otInstance *)
{
return FLASH_SWAP_SIZE;
}
OT_TOOL_WEAK uint32_t otPlatFlashGetSwapSize(otInstance *) { return FLASH_SWAP_SIZE; }
OT_TOOL_WEAK void otPlatFlashErase(otInstance *, uint8_t aSwapIndex)
{
@@ -428,10 +300,7 @@ OT_TOOL_WEAK void otPlatFlashWrite(otInstance *,
}
#if OPENTHREAD_CONFIG_TIME_SYNC_ENABLE || OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
OT_TOOL_WEAK uint16_t otPlatTimeGetXtalAccuracy(void)
{
return 0;
}
OT_TOOL_WEAK uint16_t otPlatTimeGetXtalAccuracy(void) { return 0; }
#endif
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
@@ -440,9 +309,7 @@ OT_TOOL_WEAK otError otPlatRadioEnableCsl(otInstance *, uint32_t, otShortAddress
return OT_ERROR_NONE;
}
OT_TOOL_WEAK void otPlatRadioUpdateCslSampleTime(otInstance *, uint32_t)
{
}
OT_TOOL_WEAK void otPlatRadioUpdateCslSampleTime(otInstance *, uint32_t) {}
OT_TOOL_WEAK uint8_t otPlatRadioGetCslAccuracy(otInstance *)
{
@@ -451,27 +318,17 @@ OT_TOOL_WEAK uint8_t otPlatRadioGetCslAccuracy(otInstance *)
#endif
#if OPENTHREAD_CONFIG_OTNS_ENABLE
OT_TOOL_WEAK void otPlatOtnsStatus(const char *)
{
}
OT_TOOL_WEAK void otPlatOtnsStatus(const char *) {}
#endif
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
OT_TOOL_WEAK void otPlatTrelEnable(otInstance *, uint16_t *)
{
}
OT_TOOL_WEAK void otPlatTrelEnable(otInstance *, uint16_t *) {}
OT_TOOL_WEAK void otPlatTrelDisable(otInstance *)
{
}
OT_TOOL_WEAK void otPlatTrelDisable(otInstance *) {}
OT_TOOL_WEAK void otPlatTrelSend(otInstance *, const uint8_t *, uint16_t, const otSockAddr *)
{
}
OT_TOOL_WEAK void otPlatTrelSend(otInstance *, const uint8_t *, uint16_t, const otSockAddr *) {}
OT_TOOL_WEAK void otPlatTrelRegisterService(otInstance *, uint16_t, const uint8_t *, uint8_t)
{
}
OT_TOOL_WEAK void otPlatTrelRegisterService(otInstance *, uint16_t, const uint8_t *, uint8_t) {}
#endif
#if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE
@@ -494,20 +351,14 @@ OT_TOOL_WEAK otLinkMetrics otPlatRadioGetEnhAckProbingMetrics(otInstance *, cons
#endif
#if OPENTHREAD_CONFIG_BORDER_ROUTING_ENABLE
OT_TOOL_WEAK bool otPlatInfraIfHasAddress(uint32_t, const otIp6Address *)
{
return false;
}
OT_TOOL_WEAK bool otPlatInfraIfHasAddress(uint32_t, const otIp6Address *) { return false; }
OT_TOOL_WEAK otError otPlatInfraIfSendIcmp6Nd(uint32_t, const otIp6Address *, const uint8_t *, uint16_t)
{
return OT_ERROR_FAILED;
}
OT_TOOL_WEAK otError otPlatInfraIfDiscoverNat64Prefix(uint32_t)
{
return OT_ERROR_FAILED;
}
OT_TOOL_WEAK otError otPlatInfraIfDiscoverNat64Prefix(uint32_t) { return OT_ERROR_FAILED; }
#endif
#if OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE