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

'#if 0' cleanup

This removes various blocks of uncommented experimental code that
was disabled using '#if 0' or '#if 1 ... #else' directives. It's
hard or impossible to figure out what the thoughts behind them
might have been, and we can really do without those distractions.
This commit is contained in:
Martijn Dekker 2020-08-30 03:59:12 +01:00
parent f8feed1bd2
commit 42301639d6
17 changed files with 4 additions and 227 deletions

View file

@ -70,11 +70,6 @@ USAGE_LICENSE
"with the \bfunction\b reserved word, the specified variables "
"will have function static scope. Otherwise, the variable is "
"unset prior to processing the assignment list.]"
#if 0
"[p?Causes the output to be in a form of \b\f?\f\b commands that can be "
"used as input to the shell to recreate the current type of "
"these variables.]"
#endif
"\n"
"\n[name[=value]...]\n"
"\n"
@ -103,11 +98,7 @@ static int enuminfo(Opt_t* op, Sfio_t *out, const char *str, Optdisc_t *fp)
np = *(Namval_t**)(fp+1);
ep = (struct Enum*)np->nvfun;
if(strcmp(str,"default")==0)
#if 0
sfprintf(out,"\b%s\b%c",ep->values[0],0);
#else
sfprintf(out,"\b%s\b",ep->values[0]);
#endif
else if(strcmp(str,"case")==0)
{
if(ep->iflag)

View file

@ -227,10 +227,8 @@ static int waitnotify(int fd, long timeout, int rw)
if(service_list[file_list[i]])
*pstream++ = sh_fd2sfio(file_list[i]);
}
#if 1
for(i=0; i < pstream-poll_list; i++)
sfset(poll_list[i],SF_WRITE,0);
#endif
nready = ready = 0;
errno = 0;
#ifdef DEBUG
@ -246,10 +244,8 @@ static int waitnotify(int fd, long timeout, int rw)
sfprintf(sfstderr," %d",sffileno(poll_list[i]));
sfputc(sfstderr,'\n');
#endif
#if 1
for(i=0; i < pstream-poll_list; i++)
sfset(poll_list[i],SF_WRITE,1);
#endif
if(nready<=0)
return(errno? -1: 0);
if(special && poll_list[0]==special)

View file

@ -538,11 +538,7 @@ static char *fmthtml(const char *string, int flags)
return(stakptr(offset));
}
#if 1
static ssize_t fmtbase64(Sfio_t *iop, char *string, int alt)
#else
static void *fmtbase64(char *string, ssize_t *sz, int alt)
#endif
{
char *cp;
Sfdouble_t d;
@ -595,16 +591,9 @@ static void *fmtbase64(char *string, ssize_t *sz, int alt)
number.i = (int)d;
}
}
#if 1
return(sfwrite(iop, (void*)&number, size));
#else
if(sz)
*sz = size;
return((void*)&number);
#endif
}
if(nv_isattr(np,NV_BINARY))
#if 1
{
Namfun_t *fp;
for(fp=np->nvfun; fp;fp=fp->next)
@ -651,17 +640,6 @@ static void *fmtbase64(char *string, ssize_t *sz, int alt)
size = strlen(cp);
return(sfwrite(iop,cp,size));
}
#else
nv_onattr(np,NV_RAW);
cp = nv_getval(np);
if(nv_isattr(np,NV_BINARY))
nv_offattr(np,NV_RAW);
if((size = nv_size(np))==0)
size = strlen(cp);
if(sz)
*sz = size;
return((void*)cp);
#endif
}
static int varname(const char *str, int n)