Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 17 files changed
  • 0 commit comments
  • 2 contributors
Commits on Nov 28, 2011
@usineur usineur fix all "deprecated conversion from string constant to 'char*'" 19ef30e
@phire phire SConstruct: Added generic release optimisation flags.
The x86_64 platform didn't agree with the -march=pentium3 flag. So I've
implemented some generic release flags which leaves most of the
optimisations upto the compiler and -O3, while keeping the -ffast-math
related flags.
e1812c1
View
19 neo/SConstruct
@@ -313,18 +313,23 @@ if ( BUILD == 'debug-all' ):
if ( ID_MCHECK == '0' ):
ID_MCHECK = '1'
elif ( BUILD == 'debug' ):
- OPTCPPFLAGS = [ '-g', '-O1', '-D_DEBUG' ]
+ OPTCPPFLAGS = [ '-g', '-O1', '-D_DEBUG', '-fkeep-inline-functions']
if ( ID_MCHECK == '0' ):
ID_MCHECK = '1'
elif ( BUILD == 'release' ):
- # -fomit-frame-pointer: "-O also turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging."
- # on x86 have to set it explicitely
- # -finline-functions: implicit at -O3
- # -fschedule-insns2: implicit at -O2
- # no-unsafe-math-optimizations: that should be on by default really. hit some wonko bugs in physics code because of that
- OPTCPPFLAGS = [ '-O3', '-march=pentium3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations', '-fomit-frame-pointer' ]
+ if( cpu == 'x86' ):
+ # -fomit-frame-pointer: "-O also turns on -fomit-frame-pointer on machines where doing so does not interfere with debugging."
+ # on x86 have to set it explicitely
+ # -finline-functions: implicit at -O3
+ # -fschedule-insns2: implicit at -O2
+ # no-unsafe-math-optimizations: that should be on by default really. hit some wonko bugs in physics code because of that
+ OPTCPPFLAGS = [ '-O3', '-march=pentium3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations', '-fomit-frame-pointer' ]
+ else:
+ # generic optimisation flags for platforms that don't have hand tuned flags.
+ OPTCPPFLAGS = [ '-O3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations' ]
if ( ID_MCHECK == '0' ):
ID_MCHECK = '2'
+
else:
print 'Unknown build configuration ' + BUILD
sys.exit(0)
View
2 neo/d3xp/Game_local.cpp
@@ -71,7 +71,7 @@ const char *idGameLocal::sufaceTypeNames[ MAX_SURFACE_TYPES ] = {
#ifdef _D3XP
// List of all defs used by the player that will stay on the fast timeline
-static char* fastEntityList[] = {
+static const char* fastEntityList[] = {
"player_doommarine",
"weapon_chainsaw",
"weapon_fists",
View
2 neo/d3xp/Item.cpp
@@ -772,7 +772,7 @@ void idItemTeam::Spawn( void ) {
idItemTeam::LoadScript
===============
*/
-function_t * idItemTeam::LoadScript( char * script ) {
+function_t * idItemTeam::LoadScript( const char * script ) {
function_t * function = NULL;
idStr funcname = spawnArgs.GetString( script, "" );
if ( funcname.Length() ) {
View
2 neo/d3xp/Item.h
@@ -257,7 +257,7 @@ class idItemTeam : public idMoveableItem {
void Event_FlagCapture( void );
void PrivateReturn( void );
- function_t * LoadScript( char * script );
+ function_t * LoadScript( const char * script );
void SpawnNugget( idVec3 pos );
void UpdateGuis( void );
View
2 neo/d3xp/MultiplayerGame.cpp
@@ -4230,7 +4230,7 @@ idMultiplayerGame::GetTeamFlag
================
*/
void idMultiplayerGame::FindTeamFlags( void ) {
- char * flagDefs[2] =
+ const char * flagDefs[2] =
{
"team_CTF_redflag",
"team_CTF_blueflag"
View
6 neo/d3xp/gamesys/SysCmds.cpp
@@ -446,7 +446,7 @@ argv(0) god
==================
*/
void Cmd_God_f( const idCmdArgs &args ) {
- char *msg;
+ const char *msg;
idPlayer *player;
player = gameLocal.GetLocalPlayer();
@@ -475,7 +475,7 @@ argv(0) notarget
==================
*/
void Cmd_Notarget_f( const idCmdArgs &args ) {
- char *msg;
+ const char *msg;
idPlayer *player;
player = gameLocal.GetLocalPlayer();
@@ -502,7 +502,7 @@ argv(0) noclip
==================
*/
void Cmd_Noclip_f( const idCmdArgs &args ) {
- char *msg;
+ const char *msg;
idPlayer *player;
player = gameLocal.GetLocalPlayer();
View
6 neo/d3xp/script/Script_Compiler.cpp
@@ -38,7 +38,7 @@ If you have questions concerning this license or the applicable additional terms
#define TOP_PRIORITY 7
bool idCompiler::punctuationValid[ 256 ];
-char *idCompiler::punctuation[] = {
+const char *idCompiler::punctuation[] = {
"+=", "-=", "*=", "/=", "%=", "&=", "|=", "++", "--",
"&&", "||", "<=", ">=", "==", "!=", "::", ";", ",",
"~", "!", "*", "/", "%", "(", ")", "-", "+",
@@ -207,8 +207,8 @@ idCompiler::idCompiler()
================
*/
idCompiler::idCompiler() {
- char **ptr;
- int id;
+ const char **ptr;
+ int id;
// make sure we have the right # of opcodes in the table
assert( ( sizeof( opcodes ) / sizeof( opcodes[ 0 ] ) ) == ( NUM_OPCODES + 1 ) );
View
8 neo/d3xp/script/Script_Compiler.h
@@ -31,8 +31,8 @@ If you have questions concerning this license or the applicable additional terms
const char * const RESULT_STRING = "<RESULT>";
typedef struct opcode_s {
- char *name;
- char *opname;
+ const char *name;
+ const char *opname;
int priority;
bool rightAssociative;
idVarDef *type_a;
@@ -196,8 +196,8 @@ enum {
class idCompiler {
private:
- static bool punctuationValid[ 256 ];
- static char *punctuation[];
+ static bool punctuationValid[ 256 ];
+ static const char *punctuation[];
idParser parser;
idParser *parserPtr;
View
4 neo/d3xp/script/Script_Interpreter.cpp
@@ -425,7 +425,7 @@ idInterpreter::Error
Aborts the currently executing function
============
*/
-void idInterpreter::Error( char *fmt, ... ) const {
+void idInterpreter::Error( const char *fmt, ... ) const {
va_list argptr;
char text[ 1024 ];
@@ -450,7 +450,7 @@ idInterpreter::Warning
Prints file and line number information with warning.
============
*/
-void idInterpreter::Warning( char *fmt, ... ) const {
+void idInterpreter::Warning( const char *fmt, ... ) const {
va_list argptr;
char text[ 1024 ];
View
4 neo/d3xp/script/Script_Interpreter.h
@@ -93,8 +93,8 @@ class idInterpreter {
int CurrentLine( void ) const;
const char *CurrentFile( void ) const;
- void Error( char *fmt, ... ) const id_attribute((format(printf,2,3)));
- void Warning( char *fmt, ... ) const id_attribute((format(printf,2,3)));
+ void Error( const char *fmt, ... ) const id_attribute((format(printf,2,3)));
+ void Warning( const char *fmt, ... ) const id_attribute((format(printf,2,3)));
void DisplayInfo( void ) const;
bool BeginMultiFrameEvent( idEntity *ent, const idEventDef *event );
View
6 neo/game/gamesys/SysCmds.cpp
@@ -395,7 +395,7 @@ argv(0) god
==================
*/
void Cmd_God_f( const idCmdArgs &args ) {
- char *msg;
+ const char *msg;
idPlayer *player;
player = gameLocal.GetLocalPlayer();
@@ -424,7 +424,7 @@ argv(0) notarget
==================
*/
void Cmd_Notarget_f( const idCmdArgs &args ) {
- char *msg;
+ const char *msg;
idPlayer *player;
player = gameLocal.GetLocalPlayer();
@@ -451,7 +451,7 @@ argv(0) noclip
==================
*/
void Cmd_Noclip_f( const idCmdArgs &args ) {
- char *msg;
+ const char *msg;
idPlayer *player;
player = gameLocal.GetLocalPlayer();
View
2 neo/idlib/Lexer.cpp
@@ -774,7 +774,7 @@ idLexer::ReadPunctuation
*/
int idLexer::ReadPunctuation( idToken *token ) {
int l, n, i;
- char *p;
+ const char *p;
const punctuation_t *punc;
#ifdef PUNCTABLE
View
2 neo/idlib/Lexer.h
@@ -129,7 +129,7 @@ typedef enum {
// punctuation
typedef struct punctuation_s
{
- char *p; // punctuation character(s)
+ const char *p; // punctuation character(s)
int n; // punctuation id
} punctuation_t;
View
2 neo/idlib/Parser.cpp
@@ -625,7 +625,7 @@ void idParser::AddBuiltinDefines( void ) {
define_t *define;
struct builtin
{
- char *string;
+ const char *string;
int id;
} builtin[] = {
{ "__LINE__", BUILTIN_LINE },
View
2 neo/idlib/math/Simd.cpp
@@ -312,7 +312,7 @@ TIME_TYPE time_in_millisec( void ) {
PrintClocks
============
*/
-void PrintClocks( char *string, int dataCount, int clocks, int otherClocks = 0 ) {
+void PrintClocks( const char *string, int dataCount, int clocks, int otherClocks = 0 ) {
int i;
idLib::common->Printf( string );
View
2 neo/tools/compilers/aas/Brush.cpp
@@ -44,7 +44,7 @@ If you have questions concerning this license or the applicable additional terms
DisplayRealTimeString
============
*/
-void DisplayRealTimeString( char *string, ... ) {
+void DisplayRealTimeString( const char *string, ... ) {
va_list argPtr;
char buf[MAX_STRING_CHARS];
static int lastUpdateTime;
View
2 neo/tools/compilers/aas/Brush.h
@@ -46,7 +46,7 @@ If you have questions concerning this license or the applicable additional terms
class idBrush;
class idBrushList;
-void DisplayRealTimeString( char *string, ... ) id_attribute((format(printf,1,2)));
+void DisplayRealTimeString( const char *string, ... ) id_attribute((format(printf,1,2)));
//===============================================================

No commit comments for this range

Something went wrong with that request. Please try again.