Remove some cppcheck warnings.

This patch modifies the code to remove some more cppcheck warnings.
This commit is contained in:
Cary R 2010-07-23 15:58:00 -07:00 committed by Stephen Williams
parent 44b08a4630
commit 86653ddff9
12 changed files with 19 additions and 10 deletions

View File

@ -34,6 +34,9 @@ Module::Module(perm_string n)
is_cell = false; is_cell = false;
uc_drive = UCD_NONE; uc_drive = UCD_NONE;
timescale_warn_done = false; timescale_warn_done = false;
time_unit = 0;
time_precision = 0;
time_from_timescale = false;
} }
Module::~Module() Module::~Module()

View File

@ -288,7 +288,7 @@ void PGModule::set_range(PExpr*msb, PExpr*lsb)
lsb_ = lsb; lsb_ = lsb;
} }
perm_string PGModule::get_type() perm_string PGModule::get_type() const
{ {
return type_; return type_;
} }

View File

@ -1,7 +1,7 @@
#ifndef __PGate_H #ifndef __PGate_H
#define __PGate_H #define __PGate_H
/* /*
* Copyright (c) 1998-2008 Stephen Williams (steve@icarus.com) * Copyright (c) 1998-2010 Stephen Williams (steve@icarus.com)
* *
* This source code is free software; you can redistribute it * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -215,7 +215,7 @@ class PGModule : public PGate {
// This returns the module name of this module. It is a // This returns the module name of this module. It is a
// permallocated string. // permallocated string.
perm_string get_type(); perm_string get_type() const;
private: private:
perm_string type_; perm_string type_;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2006,2009,2010 Stephen Williams (steve@icarus.com) * Copyright (c) 2006-2010 Stephen Williams (steve@icarus.com)
* *
* This source code is free software; you can redistribute it * This source code is free software; you can redistribute it
* and/or modify it in source code form under the terms of the GNU * and/or modify it in source code form under the terms of the GNU
@ -25,6 +25,10 @@ PGenerate::PGenerate(LexicalScope*parent, unsigned id)
: LexicalScope(parent), id_number(id) : LexicalScope(parent), id_number(id)
{ {
direct_nested_ = false; direct_nested_ = false;
scheme_type = GS_NONE;
loop_init = 0;
loop_test = 0;
loop_step = 0;
} }
PGenerate::~PGenerate() PGenerate::~PGenerate()

View File

@ -41,6 +41,7 @@ NetAssign_::NetAssign_(NetNet*s)
lwid_ = sig_->vector_width(); lwid_ = sig_->vector_width();
sig_->incr_lref(); sig_->incr_lref();
more = 0; more = 0;
turn_sig_to_wire_on_release_ = false;
} }
NetAssign_::~NetAssign_() NetAssign_::~NetAssign_()

View File

@ -43,6 +43,7 @@ Design:: Design()
des_precision_ = 0; des_precision_ = 0;
nodes_functor_cur_ = 0; nodes_functor_cur_ = 0;
nodes_functor_nxt_ = 0; nodes_functor_nxt_ = 0;
des_delay_sel_ = Design::TYP;
} }
Design::~Design() Design::~Design()

View File

@ -300,7 +300,7 @@ NetFuncDef* NetScope::func_def()
return func_; return func_;
} }
bool NetScope::in_func() bool NetScope::in_func() const
{ {
return (type_ == FUNC) ? true : false; return (type_ == FUNC) ? true : false;
} }

View File

@ -771,7 +771,7 @@ class NetScope : public Attrib {
unsigned get_lineno() const { return lineno_; }; unsigned get_lineno() const { return lineno_; };
unsigned get_def_lineno() const { return def_lineno_; }; unsigned get_def_lineno() const { return def_lineno_; };
bool in_func(); bool in_func() const;
/* Is the task or function automatic. */ /* Is the task or function automatic. */
void is_auto(bool is_auto__) { is_auto_ = is_auto__; }; void is_auto(bool is_auto__) { is_auto_ = is_auto__; };
bool is_auto() const { return is_auto_; }; bool is_auto() const { return is_auto_; };

View File

@ -102,7 +102,7 @@ struct net_decl_assign_t {
/* The lgate is gate instantiation information. */ /* The lgate is gate instantiation information. */
struct lgate { struct lgate {
lgate(int =0) lgate(int =0)
: parms(0), parms_by_name(0), lineno(0) : parms(0), parms_by_name(0), file(NULL), lineno(0)
{ range[0] = 0; { range[0] = 0;
range[1] = 0; range[1] = 0;
} }

View File

@ -2120,7 +2120,7 @@ bool dll_target::replicate(const NetReplicate*net)
* The assignment l-values are captured by the assignment statements * The assignment l-values are captured by the assignment statements
* themselves in the process handling. * themselves in the process handling.
*/ */
void dll_target::net_assign(const NetAssign_*) void dll_target::net_assign(const NetAssign_*) const
{ {
} }

View File

@ -80,7 +80,7 @@ struct dll_target : public target_t, public expr_scan_t {
bool concat(const NetConcat*); bool concat(const NetConcat*);
bool part_select(const NetPartSelect*); bool part_select(const NetPartSelect*);
bool replicate(const NetReplicate*); bool replicate(const NetReplicate*);
void net_assign(const NetAssign_*); void net_assign(const NetAssign_*) const;
bool net_sysfunction(const NetSysFunc*); bool net_sysfunction(const NetSysFunc*);
bool net_function(const NetUserFunc*); bool net_function(const NetUserFunc*);
bool net_const(const NetConst*); bool net_const(const NetConst*);

View File

@ -60,7 +60,7 @@ class vhdl_var_ref : public vhdl_expr {
public: public:
vhdl_var_ref(const string& name, const vhdl_type *type, vhdl_var_ref(const string& name, const vhdl_type *type,
vhdl_expr *slice = NULL) vhdl_expr *slice = NULL)
: vhdl_expr(type), name_(name), slice_(slice) {} : vhdl_expr(type), name_(name), slice_(slice), slice_width_(0) {}
~vhdl_var_ref(); ~vhdl_var_ref();
void emit(std::ostream &of, int level) const; void emit(std::ostream &of, int level) const;