ncurses 5.7 - patch 20090815
[ncurses.git] / form / fld_max.c
index 1ed58176b889ae23f10b2b8ffeccc0862d7502ef..7f5352e00d6e5fd6f8bc723e69ecdf130335df9f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998,2000 Free Software Foundation, Inc.                   *
+ * Copyright (c) 1998-2003,2004 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            *
 
 /****************************************************************************
  *   Author:  Juergen Pfeifer, 1995,1997                                    *
- *   Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en             *
  ****************************************************************************/
 
 #include "form.priv.h"
 
-MODULE_ID("$Id: fld_max.c,v 1.6 2002/07/06 15:33:27 juergen Exp $")
+MODULE_ID("$Id: fld_max.c,v 1.9 2004/12/11 21:51:54 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnform  
@@ -46,17 +45,19 @@ MODULE_ID("$Id: fld_max.c,v 1.6 2002/07/06 15:33:27 juergen Exp $")
 |                    E_BAD_ARGUMENT - invalid argument
 +--------------------------------------------------------------------------*/
 NCURSES_EXPORT(int)
-set_max_field (FIELD *field, int maxgrow)
+set_max_field(FIELD *field, int maxgrow)
 {
-  if (!field || (maxgrow<0))
+  T((T_CALLED("set_max_field(%p,%d)"), field, maxgrow));
+
+  if (!field || (maxgrow < 0))
     RETURN(E_BAD_ARGUMENT);
   else
     {
       bool single_line_field = Single_Line_Field(field);
 
-      if (maxgrow>0)
+      if (maxgrow > 0)
        {
-         if (( single_line_field && (maxgrow < field->dcols)) ||
+         if ((single_line_field && (maxgrow < field->dcols)) ||
              (!single_line_field && (maxgrow < field->drows)))
            RETURN(E_BAD_ARGUMENT);
        }
@@ -64,13 +65,13 @@ set_max_field (FIELD *field, int maxgrow)
       field->status &= ~_MAY_GROW;
       if (!(field->opts & O_STATIC))
        {
-         if ((maxgrow==0) ||
-             ( single_line_field && (field->dcols < maxgrow)) ||
+         if ((maxgrow == 0) ||
+             (single_line_field && (field->dcols < maxgrow)) ||
              (!single_line_field && (field->drows < maxgrow)))
            field->status |= _MAY_GROW;
        }
     }
   RETURN(E_OK);
 }
-                 
+
 /* fld_max.c ends here */