projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
<OpenTransportInternet.h> seems to want <Files.h>. Silly thing.
[u/mdw/putty]
/
terminal.c
diff --git
a/terminal.c
b/terminal.c
index
d81a0af
..
f3b2c8a
100644
(file)
--- a/
terminal.c
+++ b/
terminal.c
@@
-804,7
+804,7
@@
static void scroll(Terminal *term, int topline, int botline, int lines, int sb)
* If the scroll is on the same area as the last scroll in the list,
* merge them.
*/
* If the scroll is on the same area as the last scroll in the list,
* merge them.
*/
-void save_scroll(Terminal *term, int topline, int botline, int lines)
+
static
void save_scroll(Terminal *term, int topline, int botline, int lines)
{
struct scrollregion *newscroll;
if (term->scrolltail &&
{
struct scrollregion *newscroll;
if (term->scrolltail &&
@@
-4099,7
+4099,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
fprintf(stderr, "keysym = %d, %d chars:", keysym, tlen);
for (i = 0; i < tlen; i++)
fprintf(stderr, "keysym = %d, %d chars:", keysym, tlen);
for (i = 0; i < tlen; i++)
- fprintf(stderr, " %04x", text[i]);
+ fprintf(stderr, " %04x",
(unsigned)
text[i]);
fprintf(stderr, "\n");
#endif
fprintf(stderr, "\n");
#endif
@@
-4148,8
+4148,8
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
if (keysym == PK_NULL && (modifiers & PKM_CONTROL) && tlen == 1 &&
text[0] >= 0x20 && text[0] <= 0x7e) {
/* ASCII chars + Control */
if (keysym == PK_NULL && (modifiers & PKM_CONTROL) && tlen == 1 &&
text[0] >= 0x20 && text[0] <= 0x7e) {
/* ASCII chars + Control */
- if (
text[0] >= 0x40 && text[0] <= 0x5f
||
-
text[0] >= 0x61 && text[0] <= 0x7a
)
+ if (
(text[0] >= 0x40 && text[0] <= 0x5f)
||
+
(text[0] >= 0x61 && text[0] <= 0x7a)
)
text[0] &= 0x1f;
else {
/*
text[0] &= 0x1f;
else {
/*
@@
-4188,6
+4188,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
case PK_KP7: c = 'y'; break;
case PK_KP8: c = 'k'; break;
case PK_KP9: c = 'u'; break;
case PK_KP7: c = 'y'; break;
case PK_KP8: c = 'k'; break;
case PK_KP9: c = 'u'; break;
+ default: break; /* else gcc warns `enum value not used' */
}
if (c != 0) {
if (c != '.') {
}
if (c != 0) {
if (c != '.') {
@@
-4218,6
+4219,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
case PK_PF2: xkey = 'Q'; break;
case PK_PF3: xkey = 'R'; break;
case PK_PF4: xkey = 'S'; break;
case PK_PF2: xkey = 'Q'; break;
case PK_PF3: xkey = 'R'; break;
case PK_PF4: xkey = 'S'; break;
+ default: break; /* else gcc warns `enum value not used' */
}
}
if (term->app_keypad_keys && !term->cfg.no_applic_k) {
}
}
if (term->app_keypad_keys && !term->cfg.no_applic_k) {
@@
-4234,6
+4236,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
case PK_KP9: xkey = 'y'; break;
case PK_KPDECIMAL: xkey = 'n'; break;
case PK_KPENTER: xkey = 'M'; break;
case PK_KP9: xkey = 'y'; break;
case PK_KPDECIMAL: xkey = 'n'; break;
case PK_KPENTER: xkey = 'M'; break;
+ default: break; /* else gcc warns `enum value not used' */
}
if (term->cfg.funky_type == FUNKY_XTERM && tlen > 0) {
/*
}
if (term->cfg.funky_type == FUNKY_XTERM && tlen > 0) {
/*
@@
-4268,6
+4271,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
break;
case PK_KPMINUS: xkey = 'm'; break;
case PK_KPCOMMA: xkey = 'l'; break;
break;
case PK_KPMINUS: xkey = 'm'; break;
case PK_KPCOMMA: xkey = 'l'; break;
+ default: break; /* else gcc warns `enum value not used' */
}
}
}
}
}
}
@@
-4294,6
+4298,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
case PK_KP7: keysym = PK_HOME; break;
case PK_KP8: keysym = PK_UP; break;
case PK_KP9: keysym = PK_PAGEUP; break;
case PK_KP7: keysym = PK_HOME; break;
case PK_KP8: keysym = PK_UP; break;
case PK_KP9: keysym = PK_PAGEUP; break;
+ default: break; /* else gcc warns `enum value not used' */
}
}
}
}
}
}
@@
-4332,6
+4337,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
*p++ = 0x0a;
goto done;
}
*p++ = 0x0a;
goto done;
}
+ default: break; /* else gcc warns `enum value not used' */
}
/* SCO function keys and editing keys */
}
/* SCO function keys and editing keys */
@@
-4356,6
+4362,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
case PK_END: xkey = 'F'; break;
case PK_PAGEUP: xkey = 'I'; break;
case PK_PAGEDOWN: xkey = 'G'; break;
case PK_END: xkey = 'F'; break;
case PK_PAGEUP: xkey = 'I'; break;
case PK_PAGEDOWN: xkey = 'G'; break;
+ default: break; /* else gcc warns `enum value not used' */
}
p += sprintf((char *) p, "\x1B[%c", xkey);
}
}
p += sprintf((char *) p, "\x1B[%c", xkey);
}
@@
-4373,6
+4380,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
case PK_END: keysym = PK_PAGEUP; break;
case PK_PAGEUP: keysym = PK_DELETE; break;
case PK_PAGEDOWN: keysym = PK_PAGEDOWN; break;
case PK_END: keysym = PK_PAGEUP; break;
case PK_PAGEUP: keysym = PK_DELETE; break;
case PK_PAGEDOWN: keysym = PK_PAGEDOWN; break;
+ default: break; /* else gcc warns `enum value not used' */
}
}
}
}
@@
-4397,6
+4405,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
case PK_END: xkey = 'E'; break;
case PK_PAGEUP: xkey = 'I'; break;
case PK_PAGEDOWN: xkey = 'G'; break;
case PK_END: xkey = 'E'; break;
case PK_PAGEUP: xkey = 'I'; break;
case PK_PAGEDOWN: xkey = 'G'; break;
+ default: break; /* else gcc warns `enum value not used' */
}
p += sprintf((char *) p, "\x1B%c", xkey);
goto done;
}
p += sprintf((char *) p, "\x1B%c", xkey);
goto done;
@@
-4409,6
+4418,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
case PK_END: code = 4; break;
case PK_PAGEUP: code = 5; break;
case PK_PAGEDOWN: code = 6; break;
case PK_END: code = 4; break;
case PK_PAGEUP: code = 5; break;
case PK_PAGEDOWN: code = 6; break;
+ default: break; /* else gcc warns `enum value not used' */
}
p += sprintf((char *) p, "\x1B[%d~", code);
goto done;
}
p += sprintf((char *) p, "\x1B[%d~", code);
goto done;
@@
-4452,6
+4462,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
case PK_RIGHT: xkey = 'C'; break;
case PK_LEFT: xkey = 'D'; break;
case PK_REST: xkey = 'G'; break; /* centre key on number pad */
case PK_RIGHT: xkey = 'C'; break;
case PK_LEFT: xkey = 'D'; break;
case PK_REST: xkey = 'G'; break; /* centre key on number pad */
+ default: break; /* else gcc warns `enum value not used' */
}
if (term->vt52_mode)
p += sprintf((char *) p, "\x1B%c", xkey);
}
if (term->vt52_mode)
p += sprintf((char *) p, "\x1B%c", xkey);
@@
-4509,7
+4520,7
@@
void term_key(Terminal *term, Key_Sym keysym, wchar_t *text, size_t tlen,
#if 0
fprintf(stderr, "sending %d unichars:", tlen);
for (i = 0; i < tlen; i++)
#if 0
fprintf(stderr, "sending %d unichars:", tlen);
for (i = 0; i < tlen; i++)
- fprintf(stderr, " %04x", text[i]);
+ fprintf(stderr, " %04x",
(unsigned)
text[i]);
fprintf(stderr, "\n");
#endif
luni_send(term->ldisc, text, tlen, 1);
fprintf(stderr, "\n");
#endif
luni_send(term->ldisc, text, tlen, 1);
@@
-4591,7
+4602,7
@@
int term_ldisc(Terminal *term, int option)
/*
* from_backend(), to get data from the backend for the terminal.
*/
/*
* from_backend(), to get data from the backend for the terminal.
*/
-int from_backend(void *vterm, int is_stderr, char *data, int len)
+int from_backend(void *vterm, int is_stderr, c
onst c
har *data, int len)
{
Terminal *term = (Terminal *)vterm;
{
Terminal *term = (Terminal *)vterm;