diff --git a/mozilla/base/public/nsFileSpec.h b/mozilla/base/public/nsFileSpec.h index 8e89ecf492f..1a2544c0ccd 100644 --- a/mozilla/base/public/nsFileSpec.h +++ b/mozilla/base/public/nsFileSpec.h @@ -111,21 +111,23 @@ #endif #ifdef NS_USING_NAMESPACE + #define NS_NAMESPACE_PROTOTYPE #define NS_NAMESPACE namespace #define NS_NAMESPACE_END #include using std::ostream; + #else + #define NS_NAMESPACE_PROTOTYPE static #define NS_NAMESPACE struct #define NS_NAMESPACE_END ; #include + #endif //=========================== End Compiler-specific macros =============================== -#include "nsDebug.h" - #ifdef XP_MAC #include #endif diff --git a/mozilla/base/src/nsFileSpec.cpp b/mozilla/base/src/nsFileSpec.cpp index b2a82794851..46b7bd78d4b 100644 --- a/mozilla/base/src/nsFileSpec.cpp +++ b/mozilla/base/src/nsFileSpec.cpp @@ -21,13 +21,14 @@ #include "prtypes.h" #ifdef NS_USING_NAMESPACE -#include + #include -#include + #else + #include #include -#include + #endif #ifdef NS_USING_NAMESPACE @@ -35,6 +36,9 @@ using std::ostrstream; #endif +#include +#include "nsDebug.h" + //======================================================================================== NS_NAMESPACE nsFileSpecHelpers //======================================================================================== @@ -132,10 +136,10 @@ char* nsFileSpecHelpers::GetLeaf(const char* inPath, char inSeparator) } // nsNativeFileSpec::GetLeaf -#ifdef XP_MAC -#include "nsFileSpecMac.cpp" // Macintosh-specific implementations -#elif defined(XP_PC) +#if defined(XP_PC) #include "nsFileSpecWin.cpp" // Windows-specific implementations +#elif defined(XP_MAC) +#include "nsFileSpecMac.cpp" // Macintosh-specific implementations #elif defined(XP_UNIX) #include "nsFileSpecUnix.cpp" // Unix-specific implementations #endif @@ -414,7 +418,7 @@ void nsNativeFileSpec::operator = (const nsFilePath& inPath) //---------------------------------------------------------------------------------------- nsNativeFileSpec::nsNativeFileSpec(const nsNativeFileSpec& inSpec) //---------------------------------------------------------------------------------------- -: mPath(nsFileSpecHelpers::StringDup((const char*)inSpec)) +: mPath(nsFileSpecHelpers::StringDup(inSpec.mPath)) { } #endif //XP_UNIX diff --git a/mozilla/base/src/windows/nsFileSpecWin.cpp b/mozilla/base/src/windows/nsFileSpecWin.cpp index 9d0ddf2db62..b4290b10685 100644 --- a/mozilla/base/src/windows/nsFileSpecWin.cpp +++ b/mozilla/base/src/windows/nsFileSpecWin.cpp @@ -32,8 +32,8 @@ void nsNativeFileSpec::operator = (const nsFilePath& inPath) //---------------------------------------------------------------------------------------- { // Convert '/' to '\' - nsFileSpecHelpers::StringAssign(mPath, inSpec.mPath); - for (const char* cp = mPath; *cp; cp++) + nsFileSpecHelpers::StringAssign(mPath, (const char*)mPath); + for (char* cp = mPath; *cp; cp++) { if (*cp == '/') *cp = '\\'; @@ -54,7 +54,7 @@ void nsFilePath::operator = (const nsNativeFileSpec& inSpec) { // Convert '\' to '/' nsFileSpecHelpers::StringAssign(mPath, inSpec.mPath); - for (const char* cp = mPath; *cp; cp++) + for (char* cp = mPath; *cp; cp++) { if (*cp == '\\') *cp = '/'; @@ -69,7 +69,7 @@ void nsNativeFileSpec::SetLeafName(const char* inLeafName) } // nsNativeFileSpec::SetLeafName //---------------------------------------------------------------------------------------- -const char* nsNativeFileSpec::GetLeafName() const +char* nsNativeFileSpec::GetLeafName() const //---------------------------------------------------------------------------------------- { return nsFileSpecHelpers::GetLeaf(mPath, '\\'); diff --git a/mozilla/xpcom/io/nsFileSpec.cpp b/mozilla/xpcom/io/nsFileSpec.cpp index b2a82794851..46b7bd78d4b 100644 --- a/mozilla/xpcom/io/nsFileSpec.cpp +++ b/mozilla/xpcom/io/nsFileSpec.cpp @@ -21,13 +21,14 @@ #include "prtypes.h" #ifdef NS_USING_NAMESPACE -#include + #include -#include + #else + #include #include -#include + #endif #ifdef NS_USING_NAMESPACE @@ -35,6 +36,9 @@ using std::ostrstream; #endif +#include +#include "nsDebug.h" + //======================================================================================== NS_NAMESPACE nsFileSpecHelpers //======================================================================================== @@ -132,10 +136,10 @@ char* nsFileSpecHelpers::GetLeaf(const char* inPath, char inSeparator) } // nsNativeFileSpec::GetLeaf -#ifdef XP_MAC -#include "nsFileSpecMac.cpp" // Macintosh-specific implementations -#elif defined(XP_PC) +#if defined(XP_PC) #include "nsFileSpecWin.cpp" // Windows-specific implementations +#elif defined(XP_MAC) +#include "nsFileSpecMac.cpp" // Macintosh-specific implementations #elif defined(XP_UNIX) #include "nsFileSpecUnix.cpp" // Unix-specific implementations #endif @@ -414,7 +418,7 @@ void nsNativeFileSpec::operator = (const nsFilePath& inPath) //---------------------------------------------------------------------------------------- nsNativeFileSpec::nsNativeFileSpec(const nsNativeFileSpec& inSpec) //---------------------------------------------------------------------------------------- -: mPath(nsFileSpecHelpers::StringDup((const char*)inSpec)) +: mPath(nsFileSpecHelpers::StringDup(inSpec.mPath)) { } #endif //XP_UNIX diff --git a/mozilla/xpcom/io/nsFileSpec.h b/mozilla/xpcom/io/nsFileSpec.h index 8e89ecf492f..1a2544c0ccd 100644 --- a/mozilla/xpcom/io/nsFileSpec.h +++ b/mozilla/xpcom/io/nsFileSpec.h @@ -111,21 +111,23 @@ #endif #ifdef NS_USING_NAMESPACE + #define NS_NAMESPACE_PROTOTYPE #define NS_NAMESPACE namespace #define NS_NAMESPACE_END #include using std::ostream; + #else + #define NS_NAMESPACE_PROTOTYPE static #define NS_NAMESPACE struct #define NS_NAMESPACE_END ; #include + #endif //=========================== End Compiler-specific macros =============================== -#include "nsDebug.h" - #ifdef XP_MAC #include #endif diff --git a/mozilla/xpcom/io/nsFileSpecWin.cpp b/mozilla/xpcom/io/nsFileSpecWin.cpp index 9d0ddf2db62..b4290b10685 100644 --- a/mozilla/xpcom/io/nsFileSpecWin.cpp +++ b/mozilla/xpcom/io/nsFileSpecWin.cpp @@ -32,8 +32,8 @@ void nsNativeFileSpec::operator = (const nsFilePath& inPath) //---------------------------------------------------------------------------------------- { // Convert '/' to '\' - nsFileSpecHelpers::StringAssign(mPath, inSpec.mPath); - for (const char* cp = mPath; *cp; cp++) + nsFileSpecHelpers::StringAssign(mPath, (const char*)mPath); + for (char* cp = mPath; *cp; cp++) { if (*cp == '/') *cp = '\\'; @@ -54,7 +54,7 @@ void nsFilePath::operator = (const nsNativeFileSpec& inSpec) { // Convert '\' to '/' nsFileSpecHelpers::StringAssign(mPath, inSpec.mPath); - for (const char* cp = mPath; *cp; cp++) + for (char* cp = mPath; *cp; cp++) { if (*cp == '\\') *cp = '/'; @@ -69,7 +69,7 @@ void nsNativeFileSpec::SetLeafName(const char* inLeafName) } // nsNativeFileSpec::SetLeafName //---------------------------------------------------------------------------------------- -const char* nsNativeFileSpec::GetLeafName() const +char* nsNativeFileSpec::GetLeafName() const //---------------------------------------------------------------------------------------- { return nsFileSpecHelpers::GetLeaf(mPath, '\\');