]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.9 - patch 20140201
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 2 Feb 2014 00:11:40 +0000 (00:11 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 2 Feb 2014 00:11:40 +0000 (00:11 +0000)
+ add/use symbol NCURSES_PAIRS_T like NCURSES_COLOR_T, to illustrate
  which "short" types are for color pairs and which are color values.
+ fix build for s390x, by correcting field bit offsets in generated
  representation clauses when int=32 long=64 and endian=big, or at
  least on s390x (patch by Nicolas Boulenguez).
+ minor cleanup change to test/form_driver_w.c (patch by Gaute Hope).

30 files changed:
Ada95/gen/gen.c
NEWS
c++/cursesw.cc
c++/cursesw.h
dist.mk
include/curses.h.in
include/curses.wide
ncurses/base/lib_chgat.c
ncurses/base/lib_color.c
ncurses/base/lib_colorset.c
ncurses/base/lib_instr.c
ncurses/base/lib_slkatr_set.c
ncurses/base/lib_slkcolor.c
ncurses/curses.priv.h
ncurses/trace/lib_traceatr.c
ncurses/tty/tty_update.c
ncurses/widechar/lib_cchar.c
ncurses/widechar/lib_vid_attr.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
progs/infocmp.c
test/background.c
test/color_set.c
test/form_driver_w.c
test/ncurses.c
test/test.priv.h

index 7595672e57b46ee18abfbd2b8025ca861c900763..082315b6ceee042fa397139dd19550687d626e90 100644 (file)
@@ -32,7 +32,7 @@
 
 /*
     Version Control
-    $Id: gen.c,v 1.62 2014/01/26 00:21:52 Nicolas.Boulenguez Exp $
+    $Id: gen.c,v 1.64 2014/02/01 19:52:47 tom Exp $
   --------------------------------------------------------------------------*/
 /*
   This program generates various record structures and constants from the
 #include <menu.h>
 #include <form.h>
 
-#define UChar(c)       ((unsigned char)(c))
+#undef UCHAR
+#undef UINT
+#define UChar(c)       ((UCHAR)(c))
 #define RES_NAME "Reserved"
 
+typedef unsigned char UCHAR;
+typedef unsigned int UINT;
+
 static const char *model = "";
 static int little_endian = 0;
 
@@ -70,45 +75,43 @@ typedef struct
   }
 name_attribute_pair;
 
+static UCHAR
+bit_is_set(const UCHAR * const data,
+          const UINT offset)
+{
+  const UCHAR byte = data[offset >> 3];
+  UINT bit;
+
+  if (little_endian)
+    bit = offset;              /* offset */
+  else                         /* or */
+    bit = ~offset;             /* 7 - offset */
+  bit &= 7;                    /* modulo 8 */
+  return byte & (UCHAR) (1 << bit);
+}
+
+/* Find lowest and highest used offset in a byte array. */
+/* Returns 0 if and only if all bits are unset. */
 static int
-find_pos(char *s, unsigned len, int *low, int *high)
+find_pos(const UCHAR * const data,
+        const UINT sizeof_data,
+        UINT * const low,
+        UINT * const high)
 {
-  unsigned int i, j;
-  int l = 0;
+  const UINT last = (sizeof_data << 3) - 1;
+  UINT offset;
 
-  *high = -1;
-  *low = (int)(8 * len);
+  for (offset = last; !bit_is_set(data, offset); offset--)
+    if (!offset)               /* All bits are 0. */
+      return 0;
+  *high = offset;
 
-  for (i = 0; i < len; i++, s++)
+  for (offset = 0; !bit_is_set(data, offset); offset++)
     {
-      if (*s)
-       {
-         for (j = 0; j < 8 * sizeof(char); j++)
-
-           {
-             if (((little_endian && ((*s) & 0x01)) ||
-                  (!little_endian && ((*s) & 0x80))))
-               {
-                 if (l > *high)
-                   *high = l;
-                 if (l < *low)
-                   *low = l;
-               }
-             l++;
-             if (little_endian)
-               {
-                 *s >>= 1;
-               }
-             else
-               {
-                 *s = (char)(*s << 1);
-               }
-           }
-       }
-      else
-       l += 8;
     }
-  return (*high >= 0 && (*low <= *high)) ? *low : -1;
+  *low = offset;
+
+  return -1;
 }
 
 /*
@@ -122,13 +125,13 @@ static void
 gen_reps(
          const name_attribute_pair * nap,      /* array of name_attribute_pair records */
          const char *name,     /* name of the represented record type  */
-         int len,              /* size of the record in bytes          */
-         int bias)
+         const UINT len,       /* size of the record in bytes          */
+         const UINT bias)
 {
-  const int len_bits = (8 * len);
-  int i, l, low, high;
+  const UINT len_bits = len << 3;
+  int i, l;
+  UINT low, high;
   int width = strlen(RES_NAME) + 3;
-  unsigned long a;
 
   assert(nap != NULL);
 
@@ -157,11 +160,9 @@ gen_reps(
   for (i = 0; nap[i].name != (char *)0; i++)
     if (nap[i].attr)
       {
-       a = nap[i].attr;
-       l = find_pos((char *)&a, sizeof(a), &low, &high);
-       if (l >= 0)
+       if (find_pos((const UCHAR *)(&(nap[i].attr)) + bias, len, &low, &high))
          printf("         %-*s at 0 range %2d .. %2d;\n", width, nap[i].name,
-                low - bias, high - bias);
+                low, high);
       }
   printf("      end record;\n");
   printf("   pragma Warnings (Off);");
@@ -176,10 +177,9 @@ chtype_rep(const char *name, attr_t mask)
 {
   attr_t x = (attr_t)-1;
   attr_t t = x & mask;
-  int low, high;
-  int l = find_pos((char *)&t, sizeof(t), &low, &high);
+  UINT low, high;
 
-  if (l >= 0)
+  if (find_pos((const UCHAR *)(&t), sizeof(t), &low, &high))
     printf("         %-5s at 0 range %2d .. %2d;\n", name, low, high);
 }
 
@@ -200,10 +200,9 @@ gen_chtype_rep(const char *name)
 static void
 mrep_rep(const char *name, void *rec)
 {
-  int low, high;
-  int l = find_pos((char *)rec, sizeof(MEVENT), &low, &high);
+  UINT low, high;
 
-  if (l >= 0)
+  if (find_pos((const UCHAR *)rec, sizeof(MEVENT), &low, &high))
     printf("         %-7s at 0 range %3d .. %3d;\n", name, low, high);
 }
 
@@ -289,7 +288,9 @@ gen_attr_set(const char *name)
        }
       attr = attr >> 1;
     }
-  gen_reps(nap, name, (len + 7) / 8, little_endian ? start : 0);
+  gen_reps(nap, name,
+          (UINT) ((len + 7) / 8),
+          (UINT) (little_endian ? start >> 3 : 0));
 }
 
 static void
@@ -312,7 +313,9 @@ gen_trace(const char *name)
     {"Attributes_And_Colors", TRACE_ATTRS},
     {(char *)0, 0}
   };
-  gen_reps(nap, name, sizeof(int), 0);
+
+  gen_reps(nap, name, sizeof(UINT),
+          little_endian ? 0 : sizeof(nap[0].attr) - sizeof(UINT));
 }
 
 static void
@@ -340,7 +343,9 @@ gen_menu_opt_rep(const char *name)
 #endif
     {(char *)0, 0}
   };
-  gen_reps(nap, name, sizeof(int), 0);
+
+  gen_reps(nap, name, sizeof(Menu_Options),
+          little_endian ? 0 : sizeof(nap[0].attr) - sizeof(Menu_Options));
 }
 
 static void
@@ -353,7 +358,9 @@ gen_item_opt_rep(const char *name)
 #endif
     {(char *)0, 0}
   };
-  gen_reps(nap, name, sizeof(int), 0);
+
+  gen_reps(nap, name, sizeof(Item_Options),
+          little_endian ? 0 : sizeof(nap[0].attr) - sizeof(Item_Options));
 }
 
 static void
@@ -369,7 +376,9 @@ gen_form_opt_rep(const char *name)
 #endif
     {(char *)0, 0}
   };
