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
3 changed files with 7 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
/* File : example.c */
|
/* File : example.cxx */
|
||||||
|
|
||||||
#include "example.h"
|
#include "example.h"
|
||||||
#define M_PI 3.14159265358979323846
|
#define M_PI 3.14159265358979323846
|
||||||
|
|
@ -11,18 +11,18 @@ void Shape::move(double dx, double dy) {
|
||||||
|
|
||||||
int Shape::nshapes = 0;
|
int Shape::nshapes = 0;
|
||||||
|
|
||||||
double Circle::area(void) {
|
double Circle::area() {
|
||||||
return M_PI*radius*radius;
|
return M_PI*radius*radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
double Circle::perimeter(void) {
|
double Circle::perimeter() {
|
||||||
return 2*M_PI*radius;
|
return 2*M_PI*radius;
|
||||||
}
|
}
|
||||||
|
|
||||||
double Square::area(void) {
|
double Square::area() {
|
||||||
return width*width;
|
return width*width;
|
||||||
}
|
}
|
||||||
|
|
||||||
double Square::perimeter(void) {
|
double Square::perimeter() {
|
||||||
return 4*width;
|
return 4*width;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,3 @@
|
||||||
|
|
||||||
/* Let's just grab the original header file here */
|
/* Let's just grab the original header file here */
|
||||||
%include "example.h"
|
%include "example.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/* File : example.h */
|
/* File : example.h */
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
struct A {
|
struct A {
|
||||||
};
|
};
|
||||||
|
|
@ -10,7 +11,7 @@ class Exc {
|
||||||
public:
|
public:
|
||||||
Exc(int c, const char *m) {
|
Exc(int c, const char *m) {
|
||||||
code = c;
|
code = c;
|
||||||
strncpy(msg,m,256);
|
strncpy(msg,m,255);
|
||||||
}
|
}
|
||||||
int code;
|
int code;
|
||||||
char msg[256];
|
char msg[256];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue