1 Upstream patch to fix build with GCC 5
3 Obtained from the LGames Subversion repository with the following command:
4 svn diff -c164 svn://svn.code.sf.net/p/lgames/code/trunk/ltris
6 Signed-off-by: Rodrigo Rebello <rprebello@gmail.com>
9 ------------------------------------------------------------------------
10 r164 | kulkanie | 2015-05-16 05:48:02 -0300 (Sat, 16 May 2015) | 1 line
12 removed all inline keywords
13 ------------------------------------------------------------------------
15 Line added to LTris ChangeLog concerning the change:
16 - removed all inline keywords to work with GCC 5 (2015/05/16 MS)
21 ===================================================================
22 --- a/src/sdl.c (revision 163)
23 +++ b/src/sdl.c (revision 164)
27 /* return full path of bitmap */
28 -inline void get_full_bmp_path( char *full_path, char *file_name )
29 +void get_full_bmp_path( char *full_path, char *file_name )
31 sprintf(full_path, "%s/gfx/%s", SRC_DIR, file_name );
37 -inline void lock_surf(SDL_Surface *sur)
38 +void lock_surf(SDL_Surface *sur)
40 if (SDL_MUSTLOCK(sur))
46 -inline void unlock_surf(SDL_Surface *sur)
47 +void unlock_surf(SDL_Surface *sur)
49 if (SDL_MUSTLOCK(sur))
50 SDL_UnlockSurface(sur);
55 -inline void lock_font(Font *fnt)
56 +void lock_font(Font *fnt)
58 if (SDL_MUSTLOCK(fnt->pic))
59 SDL_LockSurface(fnt->pic);
64 -inline void unlock_font(Font *fnt)
65 +void unlock_font(Font *fnt)
67 if (SDL_MUSTLOCK(fnt->pic))
68 SDL_UnlockSurface(fnt->pic);
71 update rectangle (0,0,0,0)->fullscreen
73 -inline void refresh_screen(int x, int y, int w, int h)
74 +void refresh_screen(int x, int y, int w, int h)
76 SDL_UpdateRect(sdl.screen, x, y, w, h);
82 -inline void lock_screen()
85 if (SDL_MUSTLOCK(sdl.screen))
86 SDL_LockSurface(sdl.screen);
91 -inline void unlock_screen()
94 if (SDL_MUSTLOCK(sdl.screen))
95 SDL_UnlockSurface(sdl.screen);
98 flip hardware screens (double buffer)
100 -inline void flip_screen()
103 SDL_Flip(sdl.screen);
105 @@ -1132,7 +1132,7 @@
107 get milliseconds since last call
109 -inline int get_time()
113 cur_time = SDL_GetTicks();
114 @@ -1148,7 +1148,7 @@
118 -inline void reset_timer()
121 last_time = SDL_GetTicks();
124 ===================================================================
125 --- a/src/sdl.h (revision 163)
126 +++ b/src/sdl.h (revision 164)
128 SDL_Surface* load_surf(char *fname, int f);
129 SDL_Surface* create_surf(int w, int h, int f);
130 void free_surf( SDL_Surface **surf );
131 -inline void lock_surf(SDL_Surface *sur);
132 -inline void unlock_surf(SDL_Surface *sur);
133 +void lock_surf(SDL_Surface *sur);
134 +void unlock_surf(SDL_Surface *sur);
135 void blit_surf(void);
136 void alpha_blit_surf(int alpha);
137 void fill_surf(int c);
139 Font* load_fixed_font(char *fname, int off, int len, int w);
140 void free_font(Font **sfnt);
141 int write_text(Font *sfnt, SDL_Surface *dest, int x, int y, char *str, int alpha);
142 -inline void lock_font(Font *sfnt);
143 -inline void unlock_font(Font *sfnt);
144 +void lock_font(Font *sfnt);
145 +void unlock_font(Font *sfnt);
146 SDL_Rect last_write_rect(Font *fnt);
147 int text_width(Font *fnt, char *str);
149 @@ -132,14 +132,14 @@
150 char** get_mode_names( int *count );
151 int set_video_mode( Video_Mode mode );
153 -inline void refresh_screen( int x, int y, int w, int h );
154 +void refresh_screen( int x, int y, int w, int h );
155 void refresh_rects();
156 void add_refresh_rect(int x, int y, int w, int h);
158 void wait_for_click();
159 -inline void lock_screen();
160 -inline void unlock_screen();
161 -inline void flip_screen();
163 +void unlock_screen();
165 void fade_screen( int type, int ms );
166 void take_screenshot( int i );
169 SDL_Cursor* create_cursor( int width, int height, int hot_x, int hot_y, char *source );
172 -inline int get_time();
173 -inline void reset_timer();
180 ===================================================================
181 --- a/src/tools.c (revision 163)
182 +++ b/src/tools.c (revision 164)
186 /* compares to strings and returns true if their first strlen(str1) chars are equal */
187 -inline int strequal( char *str1, char *str2 )
188 +int strequal( char *str1, char *str2 )
190 if ( strlen( str1 ) != strlen( str2 ) ) return 0;
191 return ( !strncmp( str1, str2, strlen( str1 ) ) );
195 /* set delay to ms milliseconds */
196 -inline void delay_set( Delay *delay, int ms )
197 +void delay_set( Delay *delay, int ms )
204 /* reset delay ( cur = 0 )*/
205 -inline void delay_reset( Delay *delay )
206 +void delay_reset( Delay *delay )
211 /* check if times out and reset */
212 -inline int delay_timed_out( Delay *delay, int ms )
213 +int delay_timed_out( Delay *delay, int ms )
216 if ( delay->cur >= delay->limit ) {
220 /* set timer so that we have a time out next call of delay_timed_out() */
221 -inline void delay_force_time_out( Delay *delay )
222 +void delay_force_time_out( Delay *delay )
224 delay->cur = delay->limit;
227 -inline void goto_tile( int *x, int *y, int d )
228 +void goto_tile( int *x, int *y, int d )
230 /* 0 -up, clockwise, 5 - left up */
232 @@ -326,24 +326,24 @@
233 the target value until reached when counter_update() is called.
234 ====================================================================
236 -inline void counter_set( Counter *counter, double value )
237 +void counter_set( Counter *counter, double value )
239 counter->value = value;
240 counter->approach = value;
242 -inline void counter_add( Counter *counter, double add )
243 +void counter_add( Counter *counter, double add )
245 counter->value += add;
247 -inline double counter_get_approach( Counter counter )
248 +double counter_get_approach( Counter counter )
250 return counter.approach;
252 -inline double counter_get( Counter counter )
253 +double counter_get( Counter counter )
255 return counter.value;
257 -inline void counter_update( Counter *counter, int ms )
258 +void counter_update( Counter *counter, int ms )
261 if ( counter->approach == counter->value ) return;
263 ===================================================================
264 --- a/src/bowl.c (revision 163)
265 +++ b/src/bowl.c (revision 164)
267 Set a tile contents and pixel contents.
268 ====================================================================
270 -inline void bowl_set_tile( Bowl *bowl, int x, int y, int tile_id )
271 +void bowl_set_tile( Bowl *bowl, int x, int y, int tile_id )
273 int i, j = y * bowl->block_size;
274 bowl->contents[x][y] = tile_id;
276 ===================================================================
277 --- a/src/tools.h (revision 163)
278 +++ b/src/tools.h (revision 164)
280 #define VEC_DIST( vec1, vec2 ) ( sqrt( ( vec1.x - vec2.x ) * ( vec1.x - vec2.x ) + ( vec1.y - vec2.y ) * ( vec1.y - vec2.y ) ) )
282 /* compares to strings and returns true if their first strlen(str1) chars are equal */
283 -inline int strequal( char *str1, char *str2 );
284 +int strequal( char *str1, char *str2 );
287 void delete_lines( char **lines, int line_number );
291 /* set delay to ms milliseconds */
292 -inline void delay_set( Delay *delay, int ms );
293 +void delay_set( Delay *delay, int ms );
295 /* reset delay ( cur = 0 )*/
296 -inline void delay_reset( Delay *delay );
297 +void delay_reset( Delay *delay );
299 /* check if time's out ( add ms milliseconds )and reset */
300 -inline int delay_timed_out( Delay *delay, int ms );
301 +int delay_timed_out( Delay *delay, int ms );
303 /* set timer so that we have a time out next call of delay_timed_out() */
304 -inline void delay_force_time_out( Delay *delay );
305 +void delay_force_time_out( Delay *delay );
307 /* return distance betwteen to map positions */
308 int get_dist( int x1, int y1, int x2, int y2 );