Fix all remaining warnings in gp2x build. The compiler is a bit more picky about the includes and feature macros.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1352 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
parent
13865a0ade
commit
7fe8d44805
@ -25,6 +25,7 @@
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "brush.h"
|
||||
#include "buttons.h"
|
||||
|
||||
@ -19,9 +19,12 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
#define _XOPEN_SOURCE 500
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
@ -26,6 +26,8 @@
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <SDL.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "buttons.h"
|
||||
#include "engine.h"
|
||||
|
||||
@ -29,6 +29,8 @@
|
||||
#include <png.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "errors.h"
|
||||
#include "global.h"
|
||||
#include "loadsave.h"
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
2
init.c
2
init.c
@ -22,6 +22,8 @@
|
||||
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
|
||||
// Signal handler: I activate it for the two platforms who certainly
|
||||
// support them. Feel free to check with others.
|
||||
#if defined(__WIN32__) || defined(__linux__)
|
||||
|
||||
4
io.c
4
io.c
@ -23,6 +23,8 @@
|
||||
// Fonctions de lecture/ecriture file, gèrent les systèmes big-endian et
|
||||
// little-endian.
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
|
||||
#include <SDL_endian.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
@ -316,7 +318,7 @@ byte Create_lock_file(const char *file_directory)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
#elseif !defined(__GP2X__) // gp2x does not defines F_TLOCK and is not really multitasking anyway
|
||||
#else
|
||||
// Unixy method for lock file
|
||||
Lock_file_handle = open(lock_filename,O_WRONLY|O_CREAT,S_IRUSR|S_IWUSR);
|
||||
if (Lock_file_handle == -1)
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
#define _XOPEN_SOURCE
|
||||
#define _XOPEN_SOURCE 500
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@ -25,6 +25,9 @@
|
||||
///@file miscfileformats.c
|
||||
/// Formats that aren't fully saving, either because of palette restrictions or other things
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "engine.h"
|
||||
#include "errors.h"
|
||||
#include "global.h"
|
||||
|
||||
12
mountlist.c
12
mountlist.c
@ -36,6 +36,8 @@
|
||||
#else
|
||||
#define MOUNTED_GETMNTENT1
|
||||
#endif
|
||||
|
||||
#define _XOPEN_SOURCE 500
|
||||
// --- END GRAFX2 CUSTOM CONFIG ---
|
||||
|
||||
#include "mountlist.h"
|
||||
@ -332,8 +334,14 @@ fstype_to_string (int t)
|
||||
/* Return the device number from MOUNT_OPTIONS, if possible.
|
||||
Otherwise return (dev_t) -1. */
|
||||
|
||||
#ifdef __linux__
|
||||
#define BROKEN __attribute__((unused))
|
||||
#else
|
||||
#define BROKEN
|
||||
#endif
|
||||
|
||||
static dev_t
|
||||
dev_from_mount_options (char const *mount_options)
|
||||
dev_from_mount_options (BROKEN char const *mount_options)
|
||||
{
|
||||
/* GNU/Linux allows file system implementations to define their own
|
||||
meaning for "dev=" mount options, so don't trust the meaning
|
||||
@ -370,7 +378,7 @@ dev_from_mount_options (char const *mount_options)
|
||||
the returned list are valid. Otherwise, they might not be. */
|
||||
|
||||
struct mount_entry *
|
||||
read_file_system_list (bool need_fs_type)
|
||||
read_file_system_list (BROKEN bool need_fs_type)
|
||||
{
|
||||
struct mount_entry *mount_list;
|
||||
struct mount_entry *me;
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
#define _XOPEN_SOURCE 500
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* vim:expandtab:ts=2 sw=2:
|
||||
*/
|
||||
#include <limits.h>
|
||||
#define _XOPEN_SOURCE 500
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
3
struct.h
3
struct.h
@ -350,7 +350,8 @@ typedef struct T_Page
|
||||
byte Background_transparent; ///< Boolean, true if Layer 0 should have transparent pixels
|
||||
byte Transparent_color; ///< Index of transparent color. 0 to 255.
|
||||
byte Nb_layers; ///< Number of layers
|
||||
byte * Image[0]; ///< Pixel data for the (first layer of) image.
|
||||
byte * Image[]; ///< Pixel data for the (first layer of) image.
|
||||
// Define as Image[0] if you have an old gcc which is not C99.
|
||||
// No field after Image[] ! Dynamic layer allocation for Image[1], [2] etc.
|
||||
} T_Page;
|
||||
|
||||
|
||||
7
text.c
7
text.c
@ -515,11 +515,16 @@ byte *Render_text_SFont(const char *str, int font_number, int *width, int *heigh
|
||||
return new_brush;
|
||||
}
|
||||
|
||||
#ifdef NOTTF
|
||||
#define TTFONLY __attribute__((unused))
|
||||
#else
|
||||
#define TTFONLY
|
||||
#endif
|
||||
|
||||
// Crée une brosse à partir des paramètres de texte demandés.
|
||||
// Si cela réussit, la fonction place les dimensions dans width et height,
|
||||
// et retourne l'adresse du bloc d'octets.
|
||||
byte *Render_text(const char *str, int font_number, int size, int antialias, int bold, int italic, int *width, int *height)
|
||||
byte *Render_text(const char *str, int font_number, TTFONLY int size, int TTFONLY antialias, TTFONLY int bold, TTFONLY int italic, int *width, int *height)
|
||||
{
|
||||
T_Font *font = font_list_start;
|
||||
int index=font_number;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user