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

FreeBSD 11: Fix clang (v6) builds

While CDE builds fine with gcc6 on FreeBSD 11, the default clang build
was broken in a few places.  This commit allows CDE to build now using
the default clang 6 system compiler.
This commit is contained in:
Jon Trulson 2018-06-15 00:00:46 +00:00
parent 825a504a11
commit ac883b6972
4 changed files with 25 additions and 35 deletions

View file

@ -511,7 +511,7 @@ int _Tt_types_table::yyparse(void)
int _Tt_types_table::yyparse() int _Tt_types_table::yyparse()
#endif #endif
{ {
register YYSTYPE *yypvt; /* top of value stack for $vars */ YYSTYPE *yypvt; /* top of value stack for $vars */
#if defined(__cplusplus) || defined(lint) #if defined(__cplusplus) || defined(lint)
/* /*
@ -550,10 +550,10 @@ int _Tt_types_table::yyparse()
#endif #endif
{ {
register YYSTYPE *yy_pv; /* top of value stack */ YYSTYPE *yy_pv; /* top of value stack */
register int *yy_ps; /* top of state stack */ int *yy_ps; /* top of state stack */
register int yy_state; /* current state */ int yy_state; /* current state */
register int yy_n; /* internal state number info */ int yy_n; /* internal state number info */
goto yystack; /* moved from 6 lines above to here to please C++ */ goto yystack; /* moved from 6 lines above to here to please C++ */
/* /*
@ -591,7 +591,7 @@ int _Tt_types_table::yyparse()
*/ */
if ( yydebug ) if ( yydebug )
{ {
register int yy_i; int yy_i;
printf( "State %d, token ", yy_state ); printf( "State %d, token ", yy_state );
if ( yychar == 0 ) if ( yychar == 0 )
@ -675,7 +675,7 @@ int _Tt_types_table::yyparse()
#if YYDEBUG #if YYDEBUG
if ( yydebug && yytmp ) if ( yydebug && yytmp )
{ {
register int yy_i; int yy_i;
printf( "Received token " ); printf( "Received token " );
if ( yychar == 0 ) if ( yychar == 0 )
@ -717,7 +717,7 @@ int _Tt_types_table::yyparse()
#if YYDEBUG #if YYDEBUG
if ( yydebug && yytmp ) if ( yydebug && yytmp )
{ {
register int yy_i; int yy_i;
printf( "Received token " ); printf( "Received token " );
if ( yychar == 0 ) if ( yychar == 0 )
@ -744,7 +744,7 @@ int _Tt_types_table::yyparse()
** look through exception table ** look through exception table
*/ */
{ {
register int *yyxi = yyexca; int *yyxi = yyexca;
while ( ( *yyxi != -1 ) || while ( ( *yyxi != -1 ) ||
( yyxi[1] != yy_state ) ) ( yyxi[1] != yy_state ) )
@ -830,7 +830,7 @@ int _Tt_types_table::yyparse()
*/ */
if ( yydebug ) if ( yydebug )
{ {
register int yy_i; int yy_i;
printf( "Error recovery discards " ); printf( "Error recovery discards " );
if ( yychar == 0 ) if ( yychar == 0 )
@ -879,7 +879,7 @@ int _Tt_types_table::yyparse()
/* /*
** Look in goto table for next state ** Look in goto table for next state
** Sorry about using yy_state here as temporary ** Sorry about using yy_state here as temporary
** register variable, but why not, if it works... ** variable, but why not, if it works...
** If yyr2[ yy_n ] doesn't have the low order bit ** If yyr2[ yy_n ] doesn't have the low order bit
** set, then there is no action to be done for ** set, then there is no action to be done for
** this reduction. So, no saving & unsaving of ** this reduction. So, no saving & unsaving of
@ -890,7 +890,7 @@ int _Tt_types_table::yyparse()
*/ */
{ {
/* length of production doubled with extra bit */ /* length of production doubled with extra bit */
register int yy_len = yyr2[ yy_n ]; int yy_len = yyr2[ yy_n ];
if ( !( yy_len & 01 ) ) if ( !( yy_len & 01 ) )
{ {

View file

@ -65,16 +65,6 @@ extern "C" {
} }
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(__linux__)
void exit(int);
#endif
#ifdef __cplusplus
}
#endif
#endif #endif
# define yymore() (yymorfg=1) # define yymore() (yymorfg=1)
#ifndef __cplusplus #ifndef __cplusplus
@ -1109,8 +1099,8 @@ int _Tt_types_table::yylook(void)
int _Tt_types_table::yylook() int _Tt_types_table::yylook()
#endif #endif
{ {
register struct yysvf *yystate, **lsp; struct yysvf *yystate, **lsp;
register struct yywork *yyt; struct yywork *yyt;
struct yysvf *yyz; struct yysvf *yyz;
int yych, yyfirst; int yych, yyfirst;
struct yywork *yyr; struct yywork *yyr;

View file

@ -353,7 +353,7 @@ FileShare::lockFile(DtMailEnv & error)
if (isModified(error) == DTM_FALSE) { if (isModified(error) == DTM_FALSE) {
break; break;
} else { } else {
if (time((time_t)NULL) - t_start > FileShareTimeout) { if (time(NULL) - t_start > FileShareTimeout) {
// time out! // time out!
error.setError(DTME_OtherOwnsWrite); error.setError(DTME_OtherOwnsWrite);
return; return;

View file

@ -204,7 +204,7 @@ void HexDump(FILE *pfp, char *pmsg, unsigned char *pbufr, int plen, int plimit)
GET_DUMPFILE_NAME(dumpfilename); GET_DUMPFILE_NAME(dumpfilename);
pfp_r = fopen(dumpfilename, "a"); pfp_r = fopen(dumpfilename, "a");
const time_t clockTime = (const time_t) time((time_t *)0); const time_t clockTime = (const time_t) time(NULL);
memset((void*) &ctime_buf, 0, sizeof(_Xctimeparams)); memset((void*) &ctime_buf, 0, sizeof(_Xctimeparams));
fprintf(pfp_r, "--------------------- pid=%ld %s", fprintf(pfp_r, "--------------------- pid=%ld %s",
(long)getpid(), _XCtime(&clockTime, ctime_buf)); (long)getpid(), _XCtime(&clockTime, ctime_buf));
@ -684,7 +684,7 @@ RFCMailBox::append(DtMailEnv &error, char *buf, int len)
mailboxAccessHide("append"); mailboxAccessHide("append");
else else
{ {
time_t now = time((time_t) NULL); time_t now = time(NULL);
mailboxAccessShow(now, "append"); mailboxAccessShow(now, "append");
} }
@ -3675,7 +3675,7 @@ RFCMailBox::generateUniqueLockId(void)
if (sysinfo(SI_HW_SERIAL, (char *)hwserialbuf, sizeof(hwserialbuf)-1) == -1) if (sysinfo(SI_HW_SERIAL, (char *)hwserialbuf, sizeof(hwserialbuf)-1) == -1)
#endif #endif
strcpy(hwserialbuf, "dtmail"); strcpy(hwserialbuf, "dtmail");
(void) sprintf(theId, "%08ld%08ld%s\0", (long)getpid(), (long)time((time_t *)0), hwserialbuf); (void) sprintf(theId, "%08ld%08ld%s\0", (long)getpid(), (long)time(NULL), hwserialbuf);
assert(strlen(theId)<sizeof(theId)); assert(strlen(theId)<sizeof(theId));
return(strdup(theId)); return(strdup(theId));
} }
@ -3820,7 +3820,7 @@ RFCMailBox::linkLockFile(DtMailEnv & error, char *tempLockFileName)
DTM_FALSE, NULL, tempLockFileName, error.errnoMessage()); DTM_FALSE, NULL, tempLockFileName, error.errnoMessage());
break; break;
} }
return(time(0)); return(time(NULL));
} }
// Get creation time of temporary file *on remote system* // Get creation time of temporary file *on remote system*
@ -3833,7 +3833,7 @@ RFCMailBox::linkLockFile(DtMailEnv & error, char *tempLockFileName)
error.vSetError(DTME_CannotCreateMailboxLockFile, error.vSetError(DTME_CannotCreateMailboxLockFile,
DTM_FALSE, NULL, tempLockFileName, error.errnoMessage()); DTM_FALSE, NULL, tempLockFileName, error.errnoMessage());
(void) SafeClose(lock_fd); (void) SafeClose(lock_fd);
return(time(0)); return(time(NULL));
} }
// Write proper contents to lock file: // Write proper contents to lock file:
@ -3857,7 +3857,7 @@ RFCMailBox::linkLockFile(DtMailEnv & error, char *tempLockFileName)
error.vSetError(DTME_CannotCreateMailboxLockFile, error.vSetError(DTME_CannotCreateMailboxLockFile,
DTM_FALSE, NULL, tempLockFileName, error.errnoMessage()); DTM_FALSE, NULL, tempLockFileName, error.errnoMessage());
(void) SafeClose(lock_fd); (void) SafeClose(lock_fd);
return(time(0)); return(time(NULL));
} }
// sync up the lock file with the ultimate storage device // sync up the lock file with the ultimate storage device
@ -3870,7 +3870,7 @@ RFCMailBox::linkLockFile(DtMailEnv & error, char *tempLockFileName)
error.vSetError(DTME_CannotCreateMailboxLockFile, error.vSetError(DTME_CannotCreateMailboxLockFile,
DTM_FALSE, NULL, tempLockFileName, error.errnoMessage()); DTM_FALSE, NULL, tempLockFileName, error.errnoMessage());
(void) SafeClose(lock_fd); (void) SafeClose(lock_fd);
return(time(0)); return(time(NULL));
} }
// close the file // close the file
@ -3883,7 +3883,7 @@ RFCMailBox::linkLockFile(DtMailEnv & error, char *tempLockFileName)
tempLockFileName, errno); tempLockFileName, errno);
error.vSetError(DTME_CannotCreateMailboxLockFile, error.vSetError(DTME_CannotCreateMailboxLockFile,
DTM_FALSE, NULL, tempLockFileName, error.errnoMessage()); DTM_FALSE, NULL, tempLockFileName, error.errnoMessage());
return(time(0)); return(time(NULL));
} }
// The temporary lock file has been created - now try and link it to the // The temporary lock file has been created - now try and link it to the
@ -4477,7 +4477,7 @@ RFCMailBox::writeToDumpFile(const char *format, ...)
GET_DUMPFILE_NAME(dumpfilename); GET_DUMPFILE_NAME(dumpfilename);
FILE *df = fopen(dumpfilename, "a"); FILE *df = fopen(dumpfilename, "a");
const time_t clockTime = (const time_t) time((time_t *)0); const time_t clockTime = (const time_t) time(NULL);
memset((void*) &ctime_buf, 0, sizeof(_Xctimeparams)); memset((void*) &ctime_buf, 0, sizeof(_Xctimeparams));
fprintf(df, "--------------------- pid=%ld %s", fprintf(df, "--------------------- pid=%ld %s",
(long)getpid(), _XCtime(&clockTime, ctime_buf)); (long)getpid(), _XCtime(&clockTime, ctime_buf));
@ -4545,7 +4545,7 @@ RFCMailBox::dumpMaps(const char *str)
sigaction(SIGBUS, &sig_act, &old_sig_act); sigaction(SIGBUS, &sig_act, &old_sig_act);
sigbus_env_valid = 1; sigbus_env_valid = 1;
if (setjmp(sigbus_env) == 0) { if (setjmp(sigbus_env) == 0) {
const time_t clockTime = (const time_t) time((time_t *)0); const time_t clockTime = (const time_t) time(NULL);
_Xctimeparams ctime_buf; _Xctimeparams ctime_buf;
memset((void*) &ctime_buf, 0, sizeof(_Xctimeparams)); memset((void*) &ctime_buf, 0, sizeof(_Xctimeparams));
fprintf(df, "--------------------- pid=%ld %s", fprintf(df, "--------------------- pid=%ld %s",