Bug 605180 - Fix build warnings in netwerk/. r=jduell

This commit is contained in:
Ms2ger 2012-04-07 14:25:00 -07:00
Родитель 917295d881
Коммит 4f0704cc9f
23 изменённых файлов: 56 добавлений и 43 удалений

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

@ -404,6 +404,10 @@ nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *stream)
case STATE_STOP:
nextState = OnStateStop();
break;
default:
nextState = 0;
NS_NOTREACHED("Unknown enum value.");
return NS_ERROR_UNEXPECTED;
}
if (mState == nextState && !mSuspendCount) {

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

@ -343,7 +343,7 @@ nsSocketInputStream::Read(char *buf, PRUint32 count, PRUint32 *countRead)
*countRead = 0;
PRFileDesc *fd;
PRFileDesc* fd = nsnull;
{
MutexAutoLock lock(mTransport->mLock);
@ -364,7 +364,7 @@ nsSocketInputStream::Read(char *buf, PRUint32 count, PRUint32 *countRead)
SOCKET_LOG((" PR_Read returned [n=%d]\n", n));
nsresult rv;
nsresult rv = NS_OK;
{
MutexAutoLock lock(mTransport->mLock);
@ -567,7 +567,7 @@ nsSocketOutputStream::Write(const char *buf, PRUint32 count, PRUint32 *countWrit
if (count == 0 && mByteCount)
return NS_OK;
PRFileDesc *fd;
PRFileDesc* fd = nsnull;
{
MutexAutoLock lock(mTransport->mLock);
@ -588,7 +588,7 @@ nsSocketOutputStream::Write(const char *buf, PRUint32 count, PRUint32 *countWrit
SOCKET_LOG((" PR_Write returned [n=%d]\n", n));
nsresult rv;
nsresult rv = NS_OK;
{
MutexAutoLock lock(mTransport->mLock);
@ -1875,7 +1875,7 @@ nsSocketTransport::IsAlive(bool *result)
{
*result = false;
PRFileDesc *fd;
PRFileDesc* fd = nsnull;
{
MutexAutoLock lock(mLock);
if (NS_FAILED(mCondition))

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

@ -506,8 +506,8 @@ nsStandardURL::BuildNormalizedSpec(const char *spec)
// escaping is required).
nsCAutoString encUsername, encPassword, encHost, encDirectory,
encBasename, encExtension, encQuery, encRef;
bool useEncUsername, useEncPassword, useEncHost, useEncDirectory,
useEncBasename, useEncExtension, useEncQuery, useEncRef;
bool useEncUsername, useEncPassword, useEncHost = false,
useEncDirectory, useEncBasename, useEncExtension, useEncQuery, useEncRef;
nsCAutoString portbuf;
//

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

@ -858,8 +858,8 @@ net_ParseMediaType(const nsACString &aMediaTypeStr,
const char* charset = "";
const char* charsetEnd = charset;
PRInt32 charsetParamStart;
PRInt32 charsetParamEnd;
PRInt32 charsetParamStart = 0;
PRInt32 charsetParamEnd = 0;
// Iterate over parameters
bool typeHasCharset = false;

20
netwerk/cache/nsCacheService.cpp поставляемый
Просмотреть файл

@ -1,7 +1,6 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/*
* ***** BEGIN LICENSE BLOCK *****
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -1387,35 +1386,36 @@ nsCacheService::EvictEntriesForClient(const char * clientID,
storagePolicy == nsICache::STORE_ON_DISK) {
if (mEnableDiskDevice) {
nsresult rv;
nsresult rv = NS_OK;
if (!mDiskDevice)
rv = CreateDiskDevice();
if (mDiskDevice)
rv = mDiskDevice->EvictEntries(clientID);
if (NS_FAILED(rv)) res = rv;
if (NS_FAILED(rv))
res = rv;
}
}
// Only clear the offline cache if it has been specifically asked for.
if (storagePolicy == nsICache::STORE_OFFLINE) {
if (mEnableOfflineDevice) {
nsresult rv;
nsresult rv = NS_OK;
if (!mOfflineDevice)
rv = CreateOfflineDevice();
if (mOfflineDevice)
rv = mOfflineDevice->EvictEntries(clientID);
if (NS_FAILED(rv)) res = rv;
if (NS_FAILED(rv))
res = rv;
}
}
if (storagePolicy == nsICache::STORE_ANYWHERE ||
storagePolicy == nsICache::STORE_IN_MEMORY) {
// If there is no memory device, there is no need to evict it...
if (mMemoryDevice) {
nsresult rv;
rv = mMemoryDevice->EvictEntries(clientID);
if (NS_FAILED(rv)) res = rv;
nsresult rv = mMemoryDevice->EvictEntries(clientID);
if (NS_FAILED(rv))
res = rv;
}
}

6
netwerk/cache/nsDiskCacheBlockFile.h поставляемый
Просмотреть файл

@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version

2
netwerk/cache/nsDiskCacheDeviceSQL.cpp поставляемый
Просмотреть файл

@ -1895,7 +1895,7 @@ nsOfflineCacheDevice::GetMatchingNamespace(const nsCString &clientID,
bool found = false;
nsCString nsSpec;
PRInt32 nsType;
PRInt32 nsType = 0;
nsCString nsData;
while (hasRows)

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

@ -84,6 +84,7 @@
#include "mozilla/FunctionTimer.h"
#include "mozilla/Util.h" // for DebugOnly
using namespace mozilla;
using namespace mozilla::net;
/******************************************************************************
@ -3541,7 +3542,7 @@ nsCookieService::FindStaleCookie(nsCookieEntry *aEntry,
{
aIter.entry = NULL;
PRInt64 oldestTime;
PRInt64 oldestTime = 0;
const nsCookieEntry::ArrayType &cookies = aEntry->GetCookies();
for (nsCookieEntry::IndexType i = 0; i < cookies.Length(); ++i) {
nsCookie *cookie = cookies[i];
@ -3672,7 +3673,8 @@ nsCookieService::RemoveCookieFromList(const nsListIter &aIter,
nsCOMPtr<mozIStorageBindingParams> params;
paramsArray->NewBindingParams(getter_AddRefs(params));
nsresult rv = params->BindUTF8StringByName(NS_LITERAL_CSTRING("name"),
DebugOnly<nsresult> rv =
params->BindUTF8StringByName(NS_LITERAL_CSTRING("name"),
aIter.Cookie()->Name());
NS_ASSERT_SUCCESS(rv);
@ -3718,12 +3720,12 @@ bindCookieParameters(mozIStorageBindingParamsArray *aParamsArray,
{
NS_ASSERTION(aParamsArray, "Null params array passed to bindCookieParameters!");
NS_ASSERTION(aCookie, "Null cookie passed to bindCookieParameters!");
nsresult rv;
// Use the asynchronous binding methods to ensure that we do not acquire the
// database lock.
nsCOMPtr<mozIStorageBindingParams> params;
rv = aParamsArray->NewBindingParams(getter_AddRefs(params));
DebugOnly<nsresult> rv =
aParamsArray->NewBindingParams(getter_AddRefs(params));
NS_ASSERT_SUCCESS(rv);
// Bind our values to params

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

@ -1,6 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=4:
*/
/* vim: set sw=4 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@ -923,7 +922,7 @@ static const char especials[] = "()<>@,;:\\\"/[]?.=";
nsresult DecodeRFC2047Str(const char *aHeader, const char *aDefaultCharset,
bool aOverrideCharset, nsACString &aResult)
{
const char *p, *q, *r;
const char *p, *q = nsnull, *r;
char *decodedText;
const char *begin; // tracking pointer for where we are in the input buffer
PRInt32 isLastEncodedWord = 0;
@ -1059,4 +1058,3 @@ nsresult DecodeRFC2047Str(const char *aHeader, const char *aDefaultCharset,
return NS_OK;
}

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

@ -39,6 +39,7 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk

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

@ -38,6 +38,7 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk

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

@ -39,6 +39,7 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk

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

@ -39,6 +39,7 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk

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

@ -1,6 +1,5 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

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

@ -1,6 +1,5 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*

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

@ -2379,11 +2379,13 @@ nsHttpChannel::OpenNormalCacheEntry()
nsCOMPtr<nsICacheSession> session;
rv = gHttpHandler->GetCacheSession(storagePolicy,
getter_AddRefs(session));
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv))
return rv;
nsCacheAccessMode accessRequested;
nsCacheAccessMode accessRequested = 0;
rv = DetermineCacheAccess(&accessRequested);
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv))
return rv;
mOnCacheEntryAvailableCallback =
&nsHttpChannel::OnNormalCacheEntryAvailable;

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

@ -39,6 +39,7 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk

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

@ -40,6 +40,7 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk

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

@ -39,6 +39,7 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk

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

@ -38,6 +38,7 @@ DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS = 1
include $(DEPTH)/config/autoconf.mk

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

@ -804,7 +804,7 @@ mozTXTToHTMLConv::GlyphHit(const PRUnichar * aInString, PRInt32 aInLength, bool
// temporary variable used to store the glyph html text
nsAutoString outputHTML;
bool bTestSmilie;
bool bArg;
bool bArg = false;
int i;
// refactor some of this mess to avoid code duplication and speed execution a bit

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

@ -103,7 +103,8 @@ public:
rv = inStr->Read(buffer, len, &read);
buffer[len] = '\0';
if (NS_SUCCEEDED(rv)) {
printf("CONTEXT %p: Received %u bytes and the following data: \n %s\n\n", ctxt, read, buffer);
printf("CONTEXT %p: Received %u bytes and the following data: \n %s\n\n",
static_cast<void*>(ctxt), read, buffer);
}
nsMemory::Free(buffer);

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

@ -525,7 +525,7 @@ main(PRInt32 argc, char *argv[])
rv[2] = CheckResult(cookie.get(), MUST_CONTAIN, "test=same");
rv[3] = CheckResult(cookie.get(), MUST_NOT_CONTAIN, "newtest=ciao");
rv[4] = CheckResult(cookie.get(), MUST_NOT_CONTAIN, "newtest=foo");
rv[5] = CheckResult(cookie.get(), MUST_CONTAIN, "newtest=reincarnated") != nsnull;
rv[5] = CheckResult(cookie.get(), MUST_CONTAIN, "newtest=reincarnated");
SetACookie(cookieService, "http://multiple.cookies/", nsnull, "test=expiry; domain=.multiple.cookies; max-age=0", nsnull);
GetACookie(cookieService, "http://multiple.cookies/", nsnull, getter_Copies(cookie));
rv[6] = CheckResult(cookie.get(), MUST_NOT_CONTAIN, "test=same");