Bug 1197307 - remove PR_snprintf calls in layout/ r=froydnj r=dholbert

This commit is contained in:
Anup Kumar 2015-12-01 12:50:47 -08:00
parent a791549970
commit 2832082b90
6 changed files with 27 additions and 34 deletions

View File

@ -31,7 +31,7 @@
#include "nsGkAtoms.h"
#include "nsGenericHTMLElement.h"
#include "nsAttrValueInlines.h"
#include "prprf.h"
#include "mozilla/Snprintf.h"
#include "nsFloatManager.h"
#include "prenv.h"
#include "plstr.h"
@ -1427,9 +1427,9 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
ListTag(stdout);
char buf[400];
PR_snprintf(buf, sizeof(buf),
": %lld elapsed (%lld per line) (%d lines; %d new lines)",
delta, perLineDelta, numLines, ectc - ctc);
snprintf_literal(buf,
": %lld elapsed (%lld per line) (%d lines; %d new lines)",
delta, perLineDelta, numLines, ectc - ctc);
printf("%s\n", buf);
}
#endif
@ -6578,10 +6578,10 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
ListTag(stdout);
char buf[400];
PR_snprintf(buf, sizeof(buf),
": %lld elapsed (%lld per line) lines=%d drawn=%d skip=%d",
delta, deltaPerLine,
numLines, drawnLines, numLines - drawnLines);
snprintf_literal(buf,
": %lld elapsed (%lld per line) lines=%d drawn=%d skip=%d",
delta, deltaPerLine,
numLines, drawnLines, numLines - drawnLines);
printf("%s\n", buf);
}
#endif

View File

@ -36,7 +36,7 @@
#include "nsStyleConsts.h"
#include "nsIPresShell.h"
#include "mozilla/Logging.h"
#include "prprf.h"
#include "mozilla/Snprintf.h"
#include "nsFrameManager.h"
#include "nsLayoutUtils.h"
#include "RestyleManager.h"
@ -5923,7 +5923,7 @@ nsFrame::MakeFrameName(const nsAString& aType, nsAString& aResult) const
aResult.Append(')');
}
char buf[40];
PR_snprintf(buf, sizeof(buf), "(%d)", ContentIndexInContainer(this));
snprintf_literal(buf, "(%d)", ContentIndexInContainer(this));
AppendASCIItoUTF16(buf, aResult);
return NS_OK;
}
@ -9154,11 +9154,11 @@ GetTagName(nsFrame* aFrame, nsIContent* aContent, int aResultSize,
char* aResult)
{
if (aContent) {
PR_snprintf(aResult, aResultSize, "%s@%p",
nsAtomCString(aContent->NodeInfo()->NameAtom()).get(), aFrame);
snprintf(aResult, aResultSize, "%s@%p",
nsAtomCString(aContent->NodeInfo()->NameAtom()).get(), aFrame);
}
else {
PR_snprintf(aResult, aResultSize, "@%p", aFrame);
snprintf(aResult, aResultSize, "@%p", aFrame);
}
}

View File

@ -17,7 +17,7 @@
#include "nsIFrameInlines.h"
#include "nsPresArena.h"
#include "nsPrintfCString.h"
#include "prprf.h"
#include "mozilla/Snprintf.h"
#ifdef DEBUG
static int32_t ctorCount;
@ -213,15 +213,15 @@ BreakTypeToString(uint8_t aBreakType)
char*
nsLineBox::StateToString(char* aBuf, int32_t aBufSize) const
{
PR_snprintf(aBuf, aBufSize, "%s,%s,%s,%s,%s,before:%s,after:%s[0x%x]",
IsBlock() ? "block" : "inline",
IsDirty() ? "dirty" : "clean",
IsPreviousMarginDirty() ? "prevmargindirty" : "prevmarginclean",
IsImpactedByFloat() ? "impacted" : "not impacted",
IsLineWrapped() ? "wrapped" : "not wrapped",
BreakTypeToString(GetBreakTypeBefore()),
BreakTypeToString(GetBreakTypeAfter()),
mAllFlags);
snprintf(aBuf, aBufSize, "%s,%s,%s,%s,%s,before:%s,after:%s[0x%x]",
IsBlock() ? "block" : "inline",
IsDirty() ? "dirty" : "clean",
IsPreviousMarginDirty() ? "prevmargindirty" : "prevmarginclean",
IsImpactedByFloat() ? "impacted" : "not impacted",
IsLineWrapped() ? "wrapped" : "not wrapped",
BreakTypeToString(GetBreakTypeBefore()),
BreakTypeToString(GetBreakTypeAfter()),
mAllFlags);
return aBuf;
}

View File

@ -30,7 +30,7 @@
#include "mozilla/LookAndFeel.h"
#include "nsCSSRendering.h"
#include "prprf.h" // For PR_snprintf()
#include "mozilla/Snprintf.h"
#include "nsDisplayList.h"
@ -314,7 +314,7 @@ nsPropertiesTable::ElementAt(gfxContext* /* aThebesContext */,
if (mCharCache != aChar) {
// The key in the property file is interpreted as ASCII and kept
// as such ...
char key[10]; PR_snprintf(key, sizeof(key), "\\u%04X", aChar);
char key[10]; snprintf_literal(key, "\\u%04X", aChar);
nsAutoString value;
nsresult rv = mGlyphProperties->GetStringProperty(nsDependentCString(key),
value);

View File

@ -7,7 +7,6 @@
#include "nsCOMPtr.h"
#include "nsPresContext.h"
#include "nsNameSpaceManager.h"
#include "prprf.h" // For PR_snprintf()
#include "nsIDocShell.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIWebBrowserChrome.h"
@ -326,9 +325,7 @@ nsMathMLmactionFrame::MouseClick()
if (mChildCount > 1) {
int32_t selection = (mSelection == mChildCount)? 1 : mSelection + 1;
nsAutoString value;
char cbuf[10];
PR_snprintf(cbuf, sizeof(cbuf), "%d", selection);
value.AssignASCII(cbuf);
value.AppendInt(selection);
bool notify = false; // don't yet notify the document
mContent->SetAttr(kNameSpaceID_None, nsGkAtoms::selection_, value, notify);

View File

@ -18,7 +18,6 @@
#include "nsTArray.h"
#include "nsTHashtable.h"
#include "nsUnicodeProperties.h"
#include "prprf.h"
namespace mozilla {
@ -210,10 +209,7 @@ GetAdditiveCounterText(CounterValue aOrdinal,
static bool
DecimalToText(CounterValue aOrdinal, nsSubstring& aResult)
{
// 3 for additional digit, negative sign, and null
char cbuf[std::numeric_limits<CounterValue>::digits10 + 3];
PR_snprintf(cbuf, sizeof(cbuf), "%ld", aOrdinal);
aResult.AssignASCII(cbuf);
aResult.AppendInt(aOrdinal);
return true;
}