Rename setmode() to set_mode() to avoid BSD prototype.

4.4BSD added a non-standard function setmode() to <unistd.h>; its
prototype is not compatible.
This commit is contained in:
George Koehler 2018-06-10 16:26:54 -04:00
parent 6f9e418f94
commit 250777d1ca
3 changed files with 19 additions and 19 deletions

View file

@ -369,7 +369,7 @@ end_module() {
*/ */
align(wordsize) ; align(wordsize) ;
setmode(DATA_NUL); set_mode(DATA_NUL);
dump(100); dump(100);
enmd_pro(); enmd_pro();
enmd_glo(); enmd_glo();

View file

@ -280,7 +280,7 @@ int icount(size) {
return amount ; return amount ;
} }
setmode(mode) { set_mode(mode) {
if (datamode==mode) { /* in right mode already */ if (datamode==mode) { /* in right mode already */
switch ( datamode ) { switch ( datamode ) {
@ -302,8 +302,8 @@ setmode(mode) {
default: default:
return ; return ;
} }
setmode(DATA_NUL) ; /* flush current descriptor */ set_mode(DATA_NUL) ; /* flush current descriptor */
setmode(mode) ; set_mode(mode) ;
return; return;
} }
switch(datamode) { /* terminate current mode */ switch(datamode) { /* terminate current mode */
@ -376,7 +376,7 @@ setmode(mode) {
ext8(HEADBSS) ; ext8(HEADBSS) ;
break; break;
default: default:
fatal("Unknown mode in setmode") ; fatal("Unknown mode in set_mode") ;
} }
} }

View file

@ -699,10 +699,10 @@ chkstart() {
if ( absout ) return ; if ( absout ) return ;
if ( !oksizes ) fatal("missing size specification") ; if ( !oksizes ) fatal("missing size specification") ;
setmode(DATA_CONST) ; set_mode(DATA_CONST) ;
extconst((cons_t)0) ; extconst((cons_t)0) ;
databytes= wordsize ; databytes= wordsize ;
setmode(DATA_REP) ; set_mode(DATA_REP) ;
if ( wordsize<ABSSIZE ) { if ( wordsize<ABSSIZE ) {
register factor = ABSSIZE/wordsize - 1 ; register factor = ABSSIZE/wordsize - 1 ;
extadr( (cons_t) factor ) ; extadr( (cons_t) factor ) ;
@ -724,14 +724,14 @@ sizealign(size) cons_t size ; {
align(size) int size ; { align(size) int size ; {
while ( databytes%size ) { while ( databytes%size ) {
setmode(DATA_BYTES) ; set_mode(DATA_BYTES) ;
ext8(0) ; ext8(0) ;
databytes++ ; databytes++ ;
} }
} }
extconst(n) cons_t n ; { extconst(n) cons_t n ; {
setmode(DATA_CONST); set_mode(DATA_CONST);
extword(n); extword(n);
} }
@ -747,7 +747,7 @@ extbss(n) cons_t n ; {
} }
return ; return ;
} }
setmode(DATA_NUL) ; /* flush descriptor */ set_mode(DATA_NUL) ; /* flush descriptor */
objsize= valsize(); objsize= valsize();
if ( objsize==0 ) { if ( objsize==0 ) {
werror("Unexpected end-of-line"); werror("Unexpected end-of-line");
@ -765,18 +765,18 @@ extbss(n) cons_t n ; {
putval(); putval();
amount= n/objsize ; amount= n/objsize ;
if ( amount>1 ) { if ( amount>1 ) {
setmode(DATA_REP); set_mode(DATA_REP);
extadr(amount-1) ; extadr(amount-1) ;
} }
} }
else { else {
n = (n + wordsize - 1) / wordsize; n = (n + wordsize - 1) / wordsize;
while (n > MAXBYTE) { while (n > MAXBYTE) {
setmode(DATA_BSS); set_mode(DATA_BSS);
ext8(MAXBYTE); ext8(MAXBYTE);
n -= MAXBYTE; n -= MAXBYTE;
} }
setmode(DATA_BSS); set_mode(DATA_BSS);
ext8((int) n); ext8((int) n);
} }
} }
@ -787,7 +787,7 @@ extloc(lbp) register locl_t *lbp; {
* assemble a pointer constant from a local label. * assemble a pointer constant from a local label.
* For example con *1 * For example con *1
*/ */
setmode(DATA_IPTR); set_mode(DATA_IPTR);
data_reloc( chp_cast lbp,dataoff,RELLOC); data_reloc( chp_cast lbp,dataoff,RELLOC);
extadr((cons_t)0); extadr((cons_t)0);
} }
@ -800,7 +800,7 @@ extglob(agbp,off) glob_t *agbp; cons_t off; {
* Various relocation has to be prepared here in some cases * Various relocation has to be prepared here in some cases
*/ */
gbp=agbp; gbp=agbp;
setmode(DATA_DPTR); set_mode(DATA_DPTR);
if ( gbp->g_status&DEF ) { if ( gbp->g_status&DEF ) {
extadr(gbp->g_val.g_addr+off); extadr(gbp->g_val.g_addr+off);
} else { } else {
@ -813,7 +813,7 @@ extpro(aprp) proc_t *aprp; {
/* /*
* generate a addres that is defined by a procedure descriptor. * generate a addres that is defined by a procedure descriptor.
*/ */
consiz= ptrsize ; setmode(DATA_UCON); consiz= ptrsize ; set_mode(DATA_UCON);
extarb((int)ptrsize,(long)(aprp->p_num)); extarb((int)ptrsize,(long)(aprp->p_num));
} }
@ -825,7 +825,7 @@ extstring() {
* generate data for a string. * generate data for a string.
*/ */
for(n=strlngth,s=string ; n--; ) { for(n=strlngth,s=string ; n--; ) {
setmode(DATA_BYTES) ; set_mode(DATA_BYTES) ;
ext8(*s++); ext8(*s++);
} }
return ; return ;
@ -839,7 +839,7 @@ extxcon(header) {
* generate data for a floating constant initialized by a string. * generate data for a floating constant initialized by a string.
*/ */
setmode(header); set_mode(header);
s = string ; s = string ;
for (n=strlngth ; n-- ;) { for (n=strlngth ; n-- ;) {
if ( *s==0 ) error("Zero byte in initializer") ; if ( *s==0 ) error("Zero byte in initializer") ;
@ -875,7 +875,7 @@ extvcon(header) {
* generate data for a constant initialized by a string. * generate data for a constant initialized by a string.
*/ */
setmode(header); set_mode(header);
if ( consiz>4 ) { if ( consiz>4 ) {
error("Size of initializer exceeds loader capability") ; error("Size of initializer exceeds loader capability") ;
} }