rsynd-2.5.1 / batch.c patch

John E. Malmberg wb8tyw at qsl.net
Sun Jan 13 14:51:36 EST 2002


Platform: Compaq OpenVMS Alpha 7.3
Compiler: Compaq C T6.5

The following patch is an update to a previous patch that I submitted.

The only change from the previous patch is that the const qualifier has 
been added to write_batch_*() routines to improve compiler efficiency.

Because the gdiff -u was done against the distribution it includes the 
previous patch.

The functions with no parameters were missing the void parameter.

The type (char) was being used where the usage indicated either (void)
or (unsigned char) should be used.


-John
wb8tyw at qsl.network
Personal Opinion Only

EAGLE> type batch.gdiff
--- ref_src:batch.c     Sat Jan  5 13:27:01 2002
+++ lcl_src:batch.c     Sat Jan 12 21:21:52 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND PRJ_SRC:BATCH.TPU on 
12-JAN-2002 21:21:52.41 OPENVMS_AXP */
  /* -*- c-file-style: "linux" -*-

     Weiss 1/1999
@@ -22,7 +23,7 @@

  struct file_list *batch_flist;

-void create_batch_file_ext()
+void create_batch_file_ext(void)
  {
         struct tm *timeptr;
         time_t elapsed_seconds;
@@ -103,7 +104,7 @@
                 if (i == flist_count - 1) {
                         fdb_close = 1;
                 }
-               write_char_bufs(fptr[i]->sum);
+               write_char_bufs((char *)fptr[i]->sum);
         }

  }
@@ -175,7 +176,7 @@
         close(fdb);
  }

-struct file_list *create_flist_from_batch()
+struct file_list *create_flist_from_batch(void)
  {
         unsigned char flags;

@@ -261,7 +262,7 @@
         return bytes_read;
  }

-unsigned char read_batch_flags()
+unsigned char read_batch_flags(void)
  {
         int flags;

@@ -339,13 +340,13 @@
         if (int_str_len > 0) {
                 read_batch_flist_file(buff, int_str_len);
                 buff[int_str_len] = '\0';
-               file[0].sum = strdup(buff);

+               file[0].sum = (unsigned char *)strdup(buff);
         } else {
                 file[0].sum = NULL;
         }
  }

-void write_batch_csums_file(char *buff, int bytes_to_write)
+void write_batch_csums_file(const void *buff, int bytes_to_write)
  {

         static int fdb_open = 1;
@@ -377,7 +378,7 @@
         }
  }

-void close_batch_csums_file()
+void close_batch_csums_file(void)
  {
         close(fdb);

@@ -394,12 +395,12 @@

         /* Write csum info to batch file */

-       write_batch_csums_file((char *) flist_entry, sizeof(int));
-       write_batch_csums_file((char *) (s ? &s->count : &int_zero),
+       write_batch_csums_file( flist_entry, sizeof(int));
+       write_batch_csums_file( (s ? &s->count : &int_zero),
                                sizeof(int));
         if (s) {
                 for (i = 0; i < s->count; i++) {
-                       write_batch_csums_file((char *) &s->sums[i].sum1,
+                       write_batch_csums_file( &s->sums[i].sum1,
                                                sizeof(uint32));
                         if ((*flist_entry == flist_count - 1)
                             && (i == s->count - 1)) {
@@ -486,7 +487,7 @@

  }

-void write_batch_delta_file(char *buff, int bytes_to_write)
+void write_batch_delta_file(const void *buff, int bytes_to_write)
  {
         static int fdb_delta_open = 1;

@@ -516,13 +517,13 @@
                 exit_cleanup(1);
         }
  }
-void close_batch_delta_file()
+void close_batch_delta_file(void)
  {
         close(fdb_delta);

  }

-int read_batch_delta_file(char *buff, int len)
+int read_batch_delta_file(void *buff, int len)
  {
         static int fdb_delta_open = 1;
         int bytes_read;





More information about the rsync mailing list