Reverting changes accidentally checked in

This commit is contained in:
cls%seawood.org 1999-09-15 05:28:31 +00:00
Родитель 5655835875
Коммит 0a10e0a466
3 изменённых файлов: 18 добавлений и 18 удалений

Просмотреть файл

@ -464,7 +464,7 @@ nsFileURL::nsFileURL(const char* inString, PRBool inCreateDirs)
// an unescaped string.
nsSimpleCharString unescapedPath(inString + kFileURLPrefixLength);
unescapedPath.Unescape();
nsFilePath path((char *)unescapedPath, inCreateDirs);
nsFilePath path(unescapedPath, inCreateDirs);
*this = path;
} // nsFileURL::nsFileURL
#endif
@ -484,7 +484,7 @@ nsFileURL::nsFileURL(const nsString& inString, PRBool inCreateDirs)
// an unescaped string.
nsSimpleCharString unescapedPath(aCString + kFileURLPrefixLength);
unescapedPath.Unescape();
nsFilePath path((char *)unescapedPath, inCreateDirs);
nsFilePath path(unescapedPath, inCreateDirs);
*this = path;
} // nsFileURL::nsFileURL
#endif
@ -645,7 +645,7 @@ nsFilePath::nsFilePath(const nsString& inString, PRBool inCreateDirs)
if (mPath.IsEmpty())
return;
NS_ASSERTION(strstr((char*)mPath, kFileURLPrefix) != (char*)mPath, "URL passed as path");
NS_ASSERTION(strstr((const char*)mPath, kFileURLPrefix) != (const char*)mPath, "URL passed as path");
#ifdef XP_PC
nsFileSpecHelpers::UnixToNative(mPath);
#endif
@ -812,11 +812,11 @@ void nsFileSpec::MakeUnique()
= nsFileSpecHelpers::kMaxCoreLeafNameLength - nsCRT::strlen(suffix) - 1;
if ((int)nsCRT::strlen(leafName) > (int)kMaxRootLength)
leafName[kMaxRootLength] = '\0';
for (short indx = 1; indx < 1000 && Exists(); indx++)
for (short index = 1; index < 1000 && Exists(); index++)
{
// start with "Picture-1.jpg" after "Picture.jpg" exists
char newName[nsFileSpecHelpers::kMaxFilenameLength + 1];
sprintf(newName, "%s-%d%s", leafName, indx, suffix);
sprintf(newName, "%s-%d%s", leafName, index, suffix);
SetLeafName(newName);
}
if (*suffix)
@ -993,7 +993,7 @@ PRBool nsFileSpec::operator == (const nsFileSpec& inOther) const
if(inStr[inLast] == DIR_SEPARATOR)
inStr[inLast] = '\0';
if (DIR_STRCMP((char *)str, (char *)inStr ) == 0)
if (DIR_STRCMP(str, inStr ) == 0)
return PR_TRUE;
#undef DIR_SEPARATOR
#undef DIR_STRCMP

Просмотреть файл

@ -78,7 +78,7 @@ nsOutputStream& operator << (nsOutputStream& s, const nsPersistentFileDescriptor
sprintf(littleBuf, "%.8x", dataSize);
s << littleBuf;
// Now write the data itself
s << (char*)data;
s << (const char*)data;
return s;
}

Просмотреть файл

@ -85,7 +85,7 @@ void nsFileSpecHelpers::Canonify(nsSimpleCharString& ioPath, PRBool inMakeDirs)
if (inMakeDirs)
{
const mode_t mode = 0700;
nsFileSpecHelpers::MakeAllDirectories((char*)ioPath, mode);
nsFileSpecHelpers::MakeAllDirectories((const char*)ioPath, mode);
}
errno = 0; // needed?
@ -98,7 +98,7 @@ void nsFileSpecHelpers::Canonify(nsSimpleCharString& ioPath, PRBool inMakeDirs)
(void) getcwd(buffer, MAXPATHLEN);
strcat(buffer, "/");
strcat(buffer, (char *)ioPath);
strcat(buffer, ioPath);
ioPath = buffer;
}
@ -201,7 +201,7 @@ nsresult nsFileSpec::ResolveSymlink(PRBool& wasAliased)
wasAliased = PR_FALSE;
char resolvedPath[MAXPATHLEN];
int charCount = readlink((char *)mPath, (char*)&resolvedPath, MAXPATHLEN);
int charCount = readlink(mPath, (char*)&resolvedPath, MAXPATHLEN);
if (0 < charCount)
{
if (MAXPATHLEN > charCount)
@ -218,7 +218,7 @@ nsresult nsFileSpec::ResolveSymlink(PRBool& wasAliased)
mPath = (char*)&resolvedPath;
}
char* canonicalPath = realpath((char *)mPath, resolvedPath);
char* canonicalPath = realpath((const char *)mPath, resolvedPath);
NS_ASSERTION(canonicalPath, "realpath failed");
if (canonicalPath) {
mPath = (char*)&resolvedPath;
@ -251,7 +251,7 @@ void nsFileSpec::operator += (const char* inRelativePath)
if (!inRelativePath || mPath.IsEmpty())
return;
char endChar = mPath[(int)(strlen((char *)mPath) - 1)];
char endChar = mPath[(int)(strlen(mPath) - 1)];
if (endChar == '/')
mPath += "x";
else
@ -266,7 +266,7 @@ void nsFileSpec::CreateDirectory(int mode)
// Note that mPath is canonical!
if (mPath.IsEmpty())
return;
mkdir((char *)mPath, mode);
mkdir(mPath, mode);
} // nsFileSpec::CreateDirectory
//----------------------------------------------------------------------------------------
@ -343,11 +343,11 @@ nsresult nsFileSpec::Rename(const char* inNewName)
if (mPath.IsEmpty() || strchr(inNewName, '/'))
return NS_FILE_FAILURE;
char* oldPath = nsCRT::strdup((char *)mPath);
char* oldPath = nsCRT::strdup(mPath);
SetLeafName(inNewName);
if (PR_Rename(oldPath, (char *)mPath) != NS_OK)
if (PR_Rename(oldPath, mPath) != NS_OK)
{
// Could not rename, set back to the original.
mPath = oldPath;
@ -425,7 +425,7 @@ nsresult nsFileSpec::Copy(const nsFileSpec& inParentDirectory) const
destPath += "/";
destPath += leafname;
nsCRT::free(leafname);
result = NS_FILE_RESULT(CrudeFileCopy(GetCString(), (char *)destPath));
result = NS_FILE_RESULT(CrudeFileCopy(GetCString(), destPath));
}
return result;
} // nsFileSpec::Copy
@ -445,7 +445,7 @@ nsresult nsFileSpec::Move(const nsFileSpec& inNewParentDirectory)
destPath += leafname;
nsCRT::free(leafname);
result = NS_FILE_RESULT(CrudeFileCopy(GetCString(), (char*)destPath));
result = NS_FILE_RESULT(CrudeFileCopy(GetCString(), (const char*)destPath));
if (result == NS_OK)
{
// cast to fix const-ness
@ -466,7 +466,7 @@ nsresult nsFileSpec::Execute(const char* inArgs ) const
if (!mPath.IsEmpty() && !IsDirectory())
{
nsSimpleCharString fileNameWithArgs = mPath + " " + inArgs;
result = NS_FILE_RESULT(system((char *)fileNameWithArgs));
result = NS_FILE_RESULT(system(fileNameWithArgs));
}
return result;