svn commit: r1921361 - /subversion/trunk/subversion/libsvn_subr/io.c

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Wed Oct 16 14:45:20 2024
New Revision: 1921361

URL: http://svn.apache.org/viewvc?rev=1921361&view=rev
Log:
Fix compilation with CLang on Windows.

Before, we were invoking the svn_utf__win32_utf8_to_utf16() function with
non-constant pointer, passed into the 'result' argument. However, in the
svn_io__utf8_to_unicode_longpath function implementation, there is a
conversion to a constant pointer causing the following error when compiling
with CLang:

[[[
subversion\libsvn_subr\io.c(1902,42): error : cannot take the address of
an rvalue of type 'const WCHAR *' (aka 'const unsigned short *')
]]]

In this commit, this conversion will be removed in order to prevent the error,
how it is done in the other places, where the function is utilized.

There still will be a warning of implicit conversion, which has to be
fixed generally in this function.

* subversion/libsvn_subr/io.c
  (svn_io__utf8_to_unicode_longpath): Do not convert 'buffer' to 'const WCHAR *'
   before taking address of it.

Modified:
    subversion/trunk/subversion/libsvn_subr/io.c

Modified: subversion/trunk/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/io.c?rev=1921361&r1=1921360&r2=1921361&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/io.c (original)
+++ subversion/trunk/subversion/libsvn_subr/io.c Wed Oct 16 14:45:20 2024
@@ -1899,7 +1899,7 @@ svn_io__utf8_to_unicode_longpath(const W
         }
     }
 
-    SVN_ERR(svn_utf__win32_utf8_to_utf16(&(const WCHAR*)buffer, source,
+    SVN_ERR(svn_utf__win32_utf8_to_utf16(&buffer, source,
                                          prefix, result_pool));
 
     /* Convert slashes to backslashes because the \\?\ path format
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.