FEAT: Implemented a more streamlined error handler.
REFACTOR: Completely rewrote insert and cleaned up names and redundant code.
This commit is contained in:
+4
-1
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define CAPACITY 1024
|
||||
#define SUCCESS 0
|
||||
|
||||
@@ -10,9 +11,10 @@
|
||||
#define ERR_ALLOC_FAIL 20
|
||||
#define ERR_BUF_NULL 21
|
||||
#define ERR_BAD_TYPE 22
|
||||
#define ERR_INVALID_SIZE 23
|
||||
#define ERR_SIZE_ZERO 23
|
||||
#define ERR_VECTOR_NULL 24
|
||||
#define ERR_MAX_PASSED 25
|
||||
#define ERR_OUT_OF_BOUNDS 26
|
||||
|
||||
extern const char* error_messages[];
|
||||
|
||||
@@ -22,6 +24,7 @@ extern const char* error_messages[];
|
||||
error_messages[error_code]) /**< Print log error message*/
|
||||
|
||||
#define find_len(arr) sizeof(arr) / sizeof(arr[0])
|
||||
|
||||
static const size_t VEC_MAX = SIZE_MAX / sizeof(int);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user