Various and sundry updates for the Pike module.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4758 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7ac6270fb8
commit
c478c13cf0
6 changed files with 147 additions and 59 deletions
|
|
@ -11,7 +11,6 @@ int Shape::nshapes = 0;
|
|||
|
||||
// Constructor
|
||||
Shape::Shape() {
|
||||
// printf("Shape::Shape(), this = 0x%08x\n", this);
|
||||
nshapes++;
|
||||
}
|
||||
|
||||
|
|
@ -23,26 +22,25 @@ void Shape::move(double dx, double dy) {
|
|||
|
||||
// Destructor
|
||||
Shape::~Shape() {
|
||||
// printf("Shape::~Shape(), this = 0x%08x\n", this);
|
||||
nshapes--;
|
||||
}
|
||||
|
||||
// Circle area
|
||||
double Circle::area() {
|
||||
double Circle::area() const {
|
||||
return M_PI*radius*radius;
|
||||
}
|
||||
|
||||
// Circle perimeter
|
||||
double Circle::perimeter() {
|
||||
double Circle::perimeter() const {
|
||||
return 2*M_PI*radius;
|
||||
}
|
||||
|
||||
// Square area
|
||||
double Square::area() {
|
||||
double Square::area() const {
|
||||
return width*width;
|
||||
}
|
||||
|
||||
// Square perimeter
|
||||
double Square::perimeter() {
|
||||
double Square::perimeter() const {
|
||||
return 4*width;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue