diff --git a/src/disk.c b/src/disk.c index 5ee62b9f..0a17c52d 100644 --- a/src/disk.c +++ b/src/disk.c @@ -1213,7 +1213,7 @@ bool disk6_loadState(StateHelper_s *helper) { } #if DISK_TRACING -void c_begin_disk_trace_6(const char *read_file, const char *write_file) { +void disk6_traceBegin(const char *read_file, const char *write_file) { if (read_file) { TEMP_FAILURE_RETRY_FOPEN(test_read_fp = fopen(read_file, "w")); } @@ -1222,7 +1222,7 @@ void c_begin_disk_trace_6(const char *read_file, const char *write_file) { } } -void c_end_disk_trace_6(void) { +void disk6_traceEnd(void) { if (test_read_fp) { TEMP_FAILURE_RETRY(fflush(test_read_fp)); TEMP_FAILURE_RETRY(fclose(test_read_fp)); @@ -1235,11 +1235,11 @@ void c_end_disk_trace_6(void) { } } -void c_toggle_disk_trace_6(const char *read_file, const char *write_file) { +void disk6_traceToggle(const char *read_file, const char *write_file) { if (test_read_fp) { - c_end_disk_trace_6(); + disk6_traceEnd(); } else { - c_begin_disk_trace_6(read_file, write_file); + disk6_traceBegin(read_file, write_file); } } #endif diff --git a/src/disk.h b/src/disk.h index 5f040fb3..032b3df7 100644 --- a/src/disk.h +++ b/src/disk.h @@ -91,9 +91,9 @@ extern bool disk6_saveState(StateHelper_s *helper); extern bool disk6_loadState(StateHelper_s *helper); #if DISK_TRACING -void c_toggle_disk_trace_6(const char *read_file, const char *write_file); -void c_begin_disk_trace_6(const char *read_file, const char *write_file); -void c_end_disk_trace_6(void); +void disk6_traceToggle(const char *read_file, const char *write_file); +void disk6_traceBegin(const char *read_file, const char *write_file); +void disk6_traceEnd(void); #endif #endif diff --git a/src/meta/debug.c b/src/meta/debug.c index b2756d73..389288c6 100644 --- a/src/meta/debug.c +++ b/src/meta/debug.c @@ -1241,7 +1241,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1254,7 +1254,7 @@ static int input (void ); else \ { \ errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + while ( (result = fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ @@ -2382,7 +2382,7 @@ YY_RULE_SETUP #if DISK_TRACING char *buf = NULL; asprintf(&buf, "%s/%s", HOMEDIR, "disktrace.txt"); - c_toggle_disk_trace_6(buf, NULL); + disk6_traceToggle(buf, NULL); FREE(buf); #else LOG("Disk tracing not enabled..."); @@ -2725,7 +2725,7 @@ static int yy_get_next_buffer (void) else { - yy_size_t num_to_read = + int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) diff --git a/src/meta/debug.l b/src/meta/debug.l index 43b29eaa..4a2a6d2e 100644 --- a/src/meta/debug.l +++ b/src/meta/debug.l @@ -864,7 +864,7 @@ ADDRS [0-9a-fA-F]+ #if DISK_TRACING char *buf = NULL; asprintf(&buf, "%s/%s", HOMEDIR, "disktrace.txt"); - c_toggle_disk_trace_6(buf, NULL); + disk6_traceToggle(buf, NULL); FREE(buf); #else LOG("Disk tracing not enabled..."); diff --git a/src/test/testdisk.c b/src/test/testdisk.c index f8c936ed..a488b59a 100644 --- a/src/test/testdisk.c +++ b/src/test/testdisk.c @@ -54,12 +54,12 @@ TEST test_boot_disk_bytes() { ASPRINTF(&disk, "%s/a2_read_disk_test.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(disk, NULL); + disk6_traceBegin(disk, NULL); } BOOT_TO_DOS(); - c_end_disk_trace_6(); + disk6_traceEnd(); disk6_eject(0); do { @@ -102,12 +102,12 @@ TEST test_boot_disk_bytes_nib() { ASPRINTF(&disk, "%s/a2_read_disk_test_nib.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(disk, NULL); + disk6_traceBegin(disk, NULL); } BOOT_TO_DOS(); - c_end_disk_trace_6(); + disk6_traceEnd(); disk6_eject(0); do { @@ -155,12 +155,12 @@ TEST test_boot_disk_bytes_po() { ASPRINTF(&disk, "%s/a2_read_disk_test_po.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(disk, NULL); + disk6_traceBegin(disk, NULL); } BOOT_TO_DOS(); - c_end_disk_trace_6(); + disk6_traceEnd(); disk6_eject(0); do { @@ -344,7 +344,7 @@ TEST test_disk_bytes_savehello_dsk() { ASPRINTF(&disk, "%s/a2_write_disk_test_dsk.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(NULL, disk); + disk6_traceBegin(NULL, disk); } apple_ii_64k[0][WATCHPOINT_ADDR] = 0x0; @@ -356,7 +356,7 @@ TEST test_disk_bytes_savehello_dsk() { ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED); ASSERT_SHA(SAVE_SHA1); - c_end_disk_trace_6(); + disk6_traceEnd(); do { uint8_t md[SHA_DIGEST_LENGTH]; @@ -438,7 +438,7 @@ TEST test_disk_bytes_savehello_nib() { ASPRINTF(&disk, "%s/a2_write_disk_test_nib.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(NULL, disk); + disk6_traceBegin(NULL, disk); } apple_ii_64k[0][WATCHPOINT_ADDR] = 0x0; @@ -450,7 +450,7 @@ TEST test_disk_bytes_savehello_nib() { ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED); ASSERT_SHA(SAVE_SHA1); - c_end_disk_trace_6(); + disk6_traceEnd(); do { uint8_t md[SHA_DIGEST_LENGTH]; @@ -532,7 +532,7 @@ TEST test_disk_bytes_savehello_po() { ASPRINTF(&disk, "%s/a2_write_disk_test_po.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(NULL, disk); + disk6_traceBegin(NULL, disk); } apple_ii_64k[0][WATCHPOINT_ADDR] = 0x0; @@ -544,7 +544,7 @@ TEST test_disk_bytes_savehello_po() { ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED); ASSERT_SHA(SAVE_SHA1); - c_end_disk_trace_6(); + disk6_traceEnd(); do { uint8_t md[SHA_DIGEST_LENGTH]; @@ -645,7 +645,7 @@ TEST test_outofspace_dsk() { ASPRINTF(&disk, "%s/a2_oos_dsk_test.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(NULL, disk); + disk6_traceBegin(NULL, disk); } apple_ii_64k[0][WATCHPOINT_ADDR] = 0x0; @@ -657,7 +657,7 @@ TEST test_outofspace_dsk() { ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED); ASSERT_SHA(NOSPACE_SHA1); - c_end_disk_trace_6(); + disk6_traceEnd(); do { uint8_t md[SHA_DIGEST_LENGTH]; @@ -856,7 +856,7 @@ TEST test_bload_trace_dsk() { ASPRINTF(&disk, "%s/a2_bload_trace_test_dsk.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(disk, NULL); + disk6_traceBegin(disk, NULL); } test_type_input("CALL-151\r"); @@ -925,7 +925,7 @@ TEST test_bload_trace_dsk() { ASSERT_SHA_MEM(JUNK_MEM_END_SHA1, 0x2000, 0x4000); ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED); - c_end_disk_trace_6(); + disk6_traceEnd(); do { uint8_t md[SHA_DIGEST_LENGTH]; @@ -974,7 +974,7 @@ TEST test_bload_trace_nib() { ASPRINTF(&disk, "%s/a2_bload_trace_test_nib.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(disk, NULL); + disk6_traceBegin(disk, NULL); } test_type_input("CALL-151\r"); @@ -1043,7 +1043,7 @@ TEST test_bload_trace_nib() { ASSERT_SHA_MEM(JUNK_MEM_END_SHA1, 0x2000, 0x4000); ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED); - c_end_disk_trace_6(); + disk6_traceEnd(); do { uint8_t md[SHA_DIGEST_LENGTH]; @@ -1092,7 +1092,7 @@ TEST test_bload_trace_po() { ASPRINTF(&disk, "%s/a2_bload_trace_test_po.txt", homedir); if (disk) { unlink(disk); - c_begin_disk_trace_6(disk, NULL); + disk6_traceBegin(disk, NULL); } test_type_input("CALL-151\r"); @@ -1161,7 +1161,7 @@ TEST test_bload_trace_po() { ASSERT_SHA_MEM(JUNK_MEM_END_SHA1, 0x2000, 0x4000); ASSERT(apple_ii_64k[0][WATCHPOINT_ADDR] == TEST_FINISHED); - c_end_disk_trace_6(); + disk6_traceEnd(); do { uint8_t md[SHA_DIGEST_LENGTH];