/*
* Slide puzzle core game logic
- * Copyright © 2022-2023 Nick Bowler
+ * Copyright © 2022-2024 Nick Bowler
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include <time.h>
#include "game.h"
-#define B64(x) ((x) & 0xffffffffffffffff)
+#define B64(x) ((x) & 0xffffffffffffffffull)
/* Rotate val left by n bits. The behaviour is undefined if n is zero. */
static unsigned long long rot_left64(unsigned long long val, int n)
{
unsigned long long z;
- z = B64(*state += 0x9e3779b97f4a7c15);
- z = B64((z ^ (z >> 30)) * 0xbf58476d1ce4e5b9);
- z = B64((z ^ (z >> 27)) * 0x94d049bb133111eb);
+ z = B64(*state += 0x9e3779b97f4a7c15ull);
+ z = B64((z ^ (z >> 30)) * 0xbf58476d1ce4e5b9ull);
+ z = B64((z ^ (z >> 27)) * 0x94d049bb133111ebull);
return z ^ (z >> 31);
}