mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Fix more compiler warnings, typos and other minor issues (#260)
Many of these changes are minor typo fixes. The other changes (which are mostly compiler warning fixes) are: NEWS: - The --globcasedetect shell option works on older Linux kernels when used with FAT32/VFAT file systems, so remove the note about it only working with 5.2+ kernels. src/cmd/ksh93/COMPATIBILITY: - Update the documentation on function scoping with an addition from ksh93v- (this does apply to ksh93u+). src/cmd/ksh93/edit/emacs.c: - Check for '_AST_ksh_release', not 'AST_ksh_release'. src/cmd/INIT/mamake.c, src/cmd/INIT/ratz.c, src/cmd/INIT/release.c, src/cmd/builtin/pty.c: - Add more uses of UNREACHABLE() and noreturn, this time for the build system and pty. src/cmd/builtin/pty.c, src/cmd/builtin/array.c, src/cmd/ksh93/sh/name.c, src/cmd/ksh93/sh/nvtype.c, src/cmd/ksh93/sh/suid_exec.c: - Fix six -Wunused-variable warnings (the name.c nv_arrayptr() fixes are also in ksh93v-). - Remove the unused 'tableval' function to fix a -Wunused-function warning. src/cmd/ksh93/sh/lex.c: - Remove unused 'SHOPT_DOS' code, which isn't enabled anywhere. https://github.com/att/ast/issues/272#issuecomment-354363112 src/cmd/ksh93/bltins/misc.c, src/cmd/ksh93/bltins/trap.c, src/cmd/ksh93/bltins/typeset.c: - Add dictionary generator function declarations for former aliases that are now builtins (re:1fbbeaa1,ef1621c1,3ba4900e). - For consistency with the rest of the codebase, use '(void)' instead of '()' for print_cpu_times. src/cmd/ksh93/sh/init.c, src/lib/libast/path/pathshell.c: - Move the otherwise unused EXE macro to pathshell() and only search for 'sh.exe' on Windows. src/cmd/ksh93/sh/xec.c, src/lib/libast/include/ast.h: - Add an empty definition for inline when compiling with C89. This allows the timeval_to_double() function to be inlined. src/cmd/ksh93/include/shlex.h: - Remove the unused 'PIPESYM2' macro. src/cmd/ksh93/tests/pty.sh: - Add '# err_exit #' to count the regression test added in commit113a9392. src/lib/libast/disc/sfdcdio.c: - Move diordwr, dioread, diowrite and dioexcept behind '#ifdef F_DIOINFO' to fix one -Wunused-variable warning and multiple -Wunused-function warnings (sfdcdio() only uses these functions when F_DIOINFO is defined). src/lib/libast/string/fmtdev.c: - Fix two -Wimplicit-function-declaration warnings on Linux by including sys/sysmacros.h in fmtdev().
This commit is contained in:
parent
ecf260c282
commit
a065558291
96 changed files with 299 additions and 282 deletions
|
|
@ -37,7 +37,7 @@
|
|||
static char *savesub = 0;
|
||||
static char Null[1];
|
||||
static Namval_t NullNode;
|
||||
static Dt_t *Refdict;
|
||||
static Dt_t *Refdict;
|
||||
static Dtdisc_t _Refdisc =
|
||||
{
|
||||
offsetof(struct Namref,np),sizeof(struct Namval_t*),sizeof(struct Namref)
|
||||
|
|
@ -280,7 +280,7 @@ void nv_setlist(register struct argnod *arg,register int flags, Namval_t *typ)
|
|||
shtp.rp = 0;
|
||||
shtp.nodes = (Namval_t**)sh_malloc(shtp.maxnodes*sizeof(Namval_t*));
|
||||
}
|
||||
#endif /* SHOPT_TYPEDEF*/
|
||||
#endif /* SHOPT_TYPEDEF */
|
||||
#if SHOPT_NAMESPACE
|
||||
if(shp->namespace && nv_dict(shp->namespace)==shp->var_tree)
|
||||
flags |= NV_NOSCOPE;
|
||||
|
|
@ -734,9 +734,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
|
|||
long mode, add=0;
|
||||
int copy=0,isref,top=0,noscope=(flags&NV_NOSCOPE);
|
||||
int nofree=0, level=0;
|
||||
#if SHOPT_FIXEDARRAY
|
||||
Namarr_t *ap;
|
||||
#endif /* SHOPT_FIXEDARRAY */
|
||||
if(root==shp->var_tree)
|
||||
{
|
||||
if(dtvnext(root))
|
||||
|
|
@ -944,7 +942,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
|
|||
{
|
||||
if(flags&NV_ARRAY)
|
||||
{
|
||||
Namarr_t *ap = nv_arrayptr(np);
|
||||
ap = nv_arrayptr(np);
|
||||
nq = nv_opensub(np);
|
||||
if((flags&NV_ASSIGN) && (!nq || nv_isnull(nq)))
|
||||
ap->nelem++;
|
||||
|
|
@ -1034,7 +1032,7 @@ Namval_t *nv_create(const char *name, Dt_t *root, int flags, Namfun_t *dp)
|
|||
if(c=='[')
|
||||
{
|
||||
#if SHOPT_FIXEDARRAY
|
||||
Namarr_t *ap = nv_arrayptr(np);
|
||||
ap = nv_arrayptr(np);
|
||||
#endif /* SHOPT_FIXEDARRAY */
|
||||
n = mode|nv_isarray(np);
|
||||
if(!mode && (flags&NV_ARRAY) && ((c=sp[1])=='*' || c=='@') && sp[2]==']')
|
||||
|
|
@ -2073,7 +2071,7 @@ static void rightjust(char *str, int size, int fill)
|
|||
* given physical size, return a logical size which reflects the
|
||||
* screen width of multi-byte characters
|
||||
* Multi-width characters replaced by spaces if they cross the boundary
|
||||
* <type> is non-zero for right justified fields
|
||||
* <type> is non-zero for right justified fields
|
||||
*/
|
||||
|
||||
static int ja_size(char *str,int size,int type)
|
||||
|
|
@ -2604,36 +2602,6 @@ Namval_t *sh_scoped(Shell_t *shp, register Namval_t *np)
|
|||
return(dtsearch(shp->var_tree,np));
|
||||
}
|
||||
|
||||
/*
|
||||
* return space separated list of names of variables in given tree
|
||||
*/
|
||||
static char *tableval(Dt_t *root)
|
||||
{
|
||||
static Sfio_t *out;
|
||||
register Namval_t *np;
|
||||
register int first=1;
|
||||
register Dt_t *base = dtview(root,0);
|
||||
if(out)
|
||||
sfseek(out,(Sfoff_t)0,SEEK_SET);
|
||||
else
|
||||
out = sfnew((Sfio_t*)0,(char*)0,-1,-1,SF_WRITE|SF_STRING);
|
||||
for(np=(Namval_t*)dtfirst(root);np;np=(Namval_t*)dtnext(root,np))
|
||||
{
|
||||
if(!nv_isnull(np) || np->nvfun || nv_isattr(np,~NV_NOFREE))
|
||||
{
|
||||
if(!first)
|
||||
sfputc(out,' ');
|
||||
else
|
||||
first = 0;
|
||||
sfputr(out,np->nvname,-1);
|
||||
}
|
||||
}
|
||||
sfputc(out,0);
|
||||
if(base)
|
||||
dtview(root,base);
|
||||
return((char*)out->_data);
|
||||
}
|
||||
|
||||
#if SHOPT_OPTIMIZE
|
||||
struct optimize
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue