]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/demo_forms.c
ncurses 6.0 - patch 20170415
[ncurses.git] / test / demo_forms.c
index f891b0407b85ed0067164af9c1c438aaf1317989..e3a11122b8c15a6d170161b5f903611a3a0f66fc 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2003-2014,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 2003-2016,2017 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            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_forms.c,v 1.52 2016/09/10 21:14:55 tom Exp $
+ * $Id: demo_forms.c,v 1.53 2017/04/10 00:28:54 tom Exp $
  *
  * Demonstrate a variety of functions from the form library.
  * Thomas Dickey - 2003/4/26
@@ -227,7 +227,7 @@ make_field(const char *label, int frow, int fcol, int rows, int cols)
 }
 
 static void
-display_form(FORM * f)
+display_form(FORM *f)
 {
     WINDOW *w;
     int rows, cols;
@@ -250,7 +250,7 @@ display_form(FORM * f)
 }
 
 static void
-erase_form(FORM * f)
+erase_form(FORM *f)
 {
     WINDOW *w = form_win(f);
     WINDOW *s = form_sub(f);
@@ -273,7 +273,7 @@ show_insert_mode(bool insert_mode)
 #define O_SELECTABLE (O_ACTIVE | O_VISIBLE)
 
 static FIELD *
-another_field(FORM * form, FIELD * field)
+another_field(FORM *form, FIELD *field)
 {
     FIELD **f = form_fields(form);
     FIELD *result = 0;
@@ -290,7 +290,7 @@ another_field(FORM * form, FIELD * field)
 }
 
 static int
-my_form_driver(FORM * form, int c)
+my_form_driver(FORM *form, int c)
 {
     static bool insert_mode = TRUE;
     FIELD *field;
@@ -337,7 +337,7 @@ my_form_driver(FORM * form, int c)
 }
 
 static void
-show_current_field(WINDOW *win, FORM * form)
+show_current_field(WINDOW *win, FORM *form)
 {
     FIELD *field;
     FIELDTYPE *type;
@@ -559,8 +559,7 @@ demo_forms(void)
        free_form(form);
     }
     for (c = 0; f[c] != 0; c++) {
-       void *ptr = field_userptr(f[c]);
-       free(ptr);
+       free_edit_field(f[c]);
        free_field(f[c]);
     }
     noraw();