Skip to content

Commit

Permalink
Bug 810668 - Fix some gcc4.6 build warnings; r=bz
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Dec 2, 2012
1 parent abe686e commit 0a0b156
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 31 deletions.
10 changes: 4 additions & 6 deletions docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6225,8 +6225,6 @@ NS_IMETHODIMP
nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest,
uint32_t aStateFlags, nsresult aStatus)
{
nsresult rv;

if ((~aStateFlags & (STATE_START | STATE_IS_NETWORK)) == 0) {
// Save timing statistics.
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
Expand All @@ -6241,7 +6239,7 @@ nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest,

// We don't update navigation timing for wyciwyg channels
if (this == aProgress && !wcwgChannel){
rv = MaybeInitTiming();
MaybeInitTiming();
if (mTiming) {
mTiming->NotifyFetchStart(uri, ConvertLoadTypeToNavigationType(mLoadType));
}
Expand Down Expand Up @@ -6285,11 +6283,11 @@ nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest,
// from the channel and store it in session history.
// Pass false for aCloneChildren, since we're creating
// a new DOM here.
rv = AddToSessionHistory(uri, wcwgChannel, nullptr, false,
getter_AddRefs(mLSHE));
AddToSessionHistory(uri, wcwgChannel, nullptr, false,
getter_AddRefs(mLSHE));
SetCurrentURI(uri, aRequest, true, 0);
// Save history state of the previous page
rv = PersistLayoutHistoryState();
PersistLayoutHistoryState();
// We'll never get an Embed() for this load, so just go ahead
// and SetHistoryEntry now.
SetHistoryEntry(&mOSHE, mLSHE);
Expand Down
7 changes: 4 additions & 3 deletions dom/plugins/base/nsNPAPIPluginInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
#include "nsSize.h"
#include "nsNetCID.h"
#include "nsIContent.h"

#include "mozilla/Preferences.h"
#include "nsVersionComparator.h"
#include "mozilla/Preferences.h"
#include "mozilla/unused.h"

using namespace mozilla;

#ifdef MOZ_WIDGET_ANDROID
#include "ANPBase.h"
Expand All @@ -47,7 +49,6 @@
#include "GLContextProvider.h"
#include "TexturePoolOGL.h"

using namespace mozilla;
using namespace mozilla::gl;

typedef nsNPAPIPluginInstance::TextureInfo TextureInfo;
Expand Down
9 changes: 3 additions & 6 deletions ipc/testshell/XPCShellEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,25 +276,22 @@ Load(JSContext *cx,
unsigned argc,
jsval *vp)
{
unsigned i;
JSString *str;
jsval result;
FILE *file;

JSObject *obj = JS_THIS_OBJECT(cx, vp);
if (!obj)
return JS_FALSE;

jsval *argv = JS_ARGV(cx, vp);
for (i = 0; i < argc; i++) {
str = JS_ValueToString(cx, argv[i]);
for (unsigned i = 0; i < argc; i++) {
JSString *str = JS_ValueToString(cx, argv[i]);
if (!str)
return JS_FALSE;
argv[i] = STRING_TO_JSVAL(str);
JSAutoByteString filename(cx, str);
if (!filename)
return JS_FALSE;
file = fopen(filename.ptr(), "r");
FILE *file = fopen(filename.ptr(), "r");
if (!file) {
JS_ReportError(cx, "cannot open file '%s' for reading", filename.ptr());
return JS_FALSE;
Expand Down
2 changes: 2 additions & 0 deletions layout/base/nsFrameManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

/* storage of the frame tree and information about it */

#include "mozilla/Util.h"

#include "nscore.h"
#include "nsPresContext.h"
#include "nsIPresShell.h"
Expand Down
2 changes: 1 addition & 1 deletion layout/style/nsRuleNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3580,7 +3580,7 @@ nsRuleNode::GetShadowData(const nsCSSValueList* aList,
return nullptr;

nsStyleCoord tempCoord;
bool unitOK;
DebugOnly<bool> unitOK;
for (nsCSSShadowItem* item = shadowList->ShadowAt(0);
aList;
aList = aList->mNext, ++item) {
Expand Down
1 change: 1 addition & 0 deletions layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#include "nsIScriptableRegion.h"

#include "mozilla/Likely.h"
#include "mozilla/Util.h"

#ifdef ACCESSIBILITY
#include "nsAccessibilityService.h"
Expand Down
11 changes: 2 additions & 9 deletions netwerk/test/TestProtocols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,19 +512,12 @@ InputTestConsumer::OnStopRequest(nsIRequest *request, nsISupports* context,
URLLoadInfo* info = (URLLoadInfo*)context;

if (info) {
#ifdef PR_LOGGING
double connectTime;
#endif
double readTime;
uint32_t httpStatus;
bool bHTTPURL = false;

info->mTotalTime = PR_Now() - info->mTotalTime;

#ifdef PR_LOGGING
connectTime = (info->mConnectTime/1000.0)/1000.0;
#endif
readTime = ((info->mTotalTime-info->mConnectTime)/1000.0)/1000.0;
double readTime = ((info->mTotalTime-info->mConnectTime)/1000.0)/1000.0;

nsCOMPtr<nsIHttpChannel> pHTTPCon(do_QueryInterface(request));
if (pHTTPCon) {
Expand All @@ -540,7 +533,7 @@ InputTestConsumer::OnStopRequest(nsIRequest *request, nsISupports* context,
NS_ERROR_UNKNOWN_PROXY_HOST == aStatus) {
LOG(("\tDNS lookup failed.\n"));
}
LOG(("\tTime to connect: %.3f seconds\n", connectTime));
LOG(("\tTime to connect: %.3f seconds\n", (info->mConnectTime/1000.0)/1000.0));
LOG(("\tTime to read: %.3f seconds.\n", readTime));
LOG(("\tRead: %lld bytes.\n", info->mBytesRead));
if (info->mBytesRead == int64_t(0)) {
Expand Down
14 changes: 8 additions & 6 deletions xpcom/ds/nsSupportsArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,14 +616,16 @@ CopyElement(nsISupports* aElement, void *aData)
}

NS_IMETHODIMP
nsSupportsArray::Clone(nsISupportsArray* *result)
nsSupportsArray::Clone(nsISupportsArray** aResult)
{
nsresult rv;
nsISupportsArray* newArray;
rv = NS_NewISupportsArray(&newArray);
nsCOMPtr<nsISupportsArray> newArray;
nsresult rv = NS_NewISupportsArray(getter_AddRefs(newArray));
NS_ENSURE_SUCCESS(rv, rv);

bool ok = EnumerateForwards(CopyElement, newArray);
if (!ok) return NS_ERROR_OUT_OF_MEMORY;
*result = newArray;
NS_ENSURE_TRUE(ok, NS_ERROR_OUT_OF_MEMORY);

newArray.forget(aResult);
return NS_OK;
}

Expand Down

0 comments on commit 0a0b156

Please sign in to comment.