]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - form/frm_data.c
ncurses 6.2 - patch 20210904
[ncurses.git] / form / frm_data.c
index e52b1bece25dfe3cb7c27f395585d779e9a75a41..940c32db99c60d23bf3a3e01e6661267f99924a0 100644 (file)
@@ -1,5 +1,6 @@
 /****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.              *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
+ * Copyright 1998-2010,2013 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: frm_data.c,v 1.13 2004/12/11 22:29:28 tom Exp $")
+MODULE_ID("$Id: frm_data.c,v 1.21 2021/06/17 21:11:08 tom Exp $")
 
 /*---------------------------------------------------------------------------
-|   Facility      :  libnform  
+|   Facility      :  libnform
 |   Function      :  bool data_behind(const FORM *form)
-|   
+|
 |   Description   :  Check for off-screen data behind. This is nearly trivial
 |                    because the beginning of a field is fixed.
 |
 |   Return Values :  TRUE   - there are off-screen data behind
 |                    FALSE  - there are no off-screen data behind
 +--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
 data_behind(const FORM *form)
 {
   bool result = FALSE;
 
-  T((T_CALLED("data_behind(%p)"), form));
+  T((T_CALLED("data_behind(%p)"), (const void *)form));
 
   if (form && (form->status & _POSTED) && form->current)
     {
@@ -69,18 +70,18 @@ data_behind(const FORM *form)
 }
 
 /*---------------------------------------------------------------------------
-|   Facility      :  libnform  
+|   Facility      :  libnform
 |   Function      :  static char * Only_Padding(
 |                                    WINDOW *w,
 |                                    int len,
 |                                    int pad)
-|   
+|
 |   Description   :  Test if 'length' cells starting at the current position
 |                    contain a padding character.
 |
 |   Return Values :  true if only padding cells are found
 +--------------------------------------------------------------------------*/
-INLINE static bool
+NCURSES_INLINE static bool
 Only_Padding(WINDOW *w, int len, int pad)
 {
   bool result = TRUE;
@@ -103,7 +104,7 @@ Only_Padding(WINDOW *w, int len, int pad)
                }
            }
 #else
-         cell = winch(w);
+         cell = (FIELD_CELL)winch(w);
          if (ChCharOf(cell) != ChCharOf(pad))
            {
              result = FALSE;
@@ -122,21 +123,21 @@ Only_Padding(WINDOW *w, int len, int pad)
 }
 
 /*---------------------------------------------------------------------------
-|   Facility      :  libnform  
+|   Facility      :  libnform
 |   Function      :  bool data_ahead(const FORM *form)
-|   
+|
 |   Description   :  Check for off-screen data ahead. This is more difficult
-|                    because a dynamic field has a variable end. 
+|                    because a dynamic field has a variable end.
 |
 |   Return Values :  TRUE   - there are off-screen data ahead
 |                    FALSE  - there are no off-screen data ahead
 +--------------------------------------------------------------------------*/
-NCURSES_EXPORT(bool)
+FORM_EXPORT(bool)
 data_ahead(const FORM *form)
 {
   bool result = FALSE;
 
-  T((T_CALLED("data_ahead(%p)"), form));
+  T((T_CALLED("data_ahead(%p)"), (const void *)form));
 
   if (form && (form->status & _POSTED) && form->current)
     {
@@ -149,12 +150,11 @@ data_ahead(const FORM *form)
 
       if (Single_Line_Field(field))
        {
-         int check_len;
-
          pos = form->begincol + field->cols;
          while (pos < field->dcols)
            {
-             check_len = field->dcols - pos;
+             int check_len = field->dcols - pos;
+
              if (check_len >= field->cols)
                check_len = field->cols;
              cursor_moved = TRUE;