From 6972441d43b4ee925617186e2a75b9b3dcdcbc7d Mon Sep 17 00:00:00 2001 From: "jdunn%netscape.com" Date: Wed, 16 Jan 2002 03:06:47 +0000 Subject: [PATCH] fixing xlC5.x compiler error: use a temp variable for the static_cast sr=jaggernaut@netscape.com # 119326 git-svn-id: svn://10.0.0.236/trunk@112274 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/src/nsXPIDLString.cpp | 22 ++++++++++++++-------- mozilla/xpcom/string/src/nsXPIDLString.cpp | 22 ++++++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/mozilla/string/src/nsXPIDLString.cpp b/mozilla/string/src/nsXPIDLString.cpp index daf12dcd9f7..7264f3fda98 100644 --- a/mozilla/string/src/nsXPIDLString.cpp +++ b/mozilla/string/src/nsXPIDLString.cpp @@ -114,10 +114,13 @@ nsXPIDLString::GetSharedBufferHandle() const // PrepareForUseAsOutParam and it hasn't been filled in yet? mutable_this->mBuffer = GetSharedEmptyBufferHandle(); else if ( !mBuffer->DataEnd() ) - // Our handle may not be an nsImportedStringHandle. However, if it - // is not, this cast will still be safe since no other handle will - // be in this state. - NS_STATIC_CAST(const nsImportedStringHandle*, mBuffer.get())->RecalculateBoundaries(); + { + // Our handle may not be an nsImportedStringHandle. However, if it + // is not, this cast will still be safe since no other handle will + // be in this state. + const nsImportedStringHandle* handle = NS_STATIC_CAST(const nsImportedStringHandle*, mBuffer.get()); + handle->RecalculateBoundaries(); + } #if DEBUG_STRING_STATS ++sShareCount; @@ -189,10 +192,13 @@ nsXPIDLCString::GetSharedBufferHandle() const // PrepareForUseAsOutParam and it hasn't been filled in yet? mutable_this->mBuffer = GetSharedEmptyBufferHandle(); else if ( !mBuffer->DataEnd() ) - // Our handle may not be an nsImportedStringHandle. However, if it - // is not, this cast will still be safe since no other handle will - // be in this state. - NS_STATIC_CAST(const nsImportedStringHandle*, mBuffer.get())->RecalculateBoundaries(); + { + // Our handle may not be an nsImportedStringHandle. However, if it + // is not, this cast will still be safe since no other handle will + // be in this state. + const nsImportedStringHandle* handle = NS_STATIC_CAST(const nsImportedStringHandle*, mBuffer.get()); + handle->RecalculateBoundaries(); + } #if DEBUG_STRING_STATS ++sShareCount; diff --git a/mozilla/xpcom/string/src/nsXPIDLString.cpp b/mozilla/xpcom/string/src/nsXPIDLString.cpp index daf12dcd9f7..7264f3fda98 100644 --- a/mozilla/xpcom/string/src/nsXPIDLString.cpp +++ b/mozilla/xpcom/string/src/nsXPIDLString.cpp @@ -114,10 +114,13 @@ nsXPIDLString::GetSharedBufferHandle() const // PrepareForUseAsOutParam and it hasn't been filled in yet? mutable_this->mBuffer = GetSharedEmptyBufferHandle(); else if ( !mBuffer->DataEnd() ) - // Our handle may not be an nsImportedStringHandle. However, if it - // is not, this cast will still be safe since no other handle will - // be in this state. - NS_STATIC_CAST(const nsImportedStringHandle*, mBuffer.get())->RecalculateBoundaries(); + { + // Our handle may not be an nsImportedStringHandle. However, if it + // is not, this cast will still be safe since no other handle will + // be in this state. + const nsImportedStringHandle* handle = NS_STATIC_CAST(const nsImportedStringHandle*, mBuffer.get()); + handle->RecalculateBoundaries(); + } #if DEBUG_STRING_STATS ++sShareCount; @@ -189,10 +192,13 @@ nsXPIDLCString::GetSharedBufferHandle() const // PrepareForUseAsOutParam and it hasn't been filled in yet? mutable_this->mBuffer = GetSharedEmptyBufferHandle(); else if ( !mBuffer->DataEnd() ) - // Our handle may not be an nsImportedStringHandle. However, if it - // is not, this cast will still be safe since no other handle will - // be in this state. - NS_STATIC_CAST(const nsImportedStringHandle*, mBuffer.get())->RecalculateBoundaries(); + { + // Our handle may not be an nsImportedStringHandle. However, if it + // is not, this cast will still be safe since no other handle will + // be in this state. + const nsImportedStringHandle* handle = NS_STATIC_CAST(const nsImportedStringHandle*, mBuffer.get()); + handle->RecalculateBoundaries(); + } #if DEBUG_STRING_STATS ++sShareCount;