--- a/netwerk/base/public/Makefile.in
+++ b/netwerk/base/public/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
GRE_MODULE = 1
SDK_XPIDLSRCS = \
nsIChannel.idl \
--- a/netwerk/base/src/Makefile.in
+++ b/netwerk/base/src/Makefile.in
@@ -3,16 +3,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckobase_s
LIBXUL_LIBRARY = 1
EXPORTS = \
--- a/netwerk/base/src/nsFileStreams.cpp
+++ b/netwerk/base/src/nsFileStreams.cpp
@@ -595,28 +595,28 @@ nsPartialFileInputStream::Init(nsIFile*
NS_ENSURE_SUCCESS(rv, rv);
return nsFileInputStream::Seek(NS_SEEK_SET, mStart);
}
NS_IMETHODIMP
nsPartialFileInputStream::Tell(int64_t *aResult)
{
- int64_t tell;
+ int64_t tell = 0;
nsresult rv = nsFileInputStream::Tell(&tell);
if (NS_SUCCEEDED(rv)) {
*aResult = tell - mStart;
}
return rv;
}
NS_IMETHODIMP
nsPartialFileInputStream::Available(uint64_t* aResult)
{
- uint64_t available;
+ uint64_t available = 0;
nsresult rv = nsFileInputStream::Available(&available);
if (NS_SUCCEEDED(rv)) {
*aResult = TruncateSize(available);
}
return rv;
}
NS_IMETHODIMP
@@ -975,9 +975,9 @@ nsFileStream::GetLastModified(int64_t* _
}
else {
*_retval = modTime / int64_t(PR_USEC_PER_MSEC);
}
return NS_OK;
}
-////////////////////////////////////////////////////////////////////////////////
\ No newline at end of file
+////////////////////////////////////////////////////////////////////////////////
--- a/netwerk/base/src/nsFileStreams.h
+++ b/netwerk/base/src/nsFileStreams.h
@@ -174,16 +174,17 @@ protected:
////////////////////////////////////////////////////////////////////////////////
class nsPartialFileInputStream : public nsFileInputStream,
public nsIPartialFileInputStream
{
public:
using nsFileInputStream::Init;
+ using nsFileInputStream::Read;
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIPARTIALFILEINPUTSTREAM
NS_DECL_NSIIPCSERIALIZABLEINPUTSTREAM
nsPartialFileInputStream()
: mStart(0), mLength(0), mPosition(0)
{ }
--- a/netwerk/base/src/nsURLParsers.cpp
+++ b/netwerk/base/src/nsURLParsers.cpp
@@ -466,17 +466,19 @@ nsAuthURLParser::ParseAuthority(const ch
SET_RESULT(hostname, 0, 0);
if (port)
*port = -1;
return NS_OK;
}
// search backwards for @
const char *p = auth + authLen - 1;
- for (; (*p != '@') && (p > auth); --p);
+ for (; (*p != '@') && (p > auth); --p) {
+ continue;
+ }
if ( *p == '@' ) {
// auth = <user-info@server-info>
rv = ParseUserInfo(auth, p - auth,
usernamePos, usernameLen,
passwordPos, passwordLen);
if (NS_FAILED(rv)) return rv;
rv = ParseServerInfo(p + 1, authLen - (p - auth + 1),
hostnamePos, hostnameLen,
--- a/netwerk/build/Makefile.in
+++ b/netwerk/build/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = necko
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
MODULE_NAME = necko
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -2517,20 +2517,19 @@ nsCacheService::SetMemoryCache()
* static methods for nsCacheEntryDescriptor
*****************************************************************************/
void
nsCacheService::CloseDescriptor(nsCacheEntryDescriptor * descriptor)
{
// ask entry to remove descriptor
nsCacheEntry * entry = descriptor->CacheEntry();
bool stillActive = entry->RemoveDescriptor(descriptor);
- nsresult rv = NS_OK;
if (!entry->IsValid()) {
- rv = gService->ProcessPendingRequests(entry);
+ gService->ProcessPendingRequests(entry);
}
if (!stillActive) {
gService->DeactivateEntry(entry);
}
}
--- a/netwerk/cache/nsDiskCacheBinding.cpp
+++ b/netwerk/cache/nsDiskCacheBinding.cpp
@@ -197,19 +197,22 @@ nsDiskCacheBindery::CreateBinding(nsCach
* FindActiveEntry : to find active colliding entry so we can doom it
*/
nsDiskCacheBinding *
nsDiskCacheBindery::FindActiveBinding(uint32_t hashNumber)
{
NS_ASSERTION(initialized, "nsDiskCacheBindery not initialized");
// find hash entry for key
HashTableEntry * hashEntry;
- hashEntry = (HashTableEntry *) PL_DHashTableOperate(&table, (void*) hashNumber, PL_DHASH_LOOKUP);
+ hashEntry =
+ (HashTableEntry *) PL_DHashTableOperate(&table,
+ (void*)(uintptr_t) hashNumber,
+ PL_DHASH_LOOKUP);
if (PL_DHASH_ENTRY_IS_FREE(hashEntry)) return nullptr;
-
+
// walk list looking for active entry
NS_ASSERTION(hashEntry->mBinding, "hash entry left with no binding");
nsDiskCacheBinding * binding = hashEntry->mBinding;
while (binding->mCacheEntry->IsDoomed()) {
binding = (nsDiskCacheBinding *)PR_NEXT_LINK(binding);
if (binding == hashEntry->mBinding) return nullptr;
}
return binding;
@@ -229,19 +232,20 @@ nsDiskCacheBindery::FindActiveBinding(ui
nsresult
nsDiskCacheBindery::AddBinding(nsDiskCacheBinding * binding)
{
NS_ENSURE_ARG_POINTER(binding);
NS_ASSERTION(initialized, "nsDiskCacheBindery not initialized");
// find hash entry for key
HashTableEntry * hashEntry;
- hashEntry = (HashTableEntry *) PL_DHashTableOperate(&table,
- (void*) binding->mRecord.HashNumber(),
- PL_DHASH_ADD);
+ hashEntry = (HashTableEntry *)
+ PL_DHashTableOperate(&table,
+ (void *)(uintptr_t) binding->mRecord.HashNumber(),
+ PL_DHASH_ADD);
if (!hashEntry) return NS_ERROR_OUT_OF_MEMORY;
if (hashEntry->mBinding == nullptr) {
hashEntry->mBinding = binding;
if (binding->mGeneration == 0)
binding->mGeneration = 1; // if generation uninitialized, set it to 1
return NS_OK;
@@ -291,32 +295,32 @@ nsDiskCacheBindery::AddBinding(nsDiskCac
*/
void
nsDiskCacheBindery::RemoveBinding(nsDiskCacheBinding * binding)
{
NS_ASSERTION(initialized, "nsDiskCacheBindery not initialized");
if (!initialized) return;
HashTableEntry * hashEntry;
- void * key = (void *)binding->mRecord.HashNumber();
+ void * key = (void *)(uintptr_t)binding->mRecord.HashNumber();
hashEntry = (HashTableEntry*) PL_DHashTableOperate(&table,
- (void*) key,
+ (void*)(uintptr_t) key,
PL_DHASH_LOOKUP);
if (!PL_DHASH_ENTRY_IS_BUSY(hashEntry)) {
NS_WARNING("### disk cache: binding not in hashtable!");
return;
}
if (binding == hashEntry->mBinding) {
if (PR_CLIST_IS_EMPTY(binding)) {
// remove this hash entry
- (void) PL_DHashTableOperate(&table,
- (void*) binding->mRecord.HashNumber(),
- PL_DHASH_REMOVE);
+ PL_DHashTableOperate(&table,
+ (void*)(uintptr_t) binding->mRecord.HashNumber(),
+ PL_DHASH_REMOVE);
return;
} else {
// promote next binding to head, and unlink this binding
hashEntry->mBinding = (nsDiskCacheBinding *)PR_NEXT_LINK(binding);
}
}
PR_REMOVE_AND_INIT_LINK(binding);
--- a/netwerk/cache/nsDiskCacheStreams.cpp
+++ b/netwerk/cache/nsDiskCacheStreams.cpp
@@ -130,21 +130,20 @@ nsDiskCacheInputStream::Read(char * buff
if (count > mStreamEnd - mPos)
count = mStreamEnd - mPos;
if (mFD) {
// just read from file
int32_t result = PR_Read(mFD, buffer, count);
if (result < 0) {
- PRErrorCode error = PR_GetError();
nsresult rv = NS_ErrorAccordingToNSPR();
CACHE_LOG_DEBUG(("CACHE: nsDiskCacheInputStream::Read PR_Read failed"
"[stream=%p, rv=%d, NSPR error %s",
- this, int(rv), PR_ErrorToName(error)));
+ this, int(rv), PR_ErrorToName(PR_GetError())));
return rv;
}
mPos += (uint32_t)result;
*bytesRead = (uint32_t)result;
} else if (mBuffer) {
// read data from mBuffer
--- a/netwerk/cookie/Makefile.in
+++ b/netwerk/cookie/Makefile.in
@@ -3,16 +3,17 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
# export required interfaces, even if --disable-cookies has been given
MODULE = necko
XPIDL_MODULE = necko_cookie
GRE_MODULE = 1
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -2824,37 +2824,40 @@ nsCookieService::GetTokenValue(nsASingle
++aIter;
start = aIter;
while (aIter != aEndIter && !istokenseparator(*aIter))
++aIter;
// remove trailing <LWS>; first check we're not at the beginning
lastSpace = aIter;
if (lastSpace != start) {
- while (--lastSpace != start && iswhitespace(*lastSpace));
+ while (--lastSpace != start && iswhitespace(*lastSpace))
+ continue;
++lastSpace;
}
aTokenString.Rebind(start, lastSpace);
aEqualsFound = (*aIter == '=');
if (aEqualsFound) {
// find <value>
- while (++aIter != aEndIter && iswhitespace(*aIter));
+ while (++aIter != aEndIter && iswhitespace(*aIter))
+ continue;
start = aIter;
// process <token>
// just look for ';' to terminate ('=' allowed)
while (aIter != aEndIter && !isvalueseparator(*aIter))
++aIter;
// remove trailing <LWS>; first check we're not at the beginning
if (aIter != start) {
lastSpace = aIter;
- while (--lastSpace != start && iswhitespace(*lastSpace));
+ while (--lastSpace != start && iswhitespace(*lastSpace))
+ continue;
aTokenValue.Rebind(start, ++lastSpace);
}
}
// aIter is on ';', or terminator, or EOS
if (aIter != aEndIter) {
// if on terminator, increment past & return true to process new cookie
if (isterminator(*aIter)) {
--- a/netwerk/dns/Makefile.in
+++ b/netwerk/dns/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckodns_s
LIBXUL_LIBRARY = 1
XPIDL_MODULE = necko_dns
GRE_MODULE = 1
--- a/netwerk/ipc/Makefile.in
+++ b/netwerk/ipc/Makefile.in
@@ -1,16 +1,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckoipc_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
--- a/netwerk/mime/Makefile.in
+++ b/netwerk/mime/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = mimetype
LIBRARY_NAME = nkmime_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
--- a/netwerk/mime/nsMIMEHeaderParamImpl.cpp
+++ b/netwerk/mime/nsMIMEHeaderParamImpl.cpp
@@ -788,17 +788,17 @@ nsMIMEHeaderParamImpl::DecodeRFC5987Para
const char *c = encoded;
while (*c) {
char tc = *c++;
if (tc == '\'') {
// single quote
delimiters++;
- } else if (tc >= 128) {
+ } else if (((unsigned char)tc) >= 128) {
// fail early, not ASCII
NS_WARNING("non-US-ASCII character in RFC5987-encoded param");
return NS_ERROR_INVALID_ARG;
} else {
if (delimiters == 0) {
// valid characters are checked later implicitly
charset.Append(tc);
} else if (delimiters == 1) {
--- a/netwerk/protocol/about/Makefile.in
+++ b/netwerk/protocol/about/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = nkabout_s
LIBXUL_LIBRARY = 1
XPIDL_MODULE = necko_about
GRE_MODULE = 1
--- a/netwerk/protocol/about/nsAboutBlank.cpp
+++ b/netwerk/protocol/about/nsAboutBlank.cpp
@@ -10,29 +10,28 @@
#include "nsNetUtil.h"
NS_IMPL_ISUPPORTS1(nsAboutBlank, nsIAboutModule)
NS_IMETHODIMP
nsAboutBlank::NewChannel(nsIURI *aURI, nsIChannel **result)
{
NS_ENSURE_ARG_POINTER(aURI);
- nsresult rv;
- nsIChannel* channel;
nsCOMPtr<nsIInputStream> in;
- rv = NS_NewCStringInputStream(getter_AddRefs(in), EmptyCString());
+ nsresult rv = NS_NewCStringInputStream(getter_AddRefs(in), EmptyCString());
if (NS_FAILED(rv)) return rv;
- rv = NS_NewInputStreamChannel(&channel, aURI, in,
+ nsCOMPtr<nsIChannel> channel;
+ rv = NS_NewInputStreamChannel(getter_AddRefs(channel), aURI, in,
NS_LITERAL_CSTRING("text/html"),
NS_LITERAL_CSTRING("utf-8"));
if (NS_FAILED(rv)) return rv;
- *result = channel;
+ channel.forget(result);
return rv;
}
NS_IMETHODIMP
nsAboutBlank::GetURIFlags(nsIURI *aURI, uint32_t *result)
{
*result = nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::HIDE_FROM_ABOUTABOUT;
--- a/netwerk/protocol/about/nsAboutCache.cpp
+++ b/netwerk/protocol/about/nsAboutCache.cpp
@@ -101,23 +101,23 @@ nsAboutCache::NewChannel(nsIURI *aURI, n
"</html>\n");
outputStream->Write(mBuffer.get(), mBuffer.Length(), &bytesWritten);
nsCOMPtr<nsIInputStream> inStr;
rv = storageStream->NewInputStream(0, getter_AddRefs(inStr));
if (NS_FAILED(rv)) return rv;
- nsIChannel* channel;
- rv = NS_NewInputStreamChannel(&channel, aURI, inStr,
+ nsCOMPtr<nsIChannel> channel;
+ rv = NS_NewInputStreamChannel(getter_AddRefs(channel), aURI, inStr,
NS_LITERAL_CSTRING("text/html"),
NS_LITERAL_CSTRING("utf-8"));
if (NS_FAILED(rv)) return rv;
- *result = channel;
+ channel.forget(result);
return rv;
}
NS_IMETHODIMP
nsAboutCache::GetURIFlags(nsIURI *aURI, uint32_t *result)
{
*result = 0;
return NS_OK;
--- a/netwerk/protocol/http/Makefile.in
+++ b/netwerk/protocol/http/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = nkhttp_s
LIBXUL_LIBRARY = 1
XPIDL_MODULE = necko_http
GRE_MODULE = 1
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -386,17 +386,18 @@ nsHttpConnectionMgr::CompleteUpgrade(nsA
delete data;
return rv;
}
nsresult
nsHttpConnectionMgr::UpdateParam(nsParamName name, uint16_t value)
{
uint32_t param = (uint32_t(name) << 16) | uint32_t(value);
- return PostEvent(&nsHttpConnectionMgr::OnMsgUpdateParam, 0, (void *) param);
+ return PostEvent(&nsHttpConnectionMgr::OnMsgUpdateParam, 0,
+ (void *)(uintptr_t) param);
}
nsresult
nsHttpConnectionMgr::ProcessPendingQ(nsHttpConnectionInfo *ci)
{
LOG(("nsHttpConnectionMgr::ProcessPendingQ [ci=%s]\n", ci->HashKey().get()));
NS_ADDREF(ci);
@@ -948,17 +949,17 @@ nsHttpConnectionMgr::ProcessPendingQForE
count = ent->mPendingQ.Length();
--i;
continue;
}
if (dispatchedSuccessfully)
return true;
- NS_ABORT_IF_FALSE(count == ((int32_t) ent->mPendingQ.Length()),
+ NS_ABORT_IF_FALSE(count == ent->mPendingQ.Length(),
"something mutated pending queue from "
"GetConnection()");
}
return false;
}
bool
nsHttpConnectionMgr::ProcessPendingQForEntry(nsHttpConnectionInfo *ci)
--- a/netwerk/protocol/http/nsHttpHeaderArray.cpp
+++ b/netwerk/protocol/http/nsHttpHeaderArray.cpp
@@ -43,19 +43,18 @@ nsHttpHeaderArray::SetHeader(nsHttpAtom
return NS_OK;
}
nsresult
nsHttpHeaderArray::SetHeaderFromNet(nsHttpAtom header, const nsACString &value)
{
nsEntry *entry = nullptr;
- int32_t index;
- index = LookupEntry(header, &entry);
+ LookupEntry(header, &entry);
if (!entry) {
if (value.IsEmpty()) {
if (!TrackEmptyHeader(header)) {
LOG(("Ignoring Empty Header: %s\n", header.get()));
return NS_OK; // ignore empty headers by default
}
}
--- a/netwerk/protocol/http/nsHttpPipeline.h
+++ b/netwerk/protocol/http/nsHttpPipeline.h
@@ -68,17 +68,16 @@ private:
bool mClosed;
// indicates whether or not a true pipeline (more than 1 request without
// a synchronous response) has been formed.
bool mUtilizedPipeline;
// used when calling ReadSegments/WriteSegments on a transaction.
nsAHttpSegmentReader *mReader;
- nsAHttpSegmentWriter *mWriter;
// send buffer
nsCOMPtr<nsIInputStream> mSendBufIn;
nsCOMPtr<nsIOutputStream> mSendBufOut;
// the push back buffer. not exceeding nsIOService::gDefaultSegmentSize bytes.
char *mPushBackBuf;
uint32_t mPushBackLen;
--- a/netwerk/socket/Makefile.in
+++ b/netwerk/socket/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
XPIDL_MODULE = necko_socket
LIBRARY_NAME = neckosocket_s
LIBXUL_LIBRARY = 1
--- a/netwerk/socket/nsSOCKSIOLayer.cpp
+++ b/netwerk/socket/nsSOCKSIOLayer.cpp
@@ -1,11 +1,11 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:set expandtab ts=4 sw=4 sts=4 cin: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nspr.h"
#include "private/pprio.h"
#include "nsString.h"
#include "nsCRT.h"
@@ -929,17 +929,17 @@ nsSOCKSSocketInfo::ReadUint32()
memcpy(&rv, mData + mReadOffset, sizeof(rv));
mReadOffset += sizeof(rv);
return rv;
}
void
nsSOCKSSocketInfo::ReadNetAddr(PRNetAddr *addr, uint16_t fam)
{
- uint32_t amt;
+ uint32_t amt = 0;
const uint8_t *ip = mData + mReadOffset;
addr->raw.family = fam;
if (fam == PR_AF_INET) {
amt = sizeof(addr->inet.ip);
NS_ABORT_IF_FALSE(mReadOffset + amt <= mDataLength,
"Not enough space to pop an ipv4 addr!");
memcpy(&addr->inet.ip, ip, amt);
--- a/netwerk/streamconv/converters/Makefile.in
+++ b/netwerk/streamconv/converters/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = nkcnvts_s
LIBXUL_LIBRARY = 1
--- a/netwerk/streamconv/converters/ParseFTPList.cpp
+++ b/netwerk/streamconv/converters/ParseFTPList.cpp
@@ -26,21 +26,16 @@ int ParseFTPList(const char *line, struc
unsigned int carry_buf_len; /* copy of state->carry_buf_len */
unsigned int linelen, pos;
const char *p;
if (!line || !state || !result)
return 0;
memset( result, 0, sizeof(*result) );
- if (state->magic != ((void *)ParseFTPList))
- {
- memset( state, 0, sizeof(*state) );
- state->magic = ((void *)ParseFTPList);
- }
state->numlines++;
/* carry buffer is only valid from one line to the next */
carry_buf_len = state->carry_buf_len;
state->carry_buf_len = 0;
linelen = 0;
--- a/netwerk/streamconv/converters/ParseFTPList.h
+++ b/netwerk/streamconv/converters/ParseFTPList.h
@@ -60,17 +60,20 @@
#define SUPPORT_DOS /* WinNT server in 'site dirstyle' dos */
#define SUPPORT_VMS /* VMS (all: MultiNet, UCX, CMU-IP) */
#define SUPPORT_CMS /* IBM VM/CMS,VM/ESA (z/VM and LISTING forms) */
#define SUPPORT_OS2 /* IBM TCP/IP for OS/2 - FTP Server */
#define SUPPORT_W16 /* win16 hosts: SuperTCP or NetManage Chameleon */
struct list_state
{
- void *magic; /* to determine if previously initialized */
+ list_state() {
+ memset(this, 0, sizeof(*this));
+ }
+
PRTime now_time; /* needed for year determination */
PRExplodedTime now_tm; /* needed for year determination */
int32_t lstyle; /* LISTing style */
int32_t parsed_one; /* returned anything yet? */
char carry_buf[84]; /* for VMS multiline */
uint32_t carry_buf_len; /* length of name in carry_buf */
uint32_t numlines; /* number of lines seen */
};
--- a/netwerk/streamconv/converters/nsFTPDirListingConv.cpp
+++ b/netwerk/streamconv/converters/nsFTPDirListingConv.cpp
@@ -247,17 +247,16 @@ nsFTPDirListingConv::GetHeaders(nsACStri
char *
nsFTPDirListingConv::DigestBufferLines(char *aBuffer, nsCString &aString) {
char *line = aBuffer;
char *eol;
bool cr = false;
list_state state;
- state.magic = 0;
// while we have new lines, parse 'em into application/http-index-format.
while ( line && (eol = PL_strchr(line, nsCRT::LF)) ) {
// yank any carriage returns too.
if (eol > line && *(eol-1) == nsCRT::CR) {
eol--;
*eol = '\0';
cr = true;
--- a/netwerk/streamconv/converters/nsUnknownDecoder.cpp
+++ b/netwerk/streamconv/converters/nsUnknownDecoder.cpp
@@ -311,18 +311,18 @@ void nsUnknownDecoder::DetermineContentT
// magic numbers
uint32_t i;
for (i = 0; i < sSnifferEntryNum; ++i) {
if (mBufferLen >= sSnifferEntries[i].mByteLen && // enough data
memcmp(mBuffer, sSnifferEntries[i].mBytes, sSnifferEntries[i].mByteLen) == 0) { // and type matches
NS_ASSERTION(sSnifferEntries[i].mMimeType ||
sSnifferEntries[i].mContentTypeSniffer,
"Must have either a type string or a function to set the type");
- NS_ASSERTION(sSnifferEntries[i].mMimeType == nullptr ||
- sSnifferEntries[i].mContentTypeSniffer == nullptr,
+ NS_ASSERTION(!sSnifferEntries[i].mMimeType ||
+ !sSnifferEntries[i].mContentTypeSniffer,
"Both a type string and a type sniffing function set;"
" using type string");
if (sSnifferEntries[i].mMimeType) {
mContentType = sSnifferEntries[i].mMimeType;
NS_ASSERTION(!mContentType.IsEmpty(),
"Content type should be known by now.");
return;
}
@@ -544,17 +544,19 @@ bool nsUnknownDecoder::LastDitchSniff(ns
return true;
}
}
// Now see whether the buffer has any non-text chars. If not, then let's
// just call it text/plain...
//
uint32_t i;
- for (i=0; i<mBufferLen && IS_TEXT_CHAR(mBuffer[i]); i++);
+ for (i = 0; i < mBufferLen && IS_TEXT_CHAR(mBuffer[i]); i++) {
+ continue;
+ }
if (i == mBufferLen) {
mContentType = TEXT_PLAIN;
}
else {
mContentType = APPLICATION_OCTET_STREAM;
}
--- a/netwerk/streamconv/public/Makefile.in
+++ b/netwerk/streamconv/public/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
XPIDL_MODULE = necko_strconv
GRE_MODULE = 1
XPIDLSRCS = \
--- a/netwerk/streamconv/src/Makefile.in
+++ b/netwerk/streamconv/src/Makefile.in
@@ -9,16 +9,22 @@ srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = nkconv_s
LIBXUL_LIBRARY = 1
+ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+ifeq (x86_64,$(OS_TEST))
+# nsAppleFileDecoder.cpp has warnings I don't understand.
+FAIL_ON_WARNINGS := 1
+endif
+endif
CPPSRCS = \
nsStreamConverterService.cpp \
$(NULL)
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
ifneq (x86_64,$(OS_TEST))
CPPSRCS += \
--- a/netwerk/streamconv/test/Makefile.in
+++ b/netwerk/streamconv/test/Makefile.in
@@ -2,23 +2,23 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = TestStreamConv
PROGRAM = TestStreamConv$(BIN_SUFFIX)
-
CPPSRCS = \
Converters.cpp \
TestStreamConv.cpp \
$(NULL)
LIBS = \
$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
$(XPCOM_LIBS) \
--- a/netwerk/system/android/Makefile.in
+++ b/netwerk/system/android/Makefile.in
@@ -1,23 +1,23 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckosystem_s
LIBXUL_LIBRARY = 1
-FAIL_ON_WARNINGS = 1
FORCE_STATIC_LIB = 1
CPPSRCS += \
nsAndroidNetworkLinkService.cpp \
$(NULL)
include $(topsrcdir)/config/rules.mk
--- a/netwerk/system/mac/Makefile.in
+++ b/netwerk/system/mac/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckosystem_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
--- a/netwerk/system/maemo/Makefile.in
+++ b/netwerk/system/maemo/Makefile.in
@@ -1,16 +1,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckosystem_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
--- a/netwerk/system/qt/Makefile.in
+++ b/netwerk/system/qt/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckosystem_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
--- a/netwerk/system/win32/Makefile.in
+++ b/netwerk/system/win32/Makefile.in
@@ -2,16 +2,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckosystem_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
--- a/netwerk/test/Makefile.in
+++ b/netwerk/test/Makefile.in
@@ -4,16 +4,17 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = @relativesrcdir@
+FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
MODULE = test_necko
DIRS = \
httpserver \
browser \
--- a/netwerk/test/TestProtocols.cpp
+++ b/netwerk/test/TestProtocols.cpp
@@ -1,10 +1,10 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim: set ts=4 sw=4 et cindent: */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=2 sw=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
The TestProtocols tests the basic protocols architecture and can
be used to test individual protocols as well. If this grows too
big then we should split it to individual protocols.
@@ -373,18 +373,19 @@ NS_IMETHODIMP
InputTestConsumer::OnStartRequest(nsIRequest *request, nsISupports* context)
{
LOG(("InputTestConsumer::OnStartRequest\n"));
URLLoadInfo* info = (URLLoadInfo*)context;
if (info)
info->mConnectTime = PR_Now() - info->mConnectTime;
- if (gVerbose)
+ if (gVerbose) {
LOG(("\nStarted loading: %s\n", info ? info->Name() : "UNKNOWN URL"));
+ }
nsCAutoString value;
nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
if (channel) {
nsresult status;
channel->GetStatus(&status);
LOG(("Channel Status: %08x\n", status));
@@ -396,20 +397,21 @@ InputTestConsumer::OnStartRequest(nsIReq
channel->GetContentType(value);
LOG(("\tContent-Type: %s\n", value.get()));
channel->GetContentCharset(value);
LOG(("\tContent-Charset: %s\n", value.get()));
int32_t length = -1;
- if (NS_SUCCEEDED(channel->GetContentLength(&length)))
+ if (NS_SUCCEEDED(channel->GetContentLength(&length))) {
LOG(("\tContent-Length: %d\n", length));
- else
+ } else {
LOG(("\tContent-Length: Unknown\n"));
+ }
}
nsCOMPtr<nsISupports> owner;
channel->GetOwner(getter_AddRefs(owner));
LOG(("\tChannel Owner: %x\n", owner.get()));
}
nsCOMPtr<nsIPropertyBag2> props = do_QueryInterface(request);
@@ -425,26 +427,28 @@ InputTestConsumer::OnStartRequest(nsIReq
}
}
nsCOMPtr<nsIPropertyBag2> propbag = do_QueryInterface(request);
if (propbag) {
int64_t len;
nsresult rv = propbag->GetPropertyAsInt64(NS_CHANNEL_PROP_CONTENT_LENGTH,
&len);
- if (NS_SUCCEEDED(rv))
+ if (NS_SUCCEEDED(rv)) {
LOG(("\t64-bit length: %lli\n", len));
+ }
}
nsCOMPtr<nsIHttpChannelInternal> httpChannelInt(do_QueryInterface(request));
if (httpChannelInt) {
uint32_t majorVer, minorVer;
nsresult rv = httpChannelInt->GetResponseVersion(&majorVer, &minorVer);
- if (NS_SUCCEEDED(rv))
+ if (NS_SUCCEEDED(rv)) {
LOG(("HTTP Response version: %u.%u\n", majorVer, minorVer));
+ }
}
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(request));
if (httpChannel) {
HeaderVisitor *visitor = new HeaderVisitor();
if (!visitor)
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(visitor);
@@ -528,22 +532,23 @@ InputTestConsumer::OnStopRequest(nsIRequ
nsCOMPtr<nsIHttpChannel> pHTTPCon(do_QueryInterface(request));
if (pHTTPCon) {
pHTTPCon->GetResponseStatus(&httpStatus);
bHTTPURL = true;
}
LOG(("\nFinished loading: %s Status Code: %x\n", info->Name(), aStatus));
- if (bHTTPURL)
- LOG(("\tHTTP Status: %u\n", httpStatus));
- if (NS_ERROR_UNKNOWN_HOST == aStatus ||
- NS_ERROR_UNKNOWN_PROXY_HOST == aStatus) {
- LOG(("\tDNS lookup failed.\n"));
- }
+ if (bHTTPURL) {
+ LOG(("\tHTTP Status: %u\n", httpStatus));
+ }
+ if (NS_ERROR_UNKNOWN_HOST == aStatus ||
+ NS_ERROR_UNKNOWN_PROXY_HOST == aStatus) {
+ LOG(("\tDNS lookup failed.\n"));
+ }
LOG(("\tTime to connect: %.3f seconds\n", connectTime));
LOG(("\tTime to read: %.3f seconds.\n", readTime));
LOG(("\tRead: %lld bytes.\n", info->mBytesRead));
if (info->mBytesRead == int64_t(0)) {
} else if (readTime > 0.0) {
LOG(("\tThroughput: %.0f bps.\n", (double)(info->mBytesRead*int64_t(8))/readTime));
} else {
LOG(("\tThroughput: REAL FAST!!\n"));
@@ -641,18 +646,19 @@ nsresult StartLoadingURL(const char* aUr
nsCOMPtr<nsITimedChannel> timed(do_QueryInterface(pChannel));
if (timed)
timed->SetTimingEnabled(true);
nsCOMPtr<nsIWritablePropertyBag2> props = do_QueryInterface(pChannel);
if (props) {
rv = props->SetPropertyAsInterface(NS_LITERAL_STRING("test.foo"),
pURL);
- if (NS_SUCCEEDED(rv))
+ if (NS_SUCCEEDED(rv)) {
LOG(("set prop 'test.foo'\n"));
+ }
}
/*
You may optionally add/set other headers on this
request object. This is done by QI for the specific
protocolConnection.
*/
nsCOMPtr<nsIHttpChannel> pHTTPCon(do_QueryInterface(pChannel));
--- a/netwerk/wifi/Makefile.in
+++ b/netwerk/wifi/Makefile.in
@@ -12,16 +12,21 @@ include $(DEPTH)/config/autoconf.mk
MODULE = necko
LIBRARY_NAME = neckowifi_s
LIBXUL_LIBRARY = 1
XPIDL_MODULE = necko_wifi
GRE_MODULE = 1
FORCE_STATIC_LIB = 1
+ifneq ($(OS_ARCH),Darwin)
+# osx_corewlan.mm has warnings I don't understand.
+FAIL_ON_WARNINGS := 1
+endif
+
XPIDLSRCS = \
nsIWifiAccessPoint.idl \
nsIWifiListener.idl \
nsIWifiMonitor.idl \
$(NULL)
CPPSRCS = \
nsWifiMonitor.cpp \
--- a/netwerk/wifi/nsWifiScannerUnix.cpp
+++ b/netwerk/wifi/nsWifiScannerUnix.cpp
@@ -28,17 +28,17 @@ typedef int (*iw_stats_t)(int skfd,
const char *ifname,
iwstats *stats,
const iwrange *range,
int has_range);
static int scan_wifi(int skfd, char* ifname, char* args[], int count)
{
nsCOMArray<nsWifiAccessPoint>* accessPoints = (nsCOMArray<nsWifiAccessPoint>*) args[0];
- iw_stats_t iw_stats = (iw_stats_t) args[1];
+ iw_stats_t iw_stats = (iw_stats_t) (uintptr_t) args[1];
struct iwreq wrq;
int result = iw_get_ext(skfd, ifname, SIOCGIWMODE, &wrq);
if (result < 0)
return 0;
// We only cared about "Managed" mode. 2 is the magic number. There isn't a #define for this.
@@ -104,25 +104,25 @@ nsWifiMonitor::DoScan()
}
}
else {
LOG(("Loaded libiw\n"));
}
static iw_open_t iw_open = NULL;
if (!iw_open)
- iw_open = (iw_open_t) dlsym(iwlib_handle, "iw_sockets_open");
+ iw_open = (iw_open_t) (uintptr_t) dlsym(iwlib_handle, "iw_sockets_open");
static iw_enum_t iw_enum = NULL;
if (!iw_enum)
- iw_enum = (iw_enum_t) dlsym(iwlib_handle, "iw_enum_devices");
+ iw_enum = (iw_enum_t) (uintptr_t) dlsym(iwlib_handle, "iw_enum_devices");
static iw_stats_t iw_stats = NULL;
if (!iw_stats)
- iw_stats = (iw_stats_t)dlsym(iwlib_handle, "iw_get_stats");
+ iw_stats = (iw_stats_t) (uintptr_t) dlsym(iwlib_handle, "iw_get_stats");
if (!iw_open || !iw_enum || !iw_stats) {
LOG(("Could not load a symbol from iwlib.so\n"));
return NS_ERROR_FAILURE;
}
int skfd = (*iw_open)();
@@ -135,17 +135,17 @@ nsWifiMonitor::DoScan()
int skfd;
SocketsGuard(int skfd) : skfd(skfd) {}
~SocketsGuard() { iw_sockets_close(skfd); }
} guard(skfd);
nsCOMArray<nsWifiAccessPoint> lastAccessPoints;
nsCOMArray<nsWifiAccessPoint> accessPoints;
- char* args[] = {(char*) &accessPoints, (char*) iw_stats, nullptr };
+ char* args[] = {(char*) &accessPoints, (char*) (uintptr_t) iw_stats, nullptr };
while (mKeepGoing) {
accessPoints.Clear();
(*iw_enum)(skfd, &scan_wifi, args, 1);
bool accessPointsChanged = !AccessPointsEqual(accessPoints, lastAccessPoints);
ReplaceArray(lastAccessPoints, accessPoints);