fix: reformat codebase and fix const-correctness for CI lint
CI / lint (push) Failing after 16s
CI / build-and-test (push) Has been skipped
CI / sanitizers (address) (push) Has been skipped
CI / sanitizers (thread) (push) Has been skipped
CI / lint (pull_request) Failing after 44s
CI / build-and-test (pull_request) Has been skipped
CI / sanitizers (address) (pull_request) Has been skipped
CI / sanitizers (thread) (pull_request) Has been skipped

- Reformat all C/H files to match .clang-format (LLVM style)
- Fix 26 cppcheck const-correctness warnings (constParameterPointer,
  constVariablePointer, constVariable)
- Update function declarations in headers to match const parameters
This commit is contained in:
2026-07-19 15:57:31 +02:00
parent 02266710fb
commit 23b1d6660c
44 changed files with 1053 additions and 923 deletions
+9 -8
View File
@@ -2,8 +2,8 @@
#include "log.h"
#include "stdlib.h"
Data *data_create_empty(size_t data_size) {
void *data = malloc(data_size);
Data* data_create_empty(size_t data_size) {
void* data = malloc(data_size);
if (data == NULL) {
log_message(LOG_LEVEL_ERROR, "Could not allocate memory for empty data");
return NULL;
@@ -11,8 +11,8 @@ Data *data_create_empty(size_t data_size) {
return data_create(data, data_size);
}
Data *data_create_reserve(size_t size) {
Data *d = malloc(sizeof(Data));
Data* data_create_reserve(size_t size) {
Data* d = malloc(sizeof(Data));
if (d == NULL) {
log_message(LOG_LEVEL_ERROR, "Could not allocate memory for data");
return NULL;
@@ -22,8 +22,8 @@ Data *data_create_reserve(size_t size) {
return d;
}
Data *data_create(void *data, size_t data_size) {
Data *new_data = malloc(sizeof(Data));
Data* data_create(void* data, size_t data_size) {
Data* new_data = malloc(sizeof(Data));
if (new_data == NULL) {
log_message(LOG_LEVEL_ERROR, "Could not allocate memory for data");
free(data);
@@ -34,8 +34,9 @@ Data *data_create(void *data, size_t data_size) {
return new_data;
}
void data_destroy(Data *data) {
if (data == NULL) return;
void data_destroy(Data* data) {
if (data == NULL)
return;
free(data->data);
free(data);
}