@@ -20,7 +20,7 @@ int riscv_program_init(struct riscv_program *p, struct target *target)
2020 p -> target = target ;
2121 p -> instruction_count = 0 ;
2222
23- for (size_t i = 0 ; i < RISCV_MAX_PROGBUF_SIZE ; ++ i )
23+ for (unsigned int i = 0 ; i < RISCV013_MAX_PROGBUF_SIZE ; ++ i )
2424 p -> progbuf [i ] = (uint32_t )(-1 );
2525
2626 p -> execution_result = RISCV_PROGBUF_EXEC_RESULT_NOT_EXECUTED ;
@@ -47,9 +47,9 @@ int riscv_program_exec(struct riscv_program *p, struct target *t)
4747
4848 if (riscv_program_ebreak (p ) != ERROR_OK ) {
4949 LOG_TARGET_ERROR (t , "Unable to insert ebreak into program buffer" );
50- for (size_t i = 0 ; i < riscv_progbuf_size (p -> target ); ++ i )
50+ for (unsigned int i = 0 ; i < riscv_progbuf_size (p -> target ); ++ i )
5151 LOG_TARGET_ERROR (t , "progbuf[%02x]: DASM(0x%08" PRIx32 ") [0x%08" PRIx32 "]" ,
52- ( int ) i , p -> progbuf [i ], p -> progbuf [i ]);
52+ i , p -> progbuf [i ], p -> progbuf [i ]);
5353 return ERROR_FAIL ;
5454 }
5555
@@ -198,8 +198,8 @@ int riscv_program_insert(struct riscv_program *p, riscv_insn_t i)
198198{
199199 if (p -> instruction_count >= riscv_progbuf_size (p -> target )) {
200200 LOG_TARGET_ERROR (p -> target , "Unable to insert program into progbuf, "
201- "capacity would be exceeded (progbufsize=%d )." ,
202- ( int ) riscv_progbuf_size (p -> target ));
201+ "capacity would be exceeded (progbufsize=%u )." ,
202+ riscv_progbuf_size (p -> target ));
203203 return ERROR_FAIL ;
204204 }
205205
0 commit comments