rsync-2.5.1 / zlib patches

John E. Malmberg wb8tyw at qsl.net
Mon Jan 7 11:53:01 EST 2002


The following zlib files need patches in order to compile using Compaq C
on OpenVMS.  These patches should also be needed on a Tru64 or LINUX on
ALPHA using Compaq C.  These should work on any ANSI compliant compiler.


Operating System: OpenVMS ALPHA V7.3
Compiler: Compaq C T6.5

Compiler switches: /WARN=ENABLE=(LEVEL4, QUESTCODE)


The module adler32.c is testing the unsigned value len to see if it is 
greater than 0.  Since this value can never be less than zero, a more 
specific test is to check if the value is non-zero.

trees.c and zutil.c have function definitions with empty parameters 
instead of having a (void).  This of course affects zutil.h.

zutil.h has a reference to "..\rsync.h".  Compaq C on OpenVMS can not 
translate this to an OpenVMS specification.

The MACRO _MSC_VER is being tested for a value, when it may not exist.

The prototype for strerror() is different than the one in the standard 
header file.



-John
wb8tyw at qsl.network
Personal Opinion Only

PROJECT_ROOT:[rsync_vms.ZLIB]ADLER32.GDIFF;1

--- ref_zlib:adler32.c  Thu May  7 01:19:41 1998
+++ lcl_zlib:adler32.c  Sun Jan  6 08:43:46 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_zlib:adler32.tpu on 
  6-JAN-2002 08:43:46.62 OPENVMS_AXP */
  /* adler32.c -- compute the Adler-32 checksum of a data stream
   * Copyright (C) 1995-1998 Mark Adler
   * For conditions of distribution and use, see copyright notice in zlib.h
@@ -29,7 +30,7 @@

      if (buf == Z_NULL) return 1L;

-    while (len > 0) {
+    while (len != 0) {
          k = len < NMAX ? len : NMAX;
          len -= k;
          while (k >= 16) {

PROJECT_ROOT:[rsync_vms.ZLIB]TREES.GDIFF;2

--- ref_zlib:trees.c    Fri May 22 08:45:43 1998
+++ lcl_zlib:trees.c    Sun Jan  6 18:09:15 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_zlib:trees.tpu on 
6-JAN-2002 18:09:14.93 OPENVMS_AXP */
  /* trees.c -- output deflated data using Huffman coding
   * Copyright (C) 1995-1998 Jean-loup Gailly
   * For conditions of distribution and use, see copyright notice in zlib.h
@@ -238,7 +239,7 @@
  /* 
===========================================================================
   * Initialize the various 'constant' tables.
   */
-local void tr_static_init()
+local void tr_static_init(void)
  {
  #if defined(GEN_TREES_H) || !defined(STDC)
      static int static_init_done = 0;


PROJECT_ROOT:[rsync_vms.ZLIB]ZUTIL.GDIFF;2

--- ref_zlib:zutil.c    Wed May 27 08:54:39 1998
+++ lcl_zlib:zutil.c    Sun Jan  6 18:11:01 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND prj_zlib:zutil.tpu on 
6-JAN-2002 18:11:01.73 OPENVMS_AXP */
  /* zutil.c -- target dependent utility functions for the compression 
library
   * Copyright (C) 1995-1998 Jean-loup Gailly.
   * For conditions of distribution and use, see copyright notice in zlib.h
@@ -26,7 +27,7 @@
  ""};


-const char * ZEXPORT zlibVersion()
+const char * ZEXPORT zlibVersion(void)
  {
      return ZLIB_VERSION;
  }

PROJECT_ROOT:[rsync_vms.ZLIB]ZUTIL_H.GDIFF;2

--- ref_zlib:zutil.h    Fri May 22 08:45:43 1998
+++ lcl_zlib:zutil.h    Sun Jan  6 18:10:19 2002
@@ -1,3 +1,4 @@
+/* Converted by prj_src:unix_c_to_vms_c.tpu AND PRJ_ZLIB:ZUTIL.TPU on 
6-JAN-2002 18:10:19.38 OPENVMS_AXP */
  /* zutil.h -- internal interface and configuration of the compression 
library
   * Copyright (C) 1995-1998 Jean-loup Gailly.
   * For conditions of distribution and use, see copyright notice in zlib.h
@@ -13,7 +14,11 @@
  #ifndef _Z_UTIL_H
  #define _Z_UTIL_H

+#ifdef __VMS
+#include "rsync.h"
+#else
  #include "../rsync.h"
+#endif
  #include "zlib.h"

  #if 0
@@ -137,9 +142,11 @@
  #  define fdopen(fd,mode) NULL /* No fdopen() */
  #endif

-#if (defined(_MSC_VER) && (_MSC_VER >= 600))
+#ifdef _MSC_VER
+#if _MSC_VER >= 600
  #  define fdopen(fd,type)  _fdopen(fd,type)
  #endif
+#endif


          /* Common defaults */
@@ -155,7 +162,11 @@
           /* functions */

  #ifdef HAVE_STRERROR
+#ifdef __VMS
+   /* defined in string.h */
+#else
     extern char *strerror OF((int));
+#endif
  #  define zstrerror(errnum) strerror(errnum)
  #else
  #  define zstrerror(errnum) ""







More information about the rsync mailing list