Skip to content

Commit

Permalink
* Fixed some small bugs and EL now compiles with clang-2.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaphier committed Mar 2, 2011
1 parent 9142063 commit 4975410
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion cal.c
Expand Up @@ -550,7 +550,7 @@ CHECK_GL_ERRORS();
}


__inline__ void render_submesh(int meshId, int submeshCount, struct CalRenderer * pCalRenderer, float meshVertices[30000][3], float meshNormals[30000][3], float meshTextureCoordinates[30000][2], CalIndex meshFaces[50000][3], Uint32 use_lightning, Uint32 use_textures)
static __inline__ void render_submesh(int meshId, int submeshCount, struct CalRenderer * pCalRenderer, float meshVertices[30000][3], float meshNormals[30000][3], float meshTextureCoordinates[30000][2], CalIndex meshFaces[50000][3], Uint32 use_lightning, Uint32 use_textures)
{
int submeshId;
int vertexCount=0;
Expand Down
10 changes: 5 additions & 5 deletions dbuffer.h
Expand Up @@ -68,7 +68,7 @@ typedef struct {
\param dbuf The dbuffer to destroy
\returns nothing
*/
__inline__ void dbuffer_destroy( dbuffer_t *dbuf )
static __inline__ void dbuffer_destroy( dbuffer_t *dbuf )
{
free(dbuf);
}
Expand All @@ -87,7 +87,7 @@ __inline__ void dbuffer_destroy( dbuffer_t *dbuf )
*/


__inline__ UNUSED_RESULT_DECL dbuffer_t *dbuffer_append_data( dbuffer_t *dbuf, const unsigned char *data, size_t datalen )
static __inline__ UNUSED_RESULT_DECL dbuffer_t *dbuffer_append_data( dbuffer_t *dbuf, const unsigned char *data, size_t datalen )
{
size_t next_alloc_size;

Expand Down Expand Up @@ -121,7 +121,7 @@ __inline__ UNUSED_RESULT_DECL dbuffer_t *dbuffer_append_data( dbuffer_t *dbuf, c
\returns The newly created dbuffer.
*/

__inline__ dbuffer_t *dbuffer_new()
static __inline__ dbuffer_t *dbuffer_new()
{
return dbuffer_append_data(NULL, NULL, 0); /* Will alloc a new buffer */
}
Expand All @@ -132,7 +132,7 @@ __inline__ dbuffer_t *dbuffer_new()
\param datalen The size to preallocate
\returns The newly created dbuffer.
*/
__inline__ dbuffer_t *dbuffer_sized(size_t datalen)
static __inline__ dbuffer_t *dbuffer_sized(size_t datalen)
{
return dbuffer_append_data(NULL, NULL, datalen); /* Will alloc a new buffer */
}
Expand All @@ -145,7 +145,7 @@ __inline__ dbuffer_t *dbuffer_sized(size_t datalen)
\returns The newly created dbuffer.
*/

__inline__ dbuffer_t *dbuffer_new_with_data( const unsigned char *data, size_t datalen )
static __inline__ dbuffer_t *dbuffer_new_with_data( const unsigned char *data, size_t datalen )
{
return dbuffer_append_data(NULL, data, datalen); /* Will alloc a new buffer */
}
Expand Down
6 changes: 3 additions & 3 deletions hash.c
Expand Up @@ -145,10 +145,10 @@ hash_entry *hash_get_next(hash_table *table){


//HASH AND COMPARE FNs
unsigned long int __inline__ hash_fn_int(void *key){
unsigned long int hash_fn_int(void *key){
return (unsigned long int) key;
}
int __inline__ cmp_fn_int(void *key1, void *key2){
int cmp_fn_int(void *key1, void *key2){
return key1==key2;
}

Expand All @@ -164,7 +164,7 @@ unsigned long int __inline hash_fn_str(void *key){
return hash;
}

int __inline__ cmp_fn_str(void *key1, void *key2){
int cmp_fn_str(void *key1, void *key2){
return !strcmp((char*)key1,(char*)key2);
}

Expand Down
8 changes: 4 additions & 4 deletions hash.h
Expand Up @@ -39,11 +39,11 @@ hash_entry *hash_get_next(hash_table *table);


//HASH & KEY_CMP
unsigned long int __inline__ hash_fn_int(void *key);
int __inline__ cmp_fn_int(void *key1, void *key2);
unsigned long int hash_fn_int(void *key);
int cmp_fn_int(void *key1, void *key2);

unsigned long int __inline__ hash_fn_str(void *key);
int __inline__ cmp_fn_str(void *key1, void *key2);
unsigned long int hash_fn_str(void *key);
int cmp_fn_str(void *key1, void *key2);

Uint32 mem_hash(const void* str, const Uint32 len);

Expand Down
8 changes: 4 additions & 4 deletions minimap.c
Expand Up @@ -62,7 +62,7 @@ static __inline__ float minimap_get_zoom ()
return zoom;
}

__inline__ void rotate_actor_points(float zoom_multip, float px, float py)
static __inline__ void rotate_actor_points(float zoom_multip, float px, float py)
{
float x,y;
x = (px - (float_minimap_size/2) ) + float_minimap_size/2;
Expand All @@ -80,7 +80,7 @@ __inline__ void rotate_actor_points(float zoom_multip, float px, float py)
glTranslatef(-x,-y,0.0f);
}

__inline__ void rotate_at_player(float zoom_multip, float px, float py)
static __inline__ void rotate_at_player(float zoom_multip, float px, float py)
{
float x,y;
x = (px - (float_minimap_size/2) );
Expand All @@ -96,7 +96,7 @@ __inline__ void rotate_at_player(float zoom_multip, float px, float py)
glTranslatef(-x,-y,0.0f);
}

__inline__ void rotate_click_coords(float * x,float * y)
static __inline__ void rotate_click_coords(float * x,float * y)
{
if(rotate_minimap)
{
Expand All @@ -109,7 +109,7 @@ __inline__ void rotate_click_coords(float * x,float * y)
}
}

__inline__ int is_within_radius(float mx, float my,float px,float py,float radius)
static __inline__ int is_within_radius(float mx, float my,float px,float py,float radius)
{
float distance;

Expand Down
2 changes: 1 addition & 1 deletion notepad.c
Expand Up @@ -243,7 +243,7 @@ void display_popup_win (INPUT_POPUP *ipu, const char* label)

set_window_handler (ipu->popup_win, ELW_HANDLER_KEYPRESS, popup_keypress_handler);

if ((ipu->popup_win > -1) && (ipu->popup_win < windows_list.num_windows));
if ((ipu->popup_win > -1) && (ipu->popup_win < windows_list.num_windows))
windows_list.window[ipu->popup_win].data = ipu;
}
else
Expand Down
14 changes: 7 additions & 7 deletions sky.c
Expand Up @@ -344,7 +344,7 @@ void destroy_sphere(sky_sphere *sphere)
if (sphere->faces ) { free(sphere->faces ); sphere->faces = NULL; }
}

void __inline__ draw_sphere(sky_sphere *sphere)
static __inline__ void draw_sphere(sky_sphere *sphere)
{
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
Expand Down Expand Up @@ -385,7 +385,7 @@ float skybox_get_z_position()
return skybox_z;
}

void __inline__ skybox_vertex_to_ground_coords(sky_dome *dome, int i, float *gx, float *gy)
static __inline__ void skybox_vertex_to_ground_coords(sky_dome *dome, int i, float *gx, float *gy)
{
*gx = dome->tex_coords_conversion_factor * (dome->tex_coords[i*2 ] - dome->tex_coords[dome->vertices_count*2-2]);
*gy = dome->tex_coords_conversion_factor * (dome->tex_coords[i*2+1] - dome->tex_coords[dome->vertices_count*2-1]);
Expand Down Expand Up @@ -587,7 +587,7 @@ void update_cloudy_sky_positions()
MAT3_VECT3_MULT(moon2_direction, rot2, moon2_vect);
}

float __inline__ get_sky_sunlight(const GLfloat normal[3])
static __inline__ float get_sky_sunlight(const GLfloat normal[3])
{
GLfloat dot = normal[0]*sun_position[0]+normal[1]*sun_position[1]+normal[2]*sun_position[2];
if (skybox_show_sun && !skybox_no_sun)
Expand All @@ -596,7 +596,7 @@ float __inline__ get_sky_sunlight(const GLfloat normal[3])
return 0.0;
}

float __inline__ get_clouds_sunlight(const GLfloat normal[3])
static __inline__ float get_clouds_sunlight(const GLfloat normal[3])
{
GLfloat dot = normal[0]*sun_position[0]+normal[1]*sun_position[1]+normal[2]*sun_position[2];
if (skybox_show_sun && !skybox_no_sun)
Expand All @@ -605,7 +605,7 @@ float __inline__ get_clouds_sunlight(const GLfloat normal[3])
return 0.0;
}

float __inline__ get_fog_sunlight(const GLfloat normal[3])
static __inline__ float get_fog_sunlight(const GLfloat normal[3])
{
GLfloat dot = normal[0]*sun_position[0]+normal[1]*sun_position[1]+normal[2]*sun_position[2];
if (skybox_show_sun && !skybox_no_sun)
Expand All @@ -614,7 +614,7 @@ float __inline__ get_fog_sunlight(const GLfloat normal[3])
return 0.0;
}

float __inline__ get_moonlight1(const GLfloat normal[3])
static __inline__ float get_moonlight1(const GLfloat normal[3])
{
GLfloat dot1 = normal[0]*moon1_direction[0]+normal[1]*moon1_direction[1]+normal[2]*moon1_direction[2];
GLfloat dot2 = -(sun_position[0]*moon1_direction[0]+sun_position[1]*moon1_direction[1]+sun_position[2]*moon1_direction[2])*0.5+0.5;
Expand All @@ -625,7 +625,7 @@ float __inline__ get_moonlight1(const GLfloat normal[3])
return 0.0;
}

float __inline__ get_moonlight2(const GLfloat normal[3])
static __inline__ float get_moonlight2(const GLfloat normal[3])
{
GLfloat dot1 = normal[0]*moon2_direction[0]+normal[1]*moon2_direction[1]+normal[2]*moon2_direction[2];
GLfloat dot2 = -(sun_position[0]*moon2_direction[0]+sun_position[1]*moon2_direction[1]+sun_position[2]*moon2_direction[2])*0.5+0.5;
Expand Down
6 changes: 3 additions & 3 deletions sky.h
Expand Up @@ -74,17 +74,17 @@ void skybox_init_defs(const char *map_name);
void skybox_update_positions();
void skybox_update_colors();

static void __inline__ blend_colors(float result[], float orig[], float dest[], float t, int size)
static __inline__ void blend_colors(float result[], float orig[], float dest[], float t, int size)
{
while (size--) result[size] = (1.0-t)*orig[size] + t*dest[size];
}

static void __inline__ skybox_get_current_color(float result[4], float table[360][4])
static __inline__ void skybox_get_current_color(float result[4], float table[360][4])
{
blend_colors(result, table[game_minute], table[(game_minute+1)%360], (float)game_second/60.0, 4);
}

static void __inline__ skybox_blend_current_colors(float result[4], float orig_table[360][4], float dest_table[360][4], float t)
static __inline__ void skybox_blend_current_colors(float result[4], float orig_table[360][4], float dest_table[360][4], float t)
{
float color1[4], color2[4];
skybox_get_current_color(color1, orig_table);
Expand Down
4 changes: 2 additions & 2 deletions weather.c
Expand Up @@ -123,7 +123,7 @@ float fog_alpha;
// array used to build coordinates of quads to display particles
float weather_particles_coords[MAX_RAIN_DROPS*20];

__inline__ float next_random_number()
static __inline__ float next_random_number()
{
last_random_number = (last_random_number+1)%RANDOM_TABLE_SIZE;
return random_table[last_random_number];
Expand Down Expand Up @@ -298,7 +298,7 @@ void weather_get_color_from_ratios(float color[4], float ratios[MAX_WEATHER_TYPE
}
}

void __inline__ make_drop(int type, int i, float x, float y, float z)
static __inline__ void make_drop(int type, int i, float x, float y, float z)
{
weather_drops[type][i].pos1[0] = x + 16.0f * RAND_ONE - 8.0f;
weather_drops[type][i].pos1[1] = y + 16.0f * RAND_ONE - 8.0f;
Expand Down

0 comments on commit 4975410

Please sign in to comment.