[Scummvm-git-logs] scummvm master -> 0f0965998d5bc8f8efaddc73cad49e93959eeb9a

Strangerke noreply at scummvm.org
Fri May 31 21:46:44 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0f0965998d BAGEL: Add some virtual and override keywords, change the signature of CBofFile::close()


Commit: 0f0965998d5bc8f8efaddc73cad49e93959eeb9a
    https://github.com/scummvm/scummvm/commit/0f0965998d5bc8f8efaddc73cad49e93959eeb9a
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-31T22:46:38+01:00

Commit Message:
BAGEL: Add some virtual and override keywords, change the signature of CBofFile::close()

Changed paths:
    engines/bagel/baglib/bagel.h
    engines/bagel/boflib/app.h
    engines/bagel/boflib/dat_file.h
    engines/bagel/boflib/file.cpp
    engines/bagel/boflib/file.h


diff --git a/engines/bagel/baglib/bagel.h b/engines/bagel/baglib/bagel.h
index 510acb0133f..019575e268b 100644
--- a/engines/bagel/baglib/bagel.h
+++ b/engines/bagel/baglib/bagel.h
@@ -150,7 +150,7 @@ public:
 	 */
 	ErrorCode getOption(const char *section, const char *option, bool *boolValue, int defaultValue);
 
-	void setAppName(const char *newAppName) {
+	void setAppName(const char *newAppName) override {
 		Common::strcpy_s(_szAppName, newAppName);
 	}
 
diff --git a/engines/bagel/boflib/app.h b/engines/bagel/boflib/app.h
index 23c7e8477fc..62382a14ab3 100644
--- a/engines/bagel/boflib/app.h
+++ b/engines/bagel/boflib/app.h
@@ -77,7 +77,7 @@ public:
 	virtual ErrorCode runApp();
 	virtual ErrorCode shutdown();
 
-	void setAppName(const char *pszNewAppName) {
+	virtual void setAppName(const char *pszNewAppName) {
 		Common::strcpy_s(_szAppName, pszNewAppName);
 	}
 
diff --git a/engines/bagel/boflib/dat_file.h b/engines/bagel/boflib/dat_file.h
index d508b536549..4b6ea207930 100644
--- a/engines/bagel/boflib/dat_file.h
+++ b/engines/bagel/boflib/dat_file.h
@@ -141,7 +141,7 @@ public:
 	 * Closes current data-file, if it's not already closed
 	 * @return          Error return code
 	 */
-	ErrorCode close();
+	ErrorCode close() override;
 
 	/**
 	 * Destroys current data-file, if any, and starts a new empty one
@@ -220,7 +220,7 @@ public:
 	 * @param lBytes        Number of bytes
 	 * @return              Error code
 	 */
-	ErrorCode read(void *pDestBuf, int32 lBytes);
+	ErrorCode read(void *pDestBuf, int32 lBytes) override;
 	ErrorCode read(HeaderRec &rec);
 	ErrorCode read(HeadInfo &rec);
 
@@ -230,7 +230,7 @@ public:
 	 * @param lBytes        Number of bytes
 	 * @return              Error code
 	 */
-	ErrorCode write(const void *pSrcBuf, int32 lBytes);
+	ErrorCode write(const void *pSrcBuf, int32 lBytes) override;
 	ErrorCode write(HeaderRec &rec);
 	ErrorCode write(HeadInfo &rec);
 };
diff --git a/engines/bagel/boflib/file.cpp b/engines/bagel/boflib/file.cpp
index ce48ea7dfdb..38407b8af4b 100644
--- a/engines/bagel/boflib/file.cpp
+++ b/engines/bagel/boflib/file.cpp
@@ -134,7 +134,7 @@ ErrorCode CBofFile::open(const char *pszFileName, uint32 lFlags) {
 	return _errCode;
 }
 
-void CBofFile::close() {
+ErrorCode CBofFile::close() {
 	assert(isValidObject(this));
 
 	if (_stream != nullptr) {
@@ -145,6 +145,8 @@ void CBofFile::close() {
 		delete _stream;
 		_stream = nullptr;
 	}
+
+	return ERR_NONE;
 }
 
 ErrorCode CBofFile::read(void *pDestBuf, int32 lBytes) {
diff --git a/engines/bagel/boflib/file.h b/engines/bagel/boflib/file.h
index d63c5ad95d8..e27f8099796 100644
--- a/engines/bagel/boflib/file.h
+++ b/engines/bagel/boflib/file.h
@@ -136,7 +136,7 @@ public:
 	/**
 	 * Close a currently open file
 	 */
-	void close();
+	virtual ErrorCode close();
 
 	/**
 	 * Read from a currently open file
@@ -144,7 +144,7 @@ public:
 	 * @param lBytes        Number of bytes
 	 * @return              Error code
 	 */
-	ErrorCode read(void *pDestBuf, int32 lBytes);
+	virtual ErrorCode read(void *pDestBuf, int32 lBytes);
 
 	/**
 	 * Write to a currently open file
@@ -152,15 +152,13 @@ public:
 	 * @param lBytes        Number of bytes
 	 * @return              Error code
 	 */
-	ErrorCode write(const void *pSrcBuf, int32 lBytes);
+	virtual ErrorCode write(const void *pSrcBuf, int32 lBytes);
 
 	/**
 	 * Flushes I/O stream
 	 */
 	void commit();
 
-	//static void commitAll() { _flushall(); }
-
 	/**
 	 * Seek to a specified location in the file
 	 * @return      Error code




More information about the Scummvm-git-logs mailing list