summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmadeusz Sławiński (amade) <amade@asmblr.net>2011-01-03 12:04:59 +0100
committerAmadeusz Sławiński <amade@asmblr.net>2014-05-11 16:29:33 +0200
commite3ff691584fcb014b772aa8cef106be0d61527a7 (patch)
tree96380db28bcd66a7ec4b6ea2263c0130d27a9bd7
parent7ae8a39c153fa87614b3fce88ca4514a4fd3e74d (diff)
downloadscreen-e3ff691584fcb014b772aa8cef106be0d61527a7.tar.gz
remove #if 0'ed code
-rw-r--r--src/acls.c19
-rw-r--r--src/display.c8
-rw-r--r--src/layer.c21
-rw-r--r--src/process.c138
-rw-r--r--src/resize.c36
-rw-r--r--src/screen.c5
-rw-r--r--src/teln.c4
-rw-r--r--src/termcap.c23
-rw-r--r--src/window.c11
-rw-r--r--src/window.h3
10 files changed, 0 insertions, 268 deletions
diff --git a/src/acls.c b/src/acls.c
index 887bd78..87df7bb 100644
--- a/src/acls.c
+++ b/src/acls.c
@@ -300,25 +300,6 @@ UserAdd(char *name, char *pass, struct acluser **up)
return 0;
}
-#if 0
-/* change user's password */
-int
-UserSetPass(name, pass, up)
-char *name, *pass;
-struct acluser **up;
-{
- if (!up)
- up = FindUserPtr(name);
- if (!*up)
- return UserAdd(name, pass, up);
- if (!strcmp(name, "nobody")) /* he remains without password */
- return -1;
- strncpy((*up)->u_password, pass ? pass : "", 20);
- (*up)->u_password[20] = '\0';
- return 0;
-}
-#endif
-
/*
* Remove a user from the list.
* Destroy all his permissions and completely detach him from the session.
diff --git a/src/display.c b/src/display.c
index 6d56dd9..f68ce93 100644
--- a/src/display.c
+++ b/src/display.c
@@ -2561,9 +2561,6 @@ DisplayLine(struct mline *oml, struct mline *ml, int y, int from, int to)
#endif
for (x = from; x <= to; x++)
{
-#if 0 /* no longer needed */
- if (x || D_x != D_width || D_y != y - 1)
-#endif
{
if (ml != NULL && (x < to || x != D_width - 1 || ml->image[x + 1]))
if (cmp_mline(oml, ml, x))
@@ -2587,11 +2584,6 @@ DisplayLine(struct mline *oml, struct mline *ml, int y, int from, int to)
PUTCHAR(ml->image[++x]);
#endif
}
-#if 0 /* not needed any longer */
- /* compare != 0 because ' ' can happen when clipping occures */
- if (to == D_width - 1 && y < D_height - 1 && D_x == D_width && ml->image[to + 1])
- GotoPos(0, y + 1);
-#endif
if (last2flag)
{
GotoPos(x, y);
diff --git a/src/layer.c b/src/layer.c
index 7c3b28b..2d79659 100644
--- a/src/layer.c
+++ b/src/layer.c
@@ -218,11 +218,7 @@ LScrollV(struct layer *l, int n, int ys, int ye, int bce)
display = cv->c_display;
if (D_blocked)
continue;
-#if 0
- ScrollV(xs2, ys2, xe2, ye2, n, bce);
-#else
ScrollV(vp->v_xs, ys2, vp->v_xe, ye2, n, bce);
-#endif
debug2("LScrollV: %d %d", ys, ye);
debug2(" -> %d %d\n", ys2, ye2);
if (ye2 - ys2 == ye - ys)
@@ -543,22 +539,6 @@ LClearArea(struct layer *l, int xs, int ys, int xe, int ye, int bce, int uself)
ye2 = vp->v_ye;
if (ys2 > ye2)
continue;
-#if 0
- xcs = vp->v_xoff;
- xce = l->l_width - 1 + vp->v_xoff;
- if (xcs < vp->v_xs)
- xcs = vp->v_xs;
- if (xce > vp->v_xe)
- xce = vp->v_xe;
- if (xcs > xce)
- continue;
- if (ys2 != ys + vp->v_yoff)
- xs2 = xcs;
- if (ye2 != ye + vp->v_yoff)
- xe2 = xce;
- display = cv->c_display;
- ClearArea(xs2, ys2, xcs, xce, xe2, ye2, bce, uself);
-#else
if (xs == 0 || ys2 != ys + vp->v_yoff)
xs2 = vp->v_xs;
if (xe == l->l_width - 1 || ye2 != ye + vp->v_yoff)
@@ -575,7 +555,6 @@ LClearArea(struct layer *l, int xs, int ys, int xe, int ye, int bce, int uself)
PUTCHARLP('|');
}
}
-#endif
}
}
);
diff --git a/src/process.c b/src/process.c
index c4fcf32..32e8637 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6357,15 +6357,6 @@ Activate(int norefresh)
fore->w_monitor = MON_ON;
fore->w_bell = BELL_ON;
WindowChanged(fore, 'f');
-
-#if 0
- if (ResizeDisplay(fore->w_width, fore->w_height))
- {
- debug2("Cannot resize from (%d,%d)", D_width, D_height);
- debug2(" to (%d,%d) -> resize window\n", fore->w_width, fore->w_height);
- DoResize(D_width, D_height);
- }
-#endif
}
Redisplay(norefresh + all_norefresh);
}
@@ -6606,12 +6597,6 @@ AddWindowFlags(char *buf, int len, struct win *p)
*s = 0;
return s;
}
-#if 0
- if (display && p == D_fore)
- *s++ = '*';
- if (display && p == D_other)
- *s++ = '-';
-#endif
if (p->w_layer.l_cvlist && p->w_layer.l_cvlist->c_lnext)
*s++ = '&';
if (p->w_monitor == MON_DONE
@@ -7675,68 +7660,6 @@ FindNiceWindow(struct win *win, char *presel)
return win;
}
-#if 0
-
-/* sorted list of all commands */
-static struct comm **commtab;
-static int ncommtab;
-
-void
-AddComms(cos, hand)
-struct comm *cos;
-void (*hand) (struct comm *, char **, int);
-{
- int n, i, j, r;
- for (n = 0; cos[n].name; n++)
- ;
- if (n == 0)
- return;
- if (commtab)
- commtab = (struct commt *)realloc(commtab, sizeof(*commtab) * (ncommtab + n));
- else
- commtab = (struct commt *)malloc(sizeof(*commtab) * (ncommtab + n));
- if (!commtab)
- Panic(0, strnomem);
- for (i = 0; i < n; i++)
- {
- for (j = 0; j < ncommtab; j++)
- {
- r = strcmp(cos[i].name, commtab[j]->name);
- if (r == 0)
- Panic(0, "Duplicate command: %s\n", cos[i].name);
- if (r < 0)
- break;
- }
- for (r = ncommtab; r > j; r--)
- commtab[r] = commtab[r - 1];
- commtab[j] = cos + i;
- cos[i].handler = hand;
- bzero(cos[i].userbits, sizeof(cos[i].userbits));
- ncommtab++;
- }
-}
-
-struct comm *
-FindComm(str)
-char *str;
-{
- int x, m, l = 0, r = ncommtab - 1;
- while (l <= r)
- {
- m = (l + r) / 2;
- x = strcmp(str, commtab[m]->name);
- if (x > 0)
- l = m + 1;
- else if (x < 0)
- r = m - 1;
- else
- return commtab[m];
- }
- return 0;
-}
-
-#endif
-
static int
CalcSlicePercent(struct canvas *cv, int percent)
{
@@ -7969,67 +7892,6 @@ ResizeRegions(char *arg, int flags)
RethinkDisplayViewports();
ResizeLayersToCanvases();
return;
-
-#if 0
-
- if (siz + diff < 1)
- diff = 1 - siz;
- if (siz + diff > dsize - (nreg - 1) * 2 - 1)
- diff = dsize - (nreg - 1) * 2 - 1 - siz;
- if (diff == 0 || siz + diff < 1)
- return;
-
- if (diff < 0)
- {
- if (D_forecv->c_next)
- {
- D_forecv->c_ye += diff;
- D_forecv->c_next->c_ys += diff;
- D_forecv->c_next->c_yoff += diff;
- }
- else
- {
- for (cv = D_cvlist; cv; cv = cv->c_next)
- if (cv->c_next == D_forecv)
- break;
- ASSERT(cv);
- cv->c_ye -= diff;
- D_forecv->c_ys -= diff;
- D_forecv->c_yoff -= diff;
- }
- }
- else
- {
- int s, i = 0, found = 0, di = diff, d2;
- s = dsize - (nreg - 1) * 2 - 1 - siz;
- for (cv = D_cvlist; cv; i = cv->c_ye + 2, cv = cv->c_next)
- {
- if (cv == D_forecv)
- {
- cv->c_ye = i + (cv->c_ye - cv->c_ys) + diff;
- cv->c_yoff -= cv->c_ys - i;
- cv->c_ys = i;
- found = 1;
- continue;
- }
- s -= cv->c_ye - cv->c_ys;
- if (!found)
- {
- if (s >= di)
- continue;
- d2 = di - s;
- }
- else
- d2 = di > cv->c_ye - cv->c_ys ? cv->c_ye - cv->c_ys : di;
- di -= d2;
- cv->c_ye = i + (cv->c_ye - cv->c_ys) - d2;
- cv->c_yoff -= cv->c_ys - i;
- cv->c_ys = i;
- }
- }
- RethinkDisplayViewports();
- ResizeLayersToCanvases();
-#endif
}
static void
diff --git a/src/resize.c b/src/resize.c
index 74c5395..23426d4 100644
--- a/src/resize.c
+++ b/src/resize.c
@@ -118,15 +118,6 @@ CheckScreenSize(int change_flag)
debug2("CheckScreenSize: screen is (%d,%d)\n", wi, he);
-#if 0 /* XXX: Fixme */
- if (change_flag == 2)
- {
- debug("Trying to adapt all windows (-A)\n");
- for (p = windows; p; p = p->w_next)
- if (p->w_display == 0 || p->w_display == display)
- ChangeWindowSize(p, wi, he, p->w_histheight);
- }
-#endif
if (D_width == wi && D_height == he)
{
debug("CheckScreenSize: No change -> return.\n");
@@ -137,11 +128,6 @@ CheckScreenSize(int change_flag)
#endif
ResetIdle();
ChangeScreenSize(wi, he, change_flag);
-/* XXX Redisplay logic */
-#if 0
- if (change_flag == 1)
- Redisplay(D_fore ? D_fore->w_norefresh : 0);
-#endif
}
void
@@ -198,20 +184,8 @@ ChangeScreenSize(int wi, int he, int change_fore)
{
debug1("Trying to change window %d.\n", p->w_number);
wwi = wi;
-#if 0
- if (D_CZ0 && p->w_width != wi && (wi == Z0width || wi == Z1width))
- {
- if (p->w_width > (Z0width + Z1width) / 2)
- wwi = Z0width;
- else
- wwi = Z1width;
- }
-#endif
if (p->w_savelayer && p->w_savelayer->l_cvlist == 0)
ResizeLayer(p->w_savelayer, wwi, he, 0);
-#if 0
- ChangeWindowSize(p, wwi, he, p->w_histheight);
-#endif
}
}
}
@@ -668,16 +642,6 @@ ChangeWindowSize(struct win *p, int wi, int he, int hi)
CheckMaxSize(wi);
- /* XXX */
-#if 0
- /* just in case ... */
- if (wi && (p->w_width != wi || p->w_height != he) && p->w_lay != &p->w_winlay)
- {
- debug("ChangeWindowSize: No resize because of overlay?\n");
- return -1;
- }
-#endif
-
debug("ChangeWindowSize");
debug3(" from (%d,%d)+%d", p->w_width, p->w_height, p->w_histheight);
debug3(" to(%d,%d)+%d\n", wi, he, hi);
diff --git a/src/screen.c b/src/screen.c
index 71026bd..cc7ab26 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2513,11 +2513,6 @@ MakeWinMsgEv(char *str, struct win *win, int esc, int padlen, struct event *ev,
{
switch (*s)
{
-#if 0
- case '~':
- *p = BELL;
- break;
-#endif
case '^':
ctrl = 1;
*p-- = '^';
diff --git a/src/teln.c b/src/teln.c
index 49f5718..65cbf76 100644
--- a/src/teln.c
+++ b/src/teln.c
@@ -418,10 +418,6 @@ TelDocmd(struct win *p, int cmd, int opt)
if (!p->w_telropts[opt] || opt == TO_TM)
return;
repl = TC_DONT;
-#if 0
- if (opt == TO_ECHO || opt == TO_SGA)
- setcon();
-#endif
p->w_telropts[opt] = 0;
break;
case TC_DO:
diff --git a/src/termcap.c b/src/termcap.c
index 17a9bc8..98211e0 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -835,9 +835,6 @@ MakeTermcap(int aflag)
char buf[TERMCAP_BUFSIZE];
register char *p, *cp, *s, ch, *tname;
int i, wi, he;
-#if 0
- int found;
-#endif
if (display)
{
@@ -867,9 +864,6 @@ MakeTermcap(int aflag)
debug("MakeTermcap sets screenterm=screen\n");
strcpy(screenterm, "screen");
}
-#if 0
- found = 1;
-#endif
do
{
strcpy(Term, "TERM=");
@@ -900,26 +894,9 @@ MakeTermcap(int aflag)
if (e_tgetent(buf, p) == 1)
break;
strcpy(p, "vt100");
-#if 0
- found = 0;
-#endif
}
while (0); /* Goto free programming... */
-#if 0
-#ifndef TERMINFO
- /* check for compatibility problems, displays == 0 after fork */
- if (found)
- {
- char xbuf[TERMCAP_BUFSIZE], *xbp = xbuf;
- if (tgetstr("im", &xbp) && tgetstr("ic", &xbp) && displays)
- {
- Msg(0, "Warning: im and ic set in %s termcap entry", p);
- }
- }
-#endif
-#endif
-
tcLineLen = 100; /* Force NL */
if (strlen(Term) > TERMCAP_BUFSIZE - 40)
strcpy(Term, "too_long");
diff --git a/src/window.c b/src/window.c
index 25c903c..c98a4b6 100644
--- a/src/window.c
+++ b/src/window.c
@@ -703,16 +703,6 @@ MakeWindow(struct NewWindow *newwin)
p->w_norefresh = 0;
strncpy(p->w_tty, TtyName, MAXSTR - 1);
-#if 0
- /* XXX Fixme display resize */
- if (ChangeWindowSize(p, display ? D_defwidth : 80,
- display ? D_defheight : 24,
- nwin.histheight))
- {
- FreeWindow(p);
- return -1;
- }
-#else
if (ChangeWindowSize(p, display ? D_forecv->c_xe - D_forecv->c_xs + 1: 80,
display ? D_forecv->c_ye - D_forecv->c_ys + 1 : 24,
nwin.histheight))
@@ -720,7 +710,6 @@ MakeWindow(struct NewWindow *newwin)
FreeWindow(p);
return -1;
}
-#endif
p->w_encoding = nwin.encoding;
ResetWindow(p); /* sets w_wrap, w_c1, w_gr, w_bce */
diff --git a/src/window.h b/src/window.h
index bb22fed..2036774 100644
--- a/src/window.h
+++ b/src/window.h
@@ -212,9 +212,6 @@ struct win
int w_gr; /* enable GR flag */
int w_c1; /* enable C1 flag */
int w_bce; /* enable backcol erase */
-#if 0
- int w_encoding; /* for input and paste */
-#endif
int w_decodestate; /* state of our input decoder */
#ifdef DW_CHARS
int w_mbcs; /* saved char for multibytes charset */