Drop -Wno-unused-parameter

This commit is contained in:
Iliyas Jorio 2022-02-20 14:23:11 +01:00
parent 66edb10132
commit d8e7457b95
14 changed files with 92 additions and 23 deletions

View File

@ -141,8 +141,7 @@ if(MSVC)
/EHs # synchronous exceptions; also, extern "C" functions may throw exceptions /EHs # synchronous exceptions; also, extern "C" functions may throw exceptions
/W4 /W4
/wd4068 # ignore unrecognized pragmas /wd4068 # ignore unrecognized pragmas
/wd4100 # unreferenced formal parameter /wd4201 # nonstandard extension (nameless struct)
/wd4201 # nonstandard extension
/wd4244 # conversion from double to float /wd4244 # conversion from double to float
/wd4458 # declaration of variable hides class member /wd4458 # declaration of variable hides class member
/MP # multiprocessor compilation /MP # multiprocessor compilation
@ -153,7 +152,6 @@ else()
-Wextra -Wextra
-Wshadow -Wshadow
-Wno-multichar -Wno-multichar
-Wno-unused-parameter
-Wno-unknown-pragmas -Wno-unknown-pragmas
-fexceptions -fexceptions
) )

View File

@ -352,6 +352,8 @@ OSErr GetEOF(short refNum, long* logEOF)
OSErr SetEOF(short refNum, long logEOF) OSErr SetEOF(short refNum, long logEOF)
{ {
(void) refNum;
(void) logEOF;
TODO(); TODO();
return unimpErr; return unimpErr;
} }

View File

@ -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) 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)); std::ofstream df(ToPath(spec->parID, spec->cName));
df.close(); df.close();
// TODO: we could write an AppleDouble file to save the creator/filetype. // TODO: we could write an AppleDouble file to save the creator/filetype.

View File

@ -340,16 +340,25 @@ void RemoveResource(Handle theResource)
void AddResource(Handle theData, ResType theType, short theID, const char* name) void AddResource(Handle theData, ResType theType, short theID, const char* name)
{ {
(void) theData;
(void) theType;
(void) theID;
(void) name;
TODO(); TODO();
} }
void ChangedResource(Handle theResource) void ChangedResource(Handle theResource)
{ {
(void) theResource;
TODO(); TODO();
} }
void WriteResource(Handle theResource) void WriteResource(Handle theResource)
{ {
(void) theResource;
TODO(); TODO();
} }
@ -367,6 +376,8 @@ void DetachResource(Handle theResource)
long GetResourceSizeOnDisk(Handle theResource) long GetResourceSizeOnDisk(Handle theResource)
{ {
(void) theResource;
TODO(); TODO();
return -1; return -1;
} }

View File

@ -2,41 +2,64 @@
void ProtectEntry(short index, Boolean protect) void ProtectEntry(short index, Boolean protect)
{ {
(void) index;
(void) protect;
TODOMINOR(); TODOMINOR();
} }
void ReserveEntry(short index, Boolean reserve) void ReserveEntry(short index, Boolean reserve)
{ {
(void) index;
(void) reserve;
TODOMINOR(); TODOMINOR();
} }
void SetEntries(short start, short count, CSpecArray aTable) void SetEntries(short start, short count, CSpecArray aTable)
{ {
(void) start;
(void) count;
(void) aTable;
TODOMINOR(); TODOMINOR();
} }
void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor* dstRGB) void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor* dstRGB)
{ {
(void) srcPalette;
(void) srcEntry;
(void) dstRGB;
TODOMINOR(); TODOMINOR();
} }
void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor* srcRGB) void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor* srcRGB)
{ {
(void) dstPalette;
(void) dstEntry;
(void) srcRGB;
TODOMINOR(); TODOMINOR();
} }
PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance) PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance)
{ {
(void) entries;
(void) srcColors;
(void) srcUsage;
(void) srcTolerance;
TODOMINOR(); TODOMINOR();
return nil; 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(); TODOMINOR();
} }
void RestoreDeviceClut(GDHandle gdh) void RestoreDeviceClut(GDHandle gdh)
{ {
(void) gdh;
TODOMINOR(); TODOMINOR();
} }

View File

