diff --git a/src/system/boot/loader/RootFileSystem.cpp b/src/system/boot/loader/RootFileSystem.cpp index 441f5a1765..2c654d8641 100644 --- a/src/system/boot/loader/RootFileSystem.cpp +++ b/src/system/boot/loader/RootFileSystem.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -7,7 +7,6 @@ #include "RootFileSystem.h" #include -#include #include #include @@ -29,7 +28,7 @@ RootFileSystem::~RootFileSystem() } -status_t +status_t RootFileSystem::Open(void **_cookie, int mode) { EntryIterator *iterator = new (std::nothrow) EntryIterator(&fList); @@ -42,7 +41,7 @@ RootFileSystem::Open(void **_cookie, int mode) } -status_t +status_t RootFileSystem::Close(void *cookie) { delete (EntryIterator *)cookie; @@ -84,7 +83,7 @@ RootFileSystem::Lookup(const char *name, bool /*traverseLinks*/) } -status_t +status_t RootFileSystem::GetNextEntry(void *_cookie, char *name, size_t size) { EntryIterator *iterator = (EntryIterator *)_cookie; @@ -98,7 +97,7 @@ RootFileSystem::GetNextEntry(void *_cookie, char *name, size_t size) } -status_t +status_t RootFileSystem::GetNextNode(void *_cookie, Node **_node) { EntryIterator *iterator = (EntryIterator *)_cookie; @@ -113,24 +112,24 @@ RootFileSystem::GetNextNode(void *_cookie, Node **_node) } -status_t +status_t RootFileSystem::Rewind(void *_cookie) { EntryIterator *iterator = (EntryIterator *)_cookie; iterator->Rewind(); - return B_OK; + return B_OK; } -bool +bool RootFileSystem::IsEmpty() { return fList.IsEmpty(); } -status_t +status_t RootFileSystem::AddVolume(Directory *volume, Partition *partition) { struct entry *entry = new (std::nothrow) RootFileSystem::entry(); @@ -165,7 +164,7 @@ RootFileSystem::AddLink(const char *name, Directory *target) } -status_t +status_t RootFileSystem::GetPartitionFor(Directory *volume, Partition **_partition) { EntryIterator iterator = fList.GetIterator(); diff --git a/src/system/boot/loader/file_systems/amiga_ffs/Directory.cpp b/src/system/boot/loader/file_systems/amiga_ffs/Directory.cpp index c299717118..17e893576e 100644 --- a/src/system/boot/loader/file_systems/amiga_ffs/Directory.cpp +++ b/src/system/boot/loader/file_systems/amiga_ffs/Directory.cpp @@ -1,7 +1,7 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ #include "Directory.h" @@ -9,7 +9,6 @@ #include "File.h" #include -#include #include #include @@ -18,6 +17,7 @@ namespace FFS { + Directory::Directory(Volume &volume, int32 block) : fVolume(volume) @@ -45,14 +45,14 @@ Directory::~Directory() } -status_t +status_t Directory::InitCheck() { return fNode.ValidateCheckSum(); } -status_t +status_t Directory::Open(void **_cookie, int mode) { _inherited::Open(_cookie, mode); @@ -71,7 +71,7 @@ Directory::Open(void **_cookie, int mode) } -status_t +status_t Directory::Close(void *cookie) { _inherited::Close(cookie); @@ -113,7 +113,7 @@ Directory::Lookup(const char *name, bool traverseLinks) } -status_t +status_t Directory::GetNextEntry(void *cookie, char *name, size_t size) { HashIterator *iterator = (HashIterator *)cookie; @@ -127,7 +127,7 @@ Directory::GetNextEntry(void *cookie, char *name, size_t size) } -status_t +status_t Directory::GetNextNode(void *cookie, Node **_node) { return B_ERROR; @@ -165,4 +165,5 @@ Directory::Inode() const return fNode.HeaderKey(); } + } // namespace FFS diff --git a/src/system/boot/loader/file_systems/amiga_ffs/File.cpp b/src/system/boot/loader/file_systems/amiga_ffs/File.cpp index 249d17bf9e..f75be4f8ff 100644 --- a/src/system/boot/loader/file_systems/amiga_ffs/File.cpp +++ b/src/system/boot/loader/file_systems/amiga_ffs/File.cpp @@ -1,7 +1,7 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ #include "File.h" @@ -10,11 +10,10 @@ #include #include -#include - namespace FFS { + class Stream { public: Stream(int device, FileBlock &node); @@ -255,4 +254,5 @@ File::Inode() const return fNode.HeaderKey(); } + } // namespace FFS diff --git a/src/system/boot/loader/file_systems/amiga_ffs/Volume.cpp b/src/system/boot/loader/file_systems/amiga_ffs/Volume.cpp index 4d1cd26e31..295ff39f9d 100644 --- a/src/system/boot/loader/file_systems/amiga_ffs/Volume.cpp +++ b/src/system/boot/loader/file_systems/amiga_ffs/Volume.cpp @@ -1,7 +1,7 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ #include "Volume.h" @@ -9,7 +9,6 @@ #include #include -#include #include #include @@ -87,7 +86,7 @@ Volume::~Volume() } -status_t +status_t Volume::InitCheck() { if (fRoot != NULL) diff --git a/src/system/boot/loader/file_systems/amiga_ffs/amiga_ffs.cpp b/src/system/boot/loader/file_systems/amiga_ffs/amiga_ffs.cpp index 07fe89981d..28cc48f82e 100644 --- a/src/system/boot/loader/file_systems/amiga_ffs/amiga_ffs.cpp +++ b/src/system/boot/loader/file_systems/amiga_ffs/amiga_ffs.cpp @@ -1,14 +1,13 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ #include "amiga_ffs.h" #include #include -#include #include #include @@ -31,7 +30,7 @@ class BCPLString { }; -int32 +int32 BCPLString::CopyTo(char *name, size_t size) { int32 length = size - 1 > Length() ? Length() : size - 1; @@ -56,7 +55,7 @@ BaseBlock::GetNameBackOffset(int32 offset, char *name, size_t size) const } -status_t +status_t BaseBlock::ValidateCheckSum() const { if (fData == NULL) @@ -74,7 +73,7 @@ BaseBlock::ValidateCheckSum() const // #pragma mark - -char +char DirectoryBlock::ToUpperChar(int32 type, char c) const { // Taken from Ralph Babel's "The Amiga Guru Book" (1993), section 15.3.4.3 @@ -87,11 +86,11 @@ DirectoryBlock::ToUpperChar(int32 type, char c) const } -int32 +int32 DirectoryBlock::HashIndexFor(int32 type, const char *name) const { int32 hash = strlen(name); - + while (name[0]) { hash = (hash * 13 + ToUpperChar(type, name[0])) & 0x7ff; name++; @@ -101,7 +100,7 @@ DirectoryBlock::HashIndexFor(int32 type, const char *name) const } -int32 +int32 DirectoryBlock::HashValueAt(int32 index) const { return index >= HashSize() ? -1 : (int32)B_BENDIAN_TO_HOST_INT32(HashTable()[index]); @@ -116,11 +115,11 @@ DirectoryBlock::FirstHashValue(int32 &index) const } -int32 +int32 DirectoryBlock::NextHashValue(int32 &index) const { index++; - + int32 value; while ((value = HashValueAt(index)) == 0) { if (++index >= HashSize()) @@ -152,14 +151,14 @@ HashIterator::~HashIterator() } -status_t +status_t HashIterator::InitCheck() { return fData != NULL ? B_OK : B_NO_MEMORY; } -void +void HashIterator::Goto(int32 index) { fCurrent = index; @@ -197,7 +196,7 @@ HashIterator::GetNext(int32 &block) } -void +void HashIterator::Rewind() { fCurrent = 0; diff --git a/src/system/boot/loader/file_systems/bfs/Directory.cpp b/src/system/boot/loader/file_systems/bfs/Directory.cpp index 91fe02ffab..a4f5642880 100644 --- a/src/system/boot/loader/file_systems/bfs/Directory.cpp +++ b/src/system/boot/loader/file_systems/bfs/Directory.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2010, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -10,7 +10,6 @@ #include #include -#include #include #include @@ -52,14 +51,14 @@ Directory::~Directory() } -status_t +status_t Directory::InitCheck() { return fStream.InitCheck(); } -status_t +status_t Directory::Open(void **_cookie, int mode) { _inherited::Open(_cookie, mode); @@ -72,7 +71,7 @@ Directory::Open(void **_cookie, int mode) } -status_t +status_t Directory::Close(void *cookie) { _inherited::Close(cookie); @@ -118,7 +117,7 @@ Directory::Lookup(const char *name, bool traverseLinks) } -status_t +status_t Directory::GetNextEntry(void *cookie, char *name, size_t size) { TreeIterator *iterator = (TreeIterator *)cookie; @@ -129,7 +128,7 @@ Directory::GetNextEntry(void *cookie, char *name, size_t size) } -status_t +status_t Directory::GetNextNode(void *cookie, Node **_node) { TreeIterator *iterator = (TreeIterator *)cookie; @@ -149,7 +148,7 @@ Directory::GetNextNode(void *cookie, Node **_node) } -status_t +status_t Directory::Rewind(void *cookie) { TreeIterator *iterator = (TreeIterator *)cookie; @@ -158,7 +157,7 @@ Directory::Rewind(void *cookie) } -bool +bool Directory::IsEmpty() { TreeIterator iterator(&fTree); diff --git a/src/system/boot/loader/file_systems/bfs/File.cpp b/src/system/boot/loader/file_systems/bfs/File.cpp index 626731d39f..2853ed11b1 100644 --- a/src/system/boot/loader/file_systems/bfs/File.cpp +++ b/src/system/boot/loader/file_systems/bfs/File.cpp @@ -1,16 +1,15 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. + * This file may be used under the terms of the MIT License. + */ #include "File.h" -#include - namespace BFS { + File::File(Volume &volume, block_run run) : fStream(volume, run) @@ -37,14 +36,14 @@ File::~File() } -status_t +status_t File::InitCheck() { return fStream.InitCheck(); } -ssize_t +ssize_t File::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize) { status_t status = fStream.ReadAt(pos, (uint8 *)buffer, &bufferSize); @@ -55,7 +54,7 @@ File::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize) } -ssize_t +ssize_t File::WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize) { return EROFS; @@ -89,4 +88,5 @@ File::Inode() const return fStream.ID(); } + } // namespace BFS diff --git a/src/system/boot/loader/file_systems/bfs/Link.cpp b/src/system/boot/loader/file_systems/bfs/Link.cpp index 381abb9515..c5159a2003 100644 --- a/src/system/boot/loader/file_systems/bfs/Link.cpp +++ b/src/system/boot/loader/file_systems/bfs/Link.cpp @@ -1,16 +1,15 @@ /* -** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2004-2013, Axel Dörfler, axeld@pinc-software.de. + * This file may be used under the terms of the MIT License. + */ #include "Link.h" -#include - namespace BFS { + Link::Link(Volume &volume, block_run run) : File(volume, run) { @@ -63,4 +62,5 @@ Link::Type() const return S_IFLNK; } + } // namespace BFS diff --git a/src/system/boot/loader/file_systems/bfs/Stream.cpp b/src/system/boot/loader/file_systems/bfs/Stream.cpp index 9eb25b7e30..4cdea7dd85 100644 --- a/src/system/boot/loader/file_systems/bfs/Stream.cpp +++ b/src/system/boot/loader/file_systems/bfs/Stream.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2010, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * This file may be used under the terms of the MIT License. */ @@ -12,8 +12,6 @@ #include "File.h" #include "Link.h" -#include - #include #include #include diff --git a/src/system/boot/loader/file_systems/bfs/bfs.cpp b/src/system/boot/loader/file_systems/bfs/bfs.cpp index f6cfd3b36a..3fee5a9dc4 100644 --- a/src/system/boot/loader/file_systems/bfs/bfs.cpp +++ b/src/system/boot/loader/file_systems/bfs/bfs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2009, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -12,7 +12,6 @@ #include #include #include -#include #include "Volume.h" #include "Directory.h" diff --git a/src/system/boot/loader/file_systems/fat/CachedBlock.h b/src/system/boot/loader/file_systems/fat/CachedBlock.h index f19ca82036..ab6f6f5342 100644 --- a/src/system/boot/loader/file_systems/fat/CachedBlock.h +++ b/src/system/boot/loader/file_systems/fat/CachedBlock.h @@ -9,16 +9,12 @@ #define CACHED_BLOCK_H -#include -#include -#include -#include - #include "Volume.h" namespace FATFS { + class CachedBlock { public: enum { diff --git a/src/system/boot/loader/file_systems/fat/Directory.cpp b/src/system/boot/loader/file_systems/fat/Directory.cpp index f1e56e6f5a..caa010aa5d 100644 --- a/src/system/boot/loader/file_systems/fat/Directory.cpp +++ b/src/system/boot/loader/file_systems/fat/Directory.cpp @@ -1,7 +1,8 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2008, François Revol + * Distributed under the terms of the MIT License. + */ #include "Directory.h" @@ -14,7 +15,6 @@ #include #include -#include #include "CachedBlock.h" #include "File.h" @@ -24,8 +24,10 @@ //#define TRACE(x) dprintf x #define TRACE(x) do {} while (0) + namespace FATFS { + struct dir_entry { void *Buffer() const { return (void *)fName; }; const char *BaseName() const { return fName; }; @@ -328,7 +330,7 @@ Directory::Open(void **_cookie, int mode) TRACE(("FASFS::Directory::%s(, %d)\n", __FUNCTION__, mode)); _inherited::Open(_cookie, mode); - struct dir_cookie *c = new struct dir_cookie; + dir_cookie *c = new(nothrow) dir_cookie; if (c == NULL) return B_NO_MEMORY; diff --git a/src/system/boot/loader/file_systems/fat/File.cpp b/src/system/boot/loader/file_systems/fat/File.cpp index 4a06da1934..60ac2e8fb5 100644 --- a/src/system/boot/loader/file_systems/fat/File.cpp +++ b/src/system/boot/loader/file_systems/fat/File.cpp @@ -1,7 +1,8 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2008, François Revol + * Distributed under the terms of the MIT License. + */ #include "File.h" @@ -9,8 +10,6 @@ #include #include -#include - #include "Directory.h" @@ -137,4 +136,5 @@ File::Inode() const return fStream.FirstCluster() << 16; } + } // namespace FATFS diff --git a/src/system/boot/loader/file_systems/fat/Stream.cpp b/src/system/boot/loader/file_systems/fat/Stream.cpp index a8d8754e11..3ed255f656 100644 --- a/src/system/boot/loader/file_systems/fat/Stream.cpp +++ b/src/system/boot/loader/file_systems/fat/Stream.cpp @@ -17,12 +17,12 @@ #include #include -#include #include "CachedBlock.h" #include "Directory.h" #include "File.h" + //#define TRACE(x) dprintf x #define TRACE(x) do {} while (0) diff --git a/src/system/boot/loader/file_systems/fat/Volume.cpp b/src/system/boot/loader/file_systems/fat/Volume.cpp index fae51c9ca9..c2da9568a6 100644 --- a/src/system/boot/loader/file_systems/fat/Volume.cpp +++ b/src/system/boot/loader/file_systems/fat/Volume.cpp @@ -1,7 +1,8 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2008, François Revol + * Distributed under the terms of the MIT License. + */ #include "Volume.h" @@ -10,7 +11,6 @@ #include #include -#include #include #include @@ -18,9 +18,11 @@ #include #include + //#define TRACE(x) dprintf x #define TRACE(x) do {} while (0) + using namespace FATFS; @@ -33,7 +35,7 @@ Volume::Volume(boot::Partition *partition) if ((fDevice = open_node(partition, O_RDONLY)) < B_OK) return; - fCachedBlock = new CachedBlock(*this); + fCachedBlock = new(nothrow) CachedBlock(*this); if (fCachedBlock == NULL) return; @@ -135,13 +137,13 @@ Volume::Volume(boot::Partition *partition) fFatBits = 16; goto err1; } - TRACE(("%s: block size %d, sector size %d, sectors/cluster %d\n", __FUNCTION__, - fBlockSize, fBytesPerSector, fSectorsPerCluster)); - TRACE(("%s: block shift %d, sector shift %d, cluster shift %d\n", __FUNCTION__, - fBlockShift, fSectorShift, fClusterShift)); - TRACE(("%s: reserved %d, max root entries %d, media %02x, sectors/fat %d\n", __FUNCTION__, - fReservedSectors, fMaxRootEntries, fMediaDesc, fSectorsPerFat)); - + TRACE(("%s: block size %d, sector size %d, sectors/cluster %d\n", + __FUNCTION__, fBlockSize, fBytesPerSector, fSectorsPerCluster)); + TRACE(("%s: block shift %d, sector shift %d, cluster shift %d\n", + __FUNCTION__, fBlockShift, fSectorShift, fClusterShift)); + TRACE(("%s: reserved %d, max root entries %d, media %02x, sectors/fat %d\n", + __FUNCTION__, fReservedSectors, fMaxRootEntries, fMediaDesc, + fSectorsPerFat)); //if (fTotalSectors > partition->sectors_per_track * partition->cylinder_count * partition->head_count) if ((off_t)fTotalSectors * fBytesPerSector > partition->size) @@ -150,7 +152,7 @@ Volume::Volume(boot::Partition *partition) TRACE(("%s: found fat%d filesystem, root dir at cluster %d\n", __FUNCTION__, fFatBits, fRootDirCluster)); - fRoot = new Directory(*this, 0, fRootDirCluster, "/"); + fRoot = new(nothrow) Directory(*this, 0, fRootDirCluster, "/"); return; err1: @@ -413,7 +415,7 @@ static status_t dosfs_get_file_system(boot::Partition *partition, ::Directory **_root) { TRACE(("%s()\n", __FUNCTION__)); - Volume *volume = new Volume(partition); + Volume *volume = new(nothrow) Volume(partition); if (volume == NULL) return B_NO_MEMORY; diff --git a/src/system/boot/loader/file_systems/fat/fatfs.cpp b/src/system/boot/loader/file_systems/fat/fatfs.cpp index 074476f3e1..2a989109f8 100644 --- a/src/system/boot/loader/file_systems/fat/fatfs.cpp +++ b/src/system/boot/loader/file_systems/fat/fatfs.cpp @@ -1,14 +1,13 @@ /* -** Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. -** Distributed under the terms of the OpenBeOS License. -*/ + * Copyright 2008, François Revol + * Distributed under the terms of the MIT License. + */ #include "fatfs.h" #include #include -#include #include #include diff --git a/src/system/boot/loader/file_systems/hfs_plus/hfs_plus.cpp b/src/system/boot/loader/file_systems/hfs_plus/hfs_plus.cpp index c44cc1a227..ea3d0c26d0 100644 --- a/src/system/boot/loader/file_systems/hfs_plus/hfs_plus.cpp +++ b/src/system/boot/loader/file_systems/hfs_plus/hfs_plus.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2005-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -8,7 +8,6 @@ #include #include -#include #include #include diff --git a/src/system/boot/loader/file_systems/tarfs/tarfs.cpp b/src/system/boot/loader/file_systems/tarfs/tarfs.cpp index 6b75f2733c..60960fc8af 100644 --- a/src/system/boot/loader/file_systems/tarfs/tarfs.cpp +++ b/src/system/boot/loader/file_systems/tarfs/tarfs.cpp @@ -1,6 +1,6 @@ /* * Copyright 2005-2007, Ingo Weinhold, bonefish@cs.tu-berlin.de. - * Copyright 2005-2009, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2005-2013, Axel Dörfler, axeld@pinc-software.de. * * Distributed under the terms of the MIT License. */ @@ -21,7 +21,6 @@ #include #include -#include #include @@ -39,6 +38,7 @@ static const size_t kTarRegionSize = 8 * 1024 * 1024; // 8 MB namespace TarFS { + struct RegionDelete { inline void operator()(void* memory) { @@ -813,7 +813,6 @@ TarFS::Volume::_Inflate(boot::Partition* partition, void* cookie, off_t offset, } - // #pragma mark - diff --git a/src/system/boot/loader/heap.cpp b/src/system/boot/loader/heap.cpp index 970ce7f272..574548dda5 100644 --- a/src/system/boot/loader/heap.cpp +++ b/src/system/boot/loader/heap.cpp @@ -1,12 +1,11 @@ /* - * Copyright 2003-2009, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ #include #include -#include #ifdef HEAP_TEST # include diff --git a/src/system/boot/loader/main.cpp b/src/system/boot/loader/main.cpp index 63a78a1e9a..efa659a351 100644 --- a/src/system/boot/loader/main.cpp +++ b/src/system/boot/loader/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2005, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -14,8 +14,6 @@ #include #include -#include - //#define TRACE_MAIN #ifdef TRACE_MAIN diff --git a/src/system/boot/loader/menu.cpp b/src/system/boot/loader/menu.cpp index fbb90d5427..4e4da2cd4f 100644 --- a/src/system/boot/loader/menu.cpp +++ b/src/system/boot/loader/menu.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2010, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * Copyright 2011, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -21,7 +21,6 @@ #include #include #include -#include #include #include "kernel_debug_config.h" diff --git a/src/system/boot/loader/partitions.cpp b/src/system/boot/loader/partitions.cpp index 29d4f20f76..f70bc8a407 100644 --- a/src/system/boot/loader/partitions.cpp +++ b/src/system/boot/loader/partitions.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -16,7 +16,6 @@ #include #include #include -#include #include "RootFileSystem.h" @@ -212,7 +211,7 @@ Partition::Type() const Partition * Partition::AddChild() { - Partition *child = new Partition(fFD); + Partition *child = new(nothrow) Partition(fFD); TRACE(("%p Partition::AddChild %p\n", this, child)); if (child == NULL) return NULL; @@ -426,7 +425,7 @@ add_partitions_for(int fd, bool mountFileSystems, bool isBootDevice) TRACE(("add_partitions_for(fd = %d, mountFS = %s)\n", fd, mountFileSystems ? "yes" : "no")); - Partition *partition = new Partition(fd); + Partition *partition = new(nothrow) Partition(fd); // set some magic/default values partition->block_size = 512; diff --git a/src/system/boot/loader/stdio.cpp b/src/system/boot/loader/stdio.cpp index ca430ea730..267ddbd46f 100644 --- a/src/system/boot/loader/stdio.cpp +++ b/src/system/boot/loader/stdio.cpp @@ -1,12 +1,11 @@ /* - * Copyright 2003-2006, Axel Dörfler, axeld@pinc-software.de. All rights reserved. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ #include #include -#include #include #include diff --git a/src/system/boot/loader/vfs.cpp b/src/system/boot/loader/vfs.cpp index 9c1d5e1e1f..8e6b6c0867 100644 --- a/src/system/boot/loader/vfs.cpp +++ b/src/system/boot/loader/vfs.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2003-2008, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2003-2013, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -18,7 +18,6 @@ #include #include #include -#include #include #include "RootFileSystem.h"