subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1135682 - in /subversion/trunk/subversion: include/svn_io.h libsvn_subr/io.c libsvn_wc/props.c
Date Tue, 14 Jun 2011 16:28:57 GMT
Author: julianfoad
Date: Tue Jun 14 16:28:56 2011
New Revision: 1135682

URL: http://svn.apache.org/viewvc?rev=1135682&view=rev
Log:
Allow svn_io_is_binary_data() to accept any kind of pointer without type
casts.  A follow-up to r1135575 and r1135655.

* subversion/include/svn_io.h,
  subversion/libsvn_subr/io.c
  (svn_io_is_binary_data): Take 'const void *' instead of 'const unsigned
    char *'.

* subversion/libsvn_wc/props.c
  (prop_conflict_from_skel): Remove type casts.

Modified:
    subversion/trunk/subversion/include/svn_io.h
    subversion/trunk/subversion/libsvn_subr/io.c
    subversion/trunk/subversion/libsvn_wc/props.c

Modified: subversion/trunk/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_io.h?rev=1135682&r1=1135681&r2=1135682&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_io.h (original)
+++ subversion/trunk/subversion/include/svn_io.h Tue Jun 14 16:28:56 2011
@@ -1793,7 +1793,7 @@ svn_io_detect_mimetype(const char **mime
  * @since New in 1.7.
  */
 svn_boolean_t
-svn_io_is_binary_data(const unsigned char *buf, apr_size_t len);
+svn_io_is_binary_data(const void *buf, apr_size_t len);
 
 
 /** Wrapper for apr_file_open().  @a fname is utf8-encoded. */

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1135682&r1=1135681&r2=1135682&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Tue Jun 14 16:28:56 2011
@@ -2952,8 +2952,10 @@ svn_io_detect_mimetype2(const char **mim
 
 
 svn_boolean_t
-svn_io_is_binary_data(const unsigned char *buf, apr_size_t len)
+svn_io_is_binary_data(const void *data, apr_size_t len)
 {
+  const unsigned char *buf = data;
+
   /* Right now, this function is going to be really stupid.  It's
      going to examine the block of data, and make sure that 15%
      of the bytes are such that their value is in the ranges 0x07-0x0D

Modified: subversion/trunk/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/props.c?rev=1135682&r1=1135681&r2=1135682&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/props.c (original)
+++ subversion/trunk/subversion/libsvn_wc/props.c Tue Jun 14 16:28:56 2011
@@ -607,12 +607,9 @@ prop_conflict_from_skel(const svn_string
 
   /* If any of the property values involved in the diff is binary data,
    * do not generate a diff. */
-  original_is_binary = svn_io_is_binary_data((unsigned char *)original->data,
-                                             original->len);
-  mine_is_binary = svn_io_is_binary_data((unsigned char *)mine->data,
-                                         mine->len);
-  incoming_is_binary = svn_io_is_binary_data((unsigned char *)incoming->data,
-                                             incoming->len);
+  original_is_binary = svn_io_is_binary_data(original->data, original->len);
+  mine_is_binary = svn_io_is_binary_data(mine->data, mine->len);
+  incoming_is_binary = svn_io_is_binary_data(incoming->data, incoming->len);
 
   if (!(original_is_binary || mine_is_binary || incoming_is_binary))
     {



Mime
View raw message