From a74d92608dde5b000f147cbd14a59b75488c5267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 26 Apr 2008 11:31:00 +0000 Subject: [PATCH] style cleanup git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25173 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/media/MediaEventLooper.cpp | 4 +- src/kits/media/MediaFiles.cpp | 6 +-- src/kits/media/MediaRoster.cpp | 2 +- src/kits/media/ParameterWeb.cpp | 57 ++++++++----------------- src/kits/media/TimedEventQueuePrivate.h | 1 + 5 files changed, 25 insertions(+), 45 deletions(-) diff --git a/src/kits/media/MediaEventLooper.cpp b/src/kits/media/MediaEventLooper.cpp index 762a665bd8..51591d96af 100644 --- a/src/kits/media/MediaEventLooper.cpp +++ b/src/kits/media/MediaEventLooper.cpp @@ -172,7 +172,7 @@ BMediaEventLooper::SetRunMode(run_mode mode) priority = (mode == B_OFFLINE) ? min_c(B_NORMAL_PRIORITY, fSetPriority) : fSetPriority; if (priority != fCurrentPriority) { fCurrentPriority = priority; - if(fControlThread > 0) { + if (fControlThread > 0) { set_thread_priority(fControlThread, fCurrentPriority); fSchedulingLatency = estimate_max_scheduling_latency(fControlThread); printf("BMediaEventLooper: SchedulingLatency is %Ld\n", fSchedulingLatency); @@ -355,7 +355,7 @@ BMediaEventLooper::SetPriority(int32 priority) fSetPriority = priority; fCurrentPriority = (RunMode() == B_OFFLINE) ? min_c(B_NORMAL_PRIORITY, fSetPriority) : fSetPriority; - if(fControlThread > 0) { + if (fControlThread > 0) { set_thread_priority(fControlThread, fCurrentPriority); fSchedulingLatency = estimate_max_scheduling_latency(fControlThread); printf("BMediaEventLooper: SchedulingLatency is %Ld\n", fSchedulingLatency); diff --git a/src/kits/media/MediaFiles.cpp b/src/kits/media/MediaFiles.cpp index b9077d8a35..86df9b03ec 100644 --- a/src/kits/media/MediaFiles.cpp +++ b/src/kits/media/MediaFiles.cpp @@ -77,7 +77,7 @@ BMediaFiles::RewindTypes() BMediaFiles::GetNextType(BString *out_type) { CALLED(); - if(m_type_index < 0 || m_type_index >= m_types.CountItems()) { + if (m_type_index < 0 || m_type_index >= m_types.CountItems()) { m_type_index = -1; return B_BAD_INDEX; } @@ -111,7 +111,7 @@ BMediaFiles::RewindRefs(const char *type) return rv; } - if(reply.count>0) { + if (reply.count>0) { char *items; area_id clone; @@ -142,7 +142,7 @@ BMediaFiles::GetNextRef(BString *out_type, entry_ref *out_ref) { CALLED(); - if(m_item_index < 0 || m_item_index >= m_items.CountItems()) { + if (m_item_index < 0 || m_item_index >= m_items.CountItems()) { m_item_index = -1; return B_BAD_INDEX; } diff --git a/src/kits/media/MediaRoster.cpp b/src/kits/media/MediaRoster.cpp index bca6b76568..bb1e8a5593 100644 --- a/src/kits/media/MediaRoster.cpp +++ b/src/kits/media/MediaRoster.cpp @@ -2858,7 +2858,7 @@ BMediaRoster::GetInstancesFor(media_addon_id addon, return rv; } - if(io_count) + if (io_count) *io_count = reply.count; if (reply.count > 0) memcpy(out_id, reply.node_id, sizeof(media_node_id) * reply.count); diff --git a/src/kits/media/ParameterWeb.cpp b/src/kits/media/ParameterWeb.cpp index 5e7461a9b0..339930f370 100644 --- a/src/kits/media/ParameterWeb.cpp +++ b/src/kits/media/ParameterWeb.cpp @@ -600,20 +600,15 @@ BParameterWeb::Unflatten(type_code code, const void *buffer, ssize_t size) } #if 0 - if(mGroups != NULL) - { - for (int32 i = 0; i < mGroups->CountItems(); i++) - { + if (mGroups != NULL) { + for (int32 i = 0; i < mGroups->CountItems(); i++) { BParameterGroup *CurrentItem = static_cast(mGroups->ItemAt(i)); - if(CurrentItem != NULL) - { + if (CurrentItem != NULL) { delete CurrentItem; } } mGroups->MakeEmpty(); - } - else - { + } else { mGroups = new BList(); } #endif @@ -930,13 +925,11 @@ BParameterGroup::FlattenedSize() const //13 guaranteed bytes, variable after that. ssize_t size = 13; - if(mFlags != 0) - { + if (mFlags != 0) { size += 4; } - if(mName != NULL) - { + if (mName != NULL) { size += min_c(strlen(mName),255); } @@ -944,22 +937,18 @@ BParameterGroup::FlattenedSize() const int limit; limit = mControls->CountItems(); - for(i = 0; i < limit; i++) - { + for (i = 0; i < limit; i++) { BParameter *CurrentParameter = static_cast(mControls->ItemAt(i)); - if(CurrentParameter != NULL) - { + if (CurrentParameter != NULL) { //overhead for each parameter flattened size += 16 + CurrentParameter->FlattenedSize(); } } limit = mGroups->CountItems(); - for(i = 0; i < limit; i++) - { + for (i = 0; i < limit; i++) { BParameterGroup *CurrentGroup = static_cast(mGroups->ItemAt(i)); - if(CurrentGroup != NULL) - { + if (CurrentGroup != NULL) { //overhead for each group flattened size += 16 + CurrentGroup->FlattenedSize(); } @@ -1107,37 +1096,27 @@ BParameterGroup::Unflatten(type_code code, const void *buffer, ssize_t size) #if 0 //Clear all existing parameters/subgroups int i; - if(mControls != NULL) - { - for(i = 0; i < mControls->CountItems(); i++) - { + if (mControls != NULL) { + for(i = 0; i < mControls->CountItems(); i++) { BParameter *CurrentItem = static_cast(mControls->ItemAt(i)); - if(CurrentItem != NULL) - { + if (CurrentItem != NULL) { delete CurrentItem; } } mControls->MakeEmpty(); - } - else - { + } else { mControls = new BList(); } - if(mGroups != NULL) - { - for(i = 0; i < mGroups->CountItems(); i++) - { + if (mGroups != NULL) { + for (i = 0; i < mGroups->CountItems(); i++) { BParameterGroup *CurrentItem = static_cast(mGroups->ItemAt(i)); - if(CurrentItem != NULL) - { + if (CurrentItem != NULL) { delete CurrentItem; } } mGroups->MakeEmpty(); - } - else - { + } else { mGroups = new BList(); } #endif diff --git a/src/kits/media/TimedEventQueuePrivate.h b/src/kits/media/TimedEventQueuePrivate.h index 53269662eb..70030101f2 100644 --- a/src/kits/media/TimedEventQueuePrivate.h +++ b/src/kits/media/TimedEventQueuePrivate.h @@ -10,6 +10,7 @@ #include #include +#include "debug.h" struct _event_queue_imp {