All of lore.kernel.org
 help / color / mirror / Atom feed
* [xfsprogs] Do we need so many data types for user input?
@ 2017-04-04  8:54 Jan Tulak
  2017-04-04 19:48 ` Luis R. Rodriguez
  0 siblings, 1 reply; 9+ messages in thread
From: Jan Tulak @ 2017-04-04  8:54 UTC (permalink / raw)
  To: linux-xfs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-04-06 13:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04  8:54 [xfsprogs] Do we need so many data types for user input? Jan Tulak
2017-04-04 19:48 ` 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

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.