[Libreoffice-commits] core.git: 2 commits - external/apr ucb/source

Stephan Bergmann sbergman at redhat.com
Mon Aug 17 03:04:00 PDT 2015


 external/apr/UnpackedTarball_apr.mk            |    6 
 external/apr/uuid.patch                        |  241 +++++++++++++++++++++++++
 ucb/source/ucp/webdav/SerfUri.cxx              |    2 
 ucb/source/ucp/webdav/webdavresponseparser.cxx |    9 
 4 files changed, 252 insertions(+), 6 deletions(-)

New commits:
commit f52e295a102a44a41cecfff39f79b4db144b4271
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 17 12:03:22 2015 +0200

    loplugin:cstylecast
    
    Change-Id: I32a9feb5851691b02475e9eb5dbb024d3330b232

diff --git a/ucb/source/ucp/webdav/SerfUri.cxx b/ucb/source/ucp/webdav/SerfUri.cxx
index 8947655..1c11679 100644
--- a/ucb/source/ucp/webdav/SerfUri.cxx
+++ b/ucb/source/ucp/webdav/SerfUri.cxx
@@ -83,7 +83,7 @@ SerfUri::SerfUri( const OUString & inUri )
     }
     if ( !mAprUri.path )
     {
-        mAprUri.path = (char *)"/";
+        mAprUri.path = const_cast<char *>("/");
     }
 
     init( &mAprUri );
diff --git a/ucb/source/ucp/webdav/webdavresponseparser.cxx b/ucb/source/ucp/webdav/webdavresponseparser.cxx
index 95a451b..f7a6ee5 100644
--- a/ucb/source/ucp/webdav/webdavresponseparser.cxx
+++ b/ucb/source/ucp/webdav/webdavresponseparser.cxx
@@ -864,16 +864,15 @@ namespace
                 // get result
                 switch(eWebDAVResponseParserMode)
                 {
-                    // *(std::vector<T>*) & is a horrible hack but hopefully works,
-                    // I was not able to come up with something sane :-/
+                    //TODO: Clean up reinterpret_casts:
                     case WebDAVResponseParserMode_PropFind:
-                        rResult = *(std::vector<T>*) &pWebDAVResponseParser->getResult_PropFind();
+                        rResult = reinterpret_cast<std::vector<T> const &>(pWebDAVResponseParser->getResult_PropFind());
                         break;
                     case WebDAVResponseParserMode_PropName:
-                        rResult = *(std::vector<T>*) &pWebDAVResponseParser->getResult_PropName();
+                        rResult = reinterpret_cast<std::vector<T> const &>(pWebDAVResponseParser->getResult_PropName());
                         break;
                     case WebDAVResponseParserMode_Lock:
-                        rResult = *(std::vector<T>*) &pWebDAVResponseParser->getResult_Lock();
+                        rResult = reinterpret_cast<std::vector<T> const &>(pWebDAVResponseParser->getResult_Lock());
                         break;
                 }
             }
commit aeafca133405e4a5fdbe253f8dcd2019d6b6b2a4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Aug 17 12:01:18 2015 +0200

    external/apr: Avoid dependency on system uuid lib
    
    ...which isn't even needed, as apr only uses APR_HAS_OS_UUID for apr_os_uuid_get
    (apr_portable.h), which is neither used internally in apr nor by either of the
    two clients of apr in LO, external/serf and ucb/source/ucp/webdav
    
    Change-Id: I2e9d1f2640df0a8125ae2840f54488e77656c3ec

diff --git a/external/apr/UnpackedTarball_apr.mk b/external/apr/UnpackedTarball_apr.mk
index 5fa9d05..5f82b84 100644
--- a/external/apr/UnpackedTarball_apr.mk
+++ b/external/apr/UnpackedTarball_apr.mk
@@ -11,4 +11,10 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,apr))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,apr,$(APR_TARBALL)))
 
+$(eval $(call gb_UnpackedTarball_set_patchlevel,apr,0))
+
+$(eval $(call gb_UnpackedTarball_add_patches,apr, \
+    external/apr/uuid.patch \
+))
+
 # vim: set noet sw=4 ts=4:
