From d91580cd9a9f39e74f086d5ca31d997a56c111a9 Mon Sep 17 00:00:00 2001 From: beveloper Date: Sun, 31 Aug 2003 02:18:11 +0000 Subject: [PATCH] removed/fixed warnings git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4418 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/media/MediaMisc.h | 10 +++---- .../media/media-add-ons/mixer/AudioMixer.cpp | 7 ++--- .../media/media-add-ons/mixer/MixerCore.cpp | 2 +- .../media/media-add-ons/mixer/MixerInput.cpp | 21 ++++++------- .../media/media-add-ons/mixer/MixerInput.h | 30 +++++++++---------- .../media/media-add-ons/mixer/MixerOutput.cpp | 12 ++++---- .../media/media-add-ons/mixer/MixerOutput.h | 10 +++---- .../media-add-ons/mixer/MixerSettings.cpp | 3 +- .../media/media-add-ons/mixer/MixerUtils.cpp | 2 +- .../media/media-add-ons/mixer/MixerUtils.h | 2 +- src/kits/media/Buffer.cpp | 3 -- src/kits/media/BufferConsumer.cpp | 3 -- src/kits/media/BufferGroup.cpp | 3 -- src/kits/media/BufferProducer.cpp | 3 -- src/kits/media/ChannelMixer.cpp | 3 -- src/kits/media/Controllable.cpp | 5 +--- src/kits/media/DefaultMediaTheme.cpp | 8 +++-- src/kits/media/DormantNodeManager.cpp | 3 -- src/kits/media/MediaAddOn.cpp | 3 -- src/kits/media/MediaEventLooper.cpp | 3 -- src/kits/media/MediaNode.cpp | 3 -- src/kits/media/MediaRoster.cpp | 8 ++--- src/kits/media/Notifications.cpp | 3 -- src/kits/media/ParameterWeb.cpp | 19 +++++------- src/kits/media/SoundPlayNode.cpp | 2 +- src/kits/media/TimedEventQueuePrivate.cpp | 3 -- src/kits/media/TrackReader.cpp | 3 -- src/servers/media/AppManager.cpp | 3 -- src/servers/media/NodeManager.cpp | 9 +++--- src/servers/media/NotificationManager.cpp | 3 -- src/servers/media/media_server.cpp | 6 ++-- src/servers/media_addon/main.cpp | 2 +- 32 files changed, 76 insertions(+), 124 deletions(-) diff --git a/headers/private/media/MediaMisc.h b/headers/private/media/MediaMisc.h index 39a9ca888d..67af41014f 100644 --- a/headers/private/media/MediaMisc.h +++ b/headers/private/media/MediaMisc.h @@ -26,11 +26,11 @@ #define SYSTEM_TIMESOURCE_CONTROL_PORT -666 #define IS_SYSTEM_TIMESOURCE(_node) ((_node).node > 0 && (_node).port == SYSTEM_TIMESOURCE_CONTROL_PORT) -#define NODE_KIND_USER_MASK 0x00000000FFFFFFFFLL -#define NODE_KIND_COMPARE_MASK 0x000000007FFFFFFFLL -#define NODE_KIND_NO_REFCOUNTING 0x0000000080000000LL -#define NODE_KIND_SHADOW_TIMESOURCE 0x0000000100000000LL -#define NODE_KIND_SYSTEM_TIMESOURCE 0x0000000200000000LL +#define NODE_KIND_USER_MASK 0x00000000FFFFFFFFULL +#define NODE_KIND_COMPARE_MASK 0x000000007FFFFFFFULL +#define NODE_KIND_NO_REFCOUNTING 0x0000000080000000ULL +#define NODE_KIND_SHADOW_TIMESOURCE 0x0000000100000000ULL +#define NODE_KIND_SYSTEM_TIMESOURCE 0x0000000200000000ULL #define ROUND_UP_TO_PAGE(size) (((size) + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1)) diff --git a/src/add-ons/media/media-add-ons/mixer/AudioMixer.cpp b/src/add-ons/media/media-add-ons/mixer/AudioMixer.cpp index 87ef7e1548..1a58aa057f 100644 --- a/src/add-ons/media/media-add-ons/mixer/AudioMixer.cpp +++ b/src/add-ons/media/media-add-ons/mixer/AudioMixer.cpp @@ -615,7 +615,7 @@ AudioMixer::LatencyChanged(const media_source & source, const media_destination MixerInput *input; for (int i = 0; (input = fCore->Input(i)) != 0; i++) { - TRACE("AudioMixer: SendLatencyChange from %d/%d to %d/%d event latency is now %Ld\n", + TRACE("AudioMixer: SendLatencyChange from %ld/%ld to %ld/%ld event latency is now %Ld\n", input->MediaInput().source.port, input->MediaInput().source.id, input->MediaInput().destination.port, input->MediaInput().destination.id, EventLatency()); @@ -1066,7 +1066,7 @@ status_t AudioMixer::GetParameterValue(int32 id, bigtime_t *last_change, void *value, size_t *ioSize) { - TRACE("GetParameterValue: id 0x%08x, ioSize %ld\n", id, *ioSize); + TRACE("GetParameterValue: id 0x%08lx, ioSize %ld\n", id, *ioSize); int param = PARAM(id); fCore->Lock(); if (PARAM_IS_ETC(id)) { @@ -1253,7 +1253,7 @@ void AudioMixer::SetParameterValue(int32 id, bigtime_t when, const void *value, size_t size) { - TRACE("SetParameterValue: id 0x%08x, size %ld\n", id, size); + TRACE("SetParameterValue: id 0x%08lx, size %ld\n", id, size); bool update = false; int param = PARAM(id); fCore->Lock(); @@ -1498,7 +1498,6 @@ AudioMixer::UpdateParameterWeb() BParameterGroup *group; BParameterGroup *subgroup; BParameterGroup *subsubgroup; - BParameterGroup *subsubsubgroup; BDiscreteParameter *dp; MixerInput *in; MixerOutput *out; diff --git a/src/add-ons/media/media-add-ons/mixer/MixerCore.cpp b/src/add-ons/media/media-add-ons/mixer/MixerCore.cpp index 45f74cea38..f7b76a8f25 100644 --- a/src/add-ons/media/media-add-ons/mixer/MixerCore.cpp +++ b/src/add-ons/media/media-add-ons/mixer/MixerCore.cpp @@ -47,8 +47,8 @@ MixerCore::MixerCore(AudioMixer *node) fMixBuffer(0), fMixBufferFrameRate(0), fMixBufferFrameCount(0), - fMixBufferChannelTypes(0), fMixBufferChannelCount(0), + fMixBufferChannelTypes(0), fDoubleRateMixing(DOUBLE_RATE_MIXING), fDownstreamLatency(1), fSettings(new MixerSettings), diff --git a/src/add-ons/media/media-add-ons/mixer/MixerInput.cpp b/src/add-ons/media/media-add-ons/mixer/MixerInput.cpp index b73e96ca20..e99922c9b9 100644 --- a/src/add-ons/media/media-add-ons/mixer/MixerInput.cpp +++ b/src/add-ons/media/media-add-ons/mixer/MixerInput.cpp @@ -106,7 +106,7 @@ MixerInput::BufferReceived(BBuffer *buffer) if (fInputByteSwap) fInputByteSwap->Swap(data, size); - int32 offset = frames_for_duration(fMixBufferFrameRate, start) % fMixBufferFrameCount; + int offset = frames_for_duration(fMixBufferFrameRate, start) % fMixBufferFrameCount; PRINT(4, "MixerInput::BufferReceived: buffer start %10Ld, offset %6d\n", start, offset); @@ -183,7 +183,7 @@ MixerInput::ID() return fInput.destination.id; } -uint32 +int MixerInput::GetInputChannelCount() { return fInputChannelCount; @@ -327,7 +327,7 @@ MixerInput::UpdateInputChannelDestinationMask() } for (int i = 0; i < fInputChannelCount; i++) - TRACE("UpdateInputChannelDestinationMask: input channel %d, destination_mask 0x%08X, base %p, gain %.3f\n", i, fInputChannelInfo[i].destination_mask, fInputChannelInfo[i].buffer_base, fInputChannelInfo[i].gain); + TRACE("UpdateInputChannelDestinationMask: input channel %d, destination_mask 0x%08lX, base %p, gain %.3f\n", i, fInputChannelInfo[i].destination_mask, fInputChannelInfo[i].buffer_base, fInputChannelInfo[i].gain); TRACE("UpdateInputChannelDestinationMask: leave\n"); } @@ -335,24 +335,24 @@ MixerInput::UpdateInputChannelDestinationMask() void MixerInput::UpdateInputChannelDestinations() { - uint32 channel_count; + int channel_count; uint32 all_bits; uint32 mask; TRACE("UpdateInputChannelDestinations: enter\n"); for (int i = 0; i < fInputChannelCount; i++) - TRACE("UpdateInputChannelDestinations: input channel %d, destination_mask 0x%08X, base %p, gain %.3f\n", i, fInputChannelInfo[i].destination_mask, fInputChannelInfo[i].buffer_base, fInputChannelInfo[i].gain); + TRACE("UpdateInputChannelDestinations: input channel %d, destination_mask 0x%08lX, base %p, gain %.3f\n", i, fInputChannelInfo[i].destination_mask, fInputChannelInfo[i].buffer_base, fInputChannelInfo[i].gain); all_bits = 0; for (int i = 0; i < fInputChannelCount; i++) all_bits |= fInputChannelInfo[i].destination_mask; - TRACE("UpdateInputChannelDestinations: all_bits = %08x\n", all_bits); + TRACE("UpdateInputChannelDestinations: all_bits = %08lx\n", all_bits); channel_count = count_nonzero_bits(all_bits); - TRACE("UpdateInputChannelDestinations: %ld input channels, %ld mixer channels (%ld old)\n", fInputChannelCount, channel_count, fMixerChannelCount); + TRACE("UpdateInputChannelDestinations: %d input channels, %d mixer channels (%d old)\n", fInputChannelCount, channel_count, fMixerChannelCount); if (channel_count != fMixerChannelCount) { delete [] fMixerChannelInfo; @@ -362,7 +362,8 @@ MixerInput::UpdateInputChannelDestinations() // assign each mixer channel one type // and the gain from the fChannelTypeGain[] - for (int i = 0, mask = 1; i < fMixerChannelCount; i++) { + mask = 1; + for (int i = 0; i < fMixerChannelCount; i++) { while (mask != 0 && (all_bits & mask) == 0) mask <<= 1; fMixerChannelInfo[i].destination_type = ChannelMaskToChannelType(mask); @@ -371,7 +372,7 @@ MixerInput::UpdateInputChannelDestinations() } // assign buffer_base pointer for each mixer channel - for (int i = 0; i < fMixerChannelCount; i++) { + for (int i = 0; i < fMixerChannelCount; i++) { int j; for (j = 0; j < fInputChannelCount; j++) { if (fInputChannelInfo[j].destination_mask & ChannelTypeToChannelMask(fMixerChannelInfo[i].destination_type)) { @@ -502,7 +503,7 @@ MixerInput::SetMixBufferFormat(int32 framerate, int32 frames) TRACE(" inputBufferLength %10Ld\n", inputBufferLength); TRACE(" outputBufferLength %10Ld\n", outputBufferLength); TRACE(" mixerBufferLength %10Ld\n", mixerBufferLength); - TRACE(" fMixBufferFrameCount %10ld\n", fMixBufferFrameCount); + TRACE(" fMixBufferFrameCount %10d\n", fMixBufferFrameCount); ASSERT((fMixBufferFrameCount % frames) == 0); diff --git a/src/add-ons/media/media-add-ons/mixer/MixerInput.h b/src/add-ons/media/media-add-ons/mixer/MixerInput.h index dfbc640c38..bc1e5e6397 100644 --- a/src/add-ons/media/media-add-ons/mixer/MixerInput.h +++ b/src/add-ons/media/media-add-ons/mixer/MixerInput.h @@ -15,14 +15,14 @@ public: MixerInput(MixerCore *core, const media_input &input, float mixFrameRate, int32 mixFrameCount); ~MixerInput(); - int32 ID(); + int32 ID(); - void BufferReceived(BBuffer *buffer); + void BufferReceived(BBuffer *buffer); media_input & MediaInput(); // The physical input channels - uint32 GetInputChannelCount(); + int GetInputChannelCount(); int GetInputChannelType(int channel); void SetInputChannelGain(int channel, float gain); float GetInputChannelGain(int channel); @@ -36,16 +36,16 @@ public: int GetInputChannelForDestination(int destination_type); // returns -1 if not found // The virtual mixer channels that are generated from destinations - uint32 GetMixerChannelCount(); + int GetMixerChannelCount(); void SetMixerChannelGain(int mixer_channel, float gain); float GetMixerChannelGain(int mixer_channel); int GetMixerChannelType(int mixer_channel); - void SetEnabled(bool yesno); - bool IsEnabled(); + void SetEnabled(bool yesno); + bool IsEnabled(); // only for use by MixerCore - bool GetMixerChannelInfo(int mixer_channel, int64 framepos, bigtime_t time, const float **buffer, uint32 *sample_offset, int *type, float *gain); + bool GetMixerChannelInfo(int mixer_channel, int64 framepos, bigtime_t time, const float **buffer, uint32 *sample_offset, int *type, float *gain); protected: friend class MixerCore; @@ -57,12 +57,12 @@ private: private: struct input_chan_info { - float *buffer_base; - uint32 destination_mask; // multiple or no bits sets - float gain; + float *buffer_base; + uint32 destination_mask; // multiple or no bits sets + float gain; }; struct mixer_chan_info { - float *buffer_base; + float *buffer_base; int destination_type; float destination_gain; }; @@ -77,16 +77,16 @@ private: bool fEnabled; input_chan_info *fInputChannelInfo; // array - uint32 fInputChannelCount; + int fInputChannelCount; uint32 fInputChannelMask; mixer_chan_info *fMixerChannelInfo; // array - uint32 fMixerChannelCount; + int fMixerChannelCount; float *fMixBuffer; int32 fMixBufferFrameRate; - uint32 fMixBufferFrameCount; + int fMixBufferFrameCount; bigtime_t fLastDataAvailableTime; @@ -98,7 +98,7 @@ private: int32 debugMixBufferFrames; }; -inline uint32 +inline int MixerInput::GetMixerChannelCount() { return fMixerChannelCount; diff --git a/src/add-ons/media/media-add-ons/mixer/MixerOutput.cpp b/src/add-ons/media/media-add-ons/mixer/MixerOutput.cpp index f2749bd150..119ee1c2d0 100644 --- a/src/add-ons/media/media-add-ons/mixer/MixerOutput.cpp +++ b/src/add-ons/media/media-add-ons/mixer/MixerOutput.cpp @@ -65,7 +65,7 @@ void MixerOutput::UpdateOutputChannels() { output_chan_info *oldInfo = fOutputChannelInfo; - uint32 oldCount = fOutputChannelCount; + int oldCount = fOutputChannelCount; fOutputChannelCount = fOutput.format.u.raw_audio.channel_count; fOutputChannelInfo = new output_chan_info[fOutputChannelCount]; @@ -87,11 +87,11 @@ MixerOutput::UpdateOutputChannels() for (int i = 0; i < fOutputChannelCount; i++) { for (int j = 0; j < oldCount; j++) { if (fOutputChannelInfo[i].channel_type == oldInfo[j].channel_type) { - fOutputChannelInfo[i].channel_gain == oldInfo[j].channel_gain; - fOutputChannelInfo[i].source_count == oldInfo[j].source_count; + fOutputChannelInfo[i].channel_gain = oldInfo[j].channel_gain; + fOutputChannelInfo[i].source_count = oldInfo[j].source_count; for (int k = 0; k < fOutputChannelInfo[i].source_count; k++) { - fOutputChannelInfo[i].source_gain[k] == oldInfo[j].source_gain[k]; - fOutputChannelInfo[i].source_type[k] == oldInfo[j].source_type[k]; + fOutputChannelInfo[i].source_gain[k] = oldInfo[j].source_gain[k]; + fOutputChannelInfo[i].source_type[k] = oldInfo[j].source_type[k]; } // also copy the old gain cache for (int k = 0; k < MAX_CHANNEL_TYPES; k++) @@ -111,7 +111,7 @@ void MixerOutput::AssignDefaultSources() { uint32 mask = fOutput.format.u.raw_audio.channel_mask; - uint32 count = fOutputChannelCount; + int count = fOutputChannelCount; // assign default sources for a few known setups, // everything else is left unchanged (it already is 1:1) diff --git a/src/add-ons/media/media-add-ons/mixer/MixerOutput.h b/src/add-ons/media/media-add-ons/mixer/MixerOutput.h index 8fa2889ba4..01043bf212 100644 --- a/src/add-ons/media/media-add-ons/mixer/MixerOutput.h +++ b/src/add-ons/media/media-add-ons/mixer/MixerOutput.h @@ -28,7 +28,7 @@ public: void ChangeFormat(const media_multi_audio_format &format); // The physical output channels - uint32 GetOutputChannelCount(); + int GetOutputChannelCount(); int GetOutputChannelType(int channel); void SetOutputChannelGain(int channel, float gain); float GetOutputChannelGain(int channel); @@ -47,7 +47,7 @@ public: // Only for use by MixerCore: // For iteration of a channel's sources - uint32 GetOutputChannelSourceCount(int channel); + int GetOutputChannelSourceCount(int channel); void GetOutputChannelSourceInfoAt(int channel, int source_index, int *source_type, float *source_gain); // To swap byteorder in a buffer is that is needed @@ -79,14 +79,14 @@ private: MixerCore *fCore; media_output fOutput; - uint32 fOutputChannelCount; + int fOutputChannelCount; output_chan_info *fOutputChannelInfo; //array ByteSwap *fOutputByteSwap; bool fMuted; }; -inline uint32 MixerOutput::GetOutputChannelCount() +inline int MixerOutput::GetOutputChannelCount() { return fOutputChannelCount; } @@ -98,7 +98,7 @@ inline float MixerOutput::GetOutputChannelGain(int channel) return fOutputChannelInfo[channel].channel_gain; } -inline uint32 MixerOutput::GetOutputChannelSourceCount(int channel) +inline int MixerOutput::GetOutputChannelSourceCount(int channel) { ASSERT(channel >= 0 && channel < fOutputChannelCount); return fOutputChannelInfo[channel].source_count; diff --git a/src/add-ons/media/media-add-ons/mixer/MixerSettings.cpp b/src/add-ons/media/media-add-ons/mixer/MixerSettings.cpp index 75c996d840..ea5bd22fb8 100644 --- a/src/add-ons/media/media-add-ons/mixer/MixerSettings.cpp +++ b/src/add-ons/media/media-add-ons/mixer/MixerSettings.cpp @@ -13,7 +13,7 @@ #define SAVE_DELAY 5000000 // delay saving of settings for 5s #define SAVE_RUNTIME 30000000 // stop save thread after 30s inactivity -#define SETTINGS_VERSION 0x94251601 +#define SETTINGS_VERSION ((int32)0x94251601) MixerSettings::MixerSettings() : fLocker(new BLocker), @@ -360,7 +360,6 @@ MixerSettings::Save() for (int i = 0; i < MAX_INPUT_SETTINGS; i++) msg.AddMessage("input", &fInputSetting[i]); - size_t size; char *buffer; size_t length; diff --git a/src/add-ons/media/media-add-ons/mixer/MixerUtils.cpp b/src/add-ons/media/media-add-ons/mixer/MixerUtils.cpp index d145c61fde..75a1ade16c 100644 --- a/src/add-ons/media/media-add-ons/mixer/MixerUtils.cpp +++ b/src/add-ons/media/media-add-ons/mixer/MixerUtils.cpp @@ -43,7 +43,7 @@ StringForChannelMask(char *str, uint32 mask) DECODE(B_CHANNEL_MONO, "Mono"); #undef DECODE if (mask) - sprintf(str + strlen(str), "0x%08X", mask); + sprintf(str + strlen(str), "0x%08lX", mask); return str; } diff --git a/src/add-ons/media/media-add-ons/mixer/MixerUtils.h b/src/add-ons/media/media-add-ons/mixer/MixerUtils.h index 8503f2840e..23f7c41884 100644 --- a/src/add-ons/media/media-add-ons/mixer/MixerUtils.h +++ b/src/add-ons/media/media-add-ons/mixer/MixerUtils.h @@ -2,7 +2,7 @@ #define _MIXER_UTILS_H #if DEBUG > 0 - #define PRINT_CHANNEL_MASK(fmt) do { char s[200]; StringForChannelMask(s, (fmt).u.raw_audio.channel_mask); printf(" channel_mask 0x%08X %s\n", (fmt).u.raw_audio.channel_mask, s); } while (0) + #define PRINT_CHANNEL_MASK(fmt) do { char s[200]; StringForChannelMask(s, (fmt).u.raw_audio.channel_mask); printf(" channel_mask 0x%08lX %s\n", (fmt).u.raw_audio.channel_mask, s); } while (0) #else #define PRINT_CHANNEL_MASK(fmt) ((void)0) #endif diff --git a/src/kits/media/Buffer.cpp b/src/kits/media/Buffer.cpp index eb89a24653..6805dca1bc 100644 --- a/src/kits/media/Buffer.cpp +++ b/src/kits/media/Buffer.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include "SharedBufferList.h" diff --git a/src/kits/media/BufferConsumer.cpp b/src/kits/media/BufferConsumer.cpp index 1a1bc16c97..5945553577 100644 --- a/src/kits/media/BufferConsumer.cpp +++ b/src/kits/media/BufferConsumer.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include diff --git a/src/kits/media/BufferGroup.cpp b/src/kits/media/BufferGroup.cpp index 5ad256a855..9770262608 100644 --- a/src/kits/media/BufferGroup.cpp +++ b/src/kits/media/BufferGroup.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include "debug.h" diff --git a/src/kits/media/BufferProducer.cpp b/src/kits/media/BufferProducer.cpp index d2a2a4982e..430b05db6b 100644 --- a/src/kits/media/BufferProducer.cpp +++ b/src/kits/media/BufferProducer.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include diff --git a/src/kits/media/ChannelMixer.cpp b/src/kits/media/ChannelMixer.cpp index 262f041b45..7ccd4046c1 100644 --- a/src/kits/media/ChannelMixer.cpp +++ b/src/kits/media/ChannelMixer.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - /* Converts mono into stereo, stereo into mono * (multiple channel support should be added in the future) */ diff --git a/src/kits/media/Controllable.cpp b/src/kits/media/Controllable.cpp index 715a43a759..c8f6a21c1e 100644 --- a/src/kits/media/Controllable.cpp +++ b/src/kits/media/Controllable.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include @@ -214,7 +211,7 @@ BControllable::HandleMessage(int32 message, const void *data, size_t size) if (rv != B_OK) { ERROR("BControllable::HandleMessage CONTROLLABLE_GET_PARAMETER_WEB Flatten failed\n"); } else { - printf("BControllable::HandleMessage CONTROLLABLE_GET_PARAMETER_WEB %ld bytes, 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", + printf("BControllable::HandleMessage CONTROLLABLE_GET_PARAMETER_WEB %ld bytes, 0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx\n", reply.size, ((uint32*)buffer)[0], ((uint32*)buffer)[1], ((uint32*)buffer)[2], ((uint32*)buffer)[3]); } delete_area(area); diff --git a/src/kits/media/DefaultMediaTheme.cpp b/src/kits/media/DefaultMediaTheme.cpp index c6255b8831..0105fd7e6a 100644 --- a/src/kits/media/DefaultMediaTheme.cpp +++ b/src/kits/media/DefaultMediaTheme.cpp @@ -251,9 +251,11 @@ MessageFilter::FilterFor(BView *view, BParameter ¶meter) case BParameter::B_DISCRETE_PARAMETER: return new DiscreteMessageFilter(control, static_cast(parameter)); + + case BParameter::B_NULL_PARAMETER: /* fall through */ + default: + return NULL; } - - return NULL; } @@ -519,7 +521,7 @@ DefaultMediaTheme::MakeViewFor(BParameterGroup &group, const BRect &hintRect) rect.right = rect.left + 50; rect.bottom = rect.top + 10; - float lastHeight; + float lastHeight = 0; for (int32 i = 0; i < group.CountGroups(); i++) { BParameterGroup *subGroup = group.GroupAt(i); diff --git a/src/kits/media/DormantNodeManager.cpp b/src/kits/media/DormantNodeManager.cpp index 74adbd3ea2..9b4c1133bf 100644 --- a/src/kits/media/DormantNodeManager.cpp +++ b/src/kits/media/DormantNodeManager.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - /* This is a management class for dormant media nodes. * It is private to the media kit and only accessed by the BMediaRoster class * and the media_addon_server. diff --git a/src/kits/media/MediaAddOn.cpp b/src/kits/media/MediaAddOn.cpp index e69cd1f7d2..2c71b1861b 100644 --- a/src/kits/media/MediaAddOn.cpp +++ b/src/kits/media/MediaAddOn.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include diff --git a/src/kits/media/MediaEventLooper.cpp b/src/kits/media/MediaEventLooper.cpp index 6ca2c2f853..dd7f501859 100644 --- a/src/kits/media/MediaEventLooper.cpp +++ b/src/kits/media/MediaEventLooper.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include diff --git a/src/kits/media/MediaNode.cpp b/src/kits/media/MediaNode.cpp index 7c4bd75af9..c6b1a0367b 100644 --- a/src/kits/media/MediaNode.cpp +++ b/src/kits/media/MediaNode.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include diff --git a/src/kits/media/MediaRoster.cpp b/src/kits/media/MediaRoster.cpp index 72af3dc64d..1ac1524ca3 100644 --- a/src/kits/media/MediaRoster.cpp +++ b/src/kits/media/MediaRoster.cpp @@ -28,7 +28,7 @@ */ /* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; +char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; #include #include @@ -1885,7 +1885,7 @@ BMediaRoster::GetParameterWebFor(const media_node & node, // we got a flattened parameter web! *out_web = new BParameterWeb(); - printf("BMediaRoster::GetParameterWebFor Unflattening %ld bytes, 0x%08x, 0x%08x, 0x%08x, 0x%08x\n", + printf("BMediaRoster::GetParameterWebFor Unflattening %ld bytes, 0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx\n", reply.size, ((uint32*)data)[0], ((uint32*)data)[1], ((uint32*)data)[2], ((uint32*)data)[3]); rv = (*out_web)->Unflatten(reply.code, data, reply.size); @@ -2124,7 +2124,7 @@ BMediaRoster::InstantiateDormantNode(const dormant_node_info & in_info, return B_BAD_VALUE; } - printf("BMediaRoster::InstantiateDormantNode: addon-id %ld, flavor_id %ld, flags 0x%X\n", in_info.addon, in_info.flavor_id, flags); + printf("BMediaRoster::InstantiateDormantNode: addon-id %ld, flavor_id %ld, flags 0x%lX\n", in_info.addon, in_info.flavor_id, flags); // Get flavor_info from the server // XXX this is a little overhead, as we get the full blown dormant_flavor_info, @@ -2139,7 +2139,7 @@ BMediaRoster::InstantiateDormantNode(const dormant_node_info & in_info, ASSERT(node_info.internal_id == in_info.flavor_id); - printf("BMediaRoster::InstantiateDormantNode: name \"%s\", info \"%s\", flavor_flags 0x%X, internal_id %ld, possible_count %ld\n", + printf("BMediaRoster::InstantiateDormantNode: name \"%s\", info \"%s\", flavor_flags 0x%lX, internal_id %ld, possible_count %ld\n", node_info.name, node_info.info, node_info.flavor_flags, node_info.internal_id, node_info.possible_count); #if DEBUG diff --git a/src/kits/media/Notifications.cpp b/src/kits/media/Notifications.cpp index 35b60c0df4..693d74908e 100644 --- a/src/kits/media/Notifications.cpp +++ b/src/kits/media/Notifications.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - /* This is a interface class for media kit notifications. * It is private to the media kit which uses it to pass * notifications up to the media_server which will broadcast diff --git a/src/kits/media/ParameterWeb.cpp b/src/kits/media/ParameterWeb.cpp index 7518bbea78..c141f2f7af 100644 --- a/src/kits/media/ParameterWeb.cpp +++ b/src/kits/media/ParameterWeb.cpp @@ -136,11 +136,11 @@ const char * const B_SIMPLE_TRANSPORT = "SimpleTransport"; // Flattened data -static const int32 kParameterWebMagic = 0x01030506; static const int32 kCurrentParameterWebVersion = 1; -static const int32 kBufferGroupMagic = 0x03040509; -static const int32 kBufferGroupMagicNoFlags = 0x03040507; -static const int32 kParameterMagic = 0x02040607; +static const uint32 kParameterWebMagic = 0x01030506; +static const uint32 kBufferGroupMagic = 0x03040509; +static const uint32 kBufferGroupMagicNoFlags = 0x03040507; +static const uint32 kParameterMagic = 0x02040607; static const ssize_t kAdditionalParameterGroupSize = 12; static const ssize_t kAdditionalParameterSize = 35; @@ -581,7 +581,7 @@ BParameterWeb::Unflatten(type_code code, const void *buffer, ssize_t size) const void *bufferStart = buffer; - int32 magic = read_from_buffer(&buffer); + uint32 magic = read_from_buffer(&buffer); bool isSwapped = false; if (magic == B_SWAP_INT32(kParameterWebMagic)) { @@ -964,9 +964,6 @@ BParameterGroup::Flatten(void *buffer, ssize_t size) const return B_NO_INIT; } - void *bufferStart = buffer; - // used to compute the rest length of the buffer when needed - // NOTICE: It is important that this value is the size returned by // BParameterGroup::FlattenedSize, not by a descendent's override of this method. ssize_t actualSize = BParameterGroup::FlattenedSize(); @@ -1071,7 +1068,7 @@ BParameterGroup::Unflatten(type_code code, const void *buffer, ssize_t size) const void *bufferStart = buffer; // used to compute the rest length of the buffer when needed - int32 magic = read_from_buffer(&buffer); + uint32 magic = read_from_buffer(&buffer); bool isSwapped = false; if (magic == B_SWAP_INT32(kBufferGroupMagic) @@ -1701,7 +1698,7 @@ BParameter::Unflatten(type_code code, const void *buffer, ssize_t size) // check magic - int32 magic = read_from_buffer(&buffer); + uint32 magic = read_from_buffer(&buffer); if (magic == B_SWAP_INT32(kParameterMagic)) mSwapDetected = true; else if (magic == kParameterMagic) @@ -2294,7 +2291,7 @@ BDiscreteParameter::Unflatten(type_code code, const void *buffer, ssize_t size) if (read_string_from_buffer(&buffer, &name, size_left(size, bufferStart, buffer)) < B_OK) return B_BAD_DATA; - if (size_left(size, bufferStart, buffer) < sizeof(int32)) + if (size_left(size, bufferStart, buffer) < (int)sizeof(int32)) return B_BAD_DATA; int32 value = read_from_buffer_swap32(&buffer, SwapOnUnflatten()); diff --git a/src/kits/media/SoundPlayNode.cpp b/src/kits/media/SoundPlayNode.cpp index 376bbef10a..1a7279548c 100644 --- a/src/kits/media/SoundPlayNode.cpp +++ b/src/kits/media/SoundPlayNode.cpp @@ -626,7 +626,7 @@ _SoundPlayNode::HandleDataStatus( bigtime_t lateness, bool realTimeEvent = false) { - TRACE("_SoundPlayNode::HandleDataStatus status:%li, lateness:%li\n", event->data, lateness); + TRACE("_SoundPlayNode::HandleDataStatus status: %li, lateness: %Li\n", event->data, lateness); switch(event->data) { case B_DATA_NOT_AVAILABLE: break; diff --git a/src/kits/media/TimedEventQueuePrivate.cpp b/src/kits/media/TimedEventQueuePrivate.cpp index 38b332a48f..31f37379a1 100644 --- a/src/kits/media/TimedEventQueuePrivate.cpp +++ b/src/kits/media/TimedEventQueuePrivate.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - /* Implements _event_queue_imp used by BTimedEventQueue, not thread save! */ #include diff --git a/src/kits/media/TrackReader.cpp b/src/kits/media/TrackReader.cpp index 1cd86822a5..a0175c8ae1 100644 --- a/src/kits/media/TrackReader.cpp +++ b/src/kits/media/TrackReader.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - /* * The undocumented BTrackReader class, * used by BSound and the GameSound classes diff --git a/src/servers/media/AppManager.cpp b/src/servers/media/AppManager.cpp index 491c03ef64..019ade8dce 100644 --- a/src/servers/media/AppManager.cpp +++ b/src/servers/media/AppManager.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include diff --git a/src/servers/media/NodeManager.cpp b/src/servers/media/NodeManager.cpp index 24eb4f74d4..7cc47ca535 100644 --- a/src/servers/media/NodeManager.cpp +++ b/src/servers/media/NodeManager.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include @@ -189,7 +186,9 @@ NodeManager::DecrementGlobalRefCount(media_node_id nodeid, team_id team) } } *count -= 1; - int32 debug_count = *count; + #if DEBUG >= 2 + int32 debug_count = *count; + #endif if (*count == 0) { b = rn->teamrefcount.Remove(team); ASSERT(b); @@ -469,7 +468,7 @@ NodeManager::GetLiveNodes(Stack *livenodes, int32 maxcount, cons registered_node *rn; int namelen; - TRACE("NodeManager::GetLiveNodes: maxcount %d, in-format %p, out-format %p, name %s, require_kinds 0x%x\n", + TRACE("NodeManager::GetLiveNodes: maxcount %ld, in-format %p, out-format %p, name %s, require_kinds 0x%Lx\n", maxcount, inputformat, outputformat, (name ? name : "NULL"), require_kinds); // determine the count of byte to compare when checking for a name with(out) wildcard diff --git a/src/servers/media/NotificationManager.cpp b/src/servers/media/NotificationManager.cpp index a30b8ac34c..e9157d5255 100644 --- a/src/servers/media/NotificationManager.cpp +++ b/src/servers/media/NotificationManager.cpp @@ -27,9 +27,6 @@ * */ -/* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; - #include #include #include diff --git a/src/servers/media/media_server.cpp b/src/servers/media/media_server.cpp index 192fa38410..33f285904b 100644 --- a/src/servers/media/media_server.cpp +++ b/src/servers/media/media_server.cpp @@ -28,7 +28,7 @@ */ /* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; +char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; #include #include @@ -576,7 +576,7 @@ ServerApp::controlthread(void *arg) void ServerApp::MessageReceived(BMessage *msg) { - TRACE("ServerApp::MessageReceived %x enter\n", msg->what); + TRACE("ServerApp::MessageReceived %lx enter\n", msg->what); switch (msg->what) { case MEDIA_SERVER_REQUEST_NOTIFICATIONS: gNotificationManager->EnqueueMessage(msg); break; case MEDIA_SERVER_CANCEL_NOTIFICATIONS: gNotificationManager->EnqueueMessage(msg); break; @@ -585,7 +585,7 @@ void ServerApp::MessageReceived(BMessage *msg) printf("\nnew media server: unknown message received\n"); msg->PrintToStream(); } - TRACE("ServerApp::MessageReceived %x leave\n", msg->what); + TRACE("ServerApp::MessageReceived %lx leave\n", msg->what); } int main() diff --git a/src/servers/media_addon/main.cpp b/src/servers/media_addon/main.cpp index 0d733504b5..6c7878e3c9 100644 --- a/src/servers/media_addon/main.cpp +++ b/src/servers/media_addon/main.cpp @@ -28,7 +28,7 @@ */ /* to comply with the license above, do not remove the following line */ -static char __copyright[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; +char __dont_remove_copyright_from_binary[] = "Copyright (c) 2002, 2003 Marcus Overhagen "; #define BUILDING_MEDIA_ADDON 1 #include