]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.9 - patch 20120310
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 11 Mar 2012 01:59:25 +0000 (01:59 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 11 Mar 2012 01:59:25 +0000 (01:59 +0000)
+ fix some strict compiler warnings for abi6 and 64-bits.
+ use begin_va_copy/end_va_copy macros in lib_printw.c (cf: 20120303).
+ improve a limit-check in infocmp.c (Werner Fink):

34 files changed:
NEWS
dist.mk
form/fld_def.c
form/fld_dup.c
form/fld_just.c
form/fld_link.c
form/fld_max.c
form/fld_move.c
form/fld_page.c
form/fld_stat.c
form/form.priv.h
form/frm_def.c
form/frm_driver.c
form/frm_hook.c
menu/m_attribs.c
menu/m_driver.c
menu/m_format.c
menu/m_global.c
menu/m_hook.c
menu/m_item_new.c
menu/m_pad.c
menu/m_post.c
menu/m_spacing.c
menu/menu.priv.h
menu/mf_common.h
ncurses/base/lib_bkgd.c
ncurses/base/lib_printw.c
ncurses/curses.priv.h
ncurses/widechar/lib_cchar.c
panel/p_above.c
panel/p_below.c
progs/dump_entry.c
progs/infocmp.c
progs/toe.c

diff --git a/NEWS b/NEWS
index bd9a03a7476380998ddeed0d69c2d31a057cd5c7..ec3a1e2feb93cf82e182703eee8bc22af30b21b1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1873 2012/03/01 09:53:21 tom Exp $
+-- $Id: NEWS,v 1.1876 2012/03/11 00:35:40 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,11 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20120310
+       + fix some strict compiler warnings for abi6 and 64-bits.
+       + use begin_va_copy/end_va_copy macros in lib_printw.c (cf: 20120303).
+       + improve a limit-check in infocmp.c (Werner Fink):
+
 20120303
        + minor tidying of terminfo.tail, clarify reason for limitation
          regarding mapping of \0 to \200
 20120303
        + minor tidying of terminfo.tail, clarify reason for limitation
          regarding mapping of \0 to \200
diff --git a/dist.mk b/dist.mk
index 77d627d4e4725766ed199e15cdeb9ecd70090b29..3f54946f7841bac6957ad78342b7ce70b3b76add 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.862 2012/02/29 10:02:11 tom Exp $
+# $Id: dist.mk,v 1.863 2012/03/10 19:42:38 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 9
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 9
-NCURSES_PATCH = 20120303
+NCURSES_PATCH = 20120310
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 604e01895d8d2bafcf41476e6b9b94b3e964e042..681a3713e8c7a07e92160e14e274a00ae1ec9ef5 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_def.c,v 1.39 2011/07/16 22:26:11 tom Exp $")
+MODULE_ID("$Id: fld_def.c,v 1.40 2012/03/11 00:37:16 tom Exp $")
 
 /* this can't be readonly */
 static FIELD default_field =
 
 /* this can't be readonly */
 static FIELD default_field =
@@ -294,14 +294,14 @@ new_field(int rows, int cols, int frow, int fcol, int nrow, int nbuf)
     {
       T((T_CREATE("field %p"), (void *)New_Field));
       *New_Field = default_field;
     {
       T((T_CREATE("field %p"), (void *)New_Field));
       *New_Field = default_field;
-      New_Field->rows = rows;
-      New_Field->cols = cols;
+      New_Field->rows = (short) rows;
+      New_Field->cols = (short) cols;
       New_Field->drows = rows + nrow;
       New_Field->dcols = cols;
       New_Field->drows = rows + nrow;
       New_Field->dcols = cols;
-      New_Field->frow = frow;
-      New_Field->fcol = fcol;
+      New_Field->frow = (short) frow;
+      New_Field->fcol = (short) fcol;
       New_Field->nrow = nrow;
       New_Field->nrow = nrow;
-      New_Field->nbuf = nbuf;
+      New_Field->nbuf = (short) nbuf;
       New_Field->link = New_Field;
 
 #if USE_WIDEC_SUPPORT
       New_Field->link = New_Field;
 
 #if USE_WIDEC_SUPPORT
index b8e501b38329ed6a69b5b6b12c5a72ac4f86f49c..2df40ee0590e6213ffa67d39b63b74e7507f27ac 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_dup.c,v 1.13 2010/01/23 21:14:35 tom Exp $")
+MODULE_ID("$Id: fld_dup.c,v 1.14 2012/03/11 00:37:16 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform
@@ -60,8 +60,8 @@ dup_field(FIELD *field, int frow, int fcol)
     {
       T((T_CREATE("field %p"), (void *)New_Field));
       *New_Field = *_nc_Default_Field;
     {
       T((T_CREATE("field %p"), (void *)New_Field));
       *New_Field = *_nc_Default_Field;
-      New_Field->frow = frow;
-      New_Field->fcol = fcol;
+      New_Field->frow = (short) frow;
+      New_Field->fcol = (short) fcol;
       New_Field->link = New_Field;
       New_Field->rows = field->rows;
       New_Field->cols = field->cols;
       New_Field->link = New_Field;
       New_Field->rows = field->rows;
       New_Field->cols = field->cols;
index 58a1750cc092b254ab56dd173c5e6e00b89e0192..dea20b79b41c3349171793c781110c96843c9d74 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_just.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
+MODULE_ID("$Id: fld_just.c,v 1.13 2012/03/11 00:37:16 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -59,7 +59,7 @@ set_field_just(FIELD *field, int just)
       Normalize_Field(field);
       if (field->just != just)
        {
       Normalize_Field(field);
       if (field->just != just)
        {
-         field->just = just;
+         field->just = (short) just;
          res = _nc_Synchronize_Attributes(field);
        }
       else
          res = _nc_Synchronize_Attributes(field);
        }
       else
index 18103bee19105dbc67ac950950c17b579de29dae..b6c47680aa87e20967447c52d99c4a6c8911d7d4 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2007,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_link.c,v 1.12 2010/01/23 21:14:35 tom Exp $")
+MODULE_ID("$Id: fld_link.c,v 1.13 2012/03/11 00:37:16 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -61,8 +61,8 @@ link_field(FIELD *field, int frow, int fcol)
     {
       T((T_CREATE("field %p"), (void *)New_Field));
       *New_Field = *_nc_Default_Field;
     {
       T((T_CREATE("field %p"), (void *)New_Field));
       *New_Field = *_nc_Default_Field;
-      New_Field->frow = frow;
-      New_Field->fcol = fcol;
+      New_Field->frow = (short) frow;
+      New_Field->fcol = (short) fcol;
 
       New_Field->link = field->link;
       field->link = New_Field;
 
       New_Field->link = field->link;
       field->link = New_Field;
index 5ce918e4e0798484801c7a5beca0bd717838a07a..6f72a388d266521aebdb5ceb28f594d1b7f60cec 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_max.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: fld_max.c,v 1.11 2012/03/11 00:37:16 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -62,7 +62,7 @@ set_max_field(FIELD *field, int maxgrow)
            RETURN(E_BAD_ARGUMENT);
        }
       field->maxgrow = maxgrow;
            RETURN(E_BAD_ARGUMENT);
        }
       field->maxgrow = maxgrow;
-      field->status &= ~_MAY_GROW;
+      field->status &= (unsigned short) (~_MAY_GROW);
       if (!(field->opts & O_STATIC))
        {
          if ((maxgrow == 0) ||
       if (!(field->opts & O_STATIC))
        {
          if ((maxgrow == 0) ||
index dfba22d72aaaccd9f5964f01e47ca833f64c5119..99f549041b561c6ede5f7b5634e254a70d15219b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_move.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: fld_move.c,v 1.11 2012/03/11 00:37:16 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -56,8 +56,8 @@ move_field(FIELD *field, int frow, int fcol)
   if (field->form)
     RETURN(E_CONNECTED);
 
   if (field->form)
     RETURN(E_CONNECTED);
 
-  field->frow = frow;
-  field->fcol = fcol;
+  field->frow = (short) frow;
+  field->fcol = (short) fcol;
   RETURN(E_OK);
 }
 
   RETURN(E_OK);
 }
 
index e4d18c556be610485df81fcc57491910a84b5b9d..8d5c8cbf73ba1ea60a9793a4fba1cd936832f3b9 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_page.c,v 1.10 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: fld_page.c,v 1.11 2012/03/11 00:37:16 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -56,7 +56,7 @@ set_new_page(FIELD *field, bool new_page_flag)
   if (new_page_flag)
     field->status |= _NEWPAGE;
   else
   if (new_page_flag)
     field->status |= _NEWPAGE;
   else
-    field->status &= ~_NEWPAGE;
+    field->status &= (unsigned short) (~_NEWPAGE);
 
   RETURN(E_OK);
 }
 
   RETURN(E_OK);
 }
index 46f89e674836e7ce83de568fb5fcdb48ed3046b2..3e6f1921677d8b4ae204699e6673e79cdbf5ceee 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_stat.c,v 1.12 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: fld_stat.c,v 1.13 2012/03/11 00:37:16 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -53,7 +53,7 @@ set_field_status(FIELD *field, bool status)
   if (status)
     field->status |= _CHANGED;
   else
   if (status)
     field->status |= _CHANGED;
   else
-    field->status &= ~_CHANGED;
+    field->status &= (unsigned short)(~_CHANGED);
 
   RETURN(E_OK);
 }
 
   RETURN(E_OK);
 }
index 49250b4e5b3b15f714babe218bf7dd9204f6ec9b..38dd8caa263e2922cf73ad259788b14e02098440 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: form.priv.h,v 0.32 2009/11/07 21:26:43 tom Exp $ */
+/* $Id: form.priv.h,v 0.33 2012/03/11 00:37:46 tom Exp $ */
 
 #ifndef FORM_PRIV_H
 #define FORM_PRIV_H 1
 
 #ifndef FORM_PRIV_H
 #define FORM_PRIV_H 1
-
+/* *INDENT-OFF*/
 #include "curses.priv.h"
 #include "mf_common.h"
 
 #include "curses.priv.h"
 #include "mf_common.h"
 
@@ -119,7 +119,7 @@ extern NCURSES_EXPORT_VAR(FIELDTYPE *) _nc_Default_FieldType;
 
 /* Calculate the total size of all buffers for this field */
 #define Total_Buffer_Size(field) \
 
 /* Calculate the total size of all buffers for this field */
 #define Total_Buffer_Size(field) \
-   ( (Buffer_Length(field) + 1) * (1+(field)->nbuf) * sizeof(FIELD_CELL) )
+   ( (size_t)(Buffer_Length(field) + 1) * (size_t)(1+(field)->nbuf) * sizeof(FIELD_CELL) )
 
 /* Logic to determine whether or not a field is single lined */
 #define Single_Line_Field(field) \
 
 /* Logic to determine whether or not a field is single lined */
 #define Single_Line_Field(field) \
@@ -293,5 +293,6 @@ extern NCURSES_EXPORT(Form_Hook)    _nc_retrace_form_hook (Form_Hook);
       result = ((*buffer || (l < width)) ? FALSE : TRUE); \
     }
 #endif
       result = ((*buffer || (l < width)) ? FALSE : TRUE); \
     }
 #endif
+/* *INDENT-ON*/
 
 #endif /* FORM_PRIV_H */
 
 #endif /* FORM_PRIV_H */
index 86500f239863f125c81c5178ac3c0896fd3d86ac..fd7b56a421c5f017c6330ea549135aa8a94da785 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_def.c,v 1.25 2010/01/23 21:14:36 tom Exp $")
+MODULE_ID("$Id: frm_def.c,v 1.26 2012/03/11 00:37:16 tom Exp $")
 
 /* this can't be readonly */
 static FORM default_form =
 
 /* this can't be readonly */
 static FORM default_form =
@@ -199,14 +199,14 @@ Connect_Fields(FORM *form, FIELD **fields)
   for (j = 0; j < field_cnt; j++)
     {
       if (j == 0)
   for (j = 0; j < field_cnt; j++)
     {
       if (j == 0)
-       pg->pmin = j;
+       pg->pmin = (short) j;
       else
        {
          if (fields[j]->status & _NEWPAGE)
            {
       else
        {
          if (fields[j]->status & _NEWPAGE)
            {
-             pg->pmax = j - 1;
+             pg->pmax = (short) (j - 1);
              pg++;
              pg++;
-             pg->pmin = j;
+             pg->pmin = (short) j;
            }
        }
 
            }
        }
 
@@ -214,14 +214,14 @@ Connect_Fields(FORM *form, FIELD **fields)
       maximum_col_in_field = fields[j]->fcol + fields[j]->cols;
 
       if (form->rows < maximum_row_in_field)
       maximum_col_in_field = fields[j]->fcol + fields[j]->cols;
 
       if (form->rows < maximum_row_in_field)
-       form->rows = maximum_row_in_field;
+       form->rows = (short) maximum_row_in_field;
       if (form->cols < maximum_col_in_field)
       if (form->cols < maximum_col_in_field)
-       form->cols = maximum_col_in_field;
+       form->cols = (short) maximum_col_in_field;
     }
 
     }
 
-  pg->pmax = field_cnt - 1;
-  form->maxfield = field_cnt;
-  form->maxpage = page_nr;
+  pg->pmax = (short) (field_cnt - 1);
+  form->maxfield = (short) field_cnt;
+  form->maxpage = (short) page_nr;
 
   /* Sort fields on form pages */
   for (page_nr = 0; page_nr < form->maxpage; page_nr++)
 
   /* Sort fields on form pages */
   for (page_nr = 0; page_nr < form->maxpage; page_nr++)
@@ -230,8 +230,8 @@ Connect_Fields(FORM *form, FIELD **fields)
 
       for (j = form->page[page_nr].pmin; j <= form->page[page_nr].pmax; j++)
        {
 
       for (j = form->page[page_nr].pmin; j <= form->page[page_nr].pmax; j++)
        {
-         fields[j]->index = j;
-         fields[j]->page = page_nr;
+         fields[j]->index = (short) j;
+         fields[j]->page = (short) page_nr;
          fld = Insert_Field_By_Position(fields[j], fld);
        }
       if (fld)
          fld = Insert_Field_By_Position(fields[j], fld);
        }
       if (fld)
index f335ed2611c2a7ce8578d37ecc80dfbca1190a0c..549ce8058efa5d25c33876b885fa17f51ade4dec 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_driver.c,v 1.99 2011/09/17 22:12:10 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.100 2012/03/11 00:37:16 tom Exp $")
 
 /*----------------------------------------------------------------------------
   This is the core module of the form library. It contains the majority
 
 /*----------------------------------------------------------------------------
   This is the core module of the form library. It contains the majority
@@ -172,7 +172,7 @@ static int FE_Delete_Previous(FORM *);
    instead of a derived window because it contains invisible parts.
    This is true for non-public fields and for scrollable fields. */
 #define Has_Invisible_Parts(field)     \
    instead of a derived window because it contains invisible parts.
    This is true for non-public fields and for scrollable fields. */
 #define Has_Invisible_Parts(field)     \
-  (!((field)->opts & O_PUBLIC)      || \
+  (!((unsigned)(field)->opts & O_PUBLIC) || \
    Is_Scroll_Field(field))
 
 /* Logic to decide whether or not a field needs justification */
    Is_Scroll_Field(field))
 
 /* Logic to decide whether or not a field needs justification */
@@ -180,7 +180,7 @@ static int FE_Delete_Previous(FORM *);
    (((field)->just != NO_JUSTIFICATION)  && \
     (Single_Line_Field(field))           && \
     (((field)->dcols == (field)->cols)   && \
    (((field)->just != NO_JUSTIFICATION)  && \
     (Single_Line_Field(field))           && \
     (((field)->dcols == (field)->cols)   && \
-    ((field)->opts & O_STATIC))             )
+    ((unsigned)(field)->opts & O_STATIC)))
 
 /* Logic to determine whether or not a dynamic field may still grow */
 #define Growable(field) ((field)->status & _MAY_GROW)
 
 /* Logic to determine whether or not a dynamic field may still grow */
 #define Growable(field) ((field)->status & _MAY_GROW)
@@ -188,13 +188,13 @@ static int FE_Delete_Previous(FORM *);
 /* Macro to set the attributes for a fields window */
 #define Set_Field_Window_Attributes(field,win) \
 (  wbkgdset((win),(chtype)((field)->pad | (field)->back)), \
 /* Macro to set the attributes for a fields window */
 #define Set_Field_Window_Attributes(field,win) \
 (  wbkgdset((win),(chtype)((field)->pad | (field)->back)), \
-   (void) wattrset((win),(field)->fore) )
+   (void) wattrset((win), (int)(field)->fore) )
 
 /* Logic to decide whether or not a field really appears on the form */
 #define Field_Really_Appears(field)         \
   ((field->form)                          &&\
    (field->form->status & _POSTED)        &&\
 
 /* Logic to decide whether or not a field really appears on the form */
 #define Field_Really_Appears(field)         \
   ((field->form)                          &&\
    (field->form->status & _POSTED)        &&\
-   (field->opts & O_VISIBLE)              &&\
+   ((unsigned)field->opts & O_VISIBLE)    &&\
    (field->page == field->form->curpage))
 
 /* Logic to determine whether or not we are on the first position in the
    (field->page == field->form->curpage))
 
 /* Logic to determine whether or not we are on the first position in the
@@ -601,7 +601,7 @@ Synchronize_Buffer(FORM *form)
 {
   if (form->status & _WINDOW_MODIFIED)
     {
 {
   if (form->status & _WINDOW_MODIFIED)
     {
-      form->status &= ~_WINDOW_MODIFIED;
+      form->status &= (unsigned short) (~_WINDOW_MODIFIED);
       form->status |= _FCHECK_REQUIRED;
       Window_To_Buffer(form, form->current);
       wmove(form->w, form->currow, form->curcol);
       form->status |= _FCHECK_REQUIRED;
       Window_To_Buffer(form, form->current);
       wmove(form->w, form->currow, form->curcol);
@@ -653,7 +653,7 @@ Field_Grown(FIELD *field, int amount)
            growth = Minimum(field->maxgrow - field->dcols, growth);
          field->dcols += growth;
          if (field->dcols == field->maxgrow)
            growth = Minimum(field->maxgrow - field->dcols, growth);
          field->dcols += growth;
          if (field->dcols == field->maxgrow)
-           field->status &= ~_MAY_GROW;
+           field->status &= (unsigned short) (~_MAY_GROW);
        }
       else
        {
        }
       else
        {
@@ -662,7 +662,7 @@ Field_Grown(FIELD *field, int amount)
            growth = Minimum(field->maxgrow - field->drows, growth);
          field->drows += growth;
          if (field->drows == field->maxgrow)
            growth = Minimum(field->maxgrow - field->drows, growth);
          field->drows += growth;
          if (field->drows == field->maxgrow)
-           field->status &= ~_MAY_GROW;
+           field->status &= (unsigned short) (~_MAY_GROW);
        }
       /* drows, dcols changed, so we get really the new buffer length */
       new_buflen = Buffer_Length(field);
        }
       /* drows, dcols changed, so we get really the new buffer length */
       new_buflen = Buffer_Length(field);
@@ -860,7 +860,7 @@ _nc_Refresh_Current_Field(FORM *form)
   field = form->current;
   formwin = Get_Form_Window(form);
 
   field = form->current;
   formwin = Get_Form_Window(form);
 
-  if (field->opts & O_PUBLIC)
+  if ((unsigned)field->opts & O_PUBLIC)
     {
       if (Is_Scroll_Field(field))
        {
     {
       if (Is_Scroll_Field(field))
        {
@@ -909,7 +909,7 @@ _nc_Refresh_Current_Field(FORM *form)
                      /* means we have to copy whole range */
                      first_modified_row = form->toprow;
                      first_unmodified_row = first_modified_row + field->rows;
                      /* means we have to copy whole range */
                      first_modified_row = form->toprow;
                      first_unmodified_row = first_modified_row + field->rows;
-                     field->status &= ~_NEWTOP;
+                     field->status &= (unsigned short)(~_NEWTOP);
                    }
                  else
                    {
                    }
                  else
                    {
@@ -1111,27 +1111,27 @@ Display_Or_Erase_Field(FIELD *field, bool bEraseFlag)
     return E_SYSTEM_ERROR;
   else
     {
     return E_SYSTEM_ERROR;
   else
     {
-      if (field->opts & O_VISIBLE)
+      if ((unsigned)field->opts & O_VISIBLE)
        {
          Set_Field_Window_Attributes(field, win);
        }
       else
        {
        {
          Set_Field_Window_Attributes(field, win);
        }
       else
        {
-         (void)wattrset(win, WINDOW_ATTRS(fwin));
+         (void)wattrset(win, (int)WINDOW_ATTRS(fwin));
        }
       werase(win);
     }
 
   if (!bEraseFlag)
     {
        }
       werase(win);
     }
 
   if (!bEraseFlag)
     {
-      if (field->opts & O_PUBLIC)
+      if ((unsigned)field->opts & O_PUBLIC)
        {
          if (Justification_Allowed(field))
            Perform_Justification(field, win);
          else
            Buffer_To_Window(field, win);
        }
        {
          if (Justification_Allowed(field))
            Perform_Justification(field, win);
          else
            Buffer_To_Window(field, win);
        }
-      field->status &= ~_NEWTOP;
+      field->status &= (unsigned short)(~_NEWTOP);
     }
   wsyncup(win);
   delwin(win);
     }
   wsyncup(win);
   delwin(win);
@@ -1170,7 +1170,7 @@ Synchronize_Field(FIELD *field)
          form->currow = form->curcol = form->toprow = form->begincol = 0;
          werase(form->w);
 
          form->currow = form->curcol = form->toprow = form->begincol = 0;
          werase(form->w);
 
-         if ((field->opts & O_PUBLIC) && Justification_Allowed(field))
+         if (((unsigned)field->opts & O_PUBLIC) && Justification_Allowed(field))
            Undo_Justification(field, form->w);
          else
            Buffer_To_Window(field, form->w);
            Undo_Justification(field, form->w);
          else
            Buffer_To_Window(field, form->w);
@@ -1256,7 +1256,7 @@ _nc_Synchronize_Attributes(FIELD *field)
          werase(form->w);
          wmove(form->w, form->currow, form->curcol);
 
          werase(form->w);
          wmove(form->w, form->currow, form->curcol);
 
-         if (field->opts & O_PUBLIC)
+         if ((unsigned)field->opts & O_PUBLIC)
            {
              if (Justification_Allowed(field))
                Undo_Justification(field, form->w);
            {
              if (Justification_Allowed(field))
                Undo_Justification(field, form->w);
@@ -1328,32 +1328,32 @@ _nc_Synchronize_Options(FIELD *field, Field_Options newopts)
            }
          if (form->curpage == field->page)
            {
            }
          if (form->curpage == field->page)
            {
-             if (changed_opts & O_VISIBLE)
+             if ((unsigned) changed_opts & O_VISIBLE)
                {
                {
-                 if (newopts & O_VISIBLE)
+                 if ((unsigned) newopts & O_VISIBLE)
                    res = Display_Field(field);
                  else
                    res = Erase_Field(field);
                }
              else
                {
                    res = Display_Field(field);
                  else
                    res = Erase_Field(field);
                }
              else
                {
-                 if ((changed_opts & O_PUBLIC) &&
-                     (newopts & O_VISIBLE))
+                 if (((unsigned) changed_opts & O_PUBLIC) &&
+                     ((unsigned) newopts & O_VISIBLE))
                    res = Display_Field(field);
                }
            }
        }
     }
 
                    res = Display_Field(field);
                }
            }
        }
     }
 
-  if (changed_opts & O_STATIC)
+  if ((unsigned) changed_opts & O_STATIC)
     {
       bool single_line_field = Single_Line_Field(field);
       int res2 = E_OK;
 
     {
       bool single_line_field = Single_Line_Field(field);
       int res2 = E_OK;
 
-      if (newopts & O_STATIC)
+      if ((unsigned) newopts & O_STATIC)
        {
          /* the field becomes now static */
        {
          /* the field becomes now static */
-         field->status &= ~_MAY_GROW;
+         field->status &= (unsigned short)(~_MAY_GROW);
          /* if actually we have no hidden columns, justification may
             occur again */
          if (single_line_field &&
          /* if actually we have no hidden columns, justification may
             occur again */
          if (single_line_field &&
@@ -1424,16 +1424,16 @@ _nc_Set_Current_Field(FORM *form, FIELD *newfield)
       !(form->status & _POSTED))
     {
       if ((form->w) &&
       !(form->status & _POSTED))
     {
       if ((form->w) &&
-         (field->opts & O_VISIBLE) &&
+         ((unsigned)field->opts & O_VISIBLE) &&
          (field->form->curpage == field->page))
        {
          _nc_Refresh_Current_Field(form);
          (field->form->curpage == field->page))
        {
          _nc_Refresh_Current_Field(form);
-         if (field->opts & O_PUBLIC)
+         if ((unsigned)field->opts & O_PUBLIC)
            {
              if (field->drows > field->rows)
                {
                  if (form->toprow == 0)
            {
              if (field->drows > field->rows)
                {
                  if (form->toprow == 0)
-                   field->status &= ~_NEWTOP;
+                   field->status &= (unsigned short)(~_NEWTOP);
                  else
                    field->status |= _NEWTOP;
                }
                  else
                    field->status |= _NEWTOP;
                }
@@ -1469,7 +1469,7 @@ _nc_Set_Current_Field(FORM *form, FIELD *newfield)
        delwin(form->w);
       form->w = new_window;
 
        delwin(form->w);
       form->w = new_window;
 
-      form->status &= ~_WINDOW_MODIFIED;
+      form->status &= (unsigned short)(~_WINDOW_MODIFIED);
       Set_Field_Window_Attributes(field, form->w);
 
       if (Has_Invisible_Parts(field))
       Set_Field_Window_Attributes(field, form->w);
 
       if (Has_Invisible_Parts(field))
@@ -2430,7 +2430,7 @@ Wrapping_Not_Necessary_Or_Wrapping_Ok(FORM *form)
   int result = E_REQUEST_DENIED;
   bool Last_Row = ((field->drows - 1) == form->currow);
 
   int result = E_REQUEST_DENIED;
   bool Last_Row = ((field->drows - 1) == form->currow);
 
-  if ((field->opts & O_WRAP) &&        /* wrapping wanted     */
+  if (((unsigned)field->opts & O_WRAP) &&      /* wrapping wanted     */
       (!Single_Line_Field(field)) &&   /* must be multi-line  */
       (There_Is_No_Room_For_A_Char_In_Line(form)) &&   /* line is full        */
       (!Last_Row || Growable(field)))  /* there are more lines */
       (!Single_Line_Field(field)) &&   /* must be multi-line  */
       (There_Is_No_Room_For_A_Char_In_Line(form)) &&   /* line is full        */
       (!Last_Row || Growable(field)))  /* there are more lines */
@@ -2513,7 +2513,7 @@ Field_Editing(int (*const fct) (FORM *), FORM *form)
      editable fields.
    */
   if ((fct == FE_Delete_Previous) &&
      editable fields.
    */
   if ((fct == FE_Delete_Previous) &&
-      (form->opts & O_BS_OVERLOAD) &&
+      ((unsigned)form->opts & O_BS_OVERLOAD) &&
       First_Position_In_Current_Field(form))
     {
       res = Inter_Field_Navigation(FN_Previous_Field, form);
       First_Position_In_Current_Field(form))
     {
       res = Inter_Field_Navigation(FN_Previous_Field, form);
@@ -2522,7 +2522,7 @@ Field_Editing(int (*const fct) (FORM *), FORM *form)
     {
       if (fct == FE_New_Line)
        {
     {
       if (fct == FE_New_Line)
        {
-         if ((form->opts & O_NL_OVERLOAD) &&
+         if (((unsigned)form->opts & O_NL_OVERLOAD) &&
              First_Position_In_Current_Field(form))
            {
              res = Inter_Field_Navigation(FN_Next_Field, form);
              First_Position_In_Current_Field(form))
            {
              res = Inter_Field_Navigation(FN_Next_Field, form);
@@ -2534,7 +2534,7 @@ Field_Editing(int (*const fct) (FORM *), FORM *form)
       else
        {
          /* From now on, everything must be editable */
       else
        {
          /* From now on, everything must be editable */
-         if (form->current->opts & O_EDIT)
+         if ((unsigned)form->current->opts & O_EDIT)
            {
              res = fct(form);
              if (res == E_OK)
            {
              res = fct(form);
              if (res == E_OK)
@@ -2571,7 +2571,7 @@ FE_New_Line(FORM *form)
       if (Last_Row &&
          (!(Growable(field) && !Single_Line_Field(field))))
        {
       if (Last_Row &&
          (!(Growable(field) && !Single_Line_Field(field))))
        {
-         if (!(form->opts & O_NL_OVERLOAD))
+         if (!((unsigned)form->opts & O_NL_OVERLOAD))
            returnCode(E_REQUEST_DENIED);
          wmove(form->w, form->currow, form->curcol);
          wclrtoeol(form->w);
            returnCode(E_REQUEST_DENIED);
          wmove(form->w, form->currow, form->curcol);
          wclrtoeol(form->w);
@@ -2605,7 +2605,7 @@ FE_New_Line(FORM *form)
       if (Last_Row &&
          !(Growable(field) && !Single_Line_Field(field)))
        {
       if (Last_Row &&
          !(Growable(field) && !Single_Line_Field(field)))
        {
-         if (!(form->opts & O_NL_OVERLOAD))
+         if (!((unsigned)form->opts & O_NL_OVERLOAD))
            returnCode(E_REQUEST_DENIED);
          returnCode(Inter_Field_Navigation(FN_Next_Field, form));
        }
            returnCode(E_REQUEST_DENIED);
          returnCode(Inter_Field_Navigation(FN_Next_Field, form));
        }
@@ -2942,7 +2942,7 @@ static int
 EM_Insert_Mode(FORM *form)
 {
   T((T_CALLED("EM_Insert_Mode(%p)"), (void *)form));
 EM_Insert_Mode(FORM *form)
 {
   T((T_CALLED("EM_Insert_Mode(%p)"), (void *)form));
-  form->status &= ~_OVLMODE;
+  form->status &= (unsigned short)(~_OVLMODE);
   returnCode(E_OK);
 }
 
   returnCode(E_OK);
 }
 
@@ -3111,7 +3111,7 @@ Check_Field(FORM *form, FIELDTYPE *typ, FIELD *field, TypeArgument *argp)
 {
   if (typ)
     {
 {
   if (typ)
     {
-      if (field->opts & O_NULLOK)
+      if ((unsigned)field->opts & O_NULLOK)
        {
          FIELD_CELL *bp = field->buf;
 
        {
          FIELD_CELL *bp = field->buf;
 
@@ -3168,11 +3168,11 @@ _nc_Internal_Validation(FORM *form)
 
   Synchronize_Buffer(form);
   if ((form->status & _FCHECK_REQUIRED) ||
 
   Synchronize_Buffer(form);
   if ((form->status & _FCHECK_REQUIRED) ||
-      (!(field->opts & O_PASSOK)))
+      (!((unsigned)field->opts & O_PASSOK)))
     {
       if (!Check_Field(form, field->type, field, (TypeArgument *)(field->arg)))
        return FALSE;
     {
       if (!Check_Field(form, field->type, field, (TypeArgument *)(field->arg)))
        return FALSE;
-      form->status &= ~_FCHECK_REQUIRED;
+      form->status &= (unsigned short)(~_FCHECK_REQUIRED);
       field->status |= _CHANGED;
       Synchronize_Linked_Fields(field);
     }
       field->status |= _CHANGED;
       Synchronize_Linked_Fields(field);
     }
@@ -3273,14 +3273,15 @@ _nc_First_Active_Field(FORM *form)
          do
            {
              field = (field == last_on_page) ? first : field + 1;
          do
            {
              field = (field == last_on_page) ? first : field + 1;
-             if (((*field)->opts & O_VISIBLE))
+             if (((unsigned)(*field)->opts & O_VISIBLE))
                break;
            }
          while (proposed != (*field));
 
          proposed = *field;
 
                break;
            }
          while (proposed != (*field));
 
          proposed = *field;
 
-         if ((proposed == *last_on_page) && !(proposed->opts & O_VISIBLE))
+         if ((proposed == *last_on_page) &&
+             !((unsigned)proposed->opts & O_VISIBLE))
            {
              /* This means, there is also no visible field on the page.
                 So we propose the first one and hope the very best...
            {
              /* This means, there is also no visible field on the page.
                 So we propose the first one and hope the very best...
@@ -3816,11 +3817,11 @@ _nc_Set_Form_Page(FORM *form, int page, FIELD *field)
       FIELD *last_field, *field_on_page;
 
       werase(Get_Form_Window(form));
       FIELD *last_field, *field_on_page;
 
       werase(Get_Form_Window(form));
-      form->curpage = page;
+      form->curpage = (short)page;
       last_field = field_on_page = form->field[form->page[page].smin];
       do
        {
       last_field = field_on_page = form->field[form->page[page].smin];
       do
        {
-         if (field_on_page->opts & O_VISIBLE)
+         if ((unsigned)field_on_page->opts & O_VISIBLE)
            if ((res = Display_Field(field_on_page)) != E_OK)
              return (res);
          field_on_page = field_on_page->snext;
            if ((res = Display_Field(field_on_page)) != E_OK)
              return (res);
          field_on_page = field_on_page->snext;
@@ -3999,13 +4000,13 @@ Data_Entry(FORM *form, int c)
   int result = E_REQUEST_DENIED;
 
   T((T_CALLED("Data_Entry(%p,%s)"), (void *)form, _tracechtype((chtype)c)));
   int result = E_REQUEST_DENIED;
 
   T((T_CALLED("Data_Entry(%p,%s)"), (void *)form, _tracechtype((chtype)c)));
-  if ((field->opts & O_EDIT)
+  if (((unsigned) field->opts & O_EDIT)
 #if FIX_FORM_INACTIVE_BUG
 #if FIX_FORM_INACTIVE_BUG
-      && (field->opts & O_ACTIVE)
+      && ((unsigned) field->opts & O_ACTIVE)
 #endif
     )
     {
 #endif
     )
     {
-      if ((field->opts & O_BLANK) &&
+      if (((unsigned) field->opts & O_BLANK) &&
          First_Position_In_Current_Field(form) &&
          !(form->status & _FCHECK_REQUIRED) &&
          !(form->status & _WINDOW_MODIFIED))
          First_Position_In_Current_Field(form) &&
          !(form->status & _FCHECK_REQUIRED) &&
          !(form->status & _WINDOW_MODIFIED))
@@ -4036,7 +4037,7 @@ Data_Entry(FORM *form, int c)
                               ((field->dcols - 1) == form->curcol));
 
          form->status |= _WINDOW_MODIFIED;
                               ((field->dcols - 1) == form->curcol));
 
          form->status |= _WINDOW_MODIFIED;
-         if (End_Of_Field && !Growable(field) && (field->opts & O_AUTOSKIP))
+         if (End_Of_Field && !Growable(field) && ((unsigned) field->opts & O_AUTOSKIP))
            result = Inter_Field_Navigation(FN_Next_Field, form);
          else
            {
            result = Inter_Field_Navigation(FN_Next_Field, form);
          else
            {
@@ -4246,7 +4247,7 @@ form_driver(FORM *form, int c)
        NULL                    /* Choice Request is generic           */
       };
       size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
        NULL                    /* Choice Request is generic           */
       };
       size_t nMethods = (sizeof(Generic_Methods) / sizeof(Generic_Methods[0]));
-      size_t method = (BI->keycode >> ID_Shft) & 0xffff;       /* see ID_Mask */
+      size_t method = (size_t)((BI->keycode >> ID_Shft) & 0xffff);     /* see ID_Mask */
 
       if ((method >= nMethods) || !(BI->cmd))
        res = E_SYSTEM_ERROR;
 
       if ((method >= nMethods) || !(BI->cmd))
        res = E_SYSTEM_ERROR;
@@ -4401,14 +4402,14 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
   if (!field || !value || ((buffer < 0) || (buffer > field->nbuf)))
     RETURN(E_BAD_ARGUMENT);
 
   if (!field || !value || ((buffer < 0) || (buffer > field->nbuf)))
     RETURN(E_BAD_ARGUMENT);
 
-  len = Buffer_Length(field);
+  len = (unsigned) Buffer_Length(field);
 
   if (Growable(field))
     {
       /* for a growable field we must assume zero terminated strings, because
          somehow we have to detect the length of what should be copied.
        */
 
   if (Growable(field))
     {
       /* for a growable field we must assume zero terminated strings, because
          somehow we have to detect the length of what should be copied.
        */
-      unsigned int vlen = strlen(value);
+      unsigned vlen = (unsigned) strlen(value);
 
       if (vlen > len)
        {
 
       if (vlen > len)
        {
@@ -4438,7 +4439,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
       delwin(field->working);
       field->working = newpad(1, Buffer_Length(field) + 1);
     }
       delwin(field->working);
       field->working = newpad(1, Buffer_Length(field) + 1);
     }
-  len = Buffer_Length(field);
+  len = (unsigned)Buffer_Length(field);
   wclear(field->working);
   (void)mvwaddstr(field->working, 0, 0, value);
 
   wclear(field->working);
   (void)mvwaddstr(field->working, 0, 0, value);
 
@@ -4450,8 +4451,8 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
     {
       for (i = 0; i < (unsigned)field->drows; ++i)
        {
     {
       for (i = 0; i < (unsigned)field->drows; ++i)
        {
-         (void)mvwin_wchnstr(field->working, 0, i * field->dcols,
-                             widevalue + (i * field->dcols),
+         (void)mvwin_wchnstr(field->working, 0, (int)i * field->dcols,
+                             widevalue + ((int)i * field->dcols),
                              field->dcols);
        }
       for (i = 0; i < len; ++i)
                              field->dcols);
        }
       for (i = 0; i < len; ++i)
@@ -4512,7 +4513,7 @@ field_buffer(const FIELD *field, int buffer)
     {
 #if USE_WIDEC_SUPPORT
       FIELD_CELL *data = Address_Of_Nth_Buffer(field, buffer);
     {
 #if USE_WIDEC_SUPPORT
       FIELD_CELL *data = Address_Of_Nth_Buffer(field, buffer);
-      unsigned need = 0;
+      size_t need = 0;
       int size = Buffer_Length(field);
       int n;
 
       int size = Buffer_Length(field);
       int n;
 
@@ -4613,7 +4614,7 @@ _nc_Widen_String(char *source, int *lengthp)
                {
                  result[need] = wch;
                }
                {
                  result[need] = wch;
                }
-             passed += status;
+             passed += (size_t) status;
              ++need;
            }
          else
              ++need;
            }
          else
@@ -4633,7 +4634,7 @@ _nc_Widen_String(char *source, int *lengthp)
            break;
          result = typeCalloc(wchar_t, need);
 
            break;
          result = typeCalloc(wchar_t, need);
 
-         *lengthp = need;
+         *lengthp = (int) need;
          if (result == 0)
            break;
        }
          if (result == 0)
            break;
        }
index 7daa396b704a619856605451d81003f916289736..23850bfd1f8e37fda422c9ea26bd4040afc4218a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 
 #include "form.priv.h"
 
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_hook.c,v 1.15 2010/01/23 21:12:08 tom Exp $")
+MODULE_ID("$Id: frm_hook.c,v 1.16 2012/03/11 00:37:16 tom Exp $")
 
 /* "Template" macro to generate function to set application specific hook */
 #define GEN_HOOK_SET_FUNCTION( typ, name ) \
 NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\
 {\
 
 /* "Template" macro to generate function to set application specific hook */
 #define GEN_HOOK_SET_FUNCTION( typ, name ) \
 NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (FORM *form, Form_Hook func)\
 {\
-   T((T_CALLED("set_" #typ"_"#name"(%p,%p)"), form, func));\
+   T((T_CALLED("set_" #typ"_"#name"(%p,%p)"), (void *) form, func));\
    (Normalize_Form( form ) -> typ ## name) = func ;\
    RETURN(E_OK);\
 }
    (Normalize_Form( form ) -> typ ## name) = func ;\
    RETURN(E_OK);\
 }
index c41d558ec994b8e99040a7f9f0a78064293a1a98..eff90d60de59686df99737679dc09e668a41df66 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_attribs.c,v 1.16 2010/01/23 21:16:54 tom Exp $")
+MODULE_ID("$Id: m_attribs.c,v 1.17 2012/03/10 23:43:41 tom Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
@@ -51,7 +51,7 @@ MODULE_ID("$Id: m_attribs.c,v 1.16 2010/01/23 21:16:54 tom Exp $")
 #define GEN_MENU_ATTR_SET_FCT( name ) \
 NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
 {\
 #define GEN_MENU_ATTR_SET_FCT( name ) \
 NCURSES_IMPEXP int NCURSES_API set_menu_ ## name (MENU* menu, chtype attr) \
 {\
-  T((T_CALLED("set_menu_" #name "(%p,%s)"), menu, _traceattr(attr))); \
+  T((T_CALLED("set_menu_" #name "(%p,%s)"), (void *) menu, _traceattr(attr))); \
    if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
       RETURN(E_BAD_ARGUMENT);\
    if (menu && ( menu -> name != attr))\
    if (!(attr==A_NORMAL || (attr & A_ATTRIBUTES)==attr))\
       RETURN(E_BAD_ARGUMENT);\
    if (menu && ( menu -> name != attr))\
index dcc1c55d83a237d7c37716e6a0ff03f674bb0dd9..1a7a3911bbbf2d9aaaa454b61cd3f47dcf51320b 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_driver.c,v 1.30 2011/05/21 18:56:41 tom Exp $")
+MODULE_ID("$Id: m_driver.c,v 1.31 2012/03/10 23:43:41 tom Exp $")
 
 /* Macros */
 
 
 /* Macros */
 
@@ -47,7 +47,7 @@ MODULE_ID("$Id: m_driver.c,v 1.30 2011/05/21 18:56:41 tom Exp $")
 
 /* Add a new character to the match pattern buffer */
 #define Add_Character_To_Pattern(menu,ch) \
 
 /* Add a new character to the match pattern buffer */
 #define Add_Character_To_Pattern(menu,ch) \
-  { (menu)->pattern[((menu)->pindex)++] = (ch);\
+  { (menu)->pattern[((menu)->pindex)++] = (char) (ch);\
     (menu)->pattern[(menu)->pindex] = '\0'; }
 
 /*---------------------------------------------------------------------------
     (menu)->pattern[(menu)->pindex] = '\0'; }
 
 /*---------------------------------------------------------------------------
index 8e68a036ee2eff08d4f683d3c0f3ecc1b5616acf..e13ddc5a244ba6683585f6a01f32fe8994f8b215 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_format.c,v 1.16 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_format.c,v 1.17 2012/03/10 23:43:41 tom Exp $")
 
 #define minimum(a,b) ((a)<(b) ? (a): (b))
 
 
 #define minimum(a,b) ((a)<(b) ? (a): (b))
 
@@ -81,8 +81,8 @@ set_menu_format(MENU * menu, int rows, int cols)
       if (menu->pattern)
        Reset_Pattern(menu);
 
       if (menu->pattern)
        Reset_Pattern(menu);
 
-      menu->frows = rows;
-      menu->fcols = cols;
+      menu->frows = (short)rows;
+      menu->fcols = (short)cols;
 
       assert(rows > 0 && cols > 0);
       total_rows = (menu->nitems - 1) / cols + 1;
 
       assert(rows > 0 && cols > 0);
       total_rows = (menu->nitems - 1) / cols + 1;
@@ -90,9 +90,9 @@ set_menu_format(MENU * menu, int rows, int cols)
        minimum(menu->nitems, cols) :
        (menu->nitems - 1) / total_rows + 1;
 
        minimum(menu->nitems, cols) :
        (menu->nitems - 1) / total_rows + 1;
 
-      menu->rows = total_rows;
-      menu->cols = total_cols;
-      menu->arows = minimum(total_rows, rows);
+      menu->rows = (short)total_rows;
+      menu->cols = (short)total_cols;
+      menu->arows = (short)minimum(total_rows, rows);
       menu->toprow = 0;
       menu->curitem = *(menu->items);
       assert(menu->curitem);
       menu->toprow = 0;
       menu->curitem = *(menu->items);
       assert(menu->curitem);
@@ -102,9 +102,9 @@ set_menu_format(MENU * menu, int rows, int cols)
   else
     {
       if (rows > 0)
   else
     {
       if (rows > 0)
-       _nc_Default_Menu.frows = rows;
+       _nc_Default_Menu.frows = (short)rows;
       if (cols > 0)
       if (cols > 0)
-       _nc_Default_Menu.fcols = cols;
+       _nc_Default_Menu.fcols = (short)cols;
     }
 
   RETURN(E_OK);
     }
 
   RETURN(E_OK);
index 90f6f25925b7fcfd2b60c99b74956dd7e99a4729..dbd58652a3f9dcffc4f70133107611d2d00a0fbc 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_global.c,v 1.25 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_global.c,v 1.26 2012/03/10 23:43:41 tom Exp $")
 
 static char mark[] = "-";
 /* *INDENT-OFF* */
 
 static char mark[] = "-";
 /* *INDENT-OFF* */
@@ -117,17 +117,17 @@ ComputeMaximum_NameDesc_Lengths(MENU * menu)
   assert(menu && menu->items);
   for (items = menu->items; *items; items++)
     {
   assert(menu && menu->items);
   for (items = menu->items; *items; items++)
     {
-      check = _nc_Calculate_Text_Width(&((*items)->name));
+      check = (unsigned) _nc_Calculate_Text_Width(&((*items)->name));
       if (check > MaximumNameLength)
        MaximumNameLength = check;
 
       if (check > MaximumNameLength)
        MaximumNameLength = check;
 
-      check = _nc_Calculate_Text_Width(&((*items)->description));
+      check = (unsigned) _nc_Calculate_Text_Width(&((*items)->description));
       if (check > MaximumDescriptionLength)
        MaximumDescriptionLength = check;
     }
 
       if (check > MaximumDescriptionLength)
        MaximumDescriptionLength = check;
     }
 
-  menu->namelen = MaximumNameLength;
-  menu->desclen = MaximumDescriptionLength;
+  menu->namelen = (short) MaximumNameLength;
+  menu->desclen = (short) MaximumDescriptionLength;
   T(("ComputeMaximum_NameDesc_Lengths %d,%d", menu->namelen, menu->desclen));
 }
 
   T(("ComputeMaximum_NameDesc_Lengths %d,%d", menu->namelen, menu->desclen));
 }
 
@@ -195,7 +195,7 @@ _nc_Connect_Items(MENU * menu, ITEM ** items)
                {
                  (*item)->value = FALSE;
                }
                {
                  (*item)->value = FALSE;
                }
-             (*item)->index = ItemCount++;
+             (*item)->index = (short) ItemCount++;
              (*item)->imenu = menu;
            }
        }
              (*item)->imenu = menu;
            }
        }
@@ -206,7 +206,7 @@ _nc_Connect_Items(MENU * menu, ITEM ** items)
   if (ItemCount != 0)
     {
       menu->items = items;
   if (ItemCount != 0)
     {
       menu->items = items;
-      menu->nitems = ItemCount;
+      menu->nitems = (short) ItemCount;
       ComputeMaximum_NameDesc_Lengths(menu);
       if ((menu->pattern = typeMalloc(char, (unsigned)(1 + menu->namelen))))
        {
       ComputeMaximum_NameDesc_Lengths(menu);
       if ((menu->pattern = typeMalloc(char, (unsigned)(1 + menu->namelen))))
        {
@@ -256,7 +256,7 @@ _nc_Calculate_Text_Width(const TEXT * item /*FIXME: limit length */ )
   T((T_CALLED("_nc_menu_text_width(%p)"), (const void *)item));
   if (result != 0 && item->str != 0)
     {
   T((T_CALLED("_nc_menu_text_width(%p)"), (const void *)item));
   if (result != 0 && item->str != 0)
     {
-      int count = mbstowcs(0, item->str, 0);
+      int count = (int) mbstowcs(0, item->str, 0);
       wchar_t *temp = 0;
 
       if (count > 0
       wchar_t *temp = 0;
 
       if (count > 0
@@ -343,7 +343,7 @@ _nc_Calculate_Item_Length_and_Width(MENU * menu)
 
   assert(menu);
 
 
   assert(menu);
 
-  menu->height = 1 + menu->spc_rows * (menu->arows - 1);
+  menu->height = (short) (1 + menu->spc_rows * (menu->arows - 1));
 
   l = calculate_actual_width(menu, TRUE);
   l += menu->marklen;
 
   l = calculate_actual_width(menu, TRUE);
   l += menu->marklen;
@@ -354,10 +354,10 @@ _nc_Calculate_Item_Length_and_Width(MENU * menu)
       l += menu->spc_desc;
     }
 
       l += menu->spc_desc;
     }
 
-  menu->itemlen = l;
+  menu->itemlen = (short) l;
   l *= menu->cols;
   l += (menu->cols - 1) * menu->spc_cols;      /* for the padding between the columns */
   l *= menu->cols;
   l += (menu->cols - 1) * menu->spc_cols;      /* for the padding between the columns */
-  menu->width = l;
+  menu->width = (short) l;
 
   T(("_nc_CalculateItem_Length_and_Width columns %d, item %d, width %d",
      menu->cols,
 
   T(("_nc_CalculateItem_Length_and_Width columns %d, item %d, width %d",
      menu->cols,
@@ -388,7 +388,7 @@ _nc_Link_Items(MENU * menu)
       int Last_in_Column;
       bool cycle = (menu->opt & O_NONCYCLIC) ? FALSE : TRUE;
 
       int Last_in_Column;
       bool cycle = (menu->opt & O_NONCYCLIC) ? FALSE : TRUE;
 
-      menu->status &= ~_LINK_NEEDED;
+      menu->status &= (unsigned short) (~_LINK_NEEDED);
 
       if (menu->opt & O_ROWMAJOR)
        {
 
       if (menu->opt & O_ROWMAJOR)
        {
@@ -431,8 +431,8 @@ _nc_Link_Items(MENU * menu)
                (cycle ? menu->items[(row + 1) < menu->rows ?
                                     Number_Of_Items - 1 : col] :
                 (ITEM *) 0);
                (cycle ? menu->items[(row + 1) < menu->rows ?
                                     Number_Of_Items - 1 : col] :
                 (ITEM *) 0);
-             item->x = col;
-             item->y = row;
+             item->x = (short) col;
+             item->y = (short) row;
              if (++col == Number_Of_Columns)
                {
                  row++;
              if (++col == Number_Of_Columns)
                {
                  row++;
@@ -482,8 +482,8 @@ _nc_Link_Items(MENU * menu)
                 (ITEM *) 0
                );
 
                 (ITEM *) 0
                );
 
-             item->x = col;
-             item->y = row;
+             item->x = (short) col;
+             item->y = (short) row;
              if ((++row) == Number_Of_Rows)
                {
                  col++;
              if ((++row) == Number_Of_Rows)
                {
                  col++;
@@ -568,7 +568,7 @@ _nc_New_TopRow_and_CurrentItem(
 
       cur_item = menu->curitem;
       assert(cur_item);
 
       cur_item = menu->curitem;
       assert(cur_item);
-      menu->toprow = new_toprow;
+      menu->toprow = (short) new_toprow;
       menu->curitem = new_current_item;
 
       if (mterm_called)
       menu->curitem = new_current_item;
 
       if (mterm_called)
@@ -590,7 +590,7 @@ _nc_New_TopRow_and_CurrentItem(
     }
   else
     {                          /* if we are not posted, this is quite simple */
     }
   else
     {                          /* if we are not posted, this is quite simple */
-      menu->toprow = new_toprow;
+      menu->toprow = (short) new_toprow;
       menu->curitem = new_current_item;
     }
 }
       menu->curitem = new_current_item;
     }
 }
index 6125d052e7a2db870157975039409a049f534b46..671fab65e50ef7e0fd968d59ad69af5b6ea9c5df 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 
 #include "menu.priv.h"
 
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_hook.c,v 1.15 2010/01/23 21:16:54 tom Exp $")
+MODULE_ID("$Id: m_hook.c,v 1.16 2012/03/10 23:43:41 tom Exp $")
 
 /* "Template" macro to generate function to set application specific hook */
 #define GEN_HOOK_SET_FUNCTION( typ, name ) \
 NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
 {\
 
 /* "Template" macro to generate function to set application specific hook */
 #define GEN_HOOK_SET_FUNCTION( typ, name ) \
 NCURSES_IMPEXP int NCURSES_API set_ ## typ ## _ ## name (MENU *menu, Menu_Hook func )\
 {\
-   T((T_CALLED("set_" #typ "_" #name "(%p,%p)"), menu, func));\
+   T((T_CALLED("set_" #typ "_" #name "(%p,%p)"), (void *) menu, func));\
    (Normalize_Menu(menu) -> typ ## name = func );\
    RETURN(E_OK);\
 }
    (Normalize_Menu(menu) -> typ ## name = func );\
    RETURN(E_OK);\
 }
index f218d3ef4ef767c9167c37676d514c10dcfc988e..7f5daa9d89dc675be3a9b558bfb705b86fe4da7b 100644 (file)
@@ -44,7 +44,7 @@
 #endif
 #endif
 
 #endif
 #endif
 
-MODULE_ID("$Id: m_item_new.c,v 1.31 2012/02/23 10:02:15 tom Exp $")
+MODULE_ID("$Id: m_item_new.c,v 1.32 2012/03/10 23:41:36 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu  
@@ -62,7 +62,7 @@ Is_Printable_String(const char *s)
   int result = TRUE;
 
 #if USE_WIDEC_SUPPORT
   int result = TRUE;
 
 #if USE_WIDEC_SUPPORT
-  int count = mbstowcs(0, s, 0);
+  int count = (int)mbstowcs(0, s, 0);
   wchar_t *temp = 0;
 
   assert(s);
   wchar_t *temp = 0;
 
   assert(s);
@@ -127,13 +127,13 @@ new_item(const char *name, const char *description)
        {
          *item = _nc_Default_Item;     /* hope we have struct assignment */
 
        {
          *item = _nc_Default_Item;     /* hope we have struct assignment */
 
-         item->name.length = strlen(name);
+         item->name.length = (unsigned short)strlen(name);
          item->name.str = name;
 
          if (description && (*description != '\0') &&
              Is_Printable_String(description))
            {
          item->name.str = name;
 
          if (description && (*description != '\0') &&
              Is_Printable_String(description))
            {
-             item->description.length = strlen(description);
+             item->description.length = (unsigned short)strlen(description);
              item->description.str = description;
            }
          else
              item->description.str = description;
            }
          else
@@ -195,12 +195,12 @@ free_item(ITEM * item)
 NCURSES_EXPORT(int)
 set_menu_mark(MENU * menu, const char *mark)
 {
 NCURSES_EXPORT(int)
 set_menu_mark(MENU * menu, const char *mark)
 {
-  unsigned l;
+  short l;
 
   T((T_CALLED("set_menu_mark(%p,%s)"), (void *)menu, _nc_visbuf(mark)));
 
   if (mark && (*mark != '\0') && Is_Printable_String(mark))
 
   T((T_CALLED("set_menu_mark(%p,%s)"), (void *)menu, _nc_visbuf(mark)));
 
   if (mark && (*mark != '\0') && Is_Printable_String(mark))
-    l = strlen(mark);
+    l = (short)strlen(mark);
   else
     l = 0;
 
   else
     l = 0;
 
@@ -213,7 +213,7 @@ set_menu_mark(MENU * menu, const char *mark)
        {
          /* If the menu is already posted, the geometry is fixed. Then
             we can only accept a mark with exactly the same length */
        {
          /* If the menu is already posted, the geometry is fixed. Then
             we can only accept a mark with exactly the same length */
-         if (menu->marklen != (int)l)
+         if (menu->marklen != l)
            RETURN(E_BAD_ARGUMENT);
        }
       menu->marklen = l;
            RETURN(E_BAD_ARGUMENT);
        }
       menu->marklen = l;
@@ -228,7 +228,7 @@ set_menu_mark(MENU * menu, const char *mark)
          else
            {
              menu->mark = old_mark;
          else
            {
              menu->mark = old_mark;
-             menu->marklen = (old_mark != 0) ? strlen(old_mark) : 0;
+             menu->marklen = (short)((old_mark != 0) ? strlen(old_mark) : 0);
              RETURN(E_SYSTEM_ERROR);
            }
        }
              RETURN(E_SYSTEM_ERROR);
            }
        }
index caa2f9e207b1eeaa6f8d1368f6d3a0f7af3df238..0abaf67aee630f12909167f5e3935bf04cdd58a9 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_pad.c,v 1.12 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_pad.c,v 1.13 2012/03/10 23:43:41 tom Exp $")
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
 
 /* Macro to redraw menu if it is posted and changed */
 #define Refresh_Menu(menu) \
@@ -69,7 +69,7 @@ set_menu_pad(MENU * menu, int pad)
     RETURN(E_BAD_ARGUMENT);
 
   Normalize_Menu(menu);
     RETURN(E_BAD_ARGUMENT);
 
   Normalize_Menu(menu);
-  menu->pad = pad;
+  menu->pad = (unsigned char)pad;
 
   if (do_refresh)
     Refresh_Menu(menu);
 
   if (do_refresh)
     Refresh_Menu(menu);
index 1f0b623ed456f192016dc8ae73ec45ee4ae834d6..bfe6ebb3cbd3114d2dc2a7a299aa494de9965d5c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_post.c,v 1.29 2010/05/01 19:18:27 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.30 2012/03/10 23:43:41 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -67,7 +67,7 @@ _nc_Post_Item(const MENU * menu, const ITEM * item)
      - it is a onevalued menu and it is the current item
      - or it has a selection value
    */
      - it is a onevalued menu and it is the current item
      - or it has a selection value
    */
-  wattron(menu->win, menu->back);
+  wattron(menu->win, (int)menu->back);
   if (item->value || (item == menu->curitem))
     {
       if (menu->marklen)
   if (item->value || (item == menu->curitem))
     {
       if (menu->marklen)
@@ -79,13 +79,13 @@ _nc_Post_Item(const MENU * menu, const ITEM * item)
             item. */
          if (!(menu->opt & O_ONEVALUE) && item->value && item != menu->curitem)
            {
             item. */
          if (!(menu->opt & O_ONEVALUE) && item->value && item != menu->curitem)
            {
-             wattron(menu->win, menu->fore);
+             wattron(menu->win, (int)menu->fore);
              isfore = TRUE;
            }
          waddstr(menu->win, menu->mark);
          if (isfore)
            {
              isfore = TRUE;
            }
          waddstr(menu->win, menu->mark);
          if (isfore)
            {
-             wattron(menu->win, menu->fore);
+             wattron(menu->win, (int)menu->fore);
              isfore = FALSE;
            }
        }
              isfore = FALSE;
            }
        }
@@ -93,7 +93,7 @@ _nc_Post_Item(const MENU * menu, const ITEM * item)
   else                         /* otherwise we have to wipe out the marker area */
     for (ch = ' ', i = menu->marklen; i > 0; i--)
       waddch(menu->win, ch);
   else                         /* otherwise we have to wipe out the marker area */
     for (ch = ' ', i = menu->marklen; i > 0; i--)
       waddch(menu->win, ch);
-  wattroff(menu->win, menu->back);
+  wattroff(menu->win, (int)menu->back);
   count += menu->marklen;
 
   /* First we have to calculate the attribute depending on selectability
   count += menu->marklen;
 
   /* First we have to calculate the attribute depending on selectability
@@ -101,19 +101,19 @@ _nc_Post_Item(const MENU * menu, const ITEM * item)
    */
   if (!(item->opt & O_SELECTABLE))
     {
    */
   if (!(item->opt & O_SELECTABLE))
     {
-      wattron(menu->win, menu->grey);
+      wattron(menu->win, (int)menu->grey);
       isgrey = TRUE;
     }
   else
     {
       if (item->value || item == menu->curitem)
        {
       isgrey = TRUE;
     }
   else
     {
       if (item->value || item == menu->curitem)
        {
-         wattron(menu->win, menu->fore);
+         wattron(menu->win, (int)menu->fore);
          isfore = TRUE;
        }
       else
        {
          isfore = TRUE;
        }
       else
        {
-         wattron(menu->win, menu->back);
+         wattron(menu->win, (int)menu->back);
          isback = TRUE;
        }
     }
          isback = TRUE;
        }
     }
@@ -158,10 +158,10 @@ _nc_Post_Item(const MENU * menu, const ITEM * item)
          assert(cx >= 0 && cy >= 0);
          getyx(menu->win, ncy, ncx);
          if (isgrey)
          assert(cx >= 0 && cy >= 0);
          getyx(menu->win, ncy, ncx);
          if (isgrey)
-           wattroff(menu->win, menu->grey);
+           wattroff(menu->win, (int)menu->grey);
          else if (isfore)
          else if (isfore)
-           wattroff(menu->win, menu->fore);
-         wattron(menu->win, menu->back);
+           wattroff(menu->win, (int)menu->fore);
+         wattron(menu->win, (int)menu->back);
          for (j = 1; j < menu->spc_rows; j++)
            {
              if ((item_y + j) < getmaxy(menu->win))
          for (j = 1; j < menu->spc_rows; j++)
            {
              if ((item_y + j) < getmaxy(menu->win))
@@ -175,17 +175,17 @@ _nc_Post_Item(const MENU * menu, const ITEM * item)
            }
          wmove(menu->win, ncy, ncx);
          if (!isback)
            }
          wmove(menu->win, ncy, ncx);
          if (!isback)
-           wattroff(menu->win, menu->back);
+           wattroff(menu->win, (int)menu->back);
        }
     }
 
   /* Remove attributes */
   if (isfore)
        }
     }
 
   /* Remove attributes */
   if (isfore)
-    wattroff(menu->win, menu->fore);
+    wattroff(menu->win, (int)menu->fore);
   if (isback)
   if (isback)
-    wattroff(menu->win, menu->back);
+    wattroff(menu->win, (int)menu->back);
   if (isgrey)
   if (isgrey)
-    wattroff(menu->win, menu->grey);
+    wattroff(menu->win, (int)menu->grey);
 }
 
 /*---------------------------------------------------------------------------
 }
 
 /*---------------------------------------------------------------------------
@@ -225,7 +225,7 @@ _nc_Draw_Menu(const MENU * menu)
        {
          _nc_Post_Item(menu, hitem);
 
        {
          _nc_Post_Item(menu, hitem);
 
-         wattron(menu->win, menu->back);
+         wattron(menu->win, (int)menu->back);
          if (((hitem = hitem->right) != lasthor) && hitem)
            {
              int i, j, cy, cx;
          if (((hitem = hitem->right) != lasthor) && hitem)
            {
              int i, j, cy, cx;
@@ -244,7 +244,7 @@ _nc_Draw_Menu(const MENU * menu)
            }
        }
       while (hitem && (hitem != lasthor));
            }
        }
       while (hitem && (hitem != lasthor));
-      wattroff(menu->win, menu->back);
+      wattroff(menu->win, (int)menu->back);
 
       item = item->down;
       y += menu->spc_rows;
 
       item = item->down;
       y += menu->spc_rows;
@@ -369,7 +369,7 @@ unpost_menu(MENU * menu)
   delwin(menu->win);
   menu->win = (WINDOW *)0;
 
   delwin(menu->win);
   menu->win = (WINDOW *)0;
 
-  menu->status &= ~_POSTED;
+  menu->status &= (unsigned short)(~_POSTED);
 
   RETURN(E_OK);
 }
 
   RETURN(E_OK);
 }
index 1cfa2e166571c262bc20cba7c17db32c05234604..01941f566b4b34cd60b631bce56e18d34995f720 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2004,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -37,7 +37,7 @@
 
 #include "menu.priv.h"
 
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_spacing.c,v 1.18 2010/01/23 21:20:10 tom Exp $")
+MODULE_ID("$Id: m_spacing.c,v 1.19 2012/03/10 23:43:41 tom Exp $")
 
 #define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8)
 #define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8)
 
 #define MAX_SPC_DESC ((TABSIZE) ? (TABSIZE) : 8)
 #define MAX_SPC_COLS ((TABSIZE) ? (TABSIZE) : 8)
@@ -70,9 +70,9 @@ set_menu_spacing(MENU * menu, int s_desc, int s_row, int s_col)
       ((s_col < 0) || (s_col > MAX_SPC_COLS)))
     RETURN(E_BAD_ARGUMENT);
 
       ((s_col < 0) || (s_col > MAX_SPC_COLS)))
     RETURN(E_BAD_ARGUMENT);
 
-  m->spc_desc = s_desc ? s_desc : 1;
-  m->spc_rows = s_row ? s_row : 1;
-  m->spc_cols = s_col ? s_col : 1;
+  m->spc_desc = (short)(s_desc ? s_desc : 1);
+  m->spc_rows = (short)(s_row ? s_row : 1);
+  m->spc_cols = (short)(s_col ? s_col : 1);
   _nc_Calculate_Item_Length_and_Width(m);
 
   RETURN(E_OK);
   _nc_Calculate_Item_Length_and_Width(m);
 
   RETURN(E_OK);
index 99580a38d1c221936608f5583df1a180c2a71a9e..763ca4a675fdd8ca017b27f09de9d2b6b6549c09 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: menu.priv.h,v 1.23 2009/02/28 21:02:57 juergen Exp $ */
+/* $Id: menu.priv.h,v 1.24 2012/03/10 23:43:41 tom Exp $ */
 
 /***************************************************************************
 * Module menu.priv.h                                                       *
 
 /***************************************************************************
 * Module menu.priv.h                                                       *
@@ -39,6 +39,7 @@
 
 #ifndef MENU_PRIV_H_incl
 #define MENU_PRIV_H_incl 1
 
 #ifndef MENU_PRIV_H_incl
 #define MENU_PRIV_H_incl 1
+/* *INDENT-OFF* */
 
 #include "curses.priv.h"
 #include "mf_common.h"
 
 #include "curses.priv.h"
 #include "mf_common.h"
@@ -99,10 +100,11 @@ extern NCURSES_EXPORT_VAR(MENU) _nc_Default_Menu;
 */
 #define Adjust_Current_Item(menu,row,item) \
   { if ((item)->y < row) \
 */
 #define Adjust_Current_Item(menu,row,item) \
   { if ((item)->y < row) \
-      row = (item)->y;\
-    if ( (item)->y >= (row + (menu)->arows) )\
-      row = ( (item)->y < ((menu)->rows - row) ) ? \
-            (item)->y : (menu)->rows - (menu)->arows;\
+      row = (short) (item)->y; \
+    if ( (item)->y >= (row + (menu)->arows) ) \
+      row = (short) (( (item)->y < ((menu)->rows - row) ) \
+                     ? (item)->y \
+                    : (menu)->rows - (menu)->arows); \
     _nc_New_TopRow_and_CurrentItem(menu,row,item); }
 
 /* Reset the match pattern buffer */
     _nc_New_TopRow_and_CurrentItem(menu,row,item); }
 
 /* Reset the match pattern buffer */
@@ -152,5 +154,6 @@ extern NCURSES_EXPORT(Menu_Options) _nc_retrace_menu_opts (Menu_Options);
 #define returnMenuOpts(code)   return code
 
 #endif /* TRACE/!TRACE */
 #define returnMenuOpts(code)   return code
 
 #endif /* TRACE/!TRACE */
+/* *INDENT-ON* */
 
 #endif /* MENU_PRIV_H_incl */
 
 #endif /* MENU_PRIV_H_incl */
index 681672dc34248385f4aa3bb3474d296e29577c65..115d6a815e0631f54893ec5091210435fcd3ff5d 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2004,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -30,7 +30,7 @@
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
  ****************************************************************************/
 
-/* $Id: mf_common.h,v 0.22 2005/11/26 15:26:52 tom Exp $ */
+/* $Id: mf_common.h,v 0.23 2012/03/10 23:43:41 tom Exp $ */
 
 /* Common internal header for menu and form library */
 
 
 /* Common internal header for menu and form library */
 
@@ -63,10 +63,9 @@ extern int errno;
 #if USE_RCS_IDS
 #define MODULE_ID(id) static const char Ident[] = id;
 #else
 #if USE_RCS_IDS
 #define MODULE_ID(id) static const char Ident[] = id;
 #else
-#define MODULE_ID(id) /*nothing*/
+#define MODULE_ID(id)          /*nothing */
 #endif
 
 #endif
 
-
 /* Maximum regular 8-bit character code */
 #define MAX_REGULAR_CHARACTER (0xff)
 
 /* Maximum regular 8-bit character code */
 #define MAX_REGULAR_CHARACTER (0xff)
 
@@ -80,16 +79,16 @@ extern int errno;
 #endif
 
 /* The few common values in the status fields for menus and forms */
 #endif
 
 /* The few common values in the status fields for menus and forms */
-#define _POSTED         (0x01U)  /* menu or form is posted                  */
-#define _IN_DRIVER      (0x02U)  /* menu or form is processing hook routine */
+#define _POSTED         (0x01U)        /* menu or form is posted                  */
+#define _IN_DRIVER      (0x02U)        /* menu or form is processing hook routine */
 
 /* Call object hook */
 #define Call_Hook( object, handler ) \
    if ( (object) != 0 && ((object)->handler) != (void *) 0 )\
    {\
 
 /* Call object hook */
 #define Call_Hook( object, handler ) \
    if ( (object) != 0 && ((object)->handler) != (void *) 0 )\
    {\
-       (object)->status |= _IN_DRIVER;\
+       (object)->status |= (unsigned short) (_IN_DRIVER);\
        (object)->handler(object);\
        (object)->handler(object);\
-       (object)->status &= ~_IN_DRIVER;\
+       (object)->status &= (unsigned short) (~_IN_DRIVER);\
    }
 
 #endif /* MF_COMMON_H_incl */
    }
 
 #endif /* MF_COMMON_H_incl */
index ac0cbcb0ec0f1abcc92b6a29d53e7fa4b25b127a..2150279f060b76b5cb8ebc533bc24256811809c1 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -36,7 +36,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_bkgd.c,v 1.44 2011/05/28 20:44:22 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.45 2012/03/10 21:20:18 tom Exp $")
 
 /*
  * Set the window's background information.
 
 /*
  * Set the window's background information.
@@ -127,7 +127,7 @@ wbkgrnd(WINDOW *win, const ARG_CH_T ch)
        wgetbkgrnd(win, &old_bkgrnd);
 
        (void) wbkgrndset(win, CHREF(new_bkgd));
        wgetbkgrnd(win, &old_bkgrnd);
 
        (void) wbkgrndset(win, CHREF(new_bkgd));
-       (void) wattrset(win, AttrOf(win->_nc_bkgd));
+       (void) wattrset(win, (int) AttrOf(win->_nc_bkgd));
 
        for (y = 0; y <= win->_maxy; y++) {
            for (x = 0; x <= win->_maxx; x++) {
 
        for (y = 0; y <= win->_maxy; y++) {
            for (x = 0; x <= win->_maxx; x++) {
index 530e7134307ed5a1fdb1e273acf3738c8ffe86f0..3064c260f10376d6e9cc6c16f838195ec61d7b86 100644 (file)
@@ -39,7 +39,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_printw.c,v 1.21 2012/02/29 10:11:53 Werner.Fink Exp $")
+MODULE_ID("$Id: lib_printw.c,v 1.22 2012/03/10 20:47:33 tom Exp $")
 
 NCURSES_EXPORT(int)
 printw(const char *fmt,...)
 
 NCURSES_EXPORT(int)
 printw(const char *fmt,...)
@@ -49,11 +49,11 @@ printw(const char *fmt,...)
 
 #ifdef TRACE
     va_list argq;
 
 #ifdef TRACE
     va_list argq;
-    va_copy(argq, argp);
+    begin_va_copy(argq, argp);
     va_start(argq, fmt);
     T((T_CALLED("printw(%s%s)"),
        _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
     va_start(argq, fmt);
     T((T_CALLED("printw(%s%s)"),
        _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
-    va_end(argq);
+    end_va_copy(argq);
 #endif
 
     va_start(argp, fmt);
 #endif
 
     va_start(argp, fmt);
@@ -71,11 +71,11 @@ wprintw(WINDOW *win, const char *fmt,...)
 
 #ifdef TRACE
     va_list argq;
 
 #ifdef TRACE
     va_list argq;
-    va_copy(argq, argp);
+    begin_va_copy(argq, argp);
     va_start(argq, fmt);
     T((T_CALLED("wprintw(%p,%s%s)"),
        (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
     va_start(argq, fmt);
     T((T_CALLED("wprintw(%p,%s%s)"),
        (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
-    va_end(argq);
+    end_va_copy(argq);
 #endif
 
     va_start(argp, fmt);
 #endif
 
     va_start(argp, fmt);
@@ -93,11 +93,11 @@ mvprintw(int y, int x, const char *fmt,...)
 
 #ifdef TRACE
     va_list argq;
 
 #ifdef TRACE
     va_list argq;
-    va_copy(argq, argp);
+    begin_va_copy(argq, argp);
     va_start(argq, fmt);
     T((T_CALLED("mvprintw(%d,%d,%s%s)"),
        y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
     va_start(argq, fmt);
     T((T_CALLED("mvprintw(%d,%d,%s%s)"),
        y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
-    va_end(argq);
+    end_va_copy(argq);
 #endif
 
     if ((code = move(y, x)) != ERR) {
 #endif
 
     if ((code = move(y, x)) != ERR) {
@@ -116,11 +116,11 @@ mvwprintw(WINDOW *win, int y, int x, const char *fmt,...)
 
 #ifdef TRACE
     va_list argq;
 
 #ifdef TRACE
     va_list argq;
-    va_copy(argq, argp);
+    begin_va_copy(argq, argp);
     va_start(argq, fmt);
     T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
        y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
     va_start(argq, fmt);
     T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
        y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
-    va_end(argq);
+    end_va_copy(argq);
 #endif
 
     if ((code = wmove(win, y, x)) != ERR) {
 #endif
 
     if ((code = wmove(win, y, x)) != ERR) {
index e535a4949b8cd5455694d2c3a411b44c6c5bbbe5..5fbb7b9ae692c7b5e67bc621610426ce715bbe39 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.498 2012/02/29 10:38:18 tom Exp $
+ * $Id: curses.priv.h,v 1.499 2012/03/10 21:16:32 tom Exp $
  *
  *     curses.priv.h
  *
  *
  *     curses.priv.h
  *
@@ -398,7 +398,7 @@ color_t;
 #define if_EXT_COLORS(stmt)    stmt
 #define SetPair(value,p)       SetPair2((value).ext_color, AttrOf(value), p)
 #define SetPair2(c,a,p)                c = (p), \
 #define if_EXT_COLORS(stmt)    stmt
 #define SetPair(value,p)       SetPair2((value).ext_color, AttrOf(value), p)
 #define SetPair2(c,a,p)                c = (p), \
-                               a = (unColor2(a) | (A_COLOR & ColorPair(oldColor(c))))
+                               a = (unColor2(a) | (A_COLOR & (unsigned) ColorPair(oldColor(c))))
 #define GetPair(value)         GetPair2((value).ext_color, AttrOf(value))
 #define GetPair2(c,a)          ((c) ? (c) : PairNumber(a))
 #define oldColor(p)            (((p) > 255) ? 255 : (p))
 #define GetPair(value)         GetPair2((value).ext_color, AttrOf(value))
 #define GetPair2(c,a)          ((c) ? (c) : PairNumber(a))
 #define oldColor(p)            (((p) > 255) ? 255 : (p))
@@ -407,9 +407,9 @@ color_t;
 #define SameAttrOf(a,b)                (AttrOf(a) == AttrOf(b) && GetPair(a) == GetPair(b))
 
 #if NCURSES_SP_FUNCS
 #define SameAttrOf(a,b)                (AttrOf(a) == AttrOf(b) && GetPair(a) == GetPair(b))
 
 #if NCURSES_SP_FUNCS
-#define VIDATTR(sp,attr,pair)  NCURSES_SP_NAME(vid_attr)(sp, attr, pair, 0)
+#define VIDATTR(sp,attr,pair)  NCURSES_SP_NAME(vid_attr)(sp, attr, (short) pair, 0)
 #else
 #else
-#define VIDATTR(sp,attr,pair)  vid_attr(attr, pair, 0)
+#define VIDATTR(sp,attr,pair)  vid_attr(attr, (short) pair, 0)
 #endif
 
 #else /* !NCURSES_EXT_COLORS */
 #endif
 
 #else /* !NCURSES_EXT_COLORS */
index ac1b8ecac797b6426f211342ff1dde7f3b788dfc..7fac5c505d489bc7d64f4cd45efeecd1fae57e72 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <curses.priv.h>
 
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_cchar.c,v 1.24 2011/10/22 15:52:36 tom Exp $")
+MODULE_ID("$Id: lib_cchar.c,v 1.25 2012/03/10 20:52:21 tom Exp $")
 
 /* 
  * The SuSv2 description leaves some room for interpretation.  We'll assume wch
 
 /* 
  * The SuSv2 description leaves some room for interpretation.  We'll assume wch
@@ -60,7 +60,7 @@ setcchar(cchar_t *wcval,
 
     if (opts != NULL
        || wch == NULL
 
     if (opts != NULL
        || wch == NULL
-       || ((len = wcslen(wch)) > 1 && wcwidth(wch[0]) < 0)) {
+       || ((len = (unsigned) wcslen(wch)) > 1 && wcwidth(wch[0]) < 0)) {
        code = ERR;
     } else {
        if (len > CCHARW_MAX)
        code = ERR;
     } else {
        if (len > CCHARW_MAX)
index 8bbf1bc21cea8f14b4b17bd2e9d8649c78a85ab4..76209fe84b8bb0bd0a02133f8a031c36fdea3cbb 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  */
 #include "panel.priv.h"
 
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_above.c,v 1.8 2010/01/23 21:22:15 tom Exp $")
+MODULE_ID("$Id: p_above.c,v 1.9 2012/03/10 23:43:41 tom Exp $")
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(PANEL *)
 ground_panel(SCREEN * sp)
 {
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(PANEL *)
 ground_panel(SCREEN * sp)
 {
-  T((T_CALLED("ground_panel(%p)"), sp));
+  T((T_CALLED("ground_panel(%p)"), (void *)sp));
   if (sp)
     {
       struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
   if (sp)
     {
       struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
index f276ef959da523ccef52b81f9f59050f089e6fa5..913efa91390bf05fd37f0d6609efdf0ffcd26578 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  */
 #include "panel.priv.h"
 
  */
 #include "panel.priv.h"
 
-MODULE_ID("$Id: p_below.c,v 1.8 2010/01/23 21:22:15 tom Exp $")
+MODULE_ID("$Id: p_below.c,v 1.9 2012/03/10 23:43:41 tom Exp $")
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(PANEL *)
 ceiling_panel(SCREEN * sp)
 {
 
 #if NCURSES_SP_FUNCS
 NCURSES_EXPORT(PANEL *)
 ceiling_panel(SCREEN * sp)
 {
-  T((T_CALLED("ceiling_panel(%p)"), sp));
+  T((T_CALLED("ceiling_panel(%p)"), (void *)sp));
   if (sp)
     {
       struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
   if (sp)
     {
       struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp);
index 6d6efc11f934e11884ddbadf3b8f7c72b981fae2..354901ebd4eb49e9ee4efb1dd5bc9b6a509abb76 100644 (file)
@@ -39,7 +39,7 @@
 #include "termsort.c"          /* this C file is generated */
 #include <parametrized.h>      /* so is this */
 
 #include "termsort.c"          /* this C file is generated */
 #include <parametrized.h>      /* so is this */
 
-MODULE_ID("$Id: dump_entry.c,v 1.98 2012/02/29 01:04:17 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.99 2012/03/10 23:20:35 tom Exp $")
 
 #define INDENT                 8
 #define DISCARD(string) string = ABSENT_STRING
 
 #define INDENT                 8
 #define DISCARD(string) string = ABSENT_STRING
@@ -1195,11 +1195,11 @@ show_entry(void)
            if (ch == '\n') {
                ;
            } else if (isspace(UChar(ch))) {
            if (ch == '\n') {
                ;
            } else if (isspace(UChar(ch))) {
-               outbuf.used = j;
+               outbuf.used = (size_t) j;
            } else if (!infodump && ch == '\\') {
            } else if (!infodump && ch == '\\') {
-               outbuf.used = j;
+               outbuf.used = (size_t) j;
            } else if (ch == delim && (j == 0 || outbuf.text[j - 1] != '\\')) {
            } else if (ch == delim && (j == 0 || outbuf.text[j - 1] != '\\')) {
-               outbuf.used = (j + 1);
+               outbuf.used = (size_t) (j + 1);
            } else {
                break;
            }
            } else {
                break;
            }
index 021d8011edebbfc99b503191ae8cfdad1ac4c9ae..4f0323aa0b172242633658bc9118701430e477a3 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <dump_entry.h>
 
 
 #include <dump_entry.h>
 
-MODULE_ID("$Id: infocmp.c,v 1.112 2012/02/22 23:59:53 tom Exp $")
+MODULE_ID("$Id: infocmp.c,v 1.114 2012/03/11 00:10:57 tom Exp $")
 
 #define L_CURL "{"
 #define R_CURL "}"
 
 #define L_CURL "{"
 #define R_CURL "}"
@@ -1089,9 +1089,10 @@ dump_initializers(TERMTYPE *term)
 
        if (VALID_STRING(term->Strings[n])) {
            tp = buf;
 
        if (VALID_STRING(term->Strings[n])) {
            tp = buf;
+#define TP_LIMIT       ((MAX_STRING - 5) - (size_t)(tp - buf))
            *tp++ = '"';
            for (sp = term->Strings[n];
            *tp++ = '"';
            for (sp = term->Strings[n];
-                *sp != 0 && (tp - buf) < MAX_STRING - 6;
+                *sp != 0 && TP_LIMIT > 2;
                 sp++) {
                if (isascii(UChar(*sp))
                    && isprint(UChar(*sp))
                 sp++) {
                if (isascii(UChar(*sp))
                    && isprint(UChar(*sp))
@@ -1099,7 +1100,7 @@ dump_initializers(TERMTYPE *term)
                    && *sp != '"')
                    *tp++ = *sp;
                else {
                    && *sp != '"')
                    *tp++ = *sp;
                else {
-                   _nc_SPRINTF(tp, _nc_SLIMIT(MAX_STRING) "\\%03o", UChar(*sp));
+                   _nc_SPRINTF(tp, _nc_SLIMIT(TP_LIMIT) "\\%03o", UChar(*sp));
                    tp += 4;
                }
            }
                    tp += 4;
                }
            }
index a5cf8bb8f96d5b686afa5ee80685e6b814d6be96..f1b836fe277123bc31895a57e03d7a766bcbfdd7 100644 (file)
@@ -44,7 +44,7 @@
 #include <hashed_db.h>
 #endif
 
 #include <hashed_db.h>
 #endif
 
-MODULE_ID("$Id: toe.c,v 1.66 2012/02/22 23:57:44 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.67 2012/03/10 23:22:21 tom Exp $")
 
 #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
 
 
 #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
 
@@ -295,10 +295,10 @@ checksum_of(TERMTYPE *tp)
     unsigned i;
 
     for (i = 0; i < NUM_BOOLEANS(tp); i++) {
     unsigned i;
 
     for (i = 0; i < NUM_BOOLEANS(tp); i++) {
-       result += (tp->Booleans[i]);
+       result += (unsigned long) (tp->Booleans[i]);
     }
     for (i = 0; i < NUM_NUMBERS(tp); i++) {
     }
     for (i = 0; i < NUM_NUMBERS(tp); i++) {
-       result += (tp->Numbers[i]);
+       result += (unsigned long) (tp->Numbers[i]);
     }
     for (i = 0; i < NUM_STRINGS(tp); i++) {
        result += string_sum(tp->Strings[i]);
     }
     for (i = 0; i < NUM_STRINGS(tp); i++) {
        result += string_sum(tp->Strings[i]);