Changeset 8139b9059c5cf3c2ce771c545dd93a3df4ec08c4
- Timestamp:
- 10/07/07 01:32:37
(1 year ago)
- Author:
- Christophe Mutricy <xtophe@videolan.org>
- git-committer:
- Christophe Mutricy <xtophe@videolan.org> 1191713557 +0000
- git-parent:
[b14c3b3726ef8809eef681005a9454067253e6b7]
- git-author:
- Christophe Mutricy <xtophe@videolan.org> 1191713557 +0000
- Message:
galaktos/*: warnings hunt
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rd6008a8 |
r8139b90 |
|
| 31 | 31 | //Returns PCM Data or spectrum data, or the derivative of the PCM data |
|---|
| 32 | 32 | |
|---|
| | 33 | #include <stdlib.h> |
|---|
| | 34 | #include <stdio.h> |
|---|
| 33 | 35 | #include <inttypes.h> |
|---|
| | 36 | |
|---|
| | 37 | #include "fftsg.h" |
|---|
| 34 | 38 | |
|---|
| 35 | 39 | double **PCMd; //data structure to store PCM data PCM[channels][maxsamples] |
|---|
| rd6008a8 |
r8139b90 |
|
| 31 | 31 | //Some stuff was taken from Frederic Patin's beat-detection article, you'll find it online |
|---|
| 32 | 32 | |
|---|
| | 33 | #include <stdlib.h> |
|---|
| | 34 | #include <stdio.h> |
|---|
| 33 | 35 | #include "engine_vars.h" |
|---|
| 34 | 36 | |
|---|
| rd6008a8 |
r8139b90 |
|
| 25 | 25 | |
|---|
| 26 | 26 | #include <math.h> |
|---|
| | 27 | #include <stdlib.h> |
|---|
| | 28 | #include <stdio.h> |
|---|
| 27 | 29 | /* Values to optimize the sigmoid function */ |
|---|
| 28 | 30 | #define R 32767 |
|---|
| 29 | 31 | #define RR 65534 |
|---|
| 30 | 32 | |
|---|
| 31 | | inline double int_wrapper(double * arg_list) { |
|---|
| | 33 | static inline double int_wrapper(double * arg_list) { |
|---|
| 32 | 34 | |
|---|
| 33 | 35 | return floor(arg_list[0]); |
|---|
| … | … | |
| 36 | 38 | |
|---|
| 37 | 39 | |
|---|
| 38 | | inline double sqr_wrapper(double * arg_list) { |
|---|
| | 40 | static inline double sqr_wrapper(double * arg_list) { |
|---|
| 39 | 41 | |
|---|
| 40 | 42 | return pow(2, arg_list[0]); |
|---|
| … | … | |
| 42 | 44 | |
|---|
| 43 | 45 | |
|---|
| 44 | | inline double sign_wrapper(double * arg_list) { |
|---|
| | 46 | static inline double sign_wrapper(double * arg_list) { |
|---|
| 45 | 47 | |
|---|
| 46 | 48 | return -arg_list[0]; |
|---|
| 47 | 49 | } |
|---|
| 48 | 50 | |
|---|
| 49 | | inline double min_wrapper(double * arg_list) { |
|---|
| | 51 | static inline double min_wrapper(double * arg_list) { |
|---|
| 50 | 52 | |
|---|
| 51 | 53 | if (arg_list[0] > arg_list[1]) |
|---|
| … | … | |
| 55 | 57 | } |
|---|
| 56 | 58 | |
|---|
| 57 | | inline double max_wrapper(double * arg_list) { |
|---|
| | 59 | static inline double max_wrapper(double * arg_list) { |
|---|
| 58 | 60 | |
|---|
| 59 | 61 | if (arg_list[0] > arg_list[1]) |
|---|
| … | … | |
| 64 | 66 | |
|---|
| 65 | 67 | /* consult your AI book */ |
|---|
| 66 | | inline double sigmoid_wrapper(double * arg_list) { |
|---|
| | 68 | static inline double sigmoid_wrapper(double * arg_list) { |
|---|
| 67 | 69 | return (RR / (1 + exp( -(((double)(arg_list[0])) * arg_list[1]) / R) - R)); |
|---|
| 68 | 70 | } |
|---|
| 69 | 71 | |
|---|
| 70 | 72 | |
|---|
| 71 | | inline double bor_wrapper(double * arg_list) { |
|---|
| | 73 | static inline double bor_wrapper(double * arg_list) { |
|---|
| 72 | 74 | |
|---|
| 73 | 75 | return (double)((int)arg_list[0] || (int)arg_list[1]); |
|---|
| 74 | 76 | } |
|---|
| 75 | 77 | |
|---|
| 76 | | inline double band_wrapper(double * arg_list) { |
|---|
| | 78 | static inline double band_wrapper(double * arg_list) { |
|---|
| 77 | 79 | return (double)((int)arg_list[0] && (int)arg_list[1]); |
|---|
| 78 | 80 | } |
|---|
| 79 | 81 | |
|---|
| 80 | | inline double bnot_wrapper(double * arg_list) { |
|---|
| | 82 | static inline double bnot_wrapper(double * arg_list) { |
|---|
| 81 | 83 | return (double)(!(int)arg_list[0]); |
|---|
| 82 | 84 | } |
|---|
| 83 | 85 | |
|---|
| 84 | | inline double if_wrapper(double * arg_list) { |
|---|
| | 86 | static inline double if_wrapper(double * arg_list) { |
|---|
| 85 | 87 | |
|---|
| 86 | 88 | if ((int)arg_list[0] == 0) |
|---|
| … | … | |
| 90 | 92 | |
|---|
| 91 | 93 | |
|---|
| 92 | | inline double rand_wrapper(double * arg_list) { |
|---|
| | 94 | static inline double rand_wrapper(double * arg_list) { |
|---|
| 93 | 95 | double l; |
|---|
| 94 | 96 | |
|---|
| … | … | |
| 99 | 101 | } |
|---|
| 100 | 102 | |
|---|
| 101 | | inline double equal_wrapper(double * arg_list) { |
|---|
| | 103 | static inline double equal_wrapper(double * arg_list) { |
|---|
| 102 | 104 | |
|---|
| 103 | 105 | return (arg_list[0] == arg_list[1]); |
|---|
| … | … | |
| 105 | 107 | |
|---|
| 106 | 108 | |
|---|
| 107 | | inline double above_wrapper(double * arg_list) { |
|---|
| | 109 | static inline double above_wrapper(double * arg_list) { |
|---|
| 108 | 110 | |
|---|
| 109 | 111 | return (arg_list[0] > arg_list[1]); |
|---|
| … | … | |
| 111 | 113 | |
|---|
| 112 | 114 | |
|---|
| 113 | | inline double below_wrapper(double * arg_list) { |
|---|
| | 115 | static inline double below_wrapper(double * arg_list) { |
|---|
| 114 | 116 | |
|---|
| 115 | 117 | return (arg_list[0] < arg_list[1]); |
|---|
| 116 | 118 | } |
|---|
| 117 | 119 | |
|---|
| 118 | | inline double sin_wrapper(double * arg_list) { |
|---|
| | 120 | static inline double sin_wrapper(double * arg_list) { |
|---|
| 119 | 121 | return (sin (arg_list[0])); |
|---|
| 120 | 122 | } |
|---|
| 121 | 123 | |
|---|
| 122 | 124 | |
|---|
| 123 | | inline double cos_wrapper(double * arg_list) { |
|---|
| | 125 | static inline double cos_wrapper(double * arg_list) { |
|---|
| 124 | 126 | return (cos (arg_list[0])); |
|---|
| 125 | 127 | } |
|---|
| 126 | 128 | |
|---|
| 127 | | inline double tan_wrapper(double * arg_list) { |
|---|
| | 129 | static inline double tan_wrapper(double * arg_list) { |
|---|
| 128 | 130 | return (tan(arg_list[0])); |
|---|
| 129 | 131 | } |
|---|
| 130 | 132 | |
|---|
| 131 | | inline double asin_wrapper(double * arg_list) { |
|---|
| | 133 | static inline double asin_wrapper(double * arg_list) { |
|---|
| 132 | 134 | return (asin (arg_list[0])); |
|---|
| 133 | 135 | } |
|---|
| 134 | 136 | |
|---|
| 135 | | inline double acos_wrapper(double * arg_list) { |
|---|
| | 137 | static inline double acos_wrapper(double * arg_list) { |
|---|
| 136 | 138 | return (acos (arg_list[0])); |
|---|
| 137 | 139 | } |
|---|
| 138 | 140 | |
|---|
| 139 | | inline double atan_wrapper(double * arg_list) { |
|---|
| | 141 | static inline double atan_wrapper(double * arg_list) { |
|---|
| 140 | 142 | return (atan (arg_list[0])); |
|---|
| 141 | 143 | } |
|---|
| 142 | 144 | |
|---|
| 143 | | inline double atan2_wrapper(double * arg_list) { |
|---|
| | 145 | static inline double atan2_wrapper(double * arg_list) { |
|---|
| 144 | 146 | return (atan2 (arg_list[0], arg_list[1])); |
|---|
| 145 | 147 | } |
|---|
| 146 | 148 | |
|---|
| 147 | | inline double pow_wrapper(double * arg_list) { |
|---|
| | 149 | static inline double pow_wrapper(double * arg_list) { |
|---|
| 148 | 150 | return (pow (arg_list[0], arg_list[1])); |
|---|
| 149 | 151 | } |
|---|
| 150 | 152 | |
|---|
| 151 | | inline double exp_wrapper(double * arg_list) { |
|---|
| | 153 | static inline double exp_wrapper(double * arg_list) { |
|---|
| 152 | 154 | return (exp(arg_list[0])); |
|---|
| 153 | 155 | } |
|---|
| 154 | 156 | |
|---|
| 155 | | inline double abs_wrapper(double * arg_list) { |
|---|
| | 157 | static inline double abs_wrapper(double * arg_list) { |
|---|
| 156 | 158 | return (fabs(arg_list[0])); |
|---|
| 157 | 159 | } |
|---|
| 158 | 160 | |
|---|
| 159 | | inline double log_wrapper(double *arg_list) { |
|---|
| | 161 | static inline double log_wrapper(double *arg_list) { |
|---|
| 160 | 162 | return (log (arg_list[0])); |
|---|
| 161 | 163 | } |
|---|
| 162 | 164 | |
|---|
| 163 | | inline double log10_wrapper(double * arg_list) { |
|---|
| | 165 | static inline double log10_wrapper(double * arg_list) { |
|---|
| 164 | 166 | return (log10 (arg_list[0])); |
|---|
| 165 | 167 | } |
|---|
| 166 | 168 | |
|---|
| 167 | | inline double sqrt_wrapper(double * arg_list) { |
|---|
| | 169 | static inline double sqrt_wrapper(double * arg_list) { |
|---|
| 168 | 170 | return (sqrt (arg_list[0])); |
|---|
| 169 | 171 | } |
|---|
| 170 | 172 | |
|---|
| 171 | 173 | |
|---|
| 172 | | inline double nchoosek_wrapper(double * arg_list) { |
|---|
| | 174 | static inline double nchoosek_wrapper(double * arg_list) { |
|---|
| 173 | 175 | unsigned long cnm = 1UL; |
|---|
| 174 | 176 | int i, f; |
|---|
| … | … | |
| 190 | 192 | |
|---|
| 191 | 193 | |
|---|
| 192 | | inline double fact_wrapper(double * arg_list) { |
|---|
| | 194 | static inline double fact_wrapper(double * arg_list) { |
|---|
| 193 | 195 | |
|---|
| 194 | 196 | |
|---|
| rd6008a8 |
r8139b90 |
|
| 24 | 24 | |
|---|
| 25 | 25 | #include <stdio.h> |
|---|
| | 26 | #include <stdlib.h> |
|---|
| 26 | 27 | |
|---|
| 27 | 28 | #include "common.h" |
|---|
| … | … | |
| 55 | 56 | int cwave_interface_id = 0; |
|---|
| 56 | 57 | extern preset_t * active_preset; |
|---|
| 57 | | inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape); |
|---|
| | 58 | static inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape); |
|---|
| 58 | 59 | void load_unspec_init_cond_shape(param_t * param); |
|---|
| 59 | 60 | |
|---|
| … | … | |
| 519 | 520 | } |
|---|
| 520 | 521 | |
|---|
| 521 | | inline void evalCustomShapeInitConditions() { |
|---|
| | 522 | static inline void evalCustomShapeInitConditions() { |
|---|
| 522 | 523 | splay_traverse(eval_custom_shape_init_conds, active_preset->custom_shape_tree); |
|---|
| 523 | 524 | |
|---|
| 524 | 525 | } |
|---|
| 525 | 526 | |
|---|
| 526 | | inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape) { |
|---|
| | 527 | static inline void eval_custom_shape_init_conds(custom_shape_t * custom_shape) { |
|---|
| 527 | 528 | splay_traverse(eval_init_cond, custom_shape->init_cond_tree); |
|---|
| 528 | 529 | splay_traverse(eval_init_cond, custom_shape->per_frame_init_eqn_tree); |
|---|
| … | … | |
| 588 | 589 | /* Interface function. Makes another custom shape the current |
|---|
| 589 | 590 | concern for per frame / point equations */ |
|---|
| 590 | | inline custom_shape_t * nextCustomShape() { |
|---|
| | 591 | static inline custom_shape_t * nextCustomShape() { |
|---|
| 591 | 592 | |
|---|
| 592 | 593 | if ((interface_shape = splay_find(&cwave_interface_id, active_preset->custom_shape_tree)) == NULL) { |
|---|
| rd6008a8 |
r8139b90 |
|
| 24 | 24 | |
|---|
| 25 | 25 | #include <stdio.h> |
|---|
| | 26 | #include <stdlib.h> |
|---|
| | 27 | #include <string.h> |
|---|
| 26 | 28 | |
|---|
| 27 | 29 | #include "common.h" |
|---|
| … | … | |
| 60 | 62 | int interface_id = 0; |
|---|
| 61 | 63 | extern preset_t * active_preset; |
|---|
| 62 | | inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave); |
|---|
| | 64 | static inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave); |
|---|
| 63 | 65 | void load_unspec_init_cond(param_t * param); |
|---|
| 64 | 66 | void destroy_per_point_eqn_tree(splaytree_t * tree); |
|---|
| … | … | |
| 67 | 69 | void destroy_per_frame_init_eqn_tree(splaytree_t * tree); |
|---|
| 68 | 70 | void destroy_init_cond_tree(splaytree_t * tree); |
|---|
| 69 | | inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn); |
|---|
| | 71 | static inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn); |
|---|
| 70 | 72 | |
|---|
| 71 | 73 | custom_wave_t * new_custom_wave(int id) { |
|---|
| … | … | |
| 603 | 605 | } |
|---|
| 604 | 606 | |
|---|
| 605 | | inline void evalCustomWaveInitConditions() { |
|---|
| | 607 | static inline void evalCustomWaveInitConditions() { |
|---|
| 606 | 608 | splay_traverse(eval_custom_wave_init_conds, active_preset->custom_wave_tree); |
|---|
| 607 | 609 | } |
|---|
| 608 | 610 | |
|---|
| 609 | | inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave) { |
|---|
| | 611 | static inline void eval_custom_wave_init_conds(custom_wave_t * custom_wave) { |
|---|
| 610 | 612 | splay_traverse(eval_init_cond, custom_wave->init_cond_tree); |
|---|
| 611 | 613 | splay_traverse(eval_init_cond, custom_wave->per_frame_init_eqn_tree); |
|---|
| … | … | |
| 614 | 616 | /* Interface function. Makes another custom wave the current |
|---|
| 615 | 617 | concern for per frame / point equations */ |
|---|
| 616 | | inline custom_wave_t * nextCustomWave() { |
|---|
| | 618 | static inline custom_wave_t * nextCustomWave() { |
|---|
| 617 | 619 | |
|---|
| 618 | 620 | if ((interface_wave = splay_find(&interface_id, active_preset->custom_wave_tree)) == NULL) { |
|---|
| … | … | |
| 629 | 631 | |
|---|
| 630 | 632 | |
|---|
| 631 | | inline void evalPerPointEqns() { |
|---|
| | 633 | static inline void evalPerPointEqns() { |
|---|
| 632 | 634 | |
|---|
| 633 | 635 | int x; |
|---|
| … | … | |
| 655 | 657 | |
|---|
| 656 | 658 | /* Evaluates a per point equation for the current custom wave given by interface_wave ptr */ |
|---|
| 657 | | inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn) { |
|---|
| | 659 | static inline void evalPerPointEqn(per_point_eqn_t * per_point_eqn) { |
|---|
| 658 | 660 | |
|---|
| 659 | 661 | |
|---|
| rd6008a8 |
r8139b90 |
|
| 27 | 27 | /* Evaluation Code */ |
|---|
| 28 | 28 | |
|---|
| | 29 | #include <stdio.h> |
|---|
| 29 | 30 | #include "common.h" |
|---|
| 30 | 31 | #include "fatal.h" |
|---|
| … | … | |
| 48 | 49 | |
|---|
| 49 | 50 | |
|---|
| 50 | | inline double eval_gen_expr(gen_expr_t * gen_expr) { |
|---|
| | 51 | static inline double eval_gen_expr(gen_expr_t * gen_expr) { |
|---|
| 51 | 52 | double l; |
|---|
| 52 | 53 | |
|---|
| rd6008a8 |
r8139b90 |
|
| 779 | 779 | #endif |
|---|
| 780 | 780 | #include <pthread.h> |
|---|
| | 781 | #include <stdlib.h> |
|---|
| | 782 | #include <stdio.h> |
|---|
| 781 | 783 | #define cdft_thread_t pthread_t |
|---|
| 782 | 784 | #define cdft_thread_create(thp,func,argp) { \ |
|---|
| … | … | |
| 804 | 806 | #endif |
|---|
| 805 | 807 | #include <windows.h> |
|---|
| | 808 | <<<<<<< .working |
|---|
| | 809 | #include <stdlib.h> |
|---|
| | 810 | ======= |
|---|
| | 811 | #include <stdio.h> |
|---|
| | 812 | >>>>>>> .merge-right.r21326 |
|---|
| 806 | 813 | #define cdft_thread_t HANDLE |
|---|
| 807 | 814 | #define cdft_thread_create(thp,func,argp) { \ |
|---|
| rd6008a8 |
r8139b90 |
|
| 2 | 2 | |
|---|
| 3 | 3 | #include <stdlib.h> |
|---|
| | 4 | #include <stdio.h> |
|---|
| | 5 | #include <string.h> |
|---|
| 4 | 6 | |
|---|
| 5 | 7 | #include "common.h" |
|---|
| rd6008a8 |
r8139b90 |
|
| 27 | 27 | /* Library functions to manipulate initial condition values */ |
|---|
| 28 | 28 | |
|---|
| | 29 | #include <stdio.h> |
|---|
| | 30 | #include <stdlib.h> |
|---|
| | 31 | #include <string.h> |
|---|
| 29 | 32 | |
|---|
| 30 | 33 | #include "common.h" |
|---|
| r9e595c9 |
r8139b90 |
|
| 28 | 28 | #include <unistd.h> |
|---|
| 29 | 29 | #include <math.h> |
|---|
| | 30 | #include <stdlib.h> |
|---|
| | 31 | #include <stdio.h> |
|---|
| 30 | 32 | #include "common.h" |
|---|
| 31 | 33 | #include "preset_types.h" |
|---|
| rd6008a8 |
r8139b90 |
|
| 28 | 28 | |
|---|
| 29 | 29 | #include <stdio.h> |
|---|
| 30 | | |
|---|
| | 30 | #include <string.h> |
|---|
| | 31 | #include <stdlib.h> |
|---|
| 31 | 32 | #include <math.h> |
|---|
| 32 | 33 | #include "fatal.h" |
|---|
| rd6008a8 |
r8139b90 |
|
| 28 | 28 | |
|---|
| 29 | 29 | #include <stdlib.h> |
|---|
| | 30 | #include <stdio.h> |
|---|
| | 31 | #include <string.h> |
|---|
| 30 | 32 | |
|---|
| 31 | 33 | #include "common.h" |
|---|
| rd6008a8 |
r8139b90 |
|
| 25 | 25 | #include <stdio.h> |
|---|
| 26 | 26 | #include <stdlib.h> |
|---|
| | 27 | #include <string.h> |
|---|
| 27 | 28 | |
|---|
| 28 | 29 | #include "fatal.h" |
|---|
| 29 | 30 | #include "common.h" |
|---|
| | 31 | #include "param.h" |
|---|
| 30 | 32 | #include "per_frame_eqn_types.h" |
|---|
| 31 | 33 | #include "per_frame_eqn.h" |
|---|
| rd6008a8 |
r8139b90 |
|
| 23 | 23 | *****************************************************************************/ |
|---|
| 24 | 24 | |
|---|
| | 25 | #include <stdio.h> |
|---|
| | 26 | #include <string.h> |
|---|
| 25 | 27 | #include <stdlib.h> |
|---|
| 26 | 28 | |
|---|
| … | … | |
| 51 | 53 | |
|---|
| 52 | 54 | /* Evaluates a per pixel equation */ |
|---|
| 53 | | inline void evalPerPixelEqn(per_pixel_eqn_t * per_pixel_eqn) { |
|---|
| | 55 | static inline void evalPerPixelEqn(per_pixel_eqn_t * per_pixel_eqn) { |
|---|
| 54 | 56 | |
|---|
| 55 | 57 | double ** param_matrix = NULL; |
|---|
| … | … | |
| 93 | 95 | } |
|---|
| 94 | 96 | |
|---|
| 95 | | inline void evalPerPixelEqns() { |
|---|
| | 97 | static inline void evalPerPixelEqns() { |
|---|
| 96 | 98 | |
|---|
| 97 | 99 | /* Evaluate all per pixel equations using splay traversal */ |
|---|
| … | … | |
| 210 | 212 | } |
|---|
| 211 | 213 | |
|---|
| 212 | | inline int isPerPixelEqn(int op) { |
|---|
| | 214 | static inline int isPerPixelEqn(int op) { |
|---|
| 213 | 215 | |
|---|
| 214 | 216 | return active_preset->per_pixel_flag[op]; |
|---|
| … | … | |
| 216 | 218 | } |
|---|
| 217 | 219 | |
|---|
| 218 | | inline int resetPerPixelEqnFlags(preset_t * preset) { |
|---|
| | 220 | static inline int resetPerPixelEqnFlags(preset_t * preset) { |
|---|
| 219 | 221 | int i; |
|---|
| 220 | 222 | |
|---|
| rd6008a8 |
r8139b90 |
|
| 24 | 24 | |
|---|
| 25 | 25 | #include <vlc/vlc.h> |
|---|
| 26 | | |
|---|
| 27 | | |
|---|
| | 26 | #include <vlc_charset.h> |
|---|
| | 27 | |
|---|
| | 28 | #include <stdlib.h> |
|---|
| | 29 | #include <stdio.h> |
|---|
| 28 | 30 | #include <dirent.h> |
|---|
| 29 | 31 | #include <time.h> |
|---|
| rd6008a8 |
r8139b90 |
|
| 74 | 74 | |
|---|
| 75 | 75 | #include <stdlib.h> |
|---|
| | 76 | #include <stdio.h> |
|---|
| 76 | 77 | |
|---|
| 77 | 78 | #include "common.h" |
|---|
| … | … | |
| 95 | 96 | /* Creates a splay tree given a compare key function, copy key function, and free key function. |
|---|
| 96 | 97 | Ah yes, the wonders of procedural programming */ |
|---|
| 97 | | inline splaytree_t * create_splaytree(int (*compare)(), void * (*copy_key)(), void (*free_key)()) { |
|---|
| | 98 | static inline splaytree_t * create_splaytree(int (*compare)(), void * (*copy_key)(), void (*free_key)()) { |
|---|
| 98 | 99 | |
|---|
| 99 | 100 | splaytree_t * splaytree; |
|---|
| … | … | |
| 114 | 115 | |
|---|
| 115 | 116 | /* Destroys a splay tree */ |
|---|
| 116 | | inline int destroy_splaytree(splaytree_t * splaytree) { |
|---|
| | 117 | static inline int destroy_splaytree(splaytree_t * splaytree) { |
|---|
| 117 | 118 | |
|---|
| 118 | 119 | /* Null argument check */ |
|---|
| … | … | |
| 159 | 160 | |
|---|
| 160 | 161 | /* Traverses the entire splay tree with the given function func_ptr */ |
|---|
| 161 | | inline void splay_traverse(void (*func_ptr)(), splaytree_t * splaytree) { |
|---|
| | 162 | static inline void splay_traverse(void (*func_ptr)(), splaytree_t * splaytree) { |
|---|
| 162 | 163 | |
|---|
| 163 | 164 | /* Null argument check */ |
|---|
| … | … | |
| 205 | 206 | |
|---|
| 206 | 207 | /* Find the node corresponding to the given key in splaytree, return its data pointer */ |
|---|
| 207 | | inline void * splay_find(void * key, splaytree_t * splaytree) { |
|---|
| | 208 | static inline void * splay_find(void * key, splaytree_t * splaytree) { |
|---|
| 208 | 209 | |
|---|
| 209 | 210 | splaynode_t * splaynode; |
|---|
| … | … | |
| 245 | 246 | |
|---|
| 246 | 247 | /* Gets the splaynode that the given key points to */ |
|---|
| 247 | | inline splaynode_t * get_splaynode_of(void * key, splaytree_t * splaytree) { |
|---|
| | 248 | static inline splaynode_t * get_splaynode_of(void * key, splaytree_t * splaytree) { |
|---|
| 248 | 249 | |
|---|
| 249 | 250 | splaynode_t * splaynode; |
|---|
| … | … | |
| 326 | 327 | /* Deletes a splay node from a splay tree. If the node doesn't exist |
|---|
| 327 | 328 | then nothing happens */ |
|---|
| 328 | | inline int splay_delete(void * key, splaytree_t * splaytree) { |
|---|
| | 329 | static inline int splay_delete(void * key, splaytree_t * splaytree) { |
|---|
| 329 | 330 | |
|---|
| 330 | 331 | splaynode_t * splaynode; |
|---|
| … | … | |
| 403 | 404 | |
|---|
| 404 | 405 | /* Inserts a link into the splay tree */ |
|---|
| 405 | | inline int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * splaytree) { |
|---|
| | 406 | static inline int splay_insert_link(void * alias_key, void * orig_key, splaytree_t * splaytree) { |
|---|
| 406 | 407 | |
|---|
| 407 | 408 | splaynode_t * splaynode, * data_node; |
|---|
| … | … | |
| 440 | 441 | |
|---|
| 441 | 442 | /* Inserts 'data' into the 'splaytree' paired with the passed 'key' */ |
|---|
| 442 | | inline int splay_insert(void * data, void * key, splaytree_t * splaytree) { |
|---|
| | 443 | static inline int splay_insert(void * data, void * key, splaytree_t * splaytree) { |
|---|
| 443 | 444 | |
|---|
| 444 | 445 | splaynode_t * splaynode; |
|---|
| … | … | |
| 528 | 529 | |
|---|
| 529 | 530 | /* Returns the 'maximum' key that is less than the given key in the splaytree */ |
|---|
| 530 | | inline void * splay_find_below_max(void * key, splaytree_t * splaytree) { |
|---|
| | 531 | static inline void * splay_find_below_max(void * key, splaytree_t * splaytree) { |
|---|
| 531 | 532 | |
|---|
| 532 | 533 | void * closest_key; |
|---|
| … | … | |
| 549 | 550 | |
|---|
| 550 | 551 | /* Returns the 'minimum' key that is greater than the given key in the splaytree */ |
|---|
| 551 | | inline void * splay_find_above_min(void * key, splaytree_t * splaytree) { |
|---|
| | 552 | static inline void * splay_find_above_min(void * key, splaytree_t * splaytree) { |
|---|
| 552 | 553 | |
|---|
| 553 | 554 | void * closest_key; |
|---|
| … | … | |
| 644 | 645 | |
|---|
| 645 | 646 | /* Find the minimum entry of the splay tree */ |
|---|
| 646 | | inline void * splay_find_min(splaytree_t * t) { |
|---|
| | 647 | static inline void * splay_find_min(splaytree_t * t) { |
|---|
| 647 | 648 | |
|---|
| 648 | 649 | splaynode_t * splaynode; |
|---|
| … | … | |
| 663 | 664 | |
|---|
| 664 | 665 | /* Find the maximum entry of the splay tree */ |
|---|
| 665 | | inline void * splay_find_max(splaytree_t * t) { |
|---|
| | 666 | static inline void * splay_find_max(splaytree_t * t) { |
|---|
| 666 | 667 | |
|---|
| 667 | 668 | splaynode_t * splaynode; |
|---|
| … | … | |
| 681 | 682 | } |
|---|
| 682 | 683 | |
|---|
| 683 | | inline int splay_size(splaytree_t * t) { |
|---|
| | 684 | static inline int splay_size(splaytree_t * t) { |
|---|
| 684 | 685 | |
|---|
| 685 | 686 | if (t == NULL) |
|---|
| rd6008a8 |
r8139b90 |
|
| 23 | 23 | *****************************************************************************/ |
|---|
| 24 | 24 | |
|---|
| | 25 | #define _GNU_SOURCE |
|---|
| | 26 | #include <stdio.h> |
|---|
| 25 | 27 | #include <stdlib.h> |
|---|
| 26 | | |
|---|
| | 28 | #include <string.h> |
|---|
| 27 | 29 | #include "common.h" |
|---|
| 28 | 30 | |
|---|
| rd6008a8 |
r8139b90 |
|
| 33 | 33 | //just call init_display again with differant variables |
|---|
| 34 | 34 | |
|---|
| | 35 | #include <stdlib.h> |
|---|
| 35 | 36 | #include <GL/gl.h> |
|---|
| 36 | 37 | #include <GL/glu.h> |
|---|