]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - include/curses.h.in
ncurses 5.9 - patch 20111022
[ncurses.git] / include / curses.h.in
index 7a820a1652827d22ea93918b9fca592909e28ce5..c49422b188092c65c87f8c695df6fac80f93cc8d 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.223 2011/05/28 21:38:30 tom Exp $ */
+/* $Id: curses.h.in,v 1.225 2011/08/20 16:09:38 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
@@ -1269,20 +1269,16 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);   /*
                                             (win)->_color = (p)) \
                                          : OK), \
                                         OK)
-#define wattr_get(win,a,p,opts)                (((win) \
-                                         ? ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
-                                            (void)((p) != (void *)0 && (*(p) = (short)(win)->_color))) \
-                                         : OK), \
+#define wattr_get(win,a,p,opts)                ((void)(((a) != (void *)0) ? (*(a) = (win) ? (win)->_attrs : 0) : OK), \
+                                        (void)(((p) != (void *)0) ? (*(p) = (win) ? (short)(win)->_color : 0) : OK), \
                                         OK)
 #else
 #define wattr_set(win,a,p,opts)                (((win) \
                                          ? ((win)->_attrs = (((a) & ~A_COLOR) | (attr_t)COLOR_PAIR(p))) \
                                          : OK), \
                                         OK)
-#define wattr_get(win,a,p,opts)                (((win) \
-                                         ? ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \
-                                            (void)((p) != (void *)0 && (*(p) = (short)PAIR_NUMBER((win)->_attrs)))) \
-                                         : OK), \
+#define wattr_get(win,a,p,opts)                ((void)(((a) != (void *)0) ? (*(a) = (win) ? (win)->_attrs : 0) : OK), \
+                                        (void)(((p) != (void *)0) ? (*(p) = (win) ? (short)PAIR_NUMBER((win)->_attrs) : 0) : OK), \
                                         OK)
 #endif
 #endif /* NCURSES_OPAQUE */