diff --git a/expr_synth.cc b/expr_synth.cc index 057f905a1..fa0a69f2c 100644 --- a/expr_synth.cc +++ b/expr_synth.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999-2011 Stephen Williams (steve@icarus.com) + * Copyright (c) 1999-2012 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 @@ -1006,8 +1006,6 @@ NetNet* NetESelect::synthesize(Design *des, NetScope*scope, NetExpr*root) if (sub == 0) return 0; - NetNet*off = 0; - // Detect the special case that there is a base expression and // it is constant. In this case we can generate fixed part selects. if (NetEConst*base_const = dynamic_cast(base_)) { @@ -1106,7 +1104,7 @@ NetNet* NetESelect::synthesize(Design *des, NetScope*scope, NetExpr*root) // actual part/bit select. Generate a NetPartSelect object to // do the work, and replace "sub" with the selected output. if (base_ != 0) { - off = base_->synthesize(des, scope, root); + NetNet*off = base_->synthesize(des, scope, root); NetPartSelect*sel = new NetPartSelect(sub, off, expr_width(), base_->has_sign()); diff --git a/link_const.cc b/link_const.cc index 467c30a13..258839bb1 100644 --- a/link_const.cc +++ b/link_const.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Stephen Williams (steve@icarus.com) + * Copyright (c) 2000-2012 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 @@ -35,7 +35,6 @@ bool Nexus::drivers_constant() const return true; for (const Link*cur = first_nlink() ; cur ; cur = cur->next_nlink()) { - const NetNet*sig; Link::DIR cur_dir; cur_dir = cur->get_dir(); @@ -56,6 +55,7 @@ bool Nexus::drivers_constant() const outside world. */ if (cur_dir == Link::PASSIVE) { + const NetNet*sig; const NetPins*obj = cur->get_obj(); const NetObj*as_obj = dynamic_cast(obj); diff --git a/vvp/arith.cc b/vvp/arith.cc index 83b831c76..f69b3c4e3 100644 --- a/vvp/arith.cc +++ b/vvp/arith.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2011 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2012 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 @@ -46,7 +46,7 @@ void vvp_arith_::dispatch_operand_(vvp_net_ptr_t ptr, vvp_vector4_t bit) op_b_ = bit; break; default: - fprintf(stderr, "Unsupported port type %d.\n", port); + fprintf(stderr, "Unsupported port type %u.\n", port); assert(0); } } diff --git a/vvp/compile.cc b/vvp/compile.cc index a7edb6ce3..6dd05a13f 100644 --- a/vvp/compile.cc +++ b/vvp/compile.cc @@ -1517,7 +1517,7 @@ void compile_resolver(char*label, char*type, unsigned argc, struct symb_s*argv) } else { fprintf(stderr, "invalid resolver type: %s\n", type); compile_errors += 1; - free(net); + delete net; } if (core) {