mirror of https://github.com/swig/swig
Remove more insignificant differences with examples in master
Follow the she style of the other existing examples.
This commit is contained in:
parent
faa5d8bbf5
commit
4748e4f379
|
@ -1,4 +1,4 @@
|
|||
/* File : example.c */
|
||||
/* File : example.cxx */
|
||||
|
||||
#include "example.h"
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
@ -11,18 +11,18 @@ void Shape::move(double dx, double dy) {
|
|||
|
||||
int Shape::nshapes = 0;
|
||||
|
||||
double Circle::area(void) {
|
||||
double Circle::area() {
|
||||
return M_PI*radius*radius;
|
||||
}
|
||||
|
||||
double Circle::perimeter(void) {
|
||||
double Circle::perimeter() {
|
||||
return 2*M_PI*radius;
|
||||
}
|
||||
|
||||
double Square::area(void) {
|
||||
double Square::area() {
|
||||
return width*width;
|
||||
}
|
||||
|
||||
double Square::perimeter(void) {
|
||||
double Square::perimeter() {
|
||||
return 4*width;
|
||||
}
|
||||
|
|
|
@ -7,4 +7,3 @@
|
|||
|
||||
/* Let's just grab the original header file here */
|
||||
%include "example.h"
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* File : example.h */
|
||||
|
||||
#include <string.h>
|
||||
#ifndef SWIG
|
||||
struct A {
|
||||
};
|
||||
|
@ -10,7 +11,7 @@ class Exc {
|
|||
public:
|
||||
Exc(int c, const char *m) {
|
||||
code = c;
|
||||
strncpy(msg,m,256);
|
||||
strncpy(msg,m,255);
|
||||
}
|
||||
int code;
|
||||
char msg[256];
|
||||
|
|
Loading…
Reference in New Issue