style cleanup
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25173 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -172,7 +172,7 @@ BMediaEventLooper::SetRunMode(run_mode mode)
|
|||||||
priority = (mode == B_OFFLINE) ? min_c(B_NORMAL_PRIORITY, fSetPriority) : fSetPriority;
|
priority = (mode == B_OFFLINE) ? min_c(B_NORMAL_PRIORITY, fSetPriority) : fSetPriority;
|
||||||
if (priority != fCurrentPriority) {
|
if (priority != fCurrentPriority) {
|
||||||
fCurrentPriority = priority;
|
fCurrentPriority = priority;
|
||||||
if(fControlThread > 0) {
|
if (fControlThread > 0) {
|
||||||
set_thread_priority(fControlThread, fCurrentPriority);
|
set_thread_priority(fControlThread, fCurrentPriority);
|
||||||
fSchedulingLatency = estimate_max_scheduling_latency(fControlThread);
|
fSchedulingLatency = estimate_max_scheduling_latency(fControlThread);
|
||||||
printf("BMediaEventLooper: SchedulingLatency is %Ld\n", fSchedulingLatency);
|
printf("BMediaEventLooper: SchedulingLatency is %Ld\n", fSchedulingLatency);
|
||||||
@@ -355,7 +355,7 @@ BMediaEventLooper::SetPriority(int32 priority)
|
|||||||
fSetPriority = priority;
|
fSetPriority = priority;
|
||||||
fCurrentPriority = (RunMode() == B_OFFLINE) ? min_c(B_NORMAL_PRIORITY, fSetPriority) : fSetPriority;
|
fCurrentPriority = (RunMode() == B_OFFLINE) ? min_c(B_NORMAL_PRIORITY, fSetPriority) : fSetPriority;
|
||||||
|
|
||||||
if(fControlThread > 0) {
|
if (fControlThread > 0) {
|
||||||
set_thread_priority(fControlThread, fCurrentPriority);
|
set_thread_priority(fControlThread, fCurrentPriority);
|
||||||
fSchedulingLatency = estimate_max_scheduling_latency(fControlThread);
|
fSchedulingLatency = estimate_max_scheduling_latency(fControlThread);
|
||||||
printf("BMediaEventLooper: SchedulingLatency is %Ld\n", fSchedulingLatency);
|
printf("BMediaEventLooper: SchedulingLatency is %Ld\n", fSchedulingLatency);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ BMediaFiles::RewindTypes()
|
|||||||
BMediaFiles::GetNextType(BString *out_type)
|
BMediaFiles::GetNextType(BString *out_type)
|
||||||
{
|
{
|
||||||
CALLED();
|
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;
|
m_type_index = -1;
|
||||||
return B_BAD_INDEX;
|
return B_BAD_INDEX;
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ BMediaFiles::RewindRefs(const char *type)
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(reply.count>0) {
|
if (reply.count>0) {
|
||||||
char *items;
|
char *items;
|
||||||
area_id clone;
|
area_id clone;
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ BMediaFiles::GetNextRef(BString *out_type,
|
|||||||
entry_ref *out_ref)
|
entry_ref *out_ref)
|
||||||
{
|
{
|
||||||
CALLED();
|
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;
|
m_item_index = -1;
|
||||||
return B_BAD_INDEX;
|
return B_BAD_INDEX;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2858,7 +2858,7 @@ BMediaRoster::GetInstancesFor(media_addon_id addon,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(io_count)
|
if (io_count)
|
||||||
*io_count = reply.count;
|
*io_count = reply.count;
|
||||||
if (reply.count > 0)
|
if (reply.count > 0)
|
||||||
memcpy(out_id, reply.node_id, sizeof(media_node_id) * reply.count);
|
memcpy(out_id, reply.node_id, sizeof(media_node_id) * reply.count);
|
||||||
|
|||||||
@@ -600,20 +600,15 @@ BParameterWeb::Unflatten(type_code code, const void *buffer, ssize_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if(mGroups != NULL)
|
if (mGroups != NULL) {
|
||||||
{
|
for (int32 i = 0; i < mGroups->CountItems(); i++) {
|
||||||
for (int32 i = 0; i < mGroups->CountItems(); i++)
|
|
||||||
{
|
|
||||||
BParameterGroup *CurrentItem = static_cast<BParameterGroup *>(mGroups->ItemAt(i));
|
BParameterGroup *CurrentItem = static_cast<BParameterGroup *>(mGroups->ItemAt(i));
|
||||||
if(CurrentItem != NULL)
|
if (CurrentItem != NULL) {
|
||||||
{
|
|
||||||
delete CurrentItem;
|
delete CurrentItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mGroups->MakeEmpty();
|
mGroups->MakeEmpty();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
mGroups = new BList();
|
mGroups = new BList();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -930,13 +925,11 @@ BParameterGroup::FlattenedSize() const
|
|||||||
//13 guaranteed bytes, variable after that.
|
//13 guaranteed bytes, variable after that.
|
||||||
ssize_t size = 13;
|
ssize_t size = 13;
|
||||||
|
|
||||||
if(mFlags != 0)
|
if (mFlags != 0) {
|
||||||
{
|
|
||||||
size += 4;
|
size += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mName != NULL)
|
if (mName != NULL) {
|
||||||
{
|
|
||||||
size += min_c(strlen(mName),255);
|
size += min_c(strlen(mName),255);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,22 +937,18 @@ BParameterGroup::FlattenedSize() const
|
|||||||
int limit;
|
int limit;
|
||||||
|
|
||||||
limit = mControls->CountItems();
|
limit = mControls->CountItems();
|
||||||
for(i = 0; i < limit; i++)
|
for (i = 0; i < limit; i++) {
|
||||||
{
|
|
||||||
BParameter *CurrentParameter = static_cast<BParameter *>(mControls->ItemAt(i));
|
BParameter *CurrentParameter = static_cast<BParameter *>(mControls->ItemAt(i));
|
||||||
if(CurrentParameter != NULL)
|
if (CurrentParameter != NULL) {
|
||||||
{
|
|
||||||
//overhead for each parameter flattened
|
//overhead for each parameter flattened
|
||||||
size += 16 + CurrentParameter->FlattenedSize();
|
size += 16 + CurrentParameter->FlattenedSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
limit = mGroups->CountItems();
|
limit = mGroups->CountItems();
|
||||||
for(i = 0; i < limit; i++)
|
for (i = 0; i < limit; i++) {
|
||||||
{
|
|
||||||
BParameterGroup *CurrentGroup = static_cast<BParameterGroup *>(mGroups->ItemAt(i));
|
BParameterGroup *CurrentGroup = static_cast<BParameterGroup *>(mGroups->ItemAt(i));
|
||||||
if(CurrentGroup != NULL)
|
if (CurrentGroup != NULL) {
|
||||||
{
|
|
||||||
//overhead for each group flattened
|
//overhead for each group flattened
|
||||||
size += 16 + CurrentGroup->FlattenedSize();
|
size += 16 + CurrentGroup->FlattenedSize();
|
||||||
}
|
}
|
||||||
@@ -1107,37 +1096,27 @@ BParameterGroup::Unflatten(type_code code, const void *buffer, ssize_t size)
|
|||||||
#if 0
|
#if 0
|
||||||
//Clear all existing parameters/subgroups
|
//Clear all existing parameters/subgroups
|
||||||
int i;
|
int i;
|
||||||
if(mControls != NULL)
|
if (mControls != NULL) {
|
||||||
{
|
for(i = 0; i < mControls->CountItems(); i++) {
|
||||||
for(i = 0; i < mControls->CountItems(); i++)
|
|
||||||
{
|
|
||||||
BParameter *CurrentItem = static_cast<BParameter *>(mControls->ItemAt(i));
|
BParameter *CurrentItem = static_cast<BParameter *>(mControls->ItemAt(i));
|
||||||
if(CurrentItem != NULL)
|
if (CurrentItem != NULL) {
|
||||||
{
|
|
||||||
delete CurrentItem;
|
delete CurrentItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mControls->MakeEmpty();
|
mControls->MakeEmpty();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
mControls = new BList();
|
mControls = new BList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mGroups != NULL)
|
if (mGroups != NULL) {
|
||||||
{
|
for (i = 0; i < mGroups->CountItems(); i++) {
|
||||||
for(i = 0; i < mGroups->CountItems(); i++)
|
|
||||||
{
|
|
||||||
BParameterGroup *CurrentItem = static_cast<BParameterGroup *>(mGroups->ItemAt(i));
|
BParameterGroup *CurrentItem = static_cast<BParameterGroup *>(mGroups->ItemAt(i));
|
||||||
if(CurrentItem != NULL)
|
if (CurrentItem != NULL) {
|
||||||
{
|
|
||||||
delete CurrentItem;
|
delete CurrentItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mGroups->MakeEmpty();
|
mGroups->MakeEmpty();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
mGroups = new BList();
|
mGroups = new BList();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include <MediaDefs.h>
|
#include <MediaDefs.h>
|
||||||
#include <Locker.h>
|
#include <Locker.h>
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
struct _event_queue_imp
|
struct _event_queue_imp
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user