-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
OK to commit this to avoid a couple of compile warnings on cygwin?
2007-05-16 Eric Blake <ebb9@byu.net>
* libc/stdlib/wctomb_r.c (_wctomb_r): Avoid gcc warnings on
cygwin.
* libc/search/hash.c (__hash_open): Likewise.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGSvpQ84KuGfSFAYARArtMAKCcjRLirM0Oteu/n7h3Jm3CEBjp3wCgl6wr
YTJFjFkIjObXmT1A/F4vGVs=
=TyoQ
-----END PGP SIGNATURE-----
------------------------------------------------------------------------
Index: libc/stdlib/wctomb_r.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdlib/wctomb_r.c,v
retrieving revision 1.6
diff -u -p -r1.6 wctomb_r.c
--- libc/stdlib/wctomb_r.c 20 Sep 2002 20:13:11 -0000 1.6
+++ libc/stdlib/wctomb_r.c 16 May 2007 12:32:39 -0000
@@ -13,9 +13,14 @@ int
_DEFUN (_wctomb_r, (r, s, wchar, state),
struct _reent *r _AND
char *s _AND
- wchar_t wchar _AND
+ wchar_t _wchar _AND
mbstate_t *state)
{
+ /* Avoids compiler warnings about comparisons that are always false
+ due to limited range when sizeof(wchar_t) is 2 but sizeof(wint_t)
+ is 4, as is the case on cygwin. */
+ wint_t wchar = _wchar;
+
if (strlen (__lc_ctype) <= 1)
{ /* fall-through */ }
else if (!strcmp (__lc_ctype, "C-UTF-8"))
@@ -171,4 +176,3 @@ _DEFUN (_wctomb_r, (r, s, wchar, state),
return 1;
}
-
Index: libc/search/hash.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/search/hash.c,v
retrieving revision 1.8
diff -u -p -r1.8 hash.c
--- libc/search/hash.c 30 Jan 2007 03:13:29 -0000 1.8
+++ libc/search/hash.c 16 May 2007 12:32:39 -0000
@@ -110,7 +110,11 @@ __hash_open(file, flags, mode, info, dfl
{
HTAB *hashp;
+#ifdef __USE_INTERNAL_STAT64
+ struct stat64 statbuf;
+#else
struct stat statbuf;
+#endif
DB *dbp;
int bpages, hdrsize, new_table, nsegs, save_errno;