@ -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) 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); GrafPortImpl* impl = new GrafPortImpl(*boundsRect);
*offscreenGWorld = &impl->port; *offscreenGWorld = &impl->port;
return noErr; return noErr;
@ -231,6 +236,7 @@ void GetGWorld(CGrafPtr* port, GDHandle* gdh)
void SetGWorld(CGrafPtr port, GDHandle gdh) void SetGWorld(CGrafPtr port, GDHandle gdh)
{ {
(void) gdh;
SetPort(port); SetPort(port);
} }
@ -361,6 +367,8 @@ void PenNormal(void)
void PenSize(short width, short height) void PenSize(short width, short height)
{ {
(void) width;
(void) height;
TODOMINOR(); TODOMINOR();
} }
@ -462,6 +470,10 @@ void FrameRect(const Rect* r)
void FrameArc(const Rect* r, short startAngle, short arcAngle) void FrameArc(const Rect* r, short startAngle, short arcAngle)
{ {
(void) r;
(void) startAngle;
(void) arcAngle;
TODOMINOR(); TODOMINOR();
} }
@ -508,7 +520,7 @@ void DrawPicture(PicHandle myPicture, const Rect* dstRect)
if (srcWidth != dstWidth || srcHeight != dstHeight) if (srcWidth != dstWidth || srcHeight != dstHeight)
TODOFATAL2("we only support dstRect with the same width/height as the source picture"); TODOFATAL2("we only support dstRect with the same width/height as the source picture");
for (int y = 0; y < dstHeight; y++) for (int y = 0; y < dstHeight; y++)
{ {
memcpy( memcpy(
@ -529,6 +541,8 @@ void CopyBits(
void* maskRgn void* maskRgn
) )
{ {
(void) maskRgn;
auto& srcPM = GetImpl((PixMapPtr) srcBits); auto& srcPM = GetImpl((PixMapPtr) srcBits);
auto& dstPM = GetImpl(dstBits); auto& dstPM = GetImpl(dstBits);

View File

@ -136,6 +136,8 @@ static std::vector<T> UnpackBits(BigEndianIStream& f, UInt16 rowbytes, int packe
template<typename T> template<typename T>
static std::vector<T> UnpackAllRows(BigEndianIStream& f, int w, int h, UInt16 rowbytes, std::size_t expectedItemCount) static std::vector<T> UnpackAllRows(BigEndianIStream& f, int w, int h, UInt16 rowbytes, std::size_t expectedItemCount)
{ {
(void) w;
LOG << "UnpackBits<" << typeid(T).name() << ">"; LOG << "UnpackBits<" << typeid(T).name() << ">";
std::vector<T> data; std::vector<T> data;

View File

@ -132,6 +132,8 @@ Size GetHandleSize(Handle h)
void SetHandleSize(Handle handle, Size byteCount) void SetHandleSize(Handle handle, Size byteCount)
{ {
(void) handle;
(void) byteCount;
TODOFATAL(); TODOFATAL();
} }
@ -214,6 +216,8 @@ void Pomme_FlushPtrTracking(bool issueWarnings)
gLivePtrNums.clear(); gLivePtrNums.clear();
gCurrentPtrBatch++; gCurrentPtrBatch++;
gCurrentNumPtrsInBatch = 0; gCurrentNumPtrsInBatch = 0;
#else
(void) issueWarnings;
#endif #endif
} }
@ -227,5 +231,8 @@ void BlockMove(const void* srcPtr, void* destPtr, Size byteCount)
void BlockMoveData(const void* srcPtr, void* destPtr, Size byteCount) void BlockMoveData(const void* srcPtr, void* destPtr, Size byteCount)
{ {
(void) srcPtr;
(void) destPtr;
(void) byteCount;
TODOFATAL(); TODOFATAL();
} }

View File

@ -30,6 +30,8 @@ void ExitToShell()
void SysBeep(short duration) void SysBeep(short duration)
{ {
(void) duration;
#ifdef _WIN32 #ifdef _WIN32
Pomme::Platform::Windows::SysBeep(); Pomme::Platform::Windows::SysBeep();
#else #else

View File

@ -338,9 +338,6 @@ Boolean Button(void);
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Memory: No-op // Memory: No-op
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
// No-op in Pomme. // No-op in Pomme.
static inline void MaxApplZone(void) {} 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; } static inline Size CompactMemSys(Size size) { return size; }
// No-op in Pomme. // No-op in Pomme.
static inline void PurgeMem(Size size) {} static inline void PurgeMem(Size size) { (void) size; }
// No-op in Pomme. // No-op in Pomme.
static inline void PurgeMemSys(Size size) {} static inline void PurgeMemSys(Size size) { (void) size; }
// No-op in Pomme. // No-op in Pomme.
// TODO: do something about `grow` and return a large integer to make it look like we have tons of memory. // 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. // 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. // 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. // 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. // 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. // 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. // No-op in Pomme.
// To prevent the base address for an offscreen pixel image from being moved // To prevent the base address for an offscreen pixel image from being moved
// while you draw into or copy from its pixel map. // 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. // No-op in Pomme.
// If the Memory Manager started up in 24-bit mode, strips flag bits from 24-bit memory addresses; // 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. // otherwise (in 32-bit mode), returns the address unchanged.
static inline Ptr StripAddress(Ptr ptr) { return ptr; } // no-op static inline Ptr StripAddress(Ptr ptr) { return ptr; } // no-op
#pragma GCC diagnostic pop
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Memory: Handle // Memory: Handle

View File

@ -55,7 +55,7 @@ static inline int sign_extend(int val, unsigned bits)
return v.s >> shift; 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 step_index;
int predictor; int predictor;
@ -122,9 +122,9 @@ update:
for (int m = 0; m < 32; m++) for (int m = 0; m < 32; m++)
{ {
int byte = (uint8_t) (*in++); 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; 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; pos += nChannels;
} }
} }

View File

@ -65,6 +65,8 @@ void Pomme::Sound::xlaw::Decode(
const std::span<const char> input, const std::span<const char> input,
const std::span<char> output) const std::span<char> output)
{ {
(void) nChannels;
if (2 * input.size() != output.size()) if (2 * input.size() != output.size())
{ {
throw std::runtime_error("ulaw: incorrect input/output buffer sizes"); throw std::runtime_error("ulaw: incorrect input/output buffer sizes");

View File

@ -106,6 +106,8 @@ OSErr SndDisposeChannel(SndChannelPtr macChanPtr, Boolean quietNow)
OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatus) OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatus)
{ {
(void) theLength;
*theStatus = {}; *theStatus = {};
auto& source = GetChannelImpl(chan).source; 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. // Not implemented yet, but you can probably use SndDoImmediateInstead.
OSErr SndDoCommand(SndChannelPtr chan, const SndCommand* cmd, Boolean noWait) 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."); TODOMINOR2("SndDoCommand isn't implemented yet, but you can probably use SndDoImmediate instead.");
return noErr; return noErr;
} }
@ -282,6 +287,9 @@ OSErr SndStartFilePlay(
FilePlayCompletionUPP theCompletion, FilePlayCompletionUPP theCompletion,
Boolean async) Boolean async)
{ {
(void) bufferSize;
(void) theBuffer;
if (resNum != 0) if (resNum != 0)
{ {
TODO2("playing snd resource not implemented yet, resource " << resNum); TODO2("playing snd resource not implemented yet, resource " << resNum);

View File

@ -92,6 +92,7 @@ void cmixer::InitWithSDL()
fmt.samples = 1024; fmt.samples = 1024;
fmt.callback = [](void* udata, Uint8* stream, int size) fmt.callback = [](void* udata, Uint8* stream, int size)
{ {
(void) udata;
gMixer.Process((int16_t*) stream, size / 2); gMixer.Process((int16_t*) stream, size / 2);
}; };
@ -627,7 +628,7 @@ WavStream cmixer::LoadWAVFromFile(const char* path)
// Check header // Check header
if (memcmp(p, "RIFF", 4) || memcmp(p + 8, "WAVE", 4)) if (memcmp(p, "RIFF", 4) || memcmp(p + 8, "WAVE", 4))
throw std::invalid_argument("bad wav header"); throw std::invalid_argument("bad wav header");
// Find fmt subchunk // Find fmt subchunk
p = FindChunk(data, len, "fmt ", &sz); p = FindChunk(data, len, "fmt ", &sz);
if (!p) if (!p)