From owner-cvs-src@FreeBSD.ORG Sun May 30 23:31:33 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 498B816A4CE; Sun, 30 May 2004 23:31:33 -0700 (PDT) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4680843D48; Sun, 30 May 2004 23:31:32 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.0.86])i4V6VU4u021614; Mon, 31 May 2004 16:31:30 +1000 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i4V6VS2O000768; Mon, 31 May 2004 16:31:29 +1000 Date: Mon, 31 May 2004 16:31:27 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Nate Lawson In-Reply-To: <20040530213504.I16510@root.org> Message-ID: <20040531161707.A13309@gamplex.bde.org> References: <200405290641.i4T6fHhj002797@repoman.freebsd.org> <20040530213504.I16510@root.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Bill Paul cc: src-committers@freebsd.org cc: Pawel Jakub Dawidek cc: cvs-all@freebsd.org cc: cvs-src@freebsd.org Subject: Re: cvs commit: src/sys/compat/ndis subr_ndis.c src/sys/dev/if_ndis if_ndis.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2004 06:31:33 -0000 On Sun, 30 May 2004, Nate Lawson wrote: > While we're at it, two from acpi: > /* FreeBSD doesn't have strupr, should be fixed. (move to libkern) */ > static __inline char * > strupr(char *str) > { > char *c = str; > while(*c) { > *c = toupper(*c); > c++; > } > return(str); > } libc doesn't seem to have this, but if it did then it would have a version without so many style bugs. FreeBSD userland seems to only have it in libroken. Why would the kernel need it more than libc? > #ifdef _KERNEL > /* Or strstr (used in debugging mode, also move to libkern) */ > static __inline char * > strstr(char *s, char *find) > { > char c, sc; > size_t len; > > if ((c = *find++) != 0) { > len = strlen(find); > do { > do { > if ((sc = *s++) == 0) > return (NULL); > } while (sc != c); > } while (strncmp(s, find, len) != 0); > s--; > } > return ((char *)s); > } > #endif /* _KERNEL */ libc already has a version of this without so many bugs and style bugs. The above is was apparently obtained from rev.1.1 of libc/string/strstr.c (its only differences are "static __inline", de-register'ing and format mangling). The libc version has since caught up with the 1980's and uses "const". Bruce