[sword-svn] r3797 - in trunk: include src/frontend src/mgr

scribe at crosswire.org scribe at crosswire.org
Thu Sep 17 12:51:40 EDT 2020


Author: scribe
Date: 2020-09-17 12:51:39 -0400 (Thu, 17 Sep 2020)
New Revision: 3797

Modified:
   trunk/include/filemgr.h
   trunk/include/swlog.h
   trunk/src/frontend/swlog.cpp
   trunk/src/mgr/filemgr.cpp
Log:
updated types to be match usage


Modified: trunk/include/filemgr.h
===================================================================
--- trunk/include/filemgr.h	2020-09-17 12:31:17 UTC (rev 3796)
+++ trunk/include/filemgr.h	2020-09-17 16:51:39 UTC (rev 3797)
@@ -69,14 +69,14 @@
 protected:
 	static FileMgr *systemFileMgr;
 public:
-	static int CREAT;
-	static int APPEND;
-	static int TRUNC;
-	static int RDONLY;
-	static int RDWR;
-	static int WRONLY;
-	static int IREAD;
-	static int IWRITE;
+	static unsigned int CREAT;
+	static unsigned int APPEND;
+	static unsigned int TRUNC;
+	static unsigned int RDONLY;
+	static unsigned int RDWR;
+	static unsigned int WRONLY;
+	static unsigned int IREAD;
+	static unsigned int IWRITE;
 
 	/** Maximum number of open files set in the constructor.
 	* determines the max number of real system files that
@@ -105,6 +105,7 @@
 	* @return FileDesc object for the requested file.
 	*/
 	FileDesc *open(const char *path, int mode, bool tryDowngrade);
+	FileDesc *open(const char *path, unsigned int mode, bool tryDowngrade) { return this->open(path, (int)mode, tryDowngrade); }
 
 	/** Open a file and return a FileDesc for it.
 	* The file itself will only be opened when FileDesc::getFd() is called.
@@ -114,6 +115,7 @@
 	* @param tryDowngrade
 	* @return FileDesc object for the requested file.
 	*/
+	FileDesc *open(const char *path, unsigned int mode, unsigned int perms = IREAD | IWRITE, bool tryDowngrade = false) { return this->open(path, (int)mode, (int)perms, tryDowngrade); }
 	FileDesc *open(const char *path, int mode, int perms = IREAD | IWRITE, bool tryDowngrade = false);
 
 	/** Close a given file and delete its FileDesc object.

Modified: trunk/include/swlog.h
===================================================================
--- trunk/include/swlog.h	2020-09-17 12:31:17 UTC (rev 3796)
+++ trunk/include/swlog.h	2020-09-17 16:51:39 UTC (rev 3797)
@@ -38,11 +38,11 @@
 
 public:
 
-	static const int LOG_ERROR;
-	static const int LOG_WARN;
-	static const int LOG_INFO;
-	static const int LOG_TIMEDINFO;
-	static const int LOG_DEBUG;
+	static const char LOG_ERROR;
+	static const char LOG_WARN;
+	static const char LOG_INFO;
+	static const char LOG_TIMEDINFO;
+	static const char LOG_DEBUG;
 
 	static SWLog *getSystemLog();
 	static void setSystemLog(SWLog *newLogger);

Modified: trunk/src/frontend/swlog.cpp
===================================================================
--- trunk/src/frontend/swlog.cpp	2020-09-17 12:31:17 UTC (rev 3796)
+++ trunk/src/frontend/swlog.cpp	2020-09-17 16:51:39 UTC (rev 3797)
@@ -37,11 +37,11 @@
 
 SWLog *SWLog::systemLog = 0;
 
-const int SWLog::LOG_ERROR     = 1;
-const int SWLog::LOG_WARN      = 2;
-const int SWLog::LOG_INFO      = 3;
-const int SWLog::LOG_TIMEDINFO = 4;
-const int SWLog::LOG_DEBUG     = 5;
+const char SWLog::LOG_ERROR     = 1;
+const char SWLog::LOG_WARN      = 2;
+const char SWLog::LOG_INFO      = 3;
+const char SWLog::LOG_TIMEDINFO = 4;
+const char SWLog::LOG_DEBUG     = 5;
 
 SWLog *SWLog::getSystemLog() {
 	static class __staticSystemLog {

Modified: trunk/src/mgr/filemgr.cpp
===================================================================
--- trunk/src/mgr/filemgr.cpp	2020-09-17 12:31:17 UTC (rev 3796)
+++ trunk/src/mgr/filemgr.cpp	2020-09-17 16:51:39 UTC (rev 3797)
@@ -78,14 +78,14 @@
 SWORD_NAMESPACE_START
 
 
-int FileMgr::CREAT = O_CREAT;
-int FileMgr::APPEND = O_APPEND;
-int FileMgr::TRUNC = O_TRUNC;
-int FileMgr::RDONLY = O_RDONLY;
-int FileMgr::RDWR = O_RDWR;
-int FileMgr::WRONLY = O_WRONLY;
-int FileMgr::IREAD = S_IREAD;
-int FileMgr::IWRITE = S_IWRITE;
+unsigned int FileMgr::CREAT = O_CREAT;
+unsigned int FileMgr::APPEND = O_APPEND;
+unsigned int FileMgr::TRUNC = O_TRUNC;
+unsigned int FileMgr::RDONLY = O_RDONLY;
+unsigned int FileMgr::RDWR = O_RDWR;
+unsigned int FileMgr::WRONLY = O_WRONLY;
+unsigned int FileMgr::IREAD = S_IREAD;
+unsigned int FileMgr::IWRITE = S_IWRITE;
 
 
 // ---------------- statics -----------------



More information about the sword-cvs mailing list