Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Apr 2004 11:17:57 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Ruslan Ermilov <ru@freebsd.org>
Cc:        cvs-src@freebsd.org
Subject:   Re: cvs commit: src/usr.bin/bluetooth/rfcomm_sppd rfcomm_sdp.c
Message-ID:  <20040414110419.M5769@gamplex.bde.org>
In-Reply-To: <20040413125558.GC46878@ip.net.ua>
References:  <200404092326.i39NQGUC078871@repoman.freebsd.org> <xzpoepwujt9.fsf@dwp.des.no> <20040413125558.GC46878@ip.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040414110419.M5769>