Fix compiler warnings

0.96
Török Edvin 17 years ago
parent 3555ee75bf
commit 2cad7c395d
  1. 10
      libclamav/bytecode.c

@ -174,7 +174,7 @@ static inline operand_t readOperand(struct cli_bc_func *func, unsigned char *p,
if (!*ok) if (!*ok)
return MAX_OP; return MAX_OP;
if (v >= numValues) { if (v >= numValues) {
cli_errmsg("Operand index exceeds bounds: %u >= %u!\n", v, numValues); cli_errmsg("Operand index exceeds bounds: %u >= %u!\n", (unsigned)v, (unsigned)numValues);
*ok = 0; *ok = 0;
return MAX_OP; return MAX_OP;
} }
@ -507,7 +507,7 @@ static int parseBB(struct cli_bc *bc, unsigned func, unsigned bb, unsigned char
} }
BB->insts[BB->numInsts++] = inst; BB->insts[BB->numInsts++] = inst;
} }
if (bb == bc->funcs[func].numBB-1) { if (bb+1 == bc->funcs[func].numBB) {
if (buffer[offset] != 'E') { if (buffer[offset] != 'E') {
cli_errmsg("Missing basicblock terminator, got: %c\n", buffer[offset]); cli_errmsg("Missing basicblock terminator, got: %c\n", buffer[offset]);
return CL_EMALFDB; return CL_EMALFDB;
@ -598,9 +598,9 @@ void cli_bytecode_destroy(struct cli_bc *bc)
for (j=0;j<f->numBB;j++) { for (j=0;j<f->numBB;j++) {
struct cli_bc_bb *BB = &f->BB[j]; struct cli_bc_bb *BB = &f->BB[j];
for(k=0;k<BB->numInsts;k++) { for(k=0;k<BB->numInsts;k++) {
struct cli_bc_inst *i = &BB->insts[k]; struct cli_bc_inst *ii = &BB->insts[k];
if (operand_counts[i->opcode] > 3) if (operand_counts[ii->opcode] > 3)
free(i->u.ops.ops); free(ii->u.ops.ops);
} }
} }
free(f->BB); free(f->BB);

Loading…
Cancel
Save