Skip to content

Commit

Permalink
Remove some cppcheck warnings.
Browse files Browse the repository at this point in the history
This patch modifies the code to remove some more cppcheck warnings.
  • Loading branch information
caryr authored and steveicarus committed Jul 31, 2010
1 parent 44b08a4 commit 86653dd
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Module.cc
Expand Up @@ -34,6 +34,9 @@ Module::Module(perm_string n)
is_cell = false;
uc_drive = UCD_NONE;
timescale_warn_done = false;
time_unit = 0;
time_precision = 0;
time_from_timescale = false;
}

Module::~Module()
Expand Down
2 changes: 1 addition & 1 deletion PGate.cc
Expand Up @@ -288,7 +288,7 @@ void PGModule::set_range(PExpr*msb, PExpr*lsb)
lsb_ = lsb;
}

perm_string PGModule::get_type()
perm_string PGModule::get_type() const
{
return type_;
}
4 changes: 2 additions & 2 deletions PGate.h
@@ -1,7 +1,7 @@
#ifndef __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
* and/or modify it in source code form under the terms of the GNU
Expand Down Expand Up @@ -215,7 +215,7 @@ class PGModule : public PGate {

// This returns the module name of this module. It is a
// permallocated string.
perm_string get_type();
perm_string get_type() const;

private:
perm_string type_;
Expand Down
6 changes: 5 additions & 1 deletion PGenerate.cc
@@ -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
* and/or modify it in source code form under the terms of the GNU
Expand All @@ -25,6 +25,10 @@ PGenerate::PGenerate(LexicalScope*parent, unsigned id)
: LexicalScope(parent), id_number(id)
{
direct_nested_ = false;
scheme_type = GS_NONE;
loop_init = 0;
loop_test = 0;
loop_step = 0;
}

PGenerate::~PGenerate()
Expand Down
1 change: 1 addition & 0 deletions net_assign.cc
Expand Up @@ -41,6 +41,7 @@ NetAssign_::NetAssign_(NetNet*s)
lwid_ = sig_->vector_width();
sig_->incr_lref();
more = 0;
turn_sig_to_wire_on_release_ = false;
}

NetAssign_::~NetAssign_()
Expand Down
1 change: 1 addition & 0 deletions net_design.cc
Expand Up @@ -43,6 +43,7 @@ Design:: Design()
des_precision_ = 0;
nodes_functor_cur_ = 0;
nodes_functor_nxt_ = 0;
des_delay_sel_ = Design::TYP;
}

Design::~Design()
Expand Down
2 changes: 1 addition & 1 deletion net_scope.cc
Expand Up @@ -300,7 +300,7 @@ NetFuncDef* NetScope::func_def()
return func_;
}

bool NetScope::in_func()
bool NetScope::in_func() const
{
return (type_ == FUNC) ? true : false;
}
Expand Down
2 changes: 1 addition & 1 deletion netlist.h
Expand Up @@ -771,7 +771,7 @@ class NetScope : public Attrib {
unsigned get_lineno() const { return lineno_; };
unsigned get_def_lineno() const { return def_lineno_; };

bool in_func();
bool in_func() const;
/* Is the task or function automatic. */
void is_auto(bool is_auto__) { is_auto_ = is_auto__; };
bool is_auto() const { return is_auto_; };
Expand Down
2 changes: 1 addition & 1 deletion pform.h
Expand Up @@ -102,7 +102,7 @@ struct net_decl_assign_t {
/* The lgate is gate instantiation information. */
struct lgate {
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[1] = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion t-dll.cc
Expand Up @@ -2120,7 +2120,7 @@ bool dll_target::replicate(const NetReplicate*net)
* The assignment l-values are captured by the assignment statements
* themselves in the process handling.
*/
void dll_target::net_assign(const NetAssign_*)
void dll_target::net_assign(const NetAssign_*) const
{
}

Expand Down
2 changes: 1 addition & 1 deletion t-dll.h
Expand Up @@ -80,7 +80,7 @@ struct dll_target : public target_t, public expr_scan_t {
bool concat(const NetConcat*);
bool part_select(const NetPartSelect*);
bool replicate(const NetReplicate*);
void net_assign(const NetAssign_*);
void net_assign(const NetAssign_*) const;
bool net_sysfunction(const NetSysFunc*);
bool net_function(const NetUserFunc*);
bool net_const(const NetConst*);
Expand Down
2 changes: 1 addition & 1 deletion tgt-vhdl/vhdl_syntax.hh
Expand Up @@ -60,7 +60,7 @@ class vhdl_var_ref : public vhdl_expr {
public:
vhdl_var_ref(const string& name, const vhdl_type *type,
vhdl_expr *slice = NULL)
: vhdl_expr(type), name_(name), slice_(slice) {}
: vhdl_expr(type), name_(name), slice_(slice), slice_width_(0) {}
~vhdl_var_ref();

void emit(std::ostream &of, int level) const;
Expand Down

0 comments on commit 86653dd

Please sign in to comment.