-  gen_reps(nap, name, sizeof(int), 0);
+
+  gen_reps(nap, name, sizeof(Form_Options),
+          little_endian ? 0 : sizeof(nap[0].attr) - sizeof(Form_Options));
 }
 
 /*
@@ -412,7 +421,9 @@ gen_field_opt_rep(const char *name)
 #endif
     {(char *)0, 0}
   };
-  gen_reps(nap, name, sizeof(int), 0);
+
+  gen_reps(nap, name, sizeof(Field_Options),
+          little_endian ? 0 : sizeof(nap[0].attr) - sizeof(Field_Options));
 }
 
 /*
diff --git a/NEWS b/NEWS
index eb4c0bf3bf6b442ff268d49ab9812c61eebeed4c..f3d12bb221bfefbcb64c4eaa3f729ee2954518ae 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.2157 2014/01/26 00:20:39 tom Exp $
+-- $Id: NEWS,v 1.2161 2014/02/01 22:30:45 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,14 @@ 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.
 
+20140201
+       + add/use symbol NCURSES_PAIRS_T like NCURSES_COLOR_T, to illustrate
+         which "short" types are for color pairs and which are color values.
+       + fix build for s390x, by correcting field bit offsets in generated
+         representation clauses when int=32 long=64 and endian=big, or at
+         least on s390x (patch by Nicolas Boulenguez).
+       + minor cleanup change to test/form_driver_w.c (patch by Gaute Hope).
+
 20140125
        + remove unnecessary ifdef's in Ada95/gen/gen.c, which reportedly do
          not work as is with gcc 4.8 due to fixes using chtype cast made for
index adbcf6e71ef053f350051a68c54aa8ccbffc867a..16438770d47aaf178a92b0d52ddbb956efb7d407 100644 (file)
@@ -1,6 +1,6 @@
 // * this is for making emacs happy: -*-Mode: C++;-*-
 /****************************************************************************
- * Copyright (c) 2007-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 2007-2012,2014 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,7 +42,7 @@
 #include "internal.h"
 #include "cursesw.h"
 
-MODULE_ID("$Id: cursesw.cc,v 1.53 2012/12/08 22:06:41 tom Exp $")
+MODULE_ID("$Id: cursesw.cc,v 1.54 2014/02/01 22:10:42 tom Exp $")
 
 #define COLORS_NEED_INITIALIZATION  -1
 #define COLORS_NOT_INITIALIZED       0
@@ -401,16 +401,16 @@ NCursesWindow::useColors(void)
     }
 }
 
-short
+NCURSES_PAIRS_T
 NCursesWindow::getPair() const
 {
-    return static_cast<short>(PAIR_NUMBER(getattrs(w)));
+    return static_cast<NCURSES_PAIRS_T>(PAIR_NUMBER(getattrs(w)));
 }
 
-short
+NCURSES_COLOR_T
 NCursesWindow::getcolor(int getback) const
 {
-    short fore, back;
+    NCURSES_COLOR_T fore, back;
 
     if (HaveColors()) {
        if (::pair_content(getPair(), &fore, &back) == ERR)
@@ -428,27 +428,27 @@ int NCursesWindow::NumberOfColors()
     return (HaveColors()) ? COLORS : 1;
 }
 
-short
+NCURSES_PAIRS_T
 NCursesWindow::getcolor() const
 {
     return (HaveColors()) ? getPair() : 0;
 }
 
 int
-NCursesWindow::setpalette(short fore, short back, short pair)
+NCursesWindow::setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back, NCURSES_PAIRS_T pair)
 {
     return (HaveColors()) ? ::init_pair(pair, fore, back) : OK;
 }
 
 int
-NCursesWindow::setpalette(short fore, short back)
+NCursesWindow::setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back)
 {
     return setpalette(fore, back, getPair());
 }
 
 
 int
-NCursesWindow::setcolor(short pair)
+NCursesWindow::setcolor(NCURSES_PAIRS_T pair)
 {
     if (HaveColors()) {
        if ((pair < 1) || (pair > COLOR_PAIRS))
index 4472ea9ca13ac8c17f35f7bc3366b58d8bd0e917..ca07b04237f5631fbe6d314f49a71638606f154d 100644 (file)
@@ -1,7 +1,7 @@
 // * This makes emacs happy -*-Mode: C++;-*-
 // vile:cppmode
 /****************************************************************************
- * Copyright (c) 1998-2008,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2014 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            *
@@ -31,7 +31,7 @@
 #ifndef NCURSES_CURSESW_H_incl
 #define NCURSES_CURSESW_H_incl 1
 
-// $Id: cursesw.h,v 1.49 2011/09/17 22:12:10 tom Exp $
+// $Id: cursesw.h,v 1.50 2014/02/01 22:17:37 tom Exp $
 
 #include <etip.h>
 
@@ -118,7 +118,7 @@ inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); }
 #endif
 
 #ifdef chgat
-inline int UNDEF(chgat)(int n, attr_t attr, short color, const void *opts) {
+inline int UNDEF(chgat)(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts) {
   return chgat(n, attr, color, opts); }
 #undef chgat
 #define chgat UNDEF(chgat)
@@ -151,7 +151,7 @@ inline int UNDEF(clrtoeol)()  { return clrtoeol(); }
 #endif
 
 #ifdef color_set
-inline chtype UNDEF(color_set)(short p, void* opts) { return color_set(p, opts); }
+inline chtype UNDEF(color_set)(NCURSES_PAIRS_T p, void* opts) { return color_set(p, opts); }
 #undef color_set
 #define color_set UNDEF(color_set)
 #endif
@@ -361,7 +361,7 @@ inline int UNDEF(mvaddstr)(int y, int x, const char * str)
 
 #ifdef mvchgat
 inline int UNDEF(mvchgat)(int y, int x, int n,
-                         attr_t attr, short color, const void *opts) {
+                         attr_t attr, NCURSES_PAIRS_T color, const void *opts) {
   return mvchgat(y, x, n, attr, color, opts); }
 #undef mvchgat
 #define mvchgat UNDEF(mvchgat)
@@ -463,7 +463,7 @@ inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str)
 
 #ifdef mvwchgat
 inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n,
-                          attr_t attr, short color, const void *opts) {
+                          attr_t attr, NCURSES_PAIRS_T color, const void *opts) {
   return mvwchgat(win, y, x, n, attr, color, opts); }
 #undef mvwchgat
 #define mvwchgat UNDEF(mvwchgat)
@@ -763,10 +763,10 @@ private:
 
   void           set_keyboard();
 
-  short          getcolor(int getback) const;
-  short          getPair() const;
+  NCURSES_COLOR_T getcolor(int getback) const;
+  NCURSES_PAIRS_T getPair() const;
 
-  static int     setpalette(short fore, short back, short pair);
+  static int     setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back, NCURSES_PAIRS_T pair);
   static int     colorInitialized;
 
   // This private constructor is only used during the initialization
@@ -896,19 +896,19 @@ public:
   int            maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; }
   // Largest y coord in window
 
-  short          getcolor() const;
+  NCURSES_PAIRS_T getcolor() const;
   // Actual color pair
 
-  short          foreground() const { return getcolor(0); }
+  NCURSES_COLOR_T foreground() const { return getcolor(0); }
   // Actual foreground color
 
-  short          background() const { return getcolor(1); }
+  NCURSES_COLOR_T background() const { return getcolor(1); }
   // Actual background color
 
-  int            setpalette(short fore, short back);
+  int            setpalette(NCURSES_COLOR_T fore, NCURSES_COLOR_T back);
   // Set color palette entry
 
-  int            setcolor(short pair);
+  int            setcolor(NCURSES_PAIRS_T pair);
   // Set actually used palette entry
 
   // -------------------------------------------------------------------------
@@ -1107,18 +1107,18 @@ public:
   chtype         attrget() { return ::getattrs(w); }
   // Get the window attributes;
 
-  int            color_set(short color_pair_number, void* opts=NULL) {
+  int            color_set(NCURSES_PAIRS_T color_pair_number, void* opts=NULL) {
     return ::wcolor_set(w, color_pair_number, opts); }
   // Set the window color attribute;
 
-  int            chgat(int n, attr_t attr, short color, const void *opts=NULL) {
+  int            chgat(int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) {
     return ::wchgat(w, n, attr, color, opts); }
   // Change the attributes of the next n characters in the current line. If
   // n is negative or greater than the number of remaining characters in the
   // line, the attributes will be changed up to the end of the line.
 
   int            chgat(int y, int x,
-                      int n, attr_t attr, short color, const void *opts=NULL) {
+                      int n, attr_t attr, NCURSES_PAIRS_T color, const void *opts=NULL) {
     return ::mvwchgat(w, y, x, n, attr, color, opts); }
   // Move the cursor to the requested position and then perform chgat() as
   // described above.
diff --git a/dist.mk b/dist.mk
index 3fbdae0aa0ec0618277a5a20a497ddafdbf53219..a4bdc3f282301ee98f8e1c86394f22b3f6abd97b 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.968 2014/01/25 16:16:43 tom Exp $
+# $Id: dist.mk,v 1.969 2014/02/01 17:10:27 tom Exp $
 # 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 = 9
-NCURSES_PATCH = 20140125
+NCURSES_PATCH = 20140201
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 62dcb75c805490df8b7d8a604401ef6986d148c2..15c9f7f24375f1cb7b162602297579346073289a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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            *
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.236 2013/09/07 19:07:23 tom Exp $ */
+/* $Id: curses.h.in,v 1.237 2014/02/01 22:08:12 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
 #define NCURSES_INLINE @NCURSES_INLINE@
 
 /*
- * The internal type used for color values
+ * The internal type used for color values, and for color-pairs.  The latter
+ * allows the curses library to enumerate the combinations of foreground and
+ * background colors used by an application, and is normally the product of the
+ * total foreground and background colors.
+ *
+ * X/Open uses "short" for both of these types, ultimately because they are
+ * numbers from the terminal database, which uses 16-bit signed values.
  */
 #undef NCURSES_COLOR_T
 #define        NCURSES_COLOR_T short
 
+#undef NCURSES_PAIRS_T
+#define        NCURSES_PAIRS_T short
+
 /*
  * Definition used to make WINDOW and similar structs opaque.
  */
@@ -573,10 +582,10 @@ extern NCURSES_EXPORT(int) addstr (const char *);                 /* generated */
 extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T);                   /* generated */
 extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T);                    /* generated */
 extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T);                   /* generated */
-extern NCURSES_EXPORT(int) attr_get (attr_t *, short *, void *);       /* generated */
+extern NCURSES_EXPORT(int) attr_get (attr_t *, NCURSES_PAIRS_T *, void *);     /* generated */
 extern NCURSES_EXPORT(int) attr_off (attr_t, void *);                  /* generated */
 extern NCURSES_EXPORT(int) attr_on (attr_t, void *);                   /* generated */
-extern NCURSES_EXPORT(int) attr_set (attr_t, short, void *);           /* generated */
+extern NCURSES_EXPORT(int) attr_set (attr_t, NCURSES_PAIRS_T, void *);         /* generated */
 extern NCURSES_EXPORT(int) baudrate (void);                            /* implemented */
 extern NCURSES_EXPORT(int) beep  (void);                               /* implemented */
 extern NCURSES_EXPORT(int) bkgd (chtype);                              /* generated */
@@ -585,13 +594,13 @@ extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,cht
 extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype);             /* generated */
 extern NCURSES_EXPORT(bool) can_change_color (void);                   /* implemented */
 extern NCURSES_EXPORT(int) cbreak (void);                              /* implemented */
-extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *);   /* generated */
+extern NCURSES_EXPORT(int) chgat (int, attr_t, NCURSES_PAIRS_T, const void *); /* generated */
 extern NCURSES_EXPORT(int) clear (void);                               /* generated */
 extern NCURSES_EXPORT(int) clearok (WINDOW *,bool);                    /* implemented */
 extern NCURSES_EXPORT(int) clrtobot (void);                            /* generated */
 extern NCURSES_EXPORT(int) clrtoeol (void);                            /* generated */
-extern NCURSES_EXPORT(int) color_content (short,short*,short*,short*); /* implemented */
-extern NCURSES_EXPORT(int) color_set (short,void*);                    /* generated */
+extern NCURSES_EXPORT(int) color_content (NCURSES_COLOR_T,NCURSES_COLOR_T*,NCURSES_COLOR_T*,NCURSES_COLOR_T*); /* implemented */
+extern NCURSES_EXPORT(int) color_set (NCURSES_PAIRS_T,void*);                  /* generated */
 extern NCURSES_EXPORT(int) COLOR_PAIR (int);                           /* generated */
 extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int);        /* implemented */
 extern NCURSES_EXPORT(int) curs_set (int);                             /* implemented */
@@ -630,8 +639,8 @@ extern NCURSES_EXPORT(chtype) inch (void);                          /* generated */
 extern NCURSES_EXPORT(int) inchnstr (chtype *, int);                   /* generated */
 extern NCURSES_EXPORT(int) inchstr (chtype *);                         /* generated */
 extern NCURSES_EXPORT(WINDOW *) initscr (void);                                /* implemented */
-extern NCURSES_EXPORT(int) init_color (short,short,short,short);       /* implemented */
-extern NCURSES_EXPORT(int) init_pair (short,short,short);              /* implemented */
+extern NCURSES_EXPORT(int) init_color (NCURSES_COLOR_T,NCURSES_COLOR_T,NCURSES_COLOR_T,NCURSES_COLOR_T);       /* implemented */
+extern NCURSES_EXPORT(int) init_pair (NCURSES_PAIRS_T,NCURSES_COLOR_T,NCURSES_COLOR_T);                /* implemented */
 extern NCURSES_EXPORT(int) innstr (char *, int);                       /* generated */
 extern NCURSES_EXPORT(int) insch (chtype);                             /* generated */
 extern NCURSES_EXPORT(int) insdelln (int);                             /* generated */
@@ -655,7 +664,7 @@ extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int);     /* gener
 extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *);      /* generated */
 extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int);    /* generated */
 extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *);          /* generated */
-extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *);       /* generated */
+extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, NCURSES_PAIRS_T, const void *);     /* generated */
 extern NCURSES_EXPORT(int) mvcur (int,int,int,int);                    /* implemented */
 extern NCURSES_EXPORT(int) mvdelch (int, int);                         /* generated */
 extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int);              /* implemented */
@@ -681,7 +690,7 @@ extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int
 extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *);   /* generated */
 extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int); /* generated */
 extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *);       /* generated */
-extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */
+extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, NCURSES_PAIRS_T, const void *);/* generated */
 extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int);              /* generated */
 extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int);              /* generated */
 extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int);       /* generated */
@@ -715,7 +724,7 @@ extern NCURSES_EXPORT(int) noraw (void);                            /* implemented */
 extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool);                  /* implemented */
 extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *);           /* implemented */
 extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *);         /* implemented */
