]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20110101
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 2 Jan 2011 01:08:28 +0000 (01:08 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 2 Jan 2011 01:08:28 +0000 (01:08 +0000)
+ fix remaining strict compiler warnings in ncurses library ABI=5,
  except those dealing with function pointers, etc.

NEWS
dist.mk
include/curses.h.in
ncurses/base/MKlib_gen.sh
ncurses/base/lib_bkgd.c
ncurses/base/lib_mouse.c
ncurses/curses.priv.h
ncurses/trace/lib_traceatr.c
ncurses/trace/lib_tracemse.c

diff --git a/NEWS b/NEWS
index 2842dafb01c3eebd34504e173fbe3efb6fe7969d..468dbf07434c338f4594724ce3b327d9f9303c78 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1624 2010/12/25 23:56:36 tom Exp $
+-- $Id: NEWS,v 1.1626 2011/01/01 23:11:55 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,10 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20110101
+       + fix remaining strict compiler warnings in ncurses library ABI=5,
+         except those dealing with function pointers, etc.
+
 20101225
        + modify nc_tparm.h, adding guards against repeated inclusion, and
          allowing TPARM_ARG to be overridden.
 20101225
        + modify nc_tparm.h, adding guards against repeated inclusion, and
          allowing TPARM_ARG to be overridden.
diff --git a/dist.mk b/dist.mk
index dc6fe0802f6716a98a8a47c101d7838f9a9e054a..c3d09ae39fb051fe748207a3ea026e8915fc5496 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.787 2010/12/25 23:56:22 tom Exp $
+# $Id: dist.mk,v 1.788 2011/01/01 16:29:59 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 7
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 7
-NCURSES_PATCH = 20101225
+NCURSES_PATCH = 20110101
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index fc714f6777c9206d0e5f82a72806bff175e952a3..e140d10b13c89a09d835ad603ebed04fb6cf6592 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.218 2010/12/25 23:39:07 tom Exp $ */
+/* $Id: curses.h.in,v 1.219 2011/01/01 21:52:45 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
@@ -1268,12 +1268,12 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);   /*
                                         (win)->_color = (p), \
                                         OK)
 #define wattr_get(win,a,p,opts)                ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
                                         (win)->_color = (p), \
                                         OK)
 #define wattr_get(win,a,p,opts)                ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
-                                        (void)((p) != (void *)0 && (*(p) = (win)->_color)), \
+                                        (void)((p) != (void *)0 && (*(p) = (short)(win)->_color)), \
                                         OK)
 #else
                                         OK)
 #else
-#define wattr_set(win,a,p,opts)                ((win)->_attrs = (((a) & ~A_COLOR) | COLOR_PAIR(p)), OK)
+#define wattr_set(win,a,p,opts)                ((win)->_attrs = (((a) & ~A_COLOR) | (attr_t)COLOR_PAIR(p)), OK)
 #define wattr_get(win,a,p,opts)                ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
 #define wattr_get(win,a,p,opts)                ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
-                                        (void)((p) != (void *)0 && (*(p) = PAIR_NUMBER((win)->_attrs))), \
+                                        (void)((p) != (void *)0 && (*(p) = (short)PAIR_NUMBER((win)->_attrs))), \
                                         OK)
 #endif
 #endif /* NCURSES_OPAQUE */
                                         OK)
 #endif
 #endif /* NCURSES_OPAQUE */
index decf3c6a5ffc6ad75d38c79e5f1e317cc68e8690..c4319bf09f181bea993d2c5bf6e76611afdbf8ce 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # MKlib_gen.sh -- generate sources from curses.h macro definitions
 #
 #
 # MKlib_gen.sh -- generate sources from curses.h macro definitions
 #
-# ($Id: MKlib_gen.sh,v 1.41 2010/12/19 00:39:24 tom Exp $)
+# ($Id: MKlib_gen.sh,v 1.42 2011/01/01 22:06:52 tom Exp $)
 #
 ##############################################################################
 # Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.                #
 #
 ##############################################################################
 # Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.                #
@@ -200,6 +200,7 @@ $0 !~ /^P_/ {
                }
        }
        second = first + 1;
                }
        }
        second = first + 1;
