From c7000dc3eeeeb54e7bff219134166367290ca600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Fri, 10 May 2013 21:19:06 +0200 Subject: [PATCH] opensound.media_addon: fixes 64 bit warnings --- .../opensound/OpenSoundDevice.cpp | 4 +-- .../opensound/OpenSoundDeviceEngine.cpp | 12 ++++++--- .../media-add-ons/opensound/OpenSoundNode.cpp | 26 ++++++++++--------- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/add-ons/media/media-add-ons/opensound/OpenSoundDevice.cpp b/src/add-ons/media/media-add-ons/opensound/OpenSoundDevice.cpp index df9fd14f2d..427d3020fc 100644 --- a/src/add-ons/media/media-add-ons/opensound/OpenSoundDevice.cpp +++ b/src/add-ons/media/media-add-ons/opensound/OpenSoundDevice.cpp @@ -364,8 +364,8 @@ status_t OpenSoundDevice::InitDriver() { CALLED(); - PRINT(("OpenSoundDevice::InitDriver: %ld engines, %ld mixers\n", - CountEngines(), CountMixers())); + PRINT(("OpenSoundDevice::InitDriver: %" B_PRId32 " engines, %" B_PRId32 + " mixers\n", CountEngines(), CountMixers())); if (CountMixers()) { ;//... diff --git a/src/add-ons/media/media-add-ons/opensound/OpenSoundDeviceEngine.cpp b/src/add-ons/media/media-add-ons/opensound/OpenSoundDeviceEngine.cpp index 4e26d27f8d..cf74f4629d 100644 --- a/src/add-ons/media/media-add-ons/opensound/OpenSoundDeviceEngine.cpp +++ b/src/add-ons/media/media-add-ons/opensound/OpenSoundDeviceEngine.cpp @@ -540,7 +540,8 @@ status_t OpenSoundDeviceEngine::AcceptFormatFor(int fmt, media_format &format, b return err; } - PRINT(("%s:step1 fmt=0x%08x, raw.format=0x%08lx\n", __FUNCTION__, fmt, raw.format)); + PRINT(("%s:step1 fmt=0x%08x, raw.format=0x%08" B_PRIx32 "\n", + __FUNCTION__, fmt, raw.format)); // if specified, try it if (raw.format) afmt = OpenSoundDevice::convert_media_format_to_oss_format(raw.format); @@ -556,7 +557,8 @@ status_t OpenSoundDeviceEngine::AcceptFormatFor(int fmt, media_format &format, b PRINT(("%s:step3 afmt=0x%08x\n", __FUNCTION__, afmt)); // convert back raw.format = OpenSoundDevice::convert_oss_format_to_media_format(afmt); - PRINT(("%s:step4 afmt=0x%08x, raw.format=0x%08lx\n", __FUNCTION__, afmt, raw.format)); + PRINT(("%s:step4 afmt=0x%08x, raw.format=0x%08" B_PRIx32 "\n", + __FUNCTION__, afmt, raw.format)); raw.valid_bits = OpenSoundDevice::convert_oss_format_to_valid_bits(afmt); err = SetFormat(afmt); @@ -634,7 +636,8 @@ status_t OpenSoundDeviceEngine::SpecializeFormatFor(int fmt, media_format &forma if (format.type == B_MEDIA_RAW_AUDIO) { media_multi_audio_format &raw = format.u.raw_audio; - PRINT(("%s:step1 fmt=0x%08x, raw.format=0x%08lx\n", __FUNCTION__, fmt, raw.format)); + PRINT(("%s:step1 fmt=0x%08x, raw.format=0x%08" B_PRIx32 "\n", + __FUNCTION__, fmt, raw.format)); // select the best as default if (!raw.format) { afmt = OpenSoundDevice::select_oss_format(fmt); @@ -651,7 +654,8 @@ status_t OpenSoundDeviceEngine::SpecializeFormatFor(int fmt, media_format &forma } // convert back raw.format = OpenSoundDevice::convert_oss_format_to_media_format(afmt); - PRINT(("%s:step4 afmt=0x%08x, raw.format=0x%08lx\n", __FUNCTION__, afmt, raw.format)); + PRINT(("%s:step4 afmt=0x%08x, raw.format=0x%08" B_PRIx32 "\n", + __FUNCTION__, afmt, raw.format)); if (!raw.valid_bits) raw.valid_bits = OpenSoundDevice::convert_oss_format_to_valid_bits(afmt); if (raw.valid_bits != OpenSoundDevice::convert_oss_format_to_valid_bits(afmt)) { diff --git a/src/add-ons/media/media-add-ons/opensound/OpenSoundNode.cpp b/src/add-ons/media/media-add-ons/opensound/OpenSoundNode.cpp index 39d747df76..8658b8b652 100644 --- a/src/add-ons/media/media-add-ons/opensound/OpenSoundNode.cpp +++ b/src/add-ons/media/media-add-ons/opensound/OpenSoundNode.cpp @@ -158,7 +158,7 @@ public: // make sure all buffers are recycled, or we might hang // when told to quit - while (BBuffer* buffer = (BBuffer*)fBuffers.RemoveItem(0L)) + while (BBuffer* buffer = (BBuffer*)fBuffers.RemoveItem((int32)0)) buffer->Recycle(); } @@ -325,7 +325,7 @@ OpenSoundNode::OpenSoundNode(BMediaAddOn* addon, const char* name, fTimeSourceStartTime(0), fWeb(NULL), - fConfig(0UL) + fConfig((uint32)0) { CALLED(); @@ -488,7 +488,7 @@ OpenSoundNode::NodeRegistered() const char *prefix = ""; if (strstr(engine->Info()->name, "SPDIF")) prefix = "S/PDIF "; - sprintf(mediaInput.name, "%sOutput %ld (%s)", prefix, + sprintf(mediaInput.name, "%sOutput %" B_PRId32 " (%s)", prefix, mediaInput.destination.id, gSupportedFormatsNames[f]); NodeInput* input = new (nothrow) NodeInput(mediaInput, i, fmt, @@ -536,7 +536,7 @@ OpenSoundNode::NodeRegistered() const char *prefix = ""; if (strstr(engine->Info()->name, "SPDIF")) prefix = "S/PDIF "; - sprintf(mediaOutput.name, "%sInput %ld (%s)", prefix, + sprintf(mediaOutput.name, "%sInput %" B_PRId32 " (%s)", prefix, mediaOutput.source.id, gSupportedFormatsNames[f]); NodeOutput* output = new (nothrow) NodeOutput(mediaOutput, @@ -1282,8 +1282,9 @@ OpenSoundNode::Disconnect(const media_source& what, channel->FreeBuffers(); } else { fprintf(stderr, "\tDisconnect() called with wrong source/destination " - "(%ld/%ld), ours is (%ld/%ld)\n", what.id, where.id, - channel->fOutput.source.id, channel->fOutput.destination.id); + "(%" B_PRId32 "/%" B_PRId32 "), ours is (%" B_PRId32 "/%" B_PRId32 + ")\n", what.id, where.id, channel->fOutput.source.id, + channel->fOutput.destination.id); } } @@ -1315,7 +1316,7 @@ OpenSoundNode::LateNoticeReceived(const media_source& what, bigtime_t how_much, fInternalLatency += how_much; SetEventLatency(fLatency + fInternalLatency); - fprintf(stderr, "\tincreasing latency to %Ld\n", + fprintf(stderr, "\tincreasing latency to %" B_PRIdBIGTIME "\n", fLatency + fInternalLatency); } else { // The other run modes dictate various strategies for sacrificing data @@ -1396,7 +1397,8 @@ OpenSoundNode::HandleEvent(const media_timed_event* event, bigtime_t lateness, HandleParameter(event,lateness,realTimeEvent); break; default: - fprintf(stderr," unknown event type: %li\n",event->type); + fprintf(stderr," unknown event type: %" B_PRId32 "\n", + event->type); break; } } @@ -1448,7 +1450,7 @@ OpenSoundNode::HandleBuffer(const media_timed_event* event, // TODO: Debug //mLateBuffers++; NotifyLateProducer(channel->fInput.source, -how_early, perf_time); - fprintf(stderr," <- LATE BUFFER : %lli\n", how_early); + fprintf(stderr," <- LATE BUFFER : %" B_PRIdBIGTIME "\n", how_early); buffer->Recycle(); } else { fDevice->Locker()->Lock(); @@ -1610,8 +1612,8 @@ OpenSoundNode::TimeSourceOp(const time_source_op_info& op, void* _reserved) break; case B_TIMESOURCE_SEEK: // TRACE("TimeSourceOp op B_TIMESOURCE_SEEK\n"); -printf("TimeSourceOp op B_TIMESOURCE_SEEK, real %lld, " - "perf %lld\n", op.real_time, op.performance_time); +printf("TimeSourceOp op B_TIMESOURCE_SEEK, real %" B_PRIdBIGTIME ", " + "perf %" B_PRIdBIGTIME "\n", op.real_time, op.performance_time); BroadcastTimeWarp(op.real_time, op.performance_time); break; default: @@ -2257,7 +2259,7 @@ OpenSoundNode::_PlayThread(NodeInput* input) TRACE("OpenSoundNode::_PlayThread: buffers: %ld\n", input->fBuffers.CountItems()); - BBuffer* buffer = (BBuffer*)input->fBuffers.RemoveItem(0L); + BBuffer* buffer = (BBuffer*)input->fBuffers.RemoveItem((int32)0); fDevice->Locker()->Unlock();