aboutsummaryrefslogtreecommitdiff
path: root/ncurses/trace
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2014-02-28 19:12:44 +0000
committerXin LI <delphij@FreeBSD.org>2014-02-28 19:12:44 +0000
commit4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a (patch)
treeb8f6e12b479a78216f3bffb8e1258d54087268de /ncurses/trace
parente07762606a5bf651a501cb095c98cba90e4a8fe2 (diff)
downloadsrc-4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a.tar.gz
src-4b819fa20a8d007a10f2d3e8d6a5dedf7f18fc9a.zip
Undo two previous imports which was never done in preparation of doing a
new import.
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=262616
Diffstat (limited to 'ncurses/trace')
-rw-r--r--ncurses/trace/lib_trace.c37
-rw-r--r--ncurses/trace/lib_traceatr.c55
-rw-r--r--ncurses/trace/lib_tracebits.c7
-rw-r--r--ncurses/trace/lib_tracechr.c10
-rw-r--r--ncurses/trace/lib_tracedmp.c12
-rw-r--r--ncurses/trace/lib_tracemse.c42
-rw-r--r--ncurses/trace/trace_buf.c11
-rw-r--r--ncurses/trace/trace_tries.c14
-rw-r--r--ncurses/trace/trace_xnames.c7
-rw-r--r--ncurses/trace/varargs.c4
-rw-r--r--ncurses/trace/visbuf.c57
11 files changed, 92 insertions, 164 deletions
diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c
index a726901d4a3a..743b1f64f1ae 100644
--- a/ncurses/trace/lib_trace.c
+++ b/ncurses/trace/lib_trace.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,7 +30,6 @@
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
* and: Thomas E. Dickey 1996-on *
- * and: Juergen Pfeifer *
****************************************************************************/
/*
@@ -47,7 +46,7 @@
#include <ctype.h>
-MODULE_ID("$Id: lib_trace.c,v 1.76 2010/12/19 01:21:19 tom Exp $")
+MODULE_ID("$Id: lib_trace.c,v 1.71 2008/08/23 18:04:29 tom Exp $")
NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
@@ -57,26 +56,26 @@ NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
NCURSES_EXPORT(const char *)
NCURSES_PUBLIC_VAR(_nc_tputs_trace) (void)
{
- return CURRENT_SCREEN ? CURRENT_SCREEN->_tputs_trace : _nc_prescreen._tputs_trace;
+ return SP ? SP->_tputs_trace : _nc_prescreen._tputs_trace;
}
NCURSES_EXPORT(long)
NCURSES_PUBLIC_VAR(_nc_outchars) (void)
{
- return CURRENT_SCREEN ? CURRENT_SCREEN->_outchars : _nc_prescreen._outchars;
+ return SP ? SP->_outchars : _nc_prescreen._outchars;
}
NCURSES_EXPORT(void)
_nc_set_tputs_trace(const char *s)
{
- if (CURRENT_SCREEN)
- CURRENT_SCREEN->_tputs_trace = s;
+ if (SP)
+ SP->_tputs_trace = s;
else
_nc_prescreen._tputs_trace = s;
}
NCURSES_EXPORT(void)
_nc_count_outchars(long increment)
{
- if (CURRENT_SCREEN)
- CURRENT_SCREEN->_outchars += increment;
+ if (SP)
+ SP->_outchars += increment;
else
_nc_prescreen._outchars += increment;
}
@@ -96,7 +95,7 @@ trace(const unsigned int tracelevel)
const char *mode = _nc_globals.init_trace ? "ab" : "wb";
if (TracePath[0] == '\0') {
- size_t size = sizeof(TracePath) - 12;
+ int size = sizeof(TracePath) - 12;
if (getcwd(TracePath, size) == 0) {
perror("curses: Can't get working directory");
exit(EXIT_FAILURE);
@@ -122,7 +121,7 @@ trace(const unsigned int tracelevel)
*/
#if HAVE_SETVBUF /* ANSI */
(void) setvbuf(TraceFP, (char *) 0, _IOLBF, 0);
-#elif HAVE_SETBUF /* POSIX */
+#elif HAVE_SETBUF /* POSIX */
(void) setbuffer(TraceFP, (char *) 0);
#endif
_tracef("TRACING NCURSES version %s.%d (tracelevel=%#x)",
@@ -184,12 +183,8 @@ _nc_va_tracef(const char *fmt, va_list ap)
# if USE_WEAK_SYMBOLS
if ((pthread_self))
# endif
-#ifdef __MINGW32__
- fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self().p);
-#else
fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self());
#endif
-#endif
if (before || after) {
int n;
for (n = 1; n < TraceLevel; n++)
@@ -224,14 +219,6 @@ _nc_retrace_bool(NCURSES_BOOL code)
return code;
}
-/* Trace 'char' return-values */
-NCURSES_EXPORT(char)
-_nc_retrace_char(char code)
-{
- T((T_RETURN("%c"), code));
- return code;
-}
-
/* Trace 'int' return-values */
NCURSES_EXPORT(int)
_nc_retrace_int(int code)
@@ -284,7 +271,7 @@ _nc_retrace_void_ptr(void *code)
NCURSES_EXPORT(SCREEN *)
_nc_retrace_sp(SCREEN *code)
{
- T((T_RETURN("%p"), (void *) code));
+ T((T_RETURN("%p"), code));
return code;
}
@@ -292,7 +279,7 @@ _nc_retrace_sp(SCREEN *code)
NCURSES_EXPORT(WINDOW *)
_nc_retrace_win(WINDOW *code)
{
- T((T_RETURN("%p"), (void *) code));
+ T((T_RETURN("%p"), code));
return code;
}
diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c
index 35ba0d3e6797..45a03cea05fe 100644
--- a/ncurses/trace/lib_traceatr.c
+++ b/ncurses/trace/lib_traceatr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -30,7 +30,6 @@
* Author: Thomas Dickey 1996-on *
* and: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
- * and: Juergen Pfeifer *
****************************************************************************/
/*
@@ -38,12 +37,9 @@
*/
#include <curses.priv.h>
+#include <term.h> /* acs_chars */
-#ifndef CUR
-#define CUR SP_TERMTYPE
-#endif
-
-MODULE_ID("$Id: lib_traceatr.c,v 1.74 2011/01/22 19:48:01 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.63 2008/08/03 16:24:53 tom Exp $")
#define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name))
@@ -132,11 +128,11 @@ _traceattr2(int bufnum, chtype newmode)
for (n = 0; n < SIZEOF(names); n++) {
if ((newmode & names[n].val) != 0) {
if (result[1] != '\0')
- (void) _nc_trace_bufcat(bufnum, "|");
+ result = _nc_trace_bufcat(bufnum, "|");
result = _nc_trace_bufcat(bufnum, names[n].name);
if (names[n].val == A_COLOR) {
- short pairnum = (short) PairNumber(newmode);
+ short pairnum = PAIR_NUMBER(newmode);
#ifdef USE_TERMLIB
/* pair_content lives in libncurses */
(void) sprintf(temp, "{%d}", pairnum);
@@ -176,14 +172,6 @@ _traceattr(attr_t newmode)
}
/* Trace 'int' return-values */
-NCURSES_EXPORT(int)
-_nc_retrace_int_attr_t(attr_t code)
-{
- T((T_RETURN("%s"), _traceattr(code)));
- return (int) code;
-}
-
-/* Trace 'attr_t' return-values */
NCURSES_EXPORT(attr_t)
_nc_retrace_attr_t(attr_t code)
{
@@ -198,9 +186,6 @@ _nc_altcharset_name(attr_t attr, chtype ch)
unsigned int val;
const char *name;
} ALT_NAMES;
-#if NCURSES_SP_FUNCS
- SCREEN *sp = CURRENT_SCREEN;
-#endif
static const ALT_NAMES names[] =
{
{'l', "ACS_ULCORNER"}, /* upper left corner */
@@ -240,26 +225,23 @@ _nc_altcharset_name(attr_t attr, chtype ch)
const char *result = 0;
-#if NCURSES_SP_FUNCS
- (void) sp;
-#endif
if ((attr & A_ALTCHARSET) && (acs_chars != 0)) {
char *cp;
char *found = 0;
- const ALT_NAMES *strp;
+ const ALT_NAMES *sp;
for (cp = acs_chars; cp[0] && cp[1]; cp += 2) {
- if (ChCharOf(UChar(cp[1])) == ChCharOf(ch)) {
+ if (ChCharOf(cp[1]) == ChCharOf(ch)) {
found = cp;
/* don't exit from loop - there may be redefinitions */
}
}
if (found != 0) {
- ch = ChCharOf(UChar(*found));
- for (strp = names; strp->val; strp++)
- if (strp->val == ch) {
- result = strp->name;
+ ch = ChCharOf(*found);
+ for (sp = names; sp->val; sp++)
+ if (sp->val == ch) {
+ result = sp->name;
break;
}
}
@@ -278,9 +260,7 @@ _tracechtype2(int bufnum, chtype ch)
if ((found = _nc_altcharset_name(ChAttrOf(ch), ch)) != 0) {
(void) _nc_trace_bufcat(bufnum, found);
} else
- (void) _nc_trace_bufcat(bufnum,
- _nc_tracechar(CURRENT_SCREEN,
- (int) ChCharOf(ch)));
+ (void) _nc_trace_bufcat(bufnum, _nc_tracechar(SP, (int) ChCharOf(ch)));
if (ChAttrOf(ch) != A_NORMAL) {
(void) _nc_trace_bufcat(bufnum, " | ");
@@ -333,17 +313,14 @@ _tracecchar_t2(int bufnum, const cchar_t *ch)
(void) _nc_trace_bufcat(bufnum, "{ ");
for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) {
PUTC_ch = ch->chars[PUTC_i];
- if (PUTC_ch == L'\0') {
- if (PUTC_i == 0)
- (void) _nc_trace_bufcat(bufnum, "\\000");
+ if (PUTC_ch == L'\0')
break;
- }
- PUTC_n = (int) wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st);
+ PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st);
if (PUTC_n <= 0) {
if (PUTC_ch != L'\0') {
/* it could not be a multibyte sequence */
(void) _nc_trace_bufcat(bufnum,
- _nc_tracechar(CURRENT_SCREEN,
+ _nc_tracechar(SP,
UChar(ch->chars[PUTC_i])));
}
break;
@@ -352,7 +329,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch)
if (n)
(void) _nc_trace_bufcat(bufnum, ", ");
(void) _nc_trace_bufcat(bufnum,
- _nc_tracechar(CURRENT_SCREEN,
+ _nc_tracechar(SP,
UChar(PUTC_buf[n])));
}
}
diff --git a/ncurses/trace/lib_tracebits.c b/ncurses/trace/lib_tracebits.c
index d19d0e420acc..cc441b391e5b 100644
--- a/ncurses/trace/lib_tracebits.c
+++ b/ncurses/trace/lib_tracebits.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -33,8 +33,9 @@
****************************************************************************/
#include <curses.priv.h>
+#include <term.h> /* cur_term */
-MODULE_ID("$Id: lib_tracebits.c,v 1.19 2011/01/09 00:23:03 tom Exp $")
+MODULE_ID("$Id: lib_tracebits.c,v 1.17 2008/08/03 16:09:26 tom Exp $")
#if SVR4_TERMIO && !defined(_POSIX_SOURCE)
#define _POSIX_SOURCE
@@ -261,5 +262,5 @@ _nc_tracebits(void)
return _nc_trace_ttymode(&(cur_term->Nttyb));
}
#else
-EMPTY_MODULE(_nc_empty_lib_tracebits)
+EMPTY_MODULE(_nc_tracebits)
#endif /* TRACE */
diff --git a/ncurses/trace/lib_tracechr.c b/ncurses/trace/lib_tracechr.c
index a1f9f5aa2706..79cf03b4870c 100644
--- a/ncurses/trace/lib_tracechr.c
+++ b/ncurses/trace/lib_tracechr.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -39,7 +39,7 @@
#include <ctype.h>
-MODULE_ID("$Id: lib_tracechr.c,v 1.20 2009/04/18 22:48:29 tom Exp $")
+MODULE_ID("$Id: lib_tracechr.c,v 1.19 2008/08/03 15:39:29 tom Exp $")
#ifdef TRACE
@@ -52,7 +52,7 @@ _nc_tracechar(SCREEN *sp, int ch)
: _nc_globals.tracechr_buf);
if (ch > KEY_MIN || ch < 0) {
- name = safe_keyname(SP_PARM, ch);
+ name = _nc_keyname(sp, ch);
if (name == 0 || *name == '\0')
name = "NULL";
(void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch);
@@ -64,7 +64,7 @@ _nc_tracechar(SCREEN *sp, int ch)
*/
(void) sprintf(MyBuffer, "%#03o", ch);
} else {
- name = safe_unctrl(SP_PARM, (chtype) ch);
+ name = _nc_unctrl(sp, (chtype) ch);
if (name == 0 || *name == 0)
name = "null"; /* shouldn't happen */
(void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch);
@@ -75,7 +75,7 @@ _nc_tracechar(SCREEN *sp, int ch)
NCURSES_EXPORT(char *)
_tracechar(int ch)
{
- return _nc_tracechar(CURRENT_SCREEN, ch);
+ return _nc_tracechar(SP, ch);
}
#else
EMPTY_MODULE(_nc_lib_tracechr)
diff --git a/ncurses/trace/lib_tracedmp.c b/ncurses/trace/lib_tracedmp.c
index c7fcbf2e0d56..58732a06c246 100644
--- a/ncurses/trace/lib_tracedmp.c
+++ b/ncurses/trace/lib_tracedmp.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -39,7 +39,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_tracedmp.c,v 1.32 2009/04/18 21:01:38 tom Exp $")
+MODULE_ID("$Id: lib_tracedmp.c,v 1.31 2008/08/16 19:30:56 tom Exp $")
#ifdef TRACE
@@ -68,7 +68,7 @@ _tracedump(const char *name, WINDOW *win)
if (width < win->_maxx)
++width;
if (++width + 1 > (int) my_length) {
- my_length = (unsigned) (2 * (width + 1));
+ my_length = 2 * (width + 1);
my_buffer = typeRealloc(char, my_length, my_buffer);
}
@@ -82,7 +82,7 @@ _tracedump(const char *name, WINDOW *win)
* we map those to '.' and '?' respectively.
*/
for (j = 0; j < width; ++j) {
- chtype test = (chtype) CharOf(win->_line[n].text[j]);
+ chtype test = CharOf(win->_line[n].text[j]);
ep[j] = (char) ((UChar(test) == test
#if USE_WIDEC_SUPPORT
&& (win->_line[n].text[j].chars[1] == 0)
@@ -111,7 +111,7 @@ _tracedump(const char *name, WINDOW *win)
if (multicolumn) {
ep = my_buffer;
for (j = 0; j < width; ++j) {
- chtype test = WidecExt(win->_line[n].text[j]);
+ int test = WidecExt(win->_line[n].text[j]);
if (test) {
ep[j] = (char) (test + '0');
} else {
@@ -153,7 +153,7 @@ _tracedump(const char *name, WINDOW *win)
for (i = 0; i < 4; ++i) {
const char *hex = " 123456789ABCDEF";
- attr_t mask = (attr_t) (0xf << ((i + 4) * 4));
+ attr_t mask = (0xf << ((i + 4) * 4));
haveattrs = FALSE;
for (j = 0; j < width; ++j)
diff --git a/ncurses/trace/lib_tracemse.c b/ncurses/trace/lib_tracemse.c
index 1afd15d2e785..74cc177d51bb 100644
--- a/ncurses/trace/lib_tracemse.c
+++ b/ncurses/trace/lib_tracemse.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -38,16 +38,23 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_tracemse.c,v 1.18 2011/01/22 19:48:08 tom Exp $")
+MODULE_ID("$Id: lib_tracemse.c,v 1.15 2008/08/03 15:39:29 tom Exp $")
#ifdef TRACE
#define my_buffer sp->tracemse_buf
-static char *
-_trace_mmask_t(SCREEN *sp, mmask_t code)
+NCURSES_EXPORT(char *)
+_nc_tracemouse(SCREEN *sp, MEVENT const *ep)
{
-#define SHOW(m, s) if ((code & m) == m) strcat(strcat(my_buffer, s), ", ")
+ (void) sprintf(my_buffer, TRACEMSE_FMT,
+ ep->id,
+ ep->x,
+ ep->y,
+ ep->z,
+ (unsigned long) ep->bstate);
+
+#define SHOW(m, s) if ((ep->bstate & m) == m) strcat(strcat(my_buffer, s), ", ")
SHOW(BUTTON1_RELEASED, "release-1");
SHOW(BUTTON1_PRESSED, "press-1");
@@ -103,37 +110,14 @@ _trace_mmask_t(SCREEN *sp, mmask_t code)
if (my_buffer[strlen(my_buffer) - 1] == ' ')
my_buffer[strlen(my_buffer) - 2] = '\0';
-
- return (my_buffer);
-}
-
-NCURSES_EXPORT(char *)
-_nc_tracemouse(SCREEN *sp, MEVENT const *ep)
-{
- (void) sprintf(my_buffer, TRACEMSE_FMT,
- ep->id,
- ep->x,
- ep->y,
- ep->z,
- (unsigned long) ep->bstate);
-
- (void) _trace_mmask_t(sp, ep->bstate);
(void) strcat(my_buffer, "}");
return (my_buffer);
}
-NCURSES_EXPORT(mmask_t)
-_nc_retrace_mmask_t(SCREEN *sp, mmask_t code)
-{
- *my_buffer = '\0';
- T((T_RETURN("{%s}"), _trace_mmask_t(sp, code)));
- return code;
-}
-
NCURSES_EXPORT(char *)
_tracemouse(MEVENT const *ep)
{
- return _nc_tracemouse(CURRENT_SCREEN, ep);
+ return _nc_tracemouse(SP, ep);
}
#else /* !TRACE */
diff --git a/ncurses/trace/trace_buf.c b/ncurses/trace/trace_buf.c
index 46baba4796b2..6345acc035fc 100644
--- a/ncurses/trace/trace_buf.c
+++ b/ncurses/trace/trace_buf.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -35,9 +35,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: trace_buf.c,v 1.17 2011/01/22 19:48:16 tom Exp $")
-
-#ifdef TRACE
+MODULE_ID("$Id: trace_buf.c,v 1.14 2008/08/03 15:13:56 tom Exp $")
#define MyList _nc_globals.tracebuf_ptr
#define MySize _nc_globals.tracebuf_used
@@ -49,7 +47,7 @@ _nc_trace_alloc(int bufnum, size_t want)
if (bufnum >= 0) {
if ((size_t) (bufnum + 1) > MySize) {
- size_t need = (size_t) (bufnum + 1) * 2;
+ size_t need = (bufnum + 1) * 2;
if ((MyList = typeRealloc(TRACEBUF, need, MyList)) != 0) {
while (need > MySize)
MyList[MySize++].text = 0;
@@ -114,6 +112,3 @@ _nc_trace_bufcat(int bufnum, const char *value)
}
return buffer;
}
-#else
-EMPTY_MODULE(_nc_empty_trace_buf)
-#endif /* TRACE */
diff --git a/ncurses/trace/trace_tries.c b/ncurses/trace/trace_tries.c
index d3380131ecac..f813aba15825 100644
--- a/ncurses/trace/trace_tries.c
+++ b/ncurses/trace/trace_tries.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1999-2009,2011 Free Software Foundation, Inc. *
+ * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -27,7 +27,7 @@
****************************************************************************/
/****************************************************************************
- * Author: Thomas E. Dickey 1999 *
+ * Author: Thomas E. Dickey <dickey@clark.net> 1999 *
****************************************************************************/
/*
* trace_tries.c - Tracing/Debugging buffers (keycode tries-trees)
@@ -35,7 +35,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: trace_tries.c,v 1.16 2011/01/09 00:23:27 tom Exp $")
+MODULE_ID("$Id: trace_tries.c,v 1.13 2008/08/03 15:43:30 tom Exp $")
#ifdef TRACE
#define my_buffer _nc_globals.tracetry_buf
@@ -46,7 +46,7 @@ recur_tries(TRIES * tree, unsigned level)
{
if (level > my_length) {
my_length = (level + 1) * 4;
- my_buffer = (unsigned char *) _nc_doalloc(my_buffer, my_length);
+ my_buffer = (unsigned char *) realloc(my_buffer, my_length);
}
while (tree != 0) {
@@ -67,12 +67,12 @@ NCURSES_EXPORT(void)
_nc_trace_tries(TRIES * tree)
{
my_buffer = typeMalloc(unsigned char, my_length = 80);
- _tracef("BEGIN tries %p", (void *) tree);
+ _tracef("BEGIN tries %p", tree);
recur_tries(tree, 0);
- _tracef(". . . tries %p", (void *) tree);
+ _tracef(". . . tries %p", tree);
free(my_buffer);
}
#else
-EMPTY_MODULE(_nc_empty_trace_tries)
+EMPTY_MODULE(_nc_trace_tries)
#endif
diff --git a/ncurses/trace/trace_xnames.c b/ncurses/trace/trace_xnames.c
index 38a48730ccdc..9b0b5920d814 100644
--- a/ncurses/trace/trace_xnames.c
+++ b/ncurses/trace/trace_xnames.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1999-2000,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1999,2000 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -34,11 +34,12 @@
*/
#include <curses.priv.h>
+#include <term_entry.h>
-MODULE_ID("$Id: trace_xnames.c,v 1.6 2010/01/23 17:59:27 tom Exp $")
+MODULE_ID("$Id: trace_xnames.c,v 1.5 2000/12/10 03:02:45 tom Exp $")
NCURSES_EXPORT(void)
-_nc_trace_xnames(TERMTYPE *tp GCC_UNUSED)
+_nc_trace_xnames(TERMTYPE * tp GCC_UNUSED)
{
#ifdef TRACE
#if NCURSES_XNAMES
diff --git a/ncurses/trace/varargs.c b/ncurses/trace/varargs.c
index 541173d27459..f4ee46710abb 100644
--- a/ncurses/trace/varargs.c
+++ b/ncurses/trace/varargs.c
@@ -34,7 +34,7 @@
#include <ctype.h>
-MODULE_ID("$Id: varargs.c,v 1.8 2008/11/16 00:19:59 juergen Exp $")
+MODULE_ID("$Id: varargs.c,v 1.7 2008/08/03 15:42:49 tom Exp $")
#ifdef TRACE
@@ -44,7 +44,7 @@ typedef enum {
atUnknown = 0, atInteger, atFloat, atPoint, atString
} ARGTYPE;
-#define VA_INT(type) ival = (int) va_arg(ap, type)
+#define VA_INT(type) ival = va_arg(ap, type)
#define VA_FLT(type) fval = va_arg(ap, type)
#define VA_PTR(type) pval = (char *)va_arg(ap, type)
#define VA_STR(type) sval = va_arg(ap, type)
diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c
index 66da4f4beca3..bf9fb1472003 100644
--- a/ncurses/trace/visbuf.c
+++ b/ncurses/trace/visbuf.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 2001-2007,2008 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -42,9 +42,7 @@
#include <tic.h>
#include <ctype.h>
-MODULE_ID("$Id: visbuf.c,v 1.37 2010/05/29 18:51:41 tom Exp $")
-
-#define NUM_VISBUFS 4
+MODULE_ID("$Id: visbuf.c,v 1.32 2008/08/04 23:07:39 tom Exp $")
#define NormalLen(len) (size_t) (((size_t)(len) + 1) * 4)
#define WideLen(len) (size_t) (((size_t)(len) + 1) * 4 * MB_CUR_MAX)
@@ -94,7 +92,7 @@ _nc_vischar(char *tp, unsigned c)
static const char *
_nc_visbuf2n(int bufnum, const char *buf, int len)
{
- const char *vbuf = 0;
+ const char *vbuf;
char *tp;
int c;
@@ -110,16 +108,9 @@ _nc_visbuf2n(int bufnum, const char *buf, int len)
vbuf = tp = _nc_trace_buf(bufnum, NormalLen(len));
#else
{
- static char *mybuf[NUM_VISBUFS];
- if (bufnum < 0) {
- for (c = 0; c < NUM_VISBUFS; ++c) {
- FreeAndNull(mybuf[c]);
- }
- tp = 0;
- } else {
- mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]);
- vbuf = tp = mybuf[bufnum];
- }
+ static char *mybuf[4];
+ mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]);
+ vbuf = tp = mybuf[bufnum];
}
#endif
if (tp != 0) {
@@ -128,7 +119,7 @@ _nc_visbuf2n(int bufnum, const char *buf, int len)
tp = _nc_vischar(tp, UChar(c));
}
*tp++ = D_QUOTE;
- *tp = '\0';
+ *tp++ = '\0';
} else {
vbuf = ("(_nc_visbuf2n failed)");
}
@@ -186,7 +177,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len)
vbuf = tp = _nc_trace_buf(bufnum, WideLen(len));
#else
{
- static char *mybuf[NUM_VISBUFS];
+ static char *mybuf[2];
mybuf[bufnum] = typeRealloc(char, WideLen(len), mybuf[bufnum]);
vbuf = tp = mybuf[bufnum];
}
@@ -205,7 +196,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len)
}
}
*tp++ = D_QUOTE;
- *tp = '\0';
+ *tp++ = '\0';
} else {
vbuf = ("(_nc_viswbuf2n failed)");
}
@@ -238,9 +229,7 @@ _nc_viswibuf(const wint_t *buf)
static unsigned mylen;
unsigned n;
- for (n = 0; buf[n] != 0; ++n) {
- ; /* empty */
- }
+ for (n = 0; buf[n] != 0; ++n) ;
if (mylen < ++n) {
mylen = n + 80;
if (mybuf != 0)
@@ -248,10 +237,8 @@ _nc_viswibuf(const wint_t *buf)
else
mybuf = typeMalloc(wchar_t, mylen);
}
- for (n = 0; buf[n] != 0; ++n) {
+ for (n = 0; buf[n] != 0; ++n)
mybuf[n] = (wchar_t) buf[n];
- }
- mybuf[n] = L'\0';
return _nc_viswbuf2(0, mybuf);
}
@@ -287,12 +274,12 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len)
}
}
- (void) _nc_trace_bufcat(bufnum, l_brace);
- (void) _nc_trace_bufcat(bufnum, d_quote);
+ result = _nc_trace_bufcat(bufnum, l_brace);
+ result = _nc_trace_bufcat(bufnum, d_quote);
for (j = first; j <= last; ++j) {
found = _nc_altcharset_name(attr, (chtype) CharOf(buf[j]));
if (found != 0) {
- (void) _nc_trace_bufcat(bufnum, found);
+ result = _nc_trace_bufcat(bufnum, found);
attr &= ~A_ALTCHARSET;
} else
#if USE_WIDEC_SUPPORT
@@ -304,19 +291,15 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len)
int k;
PUTC_ch = buf[j].chars[PUTC_i];
- if (PUTC_ch == L'\0') {
- if (PUTC_i == 0)
- (void) _nc_trace_bufcat(bufnum, "\\000");
+ if (PUTC_ch == L'\0')
break;
- }
- PUTC_n = (int) wcrtomb(PUTC_buf,
- buf[j].chars[PUTC_i], &PUT_st);
+ PUTC_n = (int) wcrtomb(PUTC_buf, buf[j].chars[PUTC_i], &PUT_st);
if (PUTC_n <= 0)
break;
for (k = 0; k < PUTC_n; k++) {
char temp[80];
_nc_vischar(temp, UChar(PUTC_buf[k]));
- (void) _nc_trace_bufcat(bufnum, temp);
+ result = _nc_trace_bufcat(bufnum, temp);
}
}
}
@@ -328,10 +311,10 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len)
}
#endif /* USE_WIDEC_SUPPORT */
}
- (void) _nc_trace_bufcat(bufnum, d_quote);
+ result = _nc_trace_bufcat(bufnum, d_quote);
if (attr != A_NORMAL) {
- (void) _nc_trace_bufcat(bufnum, " | ");
- (void) _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr));
+ result = _nc_trace_bufcat(bufnum, " | ");
+ result = _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr));
}
result = _nc_trace_bufcat(bufnum, r_brace);
first = last + 1;