diff options
author | monty@hundin.mysql.fi <> | 2001-12-17 15:00:14 +0200 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-12-17 15:00:14 +0200 |
commit | 1904d7a88d977047c513f81ed36f2070a493de37 (patch) | |
tree | 7f95675b3decc36faca63e90ee99ac223133c290 /strings | |
parent | 7d6e8ee7b4d93120283b4a1138a8b9ecbf0f5b2a (diff) | |
download | mariadb-git-1904d7a88d977047c513f81ed36f2070a493de37.tar.gz |
Portability fixes
Diffstat (limited to 'strings')
-rw-r--r-- | strings/bcmp.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/strings/bcmp.c b/strings/bcmp.c index 52f545e7b42..7b510258fef 100644 --- a/strings/bcmp.c +++ b/strings/bcmp.c @@ -18,12 +18,18 @@ bcmp(s1, s2, len) returns 0 if the "len" bytes starting at "s1" are identical to the "len" bytes starting at "s2", non-zero if they are different. - Now only used with purify. + Now only used with purify because purify gives wrong warnings when + comparing a shorter string with bcmp. */ #include <my_global.h> #include "m_string.h" +#ifdef HAVE_purify +#undef bcmp +#undef HAVE_BCMP +#endif + #if !defined(bcmp) && !defined(HAVE_BCMP) #if defined(MC68000) && defined(DS90) @@ -45,14 +51,7 @@ uint len; /* 0 <= len <= 65535 */ #else -#ifdef HAVE_purify -int my_bcmp(s1, s2, len) -#else -int bcmp(s1, s2, len) -#endif - register const char *s1; - register const char *s2; - register uint len; +int bcmp(register const char *s1,register const char *s2, register uint len) { while (len-- != 0 && *s1++ == *s2++) ; return len+1; |