From 85fc95c247dd2f8c6f7502a73a0a90bc70e0455f Mon Sep 17 00:00:00 2001 From: havoc Date: Sun, 22 Sep 2002 00:17:46 +0000 Subject: [PATCH] const. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2412 d7cf8633-e32d-0410-b094-e92efae38249 --- cd_win.c | 6 +++--- net_wins.c | 12 ++++++------ net_wins.h | 10 +++++----- net_wipx.c | 8 ++++---- net_wipx.h | 8 ++++---- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cd_win.c b/cd_win.c index aab8dad7..d31b72e8 100644 --- a/cd_win.c +++ b/cd_win.c @@ -241,9 +241,9 @@ void CDAudio_Resume(void) static void CD_f (void) { - char *command; - int ret; - int n; + const char *command; + int ret; + int n; if (Cmd_Argc() < 2) return; diff --git a/net_wins.c b/net_wins.c index 4deb5c7c..5a12f52c 100644 --- a/net_wins.c +++ b/net_wins.c @@ -319,7 +319,7 @@ this lets you type only as much of the net address as required, using the local network components to fill in the rest ============ */ -static int PartialIPAddress (char *in, struct qsockaddr *hostaddr) +static int PartialIPAddress (const char *in, struct qsockaddr *hostaddr) { char buff[256]; char *b; @@ -462,7 +462,7 @@ int WINS_Write (int socket, qbyte *buf, int len, struct qsockaddr *addr) //============================================================================= -char *WINS_AddrToString (struct qsockaddr *addr) +char *WINS_AddrToString (const struct qsockaddr *addr) { static char buffer[22]; int haddr; @@ -474,7 +474,7 @@ char *WINS_AddrToString (struct qsockaddr *addr) //============================================================================= -int WINS_StringToAddr (char *string, struct qsockaddr *addr) +int WINS_StringToAddr (const char *string, struct qsockaddr *addr) { int ha1, ha2, ha3, ha4, hp; int ipaddr; @@ -506,7 +506,7 @@ int WINS_GetSocketAddr (int socket, struct qsockaddr *addr) //============================================================================= -int WINS_GetNameFromAddr (struct qsockaddr *addr, char *name) +int WINS_GetNameFromAddr (const struct qsockaddr *addr, char *name) { struct hostent *hostentry; @@ -523,7 +523,7 @@ int WINS_GetNameFromAddr (struct qsockaddr *addr, char *name) //============================================================================= -int WINS_GetAddrFromName(char *name, struct qsockaddr *addr) +int WINS_GetAddrFromName(const char *name, struct qsockaddr *addr) { struct hostent *hostentry; @@ -543,7 +543,7 @@ int WINS_GetAddrFromName(char *name, struct qsockaddr *addr) //============================================================================= -int WINS_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2) +int WINS_AddrCompare (const struct qsockaddr *addr1, const struct qsockaddr *addr2) { if (addr1->sa_family != addr2->sa_family) return -1; diff --git a/net_wins.h b/net_wins.h index c04a5c7c..a90da5b3 100644 --- a/net_wins.h +++ b/net_wins.h @@ -32,12 +32,12 @@ int WINS_CheckNewConnections (void); int WINS_Read (int socket, qbyte *buf, int len, struct qsockaddr *addr); int WINS_Write (int socket, qbyte *buf, int len, struct qsockaddr *addr); int WINS_Broadcast (int socket, qbyte *buf, int len); -char *WINS_AddrToString (struct qsockaddr *addr); -int WINS_StringToAddr (char *string, struct qsockaddr *addr); +char *WINS_AddrToString (const struct qsockaddr *addr); +int WINS_StringToAddr (const char *string, struct qsockaddr *addr); int WINS_GetSocketAddr (int socket, struct qsockaddr *addr); -int WINS_GetNameFromAddr (struct qsockaddr *addr, char *name); -int WINS_GetAddrFromName (char *name, struct qsockaddr *addr); -int WINS_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2); +int WINS_GetNameFromAddr (const struct qsockaddr *addr, char *name); +int WINS_GetAddrFromName (const char *name, struct qsockaddr *addr); +int WINS_AddrCompare (const struct qsockaddr *addr1, const struct qsockaddr *addr2); int WINS_GetSocketPort (struct qsockaddr *addr); int WINS_SetSocketPort (struct qsockaddr *addr, int port); diff --git a/net_wipx.c b/net_wipx.c index 12729785..f1d21236 100644 --- a/net_wipx.c +++ b/net_wipx.c @@ -289,7 +289,7 @@ int WIPX_Write (int handle, qbyte *buf, int len, struct qsockaddr *addr) //============================================================================= -char *WIPX_AddrToString (struct qsockaddr *addr) +char *WIPX_AddrToString (const struct qsockaddr *addr) { static char buf[28]; @@ -311,7 +311,7 @@ char *WIPX_AddrToString (struct qsockaddr *addr) //============================================================================= -int WIPX_StringToAddr (char *string, struct qsockaddr *addr) +int WIPX_StringToAddr (const char *string, struct qsockaddr *addr) { int val; char buf[3]; @@ -364,7 +364,7 @@ int WIPX_GetSocketAddr (int handle, struct qsockaddr *addr) //============================================================================= -int WIPX_GetNameFromAddr (struct qsockaddr *addr, char *name) +int WIPX_GetNameFromAddr (const struct qsockaddr *addr, char *name) { strcpy(name, WIPX_AddrToString(addr)); return 0; @@ -372,7 +372,7 @@ int WIPX_GetNameFromAddr (struct qsockaddr *addr, char *name) //============================================================================= -int WIPX_GetAddrFromName(char *name, struct qsockaddr *addr) +int WIPX_GetAddrFromName(const char *name, struct qsockaddr *addr) { int n; char buf[32]; diff --git a/net_wipx.h b/net_wipx.h index c5983530..b8caf436 100644 --- a/net_wipx.h +++ b/net_wipx.h @@ -32,11 +32,11 @@ int WIPX_CheckNewConnections (void); int WIPX_Read (int socket, qbyte *buf, int len, struct qsockaddr *addr); int WIPX_Write (int socket, qbyte *buf, int len, struct qsockaddr *addr); int WIPX_Broadcast (int socket, qbyte *buf, int len); -char *WIPX_AddrToString (struct qsockaddr *addr); -int WIPX_StringToAddr (char *string, struct qsockaddr *addr); +char *WIPX_AddrToString (const struct qsockaddr *addr); +int WIPX_StringToAddr (const char *string, struct qsockaddr *addr); int WIPX_GetSocketAddr (int socket, struct qsockaddr *addr); -int WIPX_GetNameFromAddr (struct qsockaddr *addr, char *name); -int WIPX_GetAddrFromName (char *name, struct qsockaddr *addr); +int WIPX_GetNameFromAddr (const struct qsockaddr *addr, char *name); +int WIPX_GetAddrFromName (const char *name, struct qsockaddr *addr); int WIPX_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2); int WIPX_GetSocketPort (struct qsockaddr *addr); int WIPX_SetSocketPort (struct qsockaddr *addr, int port); -- 2.39.2