strict signatures for kobj methods in sound subsystem
avg at icyb.net.ua
Thu Apr 16 07:44:44 PDT 2009
on 16/04/2009 15:30 Alexander Leidinger said the following:
> Quoting Andriy Gapon <avg at icyb.net.ua> (from Wed, 15 Apr 2009 21:06:13
>> Please review the attached, largely mechanical, patch for sound
>> This patch is supposed to make all functions that implement kobj
>> methods have
>> strictly the same signatures as defined by the interfaces.
> As you have to change a lot of places, a question would be if it is ok
> to change the interface from u_int32_t to int instead. I haven't
> investigated if this is about our internal in-kernel interface, or
> (indirectly) the official userland OSS interface. I also hadn't a look
> what 3rd party sound drivers (e.g. in ports) are using.
I think that this would be incorrect because callers of those methods do actually
expect uint32_t to be returned, e.g. they assign the result to a variable of such
type etc. In fact most of those changed functions do have uint32_t type for the
variables that they return. Although uint32_t->int->uint32_t conversion via return
doesn't cause any loss or altering of information, it's still not good, IMO.
> You are also mixing u_int32_t and uint32_t in the change. Most of them
> are of the u_int32_t style, but some changes have uint32_t.
Yes, but I am preserving the style of each individual file being changed.
More information about the freebsd-multimedia