Remove a few more cppcheck warnings in the tgt-* directories.

This commit is contained in:
Cary R 2012-08-31 17:56:32 -07:00
parent 4cd295cbba
commit cb9e1ee37e
5 changed files with 13 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003-2010 Stephen Williams (steve at icarus.com) * Copyright (c) 2003-2012 Stephen Williams (steve at 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
@ -877,7 +877,7 @@ void xilinx_shiftl(ivl_lpm_t net)
inputs. The slice on the low end shifts in a 0 for a select inputs. The slice on the low end shifts in a 0 for a select
input. */ input. */
for (qdx = 0 ; qdx < width ; qdx += 1) { for (qdx = 0 ; qdx < width ; qdx += 1) {
ivl_nexus_t nex0, nex1; ivl_nexus_t nex0;
edif_joint_t jnt0; edif_joint_t jnt0;
edif_joint_t jnt1; edif_joint_t jnt1;
@ -885,6 +885,7 @@ void xilinx_shiftl(ivl_lpm_t net)
jnt0 = edif_joint_of_nexus(edf, nex0); jnt0 = edif_joint_of_nexus(edf, nex0);
if (qdx > 0) { if (qdx > 0) {
ivl_nexus_t nex1;
nex1 = ivl_lpm_data(net,qdx-1); nex1 = ivl_lpm_data(net,qdx-1);
jnt1 = edif_joint_of_nexus(edf, nex1); jnt1 = edif_joint_of_nexus(edf, nex1);
} else { } else {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2007-2011 Stephen Williams (steve@icarus.com) * Copyright (c) 2007-2012 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
@ -410,7 +410,7 @@ void show_expression(ivl_expr_t net, unsigned ind)
break; break;
default: default:
fprintf(out, "%*s<expr_type=%u>\n", ind, "", code); fprintf(out, "%*s<expr_type=%d>\n", ind, "", code);
break; break;
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2004-2007,2012 Stephen Williams (steve@icarus.com) * Copyright (c) 2004-2012 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
@ -420,6 +420,6 @@ void show_statement(ivl_statement_t net, unsigned ind)
break; break;
default: default:
fprintf(out, "%*sunknown statement type (%u)\n", ind, "", code); fprintf(out, "%*sunknown statement type (%d)\n", ind, "", code);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000-2011 Stephen Williams (steve@icarus.com) * Copyright (c) 2000-2012 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
@ -567,7 +567,7 @@ static void show_lpm_mux(ivl_lpm_t net)
ivl_lpm_basename(net), width, size); ivl_lpm_basename(net), width, size);
nex = ivl_lpm_q(net); nex = ivl_lpm_q(net);
fprintf(out, " Q: %p <drive0/1 = %u/%u>\n", nex, drive0, drive1); fprintf(out, " Q: %p <drive0/1 = %d/%d>\n", nex, drive0, drive1);
if (width != width_of_nexus(nex)) { if (width != width_of_nexus(nex)) {
fprintf(out, " Q: ERROR: Nexus width is %u\n", fprintf(out, " Q: ERROR: Nexus width is %u\n",
width_of_nexus(nex)); width_of_nexus(nex));
@ -1511,9 +1511,9 @@ static void show_logic(ivl_net_logic_t net)
for (idx = 0 ; idx < npins ; idx += 1) { for (idx = 0 ; idx < npins ; idx += 1) {
ivl_nexus_t nex = ivl_logic_pin(net, idx); ivl_nexus_t nex = ivl_logic_pin(net, idx);
fprintf(out, " %d: %p", idx, nex); fprintf(out, " %u: %p", idx, nex);
if (idx == 0) if (idx == 0)
fprintf(out, " <drive0/1 = %u/%u>", drive0, drive1); fprintf(out, " <drive0/1 = %d/%d>", drive0, drive1);
fprintf(out, "\n"); fprintf(out, "\n");
if (nex == 0) { if (nex == 0) {
@ -1526,7 +1526,7 @@ static void show_logic(ivl_net_logic_t net)
} }
if (ivl_logic_width(net) != width_of_nexus(nex)) { if (ivl_logic_width(net) != width_of_nexus(nex)) {
fprintf(out, " %d: ERROR: Nexus width is %u\n", fprintf(out, " %u: ERROR: Nexus width is %u\n",
idx, width_of_nexus(nex)); idx, width_of_nexus(nex));
stub_errors += 1; stub_errors += 1;
} }

View File

@ -377,7 +377,7 @@ static void show_statement(ivl_statement_t net, unsigned ind)
break; break;
default: default:
fprintf(out, "%*sunknown statement type (%u)\n", ind, "", code); fprintf(out, "%*sunknown statement type (%d)\n", ind, "", code);
} }
} }