FreeBSD 10 clang port

This commit is contained in:
Ulrich Wilkens
2014-07-27 16:48:57 +02:00
committed by Jon Trulson
parent 8d0551bfda
commit c3f74eec17
99 changed files with 510 additions and 366 deletions

View File

@@ -389,7 +389,7 @@ ProcessChooserSocket (
if (client_fd == -1)
{
LogError ((unsigned char *)"Cannot accept chooser connection\n");
return;
return 0;
}
Debug ("Accepted %d\n", client_fd);

View File

@@ -470,7 +470,7 @@ RemoveHostname (host)
prev = &hosts->next;
}
if (!hosts)
return;
return 0;
*prev = host->next;
DisposeHostname (host);
NameTableSize--;
@@ -563,12 +563,12 @@ RegisterHostaddr (addr, len, type)
host = (HostAddr *) malloc (sizeof (HostAddr));
if (!host)
return;
return 0;
host->addr = (struct sockaddr *) malloc (len);
if (!host->addr)
{
free ((char *) host);
return;
return 0;
}
memmove( (char *) host->addr, (char *) addr, len);
host->addrlen = len;
@@ -602,7 +602,7 @@ RegisterHostname (name)
ifc.ifc_len = sizeof (buf);
ifc.ifc_buf = buf;
if (ioctl (socketFD, (int) SIOCGIFCONF, (char *) &ifc) < 0)
return;
return 0;
for (ifr = ifc.ifc_req
#if defined (__bsdi__) || defined(__NetBSD__)
; (char *)ifr < ifc.ifc_buf + ifc.ifc_len;
@@ -665,9 +665,9 @@ RegisterHostname (name)
{
hostent = gethostbyname (name);
if (!hostent)
return;
return 0;
if (hostent->h_addrtype != AF_INET || hostent->h_length != 4)
return;
return 0;
in_addr.sin_family = hostent->h_addrtype;
memmove( &in_addr.sin_addr, hostent->h_addr, 4);
}
@@ -689,10 +689,10 @@ RegisterAuthenticationName (name, namelen)
ARRAY8Ptr authName;
if (!XdmcpReallocARRAYofARRAY8 (&AuthenticationNames,
AuthenticationNames.length + 1))
return;
return 0;
authName = &AuthenticationNames.data[AuthenticationNames.length-1];
if (!XdmcpAllocARRAY8 (authName, namelen))
return;
return 0;
memmove( authName->data, name, namelen);
}

View File

