apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwool...@apache.org
Subject cvs commit: apr/misc/unix rand.c
Date Sat, 18 May 2002 04:12:28 GMT
jwoolley    02/05/17 21:12:28

  Modified:    include  apr_general.h apr_ring.h
               misc/unix rand.c
  Log:
  Renames:
    APR_XtOffset   -> APR_OFFSET
    APR_XtOffsetOf -> APR_OFFSETOF
  
  Revision  Changes    Path
  1.72      +19 -6     apr/include/apr_general.h
  
  Index: apr_general.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_general.h,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -d -u -r1.71 -r1.72
  --- apr_general.h	22 Apr 2002 08:44:22 -0000	1.71
  +++ apr_general.h	18 May 2002 04:12:28 -0000	1.72
  @@ -112,34 +112,47 @@
    * Finding offsets of elements within structures.
    * Taken from the X code... they've sweated portability of this stuff
    * so we don't have to.  Sigh...
  + * @param p_type pointer type name
  + * @param field  data field within the structure pointed to
  + * @return offset
    */
   
   #if defined(CRAY) || (defined(__arm) && !defined(LINUX))
   #ifdef __STDC__
  -#define APR_XtOffset(p_type,field) _Offsetof(p_type,field)
  +#define APR_OFFSET(p_type,field) _Offsetof(p_type,field)
   #else
   #ifdef CRAY2
  -#define APR_XtOffset(p_type,field) \
  +#define APR_OFFSET(p_type,field) \
           (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
   
   #else /* !CRAY2 */
   
  -#define APR_XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
  +#define APR_OFFSET(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
   
   #endif /* !CRAY2 */
   #endif /* __STDC__ */
   #else /* ! (CRAY || __arm) */
   
  -#define APR_XtOffset(p_type,field) \
  +#define APR_OFFSET(p_type,field) \
           ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
   
   #endif /* !CRAY */
   
  +/**
  + * Finding offsets of elements within structures.
  + * @param s_type structure type name
  + * @param field  data field within the structure
  + * @return offset
  + */
   #ifdef offsetof
  -#define APR_XtOffsetOf(s_type,field) offsetof(s_type,field)
  +#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)
   #else
  -#define APR_XtOffsetOf(s_type,field) APR_XtOffset(s_type*,field)
  +#define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field)
   #endif
  +
  +/** @deprecated */
  +#define APR_XtOffset APR_OFFSET
  +#define APR_XtOffsetOf APR_OFFSETOF
   
   
   /**
  
  
  
  1.4       +1 -1      apr/include/apr_ring.h
  
  Index: apr_ring.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_ring.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -d -u -r1.3 -r1.4
  --- apr_ring.h	13 Mar 2002 20:39:15 -0000	1.3
  +++ apr_ring.h	18 May 2002 04:12:28 -0000	1.4
  @@ -145,7 +145,7 @@
    * @param link The name of the APR_RING_ENTRY in the element struct
    */
   #define APR_RING_SENTINEL(hp, elem, link)				\
  -    (struct elem *)((char *)(hp) - APR_XtOffsetOf(struct elem, link))
  +    (struct elem *)((char *)(hp) - APR_OFFSETOF(struct elem, link))
   
   /**
    * The first element of the ring
  
  
  
  1.10      +1 -1      apr/misc/unix/rand.c
  
  Index: rand.c
  ===================================================================
  RCS file: /home/cvs/apr/misc/unix/rand.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -d -u -r1.9 -r1.10
  --- rand.c	13 Mar 2002 20:39:23 -0000	1.9
  +++ rand.c	18 May 2002 04:12:28 -0000	1.10
  @@ -135,7 +135,7 @@
       memset(&addr, 0, sizeof(struct sockaddr_un));
       addr.sun_family = AF_UNIX;
       memcpy(addr.sun_path, STR(EGD_DEFAULT_SOCKET), egd_path_len);
  -    egd_addr_len = APR_XtOffsetOf(struct sockaddr_un, sun_path) + 
  +    egd_addr_len = APR_OFFSETOF(struct sockaddr_un, sun_path) + 
                      egd_path_len; 
   
       egd_socket = socket(PF_UNIX, SOCK_STREAM, 0);
  
  
  

Mime
View raw message