[haiku-development] src_build_libbe_storage_Volume.cpp.diff
- From: kaoutsis <kaoutsis@xxxxxx>
- To: haiku-development <haiku-development@xxxxxxxxxxxxx>
- Date: Sat, 31 May 2008 13:26:55 +0300
Hi there,
src_build_libbe_storage_Volume.cpp.diff:
* adopt Axel's solution to the return statment:
- return (InitCheck() != B_OK && volume.InitCheck() != B_OK
- || fDevice == volume.fDevice);
+ return fDevice == volume.fDevice;
* some style changes,
good bye,
Vasilis
Index: src/build/libbe/storage/Volume.cpp
===================================================================
--- src/build/libbe/storage/Volume.cpp (revision 25731)
+++ src/build/libbe/storage/Volume.cpp (working copy)
@@ -1,16 +1,21 @@
-// ----------------------------------------------------------------------
-// This software is part of the OpenBeOS distribution and is covered
-// by the OpenBeOS license.
-//
-// File Name: Volume.cpp
-//
-// Description: BVolume class
-// ----------------------------------------------------------------------
+/*
+ * Copyright 2002-2008, Haiku Inc. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ * Tyler Dauwalder, tyler@xxxxxxxxxxxxx
+ * Erik Jakowatz
+ * shadow303
+ * Ingo Weinhold, ingo_weinhold@xxxxxx
+ */
+
/*!
\file Volume.h
BVolume implementation.
*/
+#include <Volume.h>
+
#include <errno.h>
#include <string.h>
@@ -18,14 +23,10 @@
#include <Directory.h>
#include <Node.h>
#include <Path.h>
-#include <Volume.h>
#include <storage_support.h>
#include <syscalls.h>
-#ifdef USE_OPENBEOS_NAMESPACE
-namespace OpenBeOS {
-#endif
/*!
\class BVolume
@@ -51,18 +52,19 @@
\brief The object's initialization status.
*/
-// constructor
+
/*! \brief Creates an uninitialized BVolume.
InitCheck() will return \c B_NO_INIT.
*/
BVolume::BVolume()
- : fDevice((dev_t)-1),
- fCStatus(B_NO_INIT)
+ :
+ fDevice((dev_t)-1),
+ fCStatus(B_NO_INIT)
{
}
-// constructor
+
/*! \brief Creates a BVolume and initializes it to the volume specified
by the supplied device ID.
@@ -72,13 +74,14 @@
\param device The device ID of the volume.
*/
BVolume::BVolume(dev_t device)
- : fDevice((dev_t)-1),
- fCStatus(B_NO_INIT)
+ :
+ fDevice((dev_t)-1),
+ fCStatus(B_NO_INIT)
{
SetTo(device);
}
-// copy constructor
+
/*! \brief Creates a BVolume and makes it a clone of the supplied one.
Afterwards the object refers to the same device the supplied object
@@ -88,12 +91,13 @@
\param volume The volume object to be cloned.
*/
BVolume::BVolume(const BVolume &volume)
- : fDevice(volume.fDevice),
- fCStatus(volume.fCStatus)
+ :
+ fDevice(volume.fDevice),
+ fCStatus(volume.fCStatus)
{
}
-// destructor
+
/*! \brief Frees all resources associated with the object.
Does nothing.
@@ -102,7 +106,7 @@
{
}
-// InitCheck
+
/*! \brief Returns the result of the last initialization.
\return
- \c B_OK: The object is properly initialized.
@@ -114,7 +118,7 @@
return fCStatus;
}
-// SetTo
+
/*! \brief Re-initializes the object to refer to the volume specified by
the supplied device ID.
\param device The device ID of the volume.
@@ -142,7 +146,7 @@
return fCStatus;
}
-// Unset
+
/*! \brief Uninitialized the BVolume.
*/
void
@@ -152,7 +156,7 @@
fCStatus = B_NO_INIT;
}
-// Device
+
/*! \brief Returns the device ID of the volume the object refers to.
\return Returns the device ID of the volume the object refers to
or -1, if the object is not properly initialized.
@@ -163,7 +167,7 @@
return fDevice;
}
-// ==
+
/*! \brief Returns whether two BVolume objects are equal.
Two volume objects are said to be equal, if they either are both
@@ -176,11 +180,10 @@
bool
BVolume::operator==(const BVolume &volume) const
{
- return (InitCheck() != B_OK && volume.InitCheck() != B_OK
- || fDevice == volume.fDevice);
+ return fDevice == volume.fDevice;
}
-// !=
+
/*! \brief Returns whether two BVolume objects are unequal.
Two volume objects are said to be equal, if they either are both
@@ -196,7 +199,7 @@
return !(*this == volume);
}
-// =
+
/*! \brief Assigns another BVolume object to this one.
This object is made an exact clone of the supplied one.
@@ -215,7 +218,6 @@
}
-// FBC
void BVolume::_TurnUpTheVolume1() {}
void BVolume::_TurnUpTheVolume2() {}
void BVolume::_TurnUpTheVolume3() {}
@@ -224,7 +226,3 @@
void BVolume::_TurnUpTheVolume6() {}
void BVolume::_TurnUpTheVolume7() {}
void BVolume::_TurnUpTheVolume8() {}
-
-#ifdef USE_OPENBEOS_NAMESPACE
-}
-#endif
Other related posts: