diff --git a/CMakeLists.txt b/CMakeLists.txt index bab2b90..169767e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,8 +141,7 @@ if(MSVC) /EHs # synchronous exceptions; also, extern "C" functions may throw exceptions /W4 /wd4068 # ignore unrecognized pragmas - /wd4100 # unreferenced formal parameter - /wd4201 # nonstandard extension + /wd4201 # nonstandard extension (nameless struct) /wd4244 # conversion from double to float /wd4458 # declaration of variable hides class member /MP # multiprocessor compilation @@ -153,7 +152,6 @@ else() -Wextra -Wshadow -Wno-multichar - -Wno-unused-parameter -Wno-unknown-pragmas -fexceptions ) diff --git a/src/Files/Files.cpp b/src/Files/Files.cpp index 61c4b7a..fac01b7 100644 --- a/src/Files/Files.cpp +++ b/src/Files/Files.cpp @@ -352,6 +352,8 @@ OSErr GetEOF(short refNum, long* logEOF) OSErr SetEOF(short refNum, long logEOF) { + (void) refNum; + (void) logEOF; TODO(); return unimpErr; } diff --git a/src/Files/HostVolume.cpp b/src/Files/HostVolume.cpp index 9823042..dc25cc9 100644 --- a/src/Files/HostVolume.cpp +++ b/src/Files/HostVolume.cpp @@ -303,6 +303,10 @@ OSErr HostVolume::DirCreate(long parentDirID, const std::string& directoryName, OSErr HostVolume::FSpCreate(const FSSpec* spec, OSType creator, OSType fileType, ScriptCode scriptTag) { + (void) creator; + (void) fileType; + (void) scriptTag; + std::ofstream df(ToPath(spec->parID, spec->cName)); df.close(); // TODO: we could write an AppleDouble file to save the creator/filetype. diff --git a/src/Files/Resources.cpp b/src/Files/Resources.cpp index ef15a67..ea93fe9 100644 --- a/src/Files/Resources.cpp +++ b/src/Files/Resources.cpp @@ -340,16 +340,25 @@ void RemoveResource(Handle theResource) void AddResource(Handle theData, ResType theType, short theID, const char* name) { + (void) theData; + (void) theType; + (void) theID; + (void) name; + TODO(); } void ChangedResource(Handle theResource) { + (void) theResource; + TODO(); } void WriteResource(Handle theResource) { + (void) theResource; + TODO(); } @@ -367,6 +376,8 @@ void DetachResource(Handle theResource) long GetResourceSizeOnDisk(Handle theResource) { + (void) theResource; + TODO(); return -1; } diff --git a/src/Graphics/ColorManager.cpp b/src/Graphics/ColorManager.cpp index d7bb817..8801c8f 100644 --- a/src/Graphics/ColorManager.cpp +++ b/src/Graphics/ColorManager.cpp @@ -2,41 +2,64 @@ void ProtectEntry(short index, Boolean protect) { + (void) index; + (void) protect; TODOMINOR(); } void ReserveEntry(short index, Boolean reserve) { + (void) index; + (void) reserve; TODOMINOR(); } void SetEntries(short start, short count, CSpecArray aTable) { + (void) start; + (void) count; + (void) aTable; TODOMINOR(); } void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor* dstRGB) { + (void) srcPalette; + (void) srcEntry; + (void) dstRGB; TODOMINOR(); } void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor* srcRGB) { + (void) dstPalette; + (void) dstEntry; + (void) srcRGB; TODOMINOR(); } PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance) { + (void) entries; + (void) srcColors; + (void) srcUsage; + (void) srcTolerance; TODOMINOR(); return nil; } -void CopyPalette(PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry,short dstEntry, short dstLength) +void CopyPalette(PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry, short dstEntry, short dstLength) { + (void) srcPalette; + (void) dstPalette; + (void) srcEntry; + (void) dstEntry; + (void) dstLength; TODOMINOR(); } void RestoreDeviceClut(GDHandle gdh) { + (void) gdh; TODOMINOR(); } \ No newline at end of file diff --git a/src/Graphics/Graphics.cpp b/src/Graphics/Graphics.cpp index 7c9d77a..3db2ddf 100644 --- a/src/Graphics/Graphics.cpp +++ b/src/Graphics/Graphics.cpp @@ -213,6 +213,11 @@ static inline ARGBPixmap& GetImpl(PixMapPtr pixMap) OSErr NewGWorld(GWorldPtr* offscreenGWorld, short pixelDepth, const Rect* boundsRect, void* junk1, void* junk2, long junk3) { + (void) pixelDepth; + (void) junk1; + (void) junk2; + (void) junk3; + GrafPortImpl* impl = new GrafPortImpl(*boundsRect); *offscreenGWorld = &impl->port; return noErr; @@ -231,6 +236,7 @@ void GetGWorld(CGrafPtr* port, GDHandle* gdh) void SetGWorld(CGrafPtr port, GDHandle gdh) { + (void) gdh; SetPort(port); } @@ -361,6 +367,8 @@ void PenNormal(void) void PenSize(short width, short height) { + (void) width; + (void) height; TODOMINOR(); } @@ -462,6 +470,10 @@ void FrameRect(const Rect* r) void FrameArc(const Rect* r, short startAngle, short arcAngle) { + (void) r; + (void) startAngle; + (void) arcAngle; + TODOMINOR(); } @@ -508,7 +520,7 @@ void DrawPicture(PicHandle myPicture, const Rect* dstRect) if (srcWidth != dstWidth || srcHeight != dstHeight) TODOFATAL2("we only support dstRect with the same width/height as the source picture"); - + for (int y = 0; y < dstHeight; y++) { memcpy( @@ -529,6 +541,8 @@ void CopyBits( void* maskRgn ) { + (void) maskRgn; + auto& srcPM = GetImpl((PixMapPtr) srcBits); auto& dstPM = GetImpl(dstBits); diff --git a/src/Graphics/PICT.cpp b/src/Graphics/PICT.cpp index c916154..2e746cd 100644 --- a/src/Graphics/PICT.cpp +++ b/src/Graphics/PICT.cpp @@ -136,6 +136,8 @@ static std::vector UnpackBits(BigEndianIStream& f, UInt16 rowbytes, int packe template static std::vector UnpackAllRows(BigEndianIStream& f, int w, int h, UInt16 rowbytes, std::size_t expectedItemCount) { + (void) w; + LOG << "UnpackBits<" << typeid(T).name() << ">"; std::vector data; diff --git a/src/Memory/Memory.cpp b/src/Memory/Memory.cpp index 60e8fac..6a574f8 100644 --- a/src/Memory/Memory.cpp +++ b/src/Memory/Memory.cpp @@ -132,6 +132,8 @@ Size GetHandleSize(Handle h) void SetHandleSize(Handle handle, Size byteCount) { + (void) handle; + (void) byteCount; TODOFATAL(); } @@ -214,6 +216,8 @@ void Pomme_FlushPtrTracking(bool issueWarnings) gLivePtrNums.clear(); gCurrentPtrBatch++; gCurrentNumPtrsInBatch = 0; +#else + (void) issueWarnings; #endif } @@ -227,5 +231,8 @@ void BlockMove(const void* srcPtr, void* destPtr, Size byteCount) void BlockMoveData(const void* srcPtr, void* destPtr, Size byteCount) { + (void) srcPtr; + (void) destPtr; + (void) byteCount; TODOFATAL(); } diff --git a/src/Pomme.cpp b/src/Pomme.cpp index c6dfc53..a02610b 100644 --- a/src/Pomme.cpp +++ b/src/Pomme.cpp @@ -30,6 +30,8 @@ void ExitToShell() void SysBeep(short duration) { + (void) duration; + #ifdef _WIN32 Pomme::Platform::Windows::SysBeep(); #else diff --git a/src/Pomme.h b/src/Pomme.h index 0ed6823..e26f3ac 100644 --- a/src/Pomme.h +++ b/src/Pomme.h @@ -338,9 +338,6 @@ Boolean Button(void); //----------------------------------------------------------------------------- // Memory: No-op -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" - // No-op in Pomme. static inline void MaxApplZone(void) {} @@ -355,42 +352,40 @@ static inline Size CompactMem(Size size) { return size; } static inline Size CompactMemSys(Size size) { return size; } // No-op in Pomme. -static inline void PurgeMem(Size size) {} +static inline void PurgeMem(Size size) { (void) size; } // No-op in Pomme. -static inline void PurgeMemSys(Size size) {} +static inline void PurgeMemSys(Size size) { (void) size; } // No-op in Pomme. // TODO: do something about `grow` and return a large integer to make it look like we have tons of memory. -static inline Size MaxMem(Size* grow) { return 0; } +static inline Size MaxMem(Size* grow) { (void) grow; return 0; } // No-op in Pomme. -static inline void HNoPurge(Handle handle) {} // no-op +static inline void HNoPurge(Handle handle) { (void) handle; } // no-op // No-op in Pomme. -static inline void HLock(Handle handle) {} // no-op +static inline void HLock(Handle handle) { (void) handle; } // no-op // No-op in Pomme. -static inline void HLockHi(Handle handle) {} // no-op +static inline void HLockHi(Handle handle) { (void) handle; } // no-op // No-op in Pomme. -static inline void HUnlock(Handle handle) {} // no-op +static inline void HUnlock(Handle handle) { (void) handle; } // no-op // No-op in Pomme. -static inline void NoPurgePixels(PixMapHandle handle) {} // no-op +static inline void NoPurgePixels(PixMapHandle handle) { (void) handle; } // no-op // No-op in Pomme. // To prevent the base address for an offscreen pixel image from being moved // while you draw into or copy from its pixel map. -static inline Boolean LockPixels(PixMapHandle handle) { return true; } // no-op; shall always return true +static inline Boolean LockPixels(PixMapHandle handle) { (void) handle; return true; } // no-op; shall always return true // No-op in Pomme. // If the Memory Manager started up in 24-bit mode, strips flag bits from 24-bit memory addresses; // otherwise (in 32-bit mode), returns the address unchanged. static inline Ptr StripAddress(Ptr ptr) { return ptr; } // no-op -#pragma GCC diagnostic pop - //----------------------------------------------------------------------------- // Memory: Handle diff --git a/src/SoundFormats/IMA4.cpp b/src/SoundFormats/IMA4.cpp index b053416..951e67b 100644 --- a/src/SoundFormats/IMA4.cpp +++ b/src/SoundFormats/IMA4.cpp @@ -55,7 +55,7 @@ static inline int sign_extend(int val, unsigned bits) return v.s >> shift; } -static inline int adpcm_ima_qt_expand_nibble(ADPCMChannelStatus* c, int nibble, int shift) +static inline int adpcm_ima_qt_expand_nibble(ADPCMChannelStatus* c, int nibble) { int step_index; int predictor; @@ -122,9 +122,9 @@ update: for (int m = 0; m < 32; m++) { int byte = (uint8_t) (*in++); - out[pos] = adpcm_ima_qt_expand_nibble(&cs, byte & 0x0F, 3); + out[pos] = adpcm_ima_qt_expand_nibble(&cs, byte & 0x0F); pos += nChannels; - out[pos] = adpcm_ima_qt_expand_nibble(&cs, byte >> 4, 3); + out[pos] = adpcm_ima_qt_expand_nibble(&cs, byte >> 4); pos += nChannels; } } diff --git a/src/SoundFormats/xlaw.cpp b/src/SoundFormats/xlaw.cpp index 3b3c6c7..4cf4a68 100644 --- a/src/SoundFormats/xlaw.cpp +++ b/src/SoundFormats/xlaw.cpp @@ -65,6 +65,8 @@ void Pomme::Sound::xlaw::Decode( const std::span input, const std::span output) { + (void) nChannels; + if (2 * input.size() != output.size()) { throw std::runtime_error("ulaw: incorrect input/output buffer sizes"); diff --git a/src/SoundMixer/SoundManager.cpp b/src/SoundMixer/SoundManager.cpp index 952460b..e1e6ad1 100644 --- a/src/SoundMixer/SoundManager.cpp +++ b/src/SoundMixer/SoundManager.cpp @@ -106,6 +106,8 @@ OSErr SndDisposeChannel(SndChannelPtr macChanPtr, Boolean quietNow) OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatus) { + (void) theLength; + *theStatus = {}; auto& source = GetChannelImpl(chan).source; @@ -268,6 +270,9 @@ OSErr SndDoImmediate(SndChannelPtr chan, const SndCommand* cmd) // Not implemented yet, but you can probably use SndDoImmediateInstead. OSErr SndDoCommand(SndChannelPtr chan, const SndCommand* cmd, Boolean noWait) { + (void) chan; + (void) cmd; + (void) noWait; TODOMINOR2("SndDoCommand isn't implemented yet, but you can probably use SndDoImmediate instead."); return noErr; } @@ -282,6 +287,9 @@ OSErr SndStartFilePlay( FilePlayCompletionUPP theCompletion, Boolean async) { + (void) bufferSize; + (void) theBuffer; + if (resNum != 0) { TODO2("playing snd resource not implemented yet, resource " << resNum); diff --git a/src/SoundMixer/cmixer.cpp b/src/SoundMixer/cmixer.cpp index d9c355f..c6166f8 100644 --- a/src/SoundMixer/cmixer.cpp +++ b/src/SoundMixer/cmixer.cpp @@ -92,6 +92,7 @@ void cmixer::InitWithSDL() fmt.samples = 1024; fmt.callback = [](void* udata, Uint8* stream, int size) { + (void) udata; gMixer.Process((int16_t*) stream, size / 2); }; @@ -627,7 +628,7 @@ WavStream cmixer::LoadWAVFromFile(const char* path) // Check header if (memcmp(p, "RIFF", 4) || memcmp(p + 8, "WAVE", 4)) throw std::invalid_argument("bad wav header"); - + // Find fmt subchunk p = FindChunk(data, len, "fmt ", &sz); if (!p)