Fix compilation warnings/errors with newer compilers.

This commit is contained in:
steve 2005-08-13 00:45:53 +00:00
parent d310e656c7
commit 8c73fa7840
13 changed files with 83 additions and 41 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: LineInfo.cc,v 1.4 2003/01/17 05:49:03 steve Exp $"
#ident "$Id: LineInfo.cc,v 1.4.2.1 2005/08/13 00:45:53 steve Exp $"
#endif
# include "config.h"
@ -34,12 +34,12 @@ LineInfo::~LineInfo()
{
}
string LineInfo::get_line() const
std::string LineInfo::get_line() const
{
ostringstream buf;
std::ostringstream buf;
buf << (file_? file_ : "") << ":" << lineno_;
string res = buf.str();
std::string res = buf.str();
return res;
}
@ -61,6 +61,9 @@ void LineInfo::set_lineno(unsigned n)
/*
* $Log: LineInfo.cc,v $
* Revision 1.4.2.1 2005/08/13 00:45:53 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.4 2003/01/17 05:49:03 steve
* Use stringstream in place of sprintf.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: LineInfo.h,v 1.7.2.1 2005/06/14 15:33:54 steve Exp $"
#ident "$Id: LineInfo.h,v 1.7.2.2 2005/08/13 00:45:53 steve Exp $"
#endif
# include <string>
@ -40,7 +40,7 @@ class LineInfo {
LineInfo();
~LineInfo();
string get_line() const;
std::string get_line() const;
void set_line(const LineInfo&that);
@ -54,6 +54,9 @@ class LineInfo {
/*
* $Log: LineInfo.h,v $
* Revision 1.7.2.2 2005/08/13 00:45:53 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.7.2.1 2005/06/14 15:33:54 steve
* Fix gcc4 build issues.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PTask.h,v 1.13 2004/05/31 23:34:36 steve Exp $"
#ident "$Id: PTask.h,v 1.13.2.1 2005/08/13 00:45:53 steve Exp $"
#endif
# include "LineInfo.h"
@ -70,7 +70,7 @@ class PTask : public LineInfo {
// Elaborate the statement to finish off the task definition.
void elaborate(Design*des, NetScope*scope) const;
void dump(ostream&, unsigned) const;
void dump(std::ostream&, unsigned) const;
private:
svector<PWire*>*ports_;
@ -106,7 +106,7 @@ class PFunction : public LineInfo {
/* Elaborate the behavioral statement. */
void elaborate(Design *des, NetScope*) const;
void dump(ostream&, unsigned) const;
void dump(std::ostream&, unsigned) const;
private:
perm_string name_;
@ -117,6 +117,9 @@ class PFunction : public LineInfo {
/*
* $Log: PTask.h,v $
* Revision 1.13.2.1 2005/08/13 00:45:53 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.13 2004/05/31 23:34:36 steve
* Rewire/generalize parsing an elaboration of
* function return values to allow for better

13
PUdp.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PUdp.h,v 1.12 2004/03/08 00:47:44 steve Exp $"
#ident "$Id: PUdp.h,v 1.12.2.1 2005/08/13 00:45:53 steve Exp $"
#endif
# include <map>
@ -55,20 +55,20 @@ class PUdp {
public:
explicit PUdp(perm_string n, unsigned nports);
svector<string>ports;
svector<std::string>ports;
unsigned find_port(const char*name);
bool sequential;
svector<string>tinput;
svector<std::string>tinput;
svector<char> tcurrent;
svector<char> toutput;
verinum::V initial;
map<string,PExpr*> attributes;
std::map<std::string,PExpr*> attributes;
void dump(ostream&out) const;
void dump(std::ostream&out) const;
perm_string name_;
private:
@ -80,6 +80,9 @@ class PUdp {
/*
* $Log: PUdp.h,v $
* Revision 1.12.2.1 2005/08/13 00:45:53 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.12 2004/03/08 00:47:44 steve
* primitive ports can bind bi name.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: StringHeap.cc,v 1.6 2004/02/18 17:11:54 steve Exp $"
#ident "$Id: StringHeap.cc,v 1.6.2.1 2005/08/13 00:45:53 steve Exp $"
#endif
# include "StringHeap.h"
@ -131,7 +131,7 @@ perm_string StringHeapLex::make(const char*text)
return perm_string(add(text));
}
perm_string StringHeapLex::make(const string&text)
perm_string StringHeapLex::make(const std::string&text)
{
return perm_string(add(text.c_str()));
}
@ -181,6 +181,9 @@ bool operator < (perm_string a, perm_string b)
/*
* $Log: StringHeap.cc,v $
* Revision 1.6.2.1 2005/08/13 00:45:53 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.6 2004/02/18 17:11:54 steve
* Use perm_strings for named langiage items.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: StringHeap.h,v 1.5.2.1 2005/06/14 15:33:54 steve Exp $"
#ident "$Id: StringHeap.h,v 1.5.2.2 2005/08/13 00:45:53 steve Exp $"
#endif
# include "config.h"
@ -103,7 +103,7 @@ class StringHeapLex : private StringHeap {
const char*add(const char*);
perm_string make(const char*);
perm_string make(const string&);
perm_string make(const std::string&);
unsigned add_count() const;
unsigned add_hit_count() const;
@ -122,6 +122,9 @@ class StringHeapLex : private StringHeap {
/*
* $Log: StringHeap.h,v $
* Revision 1.5.2.2 2005/08/13 00:45:53 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.5.2.1 2005/06/14 15:33:54 steve
* Fix gcc4 build issues.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.h,v 1.321.2.1 2005/07/06 22:41:34 steve Exp $"
#ident "$Id: netlist.h,v 1.321.2.2 2005/08/13 00:45:54 steve Exp $"
#endif
/*
@ -60,6 +60,9 @@ class NetESignal;
class NetEVariable;
class NetFuncDef;
class NetRamDq;
class NetEvTrig;
class NetEvWait;
struct target;
struct functor_t;
@ -3357,6 +3360,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.321.2.2 2005/08/13 00:45:54 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.321.2.1 2005/07/06 22:41:34 steve
* Fix compile errors with g++-4.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: parse_api.h,v 1.3 2004/02/18 17:11:57 steve Exp $"
#ident "$Id: parse_api.h,v 1.3.2.1 2005/08/13 00:45:54 steve Exp $"
#endif
# include <stdio.h>
@ -35,8 +35,8 @@ class PUdp;
* Verilog source into pform for elaboration. The parser adds modules
* to these maps as it compiles modules in the verilog source.
*/
extern map<perm_string,Module*> pform_modules;
extern map<perm_string,PUdp*> pform_primitives;
extern std::map<perm_string,Module*> pform_modules;
extern std::map<perm_string,PUdp*> pform_primitives;
/*
* This code actually invokes the parser to make modules. The first
@ -47,10 +47,13 @@ extern map<perm_string,PUdp*> pform_primitives;
*/
extern int pform_parse(const char*path, FILE*file =0);
extern string vl_file;
extern std::string vl_file;
/*
* $Log: parse_api.h,v $
* Revision 1.3.2.1 2005/08/13 00:45:54 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.3 2004/02/18 17:11:57 steve
* Use perm_strings for named langiage items.
*

7
util.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: util.h,v 1.7 2004/02/20 18:53:36 steve Exp $"
#ident "$Id: util.h,v 1.7.2.1 2005/08/13 00:45:55 steve Exp $"
#endif
# include <map>
@ -44,13 +44,16 @@ struct attrib_list_t {
verinum val;
};
extern attrib_list_t* evaluate_attributes(const map<perm_string,PExpr*>&att,
extern attrib_list_t* evaluate_attributes(const std::map<perm_string,PExpr*>&att,
unsigned&natt,
const Design*des,
const NetScope*scope);
/*
* $Log: util.h,v $
* Revision 1.7.2.1 2005/08/13 00:45:55 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.7 2004/02/20 18:53:36 steve
* Addtrbute keys are perm_strings.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: verinum.cc,v 1.43 2004/05/18 18:43:15 steve Exp $"
#ident "$Id: verinum.cc,v 1.43.2.1 2005/08/13 00:45:55 steve Exp $"
#endif
# include "config.h"
@ -41,7 +41,7 @@ verinum::verinum(const V*bits, unsigned nbits, bool has_len)
}
}
verinum::verinum(const string&str)
verinum::verinum(const std::string&str)
: has_len_(true), has_sign_(false), string_flag_(true)
{
nbits_ = str.length() * 8;
@ -257,7 +257,7 @@ signed long verinum::as_long() const
return val;
}
string verinum::as_string() const
std::string verinum::as_string() const
{
assert( nbits_%8 == 0 );
if (nbits_ == 0)
@ -283,7 +283,7 @@ string verinum::as_string() const
}
tmp[nbits_/8] = 0;
string result = string(tmp);
std::string result = std::string(tmp);
delete[]tmp;
return result;
}
@ -370,7 +370,7 @@ verinum trim_vnum(const verinum&that)
return tmp;
}
ostream& operator<< (ostream&o, verinum::V v)
std::ostream& operator<< (std::ostream&o, verinum::V v)
{
switch (v) {
case verinum::V0:
@ -393,7 +393,7 @@ ostream& operator<< (ostream&o, verinum::V v)
* This operator is used by various dumpers to write the verilog
* number in a Verilog format.
*/
ostream& operator<< (ostream&o, const verinum&v)
std::ostream& operator<< (std::ostream&o, const verinum&v)
{
if (v.is_string()) {
o << "\"" << v.as_string() << "\"";
@ -942,6 +942,9 @@ verinum::V operator ^ (verinum::V l, verinum::V r)
/*
* $Log: verinum.cc,v $
* Revision 1.43.2.1 2005/08/13 00:45:55 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.43 2004/05/18 18:43:15 steve
* Handle null string as a single nul character.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: verinum.h,v 1.26.2.1 2005/06/14 15:33:54 steve Exp $"
#ident "$Id: verinum.h,v 1.26.2.2 2005/08/13 00:45:55 steve Exp $"
#endif
# include <string>
@ -45,7 +45,7 @@ class verinum {
enum V { V0 = 0, V1, Vx, Vz };
verinum();
verinum(const string&str);
verinum(const std::string&);
verinum(const V*v, unsigned nbits, bool has_len =true);
verinum(V, unsigned nbits =1, bool has_len =true);
verinum(unsigned long val, unsigned bits);
@ -92,7 +92,7 @@ class verinum {
unsigned long as_ulong() const;
signed long as_long() const;
string as_string() const;
std::string as_string() const;
private:
V* bits_;
@ -109,8 +109,8 @@ class verinum {
needed to accurately represent the contained value, signed or not. */
extern verinum trim_vnum(const verinum&);
extern ostream& operator<< (ostream&, const verinum&);
extern ostream& operator<< (ostream&, verinum::V);
extern std::ostream& operator<< (std::ostream&, const verinum&);
extern std::ostream& operator<< (std::ostream&, verinum::V);
extern verinum::V operator | (verinum::V l, verinum::V r);
extern verinum::V operator & (verinum::V l, verinum::V r);
@ -149,6 +149,9 @@ extern verinum v_not(const verinum&left);
/*
* $Log: verinum.h,v $
* Revision 1.26.2.2 2005/08/13 00:45:55 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.26.2.1 2005/06/14 15:33:54 steve
* Fix gcc4 build issues.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: verireal.cc,v 1.15 2004/06/04 23:33:51 steve Exp $"
#ident "$Id: verireal.cc,v 1.15.2.1 2005/08/13 00:45:55 steve Exp $"
#endif
# include "config.h"
@ -124,7 +124,7 @@ verireal operator- (const verireal&l)
return res;
}
ostream& operator<< (ostream&out, const verireal&v)
std::ostream& operator<< (std::ostream&out, const verireal&v)
{
out << v.value_;
return out;
@ -132,6 +132,9 @@ ostream& operator<< (ostream&out, const verireal&v)
/*
* $Log: verireal.cc,v $
* Revision 1.15.2.1 2005/08/13 00:45:55 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.15 2004/06/04 23:33:51 steve
* Add unary minus as operator supported by verireal.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: verireal.h,v 1.10.2.1 2005/06/14 15:33:54 steve Exp $"
#ident "$Id: verireal.h,v 1.10.2.2 2005/08/13 00:45:55 steve Exp $"
#endif
#ifdef HAVE_IOSFWD
@ -41,7 +41,7 @@ class verinum;
class verireal {
friend ostream& operator<< (ostream&, const verireal&);
friend std::ostream& operator<< (std::ostream&, const verireal&);
friend verireal operator* (const verireal&, const verireal&);
friend verireal operator/ (const verireal&, const verireal&);
friend verireal operator/ (const verireal&, const verinum&);
@ -70,7 +70,7 @@ class verireal {
double value_;
};
extern ostream& operator<< (ostream&, const verireal&);
extern std::ostream& operator<< (std::ostream&, const verireal&);
extern verireal operator* (const verireal&, const verireal&);
extern verireal operator/ (const verireal&, const verireal&);
extern verireal operator/ (const verireal&, const verinum&);
@ -80,6 +80,9 @@ extern verireal operator- (const verireal&);
/*
* $Log: verireal.h,v $
* Revision 1.10.2.2 2005/08/13 00:45:55 steve
* Fix compilation warnings/errors with newer compilers.
*
* Revision 1.10.2.1 2005/06/14 15:33:54 steve
* Fix gcc4 build issues.
*