RSYNC 2.5.2 type mismatches in batch.c

John Malmberg wb8tyw at qsl.net
Mon Feb 11 02:46:50 EST 2002


Platform: OpenVMS Alpha 7.3
Compiler: Compaq C T6.5-002 on OpenVMS Alpha V7.3

Comile flags: /WARN=ENABLE=(LEVEL4, QUESTCODE)

Best guess at UNIX equivalents of above compile flags:

LEVEL4 = All warnings
QUESTCODE = Do LINT processing on source.

-John
wb8tyw at qsl.network
Personal Opinion Only


batch.c

(char *) is being used as a type, when a generic structure is being passed.

(void *) appears to be what is needed.

EAGLE> type batch.gdiff
--- ref_src:batch.c     Sat Feb  9 21:17:28 2002
+++ lcl_src:batch.c     Sat Feb  9 23:09:27 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND PRJ_SRC:BATCH.TPU on 
9-FEB-2002 23:09:26.95 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;
@@ -108,7 +109,7 @@
                 if (i == flist_count - 1) {
                         fdb_close = 1;
                 }
-               write_char_bufs(fptr[i]->sum);
+               write_char_bufs((char *)fptr[i]->sum);
         }

  }
@@ -184,7 +185,7 @@
         close(fdb);
  }

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

@@ -270,7 +271,7 @@
         return bytes_read;
  }

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

@@ -348,7 +349,7 @@
         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;
         }
@@ -386,7 +387,7 @@
         }
  }

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

@@ -423,7 +424,7 @@
         }
  }

-int read_batch_csums_file(char *buff, int len)
+int read_batch_csums_file(void *buff, int len)
  {
         static int fdb_open = 1;
         int bytes_read;
@@ -469,7 +470,7 @@
         extern int csum_length;


-       read_batch_csums_file((char *) &file_flist_entry, sizeof(int));
+       read_batch_csums_file( &file_flist_entry, sizeof(int));
         if (file_flist_entry != flist_entry) {
                 rprintf(FINFO, "file_list_entry NE flist_entry\n");
                 rprintf(FINFO, "file_flist_entry = %d  flist_entry = %d\n",
@@ -478,12 +479,12 @@
                 exit_cleanup(1);

         } else {
-               read_batch_csums_file((char *) &file_chunk_ct,
+               read_batch_csums_file( &file_chunk_ct,
                                       sizeof(int));
                 *checksums_match = 1;
                 for (i = 0; i < file_chunk_ct; i++) {

-                       read_batch_csums_file((char *) &file_sum1,
+                       read_batch_csums_file( &file_sum1,
                                               sizeof(uint32));
                         read_batch_csums_file(file_sum2, csum_length);

@@ -498,7 +499,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;

@@ -528,13 +529,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;
EAGLE>





More information about the rsync mailing list