Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: Andrew Cagney <cagney@gnu.org>
Cc: gdb@sources.redhat.com
Subject: Re: better name for var_integer et.al.
Date: Thu, 16 Sep 2004 00:29:00 -0000	[thread overview]
Message-ID: <20040916002904.GZ5843@gnat.com> (raw)
In-Reply-To: <4148A713.3000704@gnu.org>

> >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


      reply	other threads:[~2004-09-16  0:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-15 18:05 Andrew Cagney
2004-09-15 18:19 ` Joel Brobecker
2004-09-15 20:35   ` Andrew Cagney
2004-09-16  0:29     ` Joel Brobecker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040916002904.GZ5843@gnat.com \
    --to=brobecker@gnat.com \
    --cc=cagney@gnu.org \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox