Skip to content

Commit

Permalink
Bug 1060419 - make log_print use Printf.h, r=froydnj
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: BIZ1GQEZ1vs

--HG--
extra : rebase_source : 2f1f0aa12493c44f352d9a7e8683e7bb72d2d75b
  • Loading branch information
tromey committed Dec 16, 2016
1 parent 831add2 commit 5f8f360
Show file tree
Hide file tree
Showing 216 changed files with 1,550 additions and 1,236 deletions.
12 changes: 6 additions & 6 deletions dom/audiochannel/AudioChannelService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class NotifyChannelActiveRunnable final : public Runnable
: u"inactive");

MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
("NotifyChannelActiveRunnable, type = %d, active = %d\n",
mAudioChannel, mActive));
("NotifyChannelActiveRunnable, type = %" PRIu32 ", active = %d\n",
static_cast<uint32_t>(mAudioChannel), mActive));

return NS_OK;
}
Expand Down Expand Up @@ -847,8 +847,8 @@ AudioChannelService::SetAudioChannelVolume(nsPIDOMWindowOuter* aWindow,
MOZ_ASSERT(aWindow->IsOuterWindow());

MOZ_LOG(GetAudioChannelLog(), LogLevel::Debug,
("AudioChannelService, SetAudioChannelVolume, window = %p, type = %d, "
"volume = %f\n", aWindow, aAudioChannel, aVolume));
("AudioChannelService, SetAudioChannelVolume, window = %p, type = %" PRIu32 ", "
"volume = %f\n", aWindow, static_cast<uint32_t>(aAudioChannel), aVolume));

AudioChannelWindow* winData = GetOrCreateWindowData(aWindow);
winData->mChannels[(uint32_t)aAudioChannel].mVolume = aVolume;
Expand Down Expand Up @@ -908,8 +908,8 @@ AudioChannelService::SetAudioChannelMuted(nsPIDOMWindowOuter* aWindow,
MOZ_ASSERT(aWindow->IsOuterWindow());

MOZ_LOG(GetAudioChannelLog(), LogLevel::Debug,
("AudioChannelService, SetAudioChannelMuted, window = %p, type = %d, "
"mute = %d\n", aWindow, aAudioChannel, aMuted));
("AudioChannelService, SetAudioChannelMuted, window = %p, type = %" PRIu32 ", "
"mute = %d\n", aWindow, static_cast<uint32_t>(aAudioChannel), aMuted));

