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

Some more #ifdef cleanups

src/cmd/ksh93/edit/edit.c,
src/cmd/ksh93/edit/history.c,
src/cmd/ksh93/sh/deparse.c:
- Remove experimental code protected by '#ifdef future'.
  No one is going to do anything with this, it's just clutter.

src/lib/libast/sfio/sfcvt.c:
- In 2021, it might be time to actually start using some C99
  features were available. Change two checks for a _c99_in_the_wild
  macro to actual checks for C99, enabling the use of fpclassify().

Resolves: https://github.com/ksh93/ksh/issues/219
This commit is contained in:
Martijn Dekker 2021-03-21 06:04:38 +00:00
parent 0b814b53bd
commit 38f2b94f55
4 changed files with 2 additions and 60 deletions

View file

@ -147,9 +147,6 @@ static char KILL_LINE[20] = { ESC, '[', 'J', 0 };
# define _POSIX_DISABLE 0
#endif
#ifdef future
static int compare(const char*, const char*, int);
#endif /* future */
#define ttyparm (ep->e_ttyparm)
#define nttyparm (ep->e_nttyparm)
static const char bellchr[] = "\a"; /* bell char */
@ -212,10 +209,6 @@ int tty_set(int fd, int action, struct termios *tty)
register Edit_t *ep = (Edit_t*)(shgd->ed_context);
if(fd >=0)
{
#ifdef future
if(ep->e_savefd>=0 && compare(&ep->e_savetty,tty,sizeof(struct termios)))
return(0);
#endif
while(tcsetattr(fd, action, tty) == SYSERR)
{
if(errno !=EINTR)
@ -1522,21 +1515,6 @@ int ed_genlen(register const genchar *str)
}
#endif /* (SHOPT_ESH || SHOPT_VSH) && SHOPT_MULTIBYTE */
#ifdef future
/*
* returns 1 when <n> bytes starting at <a> and <b> are equal
*/
static int compare(register const char *a,register const char *b,register int n)
{
while(n-->0)
{
if(*a++ != *b++)
return(0);
}
return(1);
}
#endif
#if SHOPT_OLDTERMIO
# include <sys/termio.h>

View file

@ -240,18 +240,6 @@ int sh_histinit(void *sh_context)
stakseek(offset);
histname = stakptr(offset);
}
#ifdef future
if(hp=wasopen)
{
/* reuse history file if same name */
wasopen = 0;
shgd->hist_ptr = hist_ptr = hp;
if(strcmp(histname,hp->histname)==0)
return(1);
else
hist_free();
}
#endif
retry:
cp = path_relative(shp,histname);
if(!histinit)
@ -641,18 +629,6 @@ again:
{
count += (cp-first);
n = hist_ind(hp, ++hp->histind);
#ifdef future
if(count==hp->histcmds[n])
{
sfprintf(sfstderr,"count match n=%d\n",n);
if(histinit)
{
histinit = 0;
return;
}
}
else if(n>=histinit)
#endif
hp->histcmds[n] = count;
first = cp;
}

View file

@ -476,15 +476,8 @@ static void p_redirect(register const struct ionod *iop)
if(iop->iodelim)
{
/* here document */
#ifdef xxx
iop->iolink = (char*)here_doc;
#endif
here_doc = iop;
io_op[2] = '<';
#ifdef future
if(iof&IOSTRIP)
io_op[3] = '-';
#endif
}
sfputr(outfile,cp,' ');
if(iop->ionxt)
@ -586,11 +579,6 @@ static void p_switch(register const struct regnod *reg)
static void here_body(register const struct ionod *iop)
{
Sfio_t *infile;
#ifdef xxx
if(iop->iolink)
here_body((struct inode*)iop->iolink);
iop->iolink = 0;
#endif
if(iop->iofile&IOSTRG)
infile = sfnew((Sfio_t*)0,iop->ioname,iop->iosize,-1,SF_STRING|SF_READ);
else

View file

@ -160,7 +160,7 @@ int format; /* conversion format */
return SF_INF;
}
#endif
# if _c99_in_the_wild
# if __STDC_VERSION__ >= 199901L
# if _lib_signbit
if (signbit(f))
# else
@ -338,7 +338,7 @@ int format; /* conversion format */
return SF_INF;
}
#endif
#if _c99_in_the_wild
#if __STDC_VERSION__ >= 199901L
# if _lib_signbit
if (signbit(f))
# else