ncurses 5.9 - patch 20110820
[ncurses.git] / include / curses.h.in
index e67c3f251e42565b0691515fe2db2a1dc60ccedd..c49422b188092c65c87f8c695df6fac80f93cc8d 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.224 2011/06/06 08:44:06 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) \
-                                         : 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) \
-                                         : 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 */