r1342 - in trunk: . code/client code/qcommon
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat May 10 14:51:02 EDT 2008
Author: tma
Date: 2008-05-10 14:51:02 -0400 (Sat, 10 May 2008)
New Revision: 1342
Modified:
trunk/Makefile
trunk/README
trunk/code/client/snd_openal.c
trunk/code/qcommon/net_ip.c
Log:
* Fix a bunch of compile warnings
* Only call pkg-config if it exists
* Remove cl_consoleHistory from README
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2008-05-06 20:24:34 UTC (rev 1341)
+++ trunk/Makefile 2008-05-10 18:51:02 UTC (rev 1342)
@@ -160,13 +160,15 @@
# set PKG_CONFIG_PATH to influence this, e.g.
# PKG_CONFIG_PATH=/opt/cross/i386-mingw32msvc/lib/pkgconfig
-CURL_CFLAGS=$(shell pkg-config --cflags libcurl)
-CURL_LIBS=$(shell pkg-config --libs libcurl)
-OPENAL_CFLAGS=$(shell pkg-config --cflags openal)
-OPENAL_LIBS=$(shell pkg-config --libs openal)
-# FIXME: introduce CLIENT_CFLAGS
-SDL_CFLAGS=$(shell pkg-config --cflags sdl|sed 's/-Dmain=SDL_main//')
-SDL_LIBS=$(shell pkg-config --libs sdl)
+ifeq ($(shell which pkg-config > /dev/null; echo $$?),0)
+ CURL_CFLAGS=$(shell pkg-config --cflags libcurl)
+ CURL_LIBS=$(shell pkg-config --libs libcurl)
+ OPENAL_CFLAGS=$(shell pkg-config --cflags openal)
+ OPENAL_LIBS=$(shell pkg-config --libs openal)
+ # FIXME: introduce CLIENT_CFLAGS
+ SDL_CFLAGS=$(shell pkg-config --cflags sdl|sed 's/-Dmain=SDL_main//')
+ SDL_LIBS=$(shell pkg-config --libs sdl)
+endif
# version info
VERSION=1.35
@@ -383,9 +385,9 @@
ifeq ($(PLATFORM),mingw32)
-ifndef WINDRES
-WINDRES=windres
-endif
+ ifndef WINDRES
+ WINDRES=windres
+ endif
ARCH=x86
Modified: trunk/README
===================================================================
--- trunk/README 2008-05-06 20:24:34 UTC (rev 1341)
+++ trunk/README 2008-05-10 18:51:02 UTC (rev 1342)
@@ -134,7 +134,6 @@
backend
s_muteWhenMinimized - mute sound when minimized
in_joystickNo - select which joystick to use
- cl_consoleHistory - read only, stores the console history
cl_platformSensitivity - read only, indicates the mouse input
scaling
r_ext_texture_filter_anisotropic - anisotropic texture filtering
Modified: trunk/code/client/snd_openal.c
===================================================================
--- trunk/code/client/snd_openal.c 2008-05-06 20:24:34 UTC (rev 1341)
+++ trunk/code/client/snd_openal.c 2008-05-10 18:51:02 UTC (rev 1342)
@@ -476,9 +476,9 @@
} src_t;
#ifdef MACOS_X
- #define MAX_SRC 64
+ #define MAX_SRC 64
#else
- #define MAX_SRC 128
+ #define MAX_SRC 128
#endif
static src_t srcList[MAX_SRC];
static int srcCount = 0;
@@ -873,10 +873,13 @@
static
void S_AL_UpdateEntityPosition( int entityNum, const vec3_t origin )
{
- S_AL_SanitiseVector( (vec_t *)origin );
+ vec3_t sanOrigin;
+
+ VectorCopy( origin, sanOrigin );
+ S_AL_SanitiseVector( sanOrigin );
if ( entityNum < 0 || entityNum > MAX_GENTITIES )
Com_Error( ERR_DROP, "S_UpdateEntityPosition: bad entitynum %i", entityNum );
- VectorCopy( origin, entityList[entityNum].origin );
+ VectorCopy( sanOrigin, entityList[entityNum].origin );
}
/*
@@ -894,8 +897,8 @@
if (sfx < 0 || sfx >= numSfx)
{
Com_Printf(S_COLOR_RED "ERROR: S_AL_CheckInput: handle %i out of range\n", sfx);
- return qtrue;
- }
+ return qtrue;
+ }
return qfalse;
}
@@ -1070,12 +1073,17 @@
static
void S_AL_AddLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx )
{
+ vec3_t sanOrigin, sanVelocity;
+
if(S_AL_CheckInput(entityNum, sfx))
return;
- S_AL_SanitiseVector( (vec_t *)origin );
- S_AL_SanitiseVector( (vec_t *)velocity );
- S_AL_SrcLoop(SRCPRI_ENTITY, sfx, origin, velocity, entityNum);
+ VectorCopy( origin, sanOrigin );
+ VectorCopy( velocity, sanVelocity );
+ S_AL_SanitiseVector( sanOrigin );
+ S_AL_SanitiseVector( sanVelocity );
+
+ S_AL_SrcLoop(SRCPRI_ENTITY, sfx, sanOrigin, sanVelocity, entityNum);
}
/*
@@ -1086,20 +1094,24 @@
static
void S_AL_AddRealLoopingSound( int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx )
{
+ vec3_t sanOrigin, sanVelocity;
+
if(S_AL_CheckInput(entityNum, sfx))
return;
- S_AL_SanitiseVector( (vec_t *)origin );
- S_AL_SanitiseVector( (vec_t *)velocity );
+ VectorCopy( origin, sanOrigin );
+ VectorCopy( velocity, sanVelocity );
+ S_AL_SanitiseVector( sanOrigin );
+ S_AL_SanitiseVector( sanVelocity );
// There are certain maps (*cough* Q3:TA mpterra*) that have large quantities
// of ET_SPEAKERS in the PVS at any given time. OpenAL can't cope with mixing
// large numbers of sounds, so this culls them by distance
- if( DistanceSquared( origin, lastListenerOrigin ) > (s_alMaxDistance->value + s_alGraceDistance->value) *
+ if( DistanceSquared( sanOrigin, lastListenerOrigin ) > (s_alMaxDistance->value + s_alGraceDistance->value) *
(s_alMaxDistance->value + s_alGraceDistance->value) )
return;
- S_AL_SrcLoop(SRCPRI_AMBIENT, sfx, origin, velocity, entityNum);
+ S_AL_SrcLoop(SRCPRI_AMBIENT, sfx, sanOrigin, sanVelocity, entityNum);
}
/*
Modified: trunk/code/qcommon/net_ip.c
===================================================================
--- trunk/code/qcommon/net_ip.c 2008-05-06 20:24:34 UTC (rev 1341)
+++ trunk/code/qcommon/net_ip.c 2008-05-10 18:51:02 UTC (rev 1342)
@@ -483,7 +483,7 @@
if(ip_socket != INVALID_SOCKET)
{
fromlen = sizeof(from);
- ret = recvfrom( ip_socket, net_message->data, net_message->maxsize, 0, (struct sockaddr *) &from, &fromlen );
+ ret = recvfrom( ip_socket, (void *)net_message->data, net_message->maxsize, 0, (struct sockaddr *) &from, &fromlen );
if (ret == SOCKET_ERROR)
{
@@ -527,7 +527,7 @@
if(ip6_socket != INVALID_SOCKET)
{
fromlen = sizeof(from);
- ret = recvfrom(ip6_socket, net_message->data, net_message->maxsize, 0, (struct sockaddr *) &from, &fromlen);
+ ret = recvfrom(ip6_socket, (void *)net_message->data, net_message->maxsize, 0, (struct sockaddr *) &from, &fromlen);
if (ret == SOCKET_ERROR)
{
@@ -555,7 +555,7 @@
if(multicast6_socket != INVALID_SOCKET && multicast6_socket != ip6_socket)
{
fromlen = sizeof(from);
- ret = recvfrom(multicast6_socket, net_message->data, net_message->maxsize, 0, (struct sockaddr *) &from, &fromlen);
+ ret = recvfrom(multicast6_socket, (void *)net_message->data, net_message->maxsize, 0, (struct sockaddr *) &from, &fromlen);
if (ret == SOCKET_ERROR)
{
@@ -835,7 +835,6 @@
SOCKET newsocket;
struct sockaddr_in6 address;
qboolean _true = qtrue;
- int i = 1;
*err = 0;
@@ -865,11 +864,15 @@
}
#ifdef IPV6_V6ONLY
- // ipv4 addresses should not be allowed to connect via this socket.
- if(setsockopt(newsocket, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &i, sizeof(i)) == SOCKET_ERROR)
{
- // win32 systems don't seem to support this anyways.
- Com_DPrintf("WARNING: NET_IP6Socket: setsockopt IPV6_V6ONLY: %s\n", NET_ErrorString());
+ int i;
+
+ // ipv4 addresses should not be allowed to connect via this socket.
+ if(setsockopt(newsocket, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &i, sizeof(i)) == SOCKET_ERROR)
+ {
+ // win32 systems don't seem to support this anyways.
+ Com_DPrintf("WARNING: NET_IP6Socket: setsockopt IPV6_V6ONLY: %s\n", NET_ErrorString());
+ }
}
#endif
@@ -1074,14 +1077,14 @@
if ( rfc1929 ) {
buf[2] = 2; // method #2 - method id #02: username/password
}
- if ( send( socks_socket, buf, len, 0 ) == SOCKET_ERROR ) {
+ if ( send( socks_socket, (void *)buf, len, 0 ) == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: send: %s\n", NET_ErrorString() );
return;
}
// get the response
- len = recv( socks_socket, buf, 64, 0 );
+ len = recv( socks_socket, (void *)buf, 64, 0 );
if ( len == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: recv: %s\n", NET_ErrorString() );
@@ -1121,14 +1124,14 @@
}
// send it
- if ( send( socks_socket, buf, 3 + ulen + plen, 0 ) == SOCKET_ERROR ) {
+ if ( send( socks_socket, (void *)buf, 3 + ulen + plen, 0 ) == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: send: %s\n", NET_ErrorString() );
return;
}
// get the response
- len = recv( socks_socket, buf, 64, 0 );
+ len = recv( socks_socket, (void *)buf, 64, 0 );
if ( len == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: recv: %s\n", NET_ErrorString() );
@@ -1151,14 +1154,14 @@
buf[3] = 1; // address type: IPV4
*(int *)&buf[4] = INADDR_ANY;
*(short *)&buf[8] = htons( (short)port ); // port
- if ( send( socks_socket, buf, 10, 0 ) == SOCKET_ERROR ) {
+ if ( send( socks_socket, (void *)buf, 10, 0 ) == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: send: %s\n", NET_ErrorString() );
return;
}
// get the response
- len = recv( socks_socket, buf, 64, 0 );
+ len = recv( socks_socket, (void *)buf, 64, 0 );
if( len == SOCKET_ERROR ) {
err = socketError;
Com_Printf( "NET_OpenSocks: recv: %s\n", NET_ErrorString() );
More information about the quake3-commits
mailing list