address compiler warnings

This commit is contained in:
p2r3
2025-08-17 03:04:16 +03:00
parent c5339380cd
commit bf8c7e8185
5 changed files with 11 additions and 12 deletions

View File

@@ -1,3 +1,3 @@
rm bareiron
gcc main.c src/*.c -o bareiron
gcc src/*.c -o bareiron
./bareiron

View File

@@ -20,12 +20,12 @@
#include <unistd.h>
#endif
#include "src/globals.h"
#include "src/tools.h"
#include "src/varnum.h"
#include "src/packets.h"
#include "src/worldgen.h"
#include "src/registries.h"
#include "globals.h"
#include "tools.h"
#include "varnum.h"
#include "packets.h"
#include "worldgen.h"
#include "registries.h"
uint64_t world_time = 0;
@@ -251,7 +251,6 @@ int main () {
int server_fd, client_fd, opt = 1;
struct sockaddr_in server_addr, client_addr;
socklen_t addr_len = sizeof(client_addr);
struct sockaddr_in addr;
// Create socket
server_fd = socket(AF_INET, SOCK_STREAM, 0);

View File

@@ -226,7 +226,7 @@ int sc_synchronizePlayerPosition (int client_fd, double x, double y, double z, f
}
// S->C Set Default Spawn Position
int sc_setDefaultSpawnPosition (int client_fd, long x, long y, long z) {
int sc_setDefaultSpawnPosition (int client_fd, int64_t x, int64_t y, int64_t z) {
writeVarInt(client_fd, sizeVarInt(0x5A) + 12);
writeVarInt(client_fd, 0x5A);

View File

@@ -17,7 +17,7 @@ int sc_knownPacks (int client_fd);
int sc_finishConfiguration (int client_fd);
int sc_loginPlay (int client_fd);
int sc_synchronizePlayerPosition (int client_fd, double x, double y, double z, float yaw, float pitch);
int sc_setDefaultSpawnPosition (int client_fd, long x, long y, long z);
int sc_setDefaultSpawnPosition (int client_fd, int64_t x, int64_t y, int64_t z);
int sc_startWaitingForChunks (int client_fd);
int sc_playerAbilities (int client_fd, uint8_t flags);
int sc_updateTime (int client_fd, uint64_t ticks);

View File

@@ -195,7 +195,7 @@ void clearPlayerFD (int client_fd) {
}
uint8_t serverSlotToClientSlot (uint8_t slot) {
if (slot >= 0 && slot < 9) return slot + 36;
if (slot < 9) return slot + 36;
if (slot >= 9 && slot <= 35) return slot;
if (slot == 40) return 45;
if (slot >= 36 && slot <= 39) return 3 - (slot - 36) + 5;
@@ -229,7 +229,7 @@ uint8_t clientSlotToServerSlot (int window_id, uint8_t slot) {
// move furnace items to the player's crafting grid
// this lets us put them back in the inventory once the window closes
if (slot >= 0 && slot <= 2) return 41 + slot;
if (slot <= 2) return 41 + slot;
// the rest of the slots are identical, just shifted by 6
if (slot >= 3 && slot <= 38) return clientSlotToServerSlot(0, slot + 6);