summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2021-03-26 10:19:57 +1300
committerOlly Betts <olly@survex.com>2021-03-26 10:19:57 +1300
commit3fba8e7daa24c23c56ce6d7451831fc8f6961851 (patch)
treec3e5288c9d61f6db622085fb490f261110345b70
parentc882f39e3c6923adf4850c999a271fc4f6751d4b (diff)
downloadswig-3fba8e7daa24c23c56ce6d7451831fc8f6961851.tar.gz
php: Trim trailing whitespace from PHP typemaps
-rw-r--r--Lib/php/factory.i64
-rw-r--r--Lib/php/phprun.swg4
-rw-r--r--Lib/php/std_common.i1
-rw-r--r--Lib/php/std_map.i2
-rw-r--r--Lib/php/std_vector.i2
-rw-r--r--Lib/php/stl.i1
6 files changed, 35 insertions, 39 deletions
diff --git a/Lib/php/factory.i b/Lib/php/factory.i
index c4e082dd2..b47b4791a 100644
--- a/Lib/php/factory.i
+++ b/Lib/php/factory.i
@@ -3,41 +3,41 @@
you have:
---- geometry.h --------
- struct Geometry {
- enum GeomType{
- POINT,
- CIRCLE
- };
-
- virtual ~Geometry() {}
+ struct Geometry {
+ enum GeomType{
+ POINT,
+ CIRCLE
+ };
+
+ virtual ~Geometry() {}
virtual int draw() = 0;
-
+
//
// Factory method for all the Geometry objects
//
- static Geometry *create(GeomType i);
- };
-
- struct Point : Geometry {
- int draw() { return 1; }
- double width() { return 1.0; }
- };
-
- struct Circle : Geometry {
- int draw() { return 2; }
- double radius() { return 1.5; }
- };
-
+ static Geometry *create(GeomType i);
+ };
+
+ struct Point : Geometry {
+ int draw() { return 1; }
+ double width() { return 1.0; }
+ };
+
+ struct Circle : Geometry {
+ int draw() { return 2; }
+ double radius() { return 1.5; }
+ };
+
//
// Factory method for all the Geometry objects
//
Geometry *Geometry::create(GeomType type) {
- switch (type) {
- case POINT: return new Point();
- case CIRCLE: return new Circle();
- default: return 0;
- }
- }
+ switch (type) {
+ case POINT: return new Point();
+ case CIRCLE: return new Circle();
+ default: return 0;
+ }
+ }
---- geometry.h --------
@@ -57,16 +57,16 @@
NOTES: remember to fully qualify all the type names and don't
use %factory inside a namespace declaration, ie, instead of
-
+
namespace Foo {
%factory(Geometry *Geometry::create, Point, Circle);
}
use
- %factory(Foo::Geometry *Foo::Geometry::create, Foo::Point, Foo::Circle);
+ %factory(Foo::Geometry *Foo::Geometry::create, Foo::Point, Foo::Circle);
+
-
*/
/* for loop for macro with one argument */
@@ -90,13 +90,13 @@
/* for loop for macro with two arguments */
%define %formacro_2(macro,...)%_formacro_2(macro, __VA_ARGS__, __fordone__)%enddef
-%define %_factory_dispatch(Type)
+%define %_factory_dispatch(Type)
if (!dcast) {
Type *dobj = dynamic_cast<Type *>($1);
if (dobj) {
dcast = 1;
SWIG_SetPointerZval(return_value, SWIG_as_voidptr(dobj),$descriptor(Type *), $owner);
- }
+ }
}%enddef
%define %factory(Method,Types...)
diff --git a/Lib/php/phprun.swg b/Lib/php/phprun.swg
index 049198787..44f1087bf 100644
--- a/Lib/php/phprun.swg
+++ b/Lib/php/phprun.swg
@@ -152,7 +152,7 @@ SWIG_ConvertResourceData(void * p, const char *type_name, swig_type_info *ty) {
return p;
}
- if (! type_name) {
+ if (! type_name) {
/* can't convert p to ptr type ty if we don't know what type p is */
return NULL;
}
@@ -237,7 +237,7 @@ static swig_module_info *SWIG_Php_GetModule() {
if (Z_TYPE_P(pointer) == IS_LONG) {
return (swig_module_info *) pointer->value.lval;
}
- }
+ }
return NULL;
}
diff --git a/Lib/php/std_common.i b/Lib/php/std_common.i
index 092bf012b..1b69fc779 100644
--- a/Lib/php/std_common.i
+++ b/Lib/php/std_common.i
@@ -7,4 +7,3 @@
%include <std/std_except.i>
%apply size_t { std::size_t };
-
diff --git a/Lib/php/std_map.i b/Lib/php/std_map.i
index 7c0157353..fed3cf0b3 100644
--- a/Lib/php/std_map.i
+++ b/Lib/php/std_map.i
@@ -35,7 +35,7 @@ namespace std {
map();
map(const map& other);
-
+
unsigned int size() const;
void clear();
%extend {
diff --git a/Lib/php/std_vector.i b/Lib/php/std_vector.i
index e633bc3ad..382b37ca0 100644
--- a/Lib/php/std_vector.i
+++ b/Lib/php/std_vector.i
@@ -112,5 +112,3 @@ namespace std {
%define specialize_std_vector(T)
#warning "specialize_std_vector - specialization for type T no longer needed"
%enddef
-
-
diff --git a/Lib/php/stl.i b/Lib/php/stl.i
index 04f86014f..38aba67b8 100644
--- a/Lib/php/stl.i
+++ b/Lib/php/stl.i
@@ -7,4 +7,3 @@
%include <std_vector.i>
%include <std_map.i>
%include <std_pair.i>
-