X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fdemo_forms.c;h=70d249e21431b0c2a3f9d1f46c1a23184efca3bf;hp=0df590ab47ddad9fdc363453e3ea76b1177d4df9;hb=52aa842907b31bb56fb5133da3f023b45bd4355f;hpb=c8e187fc9682a3c5cfaebc480fc98d8585f6caf6 diff --git a/test/demo_forms.c b/test/demo_forms.c index 0df590ab..70d249e2 100644 --- a/test/demo_forms.c +++ b/test/demo_forms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2003-2008,2009 Free Software Foundation, Inc. * + * Copyright (c) 2003-2009,2010 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.33 2009/08/29 18:47:26 tom Exp $ + * $Id: demo_forms.c,v 1.36 2010/11/13 20:49:50 tom Exp $ * * Demonstrate a variety of functions from the form library. * Thomas Dickey - 2003/4/26 @@ -83,7 +83,7 @@ make_label(int frow, int fcol, NCURSES_CONST char *label) if (f) { set_field_buffer(f, 0, label); - set_field_opts(f, (int) (field_opts(f) & ~O_ACTIVE)); + set_field_opts(f, (int) ((unsigned) field_opts(f) & ~O_ACTIVE)); } return (f); } @@ -175,7 +175,7 @@ erase_form(FORM * f) static void show_insert_mode(bool insert_mode) { - mvaddstr(5, 57, (insert_mode + MvAddStr(5, 57, (insert_mode ? "form_status: insert " : "form_status: overlay")); } @@ -216,7 +216,7 @@ my_form_driver(FORM * form, int c) case MY_EDT_MODE: if ((field = current_field(form)) != 0) { set_current_field(form, another_field(form, field)); - if (field_opts(field) & O_EDIT) { + if ((unsigned) field_opts(field) & O_EDIT) { field_opts_off(field, O_EDIT); set_field_status(field, 0); } else { @@ -292,7 +292,7 @@ show_current_field(WINDOW *win, FORM * form) waddstr(win, "other"); } - if (field_opts(field) & O_EDIT) + if ((unsigned) field_opts(field) & O_EDIT) waddstr(win, " editable"); else waddstr(win, " readonly"); @@ -351,7 +351,7 @@ demo_forms(void) help_edit_field(); - mvaddstr(4, 57, "Forms Entry Test"); + MvAddStr(4, 57, "Forms Entry Test"); show_insert_mode(TRUE); refresh(); @@ -423,7 +423,7 @@ demo_forms(void) set_field_buffer(f[n - 1], 1, "Hello\nWorld!"); } - f[n++] = (FIELD *) 0; + f[n] = (FIELD *) 0; if ((form = new_form(f)) != 0) {