Booleanify more variables. - sam - An updated version of the sam text editor. | |
git clone git://vernunftzentrum.de/sam.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit fc5f7e2b89f0f7c5aeecacf8f668a3c5c7c9acf8 | |
parent 2ca4fc9ee587dd03cc3c33277e2154b8994f1f7a | |
Author: Rob King <[email protected]> | |
Date: Tue, 4 Oct 2016 10:14:11 -0500 | |
Booleanify more variables. | |
Diffstat: | |
samterm/main.c | 16 ++++++++-------- | |
samterm/menu.c | 2 +- | |
samterm/samterm.h | 3 +-- | |
3 files changed, 10 insertions(+), 11 deletions(-) | |
--- | |
diff --git a/samterm/main.c b/samterm/main.c | |
@@ -296,7 +296,7 @@ snarf(Text *t, int w) | |
} | |
void | |
-cut(Text *t, int w, int save, int check) | |
+cut(Text *t, int w, bool save, bool check) | |
{ | |
int64_t p0, p1; | |
Flayer *l; | |
@@ -322,7 +322,7 @@ void | |
paste(Text *t, int w) | |
{ | |
if(snarflen){ | |
- cut(t, w, 0, 0); | |
+ cut(t, w, false, false); | |
t->lock++; | |
outTsl(Tpaste, t->tag, t->l[w].p0); | |
} | |
@@ -691,7 +691,7 @@ cmddelword(Flayer *l, int64_t a, Text *t, const char *arg) | |
hcheck(t->tag); | |
}else{ | |
flushtyping(false); | |
- cut(t, t->front, 0, 1); | |
+ cut(t, t->front, false, true); | |
} | |
} | |
@@ -713,7 +713,7 @@ cmddelbol(Flayer *l, int64_t a, Text *t, const char *arg) | |
hcheck(t->tag); | |
}else{ | |
flushtyping(false); | |
- cut(t, t->front, 0, 1); | |
+ cut(t, t->front, false, true); | |
} | |
} | |
@@ -735,7 +735,7 @@ cmddelbs(Flayer *l, int64_t a, Text *t, const char *arg) | |
hcheck(t->tag); | |
}else{ | |
flushtyping(false); | |
- cut(t, t->front, 0, 1); | |
+ cut(t, t->front, false, true); | |
} | |
} | |
@@ -756,7 +756,7 @@ cmddel(Flayer *l, int64_t a, Text *t, const char *arg) | |
hcheck(t->tag); | |
}else{ | |
flushtyping(false); | |
- cut(t, t->front, 0, 1); | |
+ cut(t, t->front, false, true); | |
} | |
} | |
@@ -807,7 +807,7 @@ cmdcut(Flayer *l, int64_t a, Text *t, const char *arg) | |
int w = getlayer(l, t); | |
if (w >= 0) | |
- cut(t, w, 1, 1); | |
+ cut(t, w, true, true); | |
return a; | |
} | |
@@ -931,7 +931,7 @@ type(Flayer *l) /* what a bloody mess this is -- but it'… | |
a = l->p0; | |
if (a != l->p1 && (k.k != Kcommand || commands[k.c].docut)){ | |
flushtyping(true); | |
- cut(t, t->front, 1, 1); | |
+ cut(t, t->front, true, true); | |
return; /* it may now be locked */ | |
} | |
diff --git a/samterm/menu.c b/samterm/menu.c | |
@@ -75,7 +75,7 @@ menu2hit(void) | |
switch(m){ | |
case Cut: | |
- cut(t, w, 1, 1); | |
+ cut(t, w, true, true); | |
break; | |
case Paste: | |
diff --git a/samterm/samterm.h b/samterm/samterm.h | |
@@ -110,14 +110,13 @@ void mouseunblock(void); | |
void kbdblock(void); | |
void extstart(void); | |
int button(int but); | |
-int load(char*, int); | |
int waitforio(void); | |
int rcvchar(void); | |
int getch(void); | |
Keystroke qpeekc(void); | |
Keystroke kbdchar(void); | |
void mouseexit(void); | |
-void cut(Text*, int, int, int); | |
+void cut(Text*, int, bool, bool); | |
void paste(Text*, int); | |
void snarf(Text*, int); | |
int center(Flayer*, int64_t); |