if (aAudioChannel == AudioChannel::System) {
// Workaround for bug1183033, system channel type can always playback.
Expand Down
8 changes: 5 additions & 3 deletions dom/base/nsObjectLoadingContent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventStates.h"
#include "mozilla/IntegerPrintfMacros.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/HTMLObjectElementBinding.h"
#include "mozilla/dom/HTMLSharedObjectElement.h"
Expand Down Expand Up @@ -812,7 +813,7 @@ nsObjectLoadingContent::InstantiatePluginInstance(bool aIsLoading)
EmptyString(), &blockState);
if (blockState == nsIBlocklistService::STATE_OUTDATED) {
// Fire plugin outdated event if necessary
LOG(("OBJLC [%p]: Dispatching plugin outdated event for content %p\n",
LOG(("OBJLC [%p]: Dispatching plugin outdated event for content\n",
this));
nsCOMPtr<nsIRunnable> ev = new nsSimplePluginEvent(thisContent,
NS_LITERAL_STRING("PluginOutdated"));
Expand Down Expand Up @@ -2424,7 +2425,8 @@ nsObjectLoadingContent::LoadObject(bool aNotify,
// If our type remains Loading, we need a channel to proceed
rv = OpenChannel();
if (NS_FAILED(rv)) {
LOG(("OBJLC [%p]: OpenChannel returned failure (%u)", this, rv));
LOG(("OBJLC [%p]: OpenChannel returned failure (%" PRIu32 ")",
this, static_cast<uint32_t>(rv)));
}
break;
case eType_Null:
Expand Down Expand Up @@ -2702,7 +2704,7 @@ nsObjectLoadingContent::NotifyStateChanged(ObjectType aOldType,
bool aSync,
bool aNotify)
{
LOG(("OBJLC [%p]: Notifying about state change: (%u, %llx) -> (%u, %llx)"
LOG(("OBJLC [%p]: Notifying about state change: (%u, %" PRIx64 ") -> (%u, %" PRIx64 ")"
" (sync %i, notify %i)", this, aOldType, aOldState.GetInternalValue(),
mType, ObjectState().GetInternalValue(), aSync, aNotify));

Expand Down
6 changes: 3 additions & 3 deletions dom/browser-element/BrowserElementAudioChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ BrowserElementAudioChannel::Create(nsPIDOMWindowInner* aWindow,
}

MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
("BrowserElementAudioChannel, Create, channel = %p, type = %d\n",
ac.get(), aAudioChannel));
("BrowserElementAudioChannel, Create, channel = %p, type = %" PRIu32 "\n",
ac.get(), static_cast<uint32_t>(aAudioChannel)));

return ac.forget();
}
Expand Down Expand Up @@ -514,7 +514,7 @@ BrowserElementAudioChannel::ProcessStateChanged(const char16_t* aData)
{
MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
("BrowserElementAudioChannel, ProcessStateChanged, this = %p, "
"type = %d\n", this, mAudioChannel));
"type = %" PRIu32 "\n", this, static_cast<uint32_t>(mAudioChannel)));

nsAutoString value(aData);
mState = value.EqualsASCII("active") ? eStateActive : eStateInactive;
Expand Down
23 changes: 12 additions & 11 deletions dom/events/IMEStateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "mozilla/MouseEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/SizePrintfMacros.h"
#include "mozilla/TextComposition.h"
#include "mozilla/TextEvents.h"
#include "mozilla/Unused.h"
Expand Down Expand Up @@ -162,7 +163,7 @@ void
IMEStateManager::Shutdown()
{
MOZ_LOG(sISMLog, LogLevel::Info,
("Shutdown(), sTextCompositions=0x%p, sTextCompositions->Length()=%u",
("Shutdown(), sTextCompositions=0x%p, sTextCompositions->Length()=%" PRIuSIZE,
sTextCompositions, sTextCompositions ? sTextCompositions->Length() : 0));

MOZ_ASSERT(!sTextCompositions || !sTextCompositions->Length());
Expand Down Expand Up @@ -264,7 +265,7 @@ IMEStateManager::OnDestroyPresContext(nsPresContext* aPresContext)
if (i != TextCompositionArray::NoIndex) {
MOZ_LOG(sISMLog, LogLevel::Debug,
(" OnDestroyPresContext(), "
"removing TextComposition instance from the array (index=%u)", i));
"removing TextComposition instance from the array (index=%" PRIuSIZE ")", i));
// there should be only one composition per presContext object.
sTextCompositions->ElementAt(i)->Destroy();
sTextCompositions->RemoveElementAt(i);
Expand Down Expand Up @@ -914,7 +915,7 @@ IMEStateManager::SetInputContextForChildProcess(
("SetInputContextForChildProcess(aTabParent=0x%p, "
"aInputContext={ mIMEState={ mEnabled=%s, mOpen=%s }, "
"mHTMLInputType=\"%s\", mHTMLInputInputmode=\"%s\", mActionHint=\"%s\" }, "
"aAction={ mCause=%s, mAction=%s }, aTabParent=0x%p), sPresContext=0x%p, "
"aAction={ mCause=%s, mAction=%s }), sPresContext=0x%p, "
"sActiveTabParent=0x%p",
aTabParent, GetIMEStateEnabledName(aInputContext.mIMEState.mEnabled),
GetIMEStateSetOpenName(aInputContext.mIMEState.mOpen),
Expand Down Expand Up @@ -1105,10 +1106,10 @@ IMEStateManager::DispatchCompositionEvent(
MOZ_LOG(sISMLog, LogLevel::Info,
("DispatchCompositionEvent(aNode=0x%p, "
"aPresContext=0x%p, aCompositionEvent={ mMessage=%s, "
"mNativeIMEContext={ mRawNativeIMEContext=0x%X, "
"mOriginProcessID=0x%X }, mWidget(0x%p)={ "
"GetNativeIMEContext()={ mRawNativeIMEContext=0x%X, "
"mOriginProcessID=0x%X }, Destroyed()=%s }, "
"mNativeIMEContext={ mRawNativeIMEContext=0x%" PRIXPTR ", "
"mOriginProcessID=0x%" PRIX64 " }, mWidget(0x%p)={ "
"GetNativeIMEContext()={ mRawNativeIMEContext=0x%" PRIXPTR ", "
"mOriginProcessID=0x%" PRIX64 " }, Destroyed()=%s }, "
"mFlags={ mIsTrusted=%s, mPropagationStopped=%s } }, "
"aIsSynthesized=%s), tabParent=%p",
aEventTargetNode, aPresContext,
Expand Down Expand Up @@ -1255,10 +1256,10 @@ IMEStateManager::OnCompositionEventDiscarded(

MOZ_LOG(sISMLog, LogLevel::Info,
("OnCompositionEventDiscarded(aCompositionEvent={ "
"mMessage=%s, mNativeIMEContext={ mRawNativeIMEContext=0x%X, "
"mOriginProcessID=0x%X }, mWidget(0x%p)={ "
"GetNativeIMEContext()={ mRawNativeIMEContext=0x%X, "
"mOriginProcessID=0x%X }, Destroyed()=%s }, "
"mMessage=%s, mNativeIMEContext={ mRawNativeIMEContext=0x%" PRIXPTR ", "
"mOriginProcessID=0x%" PRIX64 " }, mWidget(0x%p)={ "
"GetNativeIMEContext()={ mRawNativeIMEContext=0x%" PRIXPTR ", "
"mOriginProcessID=0x%" PRIX64 " }, Destroyed()=%s }, "
"mFlags={ mIsTrusted=%s } })",
ToChar(aCompositionEvent->mMessage),
aCompositionEvent->mNativeIMEContext.mRawNativeIMEContext,
Expand Down
2 changes: 1 addition & 1 deletion dom/flyweb/FlyWebPublishedServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ FlyWebPublishedServerImpl::FlyWebPublishedServerImpl(nsPIDOMWindowInner* aOwner,
void
FlyWebPublishedServerImpl::PermissionGranted(bool aGranted)
{
LOG_I("FlyWebPublishedServerImpl::PermissionGranted(%b)", aGranted);
LOG_I("FlyWebPublishedServerImpl::PermissionGranted(%d)", aGranted);
if (!aGranted) {
PublishedServerStarted(NS_ERROR_FAILURE);
return;
Expand Down
7 changes: 4 additions & 3 deletions dom/flyweb/HttpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ HttpServer::OnStopListening(nsIServerSocket* aServ,
{
MOZ_ASSERT(aServ == mServerSocket || !mServerSocket);

LOG_I("HttpServer::OnStopListening(%p) - status 0x%lx", this, aStatus);
LOG_I("HttpServer::OnStopListening(%p) - status 0x%" PRIx32,
this, static_cast<uint32_t>(aStatus));

Close();

Expand Down Expand Up @@ -1259,8 +1260,8 @@ HttpServer::Connection::OnOutputStreamReady(nsIAsyncOutputStream* aStream)
[self, this] (nsresult aStatus) {
MOZ_ASSERT(mOutputBuffers[0].mStream);
LOG_V("HttpServer::Connection::OnOutputStreamReady(%p) - "
"Sent body. Status 0x%lx",
this, aStatus);
"Sent body. Status 0x%" PRIx32,
this, static_cast<uint32_t>(aStatus));

mOutputBuffers.RemoveElementAt(0);
mOutputCopy = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions dom/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7231,12 +7231,12 @@ HTMLMediaElement::MarkAsContentSource(CallerAPI aAPI)

LOG(LogLevel::Debug,
("%p Log VIDEO_AS_CONTENT_SOURCE: visibility = %u, API: '%d' and 'All'",
this, isVisible, aAPI));
this, isVisible, static_cast<int>(aAPI)));

if (!isVisible) {
LOG(LogLevel::Debug,
("%p Log VIDEO_AS_CONTENT_SOURCE_IN_TREE_OR_NOT: inTree = %u, API: '%d' and 'All'",
this, IsInUncomposedDoc(), aAPI));
this, IsInUncomposedDoc(), static_cast<int>(aAPI)));
}
}

Expand Down
12 changes: 8 additions & 4 deletions dom/html/TextTrackManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "mozilla/dom/TextTrackCue.h"
#include "mozilla/dom/Event.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/SizePrintfMacros.h"
#include "mozilla/Telemetry.h"
#include "nsComponentManagerUtils.h"
#include "nsVariant.h"
Expand Down Expand Up @@ -158,7 +159,8 @@ TextTrackManager::AddTextTrack(TextTrackKind aKind, const nsAString& aLabel,
return nullptr;
}
WEBVTT_LOG("%p AddTextTrack",this);
WEBVTT_LOGV("AddTextTrack kind %d Label %s Language %s",aKind,
WEBVTT_LOGV("AddTextTrack kind %" PRIu32 " Label %s Language %s",
static_cast<uint32_t>(aKind),
NS_ConvertUTF16toUTF8(aLabel).get(), NS_ConvertUTF16toUTF8(aLanguage).get());
RefPtr<TextTrack> track =
mTextTracks->AddTextTrack(aKind, aLabel, aLanguage, aMode, aReadyState,
Expand Down Expand Up @@ -278,7 +280,7 @@ TextTrackManager::UpdateCueDisplay()

if (activeCues.Length() > 0) {
WEBVTT_LOG("UpdateCueDisplay ProcessCues");
WEBVTT_LOGV("UpdateCueDisplay activeCues.Length() %d",activeCues.Length());
WEBVTT_LOGV("UpdateCueDisplay activeCues.Length() %" PRIuSIZE, activeCues.Length());
RefPtr<nsVariantCC> jsCues = new nsVariantCC();

jsCues->SetAsArray(nsIDataType::VTYPE_INTERFACE,
Expand Down Expand Up @@ -407,7 +409,8 @@ TextTrackManager::PerformTrackSelection(TextTrackKind aTextTrackKinds[],
// Step 3: If any TextTracks in candidates are showing then abort these steps.
for (uint32_t i = 0; i < candidates.Length(); i++) {
if (candidates[i]->Mode() == TextTrackMode::Showing) {
WEBVTT_LOGV("PerformTrackSelection Showing return kind %d",candidates[i]->Kind());
WEBVTT_LOGV("PerformTrackSelection Showing return kind %d",
static_cast<int>(candidates[i]->Kind()));
return;
}
}
Expand All @@ -419,7 +422,8 @@ TextTrackManager::PerformTrackSelection(TextTrackKind aTextTrackKinds[],
if (TrackIsDefault(candidates[i]) &&
candidates[i]->Mode() == TextTrackMode::Disabled) {
candidates[i]->SetMode(TextTrackMode::Showing);
WEBVTT_LOGV("PerformTrackSelection set Showing kind %d", candidates[i]->Kind());
WEBVTT_LOGV("PerformTrackSelection set Showing kind %d",
static_cast<int>(candidates[i]->Kind()));
return;
}
}
Expand Down
4 changes: 2 additions & 2 deletions dom/indexedDB/ActorsParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12621,7 +12621,7 @@ ConnectionPool::ShutdownThread(ThreadInfo& aThreadInfo)
nsCOMPtr<nsIThread> thread;
aThreadInfo.mThread.swap(thread);

IDB_DEBUG_LOG(("ConnectionPool shutting down thread %lu",
IDB_DEBUG_LOG(("ConnectionPool shutting down thread %" PRIu32,
runnable->SerialNumber()));

// This should clean up the thread with the profiler.
Expand Down Expand Up @@ -12722,7 +12722,7 @@ ConnectionPool::ScheduleTransaction(TransactionInfo* aTransactionInfo,
if (NS_SUCCEEDED(rv)) {
MOZ_ASSERT(newThread);

IDB_DEBUG_LOG(("ConnectionPool created thread %lu",
IDB_DEBUG_LOG(("ConnectionPool created thread %" PRIu32,
runnable->SerialNumber()));

dbInfo->mThreadInfo.mThread.swap(newThread);
Expand Down
4 changes: 2 additions & 2 deletions dom/ipc/TabChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,8 @@ TabChild::Observe(nsISupports *aSubject,
// check it comparing the windowID.
if (window->WindowID() != windowID) {
MOZ_LOG(AudioChannelService::GetAudioChannelLog(), LogLevel::Debug,
("TabChild, Observe, different windowID, owner ID = %lld, "
"ID from wrapper = %lld", window->WindowID(), windowID));
("TabChild, Observe, different windowID, owner ID = %" PRIu64 ", "
"ID from wrapper = %" PRIu64, window->WindowID(), windowID));
return NS_OK;
}

Expand Down
16 changes: 9 additions & 7 deletions dom/media/ADTSDemuxer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "VideoUtils.h"
#include "TimeUnits.h"
#include "prenv.h"
#include "mozilla/SizePrintfMacros.h"

#ifdef PR_LOGGING
extern mozilla::LazyLogModule gMediaDemuxerLog;
Expand Down Expand Up @@ -476,8 +477,8 @@ ADTSTrackDemuxer::FastSeek(const media::TimeUnit& aTime)
mParser->EndFrameSession();

ADTSLOG("FastSeek End avgFrameLen=%f mNumParsedFrames=%" PRIu64
" mFrameIndex=%" PRId64 " mFirstFrameOffset=%llu mOffset=%" PRIu64
" SL=%llu",
" mFrameIndex=%" PRId64 " mFirstFrameOffset=%" PRIu64 " mOffset=%" PRIu64
" SL=%" PRIu64 "",
AverageFrameLength(), mNumParsedFrames, mFrameIndex,
firstFrameOffset, mOffset, StreamLength());

Expand Down Expand Up @@ -536,7 +537,7 @@ ADTSTrackDemuxer::GetSamples(int32_t aNumSamples)
frames->mSamples.AppendElement(frame);
}

ADTSLOGV("GetSamples() End mSamples.Size()=%d aNumSamples=%d mOffset=%" PRIu64
ADTSLOGV("GetSamples() End mSamples.Size()=%" PRIuSIZE " aNumSamples=%d mOffset=%" PRIu64
" mNumParsedFrames=%" PRIu64 " mFrameIndex=%" PRId64
" mTotalFrameLen=%" PRIu64
" mSamplesPerFrame=%d mSamplesPerSecond=%d "
Expand Down Expand Up @@ -692,14 +693,14 @@ ADTSTrackDemuxer::FindNextFrame(bool findFirstFrame /*= false*/)
}

if (!foundFrame || !mParser->CurrentFrame().Length()) {
ADTSLOG("FindNext() Exit foundFrame=%d mParser->CurrentFrame().Length()=%d ",
ADTSLOG("FindNext() Exit foundFrame=%d mParser->CurrentFrame().Length()=%" PRIuSIZE " ",
foundFrame, mParser->CurrentFrame().Length());
mParser->Reset();
return mParser->CurrentFrame();
}

ADTSLOGV("FindNext() End mOffset=%" PRIu64 " mNumParsedFrames=%" PRIu64
" mFrameIndex=%" PRId64 " frameHeaderOffset=%d"
" mFrameIndex=%" PRId64 " frameHeaderOffset=%" PRId64
" mTotalFrameLen=%" PRIu64 " mSamplesPerFrame=%d mSamplesPerSecond=%d"
" mChannels=%d",
mOffset, mNumParsedFrames, mFrameIndex, frameHeaderOffset,
Expand Down Expand Up @@ -730,7 +731,8 @@ ADTSTrackDemuxer::SkipNextFrame(const adts::Frame& aFrame)
already_AddRefed<MediaRawData>
ADTSTrackDemuxer::GetNextFrame(const adts::Frame& aFrame)
{
ADTSLOG("GetNext() Begin({mOffset=%" PRId64 " HeaderSize()=%d Length()=%d})",
ADTSLOG("GetNext() Begin({mOffset=%" PRId64 " HeaderSize()=%" PRIuSIZE
" Length()=%" PRIuSIZE "})",
aFrame.Offset(), aFrame.Header().HeaderSize(), aFrame.PayloadLength());
if (!aFrame.IsValid())
return nullptr;
Expand All @@ -749,7 +751,7 @@ ADTSTrackDemuxer::GetNextFrame(const adts::Frame& aFrame)

const uint32_t read = Read(frameWriter->Data(), offset, length);
if (read != length) {
ADTSLOG("GetNext() Exit read=%u frame->Size()=%u", read, frame->Size());
ADTSLOG("GetNext() Exit read=%u frame->Size()=%" PRIuSIZE, read, frame->Size());
return nullptr;
}

Expand Down
4 changes: 2 additions & 2 deletions dom/media/Latency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ void AsyncLatencyLogger::WriteLog(LatencyLogIndex aIndex, uint64_t aID, int64_t
{
if (aTimeStamp.IsNull()) {
MOZ_LOG(GetLatencyLog(), LogLevel::Debug,
("Latency: %s,%llu,%lld,%lld",
("Latency: %s,%" PRIu64 ",%" PRId64 ",%" PRId64,
LatencyLogIndex2Strings[aIndex], aID, GetTimeStamp(), aValue));
} else {
MOZ_LOG(GetLatencyLog(), LogLevel::Debug,
("Latency: %s,%llu,%lld,%lld,%lld",
("Latency: %s,%" PRIu64 ",%" PRId64 ",%" PRId64 ",%" PRId64,
LatencyLogIndex2Strings[aIndex], aID, GetTimeStamp(), aValue,
static_cast<int64_t>((aTimeStamp - gAsyncLogger->mStart).ToMilliseconds())));
}
Expand Down
Loading

0 comments on commit 5f8f360

Please sign in to comment.