C++ conversion: fixed compilation errors for quake3 project.

This commit is contained in:
Artem Kharytoniuk
2014-05-11 00:22:27 +03:00
parent e2e32bca15
commit ff834b8b59
39 changed files with 419 additions and 405 deletions

View File

@@ -907,7 +907,7 @@ void *Z_TagMallocDebug( int size, int tag, char *label, char *file, int line ) {
void *Z_TagMalloc( int size, int tag ) {
#endif
int extra, allocSize;
memblock_t *start, *rover, *new, *base;
memblock_t *start, *rover, *newBlock, *base;
memzone_t *zone;
if (!tag) {
@@ -956,14 +956,14 @@ void *Z_TagMalloc( int size, int tag ) {
extra = base->size - size;
if (extra > MINFRAGMENT) {
// there will be a free fragment after the allocated block
new = (memblock_t *) ((byte *)base + size );
new->size = extra;
new->tag = 0; // free block
new->prev = base;
new->id = ZONEID;
new->next = base->next;
new->next->prev = new;
base->next = new;
newBlock = (memblock_t *)((byte *)base + size);
newBlock->size = extra;
newBlock->tag = 0; // free block
newBlock->prev = base;
newBlock->id = ZONEID;
newBlock->next = base->next;
newBlock->next->prev = newBlock;
base->next = newBlock;
base->size = size;
}
@@ -1148,7 +1148,7 @@ char *CopyString( const char *in ) {
return ((char *)&numberstring[in[0]-'0']) + sizeof(memblock_t);
}
}
out = S_Malloc ((int)strlen(in)+1);
out = (char*) S_Malloc ((int)strlen(in)+1);
strcpy (out, in);
return out;
}
@@ -1373,7 +1373,7 @@ Com_InitZoneMemory
void Com_InitSmallZoneMemory( void ) {
s_smallZoneTotal = 512 * 1024;
// bk001205 - was malloc
smallzone = calloc( s_smallZoneTotal, 1 );
smallzone = (memzone_t*) calloc( s_smallZoneTotal, 1 );
if ( !smallzone ) {
Com_Error( ERR_FATAL, "Small zone data failed to allocate %1.1f megs", (float)s_smallZoneTotal / (1024*1024) );
}
@@ -1394,7 +1394,7 @@ void Com_InitZoneMemory( void ) {
}
// bk001205 - was malloc
mainzone = calloc( s_zoneTotal, 1 );
mainzone = (memzone_t*) calloc( s_zoneTotal, 1 );
if ( !mainzone ) {
Com_Error( ERR_FATAL, "Zone data failed to allocate %i megs", s_zoneTotal / (1024*1024) );
}
@@ -1520,7 +1520,7 @@ void Com_InitHunkMemory( void ) {
// bk001205 - was malloc
s_hunkData = calloc( s_hunkTotal + 31, 1 );
s_hunkData = (byte*) calloc( s_hunkTotal + 31, 1 );
if ( !s_hunkData ) {
Com_Error( ERR_FATAL, "Hunk data failed to allocate %i megs", s_hunkTotal / (1024*1024) );
}
@@ -1856,9 +1856,9 @@ void Hunk_Trash( void ) {
Hunk_SwapBanks();
if ( hunk_permanent == &hunk_low ) {
buf = (void *)(s_hunkData + hunk_permanent->permanent);
buf = (char*) (void *)(s_hunkData + hunk_permanent->permanent);
} else {
buf = (void *)(s_hunkData + s_hunkTotal - hunk_permanent->permanent );
buf = (char*) (void *)(s_hunkData + s_hunkTotal - hunk_permanent->permanent );
}
length = hunk_permanent->permanent;
@@ -2097,7 +2097,7 @@ int Com_EventLoop( void ) {
case SE_NONE:
break;
case SE_KEY:
CL_KeyEvent( ev.evValue, ev.evValue2, ev.evTime );
CL_KeyEvent( ev.evValue, (qboolean) ev.evValue2, ev.evTime );
break;
case SE_CHAR:
CL_CharEvent( ev.evValue );
@@ -3244,7 +3244,7 @@ static void keyConcatArgs( void ) {
static void ConcatRemaining( const char *src, const char *start ) {
char *str;
str = strstr(src, start);
str = (char*) strstr(src, start);
if (!str) {
keyConcatArgs();
return;