tUse signed ints for port numbers - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 0078f28fd379cce838c8c01e8baf5da69b145a5b
(DIR) parent d234cb9d078159ce07700514db517da5b773588e
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Thu, 3 Dec 2020 00:33:05 -0800
Use signed ints for port numbers
Ports can only range from 0 to 65535, so they
are within the range of both signed and unsigned
ints. Use signed ints since globals only
ttechnically support signed values.
Diffstat:
M src/dopewars.c | 2 +-
M src/dopewars.h | 2 +-
M src/network.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/src/dopewars.c b/src/dopewars.c
t@@ -78,7 +78,7 @@ gboolean Network, Client, Server, WantAntique = FALSE, UseSounds = TRUE;
* dopewars in single-player or antique mode:
* Network=Server=Client=FALSE
*/
-unsigned Port = 7902;
+int Port = 7902;
gboolean Sanitized, ConfigVerbose, DrugValue, Antique = FALSE;
gchar *HiScoreFile = NULL, *ServerName = NULL;
gchar *ServerMOTD = NULL, *BindAddress = NULL, *PlayerName = NULL;
(DIR) diff --git a/src/dopewars.h b/src/dopewars.h
t@@ -171,7 +171,7 @@ extern gboolean WantAntique;
extern struct DATE StartDate;
extern int ClientSock, ListenSock;
extern gboolean Network, Client, Server, UseSounds;
-extern unsigned Port;
+extern int Port;
extern gboolean Sanitized, ConfigVerbose, DrugValue;
extern int NumLocation, NumGun, NumCop, NumDrug, NumSubway, NumPlaying,
NumStoppedTo;
(DIR) diff --git a/src/network.h b/src/network.h
t@@ -104,7 +104,7 @@ typedef void (*NBUserPasswd) (NetworkBuffer *NetBuf, gpointer data);
/* Information about a SOCKS server */
typedef struct _SocksServer {
gchar *name; /* hostname */
- unsigned port; /* port number */
+ int port; /* port number */
int version; /* desired protocol version (usually
* 4 or 5) */
gboolean numuid; /* if TRUE, send numeric user IDs rather