duplicate members fix on Solaris Netatalk


Subject: duplicate members fix on Solaris Netatalk
From: Dejan Ilic (svedja@morgaine.rydnet.lysator.liu.se)
Date: Fri Jun 20 1997 - 19:39:27 EDT


ddp.h is missing a "#include <endian.h>"

and thus "BYTE_ORDER == BIG_ENDIAN" would mean "0 == 0" because non of
them would be defined, and that is equal. Very dangerous and nasty bug.
Same for little_endian check.

We are going to find more bugs like this in the future so I think we
should avoid them. I propose that we just use simle checks like "#ifdef
BIG_ENDIAN" to avoid problems like above.

Also this prototype match is needed to get thru compilation on
Solaris_x86 2.5 :

--- libatalk/compat/strcasecmp.c.ORIG Sat Jun 21 02:35:00 1997
+++ libatalk/compat/strcasecmp.c Sat Jun 21 02:32:09 1997
@@ -70,7 +70,11 @@

 int
 strcasecmp(s1, s2)
+#ifdef SOLARIS
+ const char *s1, *s2;
+#else
        char *s1, *s2;
+#endif
 {
        register u_char *cm = charmap,
                        *us1 = (u_char *)s1,
@@ -84,7 +88,11 @@

 int
 strncasecmp(s1, s2, n)
+#ifdef SOLARIS
+ const char *s1, *s2;
+#else
        char *s1, *s2;
+#endif
        register size_t n;
 {
        if (n != 0) {

=====================================================================
Dejan Ilic, Tech Univ. of Linkoping, Sweden Phone: +46-13-473 01 06
Email: svedja@lysator.liu.se Web: http://www.lysator.liu.se/~svedja

"I may look like The Devil but i'm an angel deep down in my heart"
=====================================================================
[finger -l svedja@lysator.liu.se for public PGP key]



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:25:06 EST