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