diff options
| author | Stevoisiak <Stevoisiak@gmail.com> | 2015-02-15 14:43:31 -0500 |
|---|---|---|
| committer | Stevoisiak <Stevoisiak@gmail.com> | 2015-02-25 10:48:21 -0500 |
| commit | 93b16a4a2d5f3e6d467d1315c461aff12852b26c (patch) | |
| tree | 0993e6ce422ae33a850466e8da285421a462e79f /Source/Core/Common/CDUtils.cpp | |
| parent | b8edd8aedc75ae4e2abd8c5558af94e98c7bebcb (diff) | |
Formatting/Whitespace Cleanup
Various fixes to formatting and whitespace
Diffstat (limited to 'Source/Core/Common/CDUtils.cpp')
| -rw-r--r-- | Source/Core/Common/CDUtils.cpp | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/Source/Core/Common/CDUtils.cpp b/Source/Core/Common/CDUtils.cpp index 50c1902eac..bbe7b4c2c6 100644 --- a/Source/Core/Common/CDUtils.cpp +++ b/Source/Core/Common/CDUtils.cpp @@ -72,23 +72,23 @@ std::vector<std::string> cdio_get_devices() CFMutableDictionaryRef classes_to_match; std::vector<std::string> drives; - kern_result = IOMasterPort( MACH_PORT_NULL, &master_port ); + kern_result = IOMasterPort(MACH_PORT_NULL, &master_port); if (kern_result != KERN_SUCCESS) - return( drives ); + return drives; - classes_to_match = IOServiceMatching( kIOCDMediaClass ); + classes_to_match = IOServiceMatching(kIOCDMediaClass); if (classes_to_match == nullptr) - return( drives ); + return drives; - CFDictionarySetValue( classes_to_match, - CFSTR(kIOMediaEjectableKey), kCFBooleanTrue ); + CFDictionarySetValue(classes_to_match, + CFSTR(kIOMediaEjectableKey), kCFBooleanTrue); - kern_result = IOServiceGetMatchingServices( master_port, - classes_to_match, &media_iterator ); + kern_result = IOServiceGetMatchingServices(master_port, + classes_to_match, &media_iterator); if (kern_result != KERN_SUCCESS) - return( drives ); + return drives; - next_media = IOIteratorNext( media_iterator ); + next_media = IOIteratorNext(media_iterator); if (next_media != 0) { CFTypeRef str_bsd_path; @@ -96,12 +96,12 @@ std::vector<std::string> cdio_get_devices() do { str_bsd_path = - IORegistryEntryCreateCFProperty( next_media, - CFSTR( kIOBSDNameKey ), kCFAllocatorDefault, - 0 ); + IORegistryEntryCreateCFProperty(next_media, + CFSTR(kIOBSDNameKey), kCFAllocatorDefault, + 0); if (str_bsd_path == nullptr) { - IOObjectRelease( next_media ); + IOObjectRelease(next_media); continue; } @@ -120,12 +120,11 @@ std::vector<std::string> cdio_get_devices() delete[] buf; } - CFRelease( str_bsd_path ); - IOObjectRelease( next_media ); - - } while (( next_media = IOIteratorNext( media_iterator ) ) != 0); + CFRelease(str_bsd_path); + IOObjectRelease(next_media); + } while ((next_media = IOIteratorNext(media_iterator)) != 0); } - IOObjectRelease( media_iterator ); + IOObjectRelease(media_iterator); return drives; } #else @@ -166,11 +165,11 @@ static bool is_cdrom(const std::string& drive, char *mnttype) { // Check if the device exists if (!is_device(drive)) - return(false); + return false; - bool is_cd=false; + bool is_cd = false; // If it does exist, verify that it is a cdrom/dvd drive - int cdfd = open(drive.c_str(), (O_RDONLY|O_NONBLOCK), 0); + int cdfd = open(drive.c_str(), (O_RDONLY | O_NONBLOCK), 0); if (cdfd >= 0) { #ifdef __linux__ @@ -179,11 +178,11 @@ static bool is_cdrom(const std::string& drive, char *mnttype) is_cd = true; close(cdfd); } - return(is_cd); + return is_cd; } // Returns a pointer to an array of strings with the device names -std::vector<std::string> cdio_get_devices () +std::vector<std::string> cdio_get_devices() { std::vector<std::string> drives; // Scan the system for DVD/CD-ROM drives. |
