1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtlogin: Change to ANSI function definitions

This commit is contained in:
Peter Howkins 2018-06-28 04:16:41 +01:00
parent 806257b154
commit 2d60124e03
10 changed files with 45 additions and 79 deletions

View file

@ -697,9 +697,7 @@ checkEntry (Xauth *auth)
static int doWrite; static int doWrite;
static static
writeAuth (file, auth) writeAuth (FILE *file, Xauth *auth)
FILE *file;
Xauth *auth;
{ {
if (debugLevel >= 15) { /* normally too verbose */ if (debugLevel >= 15) { /* normally too verbose */
Debug ("writeAuth: doWrite = %d\n", doWrite); Debug ("writeAuth: doWrite = %d\n", doWrite);
@ -864,10 +862,7 @@ DefineSelf (int fd, FILE *file, Xauth *auth)
* for this fd and add them to the selfhosts list. * for this fd and add them to the selfhosts list.
*/ */
static void static void
DefineSelf (fd, file, auth) DefineSelf (int fd, FILE *file, Xauth *auth)
int fd;
FILE *file;
Xauth *auth;
{ {
char buf[2048]; char buf[2048];
struct ifconf ifc; struct ifconf ifc;
@ -940,8 +935,7 @@ DefineSelf (fd, file, auth)
* for this fd and add them to the selfhosts list. * for this fd and add them to the selfhosts list.
*/ */
static void static void
DefineSelf (fd, file, auth) DefineSelf (int fd, int file, int auth)
int fd;
{ {
register int n; register int n;
int len; int len;
@ -984,9 +978,7 @@ DefineSelf (fd, file, auth)
static void static void
setAuthNumber (auth, name) setAuthNumber (Xauth *auth, char *name)
Xauth *auth;
char *name;
{ {
char *colon; char *colon;
char *dot, *number; char *dot, *number;

View file

@ -1287,7 +1287,8 @@ CloseOnFork( void )
} }
#endif #endif
CloseOnFork () int
CloseOnFork (void)
{ {
int fd; int fd;
@ -1296,6 +1297,8 @@ CloseOnFork ()
close (fd); close (fd);
FD_ZERO (&CloseMask); FD_ZERO (&CloseMask);
max = 0; max = 0;
return 0;
} }
static int pidFd; static int pidFd;

View file

@ -92,13 +92,11 @@ from the X Consortium.
static char auth_name[256]; static char auth_name[256];
static int auth_name_len; static int auth_name_len;
int MitInitAuth (name_len, name)
#if NeedWidePrototypes #if NeedWidePrototypes
unsigned int name_len; int MitInitAuth (unsigned int name_len, char *name)
#else #else
unsigned short name_len; int MitInitAuth (unsigned short name_len, char *name)
#endif /* NeedWidePrototypes */ #endif /* NeedWidePrototypes */
char *name;
{ {
if (name_len > 256) if (name_len > 256)
name_len = 256; name_len = 256;
@ -107,14 +105,13 @@ int MitInitAuth (name_len, name)
return(0); return(0);
} }
Xauth *
MitGetAuth (namelen, name)
#if NeedWidePrototypes #if NeedWidePrototypes
unsigned int namelen; Xauth *
MitGetAuth (unsigned int namelen, char *name)
#else #else
unsigned short namelen; Xauth *
MitGetAuth (unsigned short namelen, char *name)
#endif /* NeedWidePrototypes */ #endif /* NeedWidePrototypes */
char *name;
{ {
Xauth *new; Xauth *new;
new = (Xauth *) malloc (sizeof (Xauth)); new = (Xauth *) malloc (sizeof (Xauth));

View file

@ -96,8 +96,7 @@ from the X Consortium.
/* given an XdmcpNetaddr, returns the socket protocol family used, /* given an XdmcpNetaddr, returns the socket protocol family used,
e.g., AF_INET */ e.g., AF_INET */
int NetaddrFamily(netaddrp) int NetaddrFamily(XdmcpNetaddr netaddrp)
XdmcpNetaddr netaddrp;
{ {
#ifdef STREAMSCONN #ifdef STREAMSCONN
short family = *(short *)netaddrp; short family = *(short *)netaddrp;
@ -112,9 +111,7 @@ int NetaddrFamily(netaddrp)
and sets *lenp to the length of the address and sets *lenp to the length of the address
or 0 if not using TCP or UDP. */ or 0 if not using TCP or UDP. */
char * NetaddrPort(netaddrp, lenp) char * NetaddrPort(XdmcpNetaddr netaddrp, int *lenp)
XdmcpNetaddr netaddrp;
int *lenp; /* return */
{ {
#ifdef STREAMSCONN #ifdef STREAMSCONN
*lenp = 2; *lenp = 2;
@ -136,9 +133,7 @@ char * NetaddrPort(netaddrp, lenp)
/* given an XdmcpNetaddr, returns a pointer to the network address /* given an XdmcpNetaddr, returns a pointer to the network address
and sets *lenp to the length of the address */ and sets *lenp to the length of the address */
char * NetaddrAddress(netaddrp, lenp) char * NetaddrAddress(XdmcpNetaddr netaddrp, int *lenp)
XdmcpNetaddr netaddrp;
int *lenp; /* return */
{ {
#ifdef STREAMSCONN #ifdef STREAMSCONN
*lenp = 4; *lenp = 4;
@ -175,10 +170,7 @@ char * NetaddrAddress(netaddrp, lenp)
sets *len to the number of bytes in addr. sets *len to the number of bytes in addr.
Returns the X protocol family used, e.g., FamilyInternet */ Returns the X protocol family used, e.g., FamilyInternet */
int ConvertAddr (saddr, len, addr) int ConvertAddr (XdmcpNetaddr saddr, int *len, char **addr)
XdmcpNetaddr saddr;
int *len; /* return */
char **addr; /* return */
{ {
int retval; int retval;
@ -229,9 +221,7 @@ int ConvertAddr (saddr, len, addr)
return retval; return retval;
} }
addressEqual (a1, len1, a2, len2) addressEqual (XdmcpNetaddr a1, int len1, XdmcpNetaddr a2, int len2)
XdmcpNetaddr a1, a2;
int len1, len2;
{ {
int partlen1, partlen2; int partlen1, partlen2;
char *part1, *part2; char *part1, *part2;
@ -261,9 +251,7 @@ addressEqual (a1, len1, a2, len2)
#ifdef DEBUG #ifdef DEBUG
/*ARGSUSED*/ /*ARGSUSED*/
PrintSockAddr (a, len) /* Debugging routine */ PrintSockAddr (struct sockaddr *a, int len)
struct sockaddr *a;
int len;
{ {
unsigned char *t, *p; unsigned char *t, *p;

View file

@ -257,12 +257,12 @@ catchAlrm( int arg )
longjmp (pingTime, 1); longjmp (pingTime, 1);
} }
static int
FileNameCompare (a, b)
#if defined(__STDC__) #if defined(__STDC__)
const void *a, *b; static int
FileNameCompare (const char *a, const char *b)
#else #else
char *a, *b; static int
FileNameCompare (char *a, char *b)
#endif #endif
{ {
return strcoll (*(char **)a, *(char **)b); return strcoll (*(char **)a, *(char **)b);

View file

@ -105,7 +105,7 @@ extern int chooserFd;
extern FD_TYPE WellKnownSocketsMask; extern FD_TYPE WellKnownSocketsMask;
extern int WellKnownSocketsMax; extern int WellKnownSocketsMax;
CreateWellKnownSockets () CreateWellKnownSockets (void)
{ {
struct sockaddr_in sock_addr; struct sockaddr_in sock_addr;
char *name, *localHostname(); char *name, *localHostname();
@ -154,9 +154,7 @@ CreateWellKnownSockets ()
FD_SET (chooserFd, &WellKnownSocketsMask); FD_SET (chooserFd, &WellKnownSocketsMask);
} }
GetChooserAddr (addr, lenp) GetChooserAddr (char *addr, int *lenp)
char *addr;
int *lenp;
{ {
struct sockaddr_in in_addr; struct sockaddr_in in_addr;
int len; int len;

View file

@ -980,7 +980,7 @@ static char localHostbuf[256];
static int gotLocalHostname; static int gotLocalHostname;
char * char *
localHostname () localHostname (void)
{ {
if (!gotLocalHostname) if (!gotLocalHostname)
{ {

View file

@ -1676,7 +1676,7 @@ SetDefaultDt(Widget w)
* the logo to display in logo_pixmap * the logo to display in logo_pixmap
**************************************************************************/ **************************************************************************/
void void
SetDtLabelAndIcon() SetDtLabelAndIcon(void)
{ {
static XmString blanks = NULL; static XmString blanks = NULL;
int i; int i;

View file

@ -732,7 +732,7 @@ LogError( unsigned char *fmt, ...)
***************************************************************************/ ***************************************************************************/
void void
CloseCatalog() CloseCatalog(void)
{ {
catclose(nl_fd); catclose(nl_fd);
} }
@ -744,7 +744,7 @@ CloseCatalog()
***************************************************************************/ ***************************************************************************/
void void
OpenCatalog() OpenCatalog(void)
{ {
static int initialized = 0; static int initialized = 0;
char *nlspath, *newnlspath; char *nlspath, *newnlspath;

View file

@ -122,14 +122,13 @@ XdmPrintArray8Hex(const char *s, ARRAY8Ptr a)
} }
#endif #endif
void
XdmInitAuth (name_len, name)
#if NeedWidePrototypes #if NeedWidePrototypes
unsigned int name_len; void
XdmInitAuth (unsigned int name_len, char *name)
#else #else
unsigned short name_len; void
XdmInitAuth (unsigned short name_len, char *name)
#endif /* NeedWidePrototypes */ #endif /* NeedWidePrototypes */
char *name;
{ {
if (name_len > 256) if (name_len > 256)
name_len = 256; name_len = 256;
@ -147,10 +146,7 @@ XdmInitAuth (name_len, name)
*/ */
Xauth * Xauth *
XdmGetAuthHelper (namelen, name, includeRho) XdmGetAuthHelper (unsigned short namelen, char *name, int includeRho)
unsigned short namelen;
char *name;
int includeRho;
{ {
Xauth *new; Xauth *new;
new = (Xauth *) malloc (sizeof (Xauth)); new = (Xauth *) malloc (sizeof (Xauth));
@ -192,28 +188,24 @@ XdmGetAuthHelper (namelen, name, includeRho)
return new; return new;
} }
Xauth *
XdmGetAuth (namelen, name)
#if NeedWidePrototypes #if NeedWidePrototypes
unsigned int namelen; Xauth *
XdmGetAuth (unsigned int namelen, char *name)
#else #else
unsigned short namelen; Xauth *
XdmGetAuth (unsigned short namelen, char *name)
#endif /* NeedWidePrototypes */ #endif /* NeedWidePrototypes */
char *name;
{ {
return XdmGetAuthHelper (namelen, name, TRUE); return XdmGetAuthHelper (namelen, name, TRUE);
} }
#ifdef XDMCP #ifdef XDMCP
void XdmGetXdmcpAuth (pdpy,authorizationNameLen, authorizationName)
struct protoDisplay *pdpy;
#if NeedWidePrototypes #if NeedWidePrototypes
unsigned int authorizationNameLen; void XdmGetXdmcpAuth (struct protoDisplay *pdpy, unsigned int authorizationNameLen, char *authorizationName)
#else #else
unsigned short authorizationNameLen; void XdmGetXdmcpAuth (struct protoDisplay *pdpy, unsigned short authorizationNameLen, char *authorizationName)
#endif /* NeedWidePrototypes */ #endif /* NeedWidePrototypes */
char *authorizationName;
{ {
Xauth *fileauth, *xdmcpauth; Xauth *fileauth, *xdmcpauth;
@ -264,8 +256,7 @@ void XdmGetXdmcpAuth (pdpy,authorizationNameLen, authorizationName)
'A' <= c && c <= 'F' ? c - 'A' + 10 : -1) 'A' <= c && c <= 'F' ? c - 'A' + 10 : -1)
static static
HexToBinary (key) HexToBinary (char *key)
char *key;
{ {
char *out, *in; char *out, *in;
int top, bottom; int top, bottom;
@ -294,9 +285,7 @@ HexToBinary (key)
* routine accepts either plain ascii strings for keys, or hex-encoded numbers * routine accepts either plain ascii strings for keys, or hex-encoded numbers
*/ */
XdmGetKey (pdpy, displayID) XdmGetKey (struct protoDisplay *pdpy, ARRAY8Ptr displayID)
struct protoDisplay *pdpy;
ARRAY8Ptr displayID;
{ {
FILE *keys; FILE *keys;
char line[1024], id[1024], key[1024]; char line[1024], id[1024], key[1024];
@ -335,9 +324,8 @@ XdmGetKey (pdpy, displayID)
} }
/*ARGSUSED*/ /*ARGSUSED*/
XdmCheckAuthentication (pdpy, displayID, authenticationName, authenticationData) XdmCheckAuthentication (struct protoDisplay *pdpy, ARRAY8Ptr displayID,
struct protoDisplay *pdpy; ARRAY8Ptr authenticationName, ARRAY8Ptr authenticationData)
ARRAY8Ptr displayID, authenticationName, authenticationData;
{ {
XdmAuthKeyPtr incoming; XdmAuthKeyPtr incoming;