svn commit: r298247 - head/sbin/fdisk_pc98

Pedro Giffuni pfg at FreeBSD.org
Wed Apr 20 15:04:45 UTC 2016



On 04/20/16 09:41, Conrad Meyer wrote:
> On Wed, Apr 20, 2016 at 7:33 AM, Pedro Giffuni <pfg at freebsd.org> wrote:
>> One of the things I dislike is that most of the macros are in
>> lowercase. Lowercase would make sense if these were inline functions
>> but inline functions have disadvantages for these use cases.
>> OTOH, if they were uppercase, they would not be very easy on the eyes,
>> which is the current advantage.
>
>
> You bring up a good point.  Obviously nitems() can't be an inline
> function, but roundup2() and friends could.  Is there any reason not
> to change them over to inline functions?
>

That would be interesting. The question would be if there are type
issues. I guess most uses require ints but some many use size_t.

If you are willing to try that, have a look at his patch:

https://people.freebsd.org/~pfg/patches/sys-roundup2.diff

I also have a coccinelle "patch" to replace howmany()
and roundup().

Pedro.


More information about the svn-src-head mailing list