diff --git a/external/apr/uuid.patch b/external/apr/uuid.patch
new file mode 100644
index 0000000..53c75f1
--- /dev/null
+++ b/external/apr/uuid.patch
@@ -0,0 +1,241 @@
+--- configure
++++ configure
+@@ -26343,235 +26343,9 @@
+ 
+ echo "${nl}Checking for OS UUID Support..."
+ 
+-for ac_header in uuid.h uuid/uuid.h sys/uuid.h
+-do :
+-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+-  cat >>confdefs.h <<_ACEOF
+-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+-_ACEOF
+- break
+-fi
+-
+-done
+-
+-
+-apr_revert_save_LIBS=$LIBS
+-
+-# Prefer the flavor(s) that live in libc;
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_create" >&5
+-$as_echo_n "checking for library containing uuid_create... " >&6; }
+-if ${ac_cv_search_uuid_create+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  ac_func_search_save_LIBS=$LIBS
+-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-/* Override any GCC internal prototype to avoid an error.
+-   Use char because int might match the return type of a GCC
+-   builtin and then its argument prototype would still apply.  */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-char uuid_create ();
+-int
+-main ()
+-{
+-return uuid_create ();
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-for ac_lib in '' uuid; do
+-  if test -z "$ac_lib"; then
+-    ac_res="none required"
+-  else
+-    ac_res=-l$ac_lib
+-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+-  fi
+-  if ac_fn_c_try_link "$LINENO"; then :
+-  ac_cv_search_uuid_create=$ac_res
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+-    conftest$ac_exeext
+-  if ${ac_cv_search_uuid_create+:} false; then :
+-  break
+-fi
+-done
+-if ${ac_cv_search_uuid_create+:} false; then :
+-
+-else
+-  ac_cv_search_uuid_create=no
+-fi
+-rm conftest.$ac_ext
+-LIBS=$ac_func_search_save_LIBS
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_create" >&5
+-$as_echo "$ac_cv_search_uuid_create" >&6; }
+-ac_res=$ac_cv_search_uuid_create
+-if test "$ac_res" != no; then :
+-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+-
+-fi
+-
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_generate" >&5
+-$as_echo_n "checking for library containing uuid_generate... " >&6; }
+-if ${ac_cv_search_uuid_generate+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-  ac_func_search_save_LIBS=$LIBS
+-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-/* Override any GCC internal prototype to avoid an error.
+-   Use char because int might match the return type of a GCC
+-   builtin and then its argument prototype would still apply.  */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-char uuid_generate ();
+-int
+-main ()
+-{
+-return uuid_generate ();
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-for ac_lib in '' uuid; do
+-  if test -z "$ac_lib"; then
+-    ac_res="none required"
+-  else
+-    ac_res=-l$ac_lib
+-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+-  fi
+-  if ac_fn_c_try_link "$LINENO"; then :
+-  ac_cv_search_uuid_generate=$ac_res
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+-    conftest$ac_exeext
+-  if ${ac_cv_search_uuid_generate+:} false; then :
+-  break
+-fi
+-done
+-if ${ac_cv_search_uuid_generate+:} false; then :
+-
+-else
+-  ac_cv_search_uuid_generate=no
+-fi
+-rm conftest.$ac_ext
+-LIBS=$ac_func_search_save_LIBS
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_generate" >&5
+-$as_echo "$ac_cv_search_uuid_generate" >&6; }
+-ac_res=$ac_cv_search_uuid_generate
+-if test "$ac_res" != no; then :
+-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+-
+-fi
+-
+-if test "$ac_cv_search_uuid_create" = "none required" -o \
+-        "$ac_cv_search_uuid_generate" = "none required"; then
+- LIBS=$apr_revert_save_LIBS
+-fi
+-
+-for ac_func in uuid_create uuid_generate
+-do :
+-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+-  cat >>confdefs.h <<_ACEOF
+-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+-_ACEOF
+-
+-fi
+-done
+-
+-
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for os uuid usability" >&5
+-$as_echo_n "checking for os uuid usability... " >&6; }
+-if ${apr_cv_osuuid+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-
+-# Ensure this test closely mirrors misc/unix/rand.c!
+-uuid_includes="
+-#if defined(HAVE_SYS_TYPES_H)
+-#include <sys/types.h>
+-#endif
+-#if defined(HAVE_UNISTD_H)
+-#include <unistd.h>
+-#endif
+-#if defined(HAVE_UUID_H)
+-#include <uuid.h>
+-#elif defined(HAVE_UUID_UUID_H)
+-#include <uuid/uuid.h>
+-#elif defined(HAVE_SYS_UUID_H)
+-#include <sys/uuid.h>
+-#endif
+-"
+- apr_cv_osuuid=no
+- if test $ac_cv_func_uuid_create = yes; then
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-$uuid_includes
+-int
+-main ()
+-{
+-
+-    uuid_t g;
+-    uint32_t s;
+-    uuid_create(&g, &s);
+-    if (s == uuid_s_ok) s = 0;
+-
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_link "$LINENO"; then :
+-  apr_cv_osuuid=yes
+-else
+-  apr_cv_func_uuid_create=no
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+-    conftest$ac_exeext conftest.$ac_ext
+- fi
+- if test $ac_cv_func_uuid_generate = yes; then
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-$uuid_includes
+-int
+-main ()
+-{
+-
+-    uuid_t g;
+-    uuid_generate(g);
+-
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_link "$LINENO"; then :
+-  apr_cv_osuuid=yes
+-else
+-  apr_cv_func_uuid_generate=no
+-fi
+-rm -f core conftest.err conftest.$ac_objext \
+-    conftest$ac_exeext conftest.$ac_ext
+- fi
+-
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $apr_cv_osuuid" >&5
+-$as_echo "$apr_cv_osuuid" >&6; }
+-
+-if test $apr_cv_osuuid = yes; then
+-  osuuid="1"
+-else
+-  osuuid="0"
+-  LIBS=$apr_revert_save_LIBS
+-fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo no >&6; }
++osuuid="0"
+ 
+ 
+ 


More information about the Libreoffice-commits mailing list