Unbreak with gcc 3.4.

Approved by:	portmgr (marcus)
This commit is contained in:
Thierry Thomas 2005-08-17 05:22:58 +00:00
parent 85a0587ce8
commit 777026ca2d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=140903
18 changed files with 453 additions and 7 deletions

View file

@ -16,16 +16,11 @@ COMMENT= Adaptive linear scalar elliptic and parabolic problem solver
USE_X_PREFIX= yes
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
DIST_SUBDIR= kaskade
WRKSRC= ${WRKDIR}/3.2.1
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 502126
BROKEN= "Does not compile on FreeBSD >= 5.x"
.endif
post-patch:
${CP} ${FILESDIR}/Makefile ${WRKSRC}
${CP} ${FILESDIR}/configure ${WRKSRC}
@ -34,10 +29,11 @@ post-install:
.if !defined(NOPORTDOCS)
@${MKDIR} ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/data/*.cmd ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/data/*.dat ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/data/*.ex ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/data/*.geo ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/data/kaskade.init ${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/data/*.mat ${EXAMPLESDIR}
.endif
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -0,0 +1,63 @@
--- ./sources/alloc.c.orig Tue Dec 14 13:06:31 1999
+++ ./sources/alloc.c Tue Aug 16 23:59:29 2005
@@ -60,7 +60,7 @@
++noOfElementsInBlock;
++freeElement;
- if (noOfElementsInBlock > maxElementsInBlock)
+ if (noOfElementsInBlock > maxElementsInBlock)
{
if (noOfBlocksSinceIncrement > 100) // dynamic size extension
{
@@ -71,7 +71,7 @@
MemoryBlock* newBlock = ::new MemoryBlock;
if (newBlock == 0) allocationError();
- newBlock->space = ::new T[maxElementsInBlock];
+ newBlock->space = ::new T[maxElementsInBlock];
if (newBlock->space == 0) allocationError();
newBlock->next = lastBlock;
@@ -97,19 +97,19 @@
//-------------------------------------------------------------------------
template<class T> Allocator<T>:: ~Allocator()
-{
- MemoryBlock* toDel;
+{
+ typename StaticAllocator<T>::MemoryBlock* toDel;
- while(lastBlock)
+ while(this->lastBlock)
{
- toDel = lastBlock;
- lastBlock = lastBlock->next;
+ toDel = this->lastBlock;
+ this->lastBlock = this->lastBlock->next;
delete [] toDel->space;
delete toDel;
}
int i;
- FORALL(returnedElements,i) returnedElements[i] = 0;
+ FORALL(this->returnedElements,i) this->returnedElements[i] = 0;
}
//-------------------------------------------------------------------------
@@ -118,11 +118,11 @@
{
T* elem;
- if (returnedElements.h == 0) elem = getFromBlock();
- else
- {
- elem = returnedElements.pop();
- elem->reset();
+ if (this->returnedElements.h == 0) elem = this->getFromBlock();
+ else
+ {
+ elem = this->returnedElements.pop();
+ elem->reset();
}
return elem;
}

View file

@ -0,0 +1,12 @@
--- ./sources/alloc.h.orig Fri Dec 10 15:19:05 1999
+++ ./sources/alloc.h Tue Aug 16 22:42:54 2005
@@ -3,7 +3,8 @@
#ifndef ALLOC_H
#define ALLOC_H
-#include <iostream.h>
+#include <iostream>
+using namespace std;
#include "stack.h"

View file

@ -0,0 +1,11 @@
--- ./sources/cmdpars.h.orig Fri Dec 10 15:30:27 1999
+++ ./sources/cmdpars.h Tue Aug 16 21:40:15 2005
@@ -3,7 +3,7 @@
#ifndef CMDPARS_H
#define CMDPARS_H
-#include <fstream.h>
+#include <fstream>
#include "dict.h"

View file

@ -0,0 +1,11 @@
--- ./sources/dict.h.orig Tue Dec 14 12:55:24 1999
+++ ./sources/dict.h Tue Aug 16 22:03:02 2005
@@ -4,7 +4,7 @@
#define DICT_H
-#include <iostream.h>
+#include <iostream>
#include <math.h>
#include "stack.h"

View file

@ -0,0 +1,11 @@
--- ./sources/dlist.h.orig Tue Dec 14 13:48:01 1999
+++ ./sources/dlist.h Tue Aug 16 22:50:10 2005
@@ -3,7 +3,7 @@
#ifndef DLIST_H
#define DLIST_H
-#include <iostream.h>
+#include <iostream>
template<class T>

View file

@ -0,0 +1,11 @@
--- ./sources/family.h.orig Fri Aug 4 10:13:45 2000
+++ ./sources/family.h Wed Aug 17 00:07:37 2005
@@ -85,7 +85,7 @@
virtual ~Son() { }
- void* operator new(size_t /*size*/) { cout.flush(); abort(); return 0; }
+ void* operator new(size_t /*size*/) throw() { cout.flush(); abort(); return 0; }
void operator delete(void* /*son*/) { cout.flush(); abort(); }
virtual int NoOfFathers() const = 0;

