diff options
42 files changed, 190 insertions, 192 deletions
diff --git a/libshiboken/autodecref.h b/libshiboken/autodecref.h index 9e8bc661..6c9750df 100644 --- a/libshiboken/autodecref.h +++ b/libshiboken/autodecref.h @@ -57,13 +57,13 @@ public: Py_XDECREF(m_pyobj); } - bool isNull() const { return m_pyobj == 0; } + inline bool isNull() const { return m_pyobj == 0; } /// Returns the pointer of the Python object being held. - PyObject* object() { return m_pyobj; } - operator PyObject*() { return m_pyobj; } - operator PyTupleObject*() { return reinterpret_cast<PyTupleObject*>(m_pyobj); } - operator bool() const { return m_pyobj; } - PyObject* operator->() { return m_pyobj; } + inline PyObject* object() { return m_pyobj; } + inline operator PyObject*() { return m_pyobj; } + inline operator PyTupleObject*() { return reinterpret_cast<PyTupleObject*>(m_pyobj); } + inline operator bool() const { return m_pyobj; } + inline PyObject* operator->() { return m_pyobj; } private: PyObject* m_pyobj; AutoDecRef(const AutoDecRef&); diff --git a/tests/libother/extendsnoimplicitconversion.h b/tests/libother/extendsnoimplicitconversion.h index 0a06482e..a94c63ad 100644 --- a/tests/libother/extendsnoimplicitconversion.h +++ b/tests/libother/extendsnoimplicitconversion.h @@ -38,12 +38,12 @@ #include "libothermacros.h" #include "noimplicitconversion.h" -class LIBOTHER_API ExtendsNoImplicitConversion +class ExtendsNoImplicitConversion { public: explicit ExtendsNoImplicitConversion(int objId) : m_objId(objId) {}; - int objId() const { return m_objId; } - operator NoImplicitConversion() const { return NoImplicitConversion(m_objId); } + inline int objId() const { return m_objId; } + inline operator NoImplicitConversion() const { return NoImplicitConversion(m_objId); } private: int m_objId; }; diff --git a/tests/libother/number.h b/tests/libother/number.h index 32af3325..8fd2671d 100644 --- a/tests/libother/number.h +++ b/tests/libother/number.h @@ -43,10 +43,10 @@ class LIBOTHER_API Number { public: explicit Number(int value) : m_value(value) {}; - int value() const { return m_value; } + inline int value() const { return m_value; } Str toStr() const; - operator Str() const { return toStr(); } + inline operator Str() const { return toStr(); } friend LIBOTHER_API Point operator*(const Point&, const Number&); diff --git a/tests/libother/otherderived.h b/tests/libother/otherderived.h index 4aae12aa..8e9171ba 100644 --- a/tests/libother/otherderived.h +++ b/tests/libother/otherderived.h @@ -53,16 +53,16 @@ public: virtual void unpureVirtual(); virtual PrintFormat returnAnEnum() { return Short; } - void useObjectTypeFromOtherModule(ObjectType*) {} - Event useValueTypeFromOtherModule(const Event& e) { return e; } - Complex useValueTypeFromOtherModule(const Complex& c) { return c; } - void useEnumTypeFromOtherModule(OverloadedFuncEnum) {} + inline void useObjectTypeFromOtherModule(ObjectType*) {} + inline Event useValueTypeFromOtherModule(const Event& e) { return e; } + inline Complex useValueTypeFromOtherModule(const Complex& c) { return c; } + inline void useEnumTypeFromOtherModule(OverloadedFuncEnum) {} // factory method static Abstract* createObject(); protected: - const char* getClassName() { return className(); } + inline const char* getClassName() { return className(); } virtual const char* className() { return "OtherDerived"; } }; #endif // OTHERDERIVED_H diff --git a/tests/libother/othermultiplederived.h b/tests/libother/othermultiplederived.h index 36c23ebc..cefc7256 100644 --- a/tests/libother/othermultiplederived.h +++ b/tests/libother/othermultiplederived.h @@ -40,11 +40,11 @@ class ObjectType; -class LIBOTHER_API OtherMultipleDerived : public MDerived1 +class OtherMultipleDerived : public MDerived1 { public: // this will use CppCopier from other module (bug#142) - VirtualMethods returnUselessClass() { return VirtualMethods(); } + inline VirtualMethods returnUselessClass() { return VirtualMethods(); } }; #endif diff --git a/tests/libother/otherobjecttype.h b/tests/libother/otherobjecttype.h index 24596fa9..d4c77cb1 100644 --- a/tests/libother/otherobjecttype.h +++ b/tests/libother/otherobjecttype.h @@ -42,7 +42,7 @@ #include "objecttype.h" #include "collector.h" -class LIBOTHER_API OtherObjectType : public ObjectType +class OtherObjectType : public ObjectType { public: diff --git a/tests/libsample/abstract.h b/tests/libsample/abstract.h index 834a2f9b..842435bc 100644 --- a/tests/libsample/abstract.h +++ b/tests/libsample/abstract.h @@ -62,13 +62,13 @@ public: Abstract(int id = -1); virtual ~Abstract(); - int id() { return m_id; } + inline int id() { return m_id; } // factory method - static Abstract* createObject() { return 0; } + inline static Abstract* createObject() { return 0; } // method that receives an Object Type - static int getObjectId(Abstract* obj) { return obj->id(); } + inline static int getObjectId(Abstract* obj) { return obj->id(); } virtual void pureVirtual() = 0; virtual void* pureVirtualReturningVoidPtr() = 0; diff --git a/tests/libsample/blackbox.h b/tests/libsample/blackbox.h index bb156887..344ff001 100644 --- a/tests/libsample/blackbox.h +++ b/tests/libsample/blackbox.h @@ -60,8 +60,8 @@ public: std::list<ObjectType*> objects(); std::list<Point*> points(); - void referenceToValuePointer(Point*&) {} - void referenceToObjectPointer(ObjectType*&) {} + inline void referenceToValuePointer(Point*&) {} + inline void referenceToObjectPointer(ObjectType*&) {} private: ObjectTypeMap m_objects; diff --git a/tests/libsample/bucket.h b/tests/libsample/bucket.h index 7ea5428a..c0ff388b 100644 --- a/tests/libsample/bucket.h +++ b/tests/libsample/bucket.h @@ -49,11 +49,11 @@ public: int pop(); bool empty(); void lock(); - bool locked() { return m_locked; } + inline bool locked() { return m_locked; } void unlock(); virtual bool virtualBlockerMethod(); - bool callVirtualBlockerMethodButYouDontKnowThis() { return virtualBlockerMethod(); } + inline bool callVirtualBlockerMethodButYouDontKnowThis() { return virtualBlockerMethod(); } private: std::list<int> m_data; diff --git a/tests/libsample/collector.h b/tests/libsample/collector.h index e8228033..e0ee7414 100644 --- a/tests/libsample/collector.h +++ b/tests/libsample/collector.h @@ -63,7 +63,7 @@ private: }; /* Helper for testing external operators */ -class LIBSAMPLE_API IntWrapper +class IntWrapper { public: IntWrapper(int x=0):value(x){} diff --git a/tests/libsample/complex.h b/tests/libsample/complex.h index 9ee2a4ee..2441d3ae 100644 --- a/tests/libsample/complex.h +++ b/tests/libsample/complex.h @@ -43,10 +43,10 @@ public: Complex(double real = 0.0, double imag = 0.0); ~Complex() {} - double real() const { return m_real; } - void setReal(double real) { m_real = real; } - double imag() const { return m_imag; } - void setImaginary(double imag) { m_imag = imag; } + inline double real() const { return m_real; } + inline void setReal(double real) { m_real = real; } + inline double imag() const { return m_imag; } + inline void setImaginary(double imag) { m_imag = imag; } Complex operator+(Complex& other); diff --git a/tests/libsample/derived.h b/tests/libsample/derived.h index 58c3b210..e2e1dfa2 100644 --- a/tests/libsample/derived.h +++ b/tests/libsample/derived.h @@ -84,7 +84,7 @@ public: OtherOverloadedFuncEnum otherOverloaded(int a, int b, bool c, double d); OtherOverloadedFuncEnum otherOverloaded(int a, double b); - SomeInnerClass returnMyParameter(const SomeInnerClass& s) { return s; } + inline SomeInnerClass returnMyParameter(const SomeInnerClass& s) { return s; } static Abstract* triggerImpossibleTypeDiscovery(); static Abstract* triggerAnotherImpossibleTypeDiscovery(); diff --git a/tests/libsample/echo.h b/tests/libsample/echo.h index 139fb60a..3c50f984 100644 --- a/tests/libsample/echo.h +++ b/tests/libsample/echo.h @@ -39,7 +39,7 @@ class ObjectType; -class LIBSAMPLE_API Echo +class Echo { public: Echo(){} diff --git a/tests/libsample/implicitconv.h b/tests/libsample/implicitconv.h index 28a61eac..e7373b04 100644 --- a/tests/libsample/implicitconv.h +++ b/tests/libsample/implicitconv.h @@ -64,9 +64,9 @@ public: ImplicitConv(double value, bool=true) : m_ctorEnum(CtorNone), m_value(value) {} ~ImplicitConv() {} - CtorEnum ctorEnum() { return m_ctorEnum; } - int objId() { return m_objId; } - double value() { return m_value; } + inline CtorEnum ctorEnum() { return m_ctorEnum; } + inline int objId() { return m_objId; } + inline double value() { return m_value; } static ImplicitConv implicitConvCommon(ImplicitConv implicit); diff --git a/tests/libsample/injectcode.h b/tests/libsample/injectcode.h index f22f3d5f..e7c68cf9 100644 --- a/tests/libsample/injectcode.h +++ b/tests/libsample/injectcode.h @@ -54,7 +54,7 @@ public: const char* overloadedMethod(int arg0, bool arg1); virtual int arrayMethod(int count, int* values) const; - int callArrayMethod(int count, int *values) const { return arrayMethod(count, values); } + inline int callArrayMethod(int count, int *values) const { return arrayMethod(count, values); } virtual const char* virtualMethod(int arg); int sumArrayAndLength(int* values) const; private: diff --git a/tests/libsample/listuser.h b/tests/libsample/listuser.h index 67dc95e4..6f04c2e5 100644 --- a/tests/libsample/listuser.h +++ b/tests/libsample/listuser.h @@ -60,8 +60,8 @@ public: static void multiplyPointList(PointList& points, double multiplier); - void setList(std::list<int> lst) { m_lst = lst; } - std::list<int> getList() { return m_lst; } + inline void setList(std::list<int> lst) { m_lst = lst; } + inline std::list<int> getList() { return m_lst; } private: std::list<int> m_lst; diff --git a/tests/libsample/mapuser.h b/tests/libsample/mapuser.h index c963743a..21bd226a 100644 --- a/tests/libsample/mapuser.h +++ b/tests/libsample/mapuser.h @@ -54,8 +54,8 @@ public: void showMap(std::map<std::string, int> mapping); - void setMap(std::map<std::string, std::list<int> > map) { m_map = map; } - std::map<std::string, std::list<int> > getMap() { return m_map; } + inline void setMap(std::map<std::string, std::list<int> > map) { m_map = map; } + inline std::map<std::string, std::list<int> > getMap() { return m_map; } private: std::map<std::string, std::list<int> > m_map; diff --git a/tests/libsample/modifications.h b/tests/libsample/modifications.h index d5c6d8eb..64841d63 100644 --- a/tests/libsample/modifications.h +++ b/tests/libsample/modifications.h @@ -56,26 +56,26 @@ public: // those overloaded methods should be heavily modified // to push the overload decisor to its limits - OverloadedModFunc overloaded(int a0, bool b0, int c0, double d0) { return Overloaded_ibid; } - OverloadedModFunc overloaded(int a1, bool b1, int c1, bool d1) { return Overloaded_ibib; } - OverloadedModFunc overloaded(int a2, bool b2, int c2, Point d2) { return Overloaded_ibiP; } - OverloadedModFunc overloaded(int a3, bool b3, int c3 = 123, int d3 = 456) { return Overloaded_ibii; } - OverloadedModFunc overloaded(int a4, bool b4, Point c4, Point d4) { return Overloaded_ibPP; } + inline OverloadedModFunc overloaded(int a0, bool b0, int c0, double d0) { return Overloaded_ibid; } + inline OverloadedModFunc overloaded(int a1, bool b1, int c1, bool d1) { return Overloaded_ibib; } + inline OverloadedModFunc overloaded(int a2, bool b2, int c2, Point d2) { return Overloaded_ibiP; } + inline OverloadedModFunc overloaded(int a3, bool b3, int c3 = 123, int d3 = 456) { return Overloaded_ibii; } + inline OverloadedModFunc overloaded(int a4, bool b4, Point c4, Point d4) { return Overloaded_ibPP; } - void argRemoval0(int a0, bool a1, int a2 = 123, int a3 = 456) {} - void argRemoval0(int a0, bool a1, int a2, bool a3) {} + inline void argRemoval0(int a0, bool a1, int a2 = 123, int a3 = 456) {} + inline void argRemoval0(int a0, bool a1, int a2, bool a3) {} - void argRemoval1(int a0, bool a1, Point a2 = Point(1, 2), Point a3 = Point(3, 4), int a4 = 333) {} - void argRemoval1(int a0, bool a1, int a2, bool a3) {} + inline void argRemoval1(int a0, bool a1, Point a2 = Point(1, 2), Point a3 = Point(3, 4), int a4 = 333) {} + inline void argRemoval1(int a0, bool a1, int a2, bool a3) {} - void argRemoval2(int a0, bool a1, Point a2 = Point(1, 2), Point a3 = Point(3, 4), int a4 = 333) {} + inline void argRemoval2(int a0, bool a1, Point a2 = Point(1, 2), Point a3 = Point(3, 4), int a4 = 333) {} - void argRemoval3(int a0, Point a1 = Point(1, 2), bool a2 = true, Point a3 = Point(3, 4), int a4 = 333) {} + inline void argRemoval3(int a0, Point a1 = Point(1, 2), bool a2 = true, Point a3 = Point(3, 4), int a4 = 333) {} - void argRemoval4(int a0, Point a1, bool a2, Point a3 = Point(3, 4), int a4 = 333) {} + inline void argRemoval4(int a0, Point a1, bool a2, Point a3 = Point(3, 4), int a4 = 333) {} - void argRemoval5(int a0, bool a1, Point a2 = Point(1, 2), Point a3 = Point(3, 4), int a4 = 333) {} - void argRemoval5(int a0, bool a1, int a2, bool a3) {} + inline void argRemoval5(int a0, bool a1, Point a2 = Point(1, 2), Point a3 = Point(3, 4), int a4 = 333) {} + inline void argRemoval5(int a0, bool a1, int a2, bool a3) {} // 'ok' must be removed and the return value will be changed // to a tuple (PyObject*) containing the expected result plus @@ -113,7 +113,7 @@ public: AbstractModifications() {} virtual ~AbstractModifications() {} - bool invert(bool value) { return !value; } + inline bool invert(bool value) { return !value; } // completely remove this method in Python virtual void pointlessPureVirtualMethod() = 0; diff --git a/tests/libsample/multiple_derived.h b/tests/libsample/multiple_derived.h index 576b263e..ffbe5feb 100644 --- a/tests/libsample/multiple_derived.h +++ b/tests/libsample/multiple_derived.h @@ -37,7 +37,7 @@ #include "libsamplemacros.h" -class LIBSAMPLE_API Base1 +class Base1 { public: Base1() : m_value(1) {} @@ -49,7 +49,7 @@ private: int m_value; }; -class LIBSAMPLE_API Base2 +class Base2 { public: Base2() : m_value(2) {} @@ -69,8 +69,8 @@ public: virtual int base1Method() { return Base1::base1Method() * 10; } virtual int base2Method() { return Base2::base2Method() * 10; } - Base1* castToBase1() { return (Base1*) this; } - Base2* castToBase2() { return (Base2*) this; } + inline Base1* castToBase1() { return (Base1*) this; } + inline Base2* castToBase2() { return (Base2*) this; } static MDerived1* transformFromBase1(Base1 *self); static MDerived1* transformFromBase2(Base2 *self); @@ -80,20 +80,20 @@ private: int m_value; }; -class LIBSAMPLE_API SonOfMDerived1 : public MDerived1 +class SonOfMDerived1 : public MDerived1 { public: SonOfMDerived1() : m_value(0) {} ~SonOfMDerived1() {} - MDerived1* castToMDerived1() { return (MDerived1*) this; } + inline MDerived1* castToMDerived1() { return (MDerived1*) this; } int sonOfMDerived1Method() { return m_value; } private: int m_value; }; -class LIBSAMPLE_API Base3 +class Base3 { public: explicit Base3(int val = 3) : m_value(val) {} @@ -103,7 +103,7 @@ private: int m_value; }; -class LIBSAMPLE_API Base4 +class Base4 { public: Base4() : m_value(4) {} @@ -113,7 +113,7 @@ private: int m_value; }; -class LIBSAMPLE_API Base5 +class Base5 { public: Base5() : m_value(5) {} @@ -123,7 +123,7 @@ private: int m_value; }; -class LIBSAMPLE_API Base6 +class Base6 { public: Base6() : m_value(6) {} @@ -140,13 +140,13 @@ public: MDerived2(); virtual ~MDerived2() {} - int base4Method() { return Base3::base3Method() * 10; } - int mderived2Method() { return m_value; } + inline int base4Method() { return Base3::base3Method() * 10; } + inline int mderived2Method() { return m_value; } - Base3* castToBase3() { return (Base3*) this; } - Base4* castToBase4() { return (Base4*) this; } - Base5* castToBase5() { return (Base5*) this; } - Base6* castToBase6() { return (Base6*) this; } + inline Base3* castToBase3() { return (Base3*) this; } + inline Base4* castToBase4() { return (Base4*) this; } + inline Base5* castToBase5() { return (Base5*) this; } + inline Base6* castToBase6() { return (Base6*) this; } private: int m_value; @@ -158,12 +158,12 @@ public: MDerived3(); virtual ~MDerived3() {} - virtual int mderived3Method() { return m_value; } + inline virtual int mderived3Method() { return m_value; } - MDerived1* castToMDerived1() { return (MDerived1*) this; } - MDerived2* castToMDerived2() { return (MDerived2*) this; } + inline MDerived1* castToMDerived1() { return (MDerived1*) this; } + inline MDerived2* castToMDerived2() { return (MDerived2*) this; } - Base3* castToBase3() { return (Base3*) this; } + inline Base3* castToBase3() { return (Base3*) this; } private: int m_value; @@ -175,10 +175,10 @@ public: MDerived4(); ~MDerived4() {} - int mderived4Method() { return 0; } + inline int mderived4Method() { return 0; } - Base3* castToBase3() { return (Base3*) this; } - Base4* castToBase4() { return (Base4*) this; } + inline Base3* castToBase3() { return (Base3*) this; } + inline Base4* castToBase4() { return (Base4*) this; } private: int m_value; }; @@ -191,8 +191,8 @@ public: virtual int mderived5Method() { return 0; } - Base3* castToBase3() { return (Base3*) this; } - Base4* castToBase4() { return (Base4*) this; } + inline Base3* castToBase3() { return (Base3*) this; } + inline Base4* castToBase4() { return (Base4*) this; } }; #endif // MDERIVED_H diff --git a/tests/libsample/noimplicitconversion.h b/tests/libsample/noimplicitconversion.h index 7b3e898a..89010f42 100644 --- a/tests/libsample/noimplicitconversion.h +++ b/tests/libsample/noimplicitconversion.h @@ -39,14 +39,14 @@ // This class must not have implicit conversions AND // no conversion operators should be defined in its own module. -class LIBSAMPLE_API NoImplicitConversion +class NoImplicitConversion { public: explicit NoImplicitConversion(int objId) : m_objId(objId) {} - int objId() const { return m_objId; } - static int receivesNoImplicitConversionByValue(NoImplicitConversion arg) { return arg.m_objId; } - static int receivesNoImplicitConversionByPointer(NoImplicitConversion* arg) { return arg->m_objId; } - static int receivesNoImplicitConversionByReference(NoImplicitConversion& arg) { return arg.m_objId; } + inline int objId() const { return m_objId; } + inline static int receivesNoImplicitConversionByValue(NoImplicitConversion arg) { return arg.m_objId; } + inline static int receivesNoImplicitConversionByPointer(NoImplicitConversion* arg) { return arg->m_objId; } + inline static int receivesNoImplicitConversionByReference(NoImplicitConversion& arg) { return arg.m_objId; } private: int m_objId; }; diff --git a/tests/libsample/nondefaultctor.h b/tests/libsample/nondefaultctor.h index cd4f6eac..ea0d6dfa 100644 --- a/tests/libsample/nondefaultctor.h +++ b/tests/libsample/nondefaultctor.h @@ -37,7 +37,7 @@ #include "libsamplemacros.h" -class LIBSAMPLE_API NonDefaultCtor +class NonDefaultCtor { int m_value; public: @@ -45,22 +45,22 @@ public: { } - int value() + inline int value() { return m_value; } - NonDefaultCtor returnMyself() + inline NonDefaultCtor returnMyself() { return *this; } - NonDefaultCtor returnMyself(int) + inline NonDefaultCtor returnMyself(int) { return *this; } - NonDefaultCtor returnMyself(int, NonDefaultCtor) + inline NonDefaultCtor returnMyself(int, NonDefaultCtor) { return *this; } @@ -70,7 +70,7 @@ public: return *this; } - NonDefaultCtor callReturnMyselfVirtual() + inline NonDefaultCtor callReturnMyselfVirtual() { return returnMyselfVirtual(); } diff --git a/tests/libsample/objecttype.h b/tests/libsample/objecttype.h index 9c0bb212..34142185 100644 --- a/tests/libsample/objecttype.h +++ b/tests/libsample/objecttype.h @@ -41,7 +41,7 @@ #include "libsamplemacros.h" -struct LIBSAMPLE_API Event +struct Event { enum EventType { NO_EVENT, @@ -67,12 +67,12 @@ public: virtual ~ObjectType(); // factory method - static ObjectType* create() { return new ObjectType(); } + inline static ObjectType* create() { return new ObjectType(); } static ObjectType* createWithChild(); void setParent(ObjectType* parent); - ObjectType* parent() const { return m_parent; } - const ObjectTypeList& children() const { return m_children; } + inline ObjectType* parent() const { return m_parent; } + inline const ObjectTypeList& children() const { return m_children; } void killChild(const Str& name); void removeChild(ObjectType* child); ObjectType* takeChild(ObjectType* child); @@ -82,7 +82,7 @@ public: Str objectName() const; void setObjectName(const Str& name); - unsigned long identifier() const { return reinterpret_cast<unsigned long>(this); } + inline unsigned long identifier() const { return reinterpret_cast<unsigned long>(this); } bool causeEvent(Event::EventType eventType); @@ -93,7 +93,7 @@ public: // This nonsense method emulate QWidget.setLayout method // All layout objects will became children of this object. void setLayout(ObjectTypeLayout* layout); - ObjectTypeLayout* layout() const { return m_layout; } + inline ObjectTypeLayout* layout() const { return m_layout; } // This method should be reimplemented by ObjectTypeLayout. virtual bool isLayoutType() { return false; } diff --git a/tests/libsample/objecttypelayout.h b/tests/libsample/objecttypelayout.h index 1f05b749..8473bb07 100644 --- a/tests/libsample/objecttypelayout.h +++ b/tests/libsample/objecttypelayout.h @@ -48,7 +48,7 @@ public: std::list<ObjectType*> objects() const; virtual bool isLayoutType() { return true; } - static ObjectTypeLayout* create() { return new ObjectTypeLayout(); } + inline static ObjectTypeLayout* create() { return new ObjectTypeLayout(); } virtual ObjectType* takeChild(const Str& name) { return ObjectType::takeChild(name); } private: diff --git a/tests/libsample/objectview.h b/tests/libsample/objectview.h index ae65d98d..08530035 100644 --- a/tests/libsample/objectview.h +++ b/tests/libsample/objectview.h @@ -47,8 +47,8 @@ public: : ObjectType(parent), m_model(model) {} - void setModel(ObjectType* model) { m_model = model; } - ObjectType* model() const { return m_model; } + inline void setModel(ObjectType* model) { m_model = model; } + inline ObjectType* model() const { return m_model; } Str displayModelData(); void modifyModelData(Str& data); diff --git a/tests/libsample/oddbool.h b/tests/libsample/oddbool.h index 47f0edb9..e4689476 100644 --- a/tests/libsample/oddbool.h +++ b/tests/libsample/oddbool.h @@ -37,7 +37,7 @@ #include "libsamplemacros.h" -class LIBSAMPLE_API OddBool +class OddBool { public: @@ -57,21 +57,21 @@ inline bool operator!=(OddBool b1, bool b2) { return !b1 != !b2; } inline bool operator!=(bool b1, OddBool b2) { return !b1 != !b2; } inline bool operator!=(OddBool b1, OddBool b2) { return !b1 != !b2; } -class LIBSAMPLE_API OddBoolUser +class OddBoolUser { public: OddBoolUser() : m_oddbool(OddBool(false)) {} virtual ~OddBoolUser() {} - OddBool oddBool() { return m_oddbool; } - void setOddBool(OddBool oddBool) { m_oddbool = oddBool; } + inline OddBool oddBool() { return m_oddbool; } + inline void setOddBool(OddBool oddBool) { m_oddbool = oddBool; } virtual OddBool invertedOddBool() { return !m_oddbool; } - OddBool callInvertedOddBool() + inline OddBool callInvertedOddBool() { return invertedOddBool(); } diff --git a/tests/libsample/overload.h b/tests/libsample/overload.h index 62687315..dbce9de8 100644 --- a/tests/libsample/overload.h +++ b/tests/libsample/overload.h @@ -63,12 +63,12 @@ public: FunctionEnum overloaded(Point* point, ParamEnum param); FunctionEnum overloaded(const Point& point); - void differentReturnTypes(ParamEnum param = Param0) {} - int differentReturnTypes(ParamEnum param, int val) { return val; } + inline void differentReturnTypes(ParamEnum param = Param0) {} + inline int differentReturnTypes(ParamEnum param, int val) { return val; } - int intOverloads(const Point& p, double d) { return 1; } - int intOverloads(int i, int i2) { return 2; } - int intOverloads(int i, int removedArg, double d) { return 3; } + inline int intOverloads(const Point& p, double d) { return 1; } + inline int intOverloads(int i, int i2) { return 2; } + inline int intOverloads(int i, int removedArg, double d) { return 3; } }; #endif // OVERLOAD_H diff --git a/tests/libsample/overloadsort.h b/tests/libsample/overloadsort.h index 3deeaf45..83ab0430 100644 --- a/tests/libsample/overloadsort.h +++ b/tests/libsample/overloadsort.h @@ -39,48 +39,48 @@ #include <list> -class LIBSAMPLE_API ImplicitTarget +class ImplicitTarget { public: ImplicitTarget(){} }; -class LIBSAMPLE_API ImplicitBase +class ImplicitBase { public: ImplicitBase(){} ImplicitBase(const ImplicitTarget &b){} }; -class LIBSAMPLE_API SortedOverload +class SortedOverload { public: - const char *overload(int x) { + inline const char *overload(int x) { return "int"; } - const char *overload(double x) { + inline const char *overload(double x) { return "double"; } - const char *overload(ImplicitBase x) { + inline const char *overload(ImplicitBase x) { return "ImplicitBase"; } - const char *overload(ImplicitTarget x) { + inline const char *overload(ImplicitTarget x) { return "ImplicitTarget"; } - const char *overload(const std::list<ImplicitBase> &x) { + inline const char *overload(const std::list<ImplicitBase> &x) { return "list(ImplicitBase)"; } - int implicit_overload(const ImplicitBase &x) { + inline int implicit_overload(const ImplicitBase &x) { return 1; } - const char *overloadDeep(int x, ImplicitBase &y) { + inline const char *overloadDeep(int x, ImplicitBase &y) { return "ImplicitBase"; } }; diff --git a/tests/libsample/pairuser.h b/tests/libsample/pairuser.h index 8a3cb7a9..6e42f44c 100644 --- a/tests/libsample/pairuser.h +++ b/tests/libsample/pairuser.h @@ -51,8 +51,8 @@ public: static std::pair<Complex, Complex> createComplexPair(Complex cpx0, Complex cpx1); double sumPair(std::pair<int, double> pair); - void setPair(std::pair<int, int> pair) { m_pair = pair; } - std::pair<int, int> getPair() { return m_pair; } + inline void setPair(std::pair<int, int> pair) { m_pair = pair; } + inline std::pair<int, int> getPair() { return m_pair; } private: std::pair<int, int> m_pair; diff --git a/tests/libsample/point.h b/tests/libsample/point.h index a8175039..585f9499 100644 --- a/tests/libsample/point.h +++ b/tests/libsample/point.h @@ -47,16 +47,16 @@ public: Point(double x, double y); ~Point() {} - double x() const { return m_x; } - double y() const { return m_y; } + inline double x() const { return m_x; } + inline double y() const { return m_y; } - void setX(double x) { m_x = x; } - void setY(double y) { m_y = y; } + inline void setX(double x) { m_x = x; } + inline void setY(double y) { m_y = y; } Point* copy() const; - const Point& getConstReferenceToSelf() const { return *this; } - const Point* getSelf() const { return this; } + inline const Point& getConstReferenceToSelf() const { return *this; } + inline const Point* getSelf() const { return this; } // The != operator is not implemented for the purpose of testing // for the absense of the __ne__ method in the Python binding. diff --git a/tests/libsample/pointerholder.h b/tests/libsample/pointerholder.h index 7d465451..cf11cad7 100644 --- a/tests/libsample/pointerholder.h +++ b/tests/libsample/pointerholder.h @@ -37,12 +37,12 @@ #include "libsamplemacros.h" -class LIBSAMPLE_API PointerHolder +class PointerHolder { public: explicit PointerHolder(void* ptr) : m_pointer(ptr) {} ~PointerHolder() {} - void* pointer() const { return m_pointer; } + inline void* pointer() const { return m_pointer; } private: void* m_pointer; }; diff --git a/tests/libsample/polygon.h b/tests/libsample/polygon.h index 289be29b..9d341a65 100644 --- a/tests/libsample/polygon.h +++ b/tests/libsample/polygon.h @@ -53,7 +53,7 @@ public: void addPoint(Point point); - const PointList& points() const { return m_points; } + inline const PointList& points() const { return m_points; } // This method intentionally receives and returns copies of a Polygon object. static Polygon doublePolygonScale(Polygon polygon); diff --git a/tests/libsample/privatector.h b/tests/libsample/privatector.h index 5591f15f..674a2052 100644 --- a/tests/libsample/privatector.h +++ b/tests/libsample/privatector.h @@ -37,17 +37,17 @@ #include "libsamplemacros.h" -class LIBSAMPLE_API PrivateCtor +class PrivateCtor { public: - static PrivateCtor* instance() + inline static PrivateCtor* instance() { static PrivateCtor self; self.m_instanciations++; return &self; } - int instanceCalls() + inline int instanceCalls() { return m_instanciations; } diff --git a/tests/libsample/privatedtor.h b/tests/libsample/privatedtor.h index 73f7f4d8..0bc8c2f7 100644 --- a/tests/libsample/privatedtor.h +++ b/tests/libsample/privatedtor.h @@ -37,23 +37,23 @@ #include "libsamplemacros.h" -class LIBSAMPLE_API PrivateDtor +class PrivateDtor { public: - static PrivateDtor* instance() + inline static PrivateDtor* instance() { static PrivateDtor self; self.m_instanciations++; return &self; } - int instanceCalls() + inline int instanceCalls() { return m_instanciations; } protected: - int protectedInstanceCalls() { return m_instanciations; } + inline int protectedInstanceCalls() { return m_instanciations; } private: int m_instanciations; diff --git a/tests/libsample/protected.h b/tests/libsample/protected.h index 0d1ead61..4bb26b50 100644 --- a/tests/libsample/protected.h +++ b/tests/libsample/protected.h @@ -38,22 +38,21 @@ #include "libsamplemacros.h" #include <string> -class LIBSAMPLE_API ProtectedNonPolymorphic +class ProtectedNonPolymorphic { public: explicit ProtectedNonPolymorphic(const char *name) : m_name(name) {} ~ProtectedNonPolymorphic() {} - const char* publicName() { return m_name.c_str(); } + inline const char* publicName() { return m_name.c_str(); } - static ProtectedNonPolymorphic* create() { return new ProtectedNonPolymorphic("created"); } + inline static ProtectedNonPolymorphic* create() { return new ProtectedNonPolymorphic("created"); } protected: - const char* protectedName() { return m_name.c_str(); } - int protectedSum(int a0, int a1) { return a0 + a1; } - int modifiedProtectedSum(int a0, int a1) { return a0 + a1; } - static const char* protectedStatic() { return "protectedStatic"; } - + inline const char* protectedName() { return m_name.c_str(); } + inline int protectedSum(int a0, int a1) { return a0 + a1; } + inline int modifiedProtectedSum(int a0, int a1) { return a0 + a1; } + inline static const char* protectedStatic() { return "protectedStatic"; } inline const char* dataTypeName(void *data = 0) const { return "pointer"; } inline const char* dataTypeName(int data) const { return "integer"; } @@ -61,17 +60,15 @@ private: std::string m_name; }; -class LIBSAMPLE_API ProtectedPolymorphic +class ProtectedPolymorphic { public: explicit ProtectedPolymorphic(const char *name) : m_name(name) {} virtual ~ProtectedPolymorphic() {} - const char* publicName() { return m_name.c_str(); } - - static ProtectedPolymorphic* create() { return new ProtectedPolymorphic("created"); } - - const char* callProtectedName() { return protectedName(); } + inline static ProtectedPolymorphic* create() { return new ProtectedPolymorphic("created"); } + inline const char* publicName() { return m_name.c_str(); } + inline const char* callProtectedName() { return protectedName(); } protected: virtual const char* protectedName() { return m_name.c_str(); } @@ -80,34 +77,34 @@ private: std::string m_name; }; -class LIBSAMPLE_API ProtectedPolymorphicDaughter : public ProtectedPolymorphic +class ProtectedPolymorphicDaughter : public ProtectedPolymorphic { public: explicit ProtectedPolymorphicDaughter(const char *name) : ProtectedPolymorphic(name) {} - static ProtectedPolymorphicDaughter* create() { return new ProtectedPolymorphicDaughter("created"); } + inline static ProtectedPolymorphicDaughter* create() { return new ProtectedPolymorphicDaughter("created"); } }; -class LIBSAMPLE_API ProtectedPolymorphicGrandDaughter: public ProtectedPolymorphicDaughter +class ProtectedPolymorphicGrandDaughter: public ProtectedPolymorphicDaughter { public: explicit ProtectedPolymorphicGrandDaughter(const char *name) : ProtectedPolymorphicDaughter(name) {} - static ProtectedPolymorphicGrandDaughter* create() { return new ProtectedPolymorphicGrandDaughter("created"); } + inline static ProtectedPolymorphicGrandDaughter* create() { return new ProtectedPolymorphicGrandDaughter("created"); } }; class LIBSAMPLE_API ProtectedVirtualDestructor { public: ProtectedVirtualDestructor() {} - static ProtectedVirtualDestructor* create() { return new ProtectedVirtualDestructor(); } - static int dtorCalled() { return dtor_called; } - static void resetDtorCounter() { dtor_called = 0; } + inline static ProtectedVirtualDestructor* create() { return new ProtectedVirtualDestructor(); } + inline static int dtorCalled() { return dtor_called; } + inline static void resetDtorCounter() { dtor_called = 0; } protected: virtual ~ProtectedVirtualDestructor() { dtor_called++; } private: static int dtor_called; }; -class LIBSAMPLE_API ProtectedEnumClass +class ProtectedEnumClass { public: ProtectedEnumClass() {} @@ -122,13 +119,14 @@ protected: ProtectedItem1 }; ProtectedEnum callProtectedEnumMethod(ProtectedEnum in) { return protectedEnumMethod(in); } + inline PublicEnum callPublicEnumMethod(PublicEnum in) { return publicEnumMethod(in); } + virtual ProtectedEnum protectedEnumMethod(ProtectedEnum in) { return in; } - PublicEnum callPublicEnumMethod(PublicEnum in) { return publicEnumMethod(in); } virtual PublicEnum publicEnumMethod(PublicEnum in) { return in; } }; -class LIBSAMPLE_API ProtectedProperty +class ProtectedProperty { public: ProtectedProperty() : protectedProperty(0) {} diff --git a/tests/libsample/reference.h b/tests/libsample/reference.h index 1a95ad2c..5f9c20c4 100644 --- a/tests/libsample/reference.h +++ b/tests/libsample/reference.h @@ -44,11 +44,11 @@ public: : m_objId(objId) {} virtual ~Reference() {} - int objId() { return m_objId; } - void setObjId(int objId) { m_objId = objId; } + inline int objId() { return m_objId; } + inline void setObjId(int objId) { m_objId = objId; } - static int usesReference(Reference& r) { return r.m_objId; } - static int usesConstReference(const Reference& r) { return r.m_objId; } + inline static int usesReference(Reference& r) { return r.m_objId; } + inline static int usesConstReference(const Reference& r) { return r.m_objId; } virtual int usesReferenceVirtual(Reference& r, int inc); virtual int usesConstReferenceVirtual(const Reference& r, int inc); @@ -61,7 +61,7 @@ public: void show() const; - static int multiplier() { return 10; } + inline static int multiplier() { return 10; } private: int m_objId; diff --git a/tests/libsample/samplenamespace.h b/tests/libsample/samplenamespace.h index 0456c56e..8a6cd1a4 100644 --- a/tests/libsample/samplenamespace.h +++ b/tests/libsample/samplenamespace.h @@ -74,7 +74,7 @@ LIBSAMPLE_API void doSomethingWithArray(const unsigned char* data, unsigned int LIBSAMPLE_API int enumItemAsDefaultValueToIntArgument(int value = ZeroIn); -class SomeClass +class LIBSAMPLE_API SomeClass { public: class SomeInnerClass @@ -88,17 +88,17 @@ public: NiceValue1, NiceValue2 }; - int someMethod(SomeInnerClass*) { return 0; } + inline int someMethod(SomeInnerClass*) { return 0; } virtual OkThisIsRecursiveEnough* someVirtualMethod(OkThisIsRecursiveEnough* arg) { return arg; } }; }; }; -class DerivedFromNamespace : public SomeClass::SomeInnerClass::OkThisIsRecursiveEnough +class LIBSAMPLE_API DerivedFromNamespace : public SomeClass::SomeInnerClass::OkThisIsRecursiveEnough { public: virtual OkThisIsRecursiveEnough* someVirtualMethod(OkThisIsRecursiveEnough* arg) { return arg; } - OkThisIsRecursiveEnough* methodReturningTypeFromParentScope() { return 0; } + inline OkThisIsRecursiveEnough* methodReturningTypeFromParentScope() { return 0; } }; // The combination of the following two overloaded methods could trigger a diff --git a/tests/libsample/size.h b/tests/libsample/size.h index a1431a8b..c5bf2b5c 100644 --- a/tests/libsample/size.h +++ b/tests/libsample/size.h @@ -43,12 +43,12 @@ public: Size(double width = 0.0, double height = 0.0) : m_width(width), m_height(height) {} ~Size() {} - double width() { return m_width; } - void setWidth(double width) { m_width = width; } - double height() { return m_height; } - void setHeight(double height) { m_height = height; } + inline double width() { return m_width; } + inline void setWidth(double width) { m_width = width; } + inline double height() { return m_height; } + inline void setHeight(double height) { m_height = height; } - double calculateArea() const { return m_width * m_height; } + inline double calculateArea() const { return m_width * m_height; } // Comparison Operators inline bool operator==(const Size& other) @@ -92,28 +92,28 @@ public: inline bool operator>=(double area) { return calculateArea() >= area; } // Arithmetic Operators - Size& operator+=(const Size& s) + inline Size& operator+=(const Size& s) { m_width += s.m_width; m_height += s.m_height; return *this; } - Size& operator-=(const Size& s) + inline Size& operator-=(const Size& s) { m_width -= s.m_width; m_height -= s.m_height; return *this; } - Size& operator*=(double mult) + inline Size& operator*=(double mult) { m_width *= mult; m_height *= mult; return *this; } - Size& operator/=(double div) + inline Size& operator/=(double div) { m_width /= div; m_height /= div; diff --git a/tests/libsample/sometime.h b/tests/libsample/sometime.h index 6f20425e..d6799871 100644 --- a/tests/libsample/sometime.h +++ b/tests/libsample/sometime.h @@ -59,12 +59,12 @@ public: ~Time() {} - bool isNull() const { return m_is_null; } + inline bool isNull() const { return m_is_null; } - int hour() const { return m_hour; } - int minute() const { return m_minute; } - int second() const { return m_second; } - int msec() const { return m_msec; } + inline int hour() const { return m_hour; } + inline int minute() const { return m_minute; } + inline int second() const { return m_second; } + inline int msec() const { return m_msec; } void setTime(); void setTime(int h, int m, int s = 0, int ms = 0); diff --git a/tests/libsample/str.h b/tests/libsample/str.h index 7d5f0e63..9675d4ec 100644 --- a/tests/libsample/str.h +++ b/tests/libsample/str.h @@ -59,7 +59,7 @@ public: void show() const; - int size() const { return m_str.size(); } + inline int size() const { return m_str.size(); } // nonsense operator just to test reverse operators Str operator+(int number) const; diff --git a/tests/libsample/strlist.h b/tests/libsample/strlist.h index 85b74646..334c868f 100644 --- a/tests/libsample/strlist.h +++ b/tests/libsample/strlist.h @@ -48,7 +48,7 @@ public: inline StrList(const StrList& lst) : std::list<Str>(lst) { } inline StrList(const std::list<Str>& lst) : std::list<Str>(lst) { } - void append(Str str) { push_back(str); } + inline void append(Str str) { push_back(str); } Str join(const Str& sep) const; bool operator==(const std::list<Str>& other) const; diff --git a/tests/libsample/voidholder.h b/tests/libsample/voidholder.h index 02c446d0..032c9531 100644 --- a/tests/libsample/voidholder.h +++ b/tests/libsample/voidholder.h @@ -37,13 +37,13 @@ #include "libsamplemacros.h" -class LIBSAMPLE_API VoidHolder +class VoidHolder { public: explicit VoidHolder(void* ptr = 0) : m_ptr(ptr) {} ~VoidHolder() {} - void* voidPointer() { return m_ptr; } - static void* gimmeMeSomeVoidPointer() + inline void* voidPointer() { return m_ptr; } + inline static void* gimmeMeSomeVoidPointer() { static void* pointerToSomething = new VoidHolder(); return pointerToSomething; diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index b3e05d4e..f23320cc 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -757,7 +757,7 @@ <conversion-rule class="native"> int numItems = PySequence_Size(%PYARG_1); - int %out[numItems]; + int *%out = new int[numItems]; //memory leak for (int i=0; i < numItems; i++) { %out[i] = %CONVERTTOCPP[int](PySequence_GetItem(%PYARG_1, i)); } |