apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/include/arch/unix networkio.h
Date Sat, 07 Jul 2001 22:48:09 GMT
rbb         01/07/07 15:48:09

  Modified:    network_io/unix sockopt.c
               include/arch/unix networkio.h
  Log:
  We are setting a simple bitmask.  Calling a function to do that is far
  too expensive.  It is much easier to just turn these into macros that do
  the exact same thing.
  Submitted by:	Dean Gaudet
  
  Revision  Changes    Path
  1.46      +0 -13     apr/network_io/unix/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockopt.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -d -b -w -u -r1.45 -r1.46
  --- sockopt.c	2001/04/05 18:56:08	1.45
  +++ sockopt.c	2001/07/07 22:48:08	1.46
  @@ -55,19 +55,6 @@
   #include "networkio.h"
   #include "apr_strings.h"
   
  -int apr_is_option_set(apr_int32_t mask, apr_int32_t option)
  -{
  -    return (mask & option) == option;
  -}
  -
  -void apr_set_option(apr_int32_t *mask, apr_int32_t option, int on)
  -{
  -    if (on)
  -        *mask |= option;
  -    else
  -        *mask &= ~option;
  -}
  -
   static apr_status_t soblock(int sd)
   {
   /* BeOS uses setsockopt at present for non blocking... */
  
  
  
  1.45      +10 -2     apr/include/arch/unix/networkio.h
  
  Index: networkio.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/unix/networkio.h,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -d -b -w -u -r1.44 -r1.45
  --- networkio.h	2001/06/07 10:31:20	1.44
  +++ networkio.h	2001/07/07 22:48:09	1.45
  @@ -159,8 +159,16 @@
   
   const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
   int apr_inet_pton(int af, const char *src, void *dst);
  -int apr_is_option_set(apr_int32_t, apr_int32_t);
  -void apr_set_option(apr_int32_t *, apr_int32_t, int);
  +
  +#define apr_is_option_set(mask, option)  ((mask & option) ==option)
  +
  +#define apr_set_option(mask, option, on) \
  +    do {                                 \
  +        if (on)                          \
  +            *mask |= option;             \
  +        else                             \
  +            *mask &= ~option;            \
  +    } while (0)
   
   #endif  /* ! NETWORK_IO_H */
   
  
  
  

Mime
View raw message