From acc632c7ec172aac2993d5e1486fbd8d7fe0c943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 22 Apr 2009 14:13:45 +0000 Subject: [PATCH] Make it clear from the API that the volume passed in is not touched by the function. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30326 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/storage/DiskDeviceRoster.h | 2 +- src/kits/storage/disk_device/DiskDeviceRoster.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/private/storage/DiskDeviceRoster.h b/headers/private/storage/DiskDeviceRoster.h index b7d78df6bd..713b745879 100644 --- a/headers/private/storage/DiskDeviceRoster.h +++ b/headers/private/storage/DiskDeviceRoster.h @@ -116,7 +116,7 @@ public: BDiskDevice* device = NULL, BPartition** _partition = NULL); - status_t FindPartitionByVolume(BVolume* volume, + status_t FindPartitionByVolume(const BVolume& volume, BDiskDevice* device, BPartition** _partition); status_t FindPartitionByMountPoint(const char* mountPoint, diff --git a/src/kits/storage/disk_device/DiskDeviceRoster.cpp b/src/kits/storage/disk_device/DiskDeviceRoster.cpp index c7b219fe70..9c0e6697a2 100644 --- a/src/kits/storage/disk_device/DiskDeviceRoster.cpp +++ b/src/kits/storage/disk_device/DiskDeviceRoster.cpp @@ -327,8 +327,8 @@ BDiskDeviceRoster::VisitEachMountablePartition(BDiskDeviceVisitor* visitor, /*! \brief Finds a BPartition by BVolume. */ status_t -BDiskDeviceRoster::FindPartitionByVolume(BVolume* volume, BDiskDevice* device, - BPartition** _partition) +BDiskDeviceRoster::FindPartitionByVolume(const BVolume& volume, + BDiskDevice* device, BPartition** _partition) { class FindPartitionVisitor : public BDiskDeviceVisitor { public: @@ -352,7 +352,7 @@ BDiskDeviceRoster::FindPartitionByVolume(BVolume* volume, BDiskDevice* device, private: dev_t fVolume; - } visitor(volume->Device()); + } visitor(volume.Device()); if (VisitEachMountedPartition(&visitor, device, _partition)) return B_OK; @@ -369,7 +369,7 @@ BDiskDeviceRoster::FindPartitionByMountPoint(const char* mountPoint, { BVolume volume(dev_for_path(mountPoint)); if (volume.InitCheck() == B_OK - && FindPartitionByVolume(&volume, device, _partition)) + && FindPartitionByVolume(volume, device, _partition)) return B_OK; return B_ENTRY_NOT_FOUND;