diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2011-05-07 10:09:26 +0000 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2011-05-07 10:09:26 +0000 |
commit | e2a75038805fc678186db4a21cd3c5577e47081b (patch) | |
tree | 4e3fa83121c6be38a5aa1d839d5d13946d61c2d1 | |
parent | 3b01fd9a7621aabc9f358aa91b6bb5291d8f3745 (diff) |
formats lib - Removed some core dependency, put back asserts and made logging mapping depend of define (no whatsnew)
-rw-r--r-- | src/lib/formats/cassimg.c | 10 | ||||
-rw-r--r-- | src/lib/formats/cassimg.h | 6 | ||||
-rw-r--r-- | src/lib/formats/coco_dsk.c | 1 | ||||
-rw-r--r-- | src/lib/formats/flopimg.h | 6 | ||||
-rw-r--r-- | src/lib/formats/g64_dsk.c | 5 | ||||
-rw-r--r-- | src/lib/formats/tzx_cas.c | 6 | ||||
-rw-r--r-- | src/lib/formats/z80ne_dsk.c | 3 |
7 files changed, 24 insertions, 13 deletions
diff --git a/src/lib/formats/cassimg.c b/src/lib/formats/cassimg.c index 151940bb169..bb6a14a3f22 100644 --- a/src/lib/formats/cassimg.c +++ b/src/lib/formats/cassimg.c @@ -6,7 +6,7 @@ *********************************************************************/ - +#include <assert.h> #include <string.h> #include "imageutl.h" @@ -452,7 +452,7 @@ casserr_t cassette_get_samples(cassette_image *cassette, int channel, INT32 dword; INT64 sum; -// assert(cassette); + assert(cassette); err = compute_manipulation_ranges(cassette, channel, time_index, sample_period, &ranges); if (err) @@ -899,9 +899,9 @@ casserr_t cassette_legacy_construct(cassette_image *cassette, struct CassetteLegacyWaveFiller args; /* sanity check the args */ - //assert(legacy_args->header_samples >= -1); - //assert(legacy_args->trailer_samples >= 0); - //assert(legacy_args->fill_wave); + assert(legacy_args->header_samples >= -1); + assert(legacy_args->trailer_samples >= 0); + assert(legacy_args->fill_wave); size = cassette_image_size(cassette); diff --git a/src/lib/formats/cassimg.h b/src/lib/formats/cassimg.h index 84655eadc8c..7d3d24890a1 100644 --- a/src/lib/formats/cassimg.h +++ b/src/lib/formats/cassimg.h @@ -13,8 +13,12 @@ #include "pool.h" #include "ioprocs.h" +#ifndef LOG_FORMATS +#define LOG_FORMATS 0 +#endif + #ifndef logerror -#define logerror printf +#define logerror if (LOG_FORMATS) printf #endif /*************************************************************************** diff --git a/src/lib/formats/coco_dsk.c b/src/lib/formats/coco_dsk.c index 8cc34627a6c..4cd4902287d 100644 --- a/src/lib/formats/coco_dsk.c +++ b/src/lib/formats/coco_dsk.c @@ -10,7 +10,6 @@ #include <assert.h> #include <time.h> -#include "osdepend.h" #include "formats/coco_dsk.h" #include "formats/basicdsk.h" #include "imageutl.h" diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h index aaf4508886f..7b02815bd56 100644 --- a/src/lib/formats/flopimg.h +++ b/src/lib/formats/flopimg.h @@ -13,8 +13,12 @@ #include "ioprocs.h" #include "opresolv.h" +#ifndef LOG_FORMATS +#define LOG_FORMATS 0 +#endif + #ifndef logerror -#define logerror printf +#define logerror if (LOG_FORMATS) printf #endif /*************************************************************************** diff --git a/src/lib/formats/g64_dsk.c b/src/lib/formats/g64_dsk.c index 787468b6dca..44d19dbdfe3 100644 --- a/src/lib/formats/g64_dsk.c +++ b/src/lib/formats/g64_dsk.c @@ -275,10 +275,11 @@ FLOPPY_CONSTRUCT( g64_dsk_construct ) if (LOG) { - if (tag->speed_zone_offset[i] < 4) + if (tag->speed_zone_offset[i] < 4) { logerror("G64 track %.1f speed zone: %u\n", get_dos_track(i), tag->speed_zone_offset[i]); - else + } else { logerror("G64 track %.1f speed zone offset: %04x\n", get_dos_track(i), tag->speed_zone_offset[i]); + } } } diff --git a/src/lib/formats/tzx_cas.c b/src/lib/formats/tzx_cas.c index da8084160b2..4c5a06dfbef 100644 --- a/src/lib/formats/tzx_cas.c +++ b/src/lib/formats/tzx_cas.c @@ -416,10 +416,12 @@ static int tzx_cas_do_work( INT16 **buffer ) text_size = 0; for (data_size = 0; data_size < cur_block[3]; data_size++) // data_size = number of text blocks, in this case { - if (cur_block[4 + text_size] < 0x09) + if (cur_block[4 + text_size] < 0x09) { logerror("%s: \n", archive_ident[cur_block[4 + text_size]]); - else + } + else { logerror("Comment(s): \n"); + } for (i = 0; i < cur_block[4 + text_size + 1]; i++) { diff --git a/src/lib/formats/z80ne_dsk.c b/src/lib/formats/z80ne_dsk.c index c35af51fa4d..5e50e22bc95 100644 --- a/src/lib/formats/z80ne_dsk.c +++ b/src/lib/formats/z80ne_dsk.c @@ -6,6 +6,7 @@ *********************************************************************/ +#include <assert.h> #include "z80ne_dsk.h" #include "basicdsk.h" #include "imageutl.h" @@ -323,7 +324,7 @@ static floperr_t z80ne_dmk_format_track(floppy_image *floppy, int head, int trac } /* write track footer GAP4 */ - //assert(max_track_size >= (UINT32)track_position); + assert(max_track_size >= (UINT32)track_position); memset(&track_data[track_position], 0xFF, max_track_size - track_position); done: |