This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: better name for var_integer et.al.
> >Ada calls such numbers "Positive". var_positive might be a good name.
>
> Or var_ordinal_number (vs cardinal number)?
Yew! (sorry).
I prefer var_positive. Or var_nonzero_positive.
> >>> /* Like var_uinteger but signed. *VAR is an int. The user can type 0
> >>> to mean "unlimited", which is stored in *VAR as INT_MAX. */
> >>> var_integer,
>
> Well, the "set backtrace limit 100" bug comes from a comparison between
> signed (frame->limit == -1) vs unsigned (backtrace_limit == 100)
> comparison which is from a var_uinteger.
>
> Using var_integer "fixes" it but lets a user enter -100.
What would it mean, at the semantic level if the user entered
such a value? Shouldn't this value always be positive, with a
zero value being infinity?
Anyway, if we need to keep this kind of variables, how about
var_nonzero_integer (in line with one of the proposals above).
> >>> /* ZeroableInteger. *VAR is an int. Like Unsigned Integer except
> >>> that zero really means zero. */
> >>> var_zinteger,
> >
> >
> >var_integer? (assuming we get rid of the non-zero signed integer)
And then this one could become var_integer (an integer range contains
value zero by default, so no need to emphasize it with the 'z', IMHO).
--
Joel