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
+19 -24
View File
@@ -3,15 +3,12 @@
#include <stdbool.h>
typedef enum {
TRANSPORT_TCP,
TRANSPORT_SSH
} TransportType;
typedef enum { TRANSPORT_TCP, TRANSPORT_SSH } TransportType;
typedef struct Config {
char *version;
char *send_directory;
char *receive_root_directory;
char* version;
char* send_directory;
char* receive_root_directory;
bool save_to_disk;
bool use_multithreading;
bool use_chunk_serialization;
@@ -25,33 +22,31 @@ typedef struct Config {
unsigned long long chunk_size;
int ssh_port;
TransportType transport;
char *ssh_destination;
char **exclude_patterns;
char* ssh_destination;
char** exclude_patterns;
int exclude_count;
char **include_patterns;
char** include_patterns;
int include_count;
unsigned long long max_size;
unsigned long long min_size;
bool use_incremental;
bool use_tls;
char *tls_cert;
char *tls_key;
char *tls_ca;
char* tls_cert;
char* tls_key;
char* tls_ca;
} Config;
#define PROTOCOL_VERSION "1.1.0"
#define DEFAULT_CHUNK_SIZE (10 * 1024 * 1024)
Config *config_create(char *version, char *send_directory,
char *receive_directory, bool save_to_disk,
bool use_multithreading, bool use_chunk_serialization,
bool use_compression, bool use_metadata,
int compression_level, bool use_sendfile,
unsigned long long chunk_size);
void config_delete(Config *config);
bool config_send(int file_descriptor, Config *config);
Config *config_receive(int file_descriptor);
bool is_remote_dest(const char *s);
void config_parse_ssh_dest(Config *config);
Config* config_create(char* version, char* send_directory, char* receive_directory,
bool save_to_disk, bool use_multithreading, bool use_chunk_serialization,
bool use_compression, bool use_metadata, int compression_level,
bool use_sendfile, unsigned long long chunk_size);
void config_delete(Config* config);
bool config_send(int file_descriptor, Config* config);
Config* config_receive(int file_descriptor);
bool is_remote_dest(const char* s);
void config_parse_ssh_dest(Config* config);
#endif