Got rid of inline prototypes
This commit is contained in:
parent
31c092774c
commit
0f78b1a7eb
11 changed files with 35 additions and 35 deletions
|
@ -108,19 +108,19 @@ FILE* config_open(char *filename, char *mode) {
|
|||
return out;
|
||||
}
|
||||
|
||||
inline int config_intval_p(ConfigEntry *e) {
|
||||
int config_intval_p(ConfigEntry *e) {
|
||||
return tconfig.intval[e->key];
|
||||
}
|
||||
|
||||
inline char* config_strval_p(ConfigEntry *e) {
|
||||
char* config_strval_p(ConfigEntry *e) {
|
||||
return tconfig.strval[e->key];
|
||||
}
|
||||
|
||||
inline int config_intval(char *key) {
|
||||
int config_intval(char *key) {
|
||||
return config_intval_p(config_findentry(key));
|
||||
}
|
||||
|
||||
inline char* config_strval(char *key) {
|
||||
char* config_strval(char *key) {
|
||||
return config_strval_p(config_findentry(key));
|
||||
}
|
||||
|
||||
|
|
|
@ -77,9 +77,9 @@ void config_load(char *filename);
|
|||
void config_save(char *filename);
|
||||
ConfigEntry* config_findentry(char *name);
|
||||
|
||||
inline int config_intval(char*);
|
||||
inline int config_intval_p(ConfigEntry*);
|
||||
inline char* config_strval(char*);
|
||||
inline char* config_strval_p(ConfigEntry*);
|
||||
int config_intval(char*);
|
||||
int config_intval_p(ConfigEntry*);
|
||||
char* config_strval(char*);
|
||||
char* config_strval_p(ConfigEntry*);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -121,19 +121,19 @@ void fade_out(float f) {
|
|||
colorfill(0, 0, 0, f);
|
||||
}
|
||||
|
||||
inline double psin(double x) {
|
||||
double psin(double x) {
|
||||
return 0.5 + 0.5 * sin(x);
|
||||
}
|
||||
|
||||
inline double max(double a, double b) {
|
||||
double max(double a, double b) {
|
||||
return (a > b)? a : b;
|
||||
}
|
||||
|
||||
inline double min(double a, double b) {
|
||||
double min(double a, double b) {
|
||||
return (a < b)? a : b;
|
||||
}
|
||||
|
||||
inline double clamp(double f, double lower, double upper) {
|
||||
double clamp(double f, double lower, double upper) {
|
||||
if(f < lower)
|
||||
return lower;
|
||||
if(f > upper)
|
||||
|
|
|
@ -126,7 +126,7 @@ int collision_item(Item *i) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
inline void spawn_item(complex pos, Type type) {
|
||||
void spawn_item(complex pos, Type type) {
|
||||
tsrand_fill(2);
|
||||
create_item(pos, 5*cexp(I*tsrand_a(0)/afrand(1)*M_PI*2), type);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ typedef struct Projectile {
|
|||
} Projectile;
|
||||
|
||||
Color *rgba(float r, float g, float b, float a);
|
||||
inline Color *rgb(float r, float g, float b);
|
||||
Color *rgb(float r, float g, float b);
|
||||
|
||||
#define create_particle3c(n,p,c,d,r,a1,a2,a3) create_particle4c(n,p,c,d,r,a1,a2,a3,0)
|
||||
#define create_particle2c(n,p,c,d,r,a1,a2) create_particle4c(n,p,c,d,r,a1,a2,0,0)
|
||||
|
|
16
src/random.c
16
src/random.c
|
@ -33,19 +33,19 @@ int tsrand_p(RandomState *rnd) {
|
|||
return (uint32_t)((rnd->z << 16u) + rnd->w) % TSRAND_MAX;
|
||||
}
|
||||
|
||||
inline void tsrand_seed(uint32_t seed) {
|
||||
void tsrand_seed(uint32_t seed) {
|
||||
tsrand_seed_p(tsrand_current, seed);
|
||||
}
|
||||
|
||||
inline int tsrand(void) {
|
||||
int tsrand(void) {
|
||||
return tsrand_p(tsrand_current);
|
||||
}
|
||||
|
||||
inline double frand(void) {
|
||||
double frand(void) {
|
||||
return tsrand()/(double)TSRAND_MAX;
|
||||
}
|
||||
|
||||
inline double nfrand(void) {
|
||||
double nfrand(void) {
|
||||
return frand() * 2 - 1;
|
||||
}
|
||||
|
||||
|
@ -96,21 +96,21 @@ void tsrand_fill_p(RandomState *rnd, int amount) {
|
|||
tsrand_array[i] = tsrand_p(rnd);
|
||||
}
|
||||
|
||||
inline void tsrand_fill(int amount) {
|
||||
void tsrand_fill(int amount) {
|
||||
tsrand_fill_p(tsrand_current, amount);
|
||||
}
|
||||
|
||||
inline int tsrand_a(int idx) {
|
||||
int tsrand_a(int idx) {
|
||||
if(idx >= tsrand_array_elems || idx < 0)
|
||||
errx(-1, "tsrand_a: index out of range (%i / %i)", idx, tsrand_array_elems);
|
||||
return tsrand_array[idx];
|
||||
}
|
||||
|
||||
inline double afrand(int idx) {
|
||||
double afrand(int idx) {
|
||||
return tsrand_a(idx)/(double)TSRAND_MAX;
|
||||
}
|
||||
|
||||
inline double anfrand(int idx) {
|
||||
double anfrand(int idx) {
|
||||
return afrand(idx) * 2 - 1;
|
||||
}
|
||||
|
||||
|
|
16
src/random.h
16
src/random.h
|
@ -21,17 +21,17 @@ void tsrand_switch(RandomState *rnd);
|
|||
void tsrand_seed_p(RandomState *rnd, uint32_t seed);
|
||||
int tsrand_p(RandomState *rnd);
|
||||
|
||||
inline void tsrand_seed(uint32_t seed);
|
||||
inline int tsrand(void);
|
||||
void tsrand_seed(uint32_t seed);
|
||||
int tsrand(void);
|
||||
|
||||
inline double frand(void);
|
||||
inline double nfrand(void);
|
||||
double frand(void);
|
||||
double nfrand(void);
|
||||
|
||||
void tsrand_fill_p(RandomState *rnd, int amount);
|
||||
inline void tsrand_fill(int amount);
|
||||
inline int tsrand_a(int idx);
|
||||
inline double afrand(int idx);
|
||||
inline double anfrand(int idx);
|
||||
void tsrand_fill(int amount);
|
||||
int tsrand_a(int idx);
|
||||
double afrand(int idx);
|
||||
double anfrand(int idx);
|
||||
|
||||
#define TSRAND_MAX INT32_MAX
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ void parse_obj(char *filename, ObjFileData *data) {
|
|||
}
|
||||
}
|
||||
|
||||
static inline void bad_reference_error(char *filename, char *aux, int n) {
|
||||
static void bad_reference_error(char *filename, char *aux, int n) {
|
||||
errx(-1, "load_model():\n!- OBJ file '%s': Index %d: bad %s index reference\n", filename, n, aux);
|
||||
}
|
||||
|
||||
|
@ -227,4 +227,4 @@ void delete_model(void **models, void *model) {
|
|||
|
||||
void delete_models() { // Does not delete elements from the VBO, so doing this at runtime is leaking VBO space
|
||||
delete_all_elements((void **)&resources.models, delete_model);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ Color *rgba(float r, float g, float b, float a) {
|
|||
return clr;
|
||||
}
|
||||
|
||||
inline Color *rgb(float r, float g, float b) {
|
||||
Color *rgb(float r, float g, float b) {
|
||||
return rgba(r, g, b, 1.0);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ void set_perspective_viewport(Stage3D *s, float n, float f, int vx, int vy, int
|
|||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
|
||||
inline void set_perspective(Stage3D *s, float n, float f) {
|
||||
void set_perspective(Stage3D *s, float n, float f) {
|
||||
set_perspective_viewport(s, n, f, VIEWPORT_X, VIEWPORT_Y, VIEWPORT_W, VIEWPORT_H);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ void init_stage3d(Stage3D *s);
|
|||
void add_model(Stage3D *s, SegmentDrawRule draw, SegmentPositionRule pos);
|
||||
|
||||
void set_perspective_viewport(Stage3D *s, float n, float f, int vx, int vy, int vw, int vh);
|
||||
inline void set_perspective(Stage3D *s, float near, float far);
|
||||
void set_perspective(Stage3D *s, float near, float far);
|
||||
void draw_stage3d(Stage3D *s, float maxrange);
|
||||
|
||||
void free_stage3d(Stage3D *s);
|
||||
|
|
Loading…
Reference in a new issue