aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/tests
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-29 10:45:37 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-25 10:44:05 +0200
commit7be4e64b4bac6e6b5a90eec74b9f2b661c60db3a (patch)
tree41d2f586576787ffa71e567398391f7ab504ae89 /sources/shiboken2/tests
parente5595a4b3010b1bb4b6f80a0339271a7b26934de (diff)
shiboken: Replace 'typedef' by 'using'
Apply Fixits by Qt Creator with some amendments. Remove iterator types by using auto instead. Change-Id: I8a75323da6ae5cdcc6b67af8be9376408953986b Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/tests')
-rw-r--r--sources/shiboken2/tests/libminimal/typedef.h4
-rw-r--r--sources/shiboken2/tests/libsample/handle.h6
-rw-r--r--sources/shiboken2/tests/libsample/listuser.h2
-rw-r--r--sources/shiboken2/tests/libsample/objecttype.h2
-rw-r--r--sources/shiboken2/tests/libsample/photon.h4
-rw-r--r--sources/shiboken2/tests/libsample/polygon.h2
-rw-r--r--sources/shiboken2/tests/libsample/size.h4
-rw-r--r--sources/shiboken2/tests/libsample/str.h2
-rw-r--r--sources/shiboken2/tests/libsample/strlist.h2
9 files changed, 14 insertions, 14 deletions
diff --git a/sources/shiboken2/tests/libminimal/typedef.h b/sources/shiboken2/tests/libminimal/typedef.h
index 8e3455652..b8d6faacd 100644
--- a/sources/shiboken2/tests/libminimal/typedef.h
+++ b/sources/shiboken2/tests/libminimal/typedef.h
@@ -34,7 +34,7 @@
#include <vector>
// Test wrapping of a typedef
-typedef std::vector<int> MyArrayInt;
+using MyArrayInt = std::vector<int>;
LIBMINIMAL_API bool arrayFuncInt(std::vector<int> a);
LIBMINIMAL_API bool arrayFuncIntTypedef(MyArrayInt a);
@@ -43,7 +43,7 @@ LIBMINIMAL_API std::vector<int> arrayFuncIntReturn(int size);
LIBMINIMAL_API MyArrayInt arrayFuncIntReturnTypedef(int size);
// Test wrapping of a typedef of a typedef
-typedef MyArrayInt MyArray;
+using MyArray = MyArrayInt;
LIBMINIMAL_API bool arrayFunc(std::vector<int> a);
LIBMINIMAL_API bool arrayFuncTypedef(MyArray a);
diff --git a/sources/shiboken2/tests/libsample/handle.h b/sources/shiboken2/tests/libsample/handle.h
index 18221c763..824c28b9a 100644
--- a/sources/shiboken2/tests/libsample/handle.h
+++ b/sources/shiboken2/tests/libsample/handle.h
@@ -33,14 +33,14 @@
/* See http://bugs.pyside.org/show_bug.cgi?id=1105. */
namespace Foo {
- typedef unsigned long HANDLE;
+ using HANDLE = unsigned long;
}
class LIBSAMPLE_API OBJ
{
};
-typedef OBJ* HANDLE;
+using HANDLE = OBJ *;
class LIBSAMPLE_API HandleHolder
{
@@ -63,7 +63,7 @@ private:
};
struct LIBSAMPLE_API PrimitiveStruct {};
-typedef struct PrimitiveStruct* PrimitiveStructPtr;
+using PrimitiveStructPtr = struct PrimitiveStruct *;
struct LIBSAMPLE_API PrimitiveStructPointerHolder
{
PrimitiveStructPtr primitiveStructPtr;
diff --git a/sources/shiboken2/tests/libsample/listuser.h b/sources/shiboken2/tests/libsample/listuser.h
index 92360884f..7e67039d9 100644
--- a/sources/shiboken2/tests/libsample/listuser.h
+++ b/sources/shiboken2/tests/libsample/listuser.h
@@ -39,7 +39,7 @@
class LIBSAMPLE_API ListUser
{
public:
- typedef std::list<Point*> PointList;
+ using PointList = std::list<Point *>;
enum ListOfSomething {
ListOfPoint,
diff --git a/sources/shiboken2/tests/libsample/objecttype.h b/sources/shiboken2/tests/libsample/objecttype.h
index cb5823c5b..1f2a9c7e8 100644
--- a/sources/shiboken2/tests/libsample/objecttype.h
+++ b/sources/shiboken2/tests/libsample/objecttype.h
@@ -69,7 +69,7 @@ class LIBSAMPLE_API ObjectType
{
public:
// ### Fixme: Use uintptr_t in C++ 11
- typedef size_t Identifier;
+ using Identifier = size_t;
explicit ObjectType(ObjectType *parent = nullptr);
virtual ~ObjectType();
diff --git a/sources/shiboken2/tests/libsample/photon.h b/sources/shiboken2/tests/libsample/photon.h
index b9fc6532d..1dcb4f83e 100644
--- a/sources/shiboken2/tests/libsample/photon.h
+++ b/sources/shiboken2/tests/libsample/photon.h
@@ -93,8 +93,8 @@ template class LIBSAMPLE_API TemplateBase<IdentityType>;
template class LIBSAMPLE_API TemplateBase<DuplicatorType>;
#endif
-typedef TemplateBase<IdentityType> ValueIdentity;
-typedef TemplateBase<DuplicatorType> ValueDuplicator;
+using ValueIdentity = TemplateBase<IdentityType>;
+using ValueDuplicator = TemplateBase<DuplicatorType>;
LIBSAMPLE_API int callCalculateForValueDuplicatorPointer(ValueDuplicator* value);
LIBSAMPLE_API int callCalculateForValueDuplicatorReference(ValueDuplicator& value);
diff --git a/sources/shiboken2/tests/libsample/polygon.h b/sources/shiboken2/tests/libsample/polygon.h
index 3eafa3094..728332d1a 100644
--- a/sources/shiboken2/tests/libsample/polygon.h
+++ b/sources/shiboken2/tests/libsample/polygon.h
@@ -37,7 +37,7 @@
class LIBSAMPLE_API Polygon
{
public:
- typedef std::list<Point> PointList;
+ using PointList = std::list<Point>;
Polygon() {}
Polygon(double x, double y);
diff --git a/sources/shiboken2/tests/libsample/size.h b/sources/shiboken2/tests/libsample/size.h
index c72021231..76502b416 100644
--- a/sources/shiboken2/tests/libsample/size.h
+++ b/sources/shiboken2/tests/libsample/size.h
@@ -188,8 +188,8 @@ inline const Size operator/(const Size& s, double div)
return Size(s.m_width / div, s.m_height / div);
}
-typedef double real;
-typedef unsigned short ushort;
+using real = double;
+using ushort = unsigned short;
class LIBSAMPLE_API SizeF
{
public:
diff --git a/sources/shiboken2/tests/libsample/str.h b/sources/shiboken2/tests/libsample/str.h
index 4af00e5b6..2f7cee8c3 100644
--- a/sources/shiboken2/tests/libsample/str.h
+++ b/sources/shiboken2/tests/libsample/str.h
@@ -71,7 +71,7 @@ private:
LIBSAMPLE_API Str operator+(int number, const Str& str);
LIBSAMPLE_API unsigned int strHash(const Str& str);
-typedef Str PStr;
+using PStr = Str;
LIBSAMPLE_API void changePStr(PStr* pstr, const char* suffix);
LIBSAMPLE_API void duplicatePStr(PStr *pstr = nullptr);
diff --git a/sources/shiboken2/tests/libsample/strlist.h b/sources/shiboken2/tests/libsample/strlist.h
index 27fc05e6e..43aa15390 100644
--- a/sources/shiboken2/tests/libsample/strlist.h
+++ b/sources/shiboken2/tests/libsample/strlist.h
@@ -60,6 +60,6 @@ private:
CtorEnum m_ctorUsed;
};
-typedef StrList PStrList;
+using PStrList = StrList;
#endif // STRLIST_H