gyrojeff commited on
Commit
d7d19bd
1 Parent(s): a9b34cd

feat: make consts into macros

Browse files
Files changed (1) hide show
  1. batch_generate_script_linux.c +14 -2
batch_generate_script_linux.c CHANGED
@@ -11,9 +11,21 @@ int total_mission = 64;
11
  int min_mission = 33;
12
  int max_mission = 48;
13
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  int main(int argc, char* argv[]) {
16
- for (int i = min_mission; i <= max_mission; i ++) {
17
  int pid = fork();
18
  if (pid < 0) {
19
  perror("fork");
@@ -26,7 +38,7 @@ int main(int argc, char* argv[]) {
26
  memset(batch_count, '\0', MAX_DIGIT * sizeof(char));
27
 
28
  sprintf(batch_number, "%d", i);
29
- sprintf(batch_count, "%d", total_mission);
30
 
31
  char *cmd = "./venv/bin/python";
32
  char *args[] = {"./venv/bin/python", "font_ds_generate_script.py", batch_number, batch_count, NULL};
 
11
  int min_mission = 33;
12
  int max_mission = 48;
13
 
14
+ #ifndef TOTAL_MISSION
15
+ #define TOTAL_MISSION total_mission
16
+ #endif
17
+
18
+ #ifndef MIN_MISSION
19
+ #define MIN_MISSION min_mission
20
+ #endif
21
+
22
+ #ifndef MAX_MISSION
23
+ #define MAX_MISSION max_mission
24
+ #endif
25
+
26
 
27
  int main(int argc, char* argv[]) {
28
+ for (int i = MIN_MISSION; i <= MAX_MISSION; i ++) {
29
  int pid = fork();
30
  if (pid < 0) {
31
  perror("fork");
 
38
  memset(batch_count, '\0', MAX_DIGIT * sizeof(char));
39
 
40
  sprintf(batch_number, "%d", i);
41
+ sprintf(batch_count, "%d", TOTAL_MISSION);
42
 
43
  char *cmd = "./venv/bin/python";
44
  char *args[] = {"./venv/bin/python", "font_ds_generate_script.py", batch_number, batch_count, NULL};