From 6b49386b6774fe024a0326a64c6dc0e3127ea9d9 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 29 Nov 2021 23:27:26 +0100 Subject: [PATCH] WIP: fixed some build errors --- scripts/mkqtdecl_common/produce.rb | 2 +- src/db/db/dbBoxTree.h | 8 +++---- src/db/db/dbMemStatistics.h | 4 ++-- src/db/db/dbShape.h | 16 ++++++------- src/db/db/gsiDeclDbNetlistDeviceExtractor.cc | 6 ++--- src/gsi/gsi/gsiClass.h | 2 +- src/gsi/gsi/gsiDeclTl.cc | 25 ++++---------------- src/gsiqt/qtbasic/gsiQtGuiExternals.h | 4 +++- src/gsiqt/qtbasic/gsiQtWidgetsExternals.h | 4 +++- src/laybasic/laybasic/gsiDeclLayMenu.cc | 5 ++++ src/rdb/rdb/rdb.cc | 2 +- src/rdb/rdb/rdb.h | 2 +- src/tl/tl/tlList.h | 2 +- src/tl/tl/tlReuseVector.h | 8 +++---- src/tl/tl/tlTypeTraits.h | 2 +- src/tl/tl/tlVariantUserClasses.h | 10 ++++---- 16 files changed, 48 insertions(+), 54 deletions(-) diff --git a/scripts/mkqtdecl_common/produce.rb b/scripts/mkqtdecl_common/produce.rb index e2ad911f6..d02c70055 100755 --- a/scripts/mkqtdecl_common/produce.rb +++ b/scripts/mkqtdecl_common/produce.rb @@ -3114,10 +3114,10 @@ END end end - end ttfile.puts("") ttfile.puts("#endif") + end puts("#{ttfile_name} written.") diff --git a/src/db/db/dbBoxTree.h b/src/db/db/dbBoxTree.h index cc556873c..918747933 100644 --- a/src/db/db/dbBoxTree.h +++ b/src/db/db/dbBoxTree.h @@ -74,14 +74,14 @@ private: /// @brief a helper class providing a linear-time iterator difference which is not necessarily /// the actual difference but monotonous -template -size_t box_tree_lt_difference (const tl::reuse_vector_const_iterator &a, const tl::reuse_vector_const_iterator &b) +template +size_t box_tree_lt_difference (const tl::reuse_vector_const_iterator &a, const tl::reuse_vector_const_iterator &b) { return a.index () - b.index (); } -template -size_t box_tree_lt_difference_ptr (const X *a, const tl::reuse_vector_const_iterator &b) +template +size_t box_tree_lt_difference_ptr (const X *a, const tl::reuse_vector_const_iterator &b) { return a - b.unsafe_target_addr (); } diff --git a/src/db/db/dbMemStatistics.h b/src/db/db/dbMemStatistics.h index 4ed03a805..6297bc288 100644 --- a/src/db/db/dbMemStatistics.h +++ b/src/db/db/dbMemStatistics.h @@ -41,8 +41,8 @@ namespace tl { - template class vector; - template class reuse_vector; + template class vector; + template class reuse_vector; class Variant; } diff --git a/src/db/db/dbShape.h b/src/db/db/dbShape.h index f832addf8..22d6680e8 100644 --- a/src/db/db/dbShape.h +++ b/src/db/db/dbShape.h @@ -786,8 +786,8 @@ public: * we would probably create too much constness. Hence we use const_cast to convert it * to a non-const one. */ - template - Shape (const db::Shapes *shapes, const tl::reuse_vector_const_iterator &tree_iter) + template + Shape (const db::Shapes *shapes, const tl::reuse_vector_const_iterator &tree_iter) : mp_shapes (const_cast (shapes)), m_with_props (false), m_stable (true) { typename Obj::tag tag = typename Obj::tag (); @@ -800,8 +800,8 @@ public: /** * @brief Construct as a proxy to a certain object given by an iterator */ - template - Shape (db::Shapes *shapes, const tl::reuse_vector_const_iterator &tree_iter) + template + Shape (db::Shapes *shapes, const tl::reuse_vector_const_iterator &tree_iter) : mp_shapes (shapes), m_with_props (false), m_stable (true) { typename Obj::tag tag = typename Obj::tag (); @@ -818,8 +818,8 @@ public: * we would probably create too much constness. Hence we use const_cast to convert it * to a non-const one. */ - template - Shape (const db::Shapes *shapes, const tl::reuse_vector_const_iterator &tree_iter, const Trans &trans) + template + Shape (const db::Shapes *shapes, const tl::reuse_vector_const_iterator &tree_iter, const Trans &trans) : mp_shapes (const_cast (shapes)), m_with_props (false), m_stable (true) { typename Obj::tag tag = typename Obj::tag (); @@ -832,8 +832,8 @@ public: /** * @brief Construct as a proxy to a certain object given by an iterator */ - template - Shape (db::Shapes *shapes, const tl::reuse_vector_const_iterator &tree_iter, const Trans &trans) + template + Shape (db::Shapes *shapes, const tl::reuse_vector_const_iterator &tree_iter, const Trans &trans) : mp_shapes (shapes), m_with_props (false), m_stable (true) { typename Obj::tag tag = typename Obj::tag (); diff --git a/src/db/db/gsiDeclDbNetlistDeviceExtractor.cc b/src/db/db/gsiDeclDbNetlistDeviceExtractor.cc index d2c219acb..a617dd371 100644 --- a/src/db/db/gsiDeclDbNetlistDeviceExtractor.cc +++ b/src/db/db/gsiDeclDbNetlistDeviceExtractor.cc @@ -93,9 +93,6 @@ public: gsi::Callback cb_extract_devices; }; -namespace -{ - /** * @brief A DeviceClassFactory implementation that allows reimplementation of the virtual methods */ @@ -123,6 +120,9 @@ public: } +namespace gsi +{ + Class decl_dbDeviceClassFactoryBase ("db", "DeviceClassFactory", gsi::factory_callback ("create_class", &DeviceClassFactoryImpl::create_class, &DeviceClassFactoryImpl::cb_create_class, "@brief Creates the DeviceClass object\n" diff --git a/src/gsi/gsi/gsiClass.h b/src/gsi/gsi/gsiClass.h index 4d22179a2..d6f2d9c81 100644 --- a/src/gsi/gsi/gsiClass.h +++ b/src/gsi/gsi/gsiClass.h @@ -188,7 +188,7 @@ public: void read (void *a, tl::Extractor &ex) const { - const T *t = a; + T *t = (T *) a; ex.read (*t); } diff --git a/src/gsi/gsi/gsiDeclTl.cc b/src/gsi/gsi/gsiDeclTl.cc index d11eed55f..a77719f37 100644 --- a/src/gsi/gsi/gsiDeclTl.cc +++ b/src/gsi/gsi/gsiDeclTl.cc @@ -452,6 +452,8 @@ private: std::unique_ptr mp_expr; }; +} + static tl::Variant eval_expr (const std::string &e) { ExpressionWrapper expr; @@ -476,6 +478,9 @@ static ExpressionWrapper *new_expr2 (const std::string &e, const std::map decl_ExpressionContext ("tl", "ExpressionContext", gsi::method ("var", &tl::Eval::set_var, gsi::arg ("name"), gsi::arg ("value"), "@brief Defines a variable with the given name and value\n" @@ -635,16 +640,6 @@ public: gsi::Callback cleanup_cb; }; -} - -namespace tl -{ - template <> struct type_traits : public type_traits { }; -} - -namespace gsi -{ - Class decl_Executable ("tl", "ExecutableBase", gsi::Methods (), "@hide\n@alias Executable" @@ -693,16 +688,6 @@ public: gsi::Callback executable_cb; }; -} - -namespace tl -{ - template <> struct type_traits : public type_traits { }; -} - -namespace gsi -{ - static Recipe_Impl *make_recipe (const std::string &name, const std::string &description) { return new Recipe_Impl (name, description); diff --git a/src/gsiqt/qtbasic/gsiQtGuiExternals.h b/src/gsiqt/qtbasic/gsiQtGuiExternals.h index 6b7b2a7a4..d017f1b19 100644 --- a/src/gsiqt/qtbasic/gsiQtGuiExternals.h +++ b/src/gsiqt/qtbasic/gsiQtGuiExternals.h @@ -20,7 +20,9 @@ */ -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= 0x060000 +# include "../qt6/QtGui/gsiQtExternals.h" +#elif QT_VERSION >= 0x050000 # include "../qt5/QtGui/gsiQtExternals.h" #else # include "../qt4/QtGui/gsiQtExternals.h" diff --git a/src/gsiqt/qtbasic/gsiQtWidgetsExternals.h b/src/gsiqt/qtbasic/gsiQtWidgetsExternals.h index f96d0f10f..2012aabdf 100644 --- a/src/gsiqt/qtbasic/gsiQtWidgetsExternals.h +++ b/src/gsiqt/qtbasic/gsiQtWidgetsExternals.h @@ -20,7 +20,9 @@ */ -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= 0x060000 +# include "../qt6/QtWidgets/gsiQtExternals.h" +#elif QT_VERSION >= 0x050000 # include "../qt5/QtWidgets/gsiQtExternals.h" #else // no present in Qt4 diff --git a/src/laybasic/laybasic/gsiDeclLayMenu.cc b/src/laybasic/laybasic/gsiDeclLayMenu.cc index fab175924..1d08f690b 100644 --- a/src/laybasic/laybasic/gsiDeclLayMenu.cc +++ b/src/laybasic/laybasic/gsiDeclLayMenu.cc @@ -44,6 +44,11 @@ public: tl::Event on_triggered_event; }; +} + +namespace gsi +{ + static std::string pack_key_binding (const std::map &kb) { std::vector > v; diff --git a/src/rdb/rdb/rdb.cc b/src/rdb/rdb/rdb.cc index d4a57419f..602aa90ac 100644 --- a/src/rdb/rdb/rdb.cc +++ b/src/rdb/rdb/rdb.cc @@ -299,7 +299,7 @@ ValueWrapper::to_string (const Database *rdb) const std::string r; r.reserve (200); - if (tag_id () > 0) { + if (tag_id () > 0 && rdb) { r += "["; const Tag &tag = rdb->tags ().tag (tag_id ()); if (tag.is_user_tag ()) { diff --git a/src/rdb/rdb/rdb.h b/src/rdb/rdb/rdb.h index 6df8bf59e..0028447a2 100644 --- a/src/rdb/rdb/rdb.h +++ b/src/rdb/rdb/rdb.h @@ -626,7 +626,7 @@ public: /** * @brief Convert the values collection to a string */ - std::string to_string (const Database *rdb) const; + std::string to_string (const Database *rdb = 0) const; /** * @brief Fill the values collection from the string diff --git a/src/tl/tl/tlList.h b/src/tl/tl/tlList.h index 791917b95..0c2bec7cb 100644 --- a/src/tl/tl/tlList.h +++ b/src/tl/tl/tlList.h @@ -100,7 +100,7 @@ public: } private: - template friend class list_impl; + template friend class list_impl; template friend class list; template friend class list_iterator; template friend class reverse_list_iterator; diff --git a/src/tl/tl/tlReuseVector.h b/src/tl/tl/tlReuseVector.h index 4b063c084..8805fc135 100644 --- a/src/tl/tl/tlReuseVector.h +++ b/src/tl/tl/tlReuseVector.h @@ -191,7 +191,7 @@ public: } private: - template friend class reuse_vector_const_iterator; + template friend class reuse_vector_const_iterator; reuse_vector *mp_v; size_type m_n; @@ -360,7 +360,7 @@ public: } private: - template friend class reuse_vector_iterator; + template friend class reuse_vector_iterator; const reuse_vector *mp_v; size_type m_n; @@ -955,8 +955,8 @@ private: value_type *mp_start, *mp_finish, *mp_capacity; ReuseData *mp_rdata; - template friend class reuse_vector_iterator; - template friend class reuse_vector_const_iterator; + template friend class reuse_vector_iterator; + template friend class reuse_vector_const_iterator; void init () { diff --git a/src/tl/tl/tlTypeTraits.h b/src/tl/tl/tlTypeTraits.h index be2908dd3..a454f2061 100644 --- a/src/tl/tl/tlTypeTraits.h +++ b/src/tl/tl/tlTypeTraits.h @@ -98,7 +98,7 @@ struct has_equal_operator /** * @brief Detects whether a class has a less operator */ -template static __yes_type &__test_less_func (decltype (&T::operator==)); +template static __yes_type &__test_less_func (decltype (&T::operator<)); template static __no_type &__test_less_func (...); template diff --git a/src/tl/tl/tlVariantUserClasses.h b/src/tl/tl/tlVariantUserClasses.h index 687b84548..f21572df4 100644 --- a/src/tl/tl/tlVariantUserClasses.h +++ b/src/tl/tl/tlVariantUserClasses.h @@ -139,27 +139,27 @@ public: virtual bool equal (const void *a, const void *b) const { - return _var_user_equal_impl::value> ((const T *) a, (const T *) b); + return _var_user_equal_impl::value>::call ((const T *) a, (const T *) b); } virtual bool less (const void *a, const void *b) const { - return _var_user_less_impl::value> ((const T *) a, (const T *) b); + return _var_user_less_impl::value>::call ((const T *) a, (const T *) b); } virtual void *clone (const void *a) const { - return _var_user_clone_impl::value> ((const T *) a); + return _var_user_clone_impl::value>::call ((const T *) a); } virtual void assign (void *a, const void *b) const { - _var_user_assign_impl::value> ((T *) a, (const T *)b); + _var_user_assign_impl::value>::call ((T *) a, (const T *)b); } virtual std::string to_string (const void *a) const { - return _var_user_to_string_impl::value> ((const T *) a); + return _var_user_to_string_impl::value>::call ((const T *) a); } virtual void read (void *a, tl::Extractor &ex) const