Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/tmux - use our vis (maybe I'll implement strnvi...
details: https://anonhg.NetBSD.org/src/rev/d764fb665529
branches: trunk
changeset: 763165:d764fb665529
user: christos <christos%NetBSD.org@localhost>
date: Sat Mar 12 03:02:58 2011 +0000
description:
- use our vis (maybe I'll implement strnvis soon, but not now)
- WARNS=4
diffstat:
external/bsd/tmux/dist/cmd-copy-buffer.c | 4 ++--
external/bsd/tmux/dist/cmd-paste-buffer.c | 8 ++++----
external/bsd/tmux/dist/cmd-server-info.c | 10 ++++++----
external/bsd/tmux/dist/cmd-string.c | 6 +++---
external/bsd/tmux/dist/environ.c | 4 ++--
external/bsd/tmux/dist/input.c | 12 ++++++------
external/bsd/tmux/dist/job.c | 4 ++--
external/bsd/tmux/dist/options.c | 6 +++---
external/bsd/tmux/dist/screen-write.c | 29 +++++++++++++++--------------
external/bsd/tmux/dist/screen.c | 7 ++++---
external/bsd/tmux/dist/server-fn.c | 4 ++--
external/bsd/tmux/dist/session.c | 4 ++--
external/bsd/tmux/dist/tty-acs.c | 4 ++--
external/bsd/tmux/dist/tty-keys.c | 14 +++++++-------
external/bsd/tmux/dist/tty-term.c | 12 ++++++------
external/bsd/tmux/dist/window.c | 4 ++--
external/bsd/tmux/usr.bin/tmux/Makefile | 7 ++++---
external/bsd/tmux/usr.bin/tmux/config.h | 2 +-
18 files changed, 73 insertions(+), 68 deletions(-)
diffs (truncated from 577 to 300 lines):
diff -r 0936a297117c -r d764fb665529 external/bsd/tmux/dist/cmd-copy-buffer.c
--- a/external/bsd/tmux/dist/cmd-copy-buffer.c Fri Mar 11 20:22:53 2011 +0000
+++ b/external/bsd/tmux/dist/cmd-copy-buffer.c Sat Mar 12 03:02:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: cmd-copy-buffer.c,v 1.1.1.1 2011/03/10 09:15:36 jmmv Exp $ */
+/* $Id: cmd-copy-buffer.c,v 1.2 2011/03/12 03:02:58 christos Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me%tiagocunha.org@localhost>
@@ -127,7 +127,7 @@
struct cmd_copy_buffer_data *data = self->data;
struct paste_buffer *pb;
struct paste_stack *dst_ps, *src_ps;
- u_char *pdata;
+ char *pdata;
struct session *dst_session, *src_session;
u_int limit;
diff -r 0936a297117c -r d764fb665529 external/bsd/tmux/dist/cmd-paste-buffer.c
--- a/external/bsd/tmux/dist/cmd-paste-buffer.c Fri Mar 11 20:22:53 2011 +0000
+++ b/external/bsd/tmux/dist/cmd-paste-buffer.c Sat Mar 12 03:02:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: cmd-paste-buffer.c,v 1.1.1.1 2011/03/10 09:15:37 jmmv Exp $ */
+/* $Id: cmd-paste-buffer.c,v 1.2 2011/03/12 03:02:58 christos Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -195,7 +195,6 @@
{
struct cmd_paste_buffer_data *data = self->data;
size_t off = 0;
- char tmp[BUFSIZ];
int r_flag;
r_flag = 0;
@@ -212,8 +211,9 @@
if (off < len && data->buffer != -1)
off += xsnprintf(buf + off, len - off, " -b %d", data->buffer);
if (off < len && data->sepstr != NULL && !r_flag) {
- strnvis(
- tmp, data->sepstr, sizeof tmp, VIS_OCTAL|VIS_TAB|VIS_NL);
+ size_t slen = strlen(data->sepstr);
+ char tmp[slen * 4 + 1];
+ strvisx(tmp, data->sepstr, slen, VIS_OCTAL|VIS_TAB|VIS_NL);
off += cmd_prarg(buf + off, len - off, " -s ", tmp);
}
if (off < len && data->target != NULL)
diff -r 0936a297117c -r d764fb665529 external/bsd/tmux/dist/cmd-server-info.c
--- a/external/bsd/tmux/dist/cmd-server-info.c Fri Mar 11 20:22:53 2011 +0000
+++ b/external/bsd/tmux/dist/cmd-server-info.c Sat Mar 12 03:02:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: cmd-server-info.c,v 1.1.1.1 2011/03/10 09:15:37 jmmv Exp $ */
+/* $Id: cmd-server-info.c,v 1.2 2011/03/12 03:02:58 christos Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -60,7 +60,6 @@
struct grid *gd;
struct grid_line *gl;
u_int i, j, k;
- char out[80];
char *tim;
time_t t;
u_int lines, ulines;
@@ -153,12 +152,15 @@
ctx->print(ctx, "%2u: %s: [missing]",
ent->code, ent->name);
break;
- case TTYCODE_STRING:
- strnvis(out, code->value.string, sizeof out,
+ case TTYCODE_STRING: {
+ size_t slen = strlen(code->value.string);
+ char out[slen * 4 + 1];
+ strvisx(out, code->value.string, slen,
VIS_OCTAL|VIS_TAB|VIS_NL);
ctx->print(ctx, "%2u: %s: (string) %s",
ent->code, ent->name, out);
break;
+ }
case TTYCODE_NUMBER:
ctx->print(ctx, "%2u: %s: (number) %d",
ent->code, ent->name, code->value.number);
diff -r 0936a297117c -r d764fb665529 external/bsd/tmux/dist/cmd-string.c
--- a/external/bsd/tmux/dist/cmd-string.c Fri Mar 11 20:22:53 2011 +0000
+++ b/external/bsd/tmux/dist/cmd-string.c Sat Mar 12 03:02:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: cmd-string.c,v 1.1.1.1 2011/03/10 09:15:37 jmmv Exp $ */
+/* $Id: cmd-string.c,v 1.2 2011/03/12 03:02:58 christos Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -40,11 +40,11 @@
int
cmd_string_getc(const char *s, size_t *p)
{
- const u_char *ucs = s;
+ const char *ucs = s;
if (ucs[*p] == '\0')
return (EOF);
- return (ucs[(*p)++]);
+ return (u_char)(ucs[(*p)++]);
}
void
diff -r 0936a297117c -r d764fb665529 external/bsd/tmux/dist/environ.c
--- a/external/bsd/tmux/dist/environ.c Fri Mar 11 20:22:53 2011 +0000
+++ b/external/bsd/tmux/dist/environ.c Sat Mar 12 03:02:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: environ.c,v 1.1.1.1 2011/03/10 09:15:38 jmmv Exp $ */
+/* $Id: environ.c,v 1.2 2011/03/12 03:02:59 christos Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -74,7 +74,7 @@
{
struct environ_entry envent;
- envent.name = (char *) name;
+ envent.name = __UNCONST(name);
return (RB_FIND(environ, env, &envent));
}
diff -r 0936a297117c -r d764fb665529 external/bsd/tmux/dist/input.c
--- a/external/bsd/tmux/dist/input.c Fri Mar 11 20:22:53 2011 +0000
+++ b/external/bsd/tmux/dist/input.c Sat Mar 12 03:02:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: input.c,v 1.1.1.1 2011/03/10 09:15:38 jmmv Exp $ */
+/* $Id: input.c,v 1.2 2011/03/12 03:02:59 christos Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -638,7 +638,7 @@
if (ictx->ch != entry->ch)
return (ictx->ch - entry->ch);
- return (strcmp(ictx->interm_buf, entry->interm));
+ return (strcmp((const char *)ictx->interm_buf, entry->interm));
}
/* Initialise input parser. */
@@ -752,7 +752,7 @@
if (ictx->param_len == 0)
return (0);
- ptr = ictx->param_buf;
+ ptr = (char *)ictx->param_buf;
while ((out = strsep(&ptr, ";")) != NULL) {
if (*out == '\0')
n = -1;
@@ -1409,7 +1409,7 @@
if (ictx->input_buf[0] != '0' && ictx->input_buf[0] != '2')
return;
- screen_set_title(ictx->ctx.s, ictx->input_buf + 2);
+ screen_set_title(ictx->ctx.s, (const char *)ictx->input_buf + 2);
server_status_window(ictx->wp->window);
}
@@ -1430,7 +1430,7 @@
return;
log_debug("%s: \"%s\"", __func__, ictx->input_buf);
- screen_set_title(ictx->ctx.s, ictx->input_buf);
+ screen_set_title(ictx->ctx.s, (const char *)ictx->input_buf);
server_status_window(ictx->wp->window);
}
@@ -1452,7 +1452,7 @@
log_debug("%s: \"%s\"", __func__, ictx->input_buf);
xfree(ictx->wp->window->name);
- ictx->wp->window->name = xstrdup(ictx->input_buf);
+ ictx->wp->window->name = xstrdup((const char *)ictx->input_buf);
options_set_number(&ictx->wp->window->options, "automatic-rename", 0);
server_status_window(ictx->wp->window);
diff -r 0936a297117c -r d764fb665529 external/bsd/tmux/dist/job.c
--- a/external/bsd/tmux/dist/job.c Fri Mar 11 20:22:53 2011 +0000
+++ b/external/bsd/tmux/dist/job.c Sat Mar 12 03:02:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: job.c,v 1.1.1.1 2011/03/10 09:15:38 jmmv Exp $ */
+/* $Id: job.c,v 1.2 2011/03/12 03:02:59 christos Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -69,7 +69,7 @@
{
struct job job;
- job.cmd = (char *) cmd;
+ job.cmd = __UNCONST(cmd);
return (RB_FIND(jobs, jobs, &job));
}
diff -r 0936a297117c -r d764fb665529 external/bsd/tmux/dist/options.c
--- a/external/bsd/tmux/dist/options.c Fri Mar 11 20:22:53 2011 +0000
+++ b/external/bsd/tmux/dist/options.c Sat Mar 12 03:02:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: options.c,v 1.1.1.1 2011/03/10 09:15:38 jmmv Exp $ */
+/* $Id: options.c,v 1.2 2011/03/12 03:02:59 christos Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -65,7 +65,7 @@
{
struct options_entry p;
- p.name = (char *) name;
+ p.name = __UNCONST(name);
return (SPLAY_FIND(options_tree, &oo->tree, &p));
}
@@ -74,7 +74,7 @@
{
struct options_entry *o, p;
- p.name = (char *) name;
+ p.name = __UNCONST(name);
o = SPLAY_FIND(options_tree, &oo->tree, &p);
while (o == NULL) {
oo = oo->parent;
diff -r 0936a297117c -r d764fb665529 external/bsd/tmux/dist/screen-write.c
--- a/external/bsd/tmux/dist/screen-write.c Fri Mar 11 20:22:53 2011 +0000
+++ b/external/bsd/tmux/dist/screen-write.c Sat Mar 12 03:02:58 2011 +0000
@@ -1,4 +1,4 @@
-/* $Id: screen-write.c,v 1.1.1.1 2011/03/10 09:15:39 jmmv Exp $ */
+/* $Id: screen-write.c,v 1.2 2011/03/12 03:02:59 christos Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm%users.sourceforge.net@localhost>
@@ -97,7 +97,7 @@
va_list ap;
char *msg;
struct utf8_data utf8data;
- u_char *ptr;
+ char *ptr;
size_t left, size = 0;
va_start(ap, fmt);
@@ -106,13 +106,13 @@
ptr = msg;
while (*ptr != '\0') {
- if (utf8flag && *ptr > 0x7f && utf8_open(&utf8data, *ptr)) {
+ if (utf8flag && *ptr & 0x80 && utf8_open(&utf8data, (u_char)*ptr)) {
ptr++;
left = strlen(ptr);
if (left < utf8data.size - 1)
break;
- while (utf8_append(&utf8data, *ptr))
+ while (utf8_append(&utf8data, (u_char)*ptr))
ptr++;
ptr++;
@@ -157,20 +157,20 @@
{
char *msg;
struct utf8_data utf8data;
- u_char *ptr;
+ char *ptr;
size_t left, size = 0;
xvasprintf(&msg, fmt, ap);
ptr = msg;
while (*ptr != '\0') {
- if (utf8flag && *ptr > 0x7f && utf8_open(&utf8data, *ptr)) {
+ if (utf8flag && *ptr & 0x80 && utf8_open(&utf8data, (u_char)*ptr)) {
ptr++;
left = strlen(ptr);
if (left < utf8data.size - 1)
break;
- while (utf8_append(&utf8data, *ptr))
+ while (utf8_append(&utf8data, (u_char)*ptr))
ptr++;
ptr++;
@@ -192,7 +192,7 @@
break;
size++;
- screen_write_putc(ctx, gc, *ptr);
+ screen_write_putc(ctx, gc, (u_char)*ptr);
ptr++;
}
}
@@ -209,7 +209,7 @@
struct utf8_data utf8data;
va_list ap;
char *msg;
- u_char *ptr, *last;
+ char *ptr, *last;
size_t left, size = 0;
va_start(ap, fmt);
@@ -234,13 +234,13 @@
continue;
Home |
Main Index |
Thread Index |
Old Index