>>>>> "Georg" == Georg Baum <[EMAIL PROTECTED]> writes:
Georg> Am Samstag, 27. November 2004 15:01 schrieb Lars Gullik Georg> Bjønnes: >> Do we really need this header file anymore? >> >> And if we do, shouldn't we just handle this in the >> configure/config.h instead? Actually BROKEN_HEADERS is never set! It seems that I forgot something when removing --with-broken-headers... Therefore I propose the following cleanup patch. While I was at it, I removed all traces of strcmp, memset and memmove. Comments? JMarc
Index: ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/ChangeLog,v retrieving revision 1.980 diff -u -p -r1.980 ChangeLog --- ChangeLog 4 Nov 2004 14:44:33 -0000 1.980 +++ ChangeLog 29 Nov 2004 15:54:04 -0000 @@ -1,3 +1,8 @@ +2004-11-29 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * configure.ac: do not include broken_headers.h; do not check for + strchr, memset and memmove + 2004-11-04 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> * configure.ac: do not check for snprintf Index: configure.ac =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v retrieving revision 1.29 diff -u -p -r1.29 configure.ac --- configure.ac 4 Nov 2004 14:44:34 -0000 1.29 +++ configure.ac 29 Nov 2004 15:54:04 -0000 @@ -291,7 +291,7 @@ dnl work correctly because of some confl dnl We aim to remove this eventually, since we should test as much as dnl possible with the compiler which will use the functions (JMarc) AC_LANG_PUSH(C) -AC_CHECK_FUNCS(memmove memset strchr mkfifo mkstemp mktemp) +AC_CHECK_FUNCS(mkfifo mkstemp mktemp) AC_LANG_POP(C) AC_FUNC_SELECT_ARGTYPES @@ -338,23 +338,11 @@ AH_BOTTOM([ /************************************************************ ** You should not need to change anything beyond this point */ -#ifndef HAVE_STRCHR -# define strchr(a,b) index(a,b) -#endif - -#ifndef HAVE_MEMMOVE -# define memmove(a,b,c) bcopy(b,a,c) -#endif - #ifndef HAVE_STRERROR #if defined(__cplusplus) extern "C" #endif char * strerror(int n); -#endif - -#ifdef BROKEN_HEADERS -#include "broken_headers.h" #endif #ifdef HAVE_MKSTEMP Index: src/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/ChangeLog,v retrieving revision 1.2047 diff -u -p -r1.2047 ChangeLog --- src/ChangeLog 25 Nov 2004 19:12:56 -0000 1.2047 +++ src/ChangeLog 29 Nov 2004 15:54:05 -0000 @@ -1,3 +1,9 @@ +2004-11-29 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * broken_headers.h: remove + + * Makefile.am (lyx_SOURCES): remove broken_headers.h + 2004-11-25 Lars Gullik Bjonnes <[EMAIL PROTECTED]> * rename a lot of InsetOld to InsetBase Index: src/Makefile.am =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/Makefile.am,v retrieving revision 1.218 diff -u -p -r1.218 Makefile.am --- src/Makefile.am 26 Oct 2004 18:39:09 -0000 1.218 +++ src/Makefile.am 29 Nov 2004 15:54:05 -0000 @@ -115,7 +115,6 @@ lyx_SOURCES = \ boost.C \ box.h \ box.C \ - broken_headers.h \ buffer.C \ buffer.h \ buffer_funcs.C \ Index: src/broken_headers.h =================================================================== RCS file: src/broken_headers.h diff -N src/broken_headers.h --- src/broken_headers.h 23 Aug 2003 00:16:06 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,32 +0,0 @@ -// -*- C++ -*- -/** - * \file broken_headers.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - * - * \author Lars Gullik Bjønnes - * - * Full author contact details are available in file CREDITS. - */ - -// A few prototypes missing from Sun and SCO 3.2v4 header files. - -#ifndef BROKEN_HEADERS_H -#define BROKEN_HEADERS_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HAVE_MEMMOVE -void bcopy(unsigned char * b1, unsigned char * b2, int length); -#endif - -int readlink(char const * path, char * buf, int bufsiz); -int strcasecmp(char const * s1, char const * s2); - -#ifdef __cplusplus -} -#endif - -#endif /* _BROKEN_HEADERS_H */ Index: src/frontends/xforms/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/ChangeLog,v retrieving revision 1.950 diff -u -p -r1.950 ChangeLog --- src/frontends/xforms/ChangeLog 26 Nov 2004 14:37:40 -0000 1.950 +++ src/frontends/xforms/ChangeLog 29 Nov 2004 15:54:05 -0000 @@ -1,3 +1,7 @@ +2004-11-29 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * input_validators.C: use support::contains instead of strchr + 2004-11-26 Angus Leeming <[EMAIL PROTECTED]> * FormFiledialog.C (expand_globs): changes due to the changed Index: src/frontends/xforms/input_validators.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/xforms/input_validators.C,v retrieving revision 1.19 diff -u -p -r1.19 input_validators.C --- src/frontends/xforms/input_validators.C 5 Sep 2003 13:15:43 -0000 1.19 +++ src/frontends/xforms/input_validators.C 29 Nov 2004 15:54:05 -0000 @@ -17,7 +17,9 @@ #include "lyx_forms.h" namespace support = lyx::support; - +using support::contains; +using support::isStrInt; +using support::isStrDbl; #if defined(__cplusplus) extern "C" @@ -28,8 +30,8 @@ int fl_int_filter(FL_OBJECT * ob, char const *, char const *, int c) { if (c == 0 /* final test before handing contents to app */ - || strchr("0123456789+-", c)) { - if (support::isStrInt(fl_get_input(ob))) + || contains("0123456789+-", c)) { + if (isStrInt(fl_get_input(ob))) return FL_VALID; } return FL_INVALID|FL_RINGBELL; @@ -40,7 +42,7 @@ int fl_unsigned_int_filter(FL_OBJECT * / char const *, char const *, int c) { if (c == 0 /* final test before handing contents to app */ - || strchr("0123456789", c)) { + || contains("0123456789", c)) { /* since we only accept numerals then it must be valid */ return FL_VALID; } @@ -52,8 +54,8 @@ int fl_float_filter(FL_OBJECT * ob, char const *, char const *, int c) { if (c == 0 /* final test before handing contents to app */ - || strchr("0123456789.+-", c)) { - if (support::isStrDbl(fl_get_input(ob))) + || contains("0123456789.+-", c)) { + if (isStrDbl(fl_get_input(ob))) return FL_VALID; } return FL_INVALID|FL_RINGBELL; @@ -66,8 +68,8 @@ int fl_unsigned_float_filter(FL_OBJECT * int c) { if (c == 0 /* final test before handing contents to app */ - || strchr("0123456789.", c)) { - if (support::isStrDbl(fl_get_input(ob))) + || contains("0123456789.", c)) { + if (isStrDbl(fl_get_input(ob))) return FL_VALID; } return FL_INVALID|FL_RINGBELL; @@ -80,7 +82,7 @@ int fl_lowercase_filter(FL_OBJECT * /*ob int c) { if (c == 0 /* final test before handing contents to app */ - || strchr("abcdefghijklmnopqrstuvwxyz0123456789", c)) { + || contains("abcdefghijklmnopqrstuvwxyz0123456789", c)) { /* since we only accept numerals then it must be valid */ return FL_VALID; } Index: src/mathed/ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/ChangeLog,v retrieving revision 1.456 diff -u -p -r1.456 ChangeLog --- src/mathed/ChangeLog 26 Nov 2004 13:56:22 -0000 1.456 +++ src/mathed/ChangeLog 29 Nov 2004 15:54:05 -0000 @@ -1,3 +1,7 @@ +2004-11-29 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> + + * math_charinset.C: use support::contains instead of strchr + 2004-11-26 Georg Baum <[EMAIL PROTECTED]> * math_hullinset.C (getStatus): add status messages Index: src/mathed/math_charinset.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/mathed/math_charinset.C,v retrieving revision 1.68 diff -u -p -r1.68 math_charinset.C --- src/mathed/math_charinset.C 23 Nov 2004 23:04:49 -0000 1.68 +++ src/mathed/math_charinset.C 29 Nov 2004 15:54:05 -0000 @@ -17,28 +17,23 @@ #include "debug.h" #include "dimension.h" +#include "support/lstrings.h" #include "textpainter.h" using std::auto_ptr; -#ifndef CXX_GLOBAL_CSTD -using std::strchr; -#endif - - extern bool has_math_fonts; namespace { bool isBinaryOp(char c) { - return strchr("+-<>=/*", c); + return lyx::support::contains("+-<>=/*", c); } bool slanted(char c) { - //if (strchr("0123456789;:!|[]().,?+/-*<>=", c) return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'); }