1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 11:10:03 +00:00

maelstrom: remove register keyword; fix clang (#351835)

This commit is contained in:
Emily 2024-10-28 16:30:07 +00:00 committed by GitHub
commit e87b505f51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 2 deletions

View file

@ -0,0 +1,32 @@
diff --git a/fastrand.cpp b/fastrand.cpp
index 3714f02..d1cf224 100644
--- a/fastrand.cpp
+++ b/fastrand.cpp
@@ -30,10 +30,10 @@ Uint32 GetRandSeed(void)
Uint16 FastRandom(Uint16 range)
{
Uint16 result;
- register Uint32 calc;
- register Uint32 regD0;
- register Uint32 regD1;
- register Uint32 regD2;
+ Uint32 calc;
+ Uint32 regD0;
+ Uint32 regD1;
+ Uint32 regD2;
#ifdef SERIOUS_DEBUG
fprintf(stderr, "FastRandom(%hd) Seed in: %lu ", range, randomSeed);
diff --git a/screenlib/SDL_FrameBuf.cpp b/screenlib/SDL_FrameBuf.cpp
index 2f7b44c..c8e394b 100644
--- a/screenlib/SDL_FrameBuf.cpp
+++ b/screenlib/SDL_FrameBuf.cpp
@@ -555,7 +555,7 @@ static inline void memswap(Uint8 *dst, Uint8 *src, Uint8 len)
}
#else
/* Swap two buffers using a temporary variable */
- register Uint8 tmp;
+ Uint8 tmp;
while ( len-- ) {
tmp = *dst;

View file

@ -9,8 +9,12 @@ stdenv.mkDerivation rec {
sha256 = "0dm0m5wd7amrsa8wnrblkv34sq4v4lglc2wfx8klfkdhyhi06s4k";
};
# this fixes a typedef compilation error with gcc-3.x
patches = [ ./fix-compilation.patch ];
patches = [
# this fixes a typedef compilation error with gcc-3.x
./fix-compilation.patch
# removes register keyword
./c++17-fixes.diff
];
buildInputs = [ SDL2 SDL2_net ];