From 6eb0452290fe091adc9d63cea498a009b7ec8565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski=20=28amade=29?= Date: Fri, 7 Jan 2011 02:38:51 +0100 Subject: remove unneded check logic, as we no longer use bcopy --- src/acconfig.h | 15 --------------- src/configure.in | 45 --------------------------------------------- src/extern.h | 3 --- src/misc.c | 18 ------------------ src/os.h | 13 ------------- src/screen.c | 3 --- 6 files changed, 97 deletions(-) diff --git a/src/acconfig.h b/src/acconfig.h index 2ede634..eff9ea0 100644 --- a/src/acconfig.h +++ b/src/acconfig.h @@ -404,21 +404,6 @@ */ #undef GETTTYENT -/* - * Define USEBCOPY if the bcopy/memcpy from your system's C library - * supports the overlapping of source and destination blocks. When - * undefined, screen uses its own (probably slower) version of bcopy(). - * - * SYSV machines may have a working memcpy() -- Oh, this is - * quite unlikely. Tell me if you see one. - * "But then, memmove() should work, if at all available" he thought... - * Boing, never say "works everywhere" unless you checked SCO UNIX. - * Their memove fails the test in the configure script. Sigh. (Juergen) - */ -#undef USEBCOPY -#undef USEMEMCPY -#undef USEMEMMOVE - /* * If your system has vsprintf() and requires the use of the macros in * "varargs.h" to use functions with variable arguments, diff --git a/src/configure.in b/src/configure.in index 9b02f0c..bb34037 100644 --- a/src/configure.in +++ b/src/configure.in @@ -1169,51 +1169,6 @@ AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT)) AC_CHECKING(fdwalk) AC_TRY_LINK([#include ], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK)) -AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments) -AC_TRY_RUN([ -main() { - char buf[10]; - strcpy(buf, "abcdefghi"); - bcopy(buf, buf + 2, 3); - if (strncmp(buf, "ababcf", 6)) - exit(1); - strcpy(buf, "abcdefghi"); - bcopy(buf + 2, buf, 3); - if (strncmp(buf, "cdedef", 6)) - exit(1); - exit(0); /* libc version works properly. */ -}], AC_DEFINE(USEBCOPY)) - -AC_TRY_RUN([ -#define bcopy(s,d,l) memmove(d,s,l) -main() { - char buf[10]; - strcpy(buf, "abcdefghi"); - bcopy(buf, buf + 2, 3); - if (strncmp(buf, "ababcf", 6)) - exit(1); - strcpy(buf, "abcdefghi"); - bcopy(buf + 2, buf, 3); - if (strncmp(buf, "cdedef", 6)) - exit(1); - exit(0); /* libc version works properly. */ -}], AC_DEFINE(USEMEMMOVE)) - - -AC_TRY_RUN([ -#define bcopy(s,d,l) memcpy(d,s,l) -main() { - char buf[10]; - strcpy(buf, "abcdefghi"); - bcopy(buf, buf + 2, 3); - if (strncmp(buf, "ababcf", 6)) - exit(1); - strcpy(buf, "abcdefghi"); - bcopy(buf + 2, buf, 3); - if (strncmp(buf, "cdedef", 6)) - exit(1); - exit(0); /* libc version works properly. */ -}], AC_DEFINE(USEMEMCPY)) AC_SYS_LONG_FILE_NAMES diff --git a/src/extern.h b/src/extern.h index 1404964..f312707 100644 --- a/src/extern.h +++ b/src/extern.h @@ -328,9 +328,6 @@ extern void centerline (char *, int); extern void leftline (char *, int, struct mchar *); extern char *Filename (char *); extern char *stripdev (char *); -#ifdef NEED_OWN_BCOPY -extern void xbcopy (char *, char *, int); -#endif extern void bclear (char *, int); extern void closeallfiles (int); extern int UserContext (void); diff --git a/src/misc.c b/src/misc.c index e3ba5f4..98501be 100644 --- a/src/misc.c +++ b/src/misc.c @@ -284,24 +284,6 @@ xsetegid(int egid) #endif /* HAVE_SETEUID */ - -#ifdef NEED_OWN_BCOPY -void -xbcopy(register char *s1, register char *s2, register int len) -{ - if (s1 < s2 && s2 < s1 + len) - { - s1 += len; - s2 += len; - while (len-- > 0) - *--s2 = *--s1; - } - else - while (len-- > 0) - *s2++ = *s1++; -} -#endif /* NEED_OWN_BCOPY */ - void bclear(char *p, int n) { diff --git a/src/os.h b/src/os.h index ab69d6e..70bafde 100644 --- a/src/os.h +++ b/src/os.h @@ -127,19 +127,6 @@ extern int errno; # define getcwd(b,l) getwd(b) #endif -#ifndef USEBCOPY -# ifdef USEMEMMOVE -# define bcopy(s,d,len) memmove(d,s,len) -# else -# ifdef USEMEMCPY -# define bcopy(s,d,len) memcpy(d,s,len) -# else -# define NEED_OWN_BCOPY -# define bcopy xbcopy -# endif -# endif -#endif - #if defined(HAVE_SETRESUID) && !defined(HAVE_SETREUID) # define setreuid(ruid, euid) setresuid(ruid, euid, -1) # define setregid(rgid, egid) setresgid(rgid, egid, -1) diff --git a/src/screen.c b/src/screen.c index 96bc47f..0414808 100644 --- a/src/screen.c +++ b/src/screen.c @@ -403,9 +403,6 @@ main(int argc, char **argv) #ifdef hpux debug("hpux\n"); #endif -#ifdef USEBCOPY - debug("USEBCOPY\n"); -#endif #ifdef UTMPOK debug("UTMPOK\n"); #endif -- cgit v1.2.1