Apply clang-tidy

This commit is contained in:
Tilen Majerle
2023-11-20 21:20:25 +01:00
parent 9dda4c6e5d
commit e5d85536d2
4 changed files with 40 additions and 2 deletions

19
.clang-tidy Normal file
View File

@@ -0,0 +1,19 @@
---
Checks: "*,
-abseil-*,
-altera-*,
-android-*,
-fuchsia-*,
-google-*,
-llvm*,
-modernize-use-trailing-return-type,
-zircon-*,
-readability-else-after-return,
-readability-static-accessed-through-instance,
-readability-avoid-const-params-in-decls,
-cppcoreguidelines-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes,
"
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none

View File

@@ -12,5 +12,6 @@
"bitset": "c",
"stdio.h": "c"
},
"esbonio.sphinx.confDir": ""
"esbonio.sphinx.confDir": "",
"C_Cpp.codeAnalysis.clangTidy.useBuildPath": true
}

View File

@@ -52,6 +52,24 @@ extern "C" {
* \{
*/
/**
* \brief Memory set function
*
* \note Function footprint is the same as \ref memset
*/
#ifndef LWBTN_MEMSET
#define LWBTN_MEMSET(dst, val, len) memset((dst), (val), (len))
#endif
/**
* \brief Memory copy function
*
* \note Function footprint is the same as \ref memcpy
*/
#ifndef LWBTN_MEMCPY
#define LWBTN_MEMCPY(dst, src, len) memcpy((dst), (src), (len))
#endif
/**
* \brief Enables `1` or disables `0` periodic keep alive events.
*

View File

@@ -292,7 +292,7 @@ lwbtn_init_ex(lwbtn_t* lwobj, lwbtn_btn_t* btns, uint16_t btns_cnt, lwbtn_get_st
return 0;
}
memset(lwobj, 0x00, sizeof(*lwobj));
LWBTN_MEMSET(lwobj, 0x00, sizeof(*lwobj));
lwobj->btns = btns;
lwobj->btns_cnt = btns_cnt;
lwobj->evt_fn = evt_fn;