apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: apr-util/include apr_optional.h apr_optional_hooks.h
Date Tue, 10 Feb 2004 12:52:53 GMT
jorton      2004/02/10 04:52:53

  Modified:    include  Tag: APU_0_9_BRANCH apr_optional.h
                        apr_optional_hooks.h
  Log:
  Backport from HEAD:
  
  * include/apr_optional.h (APR_REGISTER_OPTIONAL_FN),
  include/apr_optional_hooks.h (APR_OPTIONAL_HOOK): Rewrite to avoid
  calling a function through a function pointer of incompatible type,
  which is not conformant C99 code (by section 6.3.2.3 para 8) and
  triggers a warning from gcc 3.4.
  
  Reviewed by: Ben Laurie
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.11.2.1  +5 -4      apr-util/include/apr_optional.h
  
  Index: apr_optional.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/apr_optional.h,v
  retrieving revision 1.11
  retrieving revision 1.11.2.1
  diff -b -d -u -r1.11 -r1.11.2.1
  --- apr_optional.h	3 Mar 2003 23:41:11 -0000	1.11
  +++ apr_optional.h	10 Feb 2004 12:52:53 -0000	1.11.2.1
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2001-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2001-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -109,9 +109,10 @@
    * confusingly but correctly, the function itself can be static!
    * @param name The name of the function
    */
  -#define APR_REGISTER_OPTIONAL_FN(name) \
  -    (((void (*)(const char *, APR_OPTIONAL_FN_TYPE(name) *)) \
  -               &apr_dynamic_fn_register)(#name,name))
  +#define APR_REGISTER_OPTIONAL_FN(name) do { \
  +  APR_OPTIONAL_FN_TYPE(name) *apu__opt = name; \
  +  apr_dynamic_fn_register(#name,(apr_opt_fn_t *)apu__opt); \
  +} while (0)
   
   /** @internal
    * Private function! DO NOT USE! 
  
  
  
  1.9.2.1   +5 -5      apr-util/include/apr_optional_hooks.h
  
  Index: apr_optional_hooks.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/apr_optional_hooks.h,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -b -d -u -r1.9 -r1.9.2.1
  --- apr_optional_hooks.h	1 Jan 2003 00:02:20 -0000	1.9
  +++ apr_optional_hooks.h	10 Feb 2004 12:52:53 -0000	1.9.2.1
  @@ -1,7 +1,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2000-2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2000-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -99,10 +99,10 @@
    * @param nOrder an integer determining order before honouring aszPre and aszSucc (for
example HOOK_MIDDLE)
    */
   
  -#define APR_OPTIONAL_HOOK(ns,name,pfn,aszPre,aszSucc,nOrder) \
  -    ((void (APR_THREAD_FUNC *)(const char *,ns##_HOOK_##name##_t *,const char * const *,
\
  -	       const char * const *,int))&apr_optional_hook_add)(#name,pfn,aszPre, \
  -							   aszSucc, nOrder)
  +#define APR_OPTIONAL_HOOK(ns,name,pfn,aszPre,aszSucc,nOrder) do { \
  +  ns##_HOOK_##name##_t *apu__hook = pfn; \
  +  apr_optional_hook_add(#name,(void (*)(void))apu__hook,aszPre, aszSucc, nOrder); \
  +} while (0)
   
   /**
    * @internal
  
  
  

Mime
View raw message