diff --git a/Doc/Manual/Java.html b/Doc/Manual/Java.html index e0178465c..e21440ee9 100644 --- a/Doc/Manual/Java.html +++ b/Doc/Manual/Java.html @@ -5278,7 +5278,7 @@ void * operator new(size_t t) { throw bad_alloc(); pJalloc->ref = 0; return static_cast<void *>( - static_cast<char *>(static_cast<void *>(pJalloc)) + sizeof(Jalloc)); + static_cast<char *>(static_cast<void *>(pJalloc)) + sizeof(Jalloc)); } } @@ -7240,7 +7240,7 @@ public class runme { example.print_args(animals); String args[] = example.get_args(); for (int i=0; i<args.length; i++) - System.out.println(i + ":" + args[i]); + System.out.println(i + ":" + args[i]); } } diff --git a/Doc/Manual/Lua.html b/Doc/Manual/Lua.html index c94fe31dc..c5c944225 100644 --- a/Doc/Manual/Lua.html +++ b/Doc/Manual/Lua.html @@ -1008,11 +1008,10 @@ The following operators cannot be overloaded (mainly because they are not suppor
SWIG also accepts the __str__() member function which converts an object to a string. This function should return a const char*, preferably to static memory. This will be used for the print() and tostring() functions in Lua. Assuming the complex class has a function
-const char* __str__()
-{
- static char buffer[255];
- sprintf(buffer, "Complex(%g, %g)", this->re(), this->im());
- return buffer;
+const char* __str__() {
+ static char buffer[255];
+ sprintf(buffer, "Complex(%g, %g)", this->re(), this->im());
+ return buffer;
}
@@ -1031,11 +1030,10 @@ Complex(10, 12)
It is also possible to overload the operator[], but currently this cannot be automatically performed. To overload the operator[] you need to provide two functions, __getitem__() and __setitem__()
-class Complex
-{
- //....
- double __getitem__(int i)const; // i is the index, returns the data
- void __setitem__(int i, double d); // i is the index, d is the data
+class Complex {
+ //....
+ double __getitem__(int i)const; // i is the index, returns the data
+ void __setitem__(int i, double d); // i is the index, d is the data
};
diff --git a/Doc/Manual/Perl5.html b/Doc/Manual/Perl5.html
index 96e9f7517..03f2c7048 100644
--- a/Doc/Manual/Perl5.html
+++ b/Doc/Manual/Perl5.html
@@ -3279,9 +3279,9 @@ suffice in most cases:
%feature("director:except") {
- if ($error != NULL) {
- throw Swig::DirectorMethodException();
- }
+ if ($error != NULL) {
+ throw Swig::DirectorMethodException();
+ }
}
diff --git a/Doc/Manual/Php.html b/Doc/Manual/Php.html
index 7d3d33ac1..c4ba2e3f8 100644
--- a/Doc/Manual/Php.html
+++ b/Doc/Manual/Php.html
@@ -1175,9 +1175,9 @@ should suffice in most cases:
%feature("director:except") {
- if ($error == FAILURE) {
- throw Swig::DirectorMethodException();
- }
+ if ($error == FAILURE) {
+ throw Swig::DirectorMethodException();
+ }
}
diff --git a/Doc/Manual/Python.html b/Doc/Manual/Python.html
index 1b73c08b7..169151d47 100644
--- a/Doc/Manual/Python.html
+++ b/Doc/Manual/Python.html
@@ -226,16 +226,15 @@ resulting C file should be built as a python extension, inserting the module
#include "example.h"
int fact(int n) {
- if (n < 0){ /* This should probably return an error, but this is simpler */
- return 0;
- }
- if (n == 0) {
- return 1;
- }
- else {
- /* testing for overflow would be a good idea here */
- return n * fact(n-1);
- }
+ if (n < 0) { /* This should probably return an error, but this is simpler */
+ return 0;
+ }
+ if (n == 0) {
+ return 1;
+ } else {
+ /* testing for overflow would be a good idea here */
+ return n * fact(n-1);
+ }
}
@@ -3133,9 +3132,9 @@ suffice in most cases:
%feature("director:except") {
- if ($error != NULL) {
- throw Swig::DirectorMethodException();
- }
+ if ($error != NULL) {
+ throw Swig::DirectorMethodException();
+ }
}
@@ -4142,11 +4141,11 @@ Sometimes a C function expects an array to be passed as a pointer. For example,
int sumitems(int *first, int nitems) {
- int i, sum = 0;
- for (i = 0; i < nitems; i++) {
- sum += first[i];
- }
- return sum;
+ int i, sum = 0;
+ for (i = 0; i < nitems; i++) {
+ sum += first[i];
+ }
+ return sum;
}
@@ -6526,7 +6525,7 @@ string that cannot be completely decoded as UTF-8:
%inline %{
const char* non_utf8_c_str(void) {
- return "h\xe9llo w\xc3\xb6rld";
+ return "h\xe9llo w\xc3\xb6rld";
}
%}
diff --git a/Doc/Manual/SWIG.html b/Doc/Manual/SWIG.html
index e5b441fbb..b1cb1b4dd 100644
--- a/Doc/Manual/SWIG.html
+++ b/Doc/Manual/SWIG.html
@@ -1266,12 +1266,12 @@ pointers. As a result, SWIG creates a wrapper like this:
Vector *wrap_cross_product(Vector *v1, Vector *v2) {
- Vector x = *v1;
- Vector y = *v2;
- Vector *result;
- result = (Vector *) malloc(sizeof(Vector));
- *(result) = cross(x, y);
- return result;
+ Vector x = *v1;
+ Vector y = *v2;
+ Vector *result;
+ result = (Vector *) malloc(sizeof(Vector));
+ *(result) = cross(x, y);
+ return result;
}
@@ -1280,10 +1280,10 @@ or if SWIG was run with the -c++ option:
Vector *wrap_cross(Vector *v1, Vector *v2) {
- Vector x = *v1;
- Vector y = *v2;
- Vector *result = new Vector(cross(x, y)); // Uses default copy constructor
- return result;
+ Vector x = *v1;
+ Vector y = *v2;
+ Vector *result = new Vector(cross(x, y)); // Uses default copy constructor
+ return result;
}
diff --git a/Doc/Manual/SWIGPlus.html b/Doc/Manual/SWIGPlus.html
index b22f1c279..5841c7d43 100644
--- a/Doc/Manual/SWIGPlus.html
+++ b/Doc/Manual/SWIGPlus.html
@@ -2958,29 +2958,29 @@ To illustrate, consider the following template definition:
template<class T> class List {
private:
- T *data;
- int nitems;
- int maxitems;
+ T *data;
+ int nitems;
+ int maxitems;
public:
- List(int max) {
- data = new T [max];
- nitems = 0;
- maxitems = max;
- }
- ~List() {
- delete [] data;
- };
- void append(T obj) {
- if (nitems < maxitems) {
- data[nitems++] = obj;
- }
- }
- int length() {
- return nitems;
- }
- T get(int n) {
- return data[n];
+ List(int max) {
+ data = new T [max];
+ nitems = 0;
+ maxitems = max;
+ }
+ ~List() {
+ delete [] data;
+ };
+ void append(T obj) {
+ if (nitems < maxitems) {
+ data[nitems++] = obj;
}
+ }
+ int length() {
+ return nitems;
+ }
+ T get(int n) {
+ return data[n];
+ }
};
@@ -3704,10 +3704,10 @@ template <class T> class OuterTemplateClass {};
// Don't forget to use %feature("flatnested") for OuterClass::InnerStruct and
// OuterClass::InnerClass if the target language doesn't support nested classes.
class OuterClass {
- public:
- // Forward declarations:
- struct InnerStruct;
- class InnerClass;
+ public:
+ // Forward declarations:
+ struct InnerStruct;
+ class InnerClass;
};
struct OuterClass::InnerStruct {};
@@ -4533,13 +4533,13 @@ around some other class. For example:
// Smart-pointer class
template<class T> class SmartPtr {
- T *pointee;
+ T *pointee;
public:
- SmartPtr(T *p) : pointee(p) { ... }
- T *operator->() {
- return pointee;
- }
- ...
+ SmartPtr(T *p) : pointee(p) { ... }
+ T *operator->() {
+ return pointee;
+ }
+ ...
};
// Ordinary class
diff --git a/Doc/Manual/Scilab.html b/Doc/Manual/Scilab.html
index 14e03ff18..aef06e302 100644
--- a/Doc/Manual/Scilab.html
+++ b/Doc/Manual/Scilab.html
@@ -121,15 +121,15 @@ In this example we bind from C a function and a global variable into Scilab. The
double Foo = 3.0;
int fact(int n) {
- if (n < 0) {
- return 0;
- }
- else if (n == 0) {
- return 1;
- }
- else {
- return n * fact(n-1);
- }
+ if (n < 0) {
+ return 0;
+ }
+ else if (n == 0) {
+ return 1;
+ }
+ else {
+ return n * fact(n-1);
+ }
}
%}
@@ -896,8 +896,8 @@ Let's see it on an example of a struct with two members:
%inline %{
typedef struct {
- int x;
- int arr[4];
+ int x;
+ int arr[4];
} Foo;
%}
@@ -1143,11 +1143,11 @@ As explained in 6.15 SWI
%module example
void magnify(Square *square, double factor) {
- square->size *= factor;
+ square->size *= factor;
};
void magnify(Circle *circle, double factor) {
- square->radius *= factor;
+ square->radius *= factor;
};