Wii: Fix most warnings. Three remain: two are labeled with FIXMEs; the third consists of signed/unsigned comparisons involving LSWAPIB() in kplib.c.

git-svn-id: https://svn.eduke32.com/eduke32@3496 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2013-02-18 08:50:08 +00:00
parent 90f4a02905
commit 624841257c
8 changed files with 52 additions and 8 deletions

View file

@ -390,6 +390,7 @@ BASECOMMONFLAGS=$(debug) $(OPTOPT) $(CWARNS) \
ifneq (0,$(CLANG))
BASECOMMONFLAGS+= -Wno-unused-value -Wno-parentheses
endif
BASECOMMONFLAGS+= -Wno-char-subscripts
ifeq (0,$(NETCODE))
BASECOMMONFLAGS+= -DNETCODE_DISABLE

View file

@ -32,7 +32,7 @@ endif
include Makefile.shared
OURCOMMONFLAGS=$(BASECOMMONFLAGS) -Wno-char-subscripts -I$(INC)
OURCOMMONFLAGS=$(BASECOMMONFLAGS) -I$(INC)
OURCFLAGS=$(OURCOMMONFLAGS) $(BASECFLAGS)
OURCONLYFLAGS=$(BASECONLYFLAGS)
OURCXXFLAGS=$(BASECXXFLAGS)

View file

@ -42,6 +42,17 @@
#ifdef HAVE_INTTYPES
# include <stdint.h>
# include <inttypes.h>
// Ghetto. Blame devkitPPC's faulty headers.
#ifdef GEKKO
# undef PRIdPTR
# define PRIdPTR "d"
# undef PRIxPTR
# define PRIxPTR "x"
# undef SCNx32
# define SCNx32 "x"
#endif
#elif defined(_MSC_VER)
# include "msvc/inttypes.h" // from http://code.google.com/p/msinttypes/
#endif

View file

@ -878,6 +878,7 @@ int access(const char *pathname, int mode)
return -1;
// TODO: Check mode against st_mode
UNREFERENCED_PARAMETER(mode);
return 0;
}

View file

@ -5516,6 +5516,8 @@ static void drawsprite_opengl(int32_t snum)
bglDisable(GL_ALPHA_TEST);
}
# endif
#else
UNREFERENCED_PARAMETER(snum);
#endif
//============================================================================= //POLYMOST ENDS
}
@ -14325,7 +14327,7 @@ void completemirror(void)
for (dy=mirrorsy2-mirrorsy1-1; dy>=0; dy--)
{
copybufbyte((void *)(p+1),tempbuf,mirrorsx2+1);
tempbuf[mirrorsx2] = tempbuf[mirrorsx2-1];
tempbuf[mirrorsx2] = tempbuf[mirrorsx2-1]; // FIXME: with GEKKO, array subscripts are below array bounds
copybufreverse(&tempbuf[mirrorsx2],(void *)(p+i),mirrorsx2+1);
p += ylookup[1];
faketimerhandler();
@ -16187,10 +16189,14 @@ static int32_t screencapture_png(const char *filename, char inverseit, const cha
static int32_t screencapture_tga(const char *filename, char inverseit)
{
int32_t i,j;
int32_t i;
char *ptr, head[18] = { 0,1,1,0,0,0,1,24,0,0,0,0,0/*wlo*/,0/*whi*/,0/*hlo*/,0/*hhi*/,8,0 };
//char palette[4*256];
char *fn = Bstrdup(filename), *inversebuf;
char *fn = Bstrdup(filename);
# ifdef USE_OPENGL
int32_t j;
char *inversebuf;
# endif
BFILE *fil;
i = screencapture_common1(fn, "tga", &fil);

View file

@ -15,6 +15,7 @@ int32_t dmval;
#if defined(__GNUC__) && defined(GEKKO)
// naked function (no prolog/epilog)
// FIXME: this function produces unused parameter warnings and a missing return warning
int32_t scale(int32_t a, int32_t d, int32_t c)
{
// return ((int64_t)a * d) / c;

View file

@ -4,6 +4,10 @@
*/
#ifndef WIN32
#ifndef UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(x) x=x
#endif
#if defined(GEKKO)
# include <network.h>
# define gethostbyname net_gethostbyname
@ -172,8 +176,9 @@ enet_address_get_host_ip (const ENetAddress * address, char * name, size_t nameL
int
enet_address_get_host (const ENetAddress * address, char * name, size_t nameLength)
{
struct in_addr in;
struct hostent * hostEntry = NULL;
#ifndef GEKKO
struct in_addr in;
#ifdef HAS_GETHOSTBYADDR_R
struct hostent hostData;
char buffer [2048];
@ -190,6 +195,7 @@ enet_address_get_host (const ENetAddress * address, char * name, size_t nameLeng
in.s_addr = address -> host;
hostEntry = gethostbyaddr ((char *) & in, sizeof (struct in_addr), AF_INET);
#endif
#endif
if (hostEntry == NULL)
@ -342,9 +348,10 @@ enet_socket_send (ENetSocket socket,
const ENetBuffer * buffers,
size_t bufferCount)
{
int sentLength = -1;
#ifndef GEKKO
struct msghdr msgHdr;
struct sockaddr_in sin;
int sentLength;
memset (& msgHdr, 0, sizeof (struct msghdr));
@ -364,6 +371,12 @@ enet_socket_send (ENetSocket socket,
msgHdr.msg_iovlen = bufferCount;
sentLength = sendmsg (socket, & msgHdr, MSG_NOSIGNAL);
#else
UNREFERENCED_PARAMETER(socket);
UNREFERENCED_PARAMETER(address);
UNREFERENCED_PARAMETER(buffers);
UNREFERENCED_PARAMETER(bufferCount);
#endif
if (sentLength == -1)
{
@ -382,9 +395,10 @@ enet_socket_receive (ENetSocket socket,
ENetBuffer * buffers,
size_t bufferCount)
{
int recvLength = -1;
#ifndef GEKKO
struct msghdr msgHdr;
struct sockaddr_in sin;
int recvLength;
memset (& msgHdr, 0, sizeof (struct msghdr));
@ -398,6 +412,12 @@ enet_socket_receive (ENetSocket socket,
msgHdr.msg_iovlen = bufferCount;
recvLength = recvmsg (socket, & msgHdr, MSG_NOSIGNAL);
#else
UNREFERENCED_PARAMETER(socket);
UNREFERENCED_PARAMETER(address);
UNREFERENCED_PARAMETER(buffers);
UNREFERENCED_PARAMETER(bufferCount);
#endif
if (recvLength == -1)
{
@ -407,6 +427,7 @@ enet_socket_receive (ENetSocket socket,
return -1;
}
#ifndef GEKKO
#ifdef HAS_MSGHDR_FLAGS
if (msgHdr.msg_flags & MSG_TRUNC)
return -1;
@ -417,6 +438,7 @@ enet_socket_receive (ENetSocket socket,
address -> host = (enet_uint32) sin.sin_addr.s_addr;
address -> port = ENET_NET_TO_HOST_16 (sin.sin_port);
}
#endif
return recvLength;
}

View file

@ -69,7 +69,9 @@ ifeq ($(RENDERTYPE),SDL)
endif
ifneq ($(PLATFORM),DARWIN)
ifneq ($(PLATFORM),WINDOWS)
OURCOMMONFLAGS+=`pkg-config --cflags vorbis`
ifneq ($(PLATFORM),WII)
OURCOMMONFLAGS+=`pkg-config --cflags vorbis`
endif
endif
endif
OBJECTS+= $(OBJ)/driver_sdl.o