[packages/mysql-workbench] - simplified+generalized format-string and types patches, restoring 64-bit int support on ILP32 syst

qboosh qboosh at pld-linux.org
Fri Mar 9 05:34:09 CET 2018


commit 7d15f9a2042fa1c5618d48e2abb0c62d90fd680f
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Mar 9 05:36:17 2018 +0100

    - simplified+generalized format-string and types patches, restoring 64-bit int support on ILP32 systems
    - release 4

 format-string.patch  | 18 ++++-------
 mysql-workbench.spec |  2 +-
 types.patch          | 91 +++++++---------------------------------------------
 3 files changed, 18 insertions(+), 93 deletions(-)
---
diff --git a/mysql-workbench.spec b/mysql-workbench.spec
index 085ded0..641836d 100644
--- a/mysql-workbench.spec
+++ b/mysql-workbench.spec
@@ -14,7 +14,7 @@ Summary:	Extensible modeling tool for MySQL
 Summary(pl.UTF-8):	Narzędzie do modelowania baz danych dla MySQL-a
 Name:		mysql-workbench
 Version:	6.3.10
-Release:	3
+Release:	4
 License:	GPL v2
 Group:		Applications/Databases
 # Source0Download: http://dev.mysql.com/downloads/workbench/
diff --git a/format-string.patch b/format-string.patch
index 1acc038..5ad5425 100644
--- a/format-string.patch
+++ b/format-string.patch
@@ -1,26 +1,20 @@
 --- mysql-workbench-community-6.3.10-src/library/base/jsonparser.cpp~	2017-11-09 16:11:42.000000000 +0000
 +++ mysql-workbench-community-6.3.10-src/library/base/jsonparser.cpp	2018-03-08 13:43:48.632064990 +0000
-@@ -343,7 +343,11 @@
+@@ -343,7 +343,7 @@
     */
    JsonValue &JsonArray::at(SizeType pos) {
      if (pos > _data.size())
-+#if defined(__x86_64__) && !defined(__ILP32__)
-       throw std::out_of_range(base::strfmt("Index '%lu' is out of range.", pos));
-+#else
-+      throw std::out_of_range(base::strfmt("Index '%u' is out of range.", pos));
-+#endif
+-      throw std::out_of_range(base::strfmt("Index '%lu' is out of range.", pos));
++      throw std::out_of_range(base::strfmt("Index '%zu' is out of range.", pos));
      return _data.at(pos);
    }
  
-@@ -358,7 +362,11 @@
+@@ -358,7 +358,7 @@
     */
    const JsonValue &JsonArray::at(SizeType pos) const {
      if (pos > _data.size())
-+#if defined(__x86_64__) && !defined(__ILP32__)
-       throw std::out_of_range(base::strfmt("Index '%lu' is out of range.", pos));
-+#else
-+      throw std::out_of_range(base::strfmt("Index '%u' is out of range.", pos));
-+#endif
+-      throw std::out_of_range(base::strfmt("Index '%lu' is out of range.", pos));
++      throw std::out_of_range(base::strfmt("Index '%zu' is out of range.", pos));
      return _data.at(pos);
    }
  
diff --git a/types.patch b/types.patch
index 74de545..1ff2858 100644
--- a/types.patch
+++ b/types.patch
@@ -1,80 +1,11 @@
---- mysql-workbench-community-6.3.10-src/library/base/jsonparser.cpp~	2017-11-09 16:11:42.000000000 +0000
-+++ mysql-workbench-community-6.3.10-src/library/base/jsonparser.cpp	2018-03-08 13:43:48.632064990 +0000
-@@ -1677,10 +1677,10 @@
-         _output += std::to_string((double)value);
-         break;
-       case VInt64:
--        _output += std::to_string((int64_t)value);
-+        _output += std::to_string((ssize_t)value);
-         break;
-       case VUint64:
--        _output += std::to_string((uint64_t)value);
-+        _output += std::to_string((size_t)value);
-         break;
-       case VObject:
-         write((JsonObject)value);
---- mysql-workbench-community-6.3.10-src/library/forms/jsonview.cpp.orig	2018-03-08 15:19:36.753949179 +0000
-+++ mysql-workbench-community-6.3.10-src/library/forms/jsonview.cpp	2018-03-08 15:21:06.994864431 +0000
-@@ -669,7 +669,7 @@
-           break;
-         buffer << value;
-         buffer >> number2;
--        storedValue = number2;
-+        storedValue = (ssize_t)number2;
-         setData = true;
-         break;
-       case VUint64:
-@@ -677,7 +677,7 @@
-           break;
-         buffer << value;
-         buffer >> number3;
--        storedValue = number3;
-+        storedValue = (size_t)number3;
-         setData = true;
-         break;
-       case VBoolean:
-@@ -1074,11 +1074,11 @@
-       node->set_string(2, "Double");
-       break;
-     case VInt64:
--      node->set_string(1, std::to_string((int64_t)value));
-+      node->set_string(1, std::to_string((ssize_t)value));
-       node->set_string(2, "Long Integer");
-       break;
-     case VUint64:
--      node->set_string(1, std::to_string((uint64_t)value));
-+      node->set_string(1, std::to_string((size_t)value));
-       node->set_string(2, "Unsigned Long Integer");
-       break;
-     default:
-@@ -1340,7 +1340,7 @@
-           break;
-         buffer << value;
-         buffer >> number2;
--        storedValue = number2;
-+        storedValue = (ssize_t)number2;
-         node->set_long(column, number2);
-         _dataChanged(false);
-         break;
-@@ -1349,7 +1349,7 @@
-           break;
-         buffer << value;
-         buffer >> number3;
--        storedValue = number3;
-+        storedValue = (size_t)number3;
-         node->set_float(column, (double)number3);
-         _dataChanged(false);
-         break;
-@@ -1613,10 +1613,10 @@
-       node->set_float(columnId, (double)value);
-       break;
-     case VInt64:
--      node->set_long(columnId, (int64_t)value);
-+      node->set_long(columnId, (ssize_t)value);
-       break;
-     case VUint64:
--      node->set_long(columnId, (uint64_t)value);
-+      node->set_long(columnId, (size_t)value);
-       break;
-     default:
-       break;
+--- mysql-workbench-community-6.3.10-src/library/base/base/common.h.orig	2017-11-09 17:11:42.000000000 +0100
++++ mysql-workbench-community-6.3.10-src/library/base/base/common.h	2018-03-08 18:11:20.498742204 +0100
+@@ -95,6 +95,8 @@
+ 
+ #ifdef __LP64__
+ #define DEFINE_INT_FUNCTIONS
++#else
++#define DEFINE_UINT64_T_FUNCTIONS
+ #endif
+ 
+ #ifdef __APPLE__
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mysql-workbench.git/commitdiff/7d15f9a2042fa1c5618d48e2abb0c62d90fd680f



More information about the pld-cvs-commit mailing list