cvs commit: src/usr.bin/bluetooth/rfcomm_sppd rfcomm_sdp.c

Bruce Evans bde at zeta.org.au
Tue Apr 13 18:18:06 PDT 2004


On Tue, 13 Apr 2004, Ruslan Ermilov wrote:

> On Tue, Apr 13, 2004 at 02:46:42PM +0200, Dag-Erling Sm?rgrav wrote:
> > Maksim Yevmenkin <emax at FreeBSD.org> writes:
> > >   Log:
> > >   Use uint instead of u_int
> >
> > What's wrong with "unsigned int"?

It is excessively verbose (" int" in "unsigned int" is noise), and is
a style bug in many places (e.g., in most parts of the kernel, and in
utilities that are closely related to the kernel and/or use kernel
style, e.g., vmstat).  These places spell "unsigned[ int]" as u_int.

> The actual commit changed a bunch of u_int*_t to uint*_t.
> I'd be confused too if I wasn't asked to review the patches.  ;)

Indeed.  uint is SYSV compatibility cruft, but the commit actually changed
the BSDish u_int prefix to the C99 uint prefix.

I used to enforce not using uint or ushort in the kernel:

%%%
Index: types.h
===================================================================
RCS file: /home/ncvs/src/sys/sys/types.h,v
retrieving revision 1.85
diff -u -2 -r1.85 types.h
--- types.h	7 Apr 2004 04:19:50 -0000	1.85
+++ types.h	14 Apr 2004 01:13:27 -0000
@@ -50,10 +49,12 @@
 typedef	unsigned int	u_int;
 typedef	unsigned long	u_long;
+#ifndef _KERNEL
 typedef	unsigned short	ushort;		/* Sys V compatibility */
 typedef	unsigned int	uint;		/* Sys V compatibility */
 #endif
+#endif

 /*
- * XXX POSIX sized integrals that should appear only in <sys/stdint.h>.
+ * XXX C99 integer types that should appear only in <sys/stdint.h>.
  */
 #ifndef _INT8_T_DECLARED
%%%

This used to work, but hasn't been tested recently.

Bruce


More information about the cvs-src mailing list