* BugFix: Clear a lot of warnings and correct a few actual programming errors along the way.

This commit is contained in:
Robert MacGregor 2021-10-04 20:04:21 -04:00
parent ef514d0e6b
commit 1b6b803a20
61 changed files with 120 additions and 118 deletions

View file

@ -594,20 +594,20 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite)
return currentStatus;
U32 finalPos = 0;
switch (absolutePos)
if (absolutePos)
{
case true: // absolute position
AssertFatal(0 <= position, "File::setPosition: negative absolute position");
// position beyond EOS is OK
finalPos = lseek(*((int *)handle), position, SEEK_SET);
break;
case false: // relative position
}
else
{
AssertFatal((getPosition() >= (U32)abs(position) && 0 > position) || 0 <= position, "File::setPosition: negative relative position");
// position beyond EOS is OK
finalPos = lseek(*((int *)handle), position, SEEK_CUR);
break;
}
if (0xffffffff == finalPos)
@ -1110,7 +1110,7 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite)
if (dip == NULL)
return false;
while (d = readdir(dip))
while ((d = readdir(dip)))
{
bool isDir = false;
if (d->d_type == DT_UNKNOWN)
@ -1229,14 +1229,14 @@ bool dPathCopy(const char *fromName, const char *toName, bool nooverwrite)
// Iterate through and grab valid directories
//////////////////////////////////////////////////////////////////////////
while (d = readdir(dip))
while ((d = readdir(dip)))
{
bool isDir;
isDir = false;
if (d->d_type == DT_UNKNOWN)
{
char child [1024];
if ((Path[dStrlen(Path) - 1] == '/'))
if (Path[dStrlen(Path) - 1] == '/')
dSprintf(child, 1024, "%s%s", Path, d->d_name);
else
dSprintf(child, 1024, "%s/%s", Path, d->d_name);