-extern NCURSES_EXPORT(int) pair_content (short,short*,short*);         /* implemented */
+extern NCURSES_EXPORT(int) pair_content (NCURSES_PAIRS_T,NCURSES_COLOR_T*,NCURSES_COLOR_T*);           /* implemented */
 extern NCURSES_EXPORT(int) PAIR_NUMBER (int);                          /* generated */
 extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype);         /* implemented */
 extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */
@@ -749,9 +758,9 @@ extern NCURSES_EXPORT(int) slk_attron (const chtype);                       /* implemented */
 extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*);                 /* generated:WIDEC */
 extern NCURSES_EXPORT(int) slk_attrset (const chtype);                 /* implemented */
 extern NCURSES_EXPORT(attr_t) slk_attr (void);                         /* implemented */
-extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,short,void*);    /* implemented */
+extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,NCURSES_PAIRS_T,void*);  /* implemented */
 extern NCURSES_EXPORT(int) slk_clear (void);                           /* implemented */
-extern NCURSES_EXPORT(int) slk_color (short);                          /* implemented */
+extern NCURSES_EXPORT(int) slk_color (NCURSES_PAIRS_T);                                /* implemented */
 extern NCURSES_EXPORT(int) slk_init (int);                             /* implemented */
 extern NCURSES_EXPORT(char *) slk_label (int);                         /* implemented */
 extern NCURSES_EXPORT(int) slk_noutrefresh (void);                     /* implemented */
@@ -790,18 +799,18 @@ extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *);               /* generated */
 extern NCURSES_EXPORT(int) wattron (WINDOW *, int);                    /* generated */
 extern NCURSES_EXPORT(int) wattroff (WINDOW *, int);                   /* generated */
 extern NCURSES_EXPORT(int) wattrset (WINDOW *, int);                   /* generated */
-extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, short *, void *);    /* generated */
+extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, NCURSES_PAIRS_T *, void *);  /* generated */
 extern NCURSES_EXPORT(int) wattr_on (WINDOW *, attr_t, void *);                /* implemented */
 extern NCURSES_EXPORT(int) wattr_off (WINDOW *, attr_t, void *);       /* implemented */
-extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *);        /* generated */
+extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, NCURSES_PAIRS_T, void *);      /* generated */
 extern NCURSES_EXPORT(int) wbkgd (WINDOW *, chtype);                   /* implemented */
 extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype);                        /* implemented */
 extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */
-extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */
+extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, NCURSES_PAIRS_T, const void *);/* implemented */
 extern NCURSES_EXPORT(int) wclear (WINDOW *);                          /* implemented */
 extern NCURSES_EXPORT(int) wclrtobot (WINDOW *);                       /* implemented */
 extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *);                       /* implemented */
-extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,short,void*);           /* implemented */
+extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,NCURSES_PAIRS_T,void*);         /* implemented */
 extern NCURSES_EXPORT(void) wcursyncup (WINDOW *);                     /* implemented */
 extern NCURSES_EXPORT(int) wdelch (WINDOW *);                          /* implemented */
 extern NCURSES_EXPORT(int) wdeleteln (WINDOW *);                       /* generated */
@@ -947,7 +956,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(beep) (SCREEN*); /* implemented:SP_FU
 extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(cbreak) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (SCREEN*, int); /* implemented:SP_FUNC */
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, short, short*, short*, short*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T*, NCURSES_COLOR_T*, NCURSES_COLOR_T*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_shell_mode) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (SCREEN*, int); /* implemented:SP_FUNC */
@@ -963,8 +972,8 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (SCREEN*, int); /* impleme
 extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (SCREEN*); /* implemented:SP_FUNC */
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, short, short, short, short); /* implemented:SP_FUNC */
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, short, short, short); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, NCURSES_COLOR_T, NCURSES_COLOR_T, NCURSES_COLOR_T, NCURSES_COLOR_T); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T, NCURSES_COLOR_T); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(intrflush) (SCREEN*, WINDOW*, bool);        /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(isendwin) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(keyname) (SCREEN*, int); /* implemented:SP_FUNC */
@@ -981,7 +990,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (SCREEN*); /* implemented:SP_
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(void) NCURSES_SP_NAME(noqiflush) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noraw) (SCREEN*); /* implemented:SP_FUNC */
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, short, short*, short*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, NCURSES_PAIRS_T, NCURSES_COLOR_T*, NCURSES_COLOR_T*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(void) NCURSES_SP_NAME(qiflush) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(raw) (SCREEN*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_prog_mode) (SCREEN*); /* implemented:SP_FUNC */
@@ -996,9 +1005,9 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attroff) (SCREEN*, const chtype);
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attron) (SCREEN*, const chtype); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attrset) (SCREEN*, const chtype); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (SCREEN*); /* implemented:SP_FUNC */
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, short, void*); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, NCURSES_PAIRS_T, void*); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_clear) (SCREEN*); /* implemented:SP_FUNC */
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, short); /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, NCURSES_PAIRS_T); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_init) (SCREEN*, int); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(slk_label) (SCREEN*, int); /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_noutrefresh) (SCREEN*); /* implemented:SP_FUNC */
@@ -1293,7 +1302,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);     /*
                                          : OK), \
                                         OK)
 #define wattr_get(win,a,p,opts)                ((void)(((a) != (void *)0) ? (*(a) = (win) ? (win)->_attrs : 0) : OK), \
-                                        (void)(((p) != (void *)0) ? (*(p) = (short) ((win) ? (win)->_color : 0)) : OK), \
+                                        (void)(((p) != (void *)0) ? (*(p) = (NCURSES_PAIRS_T) ((win) ? (win)->_color : 0)) : OK), \
                                         OK)
 #else
 #define wattr_set(win,a,p,opts)                (((win) \
@@ -1301,7 +1310,7 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);     /*
                                          : OK), \
                                         OK)
 #define wattr_get(win,a,p,opts)                ((void)(((a) != (void *)0) ? (*(a) = (win) ? (win)->_attrs : 0) : OK), \
-                                        (void)(((p) != (void *)0) ? (*(p) = (short) ((win) ? PAIR_NUMBER((win)->_attrs) : 0)) : OK), \
+                                        (void)(((p) != (void *)0) ? (*(p) = (NCURSES_PAIRS_T) ((win) ? PAIR_NUMBER((win)->_attrs) : 0)) : OK), \
                                         OK)
 #endif
 #endif /* NCURSES_OPAQUE */
index cb76e2c2076870c65654e591a76be9d77731f070..5d130a962284307ee3b2a3c524fa5fee7828d299 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: curses.wide,v 1.45 2012/07/28 18:10:02 tom Exp $ */
+/* $Id: curses.wide,v 1.46 2014/02/01 22:00:32 tom Exp $ */
 /*
  * vile:cmode:
  * This file is part of ncurses, designed to be appended after curses.h.in
@@ -135,7 +135,7 @@ extern NCURSES_EXPORT(int) erasewchar (wchar_t*);                   /* implemented */
 extern NCURSES_EXPORT(int) get_wch (wint_t *);                         /* generated:WIDEC */
 extern NCURSES_EXPORT(int) get_wstr (wint_t *);                                /* generated:WIDEC */
 extern NCURSES_EXPORT(int) getbkgrnd (cchar_t *);                      /* generated:WIDEC */
-extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, short*, void*);       /* implemented */
+extern NCURSES_EXPORT(int) getcchar (const cchar_t *, wchar_t*, attr_t*, NCURSES_PAIRS_T*, void*);     /* implemented */
 extern NCURSES_EXPORT(int) getn_wstr (wint_t *, int);                  /* generated:WIDEC */
 extern NCURSES_EXPORT(int) hline_set (const cchar_t *, int);           /* generated:WIDEC */
 extern NCURSES_EXPORT(int) in_wch (cchar_t *);                         /* generated:WIDEC */
@@ -185,12 +185,12 @@ extern NCURSES_EXPORT(int) mvwins_wstr (WINDOW *, int, int, const wchar_t *);     /*
 extern NCURSES_EXPORT(int) mvwinwstr (WINDOW *, int, int, wchar_t *);          /* generated:WIDEC */
 extern NCURSES_EXPORT(int) mvwvline_set (WINDOW *, int,int, const cchar_t *,int); /* generated:WIDEC */
 extern NCURSES_EXPORT(int) pecho_wchar (WINDOW *, const cchar_t *);    /* implemented */
-extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, short, const void *);   /* implemented */
+extern NCURSES_EXPORT(int) setcchar (cchar_t *, const wchar_t *, const attr_t, NCURSES_PAIRS_T, const void *); /* implemented */
 extern NCURSES_EXPORT(int) slk_wset (int, const wchar_t *, int);       /* implemented */
 extern NCURSES_EXPORT(attr_t) term_attrs (void);                       /* implemented */
 extern NCURSES_EXPORT(int) unget_wch (const wchar_t);                  /* implemented */
-extern NCURSES_EXPORT(int) vid_attr (attr_t, short, void *);           /* implemented */
-extern NCURSES_EXPORT(int) vid_puts (attr_t, short, void *, NCURSES_OUTC); /* implemented */
+extern NCURSES_EXPORT(int) vid_attr (attr_t, NCURSES_PAIRS_T, void *);         /* implemented */
+extern NCURSES_EXPORT(int) vid_puts (attr_t, NCURSES_PAIRS_T, void *, NCURSES_OUTC); /* implemented */
 extern NCURSES_EXPORT(int) vline_set (const cchar_t *, int);           /* generated:WIDEC */
 extern NCURSES_EXPORT(int) wadd_wch (WINDOW *,const cchar_t *);                /* implemented */
 extern NCURSES_EXPORT(int) wadd_wchnstr (WINDOW *,const cchar_t *,int);        /* implemented */
@@ -221,8 +221,8 @@ extern NCURSES_EXPORT(int) wvline_set (WINDOW *, const cchar_t *, int);     /* imple
 extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(term_attrs) (SCREEN*);           /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(int) NCURSES_SP_NAME(unget_wch) (SCREEN*, const wchar_t);        /* implemented:SP_FUNC */
 extern NCURSES_EXPORT(wchar_t*) NCURSES_SP_NAME(wunctrl) (SCREEN*, cchar_t *); /* implemented:SP_FUNC */
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_attr) (SCREEN*, attr_t, short, void *); /* implemented:SP_FUNC */
-extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (SCREEN*, attr_t, short, void *, NCURSES_SP_OUTC);        /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_attr) (SCREEN*, attr_t, NCURSES_PAIRS_T, void *);       /* implemented:SP_FUNC */
+extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vid_puts) (SCREEN*, attr_t, NCURSES_PAIRS_T, void *, NCURSES_SP_OUTC);      /* implemented:SP_FUNC */
 #endif
 
 #ifndef NCURSES_NOMACROS
index cdddaeae995c65fbe3e33c0d018b9e82d3d1e266..1eb1f59e2385d65f78ec65b8375538f34f01adbd 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2014 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            *
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_chgat.c,v 1.9 2010/03/31 23:38:02 tom Exp $")
+MODULE_ID("$Id: lib_chgat.c,v 1.10 2014/02/01 22:13:31 tom Exp $")
 
 NCURSES_EXPORT(int)
