]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - form/frm_driver.c
ncurses 5.9 - patch 20131123
[ncurses.git] / form / frm_driver.c
index 0a39d322c7bd16eeb1a268cea984a83f96866d2c..d920433469afa787e879dc343d4c024bea407c8e 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_driver.c,v 1.103 2013/03/09 22:48:47 tom Exp $")
+MODULE_ID("$Id: frm_driver.c,v 1.106 2013/08/25 00:02:15 tom Exp $")
 
 /*----------------------------------------------------------------------------
   This is the core module of the form library. It contains the majority
@@ -187,7 +187,7 @@ 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)), \
+(  wbkgdset((win),(chtype)((chtype)((field)->pad) | (field)->back)), \
    (void) wattrset((win), (int)(field)->fore) )
 
 /* Logic to decide whether or not a field really appears on the form */
@@ -4397,8 +4397,8 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
 {
   FIELD_CELL *p;
   int res = E_OK;
-  unsigned int i;
-  unsigned int len;
+  int i;
+  int len;
 
 #if USE_WIDEC_SUPPORT
   FIELD_CELL *widevalue = 0;
@@ -4409,14 +4409,14 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
   if (!field || !value || ((buffer < 0) || (buffer > field->nbuf)))
     RETURN(E_BAD_ARGUMENT);
 
-  len = (unsigned)Buffer_Length(field);
+  len = 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.
        */
-      unsigned vlen = (unsigned)strlen(value);
+      int vlen = (int)strlen(value);
 
       if (vlen > len)
        {
@@ -4446,7 +4446,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
       delwin(field->working);
       field->working = newpad(1, Buffer_Length(field) + 1);
     }
-  len = (unsigned)Buffer_Length(field);
+  len = Buffer_Length(field);
   wclear(field->working);
   (void)mvwaddstr(field->working, 0, 0, value);
 
@@ -4456,7 +4456,7 @@ set_field_buffer(FIELD *field, int buffer, const char *value)
     }
   else
     {
-      for (i = 0; i < (unsigned)field->drows; ++i)
+      for (i = 0; i < field->drows; ++i)
        {
          (void)mvwin_wchnstr(field->working, 0, (int)i * field->dcols,
                              widevalue + ((int)i * field->dcols),
@@ -4534,7 +4534,7 @@ field_buffer(const FIELD *field, int buffer)
 
              init_mb(state);
              next = _nc_wcrtomb(0, data[n].chars[0], &state);
-             if (!isEILSEQ(next))
+             if (next > 0)
                need += next;
            }
        }