Permalink
Browse files

Remove some cppcheck warnings.

This patch modifies the code to remove some more cppcheck warnings.
  • Loading branch information...
1 parent 44b08a4 commit 86653ddff9c0ed87c4d6bfc658b7b42b2c3641a7 @caryr caryr committed with steveicarus Jul 23, 2010
Showing with 19 additions and 10 deletions.
  1. +3 −0 Module.cc
  2. +1 −1 PGate.cc
  3. +2 −2 PGate.h
  4. +5 −1 PGenerate.cc
  5. +1 −0 net_assign.cc
  6. +1 −0 net_design.cc
  7. +1 −1 net_scope.cc
  8. +1 −1 netlist.h
  9. +1 −1 pform.h
  10. +1 −1 t-dll.cc
  11. +1 −1 t-dll.h
  12. +1 −1 tgt-vhdl/vhdl_syntax.hh
View
@@ -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()
View
@@ -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_;
}
View
@@ -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
@@ -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_;
View
@@ -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
@@ -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()
View
@@ -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_()
View
@@ -43,6 +43,7 @@ Design:: Design()
des_precision_ = 0;
nodes_functor_cur_ = 0;
nodes_functor_nxt_ = 0;
+ des_delay_sel_ = Design::TYP;
}
Design::~Design()
View
@@ -300,7 +300,7 @@ NetFuncDef* NetScope::func_def()
return func_;
}
-bool NetScope::in_func()
+bool NetScope::in_func() const
{
return (type_ == FUNC) ? true : false;
}
View
@@ -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_; };
View
@@ -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;
}
View
@@ -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
{
}
View
@@ -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*);
View
@@ -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;

0 comments on commit 86653dd

Please sign in to comment.