-wchgat(WINDOW *win, int n, attr_t attr, short color, const void *opts GCC_UNUSED)
+wchgat(WINDOW *win,
+       int n,
+       attr_t attr,
+       NCURSES_PAIRS_T color,
+       const void *opts GCC_UNUSED)
 {
     int i;
 
-    T((T_CALLED("wchgat(%p,%d,%s,%d)"), (void *) win, n, _traceattr(attr), color));
+    T((T_CALLED("wchgat(%p,%d,%s,%d)"),
+       (void *) win,
+       n,
+       _traceattr(attr),
+       (int) color));
 
     if (win) {
        struct ldat *line = &(win->_line[win->_cury]);
index 13bc209cb04a21e69a8fec266f7778792439fc27..9f7250ddaffff9b688948953b06837a97cfedd46 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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            *
@@ -45,7 +45,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_color.c,v 1.108 2013/03/09 22:33:38 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.109 2014/02/01 22:22:30 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define CanChange      InfoOf(SP_PARM).canchange
@@ -388,7 +388,7 @@ start_color(void)
 
 /* This function was originally written by Daniel Weaver <danw@znyx.com> */
 static void
-rgb2hls(int r, int g, int b, short *h, short *l, short *s)
+rgb2hls(int r, int g, int b, NCURSES_COLOR_T *h, NCURSES_COLOR_T *l, NCURSES_COLOR_T *s)
 /* convert RGB to HLS system */
 {
     int min, max, t;
@@ -399,7 +399,7 @@ rgb2hls(int r, int g, int b, short *h, short *l, short *s)
        max = b;
 
     /* calculate lightness */
-    *l = (short) ((min + max) / 20);
+    *l = (NCURSES_COLOR_T) ((min + max) / 20);
 
     if (min == max) {          /* black, white and all shades of gray */
        *h = 0;
@@ -409,19 +409,19 @@ rgb2hls(int r, int g, int b, short *h, short *l, short *s)
 
     /* calculate saturation */
     if (*l < 50)
-       *s = (short) (((max - min) * 100) / (max + min));
+       *s = (NCURSES_COLOR_T) (((max - min) * 100) / (max + min));
     else
-       *s = (short) (((max - min) * 100) / (2000 - max - min));
+       *s = (NCURSES_COLOR_T) (((max - min) * 100) / (2000 - max - min));
 
     /* calculate hue */
     if (r == max)
-       t = (short) (120 + ((g - b) * 60) / (max - min));
+       t = (NCURSES_COLOR_T) (120 + ((g - b) * 60) / (max - min));
     else if (g == max)
-       t = (short) (240 + ((b - r) * 60) / (max - min));
+       t = (NCURSES_COLOR_T) (240 + ((b - r) * 60) / (max - min));
     else
-       t = (short) (360 + ((r - g) * 60) / (max - min));
+       t = (NCURSES_COLOR_T) (360 + ((r - g) * 60) / (max - min));
 
-    *h = (short) (t % 360);
+    *h = (NCURSES_COLOR_T) (t % 360);
 }
 
 /*
@@ -429,13 +429,20 @@ rgb2hls(int r, int g, int b, short *h, short *l, short *s)
  * values.
  */
 NCURSES_EXPORT(int)
-NCURSES_SP_NAME(init_pair) (NCURSES_SP_DCLx short pair, short f, short b)
+NCURSES_SP_NAME(init_pair) (NCURSES_SP_DCLx
+                           NCURSES_PAIRS_T pair,
+                           NCURSES_COLOR_T f,
+                           NCURSES_COLOR_T b)
 {
     colorpair_t result;
     colorpair_t previous;
     int maxcolors;
 
-    T((T_CALLED("init_pair(%p,%d,%d,%d)"), (void *) SP_PARM, pair, f, b));
+    T((T_CALLED("init_pair(%p,%d,%d,%d)"),
+       (void *) SP_PARM,
+       (int) pair,
+       (int) f,
+       (int) b));
 
     if (!ValidPair(pair))
        returnCode(ERR);
@@ -547,15 +554,19 @@ NCURSES_SP_NAME(init_pair) (NCURSES_SP_DCLx short pair, short f, short b)
 
        TR(TRACE_ATTRS,
           ("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)",
-           pair,
-           tp[f].red, tp[f].green, tp[f].blue,
-           tp[b].red, tp[b].green, tp[b].blue));
+           (int) pair,
+           (int) tp[f].red, (int) tp[f].green, (int) tp[f].blue,
+           (int) tp[b].red, (int) tp[b].green, (int) tp[b].blue));
 
        NCURSES_PUTP2("initialize_pair",
                      TPARM_7(initialize_pair,
                              pair,
-                             tp[f].red, tp[f].green, tp[f].blue,
-                             tp[b].red, tp[b].green, tp[b].blue));
+                             (int) tp[f].red,
+                             (int) tp[f].green,
+                             (int) tp[f].blue,
+                             (int) tp[b].red,
+                             (int) tp[b].green,
+                             (int) tp[b].blue));
     }
 #endif
 
@@ -564,7 +575,7 @@ NCURSES_SP_NAME(init_pair) (NCURSES_SP_DCLx short pair, short f, short b)
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-init_pair(short pair, short f, short b)
+init_pair(NCURSES_COLOR_T pair, NCURSES_COLOR_T f, NCURSES_COLOR_T b)
 {
     return NCURSES_SP_NAME(init_pair) (CURRENT_SCREEN, pair, f, b);
 }
