- More GCC warning removal, the most egregious of which was the potential

vulnerability "format not a string literal and no format arguments".
- Changed the CMake script to search for fmod libraries by full name instead
  of assuming a symbolic link has been placed for the latest version. It can
  also find a non-installed copy of FMOD if it is placed local to the ZDoom
  source tree.



SVN r1373 (trunk)
This commit is contained in:
Randy Heit 2009-01-28 05:29:41 +00:00
parent 9346b5d686
commit a3b11af15a
10 changed files with 67 additions and 18 deletions

View file

@ -1,3 +1,11 @@
January 27, 2009
- More GCC warning removal, the most egregious of which was the security
vulnerability "format not a string literal and no format arguments".
- Changed the CMake script to search for fmod libraries by full name instead
of assuming a symbolic link has been placed for the latest version. It can
also find a non-installed copy of FMOD if it is placed local to the ZDoom
source tree.
January 26, 2009 January 26, 2009
- Fixed: Some OPL state needs to be restored before calculating rhythm. Also, - Fixed: Some OPL state needs to be restored before calculating rhythm. Also,
since only the rhythm section uses the RNG, it doesn't need to be advanced since only the rhythm section uses the RNG, it doesn't need to be advanced

View file

@ -16,6 +16,34 @@ if( CMAKE_SIZEOF_VOID_P MATCHES "8" )
set( X64 64 ) set( X64 64 )
endif( CMAKE_SIZEOF_VOID_P MATCHES "8" ) endif( CMAKE_SIZEOF_VOID_P MATCHES "8" )
# You can either use "make install" on the FMOD distribution to put it
# in standard system locations, or you can unpack the FMOD distribution
# in the root of the zdoom tree. e.g.:
# zdoom
# docs
# fmodapi<version>linux[64] -or simply- fmod
# jpeg-6b
# ...
# Construct version numbers for searching for the FMOD library on Linux.
set( MINOR_VERSIONS "50" "49" "48" "47" "46" "45" "44" "43" "42" "41"
"40" "39" "38" "37" "36" "35" "34" "33" "32" "31" "30" "29" "28"
"27" "26" "25" "24" "23" "22" "21" "20" "21" "19" "18" "17" "16"
"15" "14" "13" "12" "11" "10" "09" "08" "07" "06" "05" "04" "03"
"02" "01" "00" )
set( MAJOR_VERSIONS "22" "20" )
set( FMOD_DIR_VERSIONS ${FMOD_DIR_VERSIONS} "../fmod" )
foreach( majver ${MAJOR_VERSIONS} )
foreach( minver ${MINOR_VERSIONS} )
set( FMOD_VERSIONS ${FMOD_VERSIONS} "fmodex${X64}-4.${majver}.${minver}" )
set( FMOD_DIR_VERSIONS ${FMOD_DIR_VERSIONS} "${CMAKE_HOME_DIRECTORY}/fmodapi4${majver}${minver}linux${X64}" )
endforeach( minver ${MINOR_VERSIONS} )
foreach( dir ${FMOD_DIR_VERSIONS} )
set( FMOD_LOCAL_INC_DIRS ${FMOD_LOCAL_INC_DIRS} "${dir}/api/inc" )
set( FMOD_LOCAL_LIB_DIRS ${FMOD_LOCAL_LIB_DIRS} "${dir}/api/lib" )
endforeach( dir ${FMOD_DIR_VERSIONS} )
endforeach( majver ${MAJER_VERSIONS} )
if( WIN32 ) if( WIN32 )
if( X64 ) if( X64 )
set( WIN_TYPE Win64 ) set( WIN_TYPE Win64 )
@ -94,7 +122,7 @@ else( WIN32 )
/opt/include ) /opt/include )
set( FMOD_INC_PATH_SUFFIXES PATH_SUFFIXES fmodex ) set( FMOD_INC_PATH_SUFFIXES PATH_SUFFIXES fmodex )
set( NASM_NAMES nasm ) set( NASM_NAMES nasm )
# Non-Windows version also needs SDL # Non-Windows version also needs SDL
find_package( SDL ) find_package( SDL )
if( NOT SDL_FOUND ) if( NOT SDL_FOUND )
@ -142,9 +170,16 @@ endif( NOT FMOD_LIB_NAME )
# Search for FMOD include files # Search for FMOD include files
find_path( FMOD_INCLUDE_DIR fmod.hpp if( NOT WIN32 )
PATHS ${FMOD_SEARCH_PATHS} find_path( FMOD_INCLUDE_DIR fmod.hpp
${FMOD_INC_PATH_SUFFIXES} ) PATHS ${FMOD_LOCAL_INC_DIRS} )
endif( NOT WIN32 )
if( NOT FMOD_INCLUDE_DIR )
find_path( FMOD_INCLUDE_DIR fmod.hpp
PATHS ${FMOD_SEARCH_PATHS}
${FMOD_INC_PATH_SUFFIXES} )
endif( NOT FMOD_INCLUDE_DIR )
if( FMOD_INCLUDE_DIR ) if( FMOD_INCLUDE_DIR )
message( STATUS "FMOD include files found at ${FMOD_INCLUDE_DIR}" ) message( STATUS "FMOD include files found at ${FMOD_INCLUDE_DIR}" )
@ -155,9 +190,15 @@ endif( FMOD_INCLUDE_DIR )
# Search for FMOD library # Search for FMOD library
find_library( FMOD_LIBRARY ${FMOD_LIB_NAME} if( WIN32 )
PATHS ${FMOD_SEARCH_PATHS} find_library( FMOD_LIBRARY ${FMOD_LIB_NAME}
${FMOD_LIB_PATH_SUFFIXES} ) PATHS ${FMOD_SEARCH_PATHS}
${FMOD_LIB_PATH_SUFFIXES} )
else( WIN32 )
find_library( FMOD_LIBRARY
NAMES ${FMOD_VERSIONS}
PATHS ${FMOD_LOCAL_LIB_DIRS} )
endif( WIN32 )
if( FMOD_LIBRARY ) if( FMOD_LIBRARY )
message( STATUS "FMOD library found at ${FMOD_LIBRARY}" ) message( STATUS "FMOD library found at ${FMOD_LIBRARY}" )

