Got rid of two now-unneeded casts.
authorWayne Davison <wayned@samba.org>
Thu, 12 Jul 2007 14:54:13 +0000 (14:54 +0000)
committerWayne Davison <wayned@samba.org>
Thu, 12 Jul 2007 14:54:13 +0000 (14:54 +0000)
checksum-updating.diff

index b25d101..63911a7 100644 (file)
@@ -11,7 +11,7 @@ To use this patch, run these commands for a successful build:
 
 --- old/clientserver.c
 +++ new/clientserver.c
-@@ -36,6 +36,7 @@ extern int sanitize_paths;
+@@ -37,6 +37,7 @@ extern int sanitize_paths;
  extern int filesfrom_fd;
  extern int remote_protocol;
  extern int protocol_version;
@@ -19,7 +19,7 @@ To use this patch, run these commands for a successful build:
  extern int io_timeout;
  extern int no_detach;
  extern int default_af_hint;
-@@ -640,6 +641,8 @@ static int rsync_module(int f_in, int f_
+@@ -641,6 +642,8 @@ static int rsync_module(int f_in, int f_
        else if (am_root < 0) /* Treat --fake-super from client as --super. */
                am_root = 2;
  
@@ -30,7 +30,7 @@ To use this patch, run these commands for a successful build:
  
 --- old/flist.c
 +++ new/flist.c
-@@ -24,6 +24,7 @@
+@@ -25,6 +25,7 @@
  #include "io.h"
  
  extern int verbose;
@@ -38,7 +38,7 @@ To use this patch, run these commands for a successful build:
  extern int list_only;
  extern int am_root;
  extern int am_server;
-@@ -56,6 +57,7 @@ extern int implied_dirs;
+@@ -57,6 +58,7 @@ extern int implied_dirs;
  extern int file_extra_cnt;
  extern int ignore_perishable;
  extern int non_perishable_cnt;
@@ -46,7 +46,7 @@ To use this patch, run these commands for a successful build:
  extern int prune_empty_dirs;
  extern int copy_links;
  extern int copy_unsafe_links;
-@@ -78,6 +80,9 @@ extern iconv_t ic_send, ic_recv;
+@@ -79,6 +81,9 @@ extern iconv_t ic_send, ic_recv;
  
  #define PTR_SIZE (sizeof (struct file_struct *))
  
@@ -56,7 +56,7 @@ To use this patch, run these commands for a successful build:
  int io_error;
  int checksum_len;
  dev_t filesystem_dev; /* used to implement -x */
-@@ -100,6 +105,10 @@ static char tmp_sum[MAX_DIGEST_LEN];
+@@ -101,6 +106,10 @@ static char tmp_sum[MAX_DIGEST_LEN];
  static char empty_sum[MAX_DIGEST_LEN];
  static int flist_count_offset; /* for --delete --progress */
  static int dir_count = 0;
@@ -67,7 +67,7 @@ To use this patch, run these commands for a successful build:
  
  static void clean_flist(struct file_list *flist, int strip_root);
  static void output_flist(struct file_list *flist);
-@@ -316,6 +325,304 @@ static void flist_done_allocating(struct
+@@ -317,6 +326,304 @@ static void flist_done_allocating(struct
                flist->pool_boundary = ptr;
  }
  
@@ -118,7 +118,7 @@ To use this patch, run these commands for a successful build:
 +              OPT_EXTRA(file, 0)->unum = (uint32)(file_length >> 32);
 +      }
 +      file->dirname = dirname;
-+      bp = (char*)F_SUM(file);
++      bp = F_SUM(file);
 +      memcpy(bp, sum, checksum_len);
 +#if SIZEOF_TIME_T == 4
 +      OPT_EXTRA(file, LEN64_BUMP(file) + SUM_EXTRA_CNT)->num = ctime;
@@ -372,7 +372,7 @@ To use this patch, run these commands for a successful build:
  int push_pathname(const char *dir, int len)
  {
        if (dir == pathname)
-@@ -972,34 +1279,24 @@ static struct file_struct *recv_file_ent
+@@ -973,34 +1280,24 @@ static struct file_struct *recv_file_ent
        return file;
  }
  
@@ -413,7 +413,7 @@ To use this patch, run these commands for a successful build:
        char *bp;
  
        if (strlcpy(thisname, fname, sizeof thisname) >= sizeof thisname) {
-@@ -1075,6 +1372,8 @@ struct file_struct *make_file(const char
+@@ -1076,6 +1373,8 @@ struct file_struct *make_file(const char
        if (is_excluded(thisname, S_ISDIR(st.st_mode) != 0, filter_level)) {
                if (ignore_perishable)
                        non_perishable_cnt++;
@@ -422,7 +422,7 @@ To use this patch, run these commands for a successful build:
                return NULL;
        }
  
-@@ -1113,9 +1412,16 @@ struct file_struct *make_file(const char
+@@ -1114,9 +1413,16 @@ struct file_struct *make_file(const char
                        memcpy(lastdir, thisname, len);
                        lastdir[len] = '\0';
                        lastdir_len = len;
@@ -440,7 +440,7 @@ To use this patch, run these commands for a successful build:
        basename_len = strlen(basename) + 1; /* count the '\0' */
  
  #ifdef SUPPORT_LINKS
-@@ -1191,11 +1497,44 @@ struct file_struct *make_file(const char
+@@ -1192,11 +1498,44 @@ struct file_struct *make_file(const char
        }
  #endif
  
@@ -464,7 +464,7 @@ To use this patch, run these commands for a successful build:
 +                              if (fp->flags & FLAG_SUM_MISSING) {
 +                                      fp->flags &= ~FLAG_SUM_MISSING;
 +                                      file_checksum(thisname, tmp_sum, st.st_size);
-+                                      memcpy((char*)F_SUM(fp), tmp_sum, MAX_DIGEST_LEN);
++                                      memcpy(F_SUM(fp), tmp_sum, MAX_DIGEST_LEN);
 +                              } else {
 +                                      checksum_matches++;
 +                                      memcpy(tmp_sum, F_SUM(fp), MAX_DIGEST_LEN);
@@ -488,7 +488,7 @@ To use this patch, run these commands for a successful build:
        /* This code is only used by the receiver when it is building
         * a list of files for a delete pass. */
        if (keep_dirlinks && linkname_len && flist) {
-@@ -1481,6 +1820,9 @@ static void send_directory(int f, struct
+@@ -1482,6 +1821,9 @@ static void send_directory(int f, struct
  
        closedir(d);
  
@@ -498,7 +498,7 @@ To use this patch, run these commands for a successful build:
        if (f >= 0 && recurse && !divert_dirs) {
                int i, end = flist->used - 1;
                /* send_if_directory() bumps flist->used, so use "end". */
-@@ -1924,7 +2266,11 @@ struct file_list *send_file_list(int f, 
+@@ -1925,7 +2267,11 @@ struct file_list *send_file_list(int f, 
                         * file-list to check if this is a 1-file xfer. */
                        send_extra_file_list(f, 1);
                }
@@ -511,7 +511,7 @@ To use this patch, run these commands for a successful build:
  
        return flist;
  }
-@@ -2217,7 +2563,7 @@ void flist_free(struct file_list *flist)
+@@ -2218,7 +2564,7 @@ void flist_free(struct file_list *flist)
  
        if (!flist->prev || !flist_cnt)
                pool_destroy(flist->file_pool);
@@ -522,7 +522,7 @@ To use this patch, run these commands for a successful build:
        if (flist->sorted && flist->sorted != flist->files)
 --- old/loadparm.c
 +++ new/loadparm.c
-@@ -148,6 +148,7 @@ typedef struct
+@@ -149,6 +149,7 @@ typedef struct
        int syslog_facility;
        int timeout;
  
@@ -530,7 +530,7 @@ To use this patch, run these commands for a successful build:
        BOOL fake_super;
        BOOL ignore_errors;
        BOOL ignore_nonreadable;
-@@ -196,6 +197,7 @@ static service sDefault =
+@@ -197,6 +198,7 @@ static service sDefault =
   /* syslog_facility; */               LOG_DAEMON,
   /* timeout; */                       0,
  
@@ -538,7 +538,7 @@ To use this patch, run these commands for a successful build:
   /* fake_super; */            False,
   /* ignore_errors; */         False,
   /* ignore_nonreadable; */    False,
-@@ -312,6 +314,7 @@ static struct parm_struct parm_table[] =
+@@ -313,6 +315,7 @@ static struct parm_struct parm_table[] =
   {"lock file",         P_STRING, P_LOCAL, &sDefault.lock_file,         NULL,0},
   {"log file",          P_STRING, P_LOCAL, &sDefault.log_file,          NULL,0},
   {"log format",        P_STRING, P_LOCAL, &sDefault.log_format,        NULL,0},
@@ -546,7 +546,7 @@ To use this patch, run these commands for a successful build:
   {"max connections",   P_INTEGER,P_LOCAL, &sDefault.max_connections,   NULL,0},
   {"max verbosity",     P_INTEGER,P_LOCAL, &sDefault.max_verbosity,     NULL,0},
   {"name",              P_STRING, P_LOCAL, &sDefault.name,              NULL,0},
-@@ -417,6 +420,7 @@ FN_LOCAL_BOOL(lp_fake_super, fake_super)
+@@ -418,6 +421,7 @@ FN_LOCAL_BOOL(lp_fake_super, fake_super)
  FN_LOCAL_BOOL(lp_ignore_errors, ignore_errors)
  FN_LOCAL_BOOL(lp_ignore_nonreadable, ignore_nonreadable)
  FN_LOCAL_BOOL(lp_list, list)
@@ -556,7 +556,7 @@ To use this patch, run these commands for a successful build:
  FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging)
 --- old/options.c
 +++ new/options.c
-@@ -108,6 +108,7 @@ size_t bwlimit_writemax = 0;
+@@ -109,6 +109,7 @@ size_t bwlimit_writemax = 0;
  int ignore_existing = 0;
  int ignore_non_existing = 0;
  int need_messages_from_generator = 0;
@@ -564,7 +564,7 @@ To use this patch, run these commands for a successful build:
  int max_delete = -1;
  OFF_T max_size = 0;
  OFF_T min_size = 0;
-@@ -301,6 +302,7 @@ void usage(enum logcode F)
+@@ -302,6 +303,7 @@ void usage(enum logcode F)
    rprintf(F," -q, --quiet                 suppress non-error messages\n");
    rprintf(F,"     --no-motd               suppress daemon-mode MOTD (see manpage caveat)\n");
    rprintf(F," -c, --checksum              skip based on checksum, not mod-time & size\n");
@@ -572,7 +572,7 @@ To use this patch, run these commands for a successful build:
    rprintf(F," -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)\n");
    rprintf(F,"     --no-OPTION             turn off an implied OPTION (e.g. --no-D)\n");
    rprintf(F," -r, --recursive             recurse into directories\n");
-@@ -541,6 +543,7 @@ static struct poptOption long_options[] 
+@@ -542,6 +544,7 @@ static struct poptOption long_options[] 
    {"checksum",        'c', POPT_ARG_VAL,    &always_checksum, 1, 0, 0 },
    {"no-checksum",      0,  POPT_ARG_VAL,    &always_checksum, 0, 0, 0 },
    {"no-c",             0,  POPT_ARG_VAL,    &always_checksum, 0, 0, 0 },
@@ -580,7 +580,7 @@ To use this patch, run these commands for a successful build:
    {"block-size",      'B', POPT_ARG_LONG,   &block_size, 0, 0, 0 },
    {"compare-dest",     0,  POPT_ARG_STRING, 0, OPT_COMPARE_DEST, 0, 0 },
    {"copy-dest",        0,  POPT_ARG_STRING, 0, OPT_COPY_DEST, 0, 0 },
-@@ -1898,7 +1901,9 @@ void server_options(char **args,int *arg
+@@ -1899,7 +1902,9 @@ void server_options(char **args,int *arg
                                args[ac++] = basis_dir[i];
                        }
                }
@@ -593,15 +593,15 @@ To use this patch, run these commands for a successful build:
                args[ac++] = "--append";
 --- old/rsync.h
 +++ new/rsync.h
-@@ -588,6 +588,7 @@ extern int xattrs_ndx;
- #define EXTRA_LEN (sizeof (union file_extras))
- #define PTR_EXTRA_LEN ((sizeof (char *) + EXTRA_LEN - 1) / EXTRA_LEN)
+@@ -591,6 +591,7 @@ extern int xattrs_ndx;
+ #define DEV_EXTRA_CNT 2
+ #define DIRNODE_EXTRA_CNT 3
  #define SUM_EXTRA_CNT ((MAX_DIGEST_LEN + EXTRA_LEN - 1) / EXTRA_LEN)
 +#define TIME_EXTRA_CNT ((SIZEOF_TIME_T + EXTRA_LEN - 1) / EXTRA_LEN)
  
  #define REQ_EXTRA(f,ndx) ((union file_extras*)(f) - (ndx))
  #define OPT_EXTRA(f,bump) ((union file_extras*)(f) - file_extra_cnt - 1 - (bump))
-@@ -1070,6 +1071,12 @@ isDigit(const char *ptr)
+@@ -1076,6 +1077,12 @@ isDigit(const char *ptr)
  }
  
  static inline int