[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 1760 - trunk/subversion/include trunk/subversion/libsvn_fs trunk/subversion/libsvn_wc trunk/subversion/clients/cmdline trunk/subversion/libsvn_delta

From: Branko Čibej <brane_at_xbc.nu>
Date: 2002-04-24 20:36:22 CEST

striker@tigris.org wrote:

>Author: striker
>Date: 2002-04-24 01:17 GMT
>New Revision: 1760
>
>Modified:
> trunk/subversion/clients/cmdline/util.c
> trunk/subversion/include/svn_delta.h
> trunk/subversion/libsvn_delta/svndiff.c
> trunk/subversion/libsvn_delta/text_delta.c
> trunk/subversion/libsvn_fs/reps-strings.c
> trunk/subversion/libsvn_fs/strings-table.c
> trunk/subversion/libsvn_wc/log.c
> trunk/subversion/libsvn_wc/props.c
>Log:
>A 'get rid of warnings' change. Inspired by Greg Stein.
>
[snip]

>Modified: trunk/subversion/libsvn_wc/log.c
>==============================================================================
>--- trunk/subversion/libsvn_wc/log.c (original)
>+++ trunk/subversion/libsvn_wc/log.c Tue Apr 23 20:17:16 2002
>@@ -1090,14 +1090,17 @@
> apr_ssize_t keylen;
> void *val;
> svn_wc_entry_t *entry;
>- svn_boolean_t is_this_dir = FALSE;
>+ svn_boolean_t is_this_dir;
>
> apr_hash_this (hi, &key, &keylen, &val);
> entry = val;
>
>- if ((keylen == strlen (SVN_WC_ENTRY_THIS_DIR))
>- && (strcmp ((char *) key, SVN_WC_ENTRY_THIS_DIR) == 0))
>- is_this_dir = TRUE;
>+#define KLEN (sizeof(SVN_WC_ENTRY_THIS_DIR) - 1)
>+
>+ is_this_dir = keylen == KLEN
>+ && memcmp(key, SVN_WC_ENTRY_THIS_DIR, KLEN) == 0;
>+
>+#undef KLEN
>
> if ((entry->kind == svn_node_dir) && (! is_this_dir))
> {
>
This is a bit too "real-man" for me. We should at least add an autoconf
test that the compiler knows the type of string literals is chsr[], not
char*. And I'd like to see some parentheses for clarity.

>Modified: trunk/subversion/libsvn_delta/svndiff.c
>==============================================================================
>--- trunk/subversion/libsvn_delta/svndiff.c (original)
>+++ trunk/subversion/libsvn_delta/svndiff.c Tue Apr 23 20:17:16 2002
>@@ -80,7 +80,7 @@
> while (--n >= 0)
> {
> cont = ((n > 0) ? 0x1 : 0x0) << 7;
>- *p++ = ((val >> (n * 7)) & 0x7f) | cont;
>+ *p++ = (char)(((val >> (n * 7)) & 0x7f) | cont);
> }
>
> return p;
>
Shouldn't we make all svndiff encoding use unsigned chars instead?

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 24 20:57:58 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.