Style cleanup, switched "* " style.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31997 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-07-30 21:02:56 +00:00
parent 435924897f
commit d8181502ef

View File

@ -1,8 +1,10 @@
/*
** Copyright 2004, the OpenBeOS project. All rights reserved.
** Distributed under the terms of the OpenBeOS License.
**
** Authors: Axel Dörfler, Marcus Overhagen
* Copyright 2004-2009, The Haiku Project. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Authors:
* Axel Dörfler
* Marcus Overhagen
*/
@ -77,7 +79,8 @@ _media_format_description::~_media_format_description()
}
_media_format_description::_media_format_description(const _media_format_description & other)
_media_format_description::_media_format_description(
const _media_format_description& other)
{
memcpy(this, &other, sizeof(*this));
}
@ -92,7 +95,8 @@ _media_format_description::operator=(const _media_format_description & other)
bool
operator==(const media_format_description & a, const media_format_description & b)
operator==(const media_format_description& a,
const media_format_description& b)
{
if (a.family != b.family)
return false;
@ -101,7 +105,8 @@ operator==(const media_format_description & a, const media_format_description &
case B_BEOS_FORMAT_FAMILY:
return a.u.beos.format == b.u.beos.format;
case B_QUICKTIME_FORMAT_FAMILY:
return a.u.quicktime.codec == b.u.quicktime.codec && a.u.quicktime.vendor == b.u.quicktime.vendor;
return a.u.quicktime.codec == b.u.quicktime.codec
&& a.u.quicktime.vendor == b.u.quicktime.vendor;
case B_AVI_FORMAT_FAMILY:
return a.u.avi.codec == b.u.avi.codec;
case B_ASF_FORMAT_FAMILY:
@ -115,7 +120,8 @@ operator==(const media_format_description & a, const media_format_description &
case B_AVR_FORMAT_FAMILY:
return a.u.avr.id == b.u.avr.id;
case B_MISC_FORMAT_FAMILY:
return a.u.misc.file_format == b.u.misc.file_format && a.u.misc.codec == b.u.misc.codec;
return a.u.misc.file_format == b.u.misc.file_format
&& a.u.misc.codec == b.u.misc.codec;
default:
return false;
@ -195,6 +201,7 @@ meta_format::meta_format(const media_format_description &description,
{
}
meta_format::meta_format(const media_format_description& description)
:
description(description),
@ -212,7 +219,8 @@ meta_format::meta_format(const meta_format &other)
bool
meta_format::Matches(const media_format &otherFormat, media_format_family family)
meta_format::Matches(const media_format& otherFormat,
media_format_family family)
{
if (family != description.family)
return false;
@ -264,7 +272,8 @@ update_media_formats()
BMessage reply;
status_t status = QueryServer(request, reply);
if (status < B_OK) {
ERROR("BMediaFormats: Could not update formats: %s\n", strerror(status));
ERROR("BMediaFormats: Could not update formats: %s\n",
strerror(status));
return status;
}
@ -464,7 +473,7 @@ status_t
BMediaFormats::RewindFormats()
{
if (!sLock.IsLocked() || sLock.LockingThread() != find_thread(NULL)) {
// ToDo: shouldn't we simply drop into the debugger in this case?
// TODO: Shouldn't we simply drop into the debugger in this case?
return B_NOT_ALLOWED;
}
@ -478,13 +487,13 @@ BMediaFormats::GetNextFormat(media_format *_format,
media_format_description* _description)
{
if (!sLock.IsLocked() || sLock.LockingThread() != find_thread(NULL)) {
// ToDo: shouldn't we simply drop into the debugger in this case?
// TODO: Shouldn't we simply drop into the debugger in this case?
return B_NOT_ALLOWED;
}
if (fIteratorIndex == 0) {
// this is the first call, so let's make sure we have
// current data to operate on
// This is the first call, so let's make sure we have current data to
// operate on.
status_t status = update_media_formats();
if (status < B_OK)
return status;
@ -514,11 +523,13 @@ BMediaFormats::Unlock()
status_t
BMediaFormats::MakeFormatFor(const media_format_description* descriptions,
int32 descriptionCount, media_format *format, uint32 flags, void * _reserved)
int32 descriptionCount, media_format* format, uint32 flags,
void* _reserved)
{
BMessage request(MEDIA_SERVER_MAKE_FORMAT_FOR);
for (int32 i = 0 ; i < descriptionCount ; i++) {
request.AddData("description", B_RAW_TYPE, &descriptions[i], sizeof(descriptions[i]));
request.AddData("description", B_RAW_TYPE, &descriptions[i],
sizeof(descriptions[i]));
}
request.AddData("format", B_RAW_TYPE, format, sizeof(*format));
request.AddData("flags", B_UINT32_TYPE, &flags, sizeof(flags));
@ -532,22 +543,18 @@ BMediaFormats::MakeFormatFor(const media_format_description *descriptions,
}
// check the status
if (reply.FindInt32("result", &status) < B_OK) {
if (reply.FindInt32("result", &status) < B_OK)
return B_ERROR;
}
if (status != B_OK) {
if (status != B_OK)
return status;
}
// get the format
const void* data;
ssize_t size;
if (reply.FindData("format", B_RAW_TYPE, 0, &data, &size) != B_OK) {
if (reply.FindData("format", B_RAW_TYPE, 0, &data, &size) != B_OK)
return B_ERROR;
}
if (size != sizeof(*format)) {
if (size != sizeof(*format))
return B_ERROR;
}
// copy the BMessage's data into our format
*format = *(media_format*)data;
@ -555,7 +562,9 @@ BMediaFormats::MakeFormatFor(const media_format_description *descriptions,
return B_OK;
}
/* --- begin deprecated API --- */
// #pragma mark - deprecated API
status_t
BMediaFormats::MakeFormatFor(const media_format_description& description,