[Scummvm-git-logs] scummvm master -> 3d60bee8a4dbdace7e51f893cf9a1af551c1989c
bluegr
bluegr at gmail.com
Tue Oct 8 10:32:37 CEST 2019
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bfc296bc4b AMIGAOS4: Fix NULL access
7525be638e JANITORIAL: Wording
6dd67641f1 JANITORIAL: English and spacing
3d60bee8a4 JANITORIAL: Add more info to track it down later
Commit: bfc296bc4b8e6f01e471984458fa66ad5acc2a1e
https://github.com/scummvm/scummvm/commit/bfc296bc4b8e6f01e471984458fa66ad5acc2a1e
Author: Hubert Maier (raziel- at users.noreply.github.com)
Date: 2019-10-08T11:32:30+03:00
Commit Message:
AMIGAOS4: Fix NULL access
Changed paths:
backends/fs/amigaos4/amigaos4-fs.cpp
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index 3561303..624f8aa 100644
--- a/backends/fs/amigaos4/amigaos4-fs.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs.cpp
@@ -62,13 +62,21 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode() {
_bIsDirectory = true;
_sPath = "";
_pFileLock = 0;
- _nProt = 0; // Protection is ignored for the root volume
+ _nProt = 0; // Protection is ignored for the root volume.
LEAVE();
}
AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
ENTER();
+ // We need to explicitely open dos.library and it's IDOS interface.
+ // Otherwise we'll hit an IDOS NULL pointer after compiling a shared
+ // binary with (shared) plugins.
+ // The hit will happen on loading a game from any engine, if more
+ // than one engine/plugin is available.
+ DOSBase=IExec->OpenLibrary("dos.library",0);
+ IDOS = (struct DOSIFace *)IExec->GetInterface(DOSBase, "main", 1, NULL);
+
int offset = p.size();
//assert(offset > 0);
@@ -84,7 +92,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
_bIsDirectory = false;
_bIsValid = false;
- // Check whether the node exists and if it's a directory
+ // Check whether the node exists and if it's a directory.
struct ExamineData * pExd = IDOS->ExamineObjectTags(EX_StringNameInput,_sPath.c_str(),TAG_END);
if (pExd) {
_nProt = pExd->Protection;
@@ -93,7 +101,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
_pFileLock = IDOS->Lock((CONST_STRPTR)_sPath.c_str(), SHARED_LOCK);
_bIsValid = (_pFileLock != 0);
- // Add a trailing slash if needed
+ // Add a trailing slash if needed.
const char c = _sPath.lastChar();
if (c != '/' && c != ':')
_sPath += '/';
@@ -105,6 +113,10 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
IDOS->FreeDosObject(DOS_EXAMINEDATA, pExd);
}
+ // Close dos.library and it's IDOS interface again.
+ IExec->DropInterface((struct Interface *)IDOS);
+ IExec->CloseLibrary(DOSBase);
+
LEAVE();
}
@@ -161,7 +173,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(BPTR pLock, const char *pDisplayNam
LEAVE();
}
-// We need the custom copy constructor because of DupLock()
+// We need the custom copy constructor because of DupLock().
AmigaOSFilesystemNode::AmigaOSFilesystemNode(const AmigaOSFilesystemNode& node)
: AbstractFSNode() {
ENTER();
@@ -237,9 +249,6 @@ bool AmigaOSFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
ENTER();
bool ret = false;
- // TODO: Honor the hidden flag
- // There is no such thing as a hidden flag in AmigaOS...
-
if (!_bIsValid) {
debug(6, "Invalid node");
LEAVE();
@@ -343,9 +352,9 @@ bool AmigaOSFilesystemNode::isReadable() const {
if (!_bIsValid)
return false;
- // Regular RWED protection flags are low-active or inverted, thus the negation.
- // Moreover, a pseudo root filesystem is readable whatever the
- // protection says.
+ // Regular RWED protection flags are low-active or inverted,
+ // thus the negation. Moreover, a pseudo root filesystem is
+ // readable whatever the protection says.
bool readable = !(_nProt & EXDF_OTR_READ) || isRootNode();
return readable;
@@ -355,9 +364,10 @@ bool AmigaOSFilesystemNode::isWritable() const {
if (!_bIsValid)
return false;
- // Regular RWED protection flags are low-active or inverted, thus the negation.
- // Moreover, a pseudo root filesystem is never writable whatever
- // the protection says (Because of it's pseudo nature).
+ // Regular RWED protection flags are low-active or inverted,
+ // thus the negation. Moreover, a pseudo root filesystem is
+ // never writable whatever the protection says.
+ // (Because of it's pseudo nature).
bool writable = !(_nProt & EXDF_OTR_WRITE) && !isRootNode();
return writable;
@@ -385,18 +395,21 @@ AbstractFSList AmigaOSFilesystemNode::listVolumes() const {
dosList->dol_Port) {
// The original line was
- //if (dosList->dol_Type == DLT_VOLUME &&
- //dosList->dol_Name &&
- //dosList->dol_Task) {
- // which errored using SDK 53.24 with a 'struct dosList' has no member called 'dol_Task'
- // The reason for that was that
- // 1) dol_Task wasn't a task pointer, it is a message port instead
- // 2) It was redefined to be dol_Port in dos/obsolete.h in afore mentioned SDK
-
- // Copy name to buffer
+ //
+ // if (dosList->dol_Type == DLT_VOLUME &&
+ // dosList->dol_Name &&
+ // dosList->dol_Task) {
+ //
+ // which errored using SDK 53.24 with a
+ // 'struct dosList' has no member called 'dol_Task'
+ // The reason for that was, that
+ // 1) dol_Task wasn't a task pointer, it is a message port instead.
+ // 2) it was redefined to be dol_Port in dos/obsolete.h in aforementioned SDK.
+
+ // Copy name to buffer.
IDOS->CopyStringBSTRToC(dosList->dol_Name, buffer, MAXPATHLEN);
- // Volume name + '\0'
+ // Volume name + '\0'.
char *volName = new char [strlen(buffer) + 1];
strcpy(volName, buffer);
@@ -408,7 +421,7 @@ AbstractFSList AmigaOSFilesystemNode::listVolumes() const {
char *devName = new char [MAXPATHLEN];
- // Find device name
+ // Find device name.
IDOS->DevNameFromLock(volumeLock, devName, MAXPATHLEN, DN_DEVICEONLY);
sprintf(buffer, "%s (%s)", volName, devName);
Commit: 7525be638eca2381328db6dd6b5b8d106535dc59
https://github.com/scummvm/scummvm/commit/7525be638eca2381328db6dd6b5b8d106535dc59
Author: Hubert Maier (raziel- at users.noreply.github.com)
Date: 2019-10-08T11:32:30+03:00
Commit Message:
JANITORIAL: Wording
Changed paths:
backends/fs/amigaos4/amigaos4-fs.cpp
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index 624f8aa..8cb3c8d 100644
--- a/backends/fs/amigaos4/amigaos4-fs.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs.cpp
@@ -70,7 +70,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
ENTER();
// We need to explicitely open dos.library and it's IDOS interface.
- // Otherwise we'll hit an IDOS NULL pointer after compiling a shared
+ // Otherwise we will hit an IDOS NULL pointer after compiling a shared
// binary with (shared) plugins.
// The hit will happen on loading a game from any engine, if more
// than one engine/plugin is available.
Commit: 6dd67641f1d22a311bb77a7a896f959bde2ecf9d
https://github.com/scummvm/scummvm/commit/6dd67641f1d22a311bb77a7a896f959bde2ecf9d
Author: Hubert Maier (raziel- at users.noreply.github.com)
Date: 2019-10-08T11:32:30+03:00
Commit Message:
JANITORIAL: English and spacing
Changed paths:
backends/fs/amigaos4/amigaos4-fs.cpp
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index 8cb3c8d..1e75840 100644
--- a/backends/fs/amigaos4/amigaos4-fs.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs.cpp
@@ -69,12 +69,12 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode() {
AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
ENTER();
- // We need to explicitely open dos.library and it's IDOS interface.
- // Otherwise we will hit an IDOS NULL pointer after compiling a shared
- // binary with (shared) plugins.
+ // We need to explicitly open dos.library and its IDOS interface.
+ // Otherwise we will hit an IDOS NULL pointer after compiling a
+ // shared binary with (shared) plugins.
// The hit will happen on loading a game from any engine, if more
- // than one engine/plugin is available.
- DOSBase=IExec->OpenLibrary("dos.library",0);
+ // than one engine/(shared) plugin is available.
+ DOSBase = IExec->OpenLibrary("dos.library", 0);
IDOS = (struct DOSIFace *)IExec->GetInterface(DOSBase, "main", 1, NULL);
int offset = p.size();
@@ -113,7 +113,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
IDOS->FreeDosObject(DOS_EXAMINEDATA, pExd);
}
- // Close dos.library and it's IDOS interface again.
+ // Close dos.library and its IDOS interface again.
IExec->DropInterface((struct Interface *)IDOS);
IExec->CloseLibrary(DOSBase);
Commit: 3d60bee8a4dbdace7e51f893cf9a1af551c1989c
https://github.com/scummvm/scummvm/commit/3d60bee8a4dbdace7e51f893cf9a1af551c1989c
Author: Hubert Maier (raziel- at users.noreply.github.com)
Date: 2019-10-08T11:32:30+03:00
Commit Message:
JANITORIAL: Add more info to track it down later
Changed paths:
backends/fs/amigaos4/amigaos4-fs.cpp
diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp
index 1e75840..c6261cf 100644
--- a/backends/fs/amigaos4/amigaos4-fs.cpp
+++ b/backends/fs/amigaos4/amigaos4-fs.cpp
@@ -69,6 +69,10 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode() {
AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
ENTER();
+ // WORKAROUND:
+ // This is a bug in AmigaOS4 newlib.library 53.30 and lower.
+ // It will be removed once a fixed version is available to public.
+ // DESCRIPTION:
// We need to explicitly open dos.library and its IDOS interface.
// Otherwise we will hit an IDOS NULL pointer after compiling a
// shared binary with (shared) plugins.
@@ -113,6 +117,7 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) {
IDOS->FreeDosObject(DOS_EXAMINEDATA, pExd);
}
+ // WORKAROUND:
// Close dos.library and its IDOS interface again.
IExec->DropInterface((struct Interface *)IDOS);
IExec->CloseLibrary(DOSBase);
More information about the Scummvm-git-logs
mailing list