+       returnCast = "";
        if ( $first == "chtype" ) {
                returnType = "Chtype";
        } else if ( $first == "SCREEN" ) {
        if ( $first == "chtype" ) {
                returnType = "Chtype";
        } else if ( $first == "SCREEN" ) {
@@ -207,7 +208,8 @@ $0 !~ /^P_/ {
        } else if ( $first == "WINDOW" ) {
                returnType = "Win";
        } else if ( $first == "attr_t" || $second == "attrset" || $second == "standout" || $second == "standend" || $second == "wattrset" || $second == "wstandout" || $second == "wstandend" ) {
        } else if ( $first == "WINDOW" ) {
                returnType = "Win";
        } else if ( $first == "attr_t" || $second == "attrset" || $second == "standout" || $second == "standend" || $second == "wattrset" || $second == "wstandout" || $second == "wstandend" ) {
-               returnType = "Attr";
+               returnType = "IntAttr";
+               returnCast = "(attr_t)";
        } else if ( $first == "bool" || $first == "NCURSES_BOOL" ) {
                returnType = "Bool";
        } else if ( $second == "*" ) {
        } else if ( $first == "bool" || $first == "NCURSES_BOOL" ) {
                returnType = "Bool";
        } else if ( $second == "*" ) {
@@ -283,6 +285,7 @@ $0 !~ /^P_/ {
                }
 
                if ( ch == "," || ch == ")" ) {
                }
 
                if ( ch == "," || ch == ")" ) {
+                       argcast = "";
                        if (va_list) {
                                call = call "%s"
                        } else if (varargs) {
                        if (va_list) {
                                call = call "%s"
                        } else if (varargs) {
@@ -303,6 +306,9 @@ $0 !~ /^P_/ {
                                } else if ( argtype != "" ) {
                                        call = call "%s"
                                        comma = comma "_trace" argtype "2(" num ","
                                } else if ( argtype != "" ) {
                                        call = call "%s"
                                        comma = comma "_trace" argtype "2(" num ","
+                                       if (argtype == "attr") {
+                                               argcast = "(chtype)";
+                                       }
                                } else {
                                        call = call "%#lx"
                                        comma = comma "(long)"
                                } else {
                                        call = call "%#lx"
                                        comma = comma "(long)"
@@ -316,7 +322,7 @@ $0 !~ /^P_/ {
                                } else if ( varargs ) {
                                        args = args comma "\"...\""
                                } else {
                                } else if ( varargs ) {
                                        args = args comma "\"...\""
                                } else {
-                                       args = args comma "z"
+                                       args = args comma argcast "z"
                                }
                        }
                        call = call ch
                                }
                        }
                        call = call ch
@@ -338,12 +344,16 @@ $0 !~ /^P_/ {
        if (dotrace)
                printf "%s", call
 
        if (dotrace)
                printf "%s", call
 
-       if (match($0, "^void"))
+       if (match($0, "^void")) {
                call = ""
                call = ""
-       else if (dotrace)
+       } else if (dotrace) {
                call = sprintf("return%s( ", returnType);
                call = sprintf("return%s( ", returnType);
-       else
+               if (returnCast != "") {
+                       call = call returnCast;
+               }
+       } else {
                call = "@@return ";
                call = "@@return ";
+       }
 
        call = call $myfunc "(";
        for (i = 1; i < argcount; i++) {
 
        call = call $myfunc "(";
        for (i = 1; i < argcount; i++) {
@@ -358,8 +368,9 @@ $0 !~ /^P_/ {
        }
        if (!match($0, "^void"))
                call = call ") ";
        }
        if (!match($0, "^void"))
                call = call ") ";
-       if (dotrace)
+       if (dotrace) {
                call = call ")";
                call = call ")";
+       }
        print call ";"
 
        if (match($0, "^void"))
        print call ";"
 
        if (match($0, "^void"))
index 784da1974a61d57a6c3936e9087707959e924417..d07d8111dbe61889cde192edf4c20c79f6958b53 100644 (file)
@@ -36,7 +36,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_bkgd.c,v 1.41 2010/05/01 22:16:21 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.42 2011/01/01 17:18:52 tom Exp $")
 
 /*
  * Set the window's background information.
 
 /*
  * Set the window's background information.
@@ -90,7 +90,7 @@ wbkgrndset(WINDOW *win, const ARG_CH_T ch)
 
            win->_bkgd = (((tmp == EOF) ? ' ' : (chtype) tmp)
                          | (AttrOf(wch) & ALL_BUT_COLOR)
 
            win->_bkgd = (((tmp == EOF) ? ' ' : (chtype) tmp)
                          | (AttrOf(wch) & ALL_BUT_COLOR)
-                         | ColorPair(GET_WINDOW_PAIR(win)));
+                         | (chtype) ColorPair(GET_WINDOW_PAIR(win)));
        }
 #endif
     }
        }
 #endif
     }
index 0ab894af2ac6fe30428c48816045cccfa719a88d..621f8f70d29e69b4ac57f27349496b8155b244c4 100644 (file)
@@ -84,7 +84,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.119 2010/05/22 20:00:55 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.120 2011/01/01 22:25:49 tom Exp $")
 
 #include <tic.h>
 
 
 #include <tic.h>
 
@@ -1450,7 +1450,7 @@ NCURSES_SP_NAME(mousemask) (NCURSES_SP_DCLx mmask_t newmask, mmask_t * oldmask)
            }
        }
     }
            }
        }
     }
-    returnBits(result);
+    returnMMask(result);
 }
 
 #if NCURSES_SP_FUNCS
 }
 
 #if NCURSES_SP_FUNCS
index 3d357777acebd6da65bd9555a362d80f16acbb1b..0db05ddf986b946a5bcfb9dfc68b082f7cbf8c6f 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.470 2010/12/25 23:45:09 tom Exp $
+ * $Id: curses.priv.h,v 1.472 2011/01/01 23:01:40 tom Exp $
  *
  *     curses.priv.h
  *
  *
  *     curses.priv.h
  *
@@ -1505,7 +1505,9 @@ extern NCURSES_EXPORT(void)       _nc_locked_tracef (const char *, ...) GCC_PRINTFLIKE
 
 #define TR(n, a)       if (USE_TRACEF(n)) _nc_locked_tracef a
 #define T(a)           TR(TRACE_CALLS, a)
 
 #define TR(n, a)       if (USE_TRACEF(n)) _nc_locked_tracef a
 #define T(a)           TR(TRACE_CALLS, a)
-#define TRACE_RETURN(value,type) return _nc_retrace_##type(value)
+#define TRACE_RETURN(value,type)     return _nc_retrace_##type(value)
+#define TRACE_RETURN2(value,dst,src) return _nc_retrace_##dst##_##src(value)
+#define TRACE_RETURN_SP(value,type)  return _nc_retrace_##type(SP_PARM, value)
 
 #define NonNull(s)     ((s) != 0 ? s : "<null>")
 
 
 #define NonNull(s)     ((s) != 0 ? s : "<null>")
 
@@ -1517,6 +1519,8 @@ extern NCURSES_EXPORT(void)       _nc_locked_tracef (const char *, ...) GCC_PRINTFLIKE
 #define returnChar(code)       TRACE_RETURN(code,char)
 #define returnChtype(code)     TRACE_RETURN(code,chtype)
 #define returnCode(code)       TRACE_RETURN(code,int)
 #define returnChar(code)       TRACE_RETURN(code,char)
 #define returnChtype(code)     TRACE_RETURN(code,chtype)
 #define returnCode(code)       TRACE_RETURN(code,int)
+#define returnIntAttr(code)    TRACE_RETURN2(code,int,attr_t)
+#define returnMMask(code)      TRACE_RETURN_SP(code,mmask_t)
 #define returnPtr(code)                TRACE_RETURN(code,ptr)
 #define returnSP(code)         TRACE_RETURN(code,sp)
 #define returnVoid             T((T_RETURN(""))); return
 #define returnPtr(code)                TRACE_RETURN(code,ptr)
 #define returnSP(code)         TRACE_RETURN(code,sp)
 #define returnVoid             T((T_RETURN(""))); return
@@ -1536,6 +1540,8 @@ extern NCURSES_EXPORT(const char *)     _nc_altcharset_name(attr_t, chtype);
 extern NCURSES_EXPORT(const char *)     _nc_retrace_cptr (const char *);
 extern NCURSES_EXPORT(char)             _nc_retrace_char (char);
 extern NCURSES_EXPORT(int)              _nc_retrace_int (int);
 extern NCURSES_EXPORT(const char *)     _nc_retrace_cptr (const char *);
 extern NCURSES_EXPORT(char)             _nc_retrace_char (char);
 extern NCURSES_EXPORT(int)              _nc_retrace_int (int);
+extern NCURSES_EXPORT(int)              _nc_retrace_int_attr_t (attr_t);
+extern NCURSES_EXPORT(mmask_t)          _nc_retrace_mmask_t (SCREEN *, mmask_t);
 extern NCURSES_EXPORT(unsigned)         _nc_retrace_unsigned (unsigned);
 extern NCURSES_EXPORT(void *)           _nc_retrace_void_ptr (void *);
 extern NCURSES_EXPORT(void)             _nc_fifo_dump (SCREEN *);
 extern NCURSES_EXPORT(unsigned)         _nc_retrace_unsigned (unsigned);
 extern NCURSES_EXPORT(void *)           _nc_retrace_void_ptr (void *);
 extern NCURSES_EXPORT(void)             _nc_fifo_dump (SCREEN *);
@@ -1578,6 +1584,8 @@ extern NCURSES_EXPORT(const char *) _nc_viscbuf (const NCURSES_CH_T *, int);
 #define returnChar(code)       return ((char) code)
 #define returnChtype(code)     return code
 #define returnCode(code)       return code
 #define returnChar(code)       return ((char) code)
 #define returnChtype(code)     return code
 #define returnCode(code)       return code
+#define returnIntAttr(code)    return code
+#define returnMMask(code)      return code
 #define returnPtr(code)                return code
 #define returnSP(code)         return code
 #define returnVoid             return
 #define returnPtr(code)                return code
 #define returnSP(code)         return code
 #define returnVoid             return
index 0f2c681e7b8f007e4a150f342223da99667183ce..86147c1d6d2b64e494d46068751b683c1ad0444a 100644 (file)
@@ -43,7 +43,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_traceatr.c,v 1.72 2010/12/19 00:51:35 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.73 2011/01/01 22:01:11 tom Exp $")
 
 #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name))
 
 
 #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name))
 
@@ -176,6 +176,14 @@ _traceattr(attr_t newmode)
 }
 
 /* Trace 'int' return-values */
 }
 
 /* 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)
 {
 NCURSES_EXPORT(attr_t)
 _nc_retrace_attr_t(attr_t code)
 {
index cf7539e80135047edcb6c6abfac45625e3c6a2ab..aa74fb1f3a48acb2f83a586bb6be9ecc430ee485 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2010 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            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_tracemse.c,v 1.16 2008/11/16 00:19:59 juergen Exp $")
+MODULE_ID("$Id: lib_tracemse.c,v 1.17 2011/01/01 22:31:53 tom Exp $")
 
 #ifdef TRACE
 
 #define my_buffer sp->tracemse_buf
 
 
 #ifdef TRACE
 
 #define my_buffer sp->tracemse_buf
 
-NCURSES_EXPORT(char *)
-_nc_tracemouse(SCREEN *sp, MEVENT const *ep)
+static char *
+_trace_mmask_t(SCREEN *sp, mmask_t code)
 {
 {
-    (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), ", ")
+#define SHOW(m, s) if ((code & m) == m) strcat(strcat(my_buffer, s), ", ")
 
     SHOW(BUTTON1_RELEASED, "release-1");
     SHOW(BUTTON1_PRESSED, "press-1");
 
     SHOW(BUTTON1_RELEASED, "release-1");
     SHOW(BUTTON1_PRESSED, "press-1");
@@ -110,10 +103,33 @@ _nc_tracemouse(SCREEN *sp, MEVENT const *ep)
 
     if (my_buffer[strlen(my_buffer) - 1] == ' ')
        my_buffer[strlen(my_buffer) - 2] = '\0';
 
     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);
 }
 
     (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)
 {
 NCURSES_EXPORT(char *)
 _tracemouse(MEVENT const *ep)
 {