RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES rpm/rpmio/ digest.c rpmpgp.h

From: Ralf S. Engelschall <rse@rpm5.org>
Date: Tue 10 Jul 2007 - 15:09:24 CEST
Message-Id: <20070710130924.C29CC3484F1@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs                       Email:  rse@rpm5.org
  Module: rpm                              Date:   10-Jul-2007 15:09:24
  Branch: HEAD                             Handle: 2007071014092400

  Modified files:
    rpm                     CHANGES
    rpm/rpmio               digest.c rpmpgp.h

  Log:
    Cleanup API by changing argument 2 of rpmDigestFinal() from "void **" to
    "void *". This both is more correct regaring strict ISO C (where "void
    **" is _NOT_ a generic pointer-to-pointer type) and also eliminates a
    bunch of compile-time warnings related to the usage of rpmDigestFinal().
    
    Reviewed by: jbj

  Summary:
    Revision    Changes     Path
    1.1449      +1  -0      rpm/CHANGES
    2.32        +3  -3      rpm/rpmio/digest.c
    2.45        +1  -1      rpm/rpmio/rpmpgp.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1448 -r1.1449 CHANGES
  --- rpm/CHANGES	10 Jul 2007 11:16:02 -0000	1.1448
  +++ rpm/CHANGES	10 Jul 2007 13:09:24 -0000	1.1449
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - rse: cleanup API by changing argument 2 of rpmDigestFinal() from "void **" to "void *"
       - rse: make directory checking for %docdir more strict to avoid false positives
       - jbj: perform fsync(2) before closing installed file.
       - jbj: default RPMCANONCOLOR to 3 everywhere but ia64 and mips*.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/digest.c
  ============================================================================
  $ cvs diff -u -r2.31 -r2.32 digest.c
  --- rpm/rpmio/digest.c	9 Jul 2007 22:31:57 -0000	2.31
  +++ rpm/rpmio/digest.c	10 Jul 2007 13:09:24 -0000	2.32
  @@ -658,7 +658,7 @@
   
   /*@-boundswrite@*/
   int
  -rpmDigestFinal(DIGEST_CTX ctx, void ** datap, size_t *lenp, int asAscii)
  +rpmDigestFinal(DIGEST_CTX ctx, void * datap, size_t *lenp, int asAscii)
   {
       byte * digest;
       char * t;
  @@ -678,7 +678,7 @@
       if (!asAscii) {
   	if (lenp) *lenp = ctx->digestsize;
   	if (datap) {
  -	    *datap = digest;
  +	    *(byte **)datap = digest;
   	    digest = NULL;
   	}
       } else {
  @@ -687,7 +687,7 @@
   	    const byte * s = (const byte *) digest;
   	    static const char hex[] = "0123456789abcdef";
   
  -	    *datap = t = xmalloc((2*ctx->digestsize) + 1);
  +	    *(char **)datap = t = xmalloc((2*ctx->digestsize) + 1);
   	    for (i = 0 ; i < ctx->digestsize; i++) {
   		*t++ = hex[ (unsigned)((*s >> 4) & 0x0f) ];
   		*t++ = hex[ (unsigned)((*s++   ) & 0x0f) ];
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmpgp.h
  ============================================================================
  $ cvs diff -u -r2.44 -r2.45 rpmpgp.h
  --- rpm/rpmio/rpmpgp.h	9 Jul 2007 15:38:53 -0000	2.44
  +++ rpm/rpmio/rpmpgp.h	10 Jul 2007 13:09:24 -0000	2.45
  @@ -1472,7 +1472,7 @@
    * @return		0 on success
    */
   int rpmDigestFinal(/*@only@*/ /*@null@*/ DIGEST_CTX ctx,
  -	/*@null@*/ /*@out@*/ void ** datap,
  +	/*@null@*/ /*@out@*/ void * datap,
   	/*@null@*/ /*@out@*/ size_t * lenp, int asAscii)
   		/*@modifies *datap, *lenp @*/;
   
  @@ .
Received on Tue Jul 10 15:09:24 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.