From 96fa1b7327b35cdeca6c77f2fdde906cabc437d8 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 24 Oct 2026 20:30:30 +0200 Subject: Replace custom int64 with its standardized int64_t type --- proxy.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'proxy.c') diff --git a/proxy.c b/proxy.c index 784e2a1..c2dc417 100644 --- a/proxy.c +++ b/proxy.c @@ -63,11 +63,11 @@ enum { OT_SYNC_PEER4, OT_SYNC_PEER6 }; enum { FLAG_SERVERSOCKET = 1 }; /* For incoming packets */ -static int64 g_socket_in = -1; +static int64_t g_socket_in = -1; static uint8_t g_inbuffer[LIVESYNC_INCOMING_BUFFSIZE]; /* For outgoing packets */ -static int64 g_socket_out = -1; +static int64_t g_socket_out = -1; static uint8_t g_peerbuffer_start[LIVESYNC_OUTGOING_BUFFSIZE_PEERS]; static uint8_t *g_peerbuffer_pos; static uint8_t *g_peerbuffer_highwater = g_peerbuffer_start + LIVESYNC_OUTGOING_BUFFSIZE_PEERS - LIVESYNC_OUTGOING_WATERMARK_PEERS; @@ -249,7 +249,7 @@ typedef struct { uint8_t indata[8192 * 16]; /* Any data not processed yet */ size_t indata_length; /* Length of unprocessed data */ uint32_t tracker_id; /* How the other end greeted */ - int64 fd; /* A file handle, if connected, <= 0 is disconnected (0 initially, -1 else) */ + int64_t fd; /* A file handle, if connected, <= 0 is disconnected (0 initially, -1 else) */ io_batch outdata; /* The iobatch containing our sync data */ size_t packet_tcount; /* Number of unprocessed torrents in packet we currently receive */ @@ -283,7 +283,7 @@ static void handle_reconnects(void) { size_t i; for (i = 0; i < g_connection_count; ++i) if (PROXYPEER_NEEDSCONNECT(g_connections[i].state)) { - int64 newfd = socket_tcp6(); + int64_t newfd = socket_tcp6(); fprintf(stderr, "(Re)connecting to peer..."); if (newfd < 0) continue; /* No socket for you */ @@ -308,10 +308,10 @@ static void handle_reconnects(void) { } /* Handle incoming connection requests, check against whitelist */ -static void handle_accept(int64 serversocket) { - int64 newfd; - ot_ip6 ip; - uint16 port; +static void handle_accept(int64_t serversocket) { + int64_t newfd; + ot_ip6 ip; + uint16 port; while ((newfd = socket_accept6(serversocket, ip, &port, NULL)) != -1) { @@ -351,9 +351,9 @@ static void handle_accept(int64 serversocket) { } /* New sync data on the stream */ -static void handle_read(int64 peersocket) { +static void handle_read(int64_t peersocket) { int i; - int64 datalen; + int64_t datalen; uint32_t tracker_id; proxy_peer *peer = io_getcookie(peersocket); @@ -420,7 +420,7 @@ static void handle_read(int64 peersocket) { } /* Can write new sync data to the stream */ -static void handle_write(int64 peersocket) { +static void handle_write(int64_t peersocket) { proxy_peer *peer = io_getcookie(peersocket); if (!peer) { @@ -472,7 +472,7 @@ static void handle_write(int64 peersocket) { } static void server_mainloop() { - int64 sock; + int64_t sock; uint32_t packet_type; /* inlined livesync_init() */ @@ -515,7 +515,7 @@ static void panic(const char *routine) { } static int64_t ot_try_bind(ot_ip6 ip, uint16_t port) { - int64 sock = socket_tcp6(); + int64_t sock = socket_tcp6(); if (socket_bind6_reuse(sock, ip, port, 0) == -1) panic("socket_bind6_reuse"); -- cgit v1.3