From 88d6787f0736613b8c36a5e7b3c5df706bb94a3c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sun, 12 Aug 2007 15:20:16 +0000 Subject: [PATCH] * syscalls.cc (getw): Remove redundant implementation. (putw): Ditto. (wcscmp): Ditto. (wcslen): Ditto. (memccpy): Ditto. --- winsup/cygwin/ChangeLog | 8 ++++++ winsup/cygwin/syscalls.cc | 56 --------------------------------------- 2 files changed, 8 insertions(+), 56 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 0aee7f3a9..24c1704c3 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2007-08-12 Corinna Vinschen + + * syscalls.cc (getw): Remove redundant implementation. + (putw): Ditto. + (wcscmp): Ditto. + (wcslen): Ditto. + (memccpy): Ditto. + 2007-08-12 Corinna Vinschen * ntdll.h: Add descriptive comments to special Rtl functions. diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 2ac5f267f..342e51e92 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -2736,45 +2736,6 @@ __assertfail () exit (99); } -extern "C" int -getw (FILE *fp) -{ - int w, ret; - ret = fread (&w, sizeof (int), 1, fp); - return ret != 1 ? EOF : w; -} - -extern "C" int -putw (int w, FILE *fp) -{ - int ret; - ret = fwrite (&w, sizeof (int), 1, fp); - if (feof (fp) || ferror (fp)) - return -1; - return 0; -} - -extern "C" int -wcscmp (const wchar_t *s1, const wchar_t *s2) -{ - while (*s1 && *s1 == *s2) - { - s1++; - s2++; - } - - return (* (unsigned short *) s1) - (* (unsigned short *) s2); -} - -extern "C" size_t -wcslen (const wchar_t *s1) -{ - int l = 0; - while (s1[l]) - l++; - return l; -} - /* FIXME: to do this right, maybe work out the usoft va_list machine and use wsvprintfW instead? */ @@ -2797,23 +2758,6 @@ vhangup () return -1; } -extern "C" _PTR -memccpy (_PTR out, const _PTR in, int c, size_t len) -{ - const char *inc = (char *) in; - char *outc = (char *) out; - - while (len) - { - char x = *inc++; - *outc++ = x; - if (x == c) - return outc; - len --; - } - return 0; -} - extern "C" int setpriority (int which, id_t who, int value) {