diff --git a/src/Files/Files.cpp b/src/Files/Files.cpp index fac01b7..508ba30 100644 --- a/src/Files/Files.cpp +++ b/src/Files/Files.cpp @@ -246,7 +246,7 @@ OSErr ResolveAlias(const FSSpec* spec, AliasHandle alias, FSSpec* target, Boolea { *wasChanged = false; - int aliasSize = GetHandleSize(alias); + Size aliasSize = GetHandleSize(alias); // the target FN is at offset 50, and the target FN is a Str63, so 50+64 if (aliasSize < 50 + 64) @@ -400,4 +400,4 @@ OSErr SetFPos(short refNum, short posMode, long filePos) FSSpec Pomme::Files::HostPathToFSSpec(const fs::path& fullPath) { return dynamic_cast(volumes[0].get())->ToFSSpec(fullPath); -} \ No newline at end of file +} diff --git a/src/Files/Resources.cpp b/src/Files/Resources.cpp index ea93fe9..b59daa3 100644 --- a/src/Files/Resources.cpp +++ b/src/Files/Resources.cpp @@ -63,7 +63,7 @@ short FSpOpenResFile(const FSSpec* spec, char permission) } auto f = Pomme::BigEndianIStream(Pomme::Files::GetStream(slot)); - auto resForkOff = f.Tell(); + std::streamoff resForkOff = f.Tell(); // ---------------- // Load resource fork @@ -75,8 +75,8 @@ short FSpOpenResFile(const FSSpec* spec, char permission) // ------------------- // Resource Header - UInt32 dataSectionOff = f.Read() + resForkOff; - UInt32 mapSectionOff = f.Read() + resForkOff; + std::streamoff dataSectionOff = f.Read() + resForkOff; + std::streamoff mapSectionOff = f.Read() + resForkOff; f.Skip(4); // UInt32 dataSectionLen f.Skip(4); // UInt32 mapSectionLen f.Skip(112 + 128); // system- (112) and app- (128) reserved data @@ -88,8 +88,8 @@ short FSpOpenResFile(const FSSpec* spec, char permission) // map header f.Skip(16 + 4 + 2); // junk f.Skip(2); // UInt16 fileAttr - UInt32 typeListOff = f.Read() + mapSectionOff; - UInt32 resNameListOff = f.Read() + mapSectionOff; + std::streamoff typeListOff = f.Read() + mapSectionOff; + std::streamoff resNameListOff = f.Read() + mapSectionOff; // all resource types int nResTypes = 1 + f.Read(); @@ -97,7 +97,7 @@ short FSpOpenResFile(const FSSpec* spec, char permission) { OSType resType = f.Read(); int resCount = f.Read() + 1; - UInt32 resRefListOff = f.Read() + typeListOff; + std::streamoff resRefListOff = f.Read() + typeListOff; // The guard will rewind the file cursor to the pos in the next iteration auto guard1 = f.GuardPos(); @@ -116,7 +116,7 @@ short FSpOpenResFile(const FSSpec* spec, char permission) // unpack attributes Byte resFlags = (resPackedAttr & 0xFF000000) >> 24; - UInt32 resDataOff = (resPackedAttr & 0x00FFFFFF) + dataSectionOff; + std::streamoff resDataOff = (resPackedAttr & 0x00FFFFFF) + dataSectionOff; // Check compressed flag ResourceAssert(!(resFlags & 1), "FSpOpenResFile: Compressed resources not supported yet"); diff --git a/src/Memory/Memory.cpp b/src/Memory/Memory.cpp index 6a574f8..294ebf2 100644 --- a/src/Memory/Memory.cpp +++ b/src/Memory/Memory.cpp @@ -97,7 +97,7 @@ Handle NewHandle(Size size) if (size > 0x7FFFFFFF) throw std::invalid_argument("trying to alloc massive handle"); - BlockDescriptor* block = BlockDescriptor::Allocate(size); + BlockDescriptor* block = BlockDescriptor::Allocate((UInt32) size); return &block->ptrToData; } @@ -175,7 +175,7 @@ Ptr NewPtr(Size byteCount) #if !POMME_PTR_TRACKING return new char[byteCount]; #else - BlockDescriptor* bd = BlockDescriptor::Allocate(byteCount); + BlockDescriptor* bd = BlockDescriptor::Allocate((UInt32) byteCount); return bd->ptrToData; #endif } diff --git a/src/PommeFiles.h b/src/PommeFiles.h index e9b45df..efaa60e 100644 --- a/src/PommeFiles.h +++ b/src/PommeFiles.h @@ -15,7 +15,7 @@ namespace Pomme::Files SInt16 id; Byte flags; SInt32 size; - UInt32 dataOffset; + std::streamoff dataOffset; std::string name; }; diff --git a/src/SoundMixer/cmixer.cpp b/src/SoundMixer/cmixer.cpp index 32403ca..86f2575 100644 --- a/src/SoundMixer/cmixer.cpp +++ b/src/SoundMixer/cmixer.cpp @@ -163,7 +163,7 @@ void Mixer::SetMasterGain(double newGain) { if (newGain < 0) newGain = 0; - gain = FX_FROM_FLOAT(newGain); + gain = (int) FX_FROM_FLOAT(newGain); } void Mixer::Process(int16_t* dst, int len) @@ -398,8 +398,8 @@ void Source::RecalcGains() { double l = this->gain * (pan <= 0. ? 1. : 1. - pan); double r = this->gain * (pan >= 0. ? 1. : 1. + pan); - this->lgain = FX_FROM_FLOAT(l); - this->rgain = FX_FROM_FLOAT(r); + this->lgain = (int) FX_FROM_FLOAT(l); + this->rgain = (int) FX_FROM_FLOAT(r); } void Source::SetGain(double newGain) @@ -425,7 +425,7 @@ void Source::SetPitch(double newPitch) { newRate = 0.001; } - rate = FX_FROM_FLOAT(newRate); + rate = (int) FX_FROM_FLOAT(newRate); } void Source::SetLoop(bool newLoop)