View file

@ -0,0 +1,13 @@
--- ./sources/general.h.in.orig Tue Dec 14 15:27:41 1999
+++ ./sources/general.h.in Tue Aug 16 21:27:57 2005
@@ -3,8 +3,8 @@
#ifndef GENERAL_H
#define GENERAL_H
-#include <iostream.h>
-#include <stddef.h>
+#include <iostream>
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

View file

@ -0,0 +1,32 @@
--- ./sources/kvector.h.orig Fri Dec 10 15:20:04 1999
+++ ./sources/kvector.h Tue Aug 16 22:39:18 2005
@@ -12,20 +12,21 @@
//-------------------------------------------------------------------------
-#include <iostream.h>
-#include <stdlib.h>
+#include <iostream>
+using namespace std;
+#include <stdlib.h>
//----------------------------------------------------------------------------
template<class T>
-class Vector
-{
- public:
-
- T* v;
+class Vector
+{
+ public:
+
+ T* v;
int l, h;
-
+
Vector(int l1, int h1) { allocate(l1, h1); }
Vector(int h1) { allocate( 1, h1); }
Vector() { allocate( 1, 1); }

View file

@ -0,0 +1,35 @@
--- ./sources/matrix.h.orig Fri Dec 10 15:20:13 1999
+++ ./sources/matrix.h Tue Aug 16 22:41:02 2005
@@ -13,21 +13,22 @@
//-------------------------------------------------------------------------
#include <stdio.h>
-#include <iostream.h>
+#include <iostream>
+using namespace std;
template<class T>
-
-class Matrix
-{
- public:
- T** row;
- int rl, rh, cl, ch;
-
- Matrix (int rl1, int rh1, int cl1, int ch1)
+class Matrix
+{
+ public:
+
+ T** row;
+ int rl, rh, cl, ch;
+
+ Matrix (int rl1, int rh1, int cl1, int ch1)
{ allocate (rl1,rh1,cl1,ch1); }
- Matrix (int nr1, int nc1) { allocate (1, nr1, 1, nc1); }
+ Matrix (int nr1, int nc1) { allocate (1, nr1, 1, nc1); }
~Matrix();

View file

@ -0,0 +1,11 @@
--- ./sources/slist.h.orig Fri Dec 10 15:20:49 1999
+++ ./sources/slist.h Tue Aug 16 23:25:00 2005
@@ -3,7 +3,7 @@
#ifndef SLIST_H
#define SLIST_H
-#include <iostream.h>
+#include <iostream>
template<class T>

View file

@ -0,0 +1,143 @@
--- ./sources/stack.c.orig Thu Oct 10 12:01:26 1996
+++ ./sources/stack.c Tue Aug 16 23:20:18 2005
@@ -8,77 +8,77 @@
#include "stack.h"
-template<class T>
-Stack<T>:: Stack(int l1, int top1, int h1)
- : Vector<T>(l1,top1) { top=top1; h=h1; }
-
-template<class T>
-Stack<T>:: Stack(int l1, int top1)
- : Vector<T>(l1,top1) { top=top1; h=l1-1; }
+template<class T>
+Stack<T>:: Stack(int l1, int top1, int h1)
+ : Vector<T>(l1,top1) { top=top1; this->h=h1; }
+
+template<class T>
+Stack<T>:: Stack(int l1, int top1)
+ : Vector<T>(l1,top1) { top=top1; this->h=l1-1; }
-template<class T>
-Stack<T>:: Stack(int top1) : Vector<T>(1,top1) { top=top1; h=0;}
+template<class T>
+Stack<T>:: Stack(int top1) : Vector<T>(1,top1) { top=top1; this->h=0;}
-template<class T>
-Stack<T>:: Stack() : Vector<T>(DefaultSize) { top=DefaultSize; h=0;}
+template<class T>
+Stack<T>:: Stack() : Vector<T>(DefaultSize) { top=DefaultSize; this->h=0;}
template<class T> void Stack<T>:: push(const T a)
{
- if (h==top) extend();
- v[++h] = a;
+ if (this->h==top) extend();
+ this->v[++this->h] = a;
}
template<class T> T Stack<T>:: pop()
{
- if (h < l)
+ if (this->h < this->l)
{
- cout << "\n*** pop tried from empty stack \n";
- cout.flush(); abort(); return v[l]; // dummy to avoid compiler warnings
+ cout << "\n*** pop tried from empty stack \n";
+ cout.flush(); abort(); return this->v[this->l]; // dummy to avoid compiler warnings
}
- else return v[h--];
+ else return this->v[this->h--];
}
template<class T> T Stack<T>:: Top() const
{
- if (h < l)
+ if (this->h < this->l)
{
- cout << "\n*** Class Stack (Top): empty stack \n";
- cout.flush(); abort(); return v[l]; // dummy to avoid compiler warnings
+ cout << "\n*** Class Stack (Top): empty stack \n";
+ cout.flush(); abort(); return this->v[this->l]; // dummy to avoid compiler warnings
}
- else return v[h];
+ else return this->v[this->h];
}
template<class T> T Stack<T>:: Prev() const
{
- if (h <= l)
+ if (this->h <= this->l)
{
- cout << "\n*** Class Stack (Prev): only one element on stack \n";
- cout.flush(); abort(); return v[l]; // dummy to avoid compiler warnings
+ cout << "\n*** Class Stack (Prev): only one element on stack \n";
+ cout.flush(); abort(); return this->v[this->l]; // dummy to avoid compiler warnings
}
- else return v[h-1];
+ else return this->v[this->h-1];
}
template<class T> void Stack<T>:: extend()
{
- int stackSize = top-l+1;
+ int stackSize = top - this->l + 1;
stackSize = int(1.5*stackSize);
if (stackSize <= 2) stackSize = 4;
-
- top = l+stackSize-1;
+
+ top = this->l+stackSize-1;
T* vnew = new T[stackSize];
- if (!vnew)
+ if (!vnew)
{
- cout << "\n*** stack extension failure: l=" <<l<< " top=" <<top<< "\n";
+ cout << "\n*** stack extension failure: l=" <<this->l<< " top=" <<top<< "\n";
cout.flush(); abort();
}
- vnew -= l;
+ vnew -= this->l;
- for (int i=l; i<=h; ++i) vnew[i] = v[i];
- v = v+l;
- delete [] v;
- v = vnew;
+ for (int i=this->l; i<=this->h; ++i) vnew[i] = this->v[i];
+ this->v = this->v + this->l;
+ delete [] this->v;
+ this->v = vnew;
if (AnnounceExtensionFlag) cout << "\n* Stack extended to " << top << "\n";
}
@@ -86,10 +86,10 @@
template<class T> void Stack<T>:: resize(int newl, int newTop)
{
- v += l; delete[] v;
- allocate (newl, newTop);
+ this->v += this->l; delete[] this->v;
+ this->allocate (newl, newTop);
top = newTop;
- h = newl-1;
+ this->h = newl-1;
}
template<class T> void Stack<T>:: resize(int newTop) { resize (1,newTop); }
@@ -97,11 +97,11 @@
template<class T> void Stack<T>:: resize(int newl, int newTop, int newh)
{
resize(newl, newTop);
- h = newh;
+ this->h = newh;
}
//-------------------------------------------------------------------------
template<class T> Stack<T>:: Stack(Stack<T>& /*vec*/)
{
- notImplemented("Stack:: copy constructor! Check function arguments");
+ this->notImplemented("Stack:: copy constructor! Check function arguments");
}

View file

@ -0,0 +1,11 @@
--- ./sources/stack.h.orig Fri Dec 10 15:20:50 1999
+++ ./sources/stack.h Tue Aug 16 22:01:00 2005
@@ -30,7 +30,7 @@
virtual T Top() const;
- int empty() const { return h < l; }
+ int empty() const { return this->h < this->l; }
virtual void resize(int newTop);
virtual void resize(int newl, int newTop);

View file

@ -0,0 +1,15 @@
--- ./sources/utils.h.orig Tue Dec 14 15:57:46 1999
+++ ./sources/utils.h Tue Aug 16 21:32:31 2005
@@ -3,10 +3,10 @@
#ifndef UTILS_H
#define UTILS_H
-#include <stddef.h>
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
-#include <iostream.h>
+#include <iostream>
#include <stdlib.h>
#include <ctype.h>
#include <math.h>

View file

@ -0,0 +1,11 @@
--- ./sources/varalloc.cc.orig Fri Dec 10 12:41:11 1999
+++ ./sources/varalloc.cc Wed Aug 17 00:04:09 2005
@@ -5,7 +5,7 @@
Part of the Kaskade distribution
*/
-#include <iostream.h>
+#include <iostream>
#include <stdlib.h>
#include "varalloc.h"

View file

@ -0,0 +1,28 @@
--- ./sources/vector.c.orig Thu Oct 10 12:01:35 1996
+++ ./sources/vector.c Tue Aug 16 22:37:14 2005
@@ -5,12 +5,14 @@
Part of the Kaskade distribution
*/
+#include <iostream>
+using namespace std;
template<class T> Vector<T>:: ~Vector() { v+=l; delete[] v; }
template<class T> void Vector<T>:: allocate (int l1, int h1)
-{
- l=l1; h=h1;
+{
+ l=l1; h=h1;
if (h < l) {
cout << "\n*** Class vector: wrong indices: l,h = "
<< l << " " << h << "\n";
@@ -23,7 +25,7 @@
cout.flush(); abort();
}
v -= l;
-}
+}
template<class T> void Vector<T>:: resize(int newl, int newh)
{

View file

@ -0,0 +1,31 @@
--- ./sources/vector.h.orig Fri Dec 10 15:21:23 1999
+++ ./sources/vector.h Tue Aug 16 22:04:53 2005
@@ -12,20 +12,20 @@
//-------------------------------------------------------------------------
-#include <iostream.h>
-#include <stdlib.h>
+#include <iostream>
+#include <stdlib.h>
//----------------------------------------------------------------------------
template<class T>
-class Vector
-{
- public:
-
- T* v;
+class Vector
+{
+ public:
+
+ T* v;
int l, h;
-
+
Vector(int l1, int h1) { allocate(l1, h1); }
Vector(int h1) { allocate( 1, h1); }
Vector() { allocate( 1, 1); }

View file

@ -55,6 +55,7 @@ bin/k6
%%PORTDOCS%%%%EXAMPLESDIR%%/holes-3d.cmd
%%PORTDOCS%%%%EXAMPLESDIR%%/holes-3d.geo
%%PORTDOCS%%%%EXAMPLESDIR%%/holes-3d.mat
%%PORTDOCS%%%%EXAMPLESDIR%%/integ.dat
%%PORTDOCS%%%%EXAMPLESDIR%%/jump.cmd
%%PORTDOCS%%%%EXAMPLESDIR%%/jump.ex
%%PORTDOCS%%%%EXAMPLESDIR%%/jump.geo