diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-06-10 15:28:12 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-06-10 15:28:12 +0200 |
commit | 697fbdabf10d956e0f13bfbc9414d3db40f0c535 (patch) | |
tree | ab80ba3119d07b11da5478009b905edb702c103f /src/common/misc.cpp | |
parent | 680af178196217bdd255d2bc851f240983144ac1 (diff) | |
download | colobot-697fbdabf10d956e0f13bfbc9414d3db40f0c535.tar.gz colobot-697fbdabf10d956e0f13bfbc9414d3db40f0c535.tar.bz2 colobot-697fbdabf10d956e0f13bfbc9414d3db40f0c535.zip |
BOOL -> bool; additional fixes in constructors/destructors
Diffstat (limited to 'src/common/misc.cpp')
-rw-r--r-- | src/common/misc.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/common/misc.cpp b/src/common/misc.cpp index e73238f..f58527f 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -40,7 +40,7 @@ CMetaFile g_metafile;
static EventMsg g_uniqueEventMsg = EVENT_USER;
-static BOOL g_bUserDir = FALSE;
+static bool g_bUserDir = false;
static char g_userDir[100] = "";
@@ -264,7 +264,7 @@ void TimeToAscii(time_t time, char *buffer) // Makes a copy of a file.
-BOOL Xfer(char* src, char* dst)
+bool Xfer(char* src, char* dst)
{
FILE *fs, *fd;
char *buffer;
@@ -273,19 +273,19 @@ BOOL Xfer(char* src, char* dst) fs = fopen(src, "rb");
if ( fs == 0 )
{
- return FALSE;
+ return false;
}
fd = fopen(dst, "wb");
if ( fd == 0 )
{
fclose(fs);
- return FALSE;
+ return false;
}
buffer = (char*)malloc(10000);
- while ( TRUE )
+ while ( true )
{
len = fread(buffer, 1, 10000, fs);
if ( len == 0 ) break;
@@ -295,12 +295,12 @@ BOOL Xfer(char* src, char* dst) free(buffer);
fclose(fs);
fclose(fd);
- return TRUE;
+ return true;
}
// Copy a file into the temporary folder.
-BOOL CopyFileToTemp(char* filename)
+bool CopyFileToTemp(char* filename)
{
char src[100];
char dst[100];
@@ -314,15 +314,15 @@ BOOL CopyFileToTemp(char* filename) strcpy(g_userDir, save);
_mkdir("temp");
- if ( !Xfer(src, dst) ) return FALSE;
+ if ( !Xfer(src, dst) ) return false;
strcpy(filename, dst);
- return TRUE;
+ return true;
}
// Copy a list of numbered files into the temporary folder.
-BOOL CopyFileListToTemp(char* filename, int* list, int total)
+bool CopyFileListToTemp(char* filename, int* list, int total)
{
char name[100];
char ext[10];
@@ -355,7 +355,7 @@ BOOL CopyFileListToTemp(char* filename, int* list, int total) strcpy(filename, file);
strcpy(g_userDir, save);
- return TRUE;
+ return true;
}
@@ -370,7 +370,7 @@ void AddExt(char* filename, char* ext) // Specifies the user folder.
-void UserDir(BOOL bUser, char* dir)
+void UserDir(bool bUser, char* dir)
{
g_bUserDir = bUser;
strcpy(g_userDir, dir);
|