mirror of
https://github.com/jorio/Pomme.git
synced 2024-12-27 21:31:47 +00:00
Drop -Wno-unused-parameter
This commit is contained in:
parent
66edb10132
commit
d8e7457b95
@ -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
|
||||
)
|
||||
|
@ -352,6 +352,8 @@ OSErr GetEOF(short refNum, long* logEOF)
|
||||
|
||||
OSErr SetEOF(short refNum, long logEOF)
|
||||
{
|
||||
(void) refNum;
|
||||
(void) logEOF;
|
||||
TODO();
|
||||
return unimpErr;
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
@ -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);
|
||||
|
||||
|
@ -136,6 +136,8 @@ static std::vector<T> UnpackBits(BigEndianIStream& f, UInt16 rowbytes, int packe
|
||||
template<typename T>
|
||||
static std::vector<T> UnpackAllRows(BigEndianIStream& f, int w, int h, UInt16 rowbytes, std::size_t expectedItemCount)
|
||||
{
|
||||
(void) w;
|
||||
|
||||
LOG << "UnpackBits<" << typeid(T).name() << ">";
|
||||
|
||||
std::vector<T> data;
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -30,6 +30,8 @@ void ExitToShell()
|
||||
|
||||
void SysBeep(short duration)
|
||||
{
|
||||
(void) duration;
|
||||
|
||||
#ifdef _WIN32
|
||||
Pomme::Platform::Windows::SysBeep();
|
||||
#else
|
||||
|
23
src/Pomme.h
23
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
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,8 @@ void Pomme::Sound::xlaw::Decode(
|
||||
const std::span<const char> input,
|
||||
const std::span<char> output)
|
||||
{
|
||||
(void) nChannels;
|
||||
|
||||
if (2 * input.size() != output.size())
|
||||
{
|
||||
throw std::runtime_error("ulaw: incorrect input/output buffer sizes");
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user