diff --git a/game-music-emu/gme/Dual_Resampler.cpp b/game-music-emu/gme/Dual_Resampler.cpp index 8644517ca..fe2085803 100644 --- a/game-music-emu/gme/Dual_Resampler.cpp +++ b/game-music-emu/gme/Dual_Resampler.cpp @@ -62,10 +62,10 @@ void Dual_Resampler::play_frame_( Blip_Buffer& blip_buf, dsample_t* out ) assert( blip_buf.samples_avail() == pair_count ); resampler.write( new_count ); - + long count = resampler.read( sample_buf.begin(), sample_buf_size ); assert( count == (long) sample_buf_size ); - + mix_samples( blip_buf, out ); blip_buf.remove_samples( pair_count ); } diff --git a/game-music-emu/gme/Gbs_Emu.h b/game-music-emu/gme/Gbs_Emu.h index 93fe691e5..6cc6b474b 100644 --- a/game-music-emu/gme/Gbs_Emu.h +++ b/game-music-emu/gme/Gbs_Emu.h @@ -41,7 +41,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } diff --git a/game-music-emu/gme/Gym_Emu.h b/game-music-emu/gme/Gym_Emu.h index 05419ea20..0f7a0e39c 100644 --- a/game-music-emu/gme/Gym_Emu.h +++ b/game-music-emu/gme/Gym_Emu.h @@ -34,7 +34,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } enum { gym_rate = 60 }; diff --git a/game-music-emu/gme/Music_Emu.h b/game-music-emu/gme/Music_Emu.h index 81e1e67cc..6a2eaa110 100644 --- a/game-music-emu/gme/Music_Emu.h +++ b/game-music-emu/gme/Music_Emu.h @@ -58,7 +58,7 @@ public: void ignore_silence( bool disable = true ); // Info for current track - Gme_File::track_info; + using Gme_File::track_info; blargg_err_t track_info( track_info_t* out ) const; // Sound customization diff --git a/game-music-emu/gme/Nsf_Emu.h b/game-music-emu/gme/Nsf_Emu.h index e06b91727..fcce66a1e 100644 --- a/game-music-emu/gme/Nsf_Emu.h +++ b/game-music-emu/gme/Nsf_Emu.h @@ -44,7 +44,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } diff --git a/game-music-emu/gme/Nsfe_Emu.h b/game-music-emu/gme/Nsfe_Emu.h index 561c3be0f..00ac40399 100644 --- a/game-music-emu/gme/Nsfe_Emu.h +++ b/game-music-emu/gme/Nsfe_Emu.h @@ -46,7 +46,7 @@ public: public: // deprecated struct header_t { char tag [4]; }; - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } void disable_playlist( bool = true ); // use clear_playlist() diff --git a/game-music-emu/gme/Spc_Emu.h b/game-music-emu/gme/Spc_Emu.h index 44b54c309..0c4a7fb27 100644 --- a/game-music-emu/gme/Spc_Emu.h +++ b/game-music-emu/gme/Spc_Emu.h @@ -47,7 +47,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } byte const* trailer() const; // use track_info() diff --git a/game-music-emu/gme/Vgm_Emu.h b/game-music-emu/gme/Vgm_Emu.h index bcb784d56..7a82fd109 100644 --- a/game-music-emu/gme/Vgm_Emu.h +++ b/game-music-emu/gme/Vgm_Emu.h @@ -51,7 +51,7 @@ public: public: // deprecated - Music_Emu::load; + using Music_Emu::load; blargg_err_t load( header_t const& h, Data_Reader& in ) // use Remaining_Reader { return load_remaining_( &h, sizeof h, in ); } byte const* gd3_data( int* size_out = 0 ) const; // use track_info() diff --git a/src/d_protocol.cpp b/src/d_protocol.cpp index 3698e5696..11e682cda 100644 --- a/src/d_protocol.cpp +++ b/src/d_protocol.cpp @@ -217,10 +217,10 @@ int PackUserCmd (const usercmd_t *ucmd, const usercmd_t *basis, BYTE **stream) buttons_changed = ucmd->buttons ^ basis->buttons; if (buttons_changed != 0) { - BYTE bytes[4] = { ucmd->buttons & 0x7F, - (ucmd->buttons >> 7) & 0x7F, - (ucmd->buttons >> 14) & 0x7F, - (ucmd->buttons >> 21) & 0xFF }; + BYTE bytes[4] = { BYTE(ucmd->buttons & 0x7F), + BYTE((ucmd->buttons >> 7) & 0x7F), + BYTE((ucmd->buttons >> 14) & 0x7F), + BYTE((ucmd->buttons >> 21) & 0xFF) }; flags |= UCMDF_BUTTONS; diff --git a/src/g_game.cpp b/src/g_game.cpp index 3d18f8fad..e271c8a51 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2104,7 +2104,7 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio if (level.time != 0 || level.maptime != 0) { - DWORD time[2] = { BigLong(TICRATE), BigLong(level.time) }; + DWORD time[2] = { DWORD(BigLong(TICRATE)), DWORD(BigLong(level.time)) }; M_AppendPNGChunk (stdfile, MAKE_ID('p','t','I','c'), (BYTE *)&time, 8); } diff --git a/src/m_png.cpp b/src/m_png.cpp index 4c329815f..dd2e46970 100644 --- a/src/m_png.cpp +++ b/src/m_png.cpp @@ -384,19 +384,19 @@ PNGHandle *M_VerifyPNG (FILE *file) if (fread (&data, 1, 8, file) != 8) { - return false; + return NULL; } if (data[0] != MAKE_ID(137,'P','N','G') || data[1] != MAKE_ID(13,10,26,10)) { // Does not have PNG signature - return false; + return NULL; } if (fread (&data, 1, 8, file) != 8) { - return false; + return NULL; } if (data[1] != MAKE_ID('I','H','D','R')) { // IHDR must be the first chunk - return false; + return NULL; } // It looks like a PNG so far, so start creating a PNGHandle for it @@ -451,7 +451,7 @@ PNGHandle *M_VerifyPNG (FILE *file) } delete png; - return false; + return NULL; } //========================================================================== diff --git a/src/oplsynth/music_opldumper_mididevice.cpp b/src/oplsynth/music_opldumper_mididevice.cpp index bbc4c9ec4..51e80a801 100644 --- a/src/oplsynth/music_opldumper_mididevice.cpp +++ b/src/oplsynth/music_opldumper_mididevice.cpp @@ -235,13 +235,13 @@ void DiskWriterIO::OPLwriteReg(int which, uint reg, uchar data) { if (reg != 0 && reg != 2 && (reg != 255 || data != 255)) { - BYTE cmd[2] = { data, reg }; + BYTE cmd[2] = { data, BYTE(reg) }; fwrite(cmd, 1, 2, File); } } else { - BYTE cmd[3] = { 4, reg, data }; + BYTE cmd[3] = { 4, BYTE(reg), data }; fwrite (cmd + (reg > 4), 1, 3 - (reg > 4), File); } } @@ -261,7 +261,7 @@ void DiskWriterIO :: SetChip(int chipnum) CurChip = chipnum; if (Format == FMT_RDOS) { - BYTE switcher[2] = { chipnum + 1, 2 }; + BYTE switcher[2] = { BYTE(chipnum + 1), 2 }; fwrite(switcher, 1, 2, File); } else @@ -309,7 +309,7 @@ void DiskWriterIO::SetClockRate(double samples_per_tick) } else { // Change the clock rate in the middle of the song. - BYTE clock_change[4] = { 0, 2, clock_word & 255, clock_word >> 8 }; + BYTE clock_change[4] = { 0, 2, BYTE(clock_word & 255), BYTE(clock_word >> 8) }; fwrite(clock_change, 1, 4, File); } } diff --git a/src/resourcefiles/file_wad.cpp b/src/resourcefiles/file_wad.cpp index 3a6de70ea..a0f04269c 100644 --- a/src/resourcefiles/file_wad.cpp +++ b/src/resourcefiles/file_wad.cpp @@ -154,7 +154,7 @@ inline bool FWadFile::IsMarker(int lump, const char *marker) struct Marker { int markertype; - int index; + unsigned int index; }; void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, namespace_t space, bool flathack) @@ -168,13 +168,13 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name { if (IsMarker(i, startmarker)) { - Marker m = {0, i }; + Marker m = { 0, i }; markers.Push(m); numstartmarkers++; } else if (IsMarker(i, endmarker)) { - Marker m = {1, i }; + Marker m = { 1, i }; markers.Push(m); numendmarkers++; } @@ -191,8 +191,8 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name { // We have found no F_START but one or more F_END markers. // mark all lumps before the last F_END marker as potential flats. - int end = markers[markers.Size()-1].index; - for(int i = 0; i < end; i++) + unsigned int end = markers[markers.Size()-1].index; + for(unsigned int i = 0; i < end; i++) { if (Lumps[i].LumpSize == 4096) { diff --git a/src/sdl/crashcatcher.c b/src/sdl/crashcatcher.c index 863f97680..1dfa43af8 100644 --- a/src/sdl/crashcatcher.c +++ b/src/sdl/crashcatcher.c @@ -14,7 +14,7 @@ #ifndef PR_SET_PTRACER #define PR_SET_PTRACER 0x59616d61 #endif -#else if defined (__APPLE__) +#elif defined (__APPLE__) #include #endif diff --git a/src/sound/music_dumb.cpp b/src/sound/music_dumb.cpp index 101368934..d0423e256 100644 --- a/src/sound/music_dumb.cpp +++ b/src/sound/music_dumb.cpp @@ -532,7 +532,7 @@ DUMBFILE *dumb_read_allfile(dumbfile_mem_status *filestate, BYTE *start, FILE *f if (fread(mem + lenhave, 1, lenfull - lenhave, file) != (size_t)(lenfull - lenhave)) { delete[] mem; - return false; + return NULL; } filestate->ptr = mem; } diff --git a/src/textures/animations.cpp b/src/textures/animations.cpp index 5b50ca901..aaf6d03d6 100644 --- a/src/textures/animations.cpp +++ b/src/textures/animations.cpp @@ -465,7 +465,7 @@ void FTextureManager::ParseRangeAnim (FScanner &sc, FTextureID picnum, int usety void FTextureManager::ParsePicAnim (FScanner &sc, FTextureID picnum, int usetype, bool missing, TArray &frames) { FTextureID framenum; - DWORD min, max; + DWORD min = 1, max = 1; framenum = ParseFramenum (sc, picnum, usetype, missing); ParseTime (sc, min, max); @@ -536,6 +536,7 @@ void FTextureManager::ParseTime (FScanner &sc, DWORD &min, DWORD &max) } else { + min = max = 1; sc.ScriptError ("Must specify a duration for animation frame"); } } diff --git a/src/textures/emptytexture.cpp b/src/textures/emptytexture.cpp index d0637c9a5..3583d7316 100644 --- a/src/textures/emptytexture.cpp +++ b/src/textures/emptytexture.cpp @@ -71,10 +71,10 @@ protected: FTexture *EmptyTexture_TryCreate(FileReader & file, int lumpnum) { char check[8]; - if (file.GetLength() != 8) return false; + if (file.GetLength() != 8) return NULL; file.Seek(0, SEEK_SET); - if (file.Read(check, 8) != 8) return false; - if (memcmp(check, "\0\0\0\0\0\0\0\0", 8)) return false; + if (file.Read(check, 8) != 8) return NULL; + if (memcmp(check, "\0\0\0\0\0\0\0\0", 8)) return NULL; return new FEmptyTexture(lumpnum); } diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 57489b91e..af22129a6 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -1032,7 +1032,7 @@ FxCompareRel::FxCompareRel(int o, FxExpression *l, FxExpression *r) FxExpression *FxCompareRel::Resolve(FCompileContext& ctx) { CHECKRESOLVED(); - if (!ResolveLR(ctx, true)) return false; + if (!ResolveLR(ctx, true)) return NULL; if (!ValueType.isNumeric()) { @@ -1126,7 +1126,7 @@ FxExpression *FxCompareEq::Resolve(FCompileContext& ctx) { CHECKRESOLVED(); - if (!ResolveLR(ctx, true)) return false; + if (!ResolveLR(ctx, true)) return NULL; if (!left || !right) { @@ -1229,7 +1229,7 @@ FxBinaryInt::FxBinaryInt(int o, FxExpression *l, FxExpression *r) FxExpression *FxBinaryInt::Resolve(FCompileContext& ctx) { CHECKRESOLVED(); - if (!ResolveLR(ctx, false)) return false; + if (!ResolveLR(ctx, false)) return NULL; if (ctx.lax && ValueType == VAL_Float) {