View file

@ -482,7 +482,7 @@ CCMD (error)
if (argv.argc() > 1) if (argv.argc() > 1)
{ {
char *textcopy = copystring (argv[1]); char *textcopy = copystring (argv[1]);
I_Error (textcopy); I_Error ("%s", textcopy);
} }
else else
{ {
@ -495,7 +495,7 @@ CCMD (error_fatal)
if (argv.argc() > 1) if (argv.argc() > 1)
{ {
char *textcopy = copystring (argv[1]); char *textcopy = copystring (argv[1]);
I_FatalError (textcopy); I_FatalError ("%s", textcopy);
} }
else else
{ {

View file

@ -2447,7 +2447,7 @@ void D_DoomMain (void)
} }
if (devparm) if (devparm)
{ {
Printf (GStrings("D_DEVSTR")); Printf ("%s", GStrings("D_DEVSTR"));
} }
#ifndef unix #ifndef unix
@ -2456,7 +2456,7 @@ void D_DoomMain (void)
// the user's home directory. // the user's home directory.
if (Args->CheckParm("-cdrom")) if (Args->CheckParm("-cdrom"))
{ {
Printf (GStrings("D_CDROM")); Printf ("%s", GStrings("D_CDROM"));
mkdir (CDROM_DIR, 0); mkdir (CDROM_DIR, 0);
} }
#endif #endif

View file

@ -1997,7 +1997,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
case DEM_PRINT: case DEM_PRINT:
s = ReadString (stream); s = ReadString (stream);
Printf (s); Printf ("%s", s);
break; break;
case DEM_CENTERPRINT: case DEM_CENTERPRINT:

View file

@ -253,7 +253,7 @@ PClass *PClass::CreateDerivedClass (FName name, unsigned int size)
const PClass *existclass = FindClass(name); const PClass *existclass = FindClass(name);
// This is a placeholder so fill it in // This is a placeholder so fill it in
if (existclass != NULL && existclass->Size == -1) if (existclass != NULL && existclass->Size == (unsigned)-1)
{ {
type = const_cast<PClass*>(existclass); type = const_cast<PClass*>(existclass);
if (!IsDescendantOf(type->ParentClass)) if (!IsDescendantOf(type->ParentClass))

View file

@ -2506,11 +2506,11 @@ void G_DoPlayDemo (void)
demo_p = demobuffer = NULL; demo_p = demobuffer = NULL;
if (singledemo) if (singledemo)
{ {
I_Error (eek); I_Error ("%s", eek);
} }
else else
{ {
Printf (PRINT_BOLD, eek); Printf (PRINT_BOLD, "%s", eek);
gameaction = ga_nothing; gameaction = ga_nothing;
} }
} }

View file

@ -928,7 +928,7 @@ void DumpStateHelper(FStateLabels *StateList, const FString &prefix)
else else
{ {
Printf(PRINT_LOG, "%s%s: %s.%d\n", prefix.GetChars(), StateList->Labels[i].Label.GetChars(), Printf(PRINT_LOG, "%s%s: %s.%d\n", prefix.GetChars(), StateList->Labels[i].Label.GetChars(),
owner->TypeName.GetChars(), StateList->Labels[i].State - owner->ActorInfo->OwnedStates); owner->TypeName.GetChars(), int(StateList->Labels[i].State - owner->ActorInfo->OwnedStates));
} }
} }
if (StateList->Labels[i].Children != NULL) if (StateList->Labels[i].Children != NULL)

View file

@ -268,7 +268,7 @@ static void FinishThingdef()
// Skip non-actors // Skip non-actors
if (!ti->IsDescendantOf(RUNTIME_CLASS(AActor))) continue; if (!ti->IsDescendantOf(RUNTIME_CLASS(AActor))) continue;
if (ti->Size == -1) if (ti->Size == (unsigned)-1)
{ {
Printf("Class %s referenced but not defined\n", ti->TypeName.GetChars()); Printf("Class %s referenced but not defined\n", ti->TypeName.GetChars());
errorcount++; errorcount++;

View file

@ -124,7 +124,7 @@ public:
void Copy(int dest, int src, int cnt); void Copy(int dest, int src, int cnt);
int ResolveAll(); int ResolveAll();
FxExpression *Get(int no); FxExpression *Get(int no);
int Size() { return expressions.Size(); } unsigned int Size() { return expressions.Size(); }
}; };
extern FStateExpressions StateParams; extern FStateExpressions StateParams;