Commit 8139b905 authored by Christophe Mutricy's avatar Christophe Mutricy

galaktos/*: warnings hunt

parent b14c3b37
...@@ -30,8 +30,12 @@ ...@@ -30,8 +30,12 @@
//Takes sound data from wherever and hands it back out. //Takes sound data from wherever and hands it back out.
//Returns PCM Data or spectrum data, or the derivative of the PCM data //Returns PCM Data or spectrum data, or the derivative of the PCM data
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h> #include <inttypes.h>
#include "fftsg.h"
double **PCMd; //data structure to store PCM data PCM[channels][maxsamples] double **PCMd; //data structure to store PCM data PCM[channels][maxsamples]
int maxsamples; //size of PCM buffer int maxsamples; //size of PCM buffer
int start; //where to add data next int start; //where to add data next
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
// //
//Some stuff was taken from Frederic Patin's beat-detection article, you'll find it online //Some stuff was taken from Frederic Patin's beat-detection article, you'll find it online
#include <stdlib.h>
#include <stdio.h>
#include "engine_vars.h" #include "engine_vars.h"
double beat_buffer[32][80],beat_instant[32],beat_history[32]; double beat_buffer[32][80],beat_instant[32],beat_history[32];
......
...@@ -24,29 +24,31 @@ ...@@ -24,29 +24,31 @@
#include <math.h> #include <math.h>
#include <stdlib.h>
#include <stdio.h>
/* Values to optimize the sigmoid function */ /* Values to optimize the sigmoid function */
#define R 32767 #define R 32767
#define RR 65534 #define RR 65534
inline double int_wrapper(double * arg_list) { static inline double int_wrapper(double * arg_list) {
return floor(arg_list[0]); return floor(arg_list[0]);
} }
inline double sqr_wrapper(double * arg_list) { static inline double sqr_wrapper(double * arg_list) {
return pow(2, arg_list[0]); return pow(2, arg_list[0]);
} }
inline double sign_wrapper(double * arg_list) { static inline double sign_wrapper(double * arg_list) {
return -arg_list[0]; return -arg_list[0];
} }
inline double min_wrapper(double * arg_list) { static inline double min_wrapper(double * arg_list) {
if (arg_list[0] > arg_list[1]) if (arg_list[0] > arg_list[1])
return arg_list[1]; return arg_list[1];
...@@ -54,7 +56,7 @@ inline double min_wrapper(double * arg_list) { ...@@ -54,7 +56,7 @@ inline double min_wrapper(double * arg_list) {
return arg_list[0]; return arg_list[0];
} }
inline double max_wrapper(double * arg_list) { static inline double max_wrapper(double * arg_list) {
if (arg_list[0] > arg_list[1]) if (arg_list[0] > arg_list[1])
return arg_list[0]; return arg_list[0];
...@@ -63,25 +65,25 @@ inline double max_wrapper(double * arg_list) { ...@@ -63,25 +65,25 @@ inline double max_wrapper(double * arg_list) {
} }
/* consult your AI book */ /* consult your AI book */
inline double sigmoid_wrapper(double * arg_list) { static inline double sigmoid_wrapper(double * arg_list) {
return (RR / (1 + exp( -(((double)(arg_list[0])) * arg_list[1]) / R) - R)); return (RR / (1 + exp( -(((double)(arg_list[0])) * arg_list[1]) / R) - R));
} }
inline double bor_wrapper(double * arg_list) { static inline double bor_wrapper(double * arg_list) {
return (double)((int)arg_list[0] || (int)arg_list[1]); return (double)((int)arg_list[0] || (int)arg_list[1]);
} }
inline double band_wrapper(double * arg_list) { static inline double band_wrapper(double * arg_list) {
return (double)((int)arg_list[0] && (int)arg_list[1]); return (double)((int)arg_list[0] && (int)arg_list[1]);
} }
inline double bnot_wrapper(double * arg_list) { static inline double bnot_wrapper(double * arg_list) {
return (double)(!(int)arg_list[0]); return (double)(!(int)arg_list[0]);
} }
inline double if_wrapper(double * arg_list) { static inline double if_wrapper(double * arg_list) {
if ((int)arg_list[0] == 0) if ((int)arg_list[0] == 0)
return arg_list[2]; return arg_list[2];
...@@ -89,7 +91,7 @@ inline double if_wrapper(double * arg_list) { ...@@ -89,7 +91,7 @@ inline double if_wrapper(double * arg_list) {
} }
inline double rand_wrapper(double * arg_list) { static inline double rand_wrapper(double * arg_list) {
double l; double l;
// printf("RAND ARG:(%d)\n", (int)arg_list[0]); // printf("RAND ARG:(%d)\n", (int)arg_list[0]);
...@@ -98,78 +100,78 @@ inline double rand_wrapper(double * arg_list) { ...@@ -98,78 +100,78 @@ inline double rand_wrapper(double * arg_list) {
return l; return l;
} }
inline double equal_wrapper(double * arg_list) { static inline double equal_wrapper(double * arg_list) {
return (arg_list[0] == arg_list[1]); return (arg_list[0] == arg_list[1]);
} }
inline double above_wrapper(double * arg_list) { static inline double above_wrapper(double * arg_list) {
return (arg_list[0] > arg_list[1]); return (arg_list[0] > arg_list[1]);
} }
inline double below_wrapper(double * arg_list) { static inline double below_wrapper(double * arg_list) {
return (arg_list[0] < arg_list[1]); return (arg_list[0] < arg_list[1]);
} }
inline double sin_wrapper(double * arg_list) { static inline double sin_wrapper(double * arg_list) {
return (sin (arg_list[0])); return (sin (arg_list[0]));
} }
inline double cos_wrapper(double * arg_list) { static inline double cos_wrapper(double * arg_list) {
return (cos (arg_list[0])); return (cos (arg_list[0]));
} }
inline double tan_wrapper(double * arg_list) { static inline double tan_wrapper(double * arg_list) {
return (tan(arg_list[0])); return (tan(arg_list[0]));
} }
inline double asin_wrapper(double * arg_list) { static inline double asin_wrapper(double * arg_list) {
return (asin (arg_list[0])); return (asin (arg_list[0]));
} }
inline double acos_wrapper(double * arg_list) { static inline double acos_wrapper(double * arg_list) {
return (acos (arg_list[0])); return (acos (arg_list[0]));
} }
inline double atan_wrapper(double * arg_list) { static inline double atan_wrapper(double * arg_list) {
return (atan (arg_list[0])); return (atan (arg_list[0]));
} }
inline double atan2_wrapper(double * arg_list) { static inline double atan2_wrapper(double * arg_list) {
return (atan2 (arg_list[0], arg_list[1])); return (atan2 (arg_list[0], arg_list[1]));
} }
inline double pow_wrapper(double * arg_list) { static inline double pow_wrapper(double * arg_list) {
return (pow (arg_list[0], arg_list[1])); return (pow (arg_list[0], arg_list[1]));
} }
inline double exp_wrapper(double * arg_list) { static inline double exp_wrapper(double * arg_list) {
return (exp(arg_list[0])); return (exp(arg_list[0]));
} }
inline double abs_wrapper(double * arg_list) { static inline double abs_wrapper(double * arg_list) {
return (fabs(arg_list[0])); return (fabs(arg_list[0]));
} }
inline double log_wrapper(double *arg_list) { static inline double log_wrapper(double *arg_list) {
return (log (arg_list[0])); return (log (arg_list[0]));
} }
inline double log10_wrapper(double * arg_list) { static inline double log10_wrapper(double * arg_list) {
return (log10 (arg_list[0])); return (log10 (arg_list[0]));
} }
inline double sqrt_wrapper(double * arg_list) { static inline double sqrt_wrapper(double * arg_list) {
return (sqrt (arg_list[0])); return (sqrt (arg_list[0]));
} }
inline double nchoosek_wrapper(double * arg_list) { static inline double nchoosek_wrapper(double * arg_list) {
unsigned long cnm = 1UL; unsigned long cnm = 1UL;
int i, f; int i, f;
int n, m; int n, m;
...@@ -189,7 +191,7 @@ inline double nchoosek_wrapper(double * arg_list) { ...@@ -189,7 +191,7 @@ inline double nchoosek_wrapper(double * arg_list) {
} }
inline double fact_wrapper(double * arg_list) { static inline double fact_wrapper(double * arg_list) {
int result = 1; int result = 1;
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
*****************************************************************************/ *****************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include "common.h" #include "common.h"
#include "fatal.h" #include "fatal.h"
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
custom_shape_t * interface_shape = NULL; custom_shape_t * interface_shape = NULL;
int cwave_interface_id = 0; int cwave_interface_id = 0;
extern preset_t * active_preset; extern preset_t * active_preset;
inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape); static inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape);
void load_unspec_init_cond_shape(param_t * param); void load_unspec_init_cond_shape(param_t * param);
void destroy_param_db_tree_shape(splaytree_t * tree); void destroy_param_db_tree_shape(splaytree_t * tree);
...@@ -518,12 +519,12 @@ custom_shape_t * find_custom_shape(int id, preset_t * preset, int create_flag) { ...@@ -518,12 +519,12 @@ custom_shape_t * find_custom_shape(int id, preset_t * preset, int create_flag) {
return custom_shape; return custom_shape;
} }
inline void evalCustomShapeInitConditions() { static inline void evalCustomShapeInitConditions() {
splay_traverse(eval_custom_shape_init_conds, active_preset->custom_shape_tree); splay_traverse(eval_custom_shape_init_conds, active_preset->custom_shape_tree);
} }
inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape) { static inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape) {
splay_traverse(eval_init_cond, custom_shape->init_cond_tree); splay_traverse(eval_init_cond, custom_shape->init_cond_tree);
splay_traverse(eval_init_cond, custom_shape->per_frame_init_eqn_tree); splay_traverse(eval_init_cond, custom_shape->per_frame_init_eqn_tree);
} }
...@@ -587,7 +588,7 @@ void load_unspec_init_cond_shape(param_t * param) { ...@@ -587,7 +588,7 @@ void load_unspec_init_cond_shape(param_t * param) {
/* Interface function. Makes another custom shape the current /* Interface function. Makes another custom shape the current
concern for per frame / point equations */ concern for per frame / point equations */
inline custom_shape_t * nextCustomShape() { static inline custom_shape_t * nextCustomShape() {
if ((interface_shape = splay_find(&cwave_interface_id, active_preset->custom_shape_tree)) == NULL) { if ((interface_shape = splay_find(&cwave_interface_id, active_preset->custom_shape_tree)) == NULL) {
cwave_interface_id = 0; cwave_interface_id = 0;
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
*****************************************************************************/ *****************************************************************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h" #include "common.h"
#include "fatal.h" #include "fatal.h"
...@@ -59,14 +61,14 @@ extern int mesh_i; ...@@ -59,14 +61,14 @@ extern int mesh_i;
custom_wave_t * interface_wave = NULL; custom_wave_t * interface_wave = NULL;
int interface_id = 0; int interface_id = 0;
extern preset_t * active_preset; extern preset_t * active_preset;
inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave); static inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave);
void load_unspec_init_cond(param_t * param); void load_unspec_init_cond(param_t * param);
void destroy_per_point_eqn_tree(splaytree_t * tree); void destroy_per_point_eqn_tree(splaytree_t * tree);
void destroy_param_db_tree(splaytree_t * tree); void destroy_param_db_tree(splaytree_t * tree);
void destroy_per_frame_eqn_tree(splaytree_t * tree); void destroy_per_frame_eqn_tree(splaytree_t * tree);
void destroy_per_frame_init_eqn_tree(splaytree_t * tree); void destroy_per_frame_init_eqn_tree(splaytree_t * tree);
void destroy_init_cond_tree(splaytree_t * tree); void destroy_init_cond_tree(splaytree_t * tree);
inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn); static inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn);
custom_wave_t * new_custom_wave(int id) { custom_wave_t * new_custom_wave(int id) {
...@@ -602,18 +604,18 @@ custom_wave_t * find_custom_wave(int id, preset_t * preset, int create_flag) { ...@@ -602,18 +604,18 @@ custom_wave_t * find_custom_wave(int id, preset_t * preset, int create_flag) {
return custom_wave; return custom_wave;
} }
inline void evalCustomWaveInitConditions() { static inline void evalCustomWaveInitConditions() {
splay_traverse(eval_custom_wave_init_conds, active_preset->custom_wave_tree); splay_traverse(eval_custom_wave_init_conds, active_preset->custom_wave_tree);
} }
inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave) { static inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave) {
splay_traverse(eval_init_cond, custom_wave->init_cond_tree); splay_traverse(eval_init_cond, custom_wave->init_cond_tree);
splay_traverse(eval_init_cond, custom_wave->per_frame_init_eqn_tree); splay_traverse(eval_init_cond, custom_wave->per_frame_init_eqn_tree);
} }
/* Interface function. Makes another custom wave the current /* Interface function. Makes another custom wave the current
concern for per frame / point equations */ concern for per frame / point equations */
inline custom_wave_t * nextCustomWave() { static inline custom_wave_t * nextCustomWave() {
if ((interface_wave = splay_find(&interface_id, active_preset->custom_wave_tree)) == NULL) { if ((interface_wave = splay_find(&interface_id, active_preset->custom_wave_tree)) == NULL) {
interface_id = 0; interface_id = 0;
...@@ -628,7 +630,7 @@ inline custom_wave_t * nextCustomWave() { ...@@ -628,7 +630,7 @@ inline custom_wave_t * nextCustomWave() {
} }
inline void evalPerPointEqns() { static inline void evalPerPointEqns() {
int x; int x;
...@@ -654,7 +656,7 @@ inline void evalPerPointEqns() { ...@@ -654,7 +656,7 @@ inline void evalPerPointEqns() {
} }
/* Evaluates a per point equation for the current custom wave given by interface_wave ptr */ /* Evaluates a per point equation for the current custom wave given by interface_wave ptr */
inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn) { static inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn) {
int samples, size; int samples, size;
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
/* Evaluation Code */ /* Evaluation Code */
#include <stdio.h>
#include "common.h" #include "common.h"
#include "fatal.h" #include "fatal.h"
...@@ -47,7 +48,7 @@ static inline double eval_prefun_expr(prefun_expr_t * prefun_expr); ...@@ -47,7 +48,7 @@ static inline double eval_prefun_expr(prefun_expr_t * prefun_expr);
static inline double eval_val_expr(val_expr_t * val_expr); static inline double eval_val_expr(val_expr_t * val_expr);
inline double eval_gen_expr(gen_expr_t * gen_expr) { static inline double eval_gen_expr(gen_expr_t * gen_expr) {
double l; double l;
if (gen_expr == NULL) if (gen_expr == NULL)
......
...@@ -778,6 +778,8 @@ void makect(int nc, int *ip, double *c) ...@@ -778,6 +778,8 @@ void makect(int nc, int *ip, double *c)
#define CDFT_4THREADS_BEGIN_N 65536 #define CDFT_4THREADS_BEGIN_N 65536
#endif #endif
#include <pthread.h> #include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#define cdft_thread_t pthread_t #define cdft_thread_t pthread_t
#define cdft_thread_create(thp,func,argp) { \ #define cdft_thread_create(thp,func,argp) { \
if (pthread_create(thp, NULL, func, (void *) argp) != 0) { \ if (pthread_create(thp, NULL, func, (void *) argp) != 0) { \
...@@ -803,6 +805,11 @@ void makect(int nc, int *ip, double *c) ...@@ -803,6 +805,11 @@ void makect(int nc, int *ip, double *c)
#define CDFT_4THREADS_BEGIN_N 524288 #define CDFT_4THREADS_BEGIN_N 524288
#endif #endif
#include <windows.h> #include <windows.h>
<<<<<<< .working
#include <stdlib.h>
=======
#include <stdio.h>
>>>>>>> .merge-right.r21326
#define cdft_thread_t HANDLE #define cdft_thread_t HANDLE
#define cdft_thread_create(thp,func,argp) { \ #define cdft_thread_create(thp,func,argp) { \
DWORD thid; \ DWORD thid; \
......
/*****************************************************************************
* fftsg.c:
*****************************************************************************
* Copyright (C) 2004 the VideoLAN team
* $Id$
*
* Authors: Cyril Deguet <asmax@videolan.org>
* code from projectM http://xmms-projectm.sourceforge.net
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
void cdft(int, int, double *, int *, double *);
void rdft(int, int, double *, int *, double *);
void ddct(int, int, double *, int *, double *);
void ddst(int, int, double *, int *, double *);
void dfct(int, double *, double *, int *, double *);
void dfst(int, double *, double *, int *, double *);
/* Function management */ /* Function management */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "common.h" #include "common.h"
#include "fatal.h" #include "fatal.h"
......
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
/* Library functions to manipulate initial condition values */ /* Library functions to manipulate initial condition values */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "common.h" #include "common.h"
#include "fatal.h" #include "fatal.h"
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <GL/glu.h> #include <GL/glu.h>
#include <unistd.h> #include <unistd.h>
#include <math.h> #include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "common.h" #include "common.h"
#include "preset_types.h" #include "preset_types.h"
#include "preset.h" #include "preset.h"
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
/* Basic Parameter Functions */ /* Basic Parameter Functions */
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h> #include <math.h>
#include "fatal.h" #include "fatal.h"
#include "common.h" #include "common.h"
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
/* parser.c */ /* parser.c */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "common.h" #include "common.h"
#include "fatal.h" #include "fatal.h"
......
...@@ -24,9 +24,11 @@ ...@@ -24,9 +24,11 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "fatal.h" #include "fatal.h"
#include "common.h" #include "common.h"
#include "param.h"
#include "per_frame_eqn_types.h" #include "per_frame_eqn_types.h"
#include "per_frame_eqn.h" #include "per_frame_eqn.h"
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include "fatal.h" #include "fatal.h"
...@@ -50,7 +52,7 @@ extern int mesh_j; ...@@ -50,7 +52,7 @@ extern int mesh_j;
/* Evaluates a per pixel equation */ /* Evaluates a per pixel equation */
inline void evalPerPixelEqn(per_pixel_eqn_t * per_pixel_eqn) { static inline void evalPerPixelEqn(per_pixel_eqn_t * per_pixel_eqn) {
double ** param_matrix = NULL; double ** param_matrix = NULL;
gen_expr_t * eqn_ptr = NULL; gen_expr_t * eqn_ptr = NULL;
...@@ -92,7 +94,7 @@ inline void evalPerPixelEqn(per_pixel_eqn_t * per_pixel_eqn) { ...@@ -92,7 +94,7 @@ inline void evalPerPixelEqn(per_pixel_eqn_t * per_pixel_eqn) {
per_pixel_eqn->param->matrix_flag = 1; per_pixel_eqn->param->matrix_flag = 1;
} }
inline void evalPerPixelEqns() { static inline void evalPerPixelEqns() {
/* Evaluate all per pixel equations using splay traversal */ /* Evaluate all per pixel equations using splay traversal */
splay_traverse(evalPerPixelEqn, active_preset->per_pixel_eqn_tree); splay_traverse(evalPerPixelEqn, active_preset->per_pixel_eqn_tree);
...@@ -209,13 +211,13 @@ void free_per_pixel_eqn(per_pixel_eqn_t * per_pixel_eqn) { ...@@ -209,13 +211,13 @@ void free_per_pixel_eqn(per_pixel_eqn_t * per_pixel_eqn) {
return; return;
} }
inline int isPerPixelEqn(int op) { static inline int isPerPixelEqn(int op) {
return active_preset->per_pixel_flag[op]; return active_preset->per_pixel_flag[op];
} }
inline int resetPerPixelEqnFlags(preset_t * preset) { static inline int resetPerPixelEqnFlags(preset_t * preset) {
int i; int i;
for (i = 0; i < NUM_OPS;i++) for (i = 0; i < NUM_OPS;i++)
......
...@@ -23,8 +23,10 @@ ...@@ -23,8 +23,10 @@
*****************************************************************************/ *****************************************************************************/
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc_charset.h>
#include <stdlib.h>
#include <stdio.h>
#include <dirent.h> #include <dirent.h>
#include <time.h> #include <time.h>
#include "common.h" #include "common.h"
......
...@@ -73,6 +73,7 @@ ...@@ -73,6 +73,7 @@
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h>
#include "common.h" #include "common.h"
#include "fatal.h" #include "fatal.h"
...@@ -94,7 +95,7 @@ static inline int splay_rec_size(splaynode_t * splaynode); ...@@ -94,7 +95,7 @@ static inline int splay_rec_size(splaynode_t * splaynode);
/* Creates a splay tree given a compare key function, copy key function, and free key function. /* Creates a splay tree given a compare key function, copy key function, and free key function.
Ah yes, the wonders of procedural programming */ Ah yes, the wonders of procedural programming */
inline splaytree_t * create_splaytree(int (*compare)(), void * (*copy_key)(), void (*free_key)()) { static inline splaytree_t * create_splaytree(int (*compare)(), void * (*copy_key)(), void (*free_key)()) {
splaytree_t * splaytree; splaytree_t * splaytree;
...@@ -113,7 +114,7 @@ inline splaytree_t * create_splaytree(int (*compare)(), void * (*copy_key)(), vo ...@@ -113,7 +114,7 @@ inline splaytree_t * create_splaytree(int (*compare)(), void * (*copy_key)(), vo
} }
/* Destroys a splay tree */ /* Destroys a splay tree */
inline int destroy_splaytree(splaytree_t * splaytree) { static inline int destroy_splaytree(splaytree_t * splaytree) {
/* Null argument check */ /* Null argument check */
if (splaytree == NULL) if (splaytree == NULL)
...@@ -158,7 +159,7 @@ static inline int free_splaynode(splaynode_t * splaynode, void (*free_key)()) { ...@@ -158,7 +159,7 @@ static inline int free_splaynode(splaynode_t * splaynode, void (*free_key)()) {
} }
/* Traverses the entire splay tree with the given function func_ptr */ /* Traverses the entire splay tree with the given function func_ptr */
inline void splay_traverse(void (*func_ptr)(), splaytree_t * splaytree) { static inline void splay_traverse(void (*func_ptr)(), splaytree_t * splaytree) {
/* Null argument check */ /* Null argument check */
...@@ -204,7 +205,7 @@ static inline void splay_traverse_helper (void (*func_ptr)(), splaynode_t * spla ...@@ -204,7 +205,7 @@ static inline void splay_traverse_helper (void (*func_ptr)(), splaynode_t * spla
} }
/* Find the node corresponding to the given key in splaytree, return its data pointer */ /* Find the node corresponding to the given key in splaytree, return its data pointer */
inline void * splay_find(void * key, splaytree_t * splaytree) { static inline void * splay_find(void * key, splaytree_t * splaytree) {
splaynode_t * splaynode; splaynode_t * splaynode;
int match_type; int match_type;
...@@ -244,7 +245,7 @@ inline void * splay_find(void * key, splaytree_t * splaytree) { ...@@ -244,7 +245,7 @@ inline void * splay_find(void * key, splaytree_t * splaytree) {
} }
/* Gets the splaynode that the given key points to */ /* Gets the splaynode that the given key points to */
inline splaynode_t * get_splaynode_of(void * key, splaytree_t * splaytree) { static inline splaynode_t * get_splaynode_of(void * key, splaytree_t * splaytree) {
splaynode_t * splaynode; splaynode_t * splaynode;
int match_type; int match_type;
...@@ -325,7 +326,7 @@ static inline splaynode_t * splay (void * key, splaynode_t * t, int * match_type ...@@ -325,7 +326,7 @@ static inline splaynode_t * splay (void * key, splaynode_t * t, int * match_type
/* Deletes a splay node from a splay tree. If the node doesn't exist /* Deletes a splay node from a splay tree. If the node doesn't exist
then nothing happens */ then nothing happens */
inline int splay_delete(void * key, splaytree_t * splaytree) { static inline int splay_delete(void * key, splaytree_t * splaytree) {
splaynode_t * splaynode; splaynode_t * splaynode;
...@@ -402,7 +403,7 @@ static inline splaynode_t * new_splaynode(int type, void * key, void * data) { ...@@ -402,7 +403,7 @@ static inline splaynode_t * new_splaynode(int type, void * key, void * data) {
} }
/* Inserts a link into the splay tree */ /* Inserts a link into the splay tree */
inline int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * splaytree) { static inline int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * splaytree) {
splaynode_t * splaynode, * data_node; splaynode_t * splaynode, * data_node;
void * key_clone; void * key_clone;
...@@ -439,7 +440,7 @@ inline int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * sp ...@@ -439,7 +440,7 @@ inline int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * sp
} }
/* Inserts 'data' into the 'splaytree' paired with the passed 'key' */ /* Inserts 'data' into the 'splaytree' paired with the passed 'key' */
inline int splay_insert(void * data, void * key, splaytree_t * splaytree) { static inline int splay_insert(void * data, void * key, splaytree_t * splaytree) {
splaynode_t * splaynode; splaynode_t * splaynode;
void * key_clone; void * key_clone;
...@@ -527,7 +528,7 @@ static inline int splay_insert_node(splaynode_t * splaynode, splaytree_t * splay ...@@ -527,7 +528,7 @@ static inline int splay_insert_node(splaynode_t * splaynode, splaytree_t * splay
} }
/* Returns the 'maximum' key that is less than the given key in the splaytree */ /* Returns the 'maximum' key that is less than the given key in the splaytree */
inline void * splay_find_below_max(void * key, splaytree_t * splaytree) { static inline void * splay_find_below_max(void * key, splaytree_t * splaytree) {
void * closest_key; void * closest_key;
...@@ -548,7 +549,7 @@ inline void * splay_find_below_max(void * key, splaytree_t * splaytree) { ...@@ -548,7 +549,7 @@ inline void * splay_find_below_max(void * key, splaytree_t * splaytree) {
/* Returns the 'minimum' key that is greater than the given key in the splaytree */ /* Returns the 'minimum' key that is greater than the given key in the splaytree */
inline void * splay_find_above_min(void * key, splaytree_t * splaytree) { static inline void * splay_find_above_min(void * key, splaytree_t * splaytree) {
void * closest_key; void * closest_key;
...@@ -643,7 +644,7 @@ static inline void splay_find_above_min_helper(void * max_key, void ** closest_k ...@@ -643,7 +644,7 @@ static inline void splay_find_above_min_helper(void * max_key, void ** closest_k
} }
/* Find the minimum entry of the splay tree */ /* Find the minimum entry of the splay tree */
inline void * splay_find_min(splaytree_t * t) { static inline void * splay_find_min(splaytree_t * t) {
splaynode_t * splaynode; splaynode_t * splaynode;
...@@ -662,7 +663,7 @@ inline void * splay_find_min(splaytree_t * t) { ...@@ -662,7 +663,7 @@ inline void * splay_find_min(splaytree_t * t) {
/* Find the maximum entry of the splay tree */ /* Find the maximum entry of the splay tree */
inline void * splay_find_max(splaytree_t * t) { static inline void * splay_find_max(splaytree_t * t) {
splaynode_t * splaynode; splaynode_t * splaynode;
...@@ -680,7 +681,7 @@ inline void * splay_find_max(splaytree_t * t) { ...@@ -680,7 +681,7 @@ inline void * splay_find_max(splaytree_t * t) {
return splaynode->data; return splaynode->data;
} }
inline int splay_size(splaytree_t * t) { static inline int splay_size(splaytree_t * t) {
if (t == NULL) if (t == NULL)
return 0; return 0;
......
...@@ -22,8 +22,10 @@ ...@@ -22,8 +22,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "common.h" #include "common.h"
/* Compares integer value numbers in 32 bit range */ /* Compares integer value numbers in 32 bit range */
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
//also able to handle resizing and fullscreening of windows //also able to handle resizing and fullscreening of windows
//just call init_display again with differant variables //just call init_display again with differant variables
#include <stdlib.h>
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h> #include <GL/glu.h>
#include "video_init.h" #include "video_init.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment