Solaris 2.6 doesn't support "signed char". What a broken system!
authorAndrew Tridgell <tridge@samba.org>
Wed, 6 May 1998 06:21:35 +0000 (06:21 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 6 May 1998 06:21:35 +0000 (06:21 +0000)
README
checksum.c
configure.in
match.c
rsync.h

diff --git a/README b/README
index 20d5054..e11ef88 100644 (file)
--- a/README
+++ b/README
@@ -72,6 +72,12 @@ To install rsync, first run the "configure" script. This will create a
 Makefile and config.h appropriate for your system. Then type
 "make". 
 
+Note that on some systems you will have to force configure not to use
+gcc because gcc may not support some features (such as 64 bit file
+offsets) that your system may support. Set the environment variable CC
+to the name of your native compiler before running configure in this
+case. 
+
 Once built put a copy of rsync in your search path on the local and
 remote systems (or use "make install"). That's it!
 
index 6186aae..6dc935e 100644 (file)
@@ -34,7 +34,7 @@ uint32 get_checksum1(char *buf1,int len)
 {
     int i;
     uint32 s1, s2;
-    signed char *buf = (signed char *)buf1;
+    schar *buf = (schar *)buf1;
 
     s1 = s2 = 0;
     for (i = 0; i < (len-4); i+=4) {
index 511620a..65a40a5 100644 (file)
@@ -60,7 +60,13 @@ echo $ac_n "checking for off64_t ... $ac_c"
 AC_TRY_RUN([#include <stdio.h>
 #include <sys/stat.h>
 main() { struct stat64 st; off64_t s; exit((lstat64("/dev/null", &st)==0)?0:1); }],
-echo yes;AC_DEFINE(HAVE_LONGLONG), 
+echo yes;AC_DEFINE(HAVE_OFF64_T), 
+echo no)
+
+echo $ac_n "checking for unsigned char ... $ac_c"
+AC_TRY_RUN([#include <stdio.h>
+main() { char c; c=250; exit((c > 0)?0:1); }],
+echo yes;AC_DEFINE(HAVE_UNSIGNED_CHAR), 
 echo no)
 
 echo $ac_n "checking for utimbuf ... $ac_c"
diff --git a/match.c b/match.c
index dda156f..3689af4 100644 (file)
--- a/match.c
+++ b/match.c
@@ -130,14 +130,14 @@ static void hash_search(int f,struct sum_struct *s,
        int end;
        char sum2[SUM_LENGTH];
        uint32 s1, s2, sum; 
-       signed char *map;
+       schar *map;
 
        if (verbose > 2)
                fprintf(FINFO,"hash search b=%d len=%d\n",s->n,(int)len);
 
        k = MIN(len, s->n);
        
-       map = (signed char *)map_ptr(buf,0,k);
+       map = (schar *)map_ptr(buf,0,k);
        
        sum = get_checksum1((char *)map, k);
        s1 = sum & 0xFFFF;
@@ -178,7 +178,7 @@ static void hash_search(int f,struct sum_struct *s,
                        
                        if (!done_csum2) {
                                int l = MIN(s->n,len-offset);
-                               map = (signed char *)map_ptr(buf,offset,l);
+                               map = (schar *)map_ptr(buf,offset,l);
                                get_checksum2((char *)map,l,sum2);
                                done_csum2 = 1;
                        }
@@ -191,7 +191,7 @@ static void hash_search(int f,struct sum_struct *s,
                        matched(f,s,buf,offset,i);
                        offset += s->sums[i].len - 1;
                        k = MIN((len-offset), s->n);
-                       map = (signed char *)map_ptr(buf,offset,k);
+                       map = (schar *)map_ptr(buf,offset,k);
                        sum = get_checksum1((char *)map, k);
                        s1 = sum & 0xFFFF;
                        s2 = sum >> 16;
@@ -201,7 +201,7 @@ static void hash_search(int f,struct sum_struct *s,
                
        null_tag:
                /* Trim off the first byte from the checksum */
-               map = (signed char *)map_ptr(buf,offset,k+1);
+               map = (schar *)map_ptr(buf,offset,k+1);
                s1 -= map[0] + CHAR_OFFSET;
                s2 -= k * (map[0]+CHAR_OFFSET);
                
diff --git a/rsync.h b/rsync.h
index 34eeb57..3418b81 100644 (file)
--- a/rsync.h
+++ b/rsync.h
 #define uchar unsigned char
 #endif
 
+#if HAVE_UNSIGNED_CHAR
+#define schar signed char
+#else
+#define schar char
+#endif
+
 #ifndef int32
 #if (SIZEOF_INT == 4)
 #define int32 int