remove some debugging code

This commit is contained in:
tg 2010-01-25 14:38:04 +00:00
parent bbb4a1a70f
commit f3b3b4b1fb
5 changed files with 6 additions and 50 deletions

7
expr.c
View File

@ -1,7 +1,7 @@
/* $OpenBSD: expr.c,v 1.21 2009/06/01 19:00:57 deraadt Exp $ */ /* $OpenBSD: expr.c,v 1.21 2009/06/01 19:00:57 deraadt Exp $ */
/*- /*-
* Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009 * Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
* Thorsten Glaser <tg@mirbsd.org> * Thorsten Glaser <tg@mirbsd.org>
* *
* Provided that these terms and disclaimer and all copyright notices * Provided that these terms and disclaimer and all copyright notices
@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/expr.c,v 1.42 2009/12/12 22:27:06 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/expr.c,v 1.43 2010/01/25 14:38:00 tg Exp $");
/* The order of these enums is constrained by the order of opinfo[] */ /* The order of these enums is constrained by the order of opinfo[] */
enum token { enum token {
@ -626,9 +626,6 @@ tempvar(void)
vp->flag = ISSET|INTEGER; vp->flag = ISSET|INTEGER;
vp->type = 0; vp->type = 0;
vp->areap = ATEMP; vp->areap = ATEMP;
#ifdef notyet_ktremove
vp->tablep = NULL;
#endif
vp->ua.hval = 0; vp->ua.hval = 0;
vp->val.i = 0; vp->val.i = 0;
vp->name[0] = '\0'; vp->name[0] = '\0';

View File

@ -25,7 +25,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.148 2010/01/25 14:11:26 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.149 2010/01/25 14:38:01 tg Exp $");
#if HAVE_KILLPG #if HAVE_KILLPG
/* /*
@ -2661,10 +2661,6 @@ c_mknod(const char **wp)
umask(oldmode); umask(oldmode);
return (rv); return (rv);
c_mknod_usage: c_mknod_usage:
#if 0
/* XXX doesn't help */
builtin_argv0 = NULL;
#endif
bi_errorf("usage: mknod [-m mode] name [b | c] major minor"); bi_errorf("usage: mknod [-m mode] name [b | c] major minor");
bi_errorf("usage: mknod [-m mode] name p"); bi_errorf("usage: mknod [-m mode] name p");
return (1); return (1);

27
main.c
View File

@ -33,7 +33,7 @@
#include <locale.h> #include <locale.h>
#endif #endif
__RCSID("$MirOS: src/bin/mksh/main.c,v 1.159 2010/01/25 14:07:38 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/main.c,v 1.160 2010/01/25 14:38:02 tg Exp $");
extern char **environ; extern char **environ;
@ -1416,9 +1416,6 @@ ktenter(struct table *tp, const char *n, uint32_t h)
p->flag = 0; p->flag = 0;
p->type = 0; p->type = 0;
p->areap = tp->areap; p->areap = tp->areap;
#ifdef notyet_ktremove
p->tablep = tp;
#endif
p->ua.hval = h; p->ua.hval = h;
p->u2.field = 0; p->u2.field = 0;
p->u.array = NULL; p->u.array = NULL;
@ -1430,28 +1427,6 @@ ktenter(struct table *tp, const char *n, uint32_t h)
return (p); return (p);
} }
#ifdef notyet_ktremove
void
ktremove(struct tbl *p)
{
struct tbl **pp;
if (p->tablep && p->tablep->size && ktscan(p->tablep, p->name,
p->ua.hval, &pp) == p) {
/* ktremove p */
wontwork("cannot use NULL here, see r1.143 commit message");
*pp = NULL;
p->tablep->nfree++;
/* get rid of p */
wontwork("need to check FINUSE, see texpand");
afree(p, p->areap);
} else {
/* mark p as free for garbage collection via texpand */
p->flag = 0;
}
}
#endif
void void
ktwalk(struct tstate *ts, struct table *tp) ktwalk(struct tstate *ts, struct table *tp)
{ {

6
sh.h
View File

@ -148,7 +148,7 @@
#endif #endif
#ifdef EXTERN #ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.374 2010/01/16 19:08:05 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/sh.h,v 1.375 2010/01/25 14:38:03 tg Exp $");
#endif #endif
#define MKSH_VERSION "R39 2010/01/08" #define MKSH_VERSION "R39 2010/01/08"
@ -863,9 +863,6 @@ struct tbl { /* table item */
struct tbl *array; /* array values */ struct tbl *array; /* array values */
const char *fpath; /* temporary path to undef function */ const char *fpath; /* temporary path to undef function */
} u; } u;
#ifdef notyet_ktremove
struct table *tablep; /* table we're ktenter'd in */
#endif
union { union {
int field; /* field with for -L/-R/-Z */ int field; /* field with for -L/-R/-Z */
int errno_; /* CEXEC/CTALIAS */ int errno_; /* CEXEC/CTALIAS */
@ -1541,7 +1538,6 @@ void ktinit(struct table *, Area *, size_t);
struct tbl *ktsearch(struct table *, const char *, uint32_t); struct tbl *ktsearch(struct table *, const char *, uint32_t);
struct tbl *ktenter(struct table *, const char *, uint32_t); struct tbl *ktenter(struct table *, const char *, uint32_t);
#define ktdelete(p) do { p->flag = 0; } while (/* CONSTCOND */ 0) #define ktdelete(p) do { p->flag = 0; } while (/* CONSTCOND */ 0)
void ktremove(struct tbl *);
void ktwalk(struct tstate *, struct table *); void ktwalk(struct tstate *, struct table *);
struct tbl *ktnext(struct tstate *); struct tbl *ktnext(struct tstate *);
struct tbl **ktsort(struct table *); struct tbl **ktsort(struct table *);

10
var.c
View File

@ -22,7 +22,7 @@
#include "sh.h" #include "sh.h"
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.102 2010/01/25 14:25:16 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/var.c,v 1.103 2010/01/25 14:38:04 tg Exp $");
/* /*
* Variables * Variables
@ -1304,10 +1304,6 @@ arraysearch(struct tbl *vp, uint32_t val)
new->areap = vp->areap; new->areap = vp->areap;
new->u2.field = vp->u2.field; new->u2.field = vp->u2.field;
new->ua.index = val; new->ua.index = val;
#ifdef notyet_ktremove
/* XXX array indices must not be ktdelete'd, for now */
new->tablep = NULL;
#endif
if (curr != new) { /* not reusing old array entry */ if (curr != new) { /* not reusing old array entry */
prev->u.array = new; prev->u.array = new;
@ -1411,10 +1407,6 @@ set_array(const char *var, bool reset, const char **vals)
vq = arraysearch(vp, j); vq = arraysearch(vp, j);
/* would be nice to deal with errors here... (see above) */ /* would be nice to deal with errors here... (see above) */
#if 0
shprintf("setting '%s'[%lu]='%s' <- '%s'\n",
vp->name, (unsigned long)j, ccp, vals[i]);
#endif
setstr(vq, ccp, KSH_RETURN_ERROR); setstr(vq, ccp, KSH_RETURN_ERROR);
i++; i++;
#ifndef MKSH_SMALL #ifndef MKSH_SMALL