* Turned off debugging output (intel.cpp still puts out some stuff, but only

when compiled for the kernel).
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27089 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-08-20 20:42:24 +00:00
parent 7a253cf5fe
commit 27ba18f412
3 changed files with 26 additions and 23 deletions
@@ -1,5 +1,5 @@
/* /*
* Copyright 2003-2006, Haiku, Inc. All Rights Reserved. * Copyright 2003-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -18,6 +18,7 @@
#ifndef _USER_MODE #ifndef _USER_MODE
# include <util/kernel_cpp.h> # include <util/kernel_cpp.h>
# include <KernelExport.h>
#else #else
# include <new> # include <new>
#endif #endif
@@ -26,20 +27,19 @@
#else #else
# include <boot/partitions.h> # include <boot/partitions.h>
#endif #endif
#ifndef _USER_MODE
# include <KernelExport.h>
#endif
#include "PartitionMap.h" #include "PartitionMap.h"
#define TRACE_ENABLED
//#define TRACE_ENABLED
#ifdef TRACE_ENABLED #ifdef TRACE_ENABLED
# ifdef _USER_MODE # ifdef _USER_MODE
# define TRACE(x) printf x # define TRACE(x) printf x
# else # else
# define TRACE(x) dprintf x # define TRACE(x) dprintf x
# endif # endif
#else
# define TRACE(x) ;
#endif #endif
using std::nothrow; using std::nothrow;
@@ -291,22 +291,24 @@ PartitionType::FindNext()
// constructor // constructor
Partition::Partition() Partition::Partition()
: fPTSOffset(0), :
fOffset(0), fPTSOffset(0),
fSize(0), fOffset(0),
fType(0), fSize(0),
fActive(false) fType(0),
fActive(false)
{ {
} }
// constructor // constructor
Partition::Partition(const partition_descriptor *descriptor,off_t ptsOffset, Partition::Partition(const partition_descriptor *descriptor,off_t ptsOffset,
off_t baseOffset) off_t baseOffset)
: fPTSOffset(0), :
fOffset(0), fPTSOffset(0),
fSize(0), fOffset(0),
fType(0), fSize(0),
fActive(false) fType(0),
fActive(false)
{ {
SetTo(descriptor, ptsOffset, baseOffset); SetTo(descriptor, ptsOffset, baseOffset);
} }
@@ -314,9 +316,9 @@ Partition::Partition(const partition_descriptor *descriptor,off_t ptsOffset,
// SetTo // SetTo
void void
Partition::SetTo(const partition_descriptor *descriptor, off_t ptsOffset, Partition::SetTo(const partition_descriptor *descriptor, off_t ptsOffset,
off_t baseOffset) off_t baseOffset)
{ {
TRACE(("Partition::SetTo(): active: %x\n", descriptor->active)); TRACE(("Partition::SetTo(): active: %x\n", descriptor->active));
SetTo(baseOffset + (off_t)descriptor->start * SECTOR_SIZE, SetTo(baseOffset + (off_t)descriptor->start * SECTOR_SIZE,
(off_t)descriptor->size * SECTOR_SIZE, (off_t)descriptor->size * SECTOR_SIZE,
descriptor->type, descriptor->type,
@@ -1,5 +1,5 @@
/* /*
* Copyright 2003-2006, Haiku, Inc. All Rights Reserved. * Copyright 2003-2008, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -21,14 +21,16 @@
#include "PartitionMap.h" #include "PartitionMap.h"
#include "PartitionMapParser.h" #include "PartitionMapParser.h"
#define TRACE_ENABLED
//#define TRACE_ENABLED
#ifdef TRACE_ENABLED #ifdef TRACE_ENABLED
# ifdef _USER_MODE # ifdef _USER_MODE
# define TRACE(x) printf x # define TRACE(x) printf x
# else # else
# define TRACE(x) dprintf x # define TRACE(x) dprintf x
# endif # endif
#else
# define TRACE(x) ;
#endif #endif
using std::nothrow; using std::nothrow;
@@ -37,15 +37,14 @@
#ifndef _BOOT_MODE #ifndef _BOOT_MODE
# include <DiskDeviceTypes.h> # include <DiskDeviceTypes.h>
# include "write_support.h" # include "write_support.h"
# define TRACE(x) dprintf x
#else #else
# include <boot/partitions.h> # include <boot/partitions.h>
# include <util/kernel_cpp.h> # include <util/kernel_cpp.h>
# define TRACE(x) ;
#endif #endif
//#define TRACE(x) ;
#define TRACE(x) dprintf x
// module names // module names
#define INTEL_PARTITION_MODULE_NAME "partitioning_systems/intel/map/v1" #define INTEL_PARTITION_MODULE_NAME "partitioning_systems/intel/map/v1"
#define INTEL_EXTENDED_PARTITION_MODULE_NAME \ #define INTEL_EXTENDED_PARTITION_MODULE_NAME \