refactor: review format and imports

This commit is contained in:
2026-05-11 07:53:28 +02:00
parent 8f0da378b0
commit cdc7df3e56
29 changed files with 30 additions and 37 deletions
+1 -2
View File
@@ -1,4 +1,3 @@
#include <bsd/string.h>
#include <limits.h>
#include <log.h>
#include <stdbool.h>
@@ -228,4 +227,4 @@ void args_parse(Parameters *params, int argc, char **argv) {
if (params->video_size == 0) {
params->video_size = params->internal_size;
}
}
}
+1 -1
View File
@@ -5,4 +5,4 @@
void args_parse(Parameters *params, int argc, char **argv);
#endif /* ARGS_H */
#endif /* ARGS_H */
+1 -1
View File
@@ -7,4 +7,4 @@ unsigned int arr_uint_index_of(UintArray array, unsigned int value);
unsigned int arr_uint_remap_index(UintArray offsets, unsigned int *index);
#endif /* ARR_H */
#endif /* ARR_H */
+1 -1
View File
@@ -87,4 +87,4 @@
#define MAX_TAP_VALUES 10
#endif
#endif /* CONFIG_H */
#endif /* CONFIG_H */
+1 -2
View File
@@ -1,4 +1,3 @@
#include <bsd/string.h>
#include <hashmap.h>
#include <log.h>
#include <stdlib.h>
@@ -139,4 +138,4 @@ unsigned int config_file_get_int(const ConfigFile *config, const char *key,
return (unsigned int)atoi(item->value);
}
void config_file_free(const ConfigFile *config) { hashmap_free(config->map); }
void config_file_free(const ConfigFile *config) { hashmap_free(config->map); }
-2
View File
@@ -1,4 +1,3 @@
#include <bsd/string.h>
#include <log.h>
#include <stdbool.h>
#include <stdio.h>
@@ -10,7 +9,6 @@
#include "types.h"
#include "file.h"
#include "string.h"
static time_t get_file_time(const File *file) {
struct stat attr;
+1 -1
View File
@@ -15,4 +15,4 @@ void file_dump(const char *path, const char *content);
void file_free(const File *file);
#endif /* FILE_H */
#endif /* FILE_H */
+1 -1
View File
@@ -5,4 +5,4 @@
void forge_run(const Parameters *params);
#endif /* FORGE_H */
#endif /* FORGE_H */
+1 -1
View File
@@ -17,7 +17,7 @@ int main(int argc, char **argv) {
puts(PACKAGE " " VERSION);
set_seed((unsigned long)time(NULL));
rand_set_seed((unsigned long)time(NULL));
forge_run(&params);
+1 -1
View File
@@ -3,4 +3,4 @@
int main(int argc, char **argv);
#endif /* MAIN_H */
#endif /* MAIN_H */
+1 -1
View File
@@ -1,10 +1,10 @@
#include <alsa/asoundlib.h>
#include <log.h>
#include <stdlib.h>
#include "types.h"
#include "config.h"
#include "log.h"
void midi_open(MidiDevice *device, const char *name) {
strlcpy(device->name, name, STR_LEN);
+1 -1
View File
@@ -11,4 +11,4 @@ bool midi_background_listen(const MidiDevice *device,
void (*event_callback)(unsigned char code,
unsigned char value));
#endif /* MIDI_H */
#endif /* MIDI_H */
+2 -3
View File
@@ -1,4 +1,4 @@
#include <bsd/string.h>
#include <log.h>
#include <string.h>
#include "types.h"
@@ -6,7 +6,6 @@
#include "config.h"
#include "config_file.h"
#include "file.h"
#include "log.h"
#include "project.h"
#include "state.h"
#include "string.h"
@@ -141,4 +140,4 @@ void project_free(const Project *project) {
}
config_file_free(&project->config);
}
}
+1 -1
View File
@@ -10,4 +10,4 @@ void project_reload(Project *project, void (*reload_callback)(unsigned int));
void project_free(const Project *project);
#endif /* PROJECT_H */
#endif /* PROJECT_H */
+2 -2
View File
@@ -13,11 +13,11 @@ static unsigned long rand(void) {
return (unsigned long)(x >> (22 + count));
}
void set_seed(unsigned long long seed) {
void rand_set_seed(unsigned long long seed) {
mcg_state = 2 * seed + 1;
(void)rand();
}
unsigned int rand_uint(const unsigned int max) {
return max == 0 ? 0 : (unsigned int)(rand() % max);
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef RAND_H
#define RAND_H
void set_seed(unsigned long long seed);
void rand_set_seed(unsigned long long seed);
unsigned int rand_uint(unsigned int max);
#endif
#endif
+1 -1
View File
@@ -32,4 +32,4 @@ SharedContext *shared_init_context(const char *key) {
void shared_close_context(SharedContext *shared) {
close_shared(shared, sizeof(SharedContext), shared->fd);
}
}
+1 -1
View File
@@ -6,4 +6,4 @@
SharedContext *shared_init_context(const char *key);
void shared_close_context(SharedContext *shared);
#endif /* SHARED_H */
#endif /* SHARED_H */
+1 -1
View File
@@ -22,4 +22,4 @@ void state_init(SharedContext *context, const StateConfig *state_config,
void state_save(const SharedContext *context, const StateConfig *state_config);
#endif /* STATE_H */
#endif /* STATE_H */
+1 -2
View File
@@ -1,4 +1,3 @@
#include <bsd/string.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@@ -73,4 +72,4 @@ char *string_replace_at(const char *src, unsigned int from, unsigned int to,
strlcpy(dst + from + rpl_len, src + to, src_len - to + 1);
return dst;
}
}
+1 -1
View File
@@ -10,4 +10,4 @@ bool string_is_number(const char *value);
char *string_replace_at(const char *src, unsigned int from, unsigned int to,
const char *rpl);
#endif /* STRINGS_H */
#endif /* STRINGS_H */
+1 -1
View File
@@ -137,4 +137,4 @@ double tempo_total(const Tempo *tempo) {
double tempo_progress(const Tempo *tempo, double modulo) {
return fmod(tempo_total(tempo), modulo);
}
}
+1 -1
View File
@@ -13,4 +13,4 @@ double tempo_total(const Tempo *tempo);
double tempo_progress(const Tempo *tempo, double modulo);
#endif /* TEMPO_H */
#endif /* TEMPO_H */
+1 -1
View File
@@ -31,4 +31,4 @@ double timer_reset(Timer *timer) {
timer->counter = 0;
return per_secs;
}
}
+1 -1
View File
@@ -9,4 +9,4 @@ bool timer_inc(Timer *timer);
double timer_reset(Timer *timer);
#endif /* TIMER_H */
#endif /* TIMER_H */
-1
View File
@@ -8,7 +8,6 @@
#include <hashmap.h>
#include <linmath.h>
#include <stdbool.h>
#include <sys/time.h>
#include <time.h>
#include "config.h"
+1 -1
View File
@@ -11,4 +11,4 @@ bool video_background_read(VideoCapture *video_capture, SharedContext *context,
void video_free(const VideoCapture *video_capture);
#endif /* VIDEO_H */
#endif /* VIDEO_H */
+1 -1
View File
@@ -165,4 +165,4 @@ unsigned int window_read_key(int key, int action, int mods) {
result += 100000;
}
return result;
}
}
+1 -1
View File
@@ -29,4 +29,4 @@ bool window_escape_key(int key, int action);
unsigned int window_read_key(int key, int action, int mods);
#endif /* WINDOW_H */
#endif /* WINDOW_H */