Author: stefan2 Date: Sun Aug 1 10:02:00 2010 New Revision: 981194 URL: http://svn.apache.org/viewvc?rev=981194&view=rev Log: Remove typedefs for various generic pointer types as requested in http://svn.haxx.se/dev/archive-2010-08/0007.shtml .
* subversion/include/private/svn_temp_serializer.h (PCPCSTR, PCPCVOID, PPVOID): drop typedefs (svn_temp_serializer__push, svn_temp_serializer__add_string, svn_temp_deserializer__resolve): replace typedef with verbatim types * subversion/libsvn_subr/svn_temp_serializer.c (svn_temp_serializer__push, svn_temp_serializer__add_string, svn_temp_deserializer__resolve): replace typedef with verbatim types (svn_temp_serializer__init): fix formatting Modified: subversion/branches/performance/subversion/include/private/svn_temp_serializer.h subversion/branches/performance/subversion/libsvn_subr/svn_temp_serializer.c Modified: subversion/branches/performance/subversion/include/private/svn_temp_serializer.h URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/include/private/svn_temp_serializer.h?rev=981194&r1=981193&r2=981194&view=diff ============================================================================== --- subversion/branches/performance/subversion/include/private/svn_temp_serializer.h (original) +++ subversion/branches/performance/subversion/include/private/svn_temp_serializer.h Sun Aug 1 10:02:00 2010 @@ -34,15 +34,6 @@ /* forward declaration */ struct svn_stringbuf_t; -/* We often use references to pointers. Although converting a pointer to - * a pointer can safely be cast to references to constant pointers to - * constant data, C compilers tend to reject them. Provide a couple of - * typedefs to simplify explicit casts. - */ -typedef const char * const * PCPCSTR; -typedef const void * const * PCPCVOID; -typedef void * * PPVOID; - /** * Opaque structure controlling the serialization process and holding the * intermediate as well as final results. @@ -85,7 +76,7 @@ svn_temp_serializer__init(const void *so */ void svn_temp_serializer__push(svn_temp_serializer__context_t *context, - PCPCVOID source_struct, + const void * const * source_struct, apr_size_t struct_size); /** @@ -106,7 +97,8 @@ svn_temp_serializer__pop(svn_temp_serial * serialized structure can be established. */ void -svn_temp_serializer__add_string(svn_temp_serializer__context_t *context, PCPCSTR s); +svn_temp_serializer__add_string(svn_temp_serializer__context_t *context, + const char * const * s); /** * @return a reference to the data buffer containing the data serialialized @@ -125,4 +117,4 @@ svn_temp_serializer__get(svn_temp_serial * the pointer to resolve in @a ptr. */ void -svn_temp_deserializer__resolve(void *buffer, PPVOID ptr); +svn_temp_deserializer__resolve(void *buffer, void **ptr); Modified: subversion/branches/performance/subversion/libsvn_subr/svn_temp_serializer.c URL: http://svn.apache.org/viewvc/subversion/branches/performance/subversion/libsvn_subr/svn_temp_serializer.c?rev=981194&r1=981193&r2=981194&view=diff ============================================================================== --- subversion/branches/performance/subversion/libsvn_subr/svn_temp_serializer.c (original) +++ subversion/branches/performance/subversion/libsvn_subr/svn_temp_serializer.c Sun Aug 1 10:02:00 2010 @@ -97,9 +97,9 @@ align_buffer_end(svn_temp_serializer__co */ svn_temp_serializer__context_t * svn_temp_serializer__init(const void *source_struct, - apr_size_t struct_size, - apr_size_t suggested_buffer_size, - apr_pool_t *pool) + apr_size_t struct_size, + apr_size_t suggested_buffer_size, + apr_pool_t *pool) { /* select a meaningful initial memory buffer capacity */ apr_size_t init_size = suggested_buffer_size < struct_size @@ -129,7 +129,7 @@ svn_temp_serializer__init(const void *so */ static void store_current_end_pointer(svn_temp_serializer__context_t *context, - PCPCVOID source_pointer) + const void * const * source_pointer) { /* relative position of the serialized pointer to the begin of the buffer */ apr_size_t offset = (const char *)source_pointer @@ -156,7 +156,7 @@ store_current_end_pointer(svn_temp_seria */ void svn_temp_serializer__push(svn_temp_serializer__context_t *context, - PCPCVOID source_struct, + const void * const * source_struct, apr_size_t struct_size) { /* create a new entry for the structure stack */ @@ -202,7 +202,8 @@ svn_temp_serializer__pop(svn_temp_serial * structure can be established. */ void -svn_temp_serializer__add_string(svn_temp_serializer__context_t *context, PCPCSTR s) +svn_temp_serializer__add_string(svn_temp_serializer__context_t *context, + const char * const * s) { /* Store the offset at which the string data that will the appended. * Write 0 for NULL pointers. Strings don't need special alignment. */ @@ -226,7 +227,7 @@ svn_temp_serializer__get(svn_temp_serial * proper pointer value. */ void -svn_temp_deserializer__resolve(void *buffer, PPVOID ptr) +svn_temp_deserializer__resolve(void *buffer, void **ptr) { if ((apr_size_t)*ptr) {