mirror of https://github.com/OpenTTD/OpenTTD
Codechange: use std::fill_n/copy_n over MemSetT/MemCpyT
parent
0d922c9d62
commit
cc51b29234
|
@ -11,7 +11,6 @@
|
||||||
#include "../zoom_func.h"
|
#include "../zoom_func.h"
|
||||||
#include "../settings_type.h"
|
#include "../settings_type.h"
|
||||||
#include "../core/math_func.hpp"
|
#include "../core/math_func.hpp"
|
||||||
#include "../core/mem_func.hpp"
|
|
||||||
#include "8bpp_optimized.hpp"
|
#include "8bpp_optimized.hpp"
|
||||||
|
|
||||||
#include "../safeguards.h"
|
#include "../safeguards.h"
|
||||||
|
@ -96,7 +95,7 @@ void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Z
|
||||||
}
|
}
|
||||||
|
|
||||||
case BlitterMode::BlackRemap:
|
case BlitterMode::BlackRemap:
|
||||||
MemSetT(dst, 0, pixels);
|
std::fill_n(dst, pixels, 0);
|
||||||
dst += pixels;
|
dst += pixels;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -112,7 +111,7 @@ void Blitter_8bppOptimized::Draw(Blitter::BlitterParams *bp, BlitterMode mode, Z
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
MemCpyT(dst, src, pixels);
|
std::copy_n(src, pixels, dst);
|
||||||
dst += pixels; src += pixels;
|
dst += pixels; src += pixels;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
#include "gfx_func.h"
|
#include "gfx_func.h"
|
||||||
#include "zoom_func.h"
|
#include "zoom_func.h"
|
||||||
#include "core/random_func.hpp"
|
#include "core/random_func.hpp"
|
||||||
#include "core/mem_func.hpp"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "core/geometry_func.hpp"
|
#include "core/geometry_func.hpp"
|
||||||
#include "string_func.h"
|
#include "string_func.h"
|
||||||
|
@ -439,7 +438,7 @@ void MusicSystem::SaveCustomPlaylist(PlaylistChoices pl)
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t num = 0;
|
size_t num = 0;
|
||||||
MemSetT(settings_pl, 0, NUM_SONGS_PLAYLIST);
|
std::fill_n(settings_pl, NUM_SONGS_PLAYLIST, 0);
|
||||||
|
|
||||||
for (const auto &song : this->standard_playlists[pl]) {
|
for (const auto &song : this->standard_playlists[pl]) {
|
||||||
/* Music set indices in the settings playlist are 1-based, 0 means unused slot */
|
/* Music set indices in the settings playlist are 1-based, 0 means unused slot */
|
||||||
|
|
Loading…
Reference in New Issue