Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: waninkoko/doom3.x64
base: d268563319
...
head fork: waninkoko/doom3.x64
compare: 6dac953286
  • 2 commits
  • 7 files changed
  • 0 commit comments
  • 2 contributors
13 neo/game/script/Script_Compiler.cpp
View
@@ -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,7 +207,7 @@ idCompiler::idCompiler()
================
*/
idCompiler::idCompiler() {
- char **ptr;
+ const char **ptr;
int id;
// make sure we have the right # of opcodes in the table
@@ -960,8 +960,8 @@ idVarDef *idCompiler::EmitFunctionParms( int op, idVarDef *func, int startarg, i
Error( "type mismatch on parm %i of call to '%s'", arg + 1, func->Name() );
}
- if ( funcArg->Type() == ev_object ) {
- size += type_object.Size();
+ if ( funcArg->Type() == ev_object or funcArg->Type() == ev_entity) {
+ size += sizeof(int);
} else {
size += funcArg->Size();
}
@@ -2010,7 +2010,6 @@ void idCompiler::ParseObjectDef( const char *objname ) {
const char *fieldname;
idTypeDef newtype( ev_field, NULL, "", 0, NULL );
idVarDef *oldscope;
- int num;
int i;
oldscope = scope;
@@ -2038,7 +2037,6 @@ void idCompiler::ParseObjectDef( const char *objname ) {
scope = objtype->def;
// inherit all the functions
- num = parentType->NumFunctions();
for( i = 0; i < parentType->NumFunctions(); i++ ) {
const function_t *func = parentType->GetFunction( i );
objtype->AddFunction( func );
@@ -2115,7 +2113,6 @@ idCompiler::ParseFunctionDef
void idCompiler::ParseFunctionDef( idTypeDef *returnType, const char *name ) {
idTypeDef *type;
idVarDef *def;
- const idVarDef *parm;
idVarDef *oldscope;
int i;
int numParms;
@@ -2171,7 +2168,7 @@ void idCompiler::ParseFunctionDef( idTypeDef *returnType, const char *name ) {
if ( gameLocal.program.GetDef( type->GetParmType( i ), type->GetParmName( i ), def ) ) {
Error( "'%s' defined more than once in function parameters", type->GetParmName( i ) );
}
- parm = gameLocal.program.AllocDef( type->GetParmType( i ), type->GetParmName( i ), def, false );
+ gameLocal.program.AllocDef( type->GetParmType( i ), type->GetParmName( i ), def, false );
}
oldscope = scope;
8 neo/game/script/Script_Compiler.h
View
@@ -31,9 +31,9 @@ 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;
- int priority;
+ const char *name;
+ const char *opname;
+ int priority;
bool rightAssociative;
idVarDef *type_a;
idVarDef *type_b;
@@ -197,7 +197,7 @@ enum {
class idCompiler {
private:
static bool punctuationValid[ 256 ];
- static char *punctuation[];
+ static const char *punctuation[];
idParser parser;
idParser *parserPtr;
6 neo/game/script/Script_Program.cpp
View
@@ -918,7 +918,7 @@ idScriptObject::Restore
*/
void idScriptObject::Restore( idRestoreGame *savefile ) {
idStr typeName;
- int size;
+ size_t size;
savefile->ReadString( typeName );
@@ -1323,7 +1323,7 @@ idVarDef *idProgram::AllocDef( idTypeDef *type, const char *name, idVarDef *scop
//
def->value.bytePtr = &variables[ numVariables ];
numVariables += def->TypeDef()->Size();
- if ( (unsigned int)numVariables > sizeof( variables ) ) {
+ if ( numVariables > sizeof( variables ) ) {
throw idCompileError( va( "Exceeded global memory size (%zu bytes)", sizeof( variables ) ) );
}
@@ -1722,7 +1722,6 @@ called after all files are compiled to report memory usage.
void idProgram::CompileStats( void ) {
int memused;
int memallocated;
- int numdefs;
int stringspace;
int funcMem;
int i;
@@ -1737,7 +1736,6 @@ void idProgram::CompileStats( void ) {
}
stringspace += fileList.Size();
- numdefs = varDefs.Num();
memused = varDefs.Num() * sizeof( idVarDef );
memused += types.Num() * sizeof( idTypeDef );
memused += stringspace;
6 neo/game/script/Script_Program.h
View
@@ -4,7 +4,7 @@
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
-This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
+This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -96,7 +96,7 @@ class idTypeDef {
private:
etype_t type;
idStr name;
- int size;
+ size_t size;
// function types are more complex
idTypeDef *auxType; // return type
@@ -442,7 +442,7 @@ class idProgram {
idStr filename;
int filenum;
- int numVariables;
+ size_t numVariables;
byte variables[ MAX_GLOBALS ];
idStaticList<byte,MAX_GLOBALS> variableDefaults;
idStaticList<function_t,MAX_FUNCS> functions;
6 neo/sys/sys_local.cpp
View
@@ -108,15 +108,15 @@ void idSysLocal::ShutdownSymbols( void ) {
Sys_ShutdownSymbols();
}
-int idSysLocal::DLL_Load( const char *dllName ) {
+size_t idSysLocal::DLL_Load( const char *dllName ) {
return Sys_DLL_Load( dllName );
}
-void *idSysLocal::DLL_GetProcAddress( int dllHandle, const char *procName ) {
+void *idSysLocal::DLL_GetProcAddress( size_t dllHandle, const char *procName ) {
return Sys_DLL_GetProcAddress( dllHandle, procName );
}
-void idSysLocal::DLL_Unload( int dllHandle ) {
+void idSysLocal::DLL_Unload( size_t dllHandle ) {
Sys_DLL_Unload( dllHandle );
}
6 neo/sys/sys_local.h
View
@@ -61,9 +61,9 @@ class idSysLocal : public idSys {
virtual bool LockMemory( void *ptr, int bytes );
virtual bool UnlockMemory( void *ptr, int bytes );
- virtual int DLL_Load( const char *dllName );
- virtual void * DLL_GetProcAddress( int dllHandle, const char *procName );
- virtual void DLL_Unload( int dllHandle );
+ virtual size_t DLL_Load( const char *dllName );
+ virtual void * DLL_GetProcAddress( size_t dllHandle, const char *procName );
+ virtual void DLL_Unload( size_t dllHandle );
virtual void DLL_GetFileName( const char *baseName, char *dllName, int maxLength );
virtual sysEvent_t GenerateMouseButtonEvent( int button, bool down );
6 neo/sys/sys_public.h
View
@@ -563,9 +563,9 @@ class idSys {
virtual const char * GetCallStackCurStr( int depth ) = 0;
virtual void ShutdownSymbols( void ) = 0;
- virtual int DLL_Load( const char *dllName ) = 0;
- virtual void * DLL_GetProcAddress( int dllHandle, const char *procName ) = 0;
- virtual void DLL_Unload( int dllHandle ) = 0;
+ virtual size_t DLL_Load( const char *dllName ) = 0;
+ virtual void * DLL_GetProcAddress( size_t dllHandle, const char *procName ) = 0;
+ virtual void DLL_Unload( size_t dllHandle ) = 0;
virtual void DLL_GetFileName( const char *baseName, char *dllName, int maxLength ) = 0;
virtual sysEvent_t GenerateMouseButtonEvent( int button, bool down ) = 0;

No commit comments for this range

Something went wrong with that request. Please try again.