[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVxJT97wzYXbRYPYdy4Vnf4D4FOc410w7HVGzXEghkBw6JbiA@mail.gmail.com>
Date: Wed, 13 May 2015 15:19:03 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Noel Grandin <noelgrandin@...il.com>
Cc: Linux Kernel <linux-kernel@...r.kernel.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>
Subject: Re: [PATCH 02/12] Add parse_integer() (replacement for simple_strto*())
[Answering to Noel Grandin, gmane sent email to list only]
> > int parse_integer(const char *s, unsigned int base, T *val);
> >
>
> I suspect splitting this into
> parse_signed_int
> and
> parse_unsigned_int
> (or some other equivalent names)
> will make the call-sites a lot easier to read.
parse_integer() is about two and only two points (everything else is
immaterial and technical details):
1) unified interface,
2) automatically fixing overflow bug based on type T.
Two interfaces in this situation is no different from having four.
C doesn't have generic functions so programmers get hardwired
to million of names all doing roughly the same but __b_c_e and
_Generic allows to mimic generic functions which is at least something.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists