Introduction
Introduction Statistics Contact Development Disclaimer Help
Compile without warnings. - sam - An updated version of the sam text editor.
git clone git://vernunftzentrum.de/sam.git
Log
Files
Refs
LICENSE
---
commit 8107b3fb44d8e2451df0acced3949d0dc60e4a9a
parent a3f16236248f4dceeec1507862720f5a214b72b3
Author: Rob King <[email protected]>
Date: Tue, 6 Sep 2016 21:55:18 -0500
Compile without warnings.
Diffstat:
libXg/cursorswitch.c | 3 ---
libXg/gcs.c | 4 ++++
libXg/gwin.c | 15 +++++----------
libXg/latin1.c | 415 +++++++++++++++----------------
libXg/menuhit.c | 2 +-
libXg/string.c | 4 ++--
libXg/strwidth.c | 4 ++--
libXg/xtbinit.c | 49 ++-----------------------------
libframe/frselect.c | 3 ++-
sam/address.c | 3 ++-
sam/buffer.c | 3 ---
sam/cmd.c | 70 ++++++++++++++++----------------
sam/mesg.c | 2 +-
sam/mesg.h | 2 ++
sam/moveto.c | 2 +-
sam/multi.c | 2 --
sam/rasp.c | 1 +
sam/regexp.c | 7 ++++---
sam/shell.c | 2 +-
sam/string.c | 2 +-
sam/unix.c | 3 ++-
sam/xec.c | 6 +++---
samterm/main.c | 4 ++--
samterm/menu.c | 6 +++---
samterm/mesg.c | 2 +-
samterm/rasp.c | 2 +-
samterm/unix.c | 1 -
27 files changed, 286 insertions(+), 333 deletions(-)
---
diff --git a/libXg/cursorswitch.c b/libXg/cursorswitch.c
@@ -8,9 +8,6 @@
#include <X11/cursorfont.h>
-static Bitmap *bsrc, *bmask;
-static Rectangle crect = { 0, 0, 16, 16 };
-
extern Window _topwindow;
static Cursor sweep;
diff --git a/libXg/gcs.c b/libXg/gcs.c
@@ -312,6 +312,7 @@ _getcopygc2(Fcode f, Bitmap *db, Bitmap *sb, int *bltfunc, …
XGCValues gcv;
unsigned long gcvm;
+ spix = xf = 0;
f &= F;
gcvm = 0;
df = db->flag;
@@ -341,6 +342,9 @@ _getcopygc2(Fcode f, Bitmap *db, Bitmap *sb, int *bltfunc, …
xf = GXxor;
spix = fg^bg;
break;
+ default:
+ /* ignored */
+ break;
}
gcv.function = xf;
gcv.foreground = spix;
diff --git a/libXg/gwin.c b/libXg/gwin.c
@@ -115,14 +115,12 @@ static int keypermod;
static void
Realize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attrs)
{
- XtValueMask mask;
-
*valueMask |= CWBackingStore;
attrs->backing_store = Always;
XtCreateWindow(w, InputOutput, (Visual *)0, *valueMask, attrs);
XtSetKeyboardFocus(w->core.parent, w);
- if (modmap = XGetModifierMapping(XtDisplay(w)))
+ if ((modmap = XGetModifierMapping(XtDisplay(w))))
keypermod = modmap->max_keypermod;
Resize(w);
@@ -202,7 +200,6 @@ Keyaction(Widget w, XEvent *e, String *p, Cardinal *np)
{
static unsigned char compose[5];
static int composing = -2;
- int composed = 0;
int kind = Kraw;
int c, minmod;
@@ -210,6 +207,8 @@ Keyaction(Widget w, XEvent *e, String *p, Cardinal *np)
Charfunc f;
Modifiers md;
+ c = 0;
+
/*
* I tried using XtGetActionKeysym, but it didn't seem to
* do case conversion properly
@@ -279,8 +278,7 @@ Keyaction(Widget w, XEvent *e, String *p, Cardinal *np)
if (c == -1) {
STUFFCOMPOSE();
c = (unsigned short)compose[4];
- } else
- composed = 1;
+ }
composing = -2;
}
} else if (composing == 1) {
@@ -288,8 +286,7 @@ Keyaction(Widget w, XEvent *e, String *p, Cardinal *np)
if (c == -1) {
STUFFCOMPOSE();
c = (unsigned short)compose[1];
- } else
- composed = 1;
+ }
composing = -2;
}
} else {
@@ -435,8 +432,6 @@ SendSel(Widget w, Atom *sel, Atom *target, Atom *rtype, XtP…
unsigned long *anslen, int *ansfmt)
{
GwinWidget gw = (GwinWidget)w;
- static Atom targets = 0;
- XrmValue src, dst;
char *s;
if(*target == XA_STRING){
diff --git a/libXg/latin1.c b/libXg/latin1.c
@@ -16,214 +16,213 @@ struct latin
};
struct latin latintab[] = {
- 0x0009, 't', 'a', /* horizontal tab */
- 0x00a1, '!','!', /* spanish initial ! */
- 0x00a2, 'c','$', /* cent */
- 0x00a3, 'l','$', /* pound sterling */
- 0x00a4, 'g','$', /* general currency */
- 0x00a5, 'y','$', /* yen */
- 0x00a6, '|','|', /* broken vertical bar */
- 0x00a7, 'S','S', /* section symbol */
- 0x00a8, '\"','\"', /* dieresis */
- 0x00a9, 'c','O', /* copyright */
- 0x00aa, 's','a', /* super a, feminine ordinal */
- 0x00ab, '<','<', /* left angle quotation */
- 0x00ac, 'n','o', /* not sign, hooked overbar */
- 0x00ad, '-','-', /* soft hyphen */
- 0x00ae, 'r','O', /* registered trademark */
- 0x00af, '_','_', /* macron */
- 0x00b0, 'd','e', /* degree */
- 0x00b1, '+','-', /* plus-minus */
- 0x00b2, 's','2', /* sup 2 */
- 0x00b3, 's','3', /* sup 3 */
- 0x00b4, '\'','\'', /* acute accent */
- 0x00b5, 'm','i', /* micron */
- 0x00b6, 'p','g', /* paragraph (pilcrow) */
- 0x00b7, '.','.', /* centered . */
- 0x00b8, ',',',', /* cedilla */
- 0x00b9, 's','1', /* sup 1 */
- 0x00ba, 's','o', /* super o, masculine ordinal */
- 0x00bb, '>','>', /* right angle quotation */
- 0x00bc, '1','4', /* 1/4 */
- 0x00bd, '1','2', /* 1/2 */
- 0x00be, '3','4', /* 3/4 */
- 0x00bf, '?','?', /* spanish initial ? */
- 0x00c0, '`','A', /* A grave */
- 0x00c1, '\'','A', /* A acute */
- 0x00c2, '^','A', /* A circumflex */
- 0x00c3, '~','A', /* A tilde */
- 0x00c4, '\"','A', /* A dieresis */
- 0x00c5, 'o','A', /* A circle */
- 0x00c6, 'A','E', /* AE ligature */
- 0x00c7, ',','C', /* C cedilla */
- 0x00c8, '`','E', /* E grave */
- 0x00c9, '\'','E', /* E acute */
- 0x00ca, '^','E', /* E circumflex */
- 0x00cb, '\"','E', /* E dieresis */
- 0x00cc, '`','I', /* I grave */
- 0x00cd, '\'','I', /* I acute */
- 0x00ce, '^','I', /* I circumflex */
- 0x00cf, '\"','I', /* I dieresis */
- 0x00d0, 'D','-', /* Eth */
- 0x00d1, '~','N', /* N tilde */
- 0x00d2, '`','O', /* O grave */
- 0x00d3, '\'','O', /* O acute */
- 0x00d4, '^','O', /* O circumflex */
- 0x00d5, '~','O', /* O tilde */
- 0x00d6, '\"','O', /* O dieresis */
- 0x00d7, 'm','u', /* times sign */
- 0x00d8, '/','O', /* O slash */
- 0x00d9, '`','U', /* U grave */
- 0x00da, '\'','U', /* U acute */
- 0x00db, '^','U', /* U circumflex */
- 0x00dc, '\"','U', /* U dieresis */
- 0x00dd, '\'','Y', /* Y acute */
- 0x00de, '|','P', /* Thorn */
- 0x00df, 's','s', /* sharp s */
- 0x00e0, '`','a', /* a grave */
- 0x00e1, '\'','a', /* a acute */
- 0x00e2, '^','a', /* a circumflex */
- 0x00e3, '~','a', /* a tilde */
- 0x00e4, '\"','a', /* a dieresis */
- 0x00e5, 'o','a', /* a circle */
- 0x00e6, 'a','e', /* ae ligature */
- 0x00e7, ',','c', /* c cedilla */
- 0x00e8, '`','e', /* e grave */
- 0x00e9, '\'','e', /* e acute */
- 0x00ea, '^','e', /* e circumflex */
- 0x00eb, '\"','e', /* e dieresis */
- 0x00ec, '`','i', /* i grave */
- 0x00ed, '\'','i', /* i acute */
- 0x00ee, '^','i', /* i circumflex */
- 0x00ef, '\"','i', /* i dieresis */
- 0x00f0, 'd','-', /* eth */
- 0x00f1, '~','n', /* n tilde */
- 0x00f2, '`','o', /* o grave */
- 0x00f3, '\'','o', /* o acute */
- 0x00f4, '^','o', /* o circumflex */
- 0x00f5, '~','o', /* o tilde */
- 0x00f6, '\"','o', /* o dieresis */
- 0x00f7, '-',':', /* divide sign */
- 0x00f8, '/','o', /* o slash */
- 0x00f9, '`','u', /* u grave */
- 0x00fa, '\'','u', /* u acute */
- 0x00fb, '^','u', /* u circumflex */
- 0x00fc, '\"','u', /* u dieresis */
- 0x00fd, '\'','y', /* y acute */
- 0x00fe, '|','p', /* thorn */
- 0x00ff, '\"','y', /* y dieresis */
- 0x2654, 'w','k', /* chess white king */
- 0x2655, 'w','q', /* chess white queen */
- 0x2656, 'w','r', /* chess white rook */
- 0x2657, 'w','b', /* chess white bishop */
- 0x2658, 'w','n', /* chess white knight */
- 0x2659, 'w','p', /* chess white pawn */
- 0x265a, 'b','k', /* chess black king */
- 0x265b, 'b','q', /* chess black queen */
- 0x265c, 'b','r', /* chess black rook */
- 0x265d, 'b','b', /* chess black bishop */
- 0x265e, 'b','n', /* chess black knight */
- 0x265f, 'b','p', /* chess black pawn */
- 0x03b1, '*','a', /* alpha */
- 0x03b2, '*','b', /* beta */
- 0x03b3, '*','g', /* gamma */
- 0x03b4, '*','d', /* delta */
- 0x03b5, '*','e', /* epsilon */
- 0x03b6, '*','z', /* zeta */
- 0x03b7, '*','y', /* eta */
- 0x03b8, '*','h', /* theta */
- 0x03b9, '*','i', /* iota */
- 0x03ba, '*','k', /* kappa */
- 0x03bb, '*','l', /* lambda */
- 0x03bc, '*','m', /* mu */
- 0x03bd, '*','n', /* nu */
- 0x03be, '*','c', /* xsi */
- 0x03bf, '*','o', /* omicron */
- 0x03c0, '*','p', /* pi */
- 0x03c1, '*','r', /* rho */
- 0x03c2, 't','s', /* terminal sigma */
- 0x03c3, '*','s', /* sigma */
- 0x03c4, '*','t', /* tau */
- 0x03c5, '*','u', /* upsilon */
- 0x03c6, '*','f', /* phi */
- 0x03c7, '*','x', /* chi */
- 0x03c8, '*','q', /* psi */
- 0x03c9, '*','w', /* omega */
- 0x0391, '*','A', /* Alpha */
- 0x0392, '*','B', /* Beta */
- 0x0393, '*','G', /* Gamma */
- 0x0394, '*','D', /* Delta */
- 0x0395, '*','E', /* Epsilon */
- 0x0396, '*','Z', /* Zeta */
- 0x0397, '*','Y', /* Eta */
- 0x0398, '*','H', /* Theta */
- 0x0399, '*','I', /* Iota */
- 0x039a, '*','K', /* Kappa */
- 0x039b, '*','L', /* Lambda */
- 0x039c, '*','M', /* Mu */
- 0x039d, '*','N', /* Nu */
- 0x039e, '*','C', /* Xsi */
- 0x039f, '*','O', /* Omicron */
- 0x03a0, '*','P', /* Pi */
- 0x03a1, '*','R', /* Rho */
- 0x03a3, '*','S', /* Sigma */
- 0x03a4, '*','T', /* Tau */
- 0x03a5, '*','U', /* Upsilon */
- 0x03a6, '*','F', /* Phi */
- 0x03a7, '*','X', /* Chi */
- 0x03a8, '*','Q', /* Psi */
- 0x03a9, '*','W', /* Omega */
- 0x2190, '<','-', /* left arrow */
- 0x2191, 'u','a', /* up arrow */
- 0x2192, '-','>', /* right arrow */
- 0x2193, 'd','a', /* down arrow */
- 0x2194, 'a','b', /* arrow both */
- 0x21d0, 'V','=', /* left double-line arrow */
- 0x21d2, '=','V', /* right double-line arrow */
- 0x2200, 'f','a', /* forall */
- 0x2203, 't','e', /* there exists */
- 0x2202, 'p','d', /* partial differential */
- 0x2205, 'e','s', /* empty set */
- 0x2206, 'D','e', /* delta */
- 0x2207, 'g','r', /* gradient */
- 0x2208, 'm','o', /* element of */
- 0x2209, '!','m', /* not element of */
- 0x220d, 's','t', /* such that */
- 0x2217, '*','*', /* math asterisk */
- 0x2219, 'b','u', /* bullet */
- 0x221a, 's','r', /* radical */
- 0x221d, 'p','t', /* proportional */
- 0x221e, 'i','f', /* infinity */
- 0x2220, 'a','n', /* angle */
- 0x2227, 'l','&', /* logical and */
- 0x2228, 'l','|', /* logical or */
- 0x2229, 'c','a', /* intersection */
- 0x222a, 'c','u', /* union */
- 0x222b, 'i','s', /* integral */
- 0x2234, 't','f', /* therefore */
- 0x2243, '~','=', /* asymptotically equal */
- 0x2245, 'c','g', /* congruent */
- 0x2248, '~','~', /* almost equal */
- 0x2260, '!','=', /* not equal */
- 0x2261, '=','=', /* equivalent */
- 0x2266, '<','=', /* less than or equal */
- 0x2267, '>','=', /* greater than or equal */
- 0x2282, 's','b', /* proper subset */
- 0x2283, 's','p', /* proper superset */
- 0x2284, '!','b', /* not subset */
- 0x2286, 'i','b', /* reflexive subset */
- 0x2287, 'i','p', /* reflexive superset */
- 0x2295, 'O','+', /* circle plus */
- 0x2296, 'O','-', /* circle minus */
- 0x2297, 'O','x', /* circle multiply */
- 0x22a2, 't','u', /* turnstile */
- 0x22a8, 'T','u', /* valid */
- 0x22c4, 'l','z', /* lozenge */
- 0x22ef, 'e','l', /* ellipses */
- 0x2639, ':','(', /* saddy */
- 0x263a, ':',')', /* white-face smiley */
- 0x263b, ';',')', /* dark-face smiley */
- 0, 0,
+ {0x00a1, {'!','!'}}, /* spanish initial ! */
+ {0x00a2, {'c','$'}}, /* cent */
+ {0x00a3, {'l','$'}}, /* pound sterling */
+ {0x00a4, {'g','$'}}, /* general currency */
+ {0x00a5, {'y','$'}}, /* yen */
+ {0x00a6, {'|','|'}}, /* broken vertical bar */
+ {0x00a7, {'S','S'}}, /* section symbol */
+ {0x00a8, {'\"','\"'}}, /* dieresis */
+ {0x00a9, {'c','O'}}, /* copyright */
+ {0x00aa, {'s','a'}}, /* super a, feminine ordinal */
+ {0x00ab, {'<','<'}}, /* left angle quotation */
+ {0x00ac, {'n','o'}}, /* not sign, hooked overbar */
+ {0x00ad, {'-','-'}}, /* soft hyphen */
+ {0x00ae, {'r','O'}}, /* registered trademark */
+ {0x00af, {'_','_'}}, /* macron */
+ {0x00b0, {'d','e'}}, /* degree */
+ {0x00b1, {'+','-'}}, /* plus-minus */
+ {0x00b2, {'s','2'}}, /* sup 2 */
+ {0x00b3, {'s','3'}}, /* sup 3 */
+ {0x00b4, {'\'','\''}}, /* acute accent */
+ {0x00b5, {'m','i'}}, /* micron */
+ {0x00b6, {'p','g'}}, /* paragraph (pilcrow) */
+ {0x00b7, {'.','.'}}, /* centered . */
+ {0x00b8, {',',','}}, /* cedilla */
+ {0x00b9, {'s','1'}}, /* sup 1 */
+ {0x00ba, {'s','o'}}, /* super o, masculine ordinal */
+ {0x00bb, {'>','>'}}, /* right angle quotation */
+ {0x00bc, {'1','4'}}, /* 1/4 */
+ {0x00bd, {'1','2'}}, /* 1/2 */
+ {0x00be, {'3','4'}}, /* 3/4 */
+ {0x00bf, {'?','?'}}, /* spanish initial ? */
+ {0x00c0, {'`','A'}}, /* A grave */
+ {0x00c1, {'\'','A'}}, /* A acute */
+ {0x00c2, {'^','A'}}, /* A circumflex */
+ {0x00c3, {'~','A'}}, /* A tilde */
+ {0x00c4, {'\"','A'}}, /* A dieresis */
+ {0x00c5, {'o','A'}}, /* A circle */
+ {0x00c6, {'A','E'}}, /* AE ligature */
+ {0x00c7, {',','C'}}, /* C cedilla */
+ {0x00c8, {'`','E'}}, /* E grave */
+ {0x00c9, {'\'','E'}}, /* E acute */
+ {0x00ca, {'^','E'}}, /* E circumflex */
+ {0x00cb, {'\"','E'}}, /* E dieresis */
+ {0x00cc, {'`','I'}}, /* I grave */
+ {0x00cd, {'\'','I'}}, /* I acute */
+ {0x00ce, {'^','I'}}, /* I circumflex */
+ {0x00cf, {'\"','I'}}, /* I dieresis */
+ {0x00d0, {'D','-'}}, /* Eth */
+ {0x00d1, {'~','N'}}, /* N tilde */
+ {0x00d2, {'`','O'}}, /* O grave */
+ {0x00d3, {'\'','O'}}, /* O acute */
+ {0x00d4, {'^','O'}}, /* O circumflex */
+ {0x00d5, {'~','O'}}, /* O tilde */
+ {0x00d6, {'\"','O'}}, /* O dieresis */
+ {0x00d7, {'m','u'}}, /* times sign */
+ {0x00d8, {'/','O'}}, /* O slash */
+ {0x00d9, {'`','U'}}, /* U grave */
+ {0x00da, {'\'','U'}}, /* U acute */
+ {0x00db, {'^','U'}}, /* U circumflex */
+ {0x00dc, {'\"','U'}}, /* U dieresis */
+ {0x00dd, {'\'','Y'}}, /* Y acute */
+ {0x00de, {'|','P'}}, /* Thorn */
+ {0x00df, {'s','s'}}, /* sharp s */
+ {0x00e0, {'`','a'}}, /* a grave */
+ {0x00e1, {'\'','a'}}, /* a acute */
+ {0x00e2, {'^','a'}}, /* a circumflex */
+ {0x00e3, {'~','a'}}, /* a tilde */
+ {0x00e4, {'\"','a'}}, /* a dieresis */
+ {0x00e5, {'o','a'}}, /* a circle */
+ {0x00e6, {'a','e'}}, /* ae ligature */
+ {0x00e7, {',','c'}}, /* c cedilla */
+ {0x00e8, {'`','e'}}, /* e grave */
+ {0x00e9, {'\'','e'}}, /* e acute */
+ {0x00ea, {'^','e'}}, /* e circumflex */
+ {0x00eb, {'\"','e'}}, /* e dieresis */
+ {0x00ec, {'`','i'}}, /* i grave */
+ {0x00ed, {'\'','i'}}, /* i acute */
+ {0x00ee, {'^','i'}}, /* i circumflex */
+ {0x00ef, {'\"','i'}}, /* i dieresis */
+ {0x00f0, {'d','-'}}, /* eth */
+ {0x00f1, {'~','n'}}, /* n tilde */
+ {0x00f2, {'`','o'}}, /* o grave */
+ {0x00f3, {'\'','o'}}, /* o acute */
+ {0x00f4, {'^','o'}}, /* o circumflex */
+ {0x00f5, {'~','o'}}, /* o tilde */
+ {0x00f6, {'\"','o'}}, /* o dieresis */
+ {0x00f7, {'-',':'}}, /* divide sign */
+ {0x00f8, {'/','o'}}, /* o slash */
+ {0x00f9, {'`','u'}}, /* u grave */
+ {0x00fa, {'\'','u'}}, /* u acute */
+ {0x00fb, {'^','u'}}, /* u circumflex */
+ {0x00fc, {'\"','u'}}, /* u dieresis */
+ {0x00fd, {'\'','y'}}, /* y acute */
+ {0x00fe, {'|','p'}}, /* thorn */
+ {0x00ff, {'\"','y'}}, /* y dieresis */
+ {0x2654, {'w','k'}}, /* chess white king */
+ {0x2655, {'w','q'}}, /* chess white queen */
+ {0x2656, {'w','r'}}, /* chess white rook */
+ {0x2657, {'w','b'}}, /* chess white bishop */
+ {0x2658, {'w','n'}}, /* chess white knight */
+ {0x2659, {'w','p'}}, /* chess white pawn */
+ {0x265a, {'b','k'}}, /* chess black king */
+ {0x265b, {'b','q'}}, /* chess black queen */
+ {0x265c, {'b','r'}}, /* chess black rook */
+ {0x265d, {'b','b'}}, /* chess black bishop */
+ {0x265e, {'b','n'}}, /* chess black knight */
+ {0x265f, {'b','p'}}, /* chess black pawn */
+ {0x03b1, {'*','a'}}, /* alpha */
+ {0x03b2, {'*','b'}}, /* beta */
+ {0x03b3, {'*','g'}}, /* gamma */
+ {0x03b4, {'*','d'}}, /* delta */
+ {0x03b5, {'*','e'}}, /* epsilon */
+ {0x03b6, {'*','z'}}, /* zeta */
+ {0x03b7, {'*','y'}}, /* eta */
+ {0x03b8, {'*','h'}}, /* theta */
+ {0x03b9, {'*','i'}}, /* iota */
+ {0x03ba, {'*','k'}}, /* kappa */
+ {0x03bb, {'*','l'}}, /* lambda */
+ {0x03bc, {'*','m'}}, /* mu */
+ {0x03bd, {'*','n'}}, /* nu */
+ {0x03be, {'*','c'}}, /* xsi */
+ {0x03bf, {'*','o'}}, /* omicron */
+ {0x03c0, {'*','p'}}, /* pi */
+ {0x03c1, {'*','r'}}, /* rho */
+ {0x03c2, {'t','s'}}, /* terminal sigma */
+ {0x03c3, {'*','s'}}, /* sigma */
+ {0x03c4, {'*','t'}}, /* tau */
+ {0x03c5, {'*','u'}}, /* upsilon */
+ {0x03c6, {'*','f'}}, /* phi */
+ {0x03c7, {'*','x'}}, /* chi */
+ {0x03c8, {'*','q'}}, /* psi */
+ {0x03c9, {'*','w'}}, /* omega */
+ {0x0391, {'*','A'}}, /* Alpha */
+ {0x0392, {'*','B'}}, /* Beta */
+ {0x0393, {'*','G'}}, /* Gamma */
+ {0x0394, {'*','D'}}, /* Delta */
+ {0x0395, {'*','E'}}, /* Epsilon */
+ {0x0396, {'*','Z'}}, /* Zeta */
+ {0x0397, {'*','Y'}}, /* Eta */
+ {0x0398, {'*','H'}}, /* Theta */
+ {0x0399, {'*','I'}}, /* Iota */
+ {0x039a, {'*','K'}}, /* Kappa */
+ {0x039b, {'*','L'}}, /* Lambda */
+ {0x039c, {'*','M'}}, /* Mu */
+ {0x039d, {'*','N'}}, /* Nu */
+ {0x039e, {'*','C'}}, /* Xsi */
+ {0x039f, {'*','O'}}, /* Omicron */
+ {0x03a0, {'*','P'}}, /* Pi */
+ {0x03a1, {'*','R'}}, /* Rho */
+ {0x03a3, {'*','S'}}, /* Sigma */
+ {0x03a4, {'*','T'}}, /* Tau */
+ {0x03a5, {'*','U'}}, /* Upsilon */
+ {0x03a6, {'*','F'}}, /* Phi */
+ {0x03a7, {'*','X'}}, /* Chi */
+ {0x03a8, {'*','Q'}}, /* Psi */
+ {0x03a9, {'*','W'}}, /* Omega */
+ {0x2190, {'<','-'}}, /* left arrow */
+ {0x2191, {'u','a'}}, /* up arrow */
+ {0x2192, {'-','>'}}, /* right arrow */
+ {0x2193, {'d','a'}}, /* down arrow */
+ {0x2194, {'a','b'}}, /* arrow both */
+ {0x21d0, {'V','='}}, /* left double-line arrow */
+ {0x21d2, {'=','V'}}, /* right double-line arrow */
+ {0x2200, {'f','a'}}, /* forall */
+ {0x2203, {'t','e'}}, /* there exists */
+ {0x2202, {'p','d'}}, /* partial differential */
+ {0x2205, {'e','s'}}, /* empty set */
+ {0x2206, {'D','e'}}, /* delta */
+ {0x2207, {'g','r'}}, /* gradient */
+ {0x2208, {'m','o'}}, /* element of */
+ {0x2209, {'!','m'}}, /* not element of */
+ {0x220d, {'s','t'}}, /* such that */
+ {0x2217, {'*','*'}}, /* math asterisk */
+ {0x2219, {'b','u'}}, /* bullet */
+ {0x221a, {'s','r'}}, /* radical */
+ {0x221d, {'p','t'}}, /* proportional */
+ {0x221e, {'i','f'}}, /* infinity */
+ {0x2220, {'a','n'}}, /* angle */
+ {0x2227, {'l','&'}}, /* logical and */
+ {0x2228, {'l','|'}}, /* logical or */
+ {0x2229, {'c','a'}}, /* intersection */
+ {0x222a, {'c','u'}}, /* union */
+ {0x222b, {'i','s'}}, /* integral */
+ {0x2234, {'t','f'}}, /* therefore */
+ {0x2243, {'~','='}}, /* asymptotically equal */
+ {0x2245, {'c','g'}}, /* congruent */
+ {0x2248, {'~','~'}}, /* almost equal */
+ {0x2260, {'!','='}}, /* not equal */
+ {0x2261, {'=','='}}, /* equivalent */
+ {0x2266, {'<','='}}, /* less than or equal */
+ {0x2267, {'>','='}}, /* greater than or equal */
+ {0x2282, {'s','b'}}, /* proper subset */
+ {0x2283, {'s','p'}}, /* proper superset */
+ {0x2284, {'!','b'}}, /* not subset */
+ {0x2286, {'i','b'}}, /* reflexive subset */
+ {0x2287, {'i','p'}}, /* reflexive superset */
+ {0x2295, {'O','+'}}, /* circle plus */
+ {0x2296, {'O','-'}}, /* circle minus */
+ {0x2297, {'O','x'}}, /* circle multiply */
+ {0x22a2, {'t','u'}}, /* turnstile */
+ {0x22a8, {'T','u'}}, /* valid */
+ {0x22c4, {'l','z'}}, /* lozenge */
+ {0x22ef, {'e','l'}}, /* ellipses */
+ {0x2639, {':','('}}, /* saddy */
+ {0x263a, {':',')'}}, /* white-face smiley */
+ {0x263b, {';',')'}}, /* dark-face smiley */
+ {0, {0, 0}}
};
diff --git a/libXg/menuhit.c b/libXg/menuhit.c
@@ -141,7 +141,7 @@ menuhit(int but, Mouse *m, Menu *menu)
clipr(&screen, screen.r);
maxwid = 0;
for(nitem = 0;
- item = menu->item? menu->item[nitem] : (*menu->gen)(nitem);
+ (item = menu->item? menu->item[nitem] : (*menu->gen)(nitem));
nitem++){
i = strwidth(font, item);
if(i > maxwid)
diff --git a/libXg/string.c b/libXg/string.c
@@ -15,7 +15,7 @@ string(Bitmap *b, Point p, XftFont *ft, char *s, Fcode f)
int x = p.x;
int y = p.y;
- XftTextExtentsUtf8(_dpy, ft, s, length, &extents);
+ XftTextExtentsUtf8(_dpy, ft, (FcChar8 *)s, length, &extents);
x = p.x;
y = p.y;
@@ -27,7 +27,7 @@ string(Bitmap *b, Point p, XftFont *ft, char *s, Fcode f)
if (!b->fd)
b->fd = XftDrawCreate(_dpy, (Drawable)(b->id), DefaultVisual(_dpy, Def…
- XftDrawStringUtf8(b->fd, &fontcolor, ft, x, y, s, length);
+ XftDrawStringUtf8(b->fd, &fontcolor, ft, x, y, (FcChar8 *)s, length);
x += extents.xOff;
diff --git a/libXg/strwidth.c b/libXg/strwidth.c
@@ -8,7 +8,7 @@ long
strwidth(XftFont *f, char *s)
{
XGlyphInfo extents = {0};
- XftTextExtentsUtf8(_dpy, f, s, strlen(s), &extents);
+ XftTextExtentsUtf8(_dpy, f, (FcChar8 *)s, strlen(s), &extents);
return extents.xOff;
}
@@ -17,7 +17,7 @@ Point
strsize(XftFont *f, char *s)
{
XGlyphInfo extents = {0};
- XftTextExtentsUtf8(_dpy, f, s, strlen(s), &extents);
+ XftTextExtentsUtf8(_dpy, f, (FcChar8 *)s, strlen(s), &extents);
return Pt(strwidth(f, s), extents.yOff);
}
diff --git a/libXg/xtbinit.c b/libXg/xtbinit.c
@@ -107,7 +107,7 @@ static void reshaped(int, int, int, int);
static void gotchar(int, int, int, int, int);
static void gotmouse(Gwinmouse *);
static int ilog2(int);
-static void pixtocolor(Pixel, XColor *);
+
static Ebuf *ebread(Esrc *);
static Ebuf *ebadd(Esrc *, int);
static void focinit(Widget);
@@ -143,7 +143,6 @@ xtbinit(Errfunc f, char *class, int *pargc, char **argv, ch…
unsigned int depth;
Arg args[20];
char *p;
- XSetWindowAttributes attr;
int compose;
initlatin();
@@ -280,7 +279,6 @@ static void
reshaped(int minx, int miny, int maxx, int maxy)
{
Ebuf *eb;
- Mouse m;
screen.r = Rect(minx, miny, maxx, maxy);
screen.clipr = screen.r;
@@ -373,21 +371,6 @@ gotinput(XtPointer cldata, int *pfd, XtInputId *id)
es->count++;
}
-static void
-gottimeout(XtPointer cldata, XtIntervalId *id)
-{
- if(!einitcalled || Stimer == -1)
- return;
- /*
- * Don't queue up timeouts, because there's
- * too big a danger that they might pile up
- * too quickly.
- */
- esrc[Stimer].head = (Ebuf *)1;
- esrc[Stimer].count = 1;
- XtAppAddTimeOut(app, (long)cldata, gottimeout, cldata);
-}
-
static int
ilog2(int n)
{
@@ -399,30 +382,6 @@ ilog2(int n)
return i;
}
-static void
-pixtocolor(Pixel p, XColor *pc)
-{
-#ifdef R3
- Colormap cmap;
- Arg args[2];
- int n;
-
- n = 0;
- XtSetArg(args[n], XtNcolormap, &cmap); n++;
- XtGetValues(_toplevel, args, n);
- pc->pixel = p;
- XQueryColor(_dpy, cmap, pc);
-#else
- XrmValue xvf, xvt;
-
- xvf.size = sizeof(Pixel);
- xvf.addr = (XtPointer)&p;
- xvt.size = sizeof(XColor);
- xvt.addr = (XtPointer)pc;
- if(!XtConvertAndStore(_toplevel, XtRPixel, &xvf, XtRColor, &xvt))
- pc->pixel = p; /* maybe that's enough */
-#endif
-}
void
rdcolmap(Bitmap *b, RGB *map)
@@ -507,7 +466,6 @@ scrollfwdbut(void)
{
Arg arg;
Boolean v;
- String s;
XtSetArg(arg, XtNscrollForwardR, &v);
XtGetValues(widg, &arg, 1);
@@ -621,7 +579,6 @@ Keystroke
ekbd(void)
{
Ebuf *eb;
- int c;
Keystroke k;
if(!esrc[Skeyboard].inuse)
@@ -709,7 +666,7 @@ ebread(Esrc *s)
return eb;
}
-static inline int
+static inline void
ebappend(Ebuf *b, Esrc *s)
{
if (s->tail){
@@ -719,7 +676,7 @@ ebappend(Ebuf *b, Esrc *s)
s->head = s->tail = b;
}
-static inline int
+static inline void
ebprepend(Ebuf *b, Esrc *s)
{
b->next = s->head;
diff --git a/libframe/frselect.c b/libframe/frselect.c
@@ -65,11 +65,12 @@ frselectf(Frame *f, Point p0, Point p1, Fcode c)
if(p0.y == f->r.max.y)
return;
if(n == 0){
- if(p0.x == p1.x)
+ if(p0.x == p1.x){
if(p0.x == f->r.min.x)
q1.x++;
else
p0.x--;
+ }
bitblt2(f->b, p0, f->b, Rpt(p0, q1), c, 0, f->bg);
}else{
if(p0.x >= f->r.max.x)
diff --git a/sam/address.c b/sam/address.c
@@ -89,7 +89,7 @@ address(Addr *ap, Address a, int sign)
panic("address");
return a;
}
- }while(ap = ap->next); /* assign = */
+ }while((ap = ap->next)); /* assign = */
return a;
}
@@ -219,6 +219,7 @@ lineaddr(Posn l, Address addr, int sign)
if(l == 0)
a.r.p2 = addr.r.p1;
else{
+ c = 0;
for(n = 0; n<l; ){ /* always runs once */
c = Fbgetc(f);
if(c == '\n')
diff --git a/sam/buffer.c b/sam/buffer.c
@@ -169,11 +169,8 @@ Bclean(Buffer *b)
}
}
-/*int hits, misses; /**/
-
int
incache(Buffer *b, Posn p1, Posn p2)
{
- /*if(b->c1<=p1 && p2<=b->c1+b->cache.n)hits++; else misses++;/**/
return b->c1<=p1 && p2<=b->c1+b->cache.n;
}
diff --git a/sam/cmd.c b/sam/cmd.c
@@ -6,39 +6,39 @@ static char linex[]="\n";
static char wordx[]=" \t\n";
struct cmdtab cmdtab[]={
/* cmdc text regexp addr defcmd defaddr count token fn */
- '\n', 0, 0, 0, 0, aDot, 0, 0, nl_cmd,
- 'a', 1, 0, 0, 0, aDot, 0, 0, a_cmd,
- 'b', 0, 0, 0, 0, aNo, 0, linex, b_cmd,
- 'B', 0, 0, 0, 0, aNo, 0, linex, b_cmd,
- 'c', 1, 0, 0, 0, aDot, 0, 0, c_cmd,
- 'd', 0, 0, 0, 0, aDot, 0, 0, d_cmd,
- 'D', 0, 0, 0, 0, aNo, 0, linex, D_cmd,
- 'e', 0, 0, 0, 0, aNo, 0, wordx, e_cmd,
- 'f', 0, 0, 0, 0, aNo, 0, wordx, f_cmd,
- 'g', 0, 1, 0, 'p', aDot, 0, 0, g_cmd,
- 'i', 1, 0, 0, 0, aDot, 0, 0, i_cmd,
- 'k', 0, 0, 0, 0, aDot, 0, 0, k_cmd,
- 'm', 0, 0, 1, 0, aDot, 0, 0, m_cmd,
- 'n', 0, 0, 0, 0, aNo, 0, 0, n_cmd,
- 'p', 0, 0, 0, 0, aDot, 0, 0, p_cmd,
- 'q', 0, 0, 0, 0, aNo, 0, 0, q_cmd,
- 'r', 0, 0, 0, 0, aDot, 0, wordx, e_cmd,
- 's', 0, 1, 0, 0, aDot, 1, 0, s_cmd,
- 't', 0, 0, 1, 0, aDot, 0, 0, m_cmd,
- 'u', 0, 0, 0, 0, aNo, 1, 0, u_cmd,
- 'v', 0, 1, 0, 'p', aDot, 0, 0, g_cmd,
- 'w', 0, 0, 0, 0, aAll, 0, wordx, w_cmd,
- 'x', 0, 1, 0, 'p', aDot, 0, 0, x_cmd,
- 'y', 0, 1, 0, 'p', aDot, 0, 0, x_cmd,
- 'X', 0, 1, 0, 'f', aNo, 0, 0, X_cmd,
- 'Y', 0, 1, 0, 'f', aNo, 0, 0, X_cmd,
- '!', 0, 0, 0, 0, aNo, 0, linex, plan9_cmd,
- '>', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd,
- '<', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd,
- '|', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd,
- '=', 0, 0, 0, 0, aDot, 0, linex, eq_cmd,
- 'c'|0x100,0, 0, 0, 0, aNo, 0, wordx, cd_cmd,
- 0, 0, 0, 0, 0, 0, 0, 0,
+ {'\n', 0, 0, 0, 0, aDot, 0, 0, nl_cmd},
+ {'a', 1, 0, 0, 0, aDot, 0, 0, a_cmd},
+ {'b', 0, 0, 0, 0, aNo, 0, linex, b_cmd},
+ {'B', 0, 0, 0, 0, aNo, 0, linex, b_cmd},
+ {'c', 1, 0, 0, 0, aDot, 0, 0, c_cmd},
+ {'d', 0, 0, 0, 0, aDot, 0, 0, d_cmd},
+ {'D', 0, 0, 0, 0, aNo, 0, linex, D_cmd},
+ {'e', 0, 0, 0, 0, aNo, 0, wordx, e_cmd},
+ {'f', 0, 0, 0, 0, aNo, 0, wordx, f_cmd},
+ {'g', 0, 1, 0, 'p', aDot, 0, 0, g_cmd},
+ {'i', 1, 0, 0, 0, aDot, 0, 0, i_cmd},
+ {'k', 0, 0, 0, 0, aDot, 0, 0, k_cmd},
+ {'m', 0, 0, 1, 0, aDot, 0, 0, m_cmd},
+ {'n', 0, 0, 0, 0, aNo, 0, 0, n_cmd},
+ {'p', 0, 0, 0, 0, aDot, 0, 0, p_cmd},
+ {'q', 0, 0, 0, 0, aNo, 0, 0, q_cmd},
+ {'r', 0, 0, 0, 0, aDot, 0, wordx, e_cmd},
+ {'s', 0, 1, 0, 0, aDot, 1, 0, s_cmd},
+ {'t', 0, 0, 1, 0, aDot, 0, 0, m_cmd},
+ {'u', 0, 0, 0, 0, aNo, 1, 0, u_cmd},
+ {'v', 0, 1, 0, 'p', aDot, 0, 0, g_cmd},
+ {'w', 0, 0, 0, 0, aAll, 0, wordx, w_cmd},
+ {'x', 0, 1, 0, 'p', aDot, 0, 0, x_cmd},
+ {'y', 0, 1, 0, 'p', aDot, 0, 0, x_cmd},
+ {'X', 0, 1, 0, 'f', aNo, 0, 0, X_cmd},
+ {'Y', 0, 1, 0, 'f', aNo, 0, 0, X_cmd},
+ {'!', 0, 0, 0, 0, aNo, 0, linex, plan9_cmd},
+ {'>', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd},
+ {'<', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd},
+ {'|', 0, 0, 0, 0, aDot, 0, linex, plan9_cmd},
+ {'=', 0, 0, 0, 0, aDot, 0, linex, eq_cmd},
+ {'c'|0x100,0, 0, 0, 0, aNo, 0, wordx, cd_cmd},
+ {0, 0, 0, 0, 0, 0, 0, 0},
};
Cmd *parsecmd(int);
Addr *compoundaddr(void);
@@ -461,7 +461,7 @@ parsecmd(int nest)
cp->next = ncp;
else
cmd.ccmd = ncp;
- }while(cp = ncp);
+ }while((cp = ncp));
break;
case '}':
atnl();
@@ -537,7 +537,7 @@ simpleaddr(void)
default:
return 0;
}
- if(addr.next = simpleaddr())
+ if((addr.next = simpleaddr()))
switch(addr.next->type){
case '.':
case '$':
diff --git a/sam/mesg.c b/sam/mesg.c
@@ -195,7 +195,7 @@ inmesg(Tmesg type)
inp = indata;
switch(type){
- case -1:
+ case Terror:
panic("rcv error");
default:
diff --git a/sam/mesg.h b/sam/mesg.h
@@ -15,6 +15,7 @@ extern int oldcompat;
*/
typedef enum Tmesg
{
+ Terror = -1, /* error */
Tversion, /* version */
Tstartcmdfile, /* terminal just opened command frame */
Tcheck, /* ask host to poke with Hcheck */
@@ -44,6 +45,7 @@ typedef enum Tmesg
*/
typedef enum Hmesg
{
+ Herror = -1, /* error */
Hversion, /* version */
Hbindname, /* attach name[0] to text in terminal */
Hcurrent, /* make named file the typing file */
diff --git a/sam/moveto.c b/sam/moveto.c
@@ -107,7 +107,7 @@ strrune(Rune *s, Rune c)
return s-1;
}
- while(c1 = *s++)
+ while((c1 = *s++))
if(c1 == c)
return s-1;
return 0;
diff --git a/sam/multi.c b/sam/multi.c
@@ -87,10 +87,8 @@ lookfile(String *s, int fuzzy)
int i;
File *b = NULL;
char *sc = Strtoc(s);
- size_t sl = strlen(sc);
for(i=0; i<file.nused; i++){
- int l2;
if(Strcmp(&file.filepptr[i]->name, s) == 0)
return file.filepptr[i];
diff --git a/sam/rasp.c b/sam/rasp.c
@@ -22,6 +22,7 @@ toterminal(File *f, int toterm)
}hdr;
Posn growpos, grown;
+ growpos = 0;
if(f->rasp == 0)
return;
if(f->marked)
diff --git a/sam/regexp.c b/sam/regexp.c
@@ -270,11 +270,12 @@ pushator(int t)
Node *
popand(int op)
{
- if(andp <= &andstack[0])
+ if(andp <= &andstack[0]){
if(op)
regerror_c(Emissop, op);
else
regerror(Ebadregexp);
+ }
return --andp;
}
@@ -602,7 +603,7 @@ execute(File *f, Posn startp, Posn eof)
addinst(tl, startinst, &sempty);
}
/* Execute machine until this list is empty */
- for(tlp = tl; inst = tlp->inst; tlp++){ /* assignment = */
+ for(tlp = tl; (inst = tlp->inst); tlp++){ /* assignment = */
Switchstmt:
switch(inst->type){
default: /* regular character */
@@ -738,7 +739,7 @@ bexecute(File *f, Posn startp)
addinst(tl, bstartinst, &sempty);
}
/* Execute machine until this list is empty */
- for(tlp = tl; inst = tlp->inst; tlp++){ /* assignment = */
+ for(tlp = tl; (inst = tlp->inst); tlp++){ /* assignment = */
Switchstmt:
switch(inst->type){
default: /* regular character */
diff --git a/sam/shell.c b/sam/shell.c
@@ -68,7 +68,7 @@ plan9(File *f, int type, String *s, int nest)
*/
close(pipe2[0]);
io = pipe2[1];
- if(retcode=!setjmp(mainloop)){ /* assignment = */
+ if ((retcode = !setjmp(mainloop))){ /* assignment = */
char *c;
for(l = 0; l<plan9buf->nrunes; l+=m){
m = plan9buf->nrunes-l;
diff --git a/sam/string.c b/sam/string.c
@@ -105,7 +105,7 @@ Strcmp(String *a, String *b)
int i, c;
for(i=0; i<a->n && i<b->n; i++)
- if(c = (a->s[i] - b->s[i])) /* assign = */
+ if((c = (a->s[i] - b->s[i]))) /* assign = */
return c;
/* damn NULs confuse everything */
i = a->n - b->n;
diff --git a/sam/unix.c b/sam/unix.c
@@ -128,12 +128,13 @@ newtmp(void)
if (f)
return fileno(f);
panic("could not create tempfile!");
+ return -1;
}
void
samerr(char *buf)
{
- snprintf(buf, PATH_MAX, "%s/sam.err", getenv("HOME") ? getenv("HOME") : "/…
+ snprintf(buf, PATH_MAX, "%s/sam.err", getenv("HOME") ? getenv("HOME") : "/…
}
int
diff --git a/sam/xec.c b/sam/xec.c
@@ -44,7 +44,7 @@ cmdexec(File *f, Cmd *cp)
ap->next->type = '*';
}
if(cp->addr){ /* may be false for '\n' (only) */
- static Address none = {0,0,0};
+ static Address none = {{0,0},0};
if(f)
addr = address(ap, f->dot, 0);
else /* a " */
@@ -133,7 +133,7 @@ g_cmd(File *f, Cmd *cp)
{
if(f!=addr.f)panic("g_cmd f!=addr.f");
compile(cp->re);
- if(execute(f, addr.r.p1, addr.r.p2) ^ cp->cmdc=='v'){
+ if(execute(f, addr.r.p1, (addr.r.p2 ^ cp->cmdc)=='v')){
f->dot = addr;
return cmdexec(f, cp->ccmd);
}
@@ -313,7 +313,7 @@ plan9_cmd(File *f, Cmd *cp)
int
eq_cmd(File *f, Cmd *cp)
{
- int charsonly;
+ int charsonly = FALSE;
switch(cp->ctext->n){
case 1:
diff --git a/samterm/main.c b/samterm/main.c
@@ -96,11 +96,12 @@ main(int argc, char *argv[])
flsetselect(which, cmd.rasp.nrunes, cmd.rasp.nrunes);
type(which, RExtern);
}
- if(got&RKeyboard)
+ if(got&RKeyboard){
if(which)
type(which, RKeyboard);
else
kbdblock();
+ }
if(got&RMouse){
if(lock==2 || !ptinrect(mouse.xy, screen.r)){
mouseunblock();
@@ -848,7 +849,6 @@ type(Flayer *l, int res) /* what a bloody mess this is -…
Rune buf[100];
Keystroke k = {0};
Rune *p = buf;
- int backspacing, moving;
long a;
if(lock || t->lock){
diff --git a/samterm/menu.c b/samterm/menu.c
@@ -171,7 +171,7 @@ menu3hit(void)
break;
default:
- if(t = text[m-NMENU3]){
+ if((t = text[m-NMENU3])){
i = t->front;
if(t->nwin==0 || t->l[i].textfn==0)
return; /* not ready yet; try again later */
@@ -274,7 +274,7 @@ paren(char *s)
uchar *t = buf;
*t++ = '(';
- do; while(*t++ = *s++);
+ do; while((*t++ = *s++));
t[-1] = ')';
*t = 0;
return (char *)buf;
@@ -287,7 +287,7 @@ genmenu2(int n)
if(n>=NMENU2+(menu2str[Search]!=0))
return 0;
p = menu2str[n];
- if(!lock && !t->lock || n==Search || n==Look)
+ if((!lock && !t->lock) || n==Search || n==Look)
return p;
return paren(p);
}
diff --git a/samterm/mesg.c b/samterm/mesg.c
@@ -102,7 +102,7 @@ inmesg(Hmesg type, int count)
m = inshort(0);
l = inlong(2);
switch(type){
- case -1:
+ case Terror:
panic("rcv error");
default:
fprintf(stderr, "type %d\n", type);
diff --git a/samterm/rasp.c b/samterm/rasp.c
@@ -169,7 +169,7 @@ rclean(Rasp *r)
void
Strcpy(Rune *to, Rune *from)
{
- do; while(*to++ = *from++);
+ do; while((*to++ = *from++));
}
Rune*
diff --git a/samterm/unix.c b/samterm/unix.c
@@ -30,7 +30,6 @@ extern int nofifo;
void
getscreen(int argc, char **argv)
{
- int fd;
Rectangle r;
signal(SIGINT, SIG_IGN);
You are viewing proxied material from vernunftzentrum.de. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.