diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/event.cpp | 4 | ||||
-rw-r--r-- | src/common/global.h | 4 | ||||
-rw-r--r-- | src/common/metafile.cpp | 4 | ||||
-rw-r--r-- | src/common/misc.cpp | 4 | ||||
-rw-r--r-- | src/common/misc.h | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/common/event.cpp b/src/common/event.cpp index d082ba9..87c8a5c 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -24,8 +24,8 @@ static EventType g_uniqueEventType = EVENT_USER; EventType GetUniqueEventType() { - int i = (int)g_uniqueEventType+1; - g_uniqueEventType = (EventType)i; + int i = static_cast<int>(g_uniqueEventType+1); + g_uniqueEventType = static_cast<EventType>(i); return g_uniqueEventType; } diff --git a/src/common/global.h b/src/common/global.h index 88f753e..9cb3dd9 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -118,7 +118,7 @@ enum KeyRank // TODO: move to CRobotMain extern long g_id; // unique identifier -extern long g_build; // constructible buildings -extern long g_researchDone; // research done +extern int g_build; // constructible buildings +extern int g_researchDone; // research done extern long g_researchEnable; // research available extern float g_unit; // conversion factor diff --git a/src/common/metafile.cpp b/src/common/metafile.cpp index d1692ce..4e7e916 100644 --- a/src/common/metafile.cpp +++ b/src/common/metafile.cpp @@ -34,7 +34,7 @@ static unsigned char table_codec[23] = void Codec(void* buffer, int len, int start) { - unsigned char *b = (unsigned char*)buffer; + unsigned char *b = static_cast<unsigned char*>(buffer); int i; for ( i=0 ; i<len ; i++ ) @@ -350,7 +350,7 @@ int CMetaFile::MetaOpen(char *metaname) strcpy(m_list[i].name, metaname); // memorized the name fread(&m_list[i].total, sizeof(int), 1, m_list[i].stream); - m_list[i].headers = (MetaHeader*)malloc(sizeof(MetaHeader)*m_list[i].total); + m_list[i].headers = static_cast<MetaHeader*>(malloc(sizeof(MetaHeader)*m_list[i].total)); offset = 4; for ( j=0 ; j<m_list[i].total ; j++ ) diff --git a/src/common/misc.cpp b/src/common/misc.cpp index 11f60ae..5344e0b 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -258,7 +258,7 @@ bool Xfer(char* src, char* dst) return false; } - buffer = (char*)malloc(10000); + buffer = static_cast<char*>(malloc(10000)); while ( true ) { @@ -338,7 +338,7 @@ bool CopyFileListToTemp(char* filename, int* list, int total) // Adds an extension to file, if doesn't already one. -void AddExt(char* filename, char* ext) +void AddExt(char* filename, const char* ext) { if ( strchr(filename, '.') != 0 ) return; // already an extension? strcat(filename, ext); diff --git a/src/common/misc.h b/src/common/misc.h index 002c910..dd559e4 100644 --- a/src/common/misc.h +++ b/src/common/misc.h @@ -46,6 +46,6 @@ extern void TimeToAscii(time_t time, char *buffer); extern bool CopyFileToTemp(char* filename); extern bool CopyFileListToTemp(char* filename, int* list, int total); -extern void AddExt(char* filename, char* ext); +extern void AddExt(char* filename, const char* ext); extern void UserDir(bool bUser, char* dir); extern void UserDir(char* buffer, const char* dir, const char* def); |