1+ // NOLINTBEGIN
12#include "cli.h"
23
34#include "3rd/disassembler.h"
1112#include "serial.h"
1213#include "time.h"
1314#include "tokenizer.h"
15+ #include "type.h"
1416
1517#include <assert.h>
1618#include <ctype.h>
1719#include <errno.h>
1820#include <inttypes.h>
1921#include <netinet/in.h>
2022#include <stdbool.h>
23+ #include <stdint.h>
2124#include <stdlib.h>
2225#include <string.h>
2326#include <sys/select.h>
@@ -163,7 +166,7 @@ static ceda_string_t *cli_break(const char *arg) {
163166 ceda_string_cpy (msg , USER_BAD_ARG_STR "address must be 16 bit\n" );
164167 return msg ;
165168 }
166- const zuint16 address = (zuint16 )_address ;
169+ const uint16_t address = (uint16_t )_address ;
167170
168171 // actually set breakpoint
169172 bool ret = cpu_addBreakpoint (address );
@@ -255,7 +258,7 @@ static ceda_string_t *cli_read(const char *arg) {
255258 // read some mem
256259 const ceda_size_t BLOB_SIZE = 8 * (size_t )16 ;
257260 uint8_t blob [BLOB_SIZE ];
258- bus_mem_readsome (blob , (zuint16 )address , BLOB_SIZE );
261+ bus_mem_readsome (blob , (uint16_t )address , BLOB_SIZE );
259262
260263 // print nice hexdump
261264 uint8_t ascii [16 + 1 ] = {0 };
@@ -266,7 +269,7 @@ static ceda_string_t *cli_read(const char *arg) {
266269 ceda_string_printf (msg , "%04x\t" , address + i );
267270 }
268271
269- ceda_string_printf (msg , "%02x " , ((unsigned int )( c ) ) & 0xff );
272+ ceda_string_printf (msg , "%02x " , ((unsigned int )c ) & 0xff );
270273 ascii [i % 16 ] = isprint (c ) ? c : '.' ;
271274
272275 if (i % 16 == 8 - 1 ) {
@@ -301,10 +304,10 @@ static ceda_string_t *cli_write(const char *arg) {
301304 ceda_string_cpy (msg , USER_BAD_ARG_STR "address must be 16 bit\n" );
302305 return msg ;
303306 }
304- const zuint16 address = (zuint16 )_address ;
307+ const uint16_t address = (uint16_t )_address ;
305308
306309 // read values, and put them in memory
307- for (zuint16 i = 0 ;; ++ i ) {
310+ for (uint16_t i = 0 ;; ++ i ) {
308311 // extract value
309312 unsigned int _value ;
310313 arg = tokenizer_next_hex (& _value , arg );
@@ -324,7 +327,7 @@ static ceda_string_t *cli_write(const char *arg) {
324327 ceda_string_cpy (msg , USER_BAD_ARG_STR "value must be 8 bit\n" );
325328 return msg ;
326329 }
327- const zuint8 value = (zuint8 )_value ;
330+ const uint8_t value = (uint8_t )_value ;
328331
329332 bus_mem_write (address + i , value );
330333 }
@@ -353,7 +356,7 @@ static ceda_string_t *cli_dis(const char *arg) {
353356 char line [LINE_BUFFER_SIZE ];
354357 uint8_t blob [CPU_MAX_OPCODE_LEN ];
355358 for (int i = 0 ; i < 16 ; ++ i ) {
356- bus_mem_readsome (blob , (zuint16 )(address + (unsigned int )disb ),
359+ bus_mem_readsome (blob , (uint16_t )(address + (unsigned int )disb ),
357360 CPU_MAX_OPCODE_LEN );
358361 disb += disassemble (blob , (int )address + disb , line , BLOCK_BUFFER_SIZE );
359362 ceda_string_printf (msg , "%s\n" , line );
@@ -440,7 +443,7 @@ static ceda_string_t *cli_save(const char *arg) {
440443 blob [0 ] = lsb ;
441444 blob [1 ] = msb ;
442445 // payload
443- bus_mem_readsome (& blob [2 ], (zuint16 )start_address , data_size );
446+ bus_mem_readsome (& blob [2 ], (uint16_t )start_address , data_size );
444447 // write
445448 size_t written = fwrite (blob , 1 , alloc_size , fp );
446449 if (written != alloc_size ) {
@@ -545,7 +548,7 @@ static ceda_string_t *cli_load_and_run(const char *arg, bool run) {
545548 ret = fread (& c , 1 , 1 , fp );
546549 if (ret == 0 )
547550 break ;
548- bus_mem_write ((zuint16 )address ++ , (zuint8 )c );
551+ bus_mem_write ((uint16_t )address ++ , (uint8_t )c );
549552 }
550553
551554 (void )fclose (fp );
@@ -662,7 +665,7 @@ static ceda_string_t *cli_goto(const char *arg) {
662665 }
663666
664667 // inconditional jump
665- cpu_goto ((zuint16 )address );
668+ cpu_goto ((uint16_t )address );
666669 return NULL ;
667670}
668671
@@ -728,7 +731,7 @@ static ceda_string_t *cli_in(const char *arg) {
728731 return msg ;
729732 }
730733
731- const zuint8 value = bus_io_in ((ceda_ioaddr_t )address );
734+ const uint8_t value = bus_io_in ((ceda_ioaddr_t )address );
732735 ceda_string_printf (msg , "%02x\n" , value );
733736 return msg ;
734737}
@@ -764,7 +767,7 @@ static ceda_string_t *cli_out(const char *arg) {
764767 return msg ;
765768 }
766769
767- bus_io_out ((ceda_ioaddr_t )address , (zuint8 )value );
770+ bus_io_out ((ceda_ioaddr_t )address , (uint8_t )value );
768771
769772 ceda_string_delete (msg );
770773 return NULL ;
@@ -1201,3 +1204,5 @@ Test(cli, delete, .init = cli_test_setup) {
12011204}
12021205
12031206#endif
1207+ //NOLINTEND
1208+
0 commit comments