Re: [PATCH] apr_hash_this_{key,klen,val}

2010-04-08 Thread Jeff Trawick
On Wed, Apr 7, 2010 at 4:59 PM, Hyrum K. Wright hyrum_wri...@mail.utexas.edu wrote: On Thu, Mar 25, 2010 at 2:28 PM, Hyrum K. Wright hyrum_wri...@mail.utexas.edu wrote: On Mar 9, 2010, at 4:37 PM, Hyrum K. Wright wrote: On Mar 9, 2010, at 2:00 PM, William A. Rowe Jr. wrote: On

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-04-07 Thread Hyrum K. Wright
On Thu, Mar 25, 2010 at 2:28 PM, Hyrum K. Wright hyrum_wri...@mail.utexas.edu wrote: On Mar 9, 2010, at 4:37 PM, Hyrum K. Wright wrote: On Mar 9, 2010, at 2:00 PM, William A. Rowe Jr. wrote: On 3/9/2010 11:48 AM, Jeff Trawick wrote: On Tue, Mar 9, 2010 at 11:19 AM, Hyrum K. Wright

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-25 Thread Hyrum K. Wright
On Mar 9, 2010, at 4:37 PM, Hyrum K. Wright wrote: On Mar 9, 2010, at 2:00 PM, William A. Rowe Jr. wrote: On 3/9/2010 11:48 AM, Jeff Trawick wrote: On Tue, Mar 9, 2010 at 11:19 AM, Hyrum K. Wright hyrum_wri...@mail.utexas.edu wrote: In using the apr_hash datastructure in Subversion,

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-12 Thread Greg Stein
On Tue, Mar 9, 2010 at 16:42, William A. Rowe Jr. wr...@rowe-clan.net wrote: On 3/9/2010 3:37 PM, Hyrum K. Wright wrote: I'm also planning a followup which const-ifies the apr_hash_index_t params to these functions, as well as apr_hash_this().  Thoughts? Note const'ness will only be

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-12 Thread William A. Rowe Jr.
On 3/12/2010 5:21 AM, Greg Stein wrote: It is *totally* fine to add a 'const' to a parameter that was not there before. That does not change the ABI whatsoever, and it will not break the API for callers. It merely gives them more information at compile time. int oldfunc (const char

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-12 Thread William A. Rowe Jr.
On 3/12/2010 10:50 AM, Hyrum K. Wright wrote: On Mar 12, 2010, at 10:39 AM, William A. Rowe Jr. wrote: On 3/12/2010 5:21 AM, Greg Stein wrote: It is *totally* fine to add a 'const' to a parameter that was not there before. That does not change the ABI whatsoever, and it will not break

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-12 Thread Greg Stein
On Fri, Mar 12, 2010 at 11:39, William A. Rowe Jr. wr...@rowe-clan.net wrote: On 3/12/2010 5:21 AM, Greg Stein wrote: It is *totally* fine to add a 'const' to a parameter that was not there before. That does not change the ABI whatsoever, and it will not break the API for callers. It merely

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-12 Thread William A. Rowe Jr.
On 3/12/2010 1:39 PM, Greg Stein wrote: Of course not. I have NO IDEA what the hell you're talking about. Why would you even attempt to assign an int function return to a char * variable? And that function is declared to take a parameter which you didn't give it. It's just nonsense code.

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-12 Thread William A. Rowe Jr.
[obviously, had not had enough coffee] On 3/12/2010 1:39 PM, Greg Stein wrote: We're talking about a function prototype that current says: APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val); and add a

[PATCH] apr_hash_this_{key,klen,val}

2010-03-09 Thread Hyrum K. Wright
In using the apr_hash datastructure in Subversion, we've found that we often only want the key or value from a hash. Furthermore, casting the various return parameters has proven cumbersome. To solve this problem, we've introduced three helper functions to return the key, key length, and value

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-09 Thread Jeff Trawick
On Tue, Mar 9, 2010 at 11:19 AM, Hyrum K. Wright hyrum_wri...@mail.utexas.edu wrote: In using the apr_hash datastructure in Subversion, we've found that we often only want the key or value from a hash.  Furthermore, casting the various return parameters has proven cumbersome.  To solve this

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-09 Thread William A. Rowe Jr.
On 3/9/2010 11:48 AM, Jeff Trawick wrote: On Tue, Mar 9, 2010 at 11:19 AM, Hyrum K. Wright hyrum_wri...@mail.utexas.edu wrote: In using the apr_hash datastructure in Subversion, we've found that we often only want the key or value from a hash. Furthermore, casting the various return

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-09 Thread Bojan Smojver
On Tue, 2010-03-09 at 12:48 -0500, Jeff Trawick wrote: IMO these functions are a natural addition; any concerns from the crowd? Didn't SVN folks also have some hash sorting functions we could borrow as well? May as well get those, while we're at it :-) -- Bojan

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-09 Thread Hyrum K. Wright
On Mar 9, 2010, at 2:00 PM, William A. Rowe Jr. wrote: On 3/9/2010 11:48 AM, Jeff Trawick wrote: On Tue, Mar 9, 2010 at 11:19 AM, Hyrum K. Wright hyrum_wri...@mail.utexas.edu wrote: In using the apr_hash datastructure in Subversion, we've found that we often only want the key or value from

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-09 Thread William A. Rowe Jr.
On 3/9/2010 3:37 PM, Hyrum K. Wright wrote: I'm also planning a followup which const-ifies the apr_hash_index_t params to these functions, as well as apr_hash_this(). Thoughts? Note const'ness will only be alterable with apr 2.0 forwards. I'm eyeballs to alligators here, so I won't have a

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-09 Thread Hyrum K. Wright
On Mar 9, 2010, at 2:42 PM, Bojan Smojver wrote: On Tue, 2010-03-09 at 12:48 -0500, Jeff Trawick wrote: IMO these functions are a natural addition; any concerns from the crowd? Didn't SVN folks also have some hash sorting functions we could borrow as well? May as well get those, while

Re: [PATCH] apr_hash_this_{key,klen,val}

2010-03-09 Thread Bojan Smojver
On Tue, 2010-03-09 at 15:45 -0600, Hyrum K. Wright wrote: We also have a couple of hash- and array-based iteration functions which might be handy. I can post those if there is interest. Yep, let's raid the SVN treasure chest :-) -- Bojan