apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr-util/dbm apr_dbm_sdbm.c
Date Thu, 23 Jan 2003 11:43:01 GMT
trawick     2003/01/23 03:43:01

  Modified:    .        CHANGES
               dbm      apr_dbm_sdbm.c
  Log:
  Fix brokenness in sdbm when sizeof(int) != sizeof(size_t)
  (e.g., 64-bit AIX, 64-bit Solaris).
  
  apr_datum_t is (char *, apr_size_t) and apr_sdbm_datum_t is (char *, int),
  and the CONVERT_DATUM and RETURN_DATUM macros in apr_dbm_sdbm.c assumed that
  the structures could be copied just by casting instead of copying member-by-
  member.
  
  PR:  14861
  
  Revision  Changes    Path
  1.96      +3 -0      apr-util/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr-util/CHANGES,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- CHANGES	22 Jan 2003 17:45:20 -0000	1.95
  +++ CHANGES	23 Jan 2003 11:43:01 -0000	1.96
  @@ -1,5 +1,8 @@
   Changes with APR-util 0.9.2
   
  +  *) Fix brokenness in sdbm when sizeof(int) != sizeof(size_t)
  +     (e.g., 64-bit AIX, 64-bit Solaris).  PR 14861.  [Jeff Trawick]
  +
     *) Have buildconf copy required files from apr so that apr-util can build
        on its own.  [Craig Rodrigues <rodrigc@attbi.com>]
   
  
  
  
  1.10      +6 -6      apr-util/dbm/apr_dbm_sdbm.c
  
  Index: apr_dbm_sdbm.c
  ===================================================================
  RCS file: /home/cvs/apr-util/dbm/apr_dbm_sdbm.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- apr_dbm_sdbm.c	1 Jan 2003 00:02:19 -0000	1.9
  +++ apr_dbm_sdbm.c	23 Jan 2003 11:43:01 -0000	1.10
  @@ -78,16 +78,16 @@
   
   typedef apr_sdbm_t *real_file_t;
   
  -typedef apr_sdbm_datum_t *cvt_datum_t;
  -#define CONVERT_DATUM(cvt, pinput) ((cvt) = (apr_sdbm_datum_t *)(pinput))
  +typedef apr_sdbm_datum_t cvt_datum_t;
  +#define CONVERT_DATUM(cvt, pinput) ((cvt).dptr = (pinput)->dptr, (cvt).dsize = (pinput)->dsize)
   
   typedef apr_sdbm_datum_t result_datum_t;
  -#define RETURN_DATUM(poutput, rd) (*(poutput) = *(apr_datum_t *)&(rd))
  +#define RETURN_DATUM(poutput, rd) ((poutput)->dptr = (rd).dptr, (poutput)->dsize
= (rd).dsize)
   
   #define APR_DBM_CLOSE(f)        apr_sdbm_close(f)
  -#define APR_DBM_FETCH(f, k, v)  apr_sdbm_fetch(f, &(v), *(k))
  -#define APR_DBM_STORE(f, k, v)  apr_sdbm_store(f, *(k), *(v), APR_SDBM_REPLACE)
  -#define APR_DBM_DELETE(f, k)    apr_sdbm_delete(f, *(k))
  +#define APR_DBM_FETCH(f, k, v)  apr_sdbm_fetch(f, &(v), (k))
  +#define APR_DBM_STORE(f, k, v)  apr_sdbm_store(f, (k), (v), APR_SDBM_REPLACE)
  +#define APR_DBM_DELETE(f, k)    apr_sdbm_delete(f, (k))
   #define APR_DBM_FIRSTKEY(f, k)  apr_sdbm_firstkey(f, &(k))
   #define APR_DBM_NEXTKEY(f, k, nk) apr_sdbm_nextkey(f, &(nk))
   #define APR_DBM_FREEDPTR(dptr)  NOOP_FUNCTION
  
  
  

Mime
View raw message