ncurses 6.1 - patch 20181125
[ncurses.git] / form / frm_def.c
index 88964fc8f774e94364269b53cafc632575333b4b..fd7b56a421c5f017c6330ea549135aa8a94da785 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2008,2009 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            *
@@ -32,7 +32,7 @@
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_def.c,v 1.24 2009/11/07 16:59:03 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 =
@@ -160,7 +160,7 @@ Connect_Fields(FORM *form, FIELD **fields)
   int maximum_row_in_field, maximum_col_in_field;
   _PAGE *pg;
 
-  T((T_CALLED("Connect_Fields(%p,%p)"), form, fields));
+  T((T_CALLED("Connect_Fields(%p,%p)"), (void *)form, (void *)fields));
 
   assert(form);
 
@@ -188,7 +188,7 @@ Connect_Fields(FORM *form, FIELD **fields)
   /* allocate page structures */
   if ((pg = typeMalloc(_PAGE, page_nr)) != (_PAGE *) 0)
     {
-      T((T_CREATE("_PAGE %p"), pg));
+      T((T_CREATE("_PAGE %p"), (void *)pg));
       form->page = pg;
     }
   else
@@ -199,14 +199,14 @@ Connect_Fields(FORM *form, FIELD **fields)
   for (j = 0; j < field_cnt; j++)
     {
       if (j == 0)
-       pg->pmin = j;
+       pg->pmin = (short) j;
       else
        {
          if (fields[j]->status & _NEWPAGE)
            {
-             pg->pmax = j - 1;
+             pg->pmax = (short) (j - 1);
              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)
-       form->rows = maximum_row_in_field;
+       form->rows = (short) maximum_row_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++)
@@ -230,8 +230,8 @@ Connect_Fields(FORM *form, FIELD **fields)
 
       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)
@@ -300,7 +300,7 @@ NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields)
   int err = E_SYSTEM_ERROR;
   FORM *form = (FORM *)0;
 
-  T((T_CALLED("new_form(%p,%p)"), SP_PARM, fields));
+  T((T_CALLED("new_form(%p,%p)"), (void *)SP_PARM, (void *)fields));
 
   if (IsValidScreen(SP_PARM))
     {
@@ -308,7 +308,7 @@ NCURSES_SP_NAME(new_form) (NCURSES_SP_DCLx FIELD **fields)
 
       if (form)
        {
-         T((T_CREATE("form %p"), form));
+         T((T_CREATE("form %p"), (void *)form));
          *form = *_nc_Default_Form;
          /* This ensures win and sub are always non-null,
             so we can derive always the SCREEN that this form is
@@ -363,7 +363,7 @@ new_form(FIELD **fields)
 NCURSES_EXPORT(int)
 free_form(FORM *form)
 {
-  T((T_CALLED("free_form(%p)"), form));
+  T((T_CALLED("free_form(%p)"), (void *)form));
 
   if (!form)
     RETURN(E_BAD_ARGUMENT);
@@ -397,7 +397,7 @@ set_form_fields(FORM *form, FIELD **fields)
   FIELD **old;
   int res;
 
-  T((T_CALLED("set_form_fields(%p,%p)"), form, fields));
+  T((T_CALLED("set_form_fields(%p,%p)"), (void *)form, (void *)fields));
 
   if (!form)
     RETURN(E_BAD_ARGUMENT);
@@ -425,7 +425,7 @@ set_form_fields(FORM *form, FIELD **fields)
 NCURSES_EXPORT(FIELD **)
 form_fields(const FORM *form)
 {
-  T((T_CALLED("form_field(%p)"), form));
+  T((T_CALLED("form_field(%p)"), (const void *)form));
   returnFieldPtr(Normalize_Form(form)->field);
 }
 
@@ -440,7 +440,7 @@ form_fields(const FORM *form)
 NCURSES_EXPORT(int)
 field_count(const FORM *form)
 {
-  T((T_CALLED("field_count(%p)"), form));
+  T((T_CALLED("field_count(%p)"), (const void *)form));
 
   returnCode(Normalize_Form(form)->maxfield);
 }