aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-01-09 23:18:17 +0100
committerUlrich Sibiller <uli42@gmx.de>2020-01-10 00:25:46 +0100
commita94e8258f72ab5db4b9a1de7e10140b8d622667b (patch)
tree890cab2f13666bd57760d4708f34c9a96083c544 /nx-X11
parent4b8194e1eafb9fd788b814921f9e2518a2079344 (diff)
downloadnx-libs-a94e8258f72ab5db4b9a1de7e10140b8d622667b.tar.gz
nx-libs-a94e8258f72ab5db4b9a1de7e10140b8d622667b.tar.bz2
nx-libs-a94e8258f72ab5db4b9a1de7e10140b8d622667b.zip
os: Fix -Wshadow errors
commit 08d0481e299c28b64a0db9bb0782ba2b551028fd Author: Keith Packard <keithp@keithp.com> Date: Sun Dec 15 01:12:22 2013 -0800 os: Fix -Wshadow errors Rename variables to avoid shadowing globals Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/os/xdmauth.c18
-rw-r--r--nx-X11/programs/Xserver/os/xdmcp.c26
2 files changed, 21 insertions, 23 deletions
diff --git a/nx-X11/programs/Xserver/os/xdmauth.c b/nx-X11/programs/Xserver/os/xdmauth.c
index eb89f4bc1..9745dffaf 100644
--- a/nx-X11/programs/Xserver/os/xdmauth.c
+++ b/nx-X11/programs/Xserver/os/xdmauth.c
@@ -61,7 +61,7 @@ static Bool authFromXDMCP;
static XdmAuthKeyRec privateKey;
static char XdmAuthenticationName[] = "XDM-AUTHENTICATION-1";
#define XdmAuthenticationNameLen (sizeof XdmAuthenticationName - 1)
-static XdmAuthKeyRec rho;
+static XdmAuthKeyRec global_rho;
static Bool
XdmAuthenticationValidator (ARRAY8Ptr privateData, ARRAY8Ptr incomingData,
@@ -76,7 +76,7 @@ XdmAuthenticationValidator (ARRAY8Ptr privateData, ARRAY8Ptr incomingData,
return FALSE;
incoming = (XdmAuthKeyPtr) incomingData->data;
XdmcpDecrementKey (incoming);
- return XdmcpCompareKeys (incoming, &rho);
+ return XdmcpCompareKeys (incoming, &global_rho);
}
return FALSE;
}
@@ -89,7 +89,7 @@ XdmAuthenticationGenerator (ARRAY8Ptr privateData, ARRAY8Ptr outgoingData,
outgoingData->data = 0;
if (packet_type == REQUEST) {
if (XdmcpAllocARRAY8 (outgoingData, 8))
- XdmcpWrap ((unsigned char *)&rho, (unsigned char *)&privateKey,
+ XdmcpWrap ((unsigned char *)&global_rho, (unsigned char *)&privateKey,
outgoingData->data, 8);
}
return TRUE;
@@ -152,10 +152,10 @@ XdmAuthenticationInit (char *cookie, int cookie_len)
cookie_len = 7;
memmove (privateKey.data + 1, cookie, cookie_len);
}
- XdmcpGenerateKey (&rho);
+ XdmcpGenerateKey (&global_rho);
XdmcpRegisterAuthentication (XdmAuthenticationName, XdmAuthenticationNameLen,
- (char *)&rho,
- sizeof (rho),
+ (char *)&global_rho,
+ sizeof (global_rho),
(ValidatorFunc)XdmAuthenticationValidator,
(GeneratorFunc)XdmAuthenticationGenerator,
(AddAuthorFunc)XdmAuthenticationAddAuth);
@@ -340,7 +340,7 @@ XdmAddCookie (unsigned short data_length, char *data, XID id)
{
/* R5 xdm sent bogus authorization data in the accept packet,
* but we can recover */
- rho_bits = rho.data;
+ rho_bits = global_rho.data;
key_bits = (unsigned char *) data;
key_bits[0] = '\0';
}
@@ -353,7 +353,7 @@ XdmAddCookie (unsigned short data_length, char *data, XID id)
break;
#ifdef XDMCP
case 8: /* auth from XDMCP is 8 bytes long */
- rho_bits = rho.data;
+ rho_bits = global_rho.data;
key_bits = (unsigned char *) data;
break;
#endif
@@ -477,7 +477,7 @@ XdmRemoveCookie (unsigned short data_length, char *data)
break;
#ifdef XDMCP
case 8:
- rho_bits = &rho;
+ rho_bits = &global_rho;
key_bits = (XdmAuthKeyPtr) data;
break;
#endif
diff --git a/nx-X11/programs/Xserver/os/xdmcp.c b/nx-X11/programs/Xserver/os/xdmcp.c
index 8da1131ed..458870357 100644
--- a/nx-X11/programs/Xserver/os/xdmcp.c
+++ b/nx-X11/programs/Xserver/os/xdmcp.c
@@ -679,15 +679,15 @@ XdmcpBlockHandler(
struct timeval **wt,
void * pReadmask)
{
- fd_set *LastSelectMask = (fd_set*)pReadmask;
+ fd_set *last_select_mask = (fd_set*)pReadmask;
CARD32 millisToGo;
if (state == XDM_OFF)
return;
- FD_SET(xdmcpSocket, LastSelectMask);
+ FD_SET(xdmcpSocket, last_select_mask);
#if defined(IPv6) && defined(AF_INET6)
if (xdmcpSocket6 >= 0)
- FD_SET(xdmcpSocket6, LastSelectMask);
+ FD_SET(xdmcpSocket6, last_select_mask);
#endif
if (timeOutTime == 0)
return;
@@ -710,7 +710,7 @@ XdmcpWakeupHandler(
int i,
void * pReadmask)
{
- fd_set* LastSelectMask = (fd_set*)pReadmask;
+ fd_set* last_select_mask = (fd_set*)pReadmask;
#ifdef NX_TRANS_SOCKET
@@ -723,16 +723,16 @@ XdmcpWakeupHandler(
return;
if (i > 0)
{
- if (FD_ISSET(xdmcpSocket, LastSelectMask))
+ if (FD_ISSET(xdmcpSocket, last_select_mask))
{
receive_packet(xdmcpSocket);
- FD_CLR(xdmcpSocket, LastSelectMask);
+ FD_CLR(xdmcpSocket, last_select_mask);
}
#if defined(IPv6) && defined(AF_INET6)
- if (xdmcpSocket6 >= 0 && FD_ISSET(xdmcpSocket6, LastSelectMask))
+ if (xdmcpSocket6 >= 0 && FD_ISSET(xdmcpSocket6, last_select_mask))
{
receive_packet(xdmcpSocket6);
- FD_CLR(xdmcpSocket6, LastSelectMask);
+ FD_CLR(xdmcpSocket6, last_select_mask);
}
#endif
}
@@ -757,12 +757,12 @@ static void
XdmcpSelectHost(
struct sockaddr *host_sockaddr,
int host_len,
- ARRAY8Ptr AuthenticationName)
+ ARRAY8Ptr auth_name)
{
state = XDM_START_CONNECTION;
memmove(&req_sockaddr, host_sockaddr, host_len);
req_socklen = host_len;
- XdmcpSetAuthentication (AuthenticationName);
+ XdmcpSetAuthentication (auth_name);
send_packet();
}
@@ -777,11 +777,11 @@ static void
XdmcpAddHost(
struct sockaddr *from,
int fromlen,
- ARRAY8Ptr AuthenticationName,
+ ARRAY8Ptr auth_name,
ARRAY8Ptr hostname,
ARRAY8Ptr status)
{
- XdmcpSelectHost(from, fromlen, AuthenticationName);
+ XdmcpSelectHost(from, fromlen, auth_name);
}
/*
@@ -1066,8 +1066,6 @@ send_query_msg(void)
XdmcpWriteARRAYofARRAY8 (&buffer, &AuthenticationNames);
if (broadcast)
{
- int i;
-
for (i = 0; i < NumBroadcastAddresses; i++)
XdmcpFlush (xdmcpSocket, &buffer, (XdmcpNetaddr) &BroadcastAddresses[i],
sizeof (struct sockaddr_in));