@@ -574,7 +585,10 @@ init_pair(short pair, short f, short b)
 
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(init_color) (NCURSES_SP_DCLx
-                            short color, short r, short g, short b)
+                            NCURSES_COLOR_T color,
+                            NCURSES_COLOR_T r,
+                            NCURSES_COLOR_T g,
+                            NCURSES_COLOR_T b)
 {
     int result = ERR;
     int maxcolors;
@@ -625,7 +639,10 @@ NCURSES_SP_NAME(init_color) (NCURSES_SP_DCLx
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-init_color(short color, short r, short g, short b)
+init_color(NCURSES_COLOR_T color,
+          NCURSES_COLOR_T r,
+          NCURSES_COLOR_T g,
+          NCURSES_COLOR_T b)
 {
     return NCURSES_SP_NAME(init_color) (CURRENT_SCREEN, color, r, g, b);
 }
@@ -685,7 +702,10 @@ has_colors(void)
 
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(color_content) (NCURSES_SP_DCLx
-                               short color, short *r, short *g, short *b)
+                               NCURSES_COLOR_T color,
+                               NCURSES_COLOR_T *r,
+                               NCURSES_COLOR_T *g,
+                               NCURSES_COLOR_T *b)
 {
     int result = ERR;
     int maxcolors;
@@ -725,7 +745,10 @@ NCURSES_SP_NAME(color_content) (NCURSES_SP_DCLx
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-color_content(short color, short *r, short *g, short *b)
+color_content(NCURSES_COLOR_T color,
+             NCURSES_COLOR_T *r,
+             NCURSES_COLOR_T *g,
+             NCURSES_COLOR_T *b)
 {
     return NCURSES_SP_NAME(color_content) (CURRENT_SCREEN, color, r, g, b);
 }
@@ -733,13 +756,15 @@ color_content(short color, short *r, short *g, short *b)
 
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(pair_content) (NCURSES_SP_DCLx
-                              short pair, short *f, short *b)
+                              NCURSES_PAIRS_T pair,
+                              NCURSES_COLOR_T *f,
+                              NCURSES_COLOR_T *b)
 {
     int result;
 
     T((T_CALLED("pair_content(%p,%d,%p,%p)"),
        (void *) SP_PARM,
-       pair,
+       (int) pair,
        (void *) f,
        (void *) b));
 
@@ -763,8 +788,8 @@ NCURSES_SP_NAME(pair_content) (NCURSES_SP_DCLx
 
        TR(TRACE_ATTRS, ("...pair_content(%p,%d,%d,%d)",
                         (void *) SP_PARM,
-                        pair,
-                        fg, bg));
+                        (int) pair,
+                        (int) fg, (int) bg));
        result = OK;
     }
     returnCode(result);
@@ -772,7 +797,7 @@ NCURSES_SP_NAME(pair_content) (NCURSES_SP_DCLx
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-pair_content(short pair, short *f, short *b)
+pair_content(NCURSES_COLOR_T pair, NCURSES_COLOR_T *f, NCURSES_COLOR_T *b)
 {
     return NCURSES_SP_NAME(pair_content) (CURRENT_SCREEN, pair, f, b);
 }
@@ -803,14 +828,14 @@ NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx
                                    1, outc);
            return;
        } else if (SP_PARM != 0) {
-           if (pair_content((short) pair, &fg, &bg) == ERR)
+           if (pair_content((NCURSES_COLOR_T) pair, &fg, &bg) == ERR)
                return;
        }
     }
 
     if (old_pair >= 0
        && SP_PARM != 0
-       && pair_content((short) old_pair, &old_fg, &old_bg) != ERR) {
+       && pair_content((NCURSES_COLOR_T) old_pair, &old_fg, &old_bg) != ERR) {
        if ((isDefaultColor(fg) && !isDefaultColor(old_fg))
            || (isDefaultColor(bg) && !isDefaultColor(old_bg))) {
 #if NCURSES_EXT_FUNCS
@@ -839,9 +864,9 @@ NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_DCLx
 
 #if NCURSES_EXT_FUNCS
     if (isDefaultColor(fg))
-       fg = (short) default_fg(NCURSES_SP_ARG);
+       fg = (NCURSES_COLOR_T) default_fg(NCURSES_SP_ARG);
     if (isDefaultColor(bg))
-       bg = (short) default_bg(NCURSES_SP_ARG);
+       bg = (NCURSES_COLOR_T) default_bg(NCURSES_SP_ARG);
 #endif
 
     if (reverse) {
index 6210a0e8a8f9cd9f1514058a97eb9b989ec15fe6..e9354860ad0d0ef44e63adcaf0c9887ec747d170 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2014 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            *
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_colorset.c,v 1.13 2009/10/24 22:02:14 tom Exp $")
+MODULE_ID("$Id: lib_colorset.c,v 1.14 2014/02/01 22:10:42 tom Exp $")
 
 NCURSES_EXPORT(int)
-wcolor_set(WINDOW *win, short color_pair_number, void *opts)
+wcolor_set(WINDOW *win, NCURSES_PAIRS_T color_pair_number, void *opts)
 {
     int code = ERR;
 
-    T((T_CALLED("wcolor_set(%p,%d)"), (void *) win, color_pair_number));
+    T((T_CALLED("wcolor_set(%p,%d)"), (void *) win, (int) color_pair_number));
     if (win
        && !opts
        && (SP != 0)
index 5677b57b8313827b3db3ea80cc1194415e97169b..f708ecc51e4acebc22475eafa53f745fdcf3de9c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2011,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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            *
@@ -41,7 +41,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_instr.c,v 1.20 2013/01/20 01:58:13 tom Exp $")
+MODULE_ID("$Id: lib_instr.c,v 1.21 2014/02/01 22:09:27 tom Exp $")
 
 NCURSES_EXPORT(int)
 winnstr(WINDOW *win, char *str, int n)
@@ -64,7 +64,7 @@ winnstr(WINDOW *win, char *str, int n)
            cchar_t *cell = &(win->_line[row].text[col]);
            wchar_t *wch;
            attr_t attrs;
-           short pair;
+           NCURSES_PAIRS_T pair;
            int n2;
            bool done = FALSE;
            mbstate_t state;
index bd5f539672a7747d681d522d2aec3162ae755331..a3132e9ced1a59984c3c7c82fd5713bd90d7e8c4 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2014 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            *
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkatr_set.c,v 1.14 2009/10/24 22:47:03 tom Exp $")
+MODULE_ID("$Id: lib_slkatr_set.c,v 1.15 2014/02/01 22:10:42 tom Exp $")
 
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(slk_attr_set) (NCURSES_SP_DCLx
                               const attr_t attr,
-                              short color_pair_number,
+                              NCURSES_PAIRS_T color_pair_number,
                               void *opts)
 {
     int code = ERR;
@@ -51,7 +51,7 @@ NCURSES_SP_NAME(slk_attr_set) (NCURSES_SP_DCLx
     T((T_CALLED("slk_attr_set(%p,%s,%d)"),
        (void *) SP_PARM,
        _traceattr(attr),
-       color_pair_number));
+       (int) color_pair_number));
 
     if (SP_PARM != 0
        && SP_PARM->_slk != 0
@@ -71,7 +71,7 @@ NCURSES_SP_NAME(slk_attr_set) (NCURSES_SP_DCLx
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-slk_attr_set(const attr_t attr, short color_pair_number, void *opts)
+slk_attr_set(const attr_t attr, NCURSES_COLOR_T color_pair_number, void *opts)
 {
     return NCURSES_SP_NAME(slk_attr_set) (CURRENT_SCREEN, attr,
                                          color_pair_number, opts);
index c1211bcb884a32cf8f4b0197f5d595eded2f139f..2cf9e5d7f1213348e83e9fb311dab6dc6e08bd69 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2014 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            *
  */
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_slkcolor.c,v 1.16 2009/10/24 22:12:21 tom Exp $")
+MODULE_ID("$Id: lib_slkcolor.c,v 1.17 2014/02/01 22:10:42 tom Exp $")
 
 NCURSES_EXPORT(int)
-NCURSES_SP_NAME(slk_color) (NCURSES_SP_DCLx short color_pair_number)
+NCURSES_SP_NAME(slk_color) (NCURSES_SP_DCLx NCURSES_PAIRS_T color_pair_number)
 {
     int code = ERR;
 
-    T((T_CALLED("slk_color(%p,%d)"), (void *) SP_PARM, color_pair_number));
+    T((T_CALLED("slk_color(%p,%d)"), (void *) SP_PARM, (int) color_pair_number));
 
     if (SP_PARM != 0
        && SP_PARM->_slk != 0
@@ -61,7 +61,7 @@ NCURSES_SP_NAME(slk_color) (NCURSES_SP_DCLx short color_pair_number)
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-slk_color(short color_pair_number)
+slk_color(NCURSES_PAIRS_T color_pair_number)
 {
     return NCURSES_SP_NAME(slk_color) (CURRENT_SCREEN, color_pair_number);
 }
index 752110a6027f87af06bc28e0044302f062f416d9..7deffad5ea68b8f723cd1c6029fb2ec5fa613f86 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.529 2013/11/16 19:44:28 tom Exp $
+ * $Id: curses.priv.h,v 1.530 2014/02/01 22:09:27 tom Exp $
  *
  *     curses.priv.h
  *
@@ -288,14 +288,6 @@ typedef TRIES {
  * Structure for palette tables
  */
 
-typedef struct
-{
-    short red, green, blue;    /* what color_content() returns */
-    short r, g, b;             /* params to init_color() */
-    int init;                  /* true if we called init_color() */
-}
-color_t;
-
 #define MAXCOLUMNS    135
 #define MAXLINES      66
 #define FIFO_SIZE     MAXCOLUMNS+2  /* for nocbreak mode input */
@@ -320,6 +312,14 @@ color_t;
 
 #include <curses.h>    /* we'll use -Ipath directive to get the right one! */
 
+typedef struct
+{
+    NCURSES_COLOR_T red, green, blue;  /* what color_content() returns */
+    NCURSES_COLOR_T r, g, b;           /* params to init_color() */
+    int init;                  /* true if we called init_color() */
+}
+color_t;
+
 /*
  * If curses.h did not expose the SCREEN-functions, then we do not need the
  * parameter in the corresponding unextended functions.
@@ -2400,7 +2400,7 @@ extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_set_tty_mode)(SCREEN*, TTY*)
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_setupscreen)(SCREEN**, int, int, FILE *, int, int);
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_tgetent)(SCREEN*,char*,const char *);
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_tigetnum)(SCREEN*,NCURSES_CONST char*);
-extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_vid_attr)(SCREEN *, attr_t, short, void *);
+extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_vid_attr)(SCREEN *, attr_t, NCURSES_COLOR_T, void *);
 extern NCURSES_EXPORT(int)      NCURSES_SP_NAME(_nc_vidputs)(SCREEN*,chtype,int(*) (SCREEN*, int));
 extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_do_color)(SCREEN*, int, int, int, NCURSES_SP_OUTC);
 extern NCURSES_EXPORT(void)     NCURSES_SP_NAME(_nc_do_xmc_glitch)(SCREEN*, attr_t);
index d1c0de40856d14d5563759b6fb272be41b7a4c29..5fb0df95f4fd9eb1b4135625d8a89bdd085fb3dd 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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            *
@@ -43,7 +43,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_traceatr.c,v 1.80 2013/08/31 13:33:06 tom Exp $")
+MODULE_ID("$Id: lib_traceatr.c,v 1.81 2014/02/01 22:09:27 tom Exp $")
 
 #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name))
 
@@ -151,7 +151,7 @@ _traceattr2(int bufnum, chtype newmode)
                    _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
                                "{%d}", pairnum);
 #else
-                   short fg, bg;
+                   NCURSES_COLOR_T fg, bg;
 
                    if (pair_content(pairnum, &fg, &bg) == OK) {
                        _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
index 3addd02e745717ef290c12c7887c9e7b583cdc89..8a110ee92125e0e4fda4aa9033381e593706d802 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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            *
@@ -82,7 +82,7 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: tty_update.c,v 1.276 2013/02/16 21:12:02 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.277 2014/02/01 22:09:27 tom Exp $")
 
 /*
  * This define controls the line-breakout optimization.  Every once in a
@@ -490,7 +490,7 @@ can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch)
        if (SP_PARM->_default_fg != C_MASK || SP_PARM->_default_bg != C_MASK)
            return FALSE;
        if ((pair = GetPair(CHDEREF(ch))) != 0) {
-           short fg, bg;
+           NCURSES_COLOR_T fg, bg;
            if (NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx
                                               (short) pair,
                                               &fg, &bg) == ERR
index 679dd7171626eb8447c9acd98f1011c6b968a00e..654bebb46d368c2bf54ff88a9ea068f8e955da8f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2001-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 2001-2012,2014 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,7 +35,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_cchar.c,v 1.26 2012/03/24 18:37:17 tom Exp $")
+MODULE_ID("$Id: lib_cchar.c,v 1.27 2014/02/01 22:10:42 tom Exp $")
 
 /* 
  * The SuSv2 description leaves some room for interpretation.  We'll assume wch
@@ -47,7 +47,7 @@ NCURSES_EXPORT(int)
 setcchar(cchar_t *wcval,
         const wchar_t *wch,
         const attr_t attrs,
-        short color_pair,
+        NCURSES_PAIRS_T color_pair,
         const void *opts)
 {
     unsigned i;
@@ -56,7 +56,7 @@ setcchar(cchar_t *wcval,
 
     TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"),
                      (void *) wcval, _nc_viswbuf(wch),
-                     (unsigned long) attrs, color_pair, opts));
+                     (unsigned long) attrs, (int) color_pair, opts));
 
     if (opts != NULL
        || wch == NULL
@@ -96,7 +96,7 @@ NCURSES_EXPORT(int)
 getcchar(const cchar_t *wcval,
         wchar_t *wch,
         attr_t *attrs,
-        short *color_pair,
+        NCURSES_PAIRS_T *color_pair,
         void *opts)
 {
     wchar_t *wp;
@@ -125,7 +125,7 @@ getcchar(const cchar_t *wcval,
            code = ERR;
        } else if (len >= 0) {
            *attrs = AttrOf(*wcval) & A_ATTRIBUTES;
-           *color_pair = (short) GetPair(*wcval);
+           *color_pair = (NCURSES_PAIRS_T) GetPair(*wcval);
            wmemcpy(wch, wcval->chars, (size_t) len);
            wch[len] = L'\0';
            code = OK;
index 5034a42ff6e7a45d4fc164eeae497aba6866caad..0be2b195c3d226b254f4e86c0812c1d41b307fbe 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-2013,2014 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            *
@@ -36,7 +36,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_vid_attr.c,v 1.21 2013/08/31 20:09:12 tom Exp $")
+MODULE_ID("$Id: lib_vid_attr.c,v 1.22 2014/02/01 22:09:27 tom Exp $")
 
 #define doPut(mode) \
        TPUTS_TRACE(#mode); \
@@ -68,7 +68,7 @@ MODULE_ID("$Id: lib_vid_attr.c,v 1.21 2013/08/31 20:09:12 tom Exp $")
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
                           attr_t newmode,
-                          short pair,
+                          NCURSES_PAIRS_T pair,
                           void *opts GCC_UNUSED,
                           NCURSES_SP_OUTC outc)
 {
@@ -267,7 +267,7 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
 
     returnCode(OK);
 #else
-    T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair));
+    T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), (int) pair));
     set_color(newmode, pair);
     returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx newmode, outc));
 #endif
@@ -276,7 +276,7 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
 vid_puts(attr_t newmode,
-        short pair,
+        NCURSES_PAIRS_T pair,
         void *opts GCC_UNUSED,
         NCURSES_OUTC outc)
 {
@@ -293,10 +293,10 @@ vid_puts(attr_t newmode,
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(vid_attr) (NCURSES_SP_DCLx
                           attr_t newmode,
-                          short pair,
+                          NCURSES_PAIRS_T pair,
                           void *opts)
 {
-    T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair));
+    T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), (int) pair));
     returnCode(NCURSES_SP_NAME(vid_puts) (NCURSES_SP_ARGx
                                          newmode,
                                          pair,
@@ -306,7 +306,7 @@ NCURSES_SP_NAME(vid_attr) (NCURSES_SP_DCLx
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(int)
-vid_attr(attr_t newmode, short pair, void *opts)
+vid_attr(attr_t newmode, NCURSES_PAIRS_T pair, void *opts)
 {
     return NCURSES_SP_NAME(vid_attr) (CURRENT_SCREEN, newmode, pair, opts);
 }
index 54b1b7e0adcb5f1a3f4d042b41b982e539eec244..d863cb90b079bdb5c2c3d9e224e92273620c8f28 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (5.9-20140125) unstable; urgency=low
+ncurses6 (5.9-20140201) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 25 Jan 2014 11:16:43 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 01 Feb 2014 12:10:27 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 54b1b7e0adcb5f1a3f4d042b41b982e539eec244..d863cb90b079bdb5c2c3d9e224e92273620c8f28 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (5.9-20140125) unstable; urgency=low
+ncurses6 (5.9-20140201) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 25 Jan 2014 11:16:43 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 01 Feb 2014 12:10:27 -0500
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index c53aab3e9af81e258171584655ae3e4422921060..473e7bd533f6d511fa9a9a48f5f05b3130a890cd 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (5.9-20140125) unstable; urgency=low
+ncurses6 (5.9-20140201) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 25 Jan 2014 11:16:43 -0500
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 01 Feb 2014 12:10:27 -0500
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index cace7bd0dc7e7ae435e2dc9e8e6a75c37a26e9a2..ad6ea01f01e3762b4db78156720f3e7129ba364d 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.22 2014/01/25 16:16:43 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.23 2014/02/01 17:10:27 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "5"\r
 !define VERSION_MINOR "9"\r
 !define VERSION_YYYY  "2014"\r
-!define VERSION_MMDD  "125"\r
+!define VERSION_MMDD  "201"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index d62fc9cf45301eee1454261f4f1377b3b87a86de..12d658dce4dd00cfd03b4c93aa75e83f2f280e7b 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 5.9
-Release: 20140125
+Release: 20140201
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index ae8cd714669d699076c5b11d0e8da6e095c6acdb..5025aa35998f3b4e06977d7f8ebaa6f46135120d 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 5.9
-Release: 20140125
+Release: 20140201
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index d52d05a679f748ba24e374c91f8f398805badfde..587cbc3449beee64f18cbc787b21bc8a3c592387 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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,7 +42,7 @@
 
 #include <dump_entry.h>
 
-MODULE_ID("$Id: infocmp.c,v 1.128 2013/12/15 01:06:52 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.129 2014/02/01 22:11:03 tom Exp $")
 
 #define L_CURL "{"
 #define R_CURL "}"
@@ -858,7 +858,7 @@ analyze_string(const char *name, const char *cap, TERMTYPE *tp)
        /* now check for standard-mode sequences */
        if (!expansion
            && (csi = skip_csi(sp)) != 0
-           && (len = strspn(sp + csi, "0123456789;"))
+           && (len = (strspn) (sp + csi, "0123456789;"))
            && (len < sizeof(buf3))
            && (next = (size_t) csi + len)
            && ((sp[next] == 'h') || (sp[next] == 'l'))) {
@@ -879,7 +879,7 @@ analyze_string(const char *name, const char *cap, TERMTYPE *tp)
        if (!expansion
            && (csi = skip_csi(sp)) != 0
            && sp[csi] == '?'
-           && (len = strspn(sp + csi + 1, "0123456789;"))
+           && (len = (strspn) (sp + csi + 1, "0123456789;"))
            && (len < sizeof(buf3))
            && (next = (size_t) csi + 1 + len)
            && ((sp[next] == 'h') || (sp[next] == 'l'))) {
@@ -899,7 +899,7 @@ analyze_string(const char *name, const char *cap, TERMTYPE *tp)
        /* now check for ECMA highlight sequences */
        if (!expansion
            && (csi = skip_csi(sp)) != 0
-           && (len = strspn(sp + csi, "0123456789;")) != 0
+           && (len = (strspn) (sp + csi, "0123456789;")) != 0
            && (len < sizeof(buf3))
            && (next = (size_t) csi + len)
            && sp[next] == 'm') {
index 356c9a6144af4f487a7bedec544472d1d15f37d8..6c5ad996c5ba74821bf25211921cd95dd15902ec 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2003-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 2003-2012,2014 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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: background.c,v 1.13 2012/06/09 20:30:33 tom Exp $
+ * $Id: background.c,v 1.14 2014/02/01 22:10:42 tom Exp $
  */
 
 #define NEED_COLOR_CODE 1
@@ -39,31 +39,31 @@ static int default_fg = COLOR_WHITE;
 static void
 test_background(void)
 {
-    short f, b;
+    NCURSES_COLOR_T f, b;
     int row;
     int chr;
 
     if (pair_content(0, &f, &b) == ERR) {
        printw("pair 0 contains no data\n");
     } else {
-       printw("pair 0 contains (%d,%d)\n", f, b);
+       printw("pair 0 contains (%d,%d)\n", (int) f, (int) b);
     }
     getch();
 
     printw("Initializing pair 1 to red/%s\n", color_name(default_bg));
-    init_pair(1, COLOR_RED, (short) default_bg);
+    init_pair(1, COLOR_RED, (NCURSES_COLOR_T) default_bg);
     bkgdset((chtype) (' ' | COLOR_PAIR(1)));
     printw("RED/BLACK\n");
     getch();
 
     printw("Initializing pair 2 to %s/blue\n", color_name(default_fg));
-    init_pair(2, (short) default_fg, COLOR_BLUE);
+    init_pair(2, (NCURSES_COLOR_T) default_fg, COLOR_BLUE);
     bkgdset((chtype) (' ' | COLOR_PAIR(2)));
     printw("This line should be %s/blue\n", color_name(default_fg));
     getch();
 
     printw("Initializing pair 3 to %s/cyan (ACS_HLINE)\n", color_name(default_fg));
-    init_pair(3, (short) default_fg, COLOR_CYAN);
+    init_pair(3, (NCURSES_COLOR_T) default_fg, COLOR_CYAN);
     printw("...and drawing a box which should be followed by lines\n");
     bkgdset(ACS_HLINE | COLOR_PAIR(3));
     /*
index 041e6fd76fbb7c6e0e722b043c6628a7f0863f61..477d049c8b5e431f721caa961c669f5a561f44bb 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2003-2008,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 2003-2012,2014 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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: color_set.c,v 1.7 2012/12/15 22:04:14 tom Exp $
+ * $Id: color_set.c,v 1.8 2014/02/01 22:10:42 tom Exp $
  */
 
 #include <test.priv.h>
@@ -38,7 +38,7 @@
 int
 main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
 {
-    short f, b;
+    NCURSES_COLOR_T f, b;
     int i;
 
     initscr();
@@ -49,7 +49,7 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
        start_color();
 
        (void) pair_content(0, &f, &b);
-       printw("pair 0 contains (%d,%d)\n", f, b);
+       printw("pair 0 contains (%d,%d)\n", (int) f, (int) b);
        getch();
 
        printw("Initializing pair 1 to red/black\n");
index 276209f49440fef83762c2d41568b0b21954ab9d..f1ebf6256d51e972bc59f09dafeba894056cab73 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2013 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2013,2014 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            *
@@ -31,7 +31,7 @@
  ****************************************************************************/
 
 /*
- * $Id: form_driver_w.c,v 1.9 2013/12/07 20:35:54 tom Exp $
+ * $Id: form_driver_w.c,v 1.10 2014/02/01 20:49:39 Gaute.Hope Exp $
  *
  * Test form_driver_w (int, int, wchar_t), a wide char aware
  * replacement of form_driver.
@@ -101,22 +101,17 @@ main(void)
            switch (ch) {
            case KEY_DOWN:
                /* Go to next field */
-               form_driver(my_form, REQ_NEXT_FIELD);
+               form_driver_w(my_form, KEY_CODE_YES, REQ_NEXT_FIELD);
                /* Go to the end of the present buffer */
                /* Leaves nicely at the last character */
-               form_driver(my_form, REQ_END_LINE);
+               form_driver_w(my_form, KEY_CODE_YES, REQ_END_LINE);
                break;
            case KEY_UP:
                /* Go to previous field */
-               form_driver(my_form, REQ_PREV_FIELD);
-               form_driver(my_form, REQ_END_LINE);
+               form_driver_w(my_form, KEY_CODE_YES, REQ_PREV_FIELD);
+               form_driver_w(my_form, KEY_CODE_YES, REQ_END_LINE);
                break;
            default:
-#if 0
-               /* If this is a normal character, it gets printed */
-               form_driver(my_form, ch);
-               wadd_wch(my_form->current->working, ch);
-#endif
                break;
            }
            break;
index cb806673b31b3f3ecc62ba5684543749b36c0c6d..40d8ac465136205f9e056619cf09591df0ed7e26 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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            *
@@ -40,7 +40,7 @@ AUTHOR
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
            Thomas E. Dickey (beginning revision 1.27 in 1996).
 
-$Id: ncurses.c,v 1.396 2013/11/23 21:43:51 tom Exp $
+$Id: ncurses.c,v 1.397 2014/02/01 22:29:37 tom Exp $
 
 ***************************************************************************/
 
@@ -157,9 +157,9 @@ static bool use_colors;             /* true if we use colors */
 static int max_pairs;          /* ...and the number of color pairs */
 
 typedef struct {
-    short red;
-    short green;
-    short blue;
+    NCURSES_COLOR_T red;
+    NCURSES_COLOR_T green;
+    NCURSES_COLOR_T blue;
 } RGB_DATA;
 
 static RGB_DATA *all_colors;
@@ -1301,29 +1301,29 @@ show_color_attr(int fg, int bg, int tx)
 }
 
 static bool
-cycle_color_attr(int ch, short *fg, short *bg, short *tx)
+cycle_color_attr(int ch, NCURSES_COLOR_T *fg, NCURSES_COLOR_T *bg, NCURSES_COLOR_T *tx)
 {
     bool error = FALSE;
 
     if (use_colors) {
        switch (ch) {
        case 'f':
-           *fg = (short) (*fg + 1);
+           *fg = (NCURSES_COLOR_T) (*fg + 1);
            break;
        case 'F':
-           *fg = (short) (*fg - 1);
+           *fg = (NCURSES_COLOR_T) (*fg - 1);
            break;
        case 'b':
-           *bg = (short) (*bg + 1);
+           *bg = (NCURSES_COLOR_T) (*bg + 1);
            break;
        case 'B':
-           *bg = (short) (*bg - 1);
+           *bg = (NCURSES_COLOR_T) (*bg - 1);
            break;
        case 't':
-           *tx = (short) (*tx + 1);
+           *tx = (NCURSES_COLOR_T) (*tx + 1);
            break;
        case 'T':
-           *tx = (short) (*tx - 1);
+           *tx = (NCURSES_COLOR_T) (*tx - 1);
            break;
        default:
            beep();
@@ -1331,17 +1331,17 @@ cycle_color_attr(int ch, short *fg, short *bg, short *tx)
            break;
        }
        if (*fg >= COLORS)
-           *fg = (short) min_colors;
+           *fg = (NCURSES_COLOR_T) min_colors;
        if (*fg < min_colors)
-           *fg = (short) (COLORS - 1);
+           *fg = (NCURSES_COLOR_T) (COLORS - 1);
        if (*bg >= COLORS)
-           *bg = (short) min_colors;
+           *bg = (NCURSES_COLOR_T) min_colors;
        if (*bg < min_colors)
-           *bg = (short) (COLORS - 1);
+           *bg = (NCURSES_COLOR_T) (COLORS - 1);
        if (*tx >= COLORS)
            *tx = -1;
        if (*tx < -1)
-           *tx = (short) (COLORS - 1);
+           *tx = (NCURSES_COLOR_T) (COLORS - 1);
     } else {
        beep();
        error = TRUE;
@@ -1493,7 +1493,13 @@ init_attr_list(ATTR_TBL * target, attr_t attrs)
 }
 
 static bool
-attr_getc(int *skip, short *fg, short *bg, short *tx, int *ac, unsigned *kc, unsigned limit)
+attr_getc(int *skip,
+         NCURSES_COLOR_T *fg,
+         NCURSES_COLOR_T *bg,
+         NCURSES_COLOR_T *tx,
+         int *ac,
+         unsigned *kc,
+         unsigned limit)
 {
     bool result = TRUE;
     bool error = FALSE;
@@ -1559,9 +1565,9 @@ attr_test(void)
 {
     int n;
     int skip = get_xmc();
-    short fg = COLOR_BLACK;    /* color pair 0 is special */
-    short bg = COLOR_BLACK;
-    short tx = -1;
+    NCURSES_COLOR_T fg = COLOR_BLACK;  /* color pair 0 is special */
+    NCURSES_COLOR_T bg = COLOR_BLACK;
+    NCURSES_COLOR_T tx = -1;
     int ac = 0;
     unsigned j, k;
     ATTR_TBL my_list[SIZEOF(attrs_to_test)];
@@ -1581,8 +1587,8 @@ attr_test(void)
            chtype extras = (chtype) ac;
 
            if (use_colors) {
-               short pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK);
-               if (pair != 0) {
+               NCURSES_PAIRS_T pair = 0;
+               if ((fg != COLOR_BLACK) || (bg != COLOR_BLACK)) {
                    pair = 1;
                    if (init_pair(pair, fg, bg) == ERR) {
                        beep();
@@ -1668,7 +1674,7 @@ wide_init_attr_string(void)
 }
 
 static void
-set_wide_background(short pair)
+set_wide_background(NCURSES_PAIRS_T pair)
 {
     cchar_t normal;
     wchar_t blank[2];
@@ -1686,7 +1692,7 @@ get_wide_background(void)
     attr_t result = A_NORMAL;
     attr_t attr;
     cchar_t ch;
-    short pair;
+    NCURSES_PAIRS_T pair;
     wchar_t wch[10];
 
     memset(&ch, 0, sizeof(ch));
@@ -1699,7 +1705,12 @@ get_wide_background(void)
 }
 
 static int
-wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const char *name)
+wide_show_attr(int row,
+              int skip,
+              bool arrow,
+              chtype attr,
+              NCURSES_PAIRS_T pair,
+              const char *name)
 {
     int ncv = get_ncv();
     chtype test = attr & ~WA_ALTCHARSET;
@@ -1729,7 +1740,7 @@ wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const cha
        }
     } else {
        attr_t old_attr = 0;
-       short old_pair = 0;
+       NCURSES_PAIRS_T old_pair = 0;
 
        (void) (attr_get) (&old_attr, &old_pair, 0);
        (void) attr_set(attr, pair, 0);
@@ -1777,8 +1788,8 @@ wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const cha
 
 static bool
 wide_attr_getc(int *skip,
-              short *fg, short *bg,
-              short *tx, int *ac,
+              NCURSES_COLOR_T *fg, NCURSES_COLOR_T *bg,
+              NCURSES_COLOR_T *tx, int *ac,
               unsigned *kc, unsigned limit)
 {
     bool result = TRUE;
@@ -1845,9 +1856,9 @@ wide_attr_test(void)
 {
     int n;
     int skip = get_xmc();
-    short fg = COLOR_BLACK;    /* color pair 0 is special */
-    short bg = COLOR_BLACK;
-    short tx = -1;
+    NCURSES_COLOR_T fg = COLOR_BLACK;  /* color pair 0 is special */
+    NCURSES_COLOR_T bg = COLOR_BLACK;
+    NCURSES_COLOR_T tx = -1;
     int ac = 0;
     unsigned j, k;
     ATTR_TBL my_list[SIZEOF(attrs_to_test)];
@@ -1863,11 +1874,11 @@ wide_attr_test(void)
 
        do {
            int row = 2;
-           short pair = 0;
-           short extras = 0;
+           NCURSES_PAIRS_T pair = 0;
+           NCURSES_PAIRS_T extras = 0;
 
            if (use_colors) {
-               pair = (short) (fg != COLOR_BLACK || bg != COLOR_BLACK);
+               pair = (NCURSES_PAIRS_T) (fg != COLOR_BLACK || bg != COLOR_BLACK);
                if (pair != 0) {
                    pair = 1;
                    if (init_pair(pair, fg, bg) == ERR) {
@@ -2011,7 +2022,7 @@ color_legend(WINDOW *helpwin, bool wide)
 static void
 color_test(void)
 {
-    short i;
+    NCURSES_PAIRS_T i;
     int top = 0, width;
     int base_row = 0;
     int grid_top = top + 3;
@@ -2072,16 +2083,16 @@ color_test(void)
            show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
 
        /* show a grid of colors, with color names/ numbers on the left */
-       for (i = (short) (base_row * per_row); i < pairs_max; i++) {
+       for (i = (NCURSES_PAIRS_T) (base_row * per_row); i < pairs_max; i++) {
            int row = grid_top + (i / per_row) - base_row;
            int col = (i % per_row + 1) * width;
-           short pair = i;
+           NCURSES_PAIRS_T pair = i;
 
-#define InxToFG(i) (short) ((i % (COLORS - min_colors)) + min_colors)
-#define InxToBG(i) (short) ((i / (COLORS - min_colors)) + min_colors)
+#define InxToFG(i) (NCURSES_COLOR_T) ((i % (COLORS - min_colors)) + min_colors)
+#define InxToBG(i) (NCURSES_COLOR_T) ((i / (COLORS - min_colors)) + min_colors)
            if (row >= 0 && move(row, col) != ERR) {
-               short fg = InxToFG(i);
-               short bg = InxToBG(i);
+               NCURSES_COLOR_T fg = InxToFG(i);
+               NCURSES_COLOR_T bg = InxToBG(i);
 
                init_pair(pair, fg, bg);
                attron((attr_t) COLOR_PAIR(pair));
@@ -2093,7 +2104,7 @@ color_test(void)
                    attron((attr_t) A_REVERSE);
 
                if (opt_nums) {
-                   sprintf(numbered, "{%02X}", i);
+                   sprintf(numbered, "{%02X}", (int) i);
                    hello = numbered;
                }
                printw("%-*.*s", width, width, hello);
@@ -2278,7 +2289,7 @@ wide_color_test(void)
        for (i = (base_row * per_row); i < pairs_max; i++) {
            int row = grid_top + (i / per_row) - base_row;
            int col = (i % per_row + 1) * width;
-           short pair = (short) i;
+           NCURSES_PAIRS_T pair = (NCURSES_PAIRS_T) i;
 
            if (row >= 0 && move(row, col) != ERR) {
                init_pair(pair, InxToFG(i), InxToBG(i));
@@ -2409,21 +2420,21 @@ wide_color_test(void)
 #endif /* USE_WIDEC_SUPPORT */
 
 static void
-change_color(short current, int field, int value, int usebase)
+change_color(NCURSES_PAIRS_T current, int field, int value, int usebase)
 {
-    short red, green, blue;
+    NCURSES_COLOR_T red, green, blue;
 
     color_content(current, &red, &green, &blue);
 
     switch (field) {
     case 0:
-       red = (short) (usebase ? (red + value) : value);
+       red = (NCURSES_COLOR_T) (usebase ? (red + value) : value);
        break;
     case 1:
-       green = (short) (usebase ? (green + value) : value);
+       green = (NCURSES_COLOR_T) (usebase ? (green + value) : value);
        break;
     case 2:
-       blue = (short) (usebase ? (blue + value) : value);
+       blue = (NCURSES_COLOR_T) (usebase ? (blue + value) : value);
        break;
     }
 
@@ -2434,7 +2445,7 @@ change_color(short current, int field, int value, int usebase)
 static void
 init_all_colors(void)
 {
-    short c;
+    NCURSES_PAIRS_T c;
 
     for (c = 0; c < COLORS; ++c)
        init_color(c,
@@ -2460,18 +2471,20 @@ color_edit(void)
     refresh();
 
     for (i = 0; i < max_colors; i++)
-       init_pair((short) i, (short) COLOR_WHITE, (short) i);
+       init_pair((NCURSES_PAIRS_T) i,
+                 (NCURSES_COLOR_T) COLOR_WHITE,
+                 (NCURSES_COLOR_T) i);
 
     MvPrintw(LINES - 2, 0, "Number: %d", value);
 
     do {
-       short red, green, blue;
+       NCURSES_COLOR_T red, green, blue;
 
        attron(A_BOLD);
        MvAddStr(0, 20, "Color RGB Value Editing");
        attroff(A_BOLD);
 
-       for (i = (short) top_color;
+       for (i = (NCURSES_COLOR_T) top_color;
             (i - top_color < page_size)
             && (i < max_colors); i++) {
            char numeric[80];
@@ -2485,30 +2498,30 @@ color_edit(void)
            addstr("        ");
            (void) attrset(A_NORMAL);
 
-           color_content((short) i, &red, &green, &blue);
+           color_content((NCURSES_PAIRS_T) i, &red, &green, &blue);
            addstr("   R = ");
            if (current == i && field == 0)
                attron(A_STANDOUT);
-           printw("%04d", red);
+           printw("%04d", (int) red);
            if (current == i && field == 0)
                (void) attrset(A_NORMAL);
            addstr(", G = ");
            if (current == i && field == 1)
                attron(A_STANDOUT);
-           printw("%04d", green);
+           printw("%04d", (int) green);
            if (current == i && field == 1)
                (void) attrset(A_NORMAL);
            addstr(", B = ");
            if (current == i && field == 2)
                attron(A_STANDOUT);
-           printw("%04d", blue);
+           printw("%04d", (int) blue);
            if (current == i && field == 2)
                (void) attrset(A_NORMAL);
            (void) attrset(A_NORMAL);
            printw(" ( %3d %3d %3d )",
-                  scaled_rgb(red),
-                  scaled_rgb(green),
-                  scaled_rgb(blue));
+                  (int) scaled_rgb(red),
+                  (int) scaled_rgb(green),
+                  (int) scaled_rgb(blue));
        }
 
        MvAddStr(LINES - 3, 0,
@@ -2572,15 +2585,15 @@ color_edit(void)
            break;
 
        case '+':
-           change_color((short) current, field, value, 1);
+           change_color((NCURSES_PAIRS_T) current, field, value, 1);
            break;
 
        case '-':
-           change_color((short) current, field, -value, 1);
+           change_color((NCURSES_PAIRS_T) current, field, -value, 1);
            break;
 
        case '=':
-           change_color((short) current, field, value, 0);
+           change_color((NCURSES_PAIRS_T) current, field, value, 0);
            break;
 
        case '?':
@@ -2607,7 +2620,9 @@ color_edit(void)
            endwin();
            main_menu(FALSE);
            for (i = 0; i < max_colors; i++)
-               init_pair((short) i, (short) COLOR_WHITE, (short) i);
+               init_pair((NCURSES_PAIRS_T) i,
+                         (NCURSES_COLOR_T) COLOR_WHITE,
+                         (NCURSES_COLOR_T) i);
            refresh();
            break;
 
@@ -2674,7 +2689,7 @@ cycle_attr(int ch, unsigned *at_code, chtype *attr, ATTR_TBL * list, unsigned li
 }
 
 static bool
-cycle_colors(int ch, int *fg, int *bg, short *pair)
+cycle_colors(int ch, int *fg, int *bg, NCURSES_PAIRS_T *pair)
 {
     bool result = FALSE;
 
@@ -2702,10 +2717,12 @@ cycle_colors(int ch, int *fg, int *bg, short *pair)
            break;
        }
        if (result) {
-           *pair = (short) (*fg != COLOR_BLACK || *bg != COLOR_BLACK);
+           *pair = (NCURSES_PAIRS_T) (*fg != COLOR_BLACK || *bg != COLOR_BLACK);
            if (*pair != 0) {
                *pair = 1;
-               if (init_pair(*pair, (short) *fg, (short) *bg) == ERR) {
+               if (init_pair(*pair,
+                             (NCURSES_COLOR_T) *fg,
+                             (NCURSES_COLOR_T) *bg) == ERR) {
                    result = FALSE;
                }
            }
@@ -2764,7 +2781,7 @@ slk_help(void)
 static void
 call_slk_color(int fg, int bg)
 {
-    init_pair(1, (short) bg, (short) fg);
+    init_pair(1, (NCURSES_COLOR_T) bg, (NCURSES_COLOR_T) fg);
     slk_color(1);
     MvPrintw(SLK_WORK, 0, "Colors %d/%d\n", fg, bg);
     clrtoeol();
@@ -2786,7 +2803,7 @@ slk_test(void)
 #if HAVE_SLK_COLOR
     int fg = COLOR_BLACK;
     int bg = COLOR_WHITE;
-    short pair = 0;
+    NCURSES_PAIRS_T pair = 0;
 #endif
     ATTR_TBL my_list[SIZEOF(attrs_to_test)];
     unsigned my_size = init_attr_list(my_list, termattrs());
@@ -2910,7 +2927,7 @@ wide_slk_test(void)
     unsigned at_code = 0;
     int fg = COLOR_BLACK;
     int bg = COLOR_WHITE;
-    short pair = 0;
+    NCURSES_PAIRS_T pair = 0;
     ATTR_TBL my_list[SIZEOF(attrs_to_test)];
     unsigned my_size = init_attr_list(my_list, term_attrs());
 
@@ -3008,13 +3025,13 @@ wide_slk_test(void)
 
        case 'F':
            if (use_colors) {
-               fg = (short) ((fg + 1) % COLORS);
+               fg = (NCURSES_COLOR_T) ((fg + 1) % COLORS);
                call_slk_color(fg, bg);
            }
            break;
        case 'B':
            if (use_colors) {
-               bg = (short) ((bg + 1) % COLORS);
+               bg = (NCURSES_COLOR_T) ((bg + 1) % COLORS);
                call_slk_color(fg, bg);
            }
            break;
@@ -3025,7 +3042,7 @@ wide_slk_test(void)
 #endif
        default:
            if (cycle_attr(c, &at_code, &attr, my_list, my_size)) {
-               slk_attr_set(attr, (short) (fg || bg), NULL);
+               slk_attr_set(attr, (NCURSES_COLOR_T) (fg || bg), NULL);
                slk_touch();
                slk_noutrefresh();
                break;
@@ -3054,7 +3071,7 @@ wide_slk_test(void)
 #endif /* SLK_INIT */
 
 static void
-show_256_chars(int repeat, attr_t attr, short pair)
+show_256_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 {
     unsigned first = 0;
     unsigned last = 255;
@@ -3087,7 +3104,7 @@ show_256_chars(int repeat, attr_t attr, short pair)
  * terminal to perform functions.  The remaining codes can be graphic.
  */
 static void
-show_upper_chars(int base, int pagesize, int repeat, attr_t attr, short pair)
+show_upper_chars(int base, int pagesize, int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 {
     unsigned code;
     unsigned first = (unsigned) base;
@@ -3129,7 +3146,7 @@ show_upper_chars(int base, int pagesize, int repeat, attr_t attr, short pair)
 #define PC_COLS 4
 
 static void
-show_pc_chars(int repeat, attr_t attr, short pair)
+show_pc_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 {
     unsigned code;
 
@@ -3170,7 +3187,7 @@ show_pc_chars(int repeat, attr_t attr, short pair)
 }
 
 static void
-show_box_chars(int repeat, attr_t attr, short pair)
+show_box_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 {
     (void) repeat;
 
@@ -3217,7 +3234,7 @@ show_1_acs(int n, int repeat, const char *name, chtype code)
 }
 
 static void
-show_acs_chars(int repeat, attr_t attr, short pair)
+show_acs_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 /* display the ACS character set */
 {
     int n;
@@ -3290,8 +3307,8 @@ acs_display(void)
     int fg = COLOR_BLACK;
     int bg = COLOR_BLACK;
     unsigned at_code = 0;
-    short pair = 0;
-    void (*last_show_acs) (int, attr_t, short) = 0;
+    NCURSES_PAIRS_T pair = 0;
+    void (*last_show_acs) (int, attr_t, NCURSES_PAIRS_T) = 0;
     ATTR_TBL my_list[SIZEOF(attrs_to_test)];
     unsigned my_size = init_attr_list(my_list, termattrs());
 
@@ -3392,7 +3409,7 @@ acs_display(void)
 
 #if USE_WIDEC_SUPPORT
 static cchar_t *
-merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, short pair)
+merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, NCURSES_PAIRS_T pair)
 {
     int count;
 
@@ -3421,7 +3438,7 @@ show_paged_widechars(int base,
                     int repeat,
                     int space,
                     attr_t attr,
-                    short pair)
+                    NCURSES_PAIRS_T pair)
 {
     int first = base * pagesize;
     int last = first + pagesize - 1;
@@ -3457,7 +3474,7 @@ show_paged_widechars(int base,
 }
 
 static void
-show_upper_widechars(int first, int repeat, int space, attr_t attr, short pair)
+show_upper_widechars(int first, int repeat, int space, attr_t attr, NCURSES_PAIRS_T pair)
 {
     cchar_t temp;
     wchar_t code;
@@ -3530,7 +3547,7 @@ show_1_wacs(int n, int repeat, const char *name, const cchar_t *code)
 #define MERGE_ATTR(wch) merge_wide_attr(&temp, wch, attr, pair)
 
 static void
-show_wacs_chars(int repeat, attr_t attr, short pair)
+show_wacs_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 /* display the wide-ACS character set */
 {
     cchar_t temp;
@@ -3590,7 +3607,7 @@ show_wacs_chars(int repeat, attr_t attr, short pair)
 
 #ifdef WACS_D_PLUS
 static void
-show_wacs_chars_double(int repeat, attr_t attr, short pair)
+show_wacs_chars_double(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 /* display the wide-ACS character set */
 {
     cchar_t temp;
@@ -3651,7 +3668,7 @@ show_wacs_chars_double(int repeat, attr_t attr, short pair)
 
 #ifdef WACS_T_PLUS
 static void
-show_wacs_chars_thick(int repeat, attr_t attr, short pair)
+show_wacs_chars_thick(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 /* display the wide-ACS character set */
 {
     cchar_t temp;
@@ -3715,7 +3732,7 @@ show_wacs_chars_thick(int repeat, attr_t attr, short pair)
 #define MERGE_ATTR(n,wch) merge_wide_attr(&temp[n], wch, attr, pair)
 
 static void
-show_wbox_chars(int repeat, attr_t attr, short pair)
+show_wbox_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 {
     cchar_t temp[8];
 
@@ -3750,7 +3767,7 @@ show_wbox_chars(int repeat, attr_t attr, short pair)
 #undef MERGE_ATTR
 
 static int
-show_2_wacs(int n, const char *name, const char *code, attr_t attr, short pair)
+show_2_wacs(int n, const char *name, const char *code, attr_t attr, NCURSES_PAIRS_T pair)
 {
     const int height = 16;
     int row = 2 + (n % height);
@@ -3767,7 +3784,7 @@ show_2_wacs(int n, const char *name, const char *code, attr_t attr, short pair)
 #define SHOW_UTF8(n, name, code) show_2_wacs(n, name, code, attr, pair)
 
 static void
-show_utf8_chars(int repeat, attr_t attr, short pair)
+show_utf8_chars(int repeat, attr_t attr, NCURSES_PAIRS_T pair)
 {
     int n;
 
@@ -3832,8 +3849,8 @@ wide_acs_display(void)
     int fg = COLOR_BLACK;
     int bg = COLOR_BLACK;
     unsigned at_code = 0;
-    short pair = 0;
-    void (*last_show_wacs) (int, attr_t, short) = 0;
+    NCURSES_PAIRS_T pair = 0;
+    void (*last_show_wacs) (int, attr_t, NCURSES_PAIRS_T) = 0;
     ATTR_TBL my_list[SIZEOF(attrs_to_test)];
     unsigned my_size = init_attr_list(my_list, term_attrs());
 
@@ -4632,7 +4649,7 @@ saywhat(NCURSES_CONST char *text)
        mkpanel(rows,cols,tly,tlx) - alloc a win and panel and associate them
 --------------------------------------------------------------------------*/
 static PANEL *
-mkpanel(short color, int rows, int cols, int tly, int tlx)
+mkpanel(NCURSES_COLOR_T color, int rows, int cols, int tly, int tlx)
 {
     WINDOW *win;
     PANEL *pan = 0;
@@ -4641,8 +4658,10 @@ mkpanel(short color, int rows, int cols, int tly, int tlx)
        if ((pan = new_panel(win)) == 0) {
            delwin(win);
        } else if (use_colors) {
-           short fg = (short) ((color == COLOR_BLUE) ? COLOR_WHITE : COLOR_BLACK);
-           short bg = color;
+           NCURSES_COLOR_T fg = (NCURSES_COLOR_T) ((color == COLOR_BLUE)
+                                                   ? COLOR_WHITE
+                                                   : COLOR_BLACK);
+           NCURSES_COLOR_T bg = color;
 
            init_pair(color, fg, bg);
            wbkgdset(win, (attr_t) (COLOR_PAIR(color) | ' '));
@@ -6220,7 +6239,7 @@ overlap_helpitem(int state, int item, char *message)
 static void
 overlap_test_1_attr(WINDOW *win, int flavor, int col)
 {
-    short cpair = (short) (1 + (flavor * 2) + col);
+    NCURSES_PAIRS_T cpair = (NCURSES_PAIRS_T) (1 + (flavor * 2) + col);
 
     switch (flavor) {
     case 0:
@@ -6243,7 +6262,7 @@ overlap_test_1_attr(WINDOW *win, int flavor, int col)
 static void
 overlap_test_2_attr(WINDOW *win, int flavor, int col)
 {
-    short cpair = (short) (9 + (flavor * 2) + col);
+    NCURSES_PAIRS_T cpair = (NCURSES_PAIRS_T) (9 + (flavor * 2) + col);
 
     switch (flavor) {
     case 0:
@@ -6977,7 +6996,7 @@ main(int argc, char *argv[])
        max_pairs = COLOR_PAIRS;        /* was > 256 ? 256 : COLOR_PAIRS */
 
        if (can_change_color()) {
-           short cp;
+           NCURSES_PAIRS_T cp;
            all_colors = typeMalloc(RGB_DATA, (unsigned) max_colors);
            if (!all_colors)
                failed("all_colors");
@@ -7005,9 +7024,10 @@ main(int argc, char *argv[])
                                   && okRGB(red)
                                   && okRGB(green)
                                   && okRGB(blue)) {
-                           all_colors[c].red = (short) ((red * 1000) / scale);
-                           all_colors[c].green = (short) ((green * 1000) / scale);
-                           all_colors[c].blue = (short) ((blue * 1000) / scale);
+#define Scaled(n) (NCURSES_COLOR_T) (((n) * 1000) / scale)
+                           all_colors[c].red = Scaled(red);
+                           all_colors[c].green = Scaled(green);
+                           all_colors[c].blue = Scaled(blue);
                        }
                    }
                    fclose(fp);
index 905efb25011b18d1f50c4796432aa4c13de69cf1..d3915fba61b3fb4e7ec2cd697ca493ba9d835bfa 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2013,2014 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            *
@@ -29,7 +29,7 @@
 /****************************************************************************
  *  Author: Thomas E. Dickey                    1996-on                     *
  ****************************************************************************/
-/* $Id: test.priv.h,v 1.122 2013/10/20 00:25:18 tom Exp $ */
+/* $Id: test.priv.h,v 1.123 2014/02/01 22:09:27 tom Exp $ */
 
 #ifndef __TEST_PRIV_H
 #define __TEST_PRIV_H 1
@@ -424,6 +424,14 @@ extern int optind;
 #define NCURSES_CH_T cchar_t
 #endif
 
+#ifndef NCURSES_COLOR_T
+#define NCURSES_COLOR_T short
+#endif
+
+#ifndef NCURSES_PAIRS_T
+#define NCURSES_PAIRS_T short
+#endif
+
 #ifndef NCURSES_OPAQUE
 #define NCURSES_OPAQUE 0
 #endif
@@ -546,7 +554,7 @@ extern char *strnames[], *strcodes[], *strfnames[];
        if ((count = getcchar(s, NULL, NULL, NULL, NULL)) > 0) { \
            wchar_t test_wch[CCHARW_MAX + 2]; \
            attr_t test_attrs; \
-           short test_pair; \
+           NCURSES_PAIRS_T test_pair; \
            \
            if (getcchar( s, test_wch, &test_attrs, &test_pair, NULL) == OK \
                && test_wch[0] != L'\0') { \