@@ -350,7 +350,7 @@ ScanServers( void )
LogError(
ReadCatalog(MC_LOG_SET,MC_LOG_NO_SRVACC,MC_DEF_LOG_NO_SRVACC),
servers);
return;
return 0;
}
if (ServersModTime == 0)
{
@@ -861,7 +861,7 @@ StartDisplay(
*/
if (d->displayType.origin == FromFile && dt_shutdown ) {
RemoveDisplay(d);
return;
return 0;
}
{
@@ -949,7 +949,7 @@ StartDisplay(
LogError ((unsigned char *)"All DT utmp IDs already in use. Removing display %s\n",
d->name);
RemoveDisplay(d);
return;
return 0;
}
}
#endif
@@ -1024,7 +1024,7 @@ StartDisplay(
if (!StartGetty(d))
RemoveDisplay (d);
return;
return 0;
}
}
else
@@ -1442,12 +1442,12 @@ SetTitle( char *name, char *ptr )
* remove domain qualifiers and screens from name...
*/
if ( (p = malloc(strlen(name) + 1)) == NULL) return;
if ( (p = malloc(strlen(name) + 1)) == NULL) return 0;
strcpy(p, name);
if ( (s = strchr(p,':')) == NULL ) {
free(p);
return;
return 0;
}
if ( (t = strchr(s,'.')) != NULL )

View File

@@ -1030,7 +1030,7 @@ MakeOptionsMenu( void )
static int
ErrorHandler( Display *dpy, XErrorEvent *event )
{
return;
return 0;
}

View File

@@ -197,12 +197,12 @@ ParseDisplay( char *source,
args = splitIntoWords (source);
if (!args)
return;
return 0;
if (!args[0])
{
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_MISS_NAME,MC_DEF_LOG_MISS_NAME));
freeArgs (args);
return;
return 0;
}
name = args[0];
if (!args[1])
@@ -210,7 +210,7 @@ ParseDisplay( char *source,
LogError(ReadCatalog(MC_LOG_SET,MC_LOG_MISS_TYPE,MC_DEF_LOG_MISS_TYPE),
args[0]);
freeArgs (args);
return;
return 0;
}
/*

View File

@@ -103,12 +103,12 @@ ApplyFontPathMods( struct display *d, Display *dpy )
if (d->displayType.location == Foreign) {
Debug(" Foreign display\n");
return;
return 0;
}
if (!(fontPath=XGetFontPath(dpy, &numPaths))) {
Debug(" Can't get font path\n");
return;
return 0;
}
/*

View File

@@ -120,6 +120,9 @@ extern int errno;
# ifdef macII
# define USE_CRYPT
# endif
# ifdef __FreeBSD__
# define USE_CRYPT
# endif
# ifdef sun
# define USE_CRYPT
# if (OSMAJORVERSION >= 4)
@@ -453,7 +456,7 @@ InitCryptoKey( void )
char *key_file = "/dev/mem";
#endif
if (cryptoInited)
return;
return 0;
/*
* If the sumFile fails to produce a result

View File

@@ -152,7 +152,7 @@ DisposeProtoDisplay( struct protoDisplay *pdpy )
prev = p;
}
if (!p)
return;
return 0;
if (prev)
prev->next = pdpy->next;
else

View File

@@ -435,7 +435,7 @@ GetResource( char *name, char *class, int valueType, char **valuep,
if (valueType == DM_STRING && *valuep) {
if (string != NULL && strlen (*valuep) == len && !strncmp (*valuep, string, len))
return;
return 0;
else {
free (*valuep);
*(valuep) = NULL;
@@ -450,7 +450,7 @@ GetResource( char *name, char *class, int valueType, char **valuep,
if (!new_string) {
LogOutOfMem(
ReadCatalog(MC_LOG_SET,MC_LOG_GET_RSC,MC_DEF_LOG_GET_RSC));
return;
return 0;
}
strncpy (new_string, string, len);
new_string[len] = '\0';

View File

@@ -1746,7 +1746,7 @@ AbortClient( int pid )
MC_LOG_SET,MC_LOG_NO_KILLCL,MC_DEF_LOG_NO_KILLCL));
case EINVAL:
case ESRCH:
return;
return 0;
}
}
if (!setjmp (tenaciousClient)) {
@@ -1834,11 +1834,11 @@ execute(char **argv, char **environ )
*/
f = fopen (argv[0], "r");
if (!f)
return;
return 0;
if (fgets (program, sizeof (program) - 1, f) == NULL)
{
fclose (f);
return;
return 0;
}
fclose (f);
e = program + strlen (program) - 1;

View File

@@ -111,13 +111,13 @@ CreateWellKnownSockets ()
char *name, *localHostname();
if (request_port == 0)
return;
return 0;
Debug ("creating socket %d\n", request_port);
xdmcpFd = socket (AF_INET, SOCK_DGRAM, 0);
if (xdmcpFd == -1) {
LogError (ReadCatalog(MC_LOG_SET,MC_LOG_FAIL_SOCK,MC_DEF_LOG_FAIL_SOCK),
request_port);
return;
return 0;
}
name = localHostname ();
registerHostname (name, strlen (name));
@@ -136,7 +136,7 @@ CreateWellKnownSockets ()
request_port, errno);
close (xdmcpFd);
xdmcpFd = -1;
return;
return 0;
}
WellKnownSocketsMax = xdmcpFd;
FD_SET (xdmcpFd, &WellKnownSocketsMask);
@@ -146,7 +146,7 @@ CreateWellKnownSockets ()
if (chooserFd == -1)
{
LogError ((unsigned char *)"chooser socket creation failed, errno %d\n", errno);
return;
return 0;
}
listen (chooserFd, 5);
if (chooserFd > WellKnownSocketsMax)

View File

@@ -2106,7 +2106,7 @@ MyBackspace( Widget w, XEvent *event, char **params, Cardinal *num_params )
static int
ErrorHandler( Display *dpy, XErrorEvent *event )
{
return;
return 0;
}