X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=form%2Ffrm_opts.c;h=18ab2938dcb4b7c94f5dd69d601a34d5019fdff1;hp=3557fcd7ff0430d0f643e209b8cf3ff87b9a83af;hb=84cf9f63bf604413fa5714ef91f83076ac8f236b;hpb=c6540b9c89dda1a6a8bd681726831e8924176504 diff --git a/form/frm_opts.c b/form/frm_opts.c index 3557fcd7..18ab2938 100644 --- a/form/frm_opts.c +++ b/form/frm_opts.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 1998-2012,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 * @@ -32,7 +33,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_opts.c,v 1.15 2010/01/23 21:14:36 tom Exp $") +MODULE_ID("$Id: frm_opts.c,v 1.18 2020/02/02 23:34:34 tom Exp $") /*--------------------------------------------------------------------------- | Facility : libnform @@ -49,8 +50,8 @@ set_form_opts(FORM *form, Form_Options opts) { T((T_CALLED("set_form_opts(%p,%d)"), (void *)form, opts)); - opts &= ALL_FORM_OPTS; - if (opts & ~ALL_FORM_OPTS) + opts &= (Form_Options) ALL_FORM_OPTS; + if ((unsigned)opts & ~ALL_FORM_OPTS) RETURN(E_BAD_ARGUMENT); else { @@ -71,7 +72,7 @@ NCURSES_EXPORT(Form_Options) form_opts(const FORM *form) { T((T_CALLED("form_opts(%p)"), (const void *)form)); - returnCode((int)(Normalize_Form(form)->opts & ALL_FORM_OPTS)); + returnCode((Form_Options) ((unsigned)Normalize_Form(form)->opts & ALL_FORM_OPTS)); } /*--------------------------------------------------------------------------- @@ -89,8 +90,8 @@ form_opts_on(FORM *form, Form_Options opts) { T((T_CALLED("form_opts_on(%p,%d)"), (void *)form, opts)); - opts &= ALL_FORM_OPTS; - if (opts & ~ALL_FORM_OPTS) + opts &= (Form_Options) ALL_FORM_OPTS; + if ((unsigned)opts & ~ALL_FORM_OPTS) RETURN(E_BAD_ARGUMENT); else { @@ -114,8 +115,8 @@ form_opts_off(FORM *form, Form_Options opts) { T((T_CALLED("form_opts_off(%p,%d)"), (void *)form, opts)); - opts &= ALL_FORM_OPTS; - if (opts & ~ALL_FORM_OPTS) + opts &= (Form_Options) ALL_FORM_OPTS; + if ((unsigned)opts & ~ALL_FORM_OPTS) RETURN(E_BAD_ARGUMENT); else {