Compiler errors
Steve Little <[email protected]> Wed, 12 Oct 2005 14:11:46 +0100
| Newsgroups | gmane.comp.gnu.gnucap.bugs |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_2682_20487268.1129122706727
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi,
I just downloaded gnucap and get quite a few compiler errors
on cygwin, g++ v3.4.4. Attached is a patch to clean them up.
In short, there were a few problems where the keyword 'typename' was
required to clear up some ambiguities, and I needed to make copy
consturctor for CPOLY1 non-explicit (presumably because g++ chose not
to elide the extra copy when calling:
FPOLY1(CPOLY1(a,b,c));
this was causing an error since it couldn't implicitly call the copy
constuctor. I don't see any real harm in the copy constructor being
implicit, so should be fine.
I've run the examples (in batch mode) using examples/runall, and they
look fine (with a minor difference in the last test, possibly the
example output is out of date? i notice the version numbers are out of
date on it...)
I haven't had much chance to try the application yet, but it looks promisin=
g.
Thanks,
Steve
------=_Part_2682_20487268.1129122706727
Content-Type: text/plain; name=gnucapdiff.txt; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="gnucapdiff.txt"
Only in gnucap-0.31-modified/modelgen: O
diff -c -r gnucap-0.31/modelgen/mg_.h gnucap-0.31-modified/modelgen/mg_.h
*** gnucap-0.31/modelgen/mg_.h Tue Mar 26 09:20:13 2002
--- gnucap-0.31-modified/modelgen/mg_.h Mon Oct 10 14:17:40 2005
***************
*** 86,97 ****
std::list<T*> _list;
virtual void parse(CS& f) = 0;
virtual ~List_Base() {
! for (std::list<T*>::iterator i = _list.begin(); i != _list.end(); ++i) {
delete *i;
}
}
public:
! typedef std::list<T*>::const_iterator const_iterator;
const_iterator begin()const {return _list.begin();}
const_iterator end()const {return _list.end();}
bool is_empty()const {return _list.empty();}
--- 86,97 ----
std::list<T*> _list;
virtual void parse(CS& f) = 0;
virtual ~List_Base() {
! for (typename std::list<T*>::iterator i = _list.begin(); i != _list.end(); ++i) {
delete *i;
}
}
public:
! typedef typename std::list<T*>::const_iterator const_iterator;
const_iterator begin()const {return _list.begin();}
const_iterator end()const {return _list.end();}
bool is_empty()const {return _list.empty();}
diff -c -r gnucap-0.31/modelgen/mg_in.cc gnucap-0.31-modified/modelgen/mg_in.cc
*** gnucap-0.31/modelgen/mg_in.cc Tue Mar 26 09:20:13 2002
--- gnucap-0.31-modified/modelgen/mg_in.cc Wed Oct 12 12:50:43 2005
***************
*** 40,46 ****
}
T* p = new T(file);
{if (!file.stuck(&here)) {
! _list.push_back(p);
}else {
delete p;
file.warn(0, "not valid here");
--- 40,46 ----
}
T* p = new T(file);
{if (!file.stuck(&here)) {
! List_Base<T>::_list.push_back(p);
}else {
delete p;
file.warn(0, "not valid here");
***************
*** 55,61 ****
int here = file.cursor();
T* m = new T(file);
{if (!file.stuck(&here)) {
! _list.push_back(m);
}else{
delete m;
file.warn(0, "what's this??");
--- 55,61 ----
int here = file.cursor();
T* m = new T(file);
{if (!file.stuck(&here)) {
! List_Base<T>::_list.push_back(m);
}else{
delete m;
file.warn(0, "what's this??");
Only in gnucap-0.31-modified/src: O
diff -c -r gnucap-0.31/src/d_admit.cc gnucap-0.31-modified/src/d_admit.cc
*** gnucap-0.31/src/d_admit.cc Tue Mar 26 09:20:27 2002
--- gnucap-0.31-modified/src/d_admit.cc Wed Oct 12 13:21:30 2005
***************
*** 246,252 ****
set_port_count(n_nodes);
_n = new node_t[num_nodes()];
! std::copy_n(nodes, num_nodes(), _n);
_inputs = inputs;
}
/*--------------------------------------------------------------------------*/
--- 246,252 ----
set_port_count(n_nodes);
_n = new node_t[num_nodes()];
! std::copy(nodes, nodes+num_nodes(), _n);
_inputs = inputs;
}
/*--------------------------------------------------------------------------*/
diff -c -r gnucap-0.31/src/d_cap.cc gnucap-0.31-modified/src/d_cap.cc
*** gnucap-0.31/src/d_cap.cc Tue Mar 26 09:20:27 2002
--- gnucap-0.31-modified/src/d_cap.cc Wed Oct 12 13:23:12 2005
***************
*** 236,242 ****
set_port_count(n_nodes);
_n = new node_t[num_nodes()];
! std::copy_n(nodes, num_nodes(), _n);
_inputs = inputs;
}
/*--------------------------------------------------------------------------*/
--- 236,242 ----
set_port_count(n_nodes);
_n = new node_t[num_nodes()];
! std::copy(nodes, nodes+num_nodes(), _n);
_inputs = inputs;
}
/*--------------------------------------------------------------------------*/
diff -c -r gnucap-0.31/src/m_cpoly.h gnucap-0.31-modified/src/m_cpoly.h
*** gnucap-0.31/src/m_cpoly.h Tue Mar 26 09:20:26 2002
--- gnucap-0.31-modified/src/m_cpoly.h Wed Oct 12 13:32:58 2005
***************
*** 65,71 ****
double c0; /* f(x) - x*f'(x), or f0 - x*f1 */
double c1; /* the first derivative */
explicit CPOLY1() : x(0), c0(0), c1(0) {}
! explicit CPOLY1(const CPOLY1& p) : x(p.x), c0(p.c0), c1(p.c1){untested();}
explicit CPOLY1(double X,double C0,double C1) : x(X), c0(C0), c1(C1) {}
explicit CPOLY1(const FPOLY1& p);
--- 65,71 ----
double c0; /* f(x) - x*f'(x), or f0 - x*f1 */
double c1; /* the first derivative */
explicit CPOLY1() : x(0), c0(0), c1(0) {}
! CPOLY1(const CPOLY1& p) : x(p.x), c0(p.c0), c1(p.c1){untested();}
explicit CPOLY1(double X,double C0,double C1) : x(X), c0(C0), c1(C1) {}
explicit CPOLY1(const FPOLY1& p);
diff -c -r gnucap-0.31/src/m_matrix.cc gnucap-0.31-modified/src/m_matrix.cc
*** gnucap-0.31/src/m_matrix.cc Tue Mar 26 09:20:27 2002
--- gnucap-0.31-modified/src/m_matrix.cc Wed Oct 12 13:14:03 2005
***************
*** 407,413 ****
b = x;
}
{
! std::copy_n(b, _size+1, c);
int ii = 1;
for ( ; ii <= _size; ++ii){
if (b[ii] != 0.){
--- 407,413 ----
b = x;
}
{
! std::copy(b, b+_size+1, c);
int ii = 1;
for ( ; ii <= _size; ++ii){
if (b[ii] != 0.){
Only in gnucap-0.31-modified/src: modelgen
diff -c -r gnucap-0.31/src/s__solve.cc gnucap-0.31-modified/src/s__solve.cc
*** gnucap-0.31/src/s__solve.cc Tue Mar 26 09:20:28 2002
--- gnucap-0.31-modified/src/s__solve.cc Wed Oct 12 13:24:04 2005
***************
*** 109,119 ****
static double last_iter_time;
{if (SIM::time0 > 0) {
{if (SIM::time0 > last_iter_time) { /* moving forward */
! std::copy_n(v0, STATUS::total_nodes+1, vt1);
}else{ /* moving backward */
/* don't save voltages. They're wrong! */
/* instead, restore a clean start for iteration */
! std::copy_n(vt1, STATUS::total_nodes+1, v0);
}}
CARD_LIST::card_list.tr_advance();
}else{
--- 109,119 ----
static double last_iter_time;
{if (SIM::time0 > 0) {
{if (SIM::time0 > last_iter_time) { /* moving forward */
! std::copy(v0, v0+STATUS::total_nodes+1, vt1);
}else{ /* moving backward */
/* don't save voltages. They're wrong! */
/* instead, restore a clean start for iteration */
! std::copy(vt1, vt1+STATUS::total_nodes+1, v0);
}}
CARD_LIST::card_list.tr_advance();
}else{
diff -c -r gnucap-0.31/src/u_xprobe.cc gnucap-0.31-modified/src/u_xprobe.cc
*** gnucap-0.31/src/u_xprobe.cc Tue Mar 26 09:20:27 2002
--- gnucap-0.31-modified/src/u_xprobe.cc Wed Oct 12 13:15:41 2005
***************
*** 25,31 ****
#include "u_opt.h"
#include "u_xprobe.h"
/*--------------------------------------------------------------------------*/
! double XPROBE::operator()(mod_t m=mtNONE, bool db = false)const
{
{if (OK()){
if (m == mtNONE) {
--- 25,31 ----
#include "u_opt.h"
#include "u_xprobe.h"
/*--------------------------------------------------------------------------*/
! double XPROBE::operator()(mod_t m, bool db)const
{
{if (OK()){
if (m == mtNONE) {
------=_Part_2682_20487268.1129122706727
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Bug-gnucap mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnucap
------=_Part_2682_20487268.1129122706727--