diff --git a/Cache/ConcreteBlockCache.h b/Cache/ConcreteBlockCache.h index aead0e6..64a2edb 100644 --- a/Cache/ConcreteBlockCache.h +++ b/Cache/ConcreteBlockCache.h @@ -22,11 +22,13 @@ public: virtual void release(unsigned block, int flags); virtual void markDirty(unsigned block); + + // public so make_shared can access it. + ConcreteBlockCache(BlockDevicePointer device, unsigned size); private: - ConcreteBlockCache(BlockDevicePointer device, unsigned size); struct Entry { unsigned block; diff --git a/Cache/MappedBlockCache.h b/Cache/MappedBlockCache.h index e02a854..ddde099 100644 --- a/Cache/MappedBlockCache.h +++ b/Cache/MappedBlockCache.h @@ -22,10 +22,12 @@ class MappedBlockCache : public BlockCache { virtual void release(unsigned block, int flags); virtual void markDirty(unsigned block); - private: + // public so make_shared can access it. MappedBlockCache(BlockDevicePointer device, void *data); + private: + void sync(unsigned block); uint8_t *_data; diff --git a/Common/smart_pointers.h b/Common/smart_pointers.h index eee7fab..3f7762f 100644 --- a/Common/smart_pointers.h +++ b/Common/smart_pointers.h @@ -2,7 +2,7 @@ #ifndef __COMMON_SMART_POINTERS_H__ #define __COMMON_SMART_POINTERS_H__ -#ifdef CPP0X +#if 1 //C++0x #include diff --git a/Common/unordered_map.h b/Common/unordered_map.h index 19ff5f5..290ad83 100644 --- a/Common/unordered_map.h +++ b/Common/unordered_map.h @@ -1,7 +1,7 @@ #ifndef __COMMON_UNORDERED_MAP_H__ #define __COMMON_UNORDERED_MAP_H__ -#ifdef CPP0X +#if 1 //c++0x #include #define UNORDERED_MAP(...) std::unordered_map(__VA_ARGS__) diff --git a/Device/DavexDiskImage.h b/Device/DavexDiskImage.h index 0c25f04..bfff212 100644 --- a/Device/DavexDiskImage.h +++ b/Device/DavexDiskImage.h @@ -25,13 +25,11 @@ public: static bool Validate(MappedFile *, const std::nothrow_t &); static bool Validate(MappedFile *); - -private: - DavexDiskImage(); - + DavexDiskImage(MappedFile *); - +private: + DavexDiskImage(); bool _changed; std::string _volumeName; diff --git a/Device/DiskCopy42Image.h b/Device/DiskCopy42Image.h index a165b1a..532081a 100644 --- a/Device/DiskCopy42Image.h +++ b/Device/DiskCopy42Image.h @@ -28,12 +28,13 @@ public: virtual BlockCachePointer createBlockCache(); - -private: + DiskCopy42Image(); + DiskCopy42Image(MappedFile *); + +private: - DiskCopy42Image(MappedFile *); bool _changed; }; diff --git a/Device/DiskImage.h b/Device/DiskImage.h index 8a1b786..38b53e4 100644 --- a/Device/DiskImage.h +++ b/Device/DiskImage.h @@ -64,10 +64,11 @@ public: static bool Validate(MappedFile *, const std::nothrow_t &); static bool Validate(MappedFile *); + + ProDOSOrderDiskImage(MappedFile *); private: ProDOSOrderDiskImage(); - ProDOSOrderDiskImage(MappedFile *); }; class DOSOrderDiskImage : public DiskImage { @@ -79,11 +80,12 @@ public: static bool Validate(MappedFile *, const std::nothrow_t &); static bool Validate(MappedFile *); - + + + DOSOrderDiskImage(MappedFile *); private: DOSOrderDiskImage(); - DOSOrderDiskImage(MappedFile *); }; diff --git a/Device/RawDevice.h b/Device/RawDevice.h index 5f5507c..5fbb739 100644 --- a/Device/RawDevice.h +++ b/Device/RawDevice.h @@ -33,13 +33,11 @@ public: virtual void sync(); virtual unsigned blocks(); - -private: - - RawDevice(const char *name, File::FileFlags flags); - + + RawDevice(const char *name, File::FileFlags flags); RawDevice(File& file, File::FileFlags flags); +private: void devSize(int fd); diff --git a/Device/UniversalDiskImage.h b/Device/UniversalDiskImage.h index fc54026..3c6d885 100644 --- a/Device/UniversalDiskImage.h +++ b/Device/UniversalDiskImage.h @@ -26,11 +26,10 @@ public: static bool Validate(MappedFile *); + UniversalDiskImage(MappedFile *); private: UniversalDiskImage(); - - UniversalDiskImage(MappedFile *); uint32_t _format; uint32_t _flags; diff --git a/Makefile b/Makefile index 14dbe1e..5c53445 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -CC = g++ -CPPFLAGS += -Wall -W -Wno-multichar -I. -O2 -g +CC = c++ +CPPFLAGS += -Wall -W -Wno-multichar -Wno-c++11-narrowing -I. -O2 -g -std=c++11 LIBS += -lpthread UNAME = $(shell uname -s) @@ -92,7 +92,6 @@ EXCEPTION_OBJECTS += POSIX/Exception.o all: $(TARGETS) - apfm: o/apfm @true @@ -108,9 +107,10 @@ profuse: o/profuse xattr: o/xattr @true +o: + mkdir $@ - -o/xattr: bin/xattr.o +o/xattr: bin/xattr.o | o $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ o/newfs_pascal: bin/newfs_pascal.o \ @@ -120,7 +120,7 @@ o/newfs_pascal: bin/newfs_pascal.o \ ${FILE_OBJECTS} \ ${COMMON_OBJECTS} \ ${EXCEPTION_OBJECTS} \ - ${PASCAL_OBJECTS} + ${PASCAL_OBJECTS} | o $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ o/apfm: bin/apfm.o \ @@ -130,7 +130,7 @@ o/apfm: bin/apfm.o \ ${FILE_OBJECTS} \ ${COMMON_OBJECTS} \ ${EXCEPTION_OBJECTS} \ - ${PASCAL_OBJECTS} + ${PASCAL_OBJECTS} | o $(CC) $(LDFLAGS) $^ $(LIBS) -o $@ @@ -141,7 +141,7 @@ o/fuse_pascal: bin/fuse_pascal.o bin/fuse_pascal_ops.o \ ${FILE_OBJECTS} \ ${COMMON_OBJECTS} \ ${EXCEPTION_OBJECTS} \ - ${PASCAL_OBJECTS} + ${PASCAL_OBJECTS} | o $(CC) $(LDFLAGS) $^ $(LIBS) $(FUSE_LIBS) -o $@ @@ -153,7 +153,7 @@ o/profuse: bin/profuse.o bin/profuse_dirent.o bin/profuse_file.o \ ${FILE_OBJECTS} \ ${COMMON_OBJECTS} \ ${EXCEPTION_OBJECTS} \ - ${PRODOS_OBJECTS} + ${PRODOS_OBJECTS} | o $(CC) $(LDFLAGS) $^ $(LIBS) $(FUSE_LIBS) -o $@ diff --git a/Pascal/FileEntry.h b/Pascal/FileEntry.h index 80e3c61..8289de7 100644 --- a/Pascal/FileEntry.h +++ b/Pascal/FileEntry.h @@ -47,7 +47,10 @@ namespace Pascal { int truncate(unsigned newSize); - + + FileEntry(const char *name, unsigned fileKind); + FileEntry(void *vp); + protected: virtual void writeDirectoryEntry(LittleEndian::IOBuffer *); @@ -57,9 +60,7 @@ namespace Pascal { friend class VolumeEntry; - FileEntry(const char *name, unsigned fileKind); - FileEntry(void *vp); - + FileEntryPointer thisPointer() { return STATIC_POINTER_CAST(FileEntry, shared_from_this()); diff --git a/Pascal/VolumeEntry.h b/Pascal/VolumeEntry.h index ccb6b7f..564087e 100644 --- a/Pascal/VolumeEntry.h +++ b/Pascal/VolumeEntry.h @@ -56,6 +56,8 @@ namespace Pascal { int krunch(); + VolumeEntry(Device::BlockDevicePointer, const char *name); + VolumeEntry(Device::BlockDevicePointer); protected: virtual void writeDirectoryEntry(LittleEndian::IOBuffer *); @@ -66,8 +68,7 @@ namespace Pascal { VolumeEntry(); - VolumeEntry(Device::BlockDevicePointer, const char *name); - VolumeEntry(Device::BlockDevicePointer); + VolumeEntryPointer thisPointer() { diff --git a/ProDOS/Disk.h b/ProDOS/Disk.h index 683defc..1523d0a 100644 --- a/ProDOS/Disk.h +++ b/ProDOS/Disk.h @@ -16,7 +16,8 @@ #include #include -#include +#include +#include enum { @@ -44,7 +45,7 @@ enum { }; class Disk; -typedef std::tr1::shared_ptr DiskPointer; +typedef SHARED_PTR(Disk) DiskPointer; class Disk { diff --git a/bin/fuse_pascal.cpp b/bin/fuse_pascal.cpp index d384486..4c4d8b6 100644 --- a/bin/fuse_pascal.cpp +++ b/bin/fuse_pascal.cpp @@ -11,7 +11,6 @@ #ifdef __APPLE__ -#define __FreeBSD__ 10 #define __DARWIN_64_BIT_INO_T 1 #endif diff --git a/bin/fuse_pascal_ops.cpp b/bin/fuse_pascal_ops.cpp index d44ac32..03c0788 100644 --- a/bin/fuse_pascal_ops.cpp +++ b/bin/fuse_pascal_ops.cpp @@ -1,6 +1,5 @@ #ifdef __APPLE__ -#define __FreeBSD__ 10 #define __DARWIN_64_BIT_INO_T 1 #endif diff --git a/bin/profuse.cpp b/bin/profuse.cpp index cf60cd1..81db146 100644 --- a/bin/profuse.cpp +++ b/bin/profuse.cpp @@ -22,8 +22,6 @@ #include #include -#include - #include @@ -33,7 +31,6 @@ using std::vector; using std::string; -using std::tr1::shared_ptr; /* diff --git a/bin/profuse.h b/bin/profuse.h index 999c213..5e2a080 100644 --- a/bin/profuse.h +++ b/bin/profuse.h @@ -15,7 +15,6 @@ #ifdef __APPLE__ -#define __FreeBSD__ 10 #define __DARWIN_64_BIT_INO_T 1 #endif