Refactor project
Crealned up some TODOs, FIXMEs etc. Added better error handling. Looks better, feels better.
This commit is contained in:
1 parent
bd4dd74881
commit
42dc4d6fcd
29 files changed
+750
-645
No files matched your search
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* @file rse_commons.h
|
||||
* @author Piotr Krygier (everyonecancode@gmail.com)
|
||||
* @brief Common functionality for all modules
|
||||
* @version 0.1
|
||||
* @date 2023-10-05
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef RSE_COMMONS_H
|
||||
#define RSE_COMMONS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* @brief Macro for allocating memory and checking it on the same line
|
||||
*
|
||||
*/
|
||||
#define rse_malloc(ptr, size) \
|
||||
ptr = malloc(size); \
|
||||
if (ptr == NULL) { \
|
||||
LOGF(common_messages[COMMON_ERROR_MEMORY_ALLOCATION_FAILED]); \
|
||||
return RSE_COMMON_ERROR_MALLLOC_FAILED; \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Error type for RSE
|
||||
*
|
||||
*/
|
||||
typedef uint32_t rse_err_t;
|
||||
|
||||
#endif /* RSE_COMMONS_H */
|
||||
Reference in new issue
Block a user