All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Tulak <jtulak@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [xfsprogs] Do we need so many data types for user input?
Date: Tue, 4 Apr 2017 10:54:09 +0200	[thread overview]
Message-ID: <CACj3i738tUsYyRvQmr3NfPQ=P2FNruh2xsr1TAuLMJ69AV0a0w@mail.gmail.com> (raw)

Hi guys,

as I'm still working on the mkfs changes, there is an opportunity to
clean up data types a bit. Right now, we are saving user input into
long long, bool, uint64, int, uint and string. Custom data types are
not saved into directly but such values are usually a result of a
computation.

I can't find any place (in the user-input section) where would we
really need anything else except uint64 and string. Some examples:

* We load an option into an int and then raise an error if it is a
negative number
* Or we even allow for 0, 1 (and 2) only
* It seems that the only place where we are not limiting the int
values immediately are logarithmic options. But unless my math
knowledge failed me, only complex logarithm is defined for negative
numbers and I really doubt we want to have "3+4.5 i" as blocksize...
;-)

Simply stated, signed values seem to be useless here. And at the end
of the day, we are converting all numbers into unsigned in one part of
the parsing anyway, so I don't see how such a change could change any
behaviour.

So what do you think, can I remove the other types in user-input part
of the code and save all numbers as uint64?

Cheers,
Jan

-- 
Jan Tulak
jtulak@redhat.com / jan@tulak.me

             reply	other threads:[~2017-04-04  8:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-04  8:54 Jan Tulak [this message]
2017-04-04 19:48 ` [xfsprogs] Do we need so many data types for user input? Luis R. Rodriguez
2017-04-04 20:17   ` Eric Sandeen
2017-04-05  8:26     ` Jan Tulak
2017-04-05 14:08       ` Eric Sandeen
2017-04-05 14:24         ` Jan Tulak
2017-04-06 12:40           ` Luis R. Rodriguez
2017-04-06 13:03             ` Jan Tulak
2017-04-05 12:15   ` Dave Chinner

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='CACj3i738tUsYyRvQmr3NfPQ=P2FNruh2xsr1TAuLMJ69AV0a0w@mail.gmail.com' \
    --to=jtulak@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.