update to compile with c++11 and beyond.

This commit is contained in:
Kelvin Sherlock 2016-08-15 12:29:06 -04:00
parent 5d1b81ecca
commit 184b69747a
17 changed files with 44 additions and 45 deletions

View File

@ -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;

View File

@ -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;

View File

@ -2,7 +2,7 @@
#ifndef __COMMON_SMART_POINTERS_H__
#define __COMMON_SMART_POINTERS_H__
#ifdef CPP0X
#if 1
//C++0x
#include <memory>

View File

@ -1,7 +1,7 @@
#ifndef __COMMON_UNORDERED_MAP_H__
#define __COMMON_UNORDERED_MAP_H__
#ifdef CPP0X
#if 1
//c++0x
#include <unordered_map>
#define UNORDERED_MAP(...) std::unordered_map(__VA_ARGS__)

View File

@ -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;

View File

@ -28,12 +28,13 @@ public:
virtual BlockCachePointer createBlockCache();
private:
DiskCopy42Image();
DiskCopy42Image(MappedFile *);
private:
DiskCopy42Image(MappedFile *);
bool _changed;
};

View File

@ -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 *);
};

View File

@ -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);

View File

@ -26,11 +26,10 @@ public:
static bool Validate(MappedFile *);
UniversalDiskImage(MappedFile *);
private:
UniversalDiskImage();
UniversalDiskImage(MappedFile *);
uint32_t _format;
uint32_t _flags;

View File

@ -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 $@

View File

@ -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());

View File

@ -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()
{

View File

@ -16,7 +16,8 @@
#include <ProDOS/File.h>
#include <Device/BlockDevice.h>
#include <tr1/memory>
#include <memory>
#include <Common/smart_pointers.h>
enum {
@ -44,7 +45,7 @@ enum {
};
class Disk;
typedef std::tr1::shared_ptr<Disk> DiskPointer;
typedef SHARED_PTR(Disk) DiskPointer;
class Disk {

View File

@ -11,7 +11,6 @@
#ifdef __APPLE__
#define __FreeBSD__ 10
#define __DARWIN_64_BIT_INO_T 1
#endif

View File

@ -1,6 +1,5 @@
#ifdef __APPLE__
#define __FreeBSD__ 10
#define __DARWIN_64_BIT_INO_T 1
#endif

View File

@ -22,8 +22,6 @@
#include <vector>
#include <string>
#include <tr1/memory>
#include <Device/BlockDevice.h>
@ -33,7 +31,6 @@
using std::vector;
using std::string;
using std::tr1::shared_ptr;
/*

View File

@ -15,7 +15,6 @@
#ifdef __APPLE__
#define __FreeBSD__ 10
#define __DARWIN_64_BIT_INO_T 1
#endif