Skip to content

Commit 6d3136b

Browse files
committed
[3/3] Module rework fixup.
1 parent 808b884 commit 6d3136b

File tree

8 files changed

+37
-23
lines changed

8 files changed

+37
-23
lines changed

Diff for: src/modules/bgm_fish.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static char * fish_word(int * hitnl) {
136136
// transfers 'ownership' of args to this.
137137
static void fish_execute(char * module, int argc, char ** argv) {
138138
int i;
139-
int mcount = modules_count();
139+
int mcount = mod_count();
140140
int routing_rov = 0;
141141
if (!strcmp(module, "/then")) {
142142
// Oh, this'll be *hilarious...*
@@ -174,7 +174,7 @@ static void fish_execute(char * module, int argc, char ** argv) {
174174
//printf("\n");
175175

176176
for (i = 0; i < mcount; i++) {
177-
if (!strcmp(module, modules_get(i)->name)) {
177+
if (!strcmp(module, mod_get(i)->name)) {
178178
if (routing_rov) {
179179
main_force_random(i, argc, argv);
180180
} else {

Diff for: src/modules/flt_debug.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
#include <assert.h>
99
#include <stdlib.h>
1010

11-
static module* next;
11+
static module* nextm;
12+
static mod_flt* next;
1213

1314
int init(int nextno, char* argstr) {
1415
printf("flt_dummy loading. next mod is %i\n", nextno);
1516
fflush(stdin);
1617
// get next ptr.
17-
next = modules_get(nextno);
18+
nextm = mod_get(nextno);
19+
next = nextm->mod;
1820
printf("next is %p", next);
1921

2022
if (argstr) {
@@ -82,5 +84,5 @@ int deinit(void) {
8284
printf("deinit\n");
8385
fflush(stdin);
8486
assert(next != NULL);
85-
return next->deinit();
87+
return nextm->deinit();
8688
}

Diff for: src/modules/flt_flip_x.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
#include <timers.h>
55
#include <mod.h>
66

7-
static module* next;
7+
static module* nextm;
8+
static mod_flt* next;
89

910
int init(int nextno, char* argstr) {
1011
// get next ptr.
11-
next = modules_get(nextno);
12+
nextm = mod_get(nextno);
13+
next = nextm->mod;
1214
return 0;
1315
}
1416

@@ -47,5 +49,5 @@ void wait_until_break(void) {
4749
}
4850

4951
int deinit(void) {
50-
return next->deinit();
52+
return nextm->deinit();
5153
}

Diff for: src/modules/flt_flip_y.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
#include <timers.h>
55
#include <mod.h>
66

7-
static module* next;
7+
static module* nextm;
8+
static mod_flt* next;
89

910
int init(int nextno, char* argstr) {
1011
// get next ptr.
11-
next = modules_get(nextno);
12+
nextm = mod_get(nextno);
13+
next = nextm;
1214
return 0;
1315
}
1416

@@ -47,5 +49,5 @@ void wait_until_break(void) {
4749
}
4850

4951
int deinit(void) {
50-
return next->deinit();
52+
return nextm->deinit();
5153
}

Diff for: src/modules/flt_gamma_correct.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
#include <mod.h>
77
#include <math.h>
88

9-
static module* next;
9+
static module* nextm;
10+
static mod_flt* next;
1011

1112
#define GAMMA 2.8f
1213
#define WHITEPOINT {0.98f, 1.0f, 1.0f} // R, G, B, respectively.
@@ -20,7 +21,8 @@ static byte LUT_B[MAX_VAL + 1];
2021

2122
int init(int nextno, char* argstr) {
2223
// get next ptr.
23-
next = modules_get(nextno);
24+
nextm = mod_get(nextno);
25+
next = nextm->mod;
2426
float whitepoint[3] = WHITEPOINT;
2527

2628
int i;
@@ -71,5 +73,5 @@ void wait_until_break(void) {
7173
}
7274

7375
int deinit(void) {
74-
return next->deinit();
76+
return nextm->deinit();
7577
}

Diff for: src/modules/flt_rot_90.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
#include <mod.h>
66
#include <stdlib.h>
77

8-
static module* next;
8+
static module* nextm;
9+
static mod_flt* next;
910
static int rot;
1011

1112
int init(int nextno, char* argstr) {
1213
// get next ptr.
13-
next = modules_get(nextno);
14+
nextm = mod_get(nextno);
15+
next = nextm->mod;
1416
rot = 1;
1517
if (argstr)
1618
rot = atoi(argstr) & 0x03;
@@ -60,5 +62,5 @@ void wait_until_break(void) {
6062
}
6163

6264
int deinit(void) {
63-
return next->deinit();
65+
return nextm->deinit();
6466
}

Diff for: src/modules/flt_scale.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
#include <assert.h>
1111

1212
static int scale = 0;
13-
static module* next;
13+
static module* nextm;
14+
static mod_flt* next;
1415

1516
int init(int nextno, char* argstr) {
16-
next = modules_get(nextno);
17+
nextm = mod_get(nextno);
18+
next = nextm->mod;
1719

1820
if (!argstr) {
1921
eprintf("flt_scale: No scaling factor given.\n");
@@ -79,5 +81,5 @@ void wait_until_break(void) {
7981
}
8082

8183
int deinit(void) {
82-
return next->deinit();
84+
return nextm->deinit();
8385
}

Diff for: src/modules/flt_smapper.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
#include <stdlib.h>
66
#include <stdio.h>
77

8-
static module* next;
8+
static module* nextm;
9+
static mod_flt* next;
910
static int mx, my;
1011
static int folds, pane_x;
1112

1213
int init(int nextno, char* argstr) {
1314
// get next ptr.
14-
next = modules_get(nextno);
15+
nextm = mod_get(nextno);
16+
next = nextm->mod;
1517
mx = next->getx();
1618
my = next->gety();
1719

@@ -75,5 +77,5 @@ void wait_until_break(void) {
7577
}
7678

7779
int deinit(void) {
78-
return next->deinit();
80+
return nextm->deinit();
7981
}

0 commit comments

Comments
 (0)