Author: julianfoad
Date: Fri Mar 16 12:49:33 2018
New Revision: 1826981

URL: http://svn.apache.org/viewvc?rev=1826981&view=rev
Log:
Resolve some GCC "casting away 'const'" warnings.

* subversion/libsvn_fs_fs/dag.c
  (svn_fs_fs__dag_serialize): Keep 'const' in the existing cast.

* subversion/libsvn_fs_fs/index.c,
  subversion/libsvn_fs_fs/load-index.c
  (compare_p2l_entry_revision): Keep 'const' in the existing cast.

* subversion/libsvn_subr/x509info.c
  (CONSTANT_PAIR): Keep 'const' in the existing cast.

* tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
  (compare_mergeinfo): Keep 'const' in the existing cast.

Modified:
    subversion/trunk/subversion/libsvn_fs_fs/dag.c
    subversion/trunk/subversion/libsvn_fs_fs/index.c
    subversion/trunk/subversion/libsvn_fs_fs/load-index.c
    subversion/trunk/subversion/libsvn_subr/x509info.c
    subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c

Modified: subversion/trunk/subversion/libsvn_fs_fs/dag.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/dag.c?rev=1826981&r1=1826980&r2=1826981&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/dag.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/dag.c Fri Mar 16 12:49:33 2018
@@ -1166,7 +1166,7 @@ svn_fs_fs__dag_serialize(void **data,
                                 (const void * const *)&node->node_pool);
 
   /* serialize other sub-structures */
-  svn_fs_fs__id_serialize(context, (const svn_fs_id_t **)&node->id);
+  svn_fs_fs__id_serialize(context, (const svn_fs_id_t *const *)&node->id);
   svn_fs_fs__id_serialize(context, &node->fresh_root_predecessor_id);
   svn_temp_serializer__add_string(context, &node->created_path);
 

Modified: subversion/trunk/subversion/libsvn_fs_fs/index.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/index.c?rev=1826981&r1=1826980&r2=1826981&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/index.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/index.c Fri Mar 16 12:49:33 2018
@@ -3191,9 +3191,9 @@ compare_p2l_entry_revision(const void *l
                            const void *rhs)
 {
   const svn_fs_fs__p2l_entry_t *lhs_entry
-    =*(const svn_fs_fs__p2l_entry_t **)lhs;
+    =*(const svn_fs_fs__p2l_entry_t *const *)lhs;
   const svn_fs_fs__p2l_entry_t *rhs_entry
-    =*(const svn_fs_fs__p2l_entry_t **)rhs;
+    =*(const svn_fs_fs__p2l_entry_t *const *)rhs;
 
   if (lhs_entry->item.revision < rhs_entry->item.revision)
     return -1;

Modified: subversion/trunk/subversion/libsvn_fs_fs/load-index.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/load-index.c?rev=1826981&r1=1826980&r2=1826981&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_fs_fs/load-index.c (original)
+++ subversion/trunk/subversion/libsvn_fs_fs/load-index.c Fri Mar 16 12:49:33 
2018
@@ -83,9 +83,9 @@ compare_p2l_entry_revision(const void *l
                            const void *rhs)
 {
   const svn_fs_fs__p2l_entry_t *lhs_entry
-    =*(const svn_fs_fs__p2l_entry_t **)lhs;
+    =*(const svn_fs_fs__p2l_entry_t *const *)lhs;
   const svn_fs_fs__p2l_entry_t *rhs_entry
-    =*(const svn_fs_fs__p2l_entry_t **)rhs;
+    =*(const svn_fs_fs__p2l_entry_t *const *)rhs;
 
   if (lhs_entry->offset < rhs_entry->offset)
     return -1;

Modified: subversion/trunk/subversion/libsvn_subr/x509info.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/x509info.c?rev=1826981&r1=1826980&r2=1826981&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/x509info.c (original)
+++ subversion/trunk/subversion/libsvn_subr/x509info.c Fri Mar 16 12:49:33 2018
@@ -128,7 +128,7 @@ typedef struct asn1_oid {
   const char *long_label;
 } asn1_oid;
 
-#define CONSTANT_PAIR(c) (unsigned char *)(c), sizeof((c)) - 1
+#define CONSTANT_PAIR(c) (const unsigned char *)(c), sizeof((c)) - 1
 
 static const asn1_oid asn1_oids[] = {
   { CONSTANT_PAIR(SVN_X509_OID_COMMON_NAME),  "CN", "commonName" },

Modified: 
subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c?rev=1826981&r1=1826980&r2=1826981&view=diff
==============================================================================
--- subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c 
(original)
+++ subversion/trunk/tools/client-side/svn-mergeinfo-normalizer/wc_mergeinfo.c 
Fri Mar 16 12:49:33 2018
@@ -112,8 +112,8 @@ static int
 compare_mergeinfo(const void *lhs,
                   const void *rhs)
 {
-  const mergeinfo_t *lhs_mi = *(const mergeinfo_t **)lhs;
-  const mergeinfo_t *rhs_mi = *(const mergeinfo_t **)rhs;
+  const mergeinfo_t *lhs_mi = *(const mergeinfo_t *const *)lhs;
+  const mergeinfo_t *rhs_mi = *(const mergeinfo_t *const *)rhs;
 
   return strcmp(lhs_mi->local_path, rhs_mi->local_path);
 }


Reply via email to