Bug 1060419 - make nsCookieService.cpp use Printf.h, r?froydnj
MozReview-Commit-ID: G2ge9NFbDV6
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -2,16 +2,17 @@
/* vim: set sw=2 ts=8 et tw=80 : */
/* 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 "mozilla/Attributes.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/Likely.h"
+#include "mozilla/Printf.h"
#include "mozilla/Unused.h"
#include "mozilla/net/CookieServiceChild.h"
#include "mozilla/net/NeckoCommon.h"
#include "nsCookieService.h"
#include "nsContentUtils.h"
#include "nsIServiceManager.h"
@@ -322,20 +323,20 @@ LogSuccess(bool aSetCookie, nsIURI *aHos
LogSuccess(aSetCookie, aHostURI, aCookieString.get(), aCookie, aReplacing);
}
#ifdef DEBUG
#define NS_ASSERT_SUCCESS(res) \
PR_BEGIN_MACRO \
nsresult __rv = res; /* Do not evaluate |res| more than once! */ \
if (NS_FAILED(__rv)) { \
- char *msg = PR_smprintf("NS_ASSERT_SUCCESS(%s) failed with result 0x%X", \
- #res, __rv); \
+ char *msg = mozilla::Smprintf("NS_ASSERT_SUCCESS(%s) failed with result 0x%" PRIX32, \
+ #res, static_cast<uint32_t>(__rv)); \
NS_ASSERTION(NS_SUCCEEDED(__rv), msg); \
- PR_smprintf_free(msg); \
+ mozilla::SmprintfFree(msg); \
} \
PR_END_MACRO
#else
#define NS_ASSERT_SUCCESS(res) PR_BEGIN_MACRO /* nothing */ PR_END_MACRO
#endif
/******************************************************************************
* DBListenerErrorHandler impl: