/****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2010,2011 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 *
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_traceatr.c,v 1.70 2010/05/01 19:33:19 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.76 2011/10/22 15:39:21 tom Exp $")
#define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name))
;
size_t n;
char temp[80];
- char *result = _nc_trace_buf(bufnum, BUFSIZ);
+ char *result = _nc_trace_buf(bufnum, (size_t) BUFSIZ);
if (result != 0) {
unsigned save_nc_tracing = _nc_tracing;
result = _nc_trace_bufcat(bufnum, names[n].name);
if (names[n].val == A_COLOR) {
- short pairnum = PairNumber(newmode);
+ short pairnum = (short) PairNumber(newmode);
#ifdef USE_TERMLIB
/* pair_content lives in libncurses */
(void) sprintf(temp, "{%d}", pairnum);
}
/* 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)
{
#if NCURSES_SP_FUNCS
(void) sp;
#endif
- if ((attr & A_ALTCHARSET) && (acs_chars != 0)) {
+ if (SP_PARM != 0 && (attr & A_ALTCHARSET) && (acs_chars != 0)) {
char *cp;
char *found = 0;
const ALT_NAMES *strp;
for (cp = acs_chars; cp[0] && cp[1]; cp += 2) {
- if (ChCharOf(cp[1]) == ChCharOf(ch)) {
+ if (ChCharOf(UChar(cp[1])) == ChCharOf(ch)) {
found = cp;
/* don't exit from loop - there may be redefinitions */
}
}
if (found != 0) {
- ch = ChCharOf(*found);
+ ch = ChCharOf(UChar(*found));
for (strp = names; strp->val; strp++)
if (strp->val == ch) {
result = strp->name;
_tracechtype2(int bufnum, chtype ch)
{
const char *found;
- char *result = _nc_trace_buf(bufnum, BUFSIZ);
+ char *result = _nc_trace_buf(bufnum, (size_t) BUFSIZ);
if (result != 0) {
strcpy(result, l_brace);
NCURSES_EXPORT(char *)
_tracecchar_t2(int bufnum, const cchar_t *ch)
{
- char *result = _nc_trace_buf(bufnum, BUFSIZ);
+ char *result = _nc_trace_buf(bufnum, (size_t) BUFSIZ);
attr_t attr;
const char *found;
(void) _nc_trace_bufcat(bufnum, "\\000");
break;
}
- PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st);
+ PUTC_n = (int) 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 */