summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/formats/cassimg.cpp2
-rw-r--r--src/lib/formats/fdi_dsk.cpp4
-rw-r--r--src/lib/util/corefile.cpp2
-rw-r--r--src/lib/util/jedparse.cpp6
-rw-r--r--src/lib/util/plaparse.cpp32
-rw-r--r--src/lib/util/vbiparse.cpp6
6 files changed, 26 insertions, 26 deletions
diff --git a/src/lib/formats/cassimg.cpp b/src/lib/formats/cassimg.cpp
index 87636b81349..d711aa01770 100644
--- a/src/lib/formats/cassimg.cpp
+++ b/src/lib/formats/cassimg.cpp
@@ -509,7 +509,7 @@ cassette_image::error cassette_put_samples(cassette_image *cassette, int channel
cassette->sample_count = ranges.sample_last + 1;
cassette->flags |= CASSETTE_FLAG_DIRTY;
- if (LOG_PUT_SAMPLES)
+ if (IS_ENABLED(LOG_PUT_SAMPLES))
{
LOG_FORMATS("cassette_put_samples(): Putting samples TIME=[%2.6g..%2.6g] INDEX=[%i..%i]\n",
time_index, time_index + sample_period,
diff --git a/src/lib/formats/fdi_dsk.cpp b/src/lib/formats/fdi_dsk.cpp
index c703f29cc69..11036e40e51 100644
--- a/src/lib/formats/fdi_dsk.cpp
+++ b/src/lib/formats/fdi_dsk.cpp
@@ -241,7 +241,7 @@ FLOPPY_CONSTRUCT( fdi_dsk_construct )
tag->tracks = pick_integer_be(header.ltrack, 0, 2) + 1;
tag->heads = header.lhead + 1;
- if (LOG)
+ if (IS_ENABLED(LOG))
{
LOG_FORMATS("FDI creator: %s\n", header.creator);
LOG_FORMATS("FDI comment: %s\n", header.comment);
@@ -264,7 +264,7 @@ FLOPPY_CONSTRUCT( fdi_dsk_construct )
uint8_t type = header.track[track].type;
int size = header.track[track].size * 256;
- if (LOG) LOG_FORMATS("FDI track %d type %02x size %d offset %d\n", track, type, size, offset);
+ if (IS_ENABLED(LOG)) LOG_FORMATS("FDI track %d type %02x size %d offset %d\n", track, type, size, offset);
tag->track_offset[track] = offset;
tag->track_type[track] = type;
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp
index 264d80f4113..6272ea120ad 100644
--- a/src/lib/util/corefile.cpp
+++ b/src/lib/util/corefile.cpp
@@ -663,7 +663,7 @@ bool core_in_memory_file::eof() const
{
// check for buffered chars
if (has_putback())
- return 0;
+ return false;
// if the offset == length, we're at EOF
return (m_offset >= m_length);
diff --git a/src/lib/util/jedparse.cpp b/src/lib/util/jedparse.cpp
index c2c9a139a6a..dc7c4ac4706 100644
--- a/src/lib/util/jedparse.cpp
+++ b/src/lib/util/jedparse.cpp
@@ -137,7 +137,7 @@ static void process_field(jed_data *data, const uint8_t *cursrc, const uint8_t *
/* default fuse state (0 or 1) */
case 'F':
cursrc++;
- if (LOG_PARSE) printf("F%c\n", *cursrc);
+ if (IS_ENABLED(LOG_PARSE)) printf("F%c\n", *cursrc);
if (*cursrc == '0')
memset(data->fusemap, 0x00, sizeof(data->fusemap));
else
@@ -152,14 +152,14 @@ static void process_field(jed_data *data, const uint8_t *cursrc, const uint8_t *
/* read the fuse number */
cursrc++;
curfuse = suck_number(&cursrc);
- if (LOG_PARSE) printf("L%u\n", curfuse);
+ if (IS_ENABLED(LOG_PARSE)) printf("L%u\n", curfuse);
/* read digits, skipping delimiters */
for ( ; cursrc < srcend; cursrc++)
if (*cursrc == '0' || *cursrc == '1')
{
jed_set_fuse(data, curfuse, *cursrc - '0');
- if (LOG_PARSE) printf(" fuse %u = %d\n", curfuse, 0);
+ if (IS_ENABLED(LOG_PARSE)) printf(" fuse %u = %d\n", curfuse, 0);
if (curfuse >= data->numfuses)
data->numfuses = curfuse + 1;
curfuse++;
diff --git a/src/lib/util/plaparse.cpp b/src/lib/util/plaparse.cpp
index d1e7c679f97..518089a8452 100644
--- a/src/lib/util/plaparse.cpp
+++ b/src/lib/util/plaparse.cpp
@@ -113,14 +113,14 @@ static bool process_terms(jed_data *data, const uint8_t **src, const uint8_t *sr
jed_set_fuse(data, data->numfuses++, 0);
jed_set_fuse(data, data->numfuses++, 1);
- if (LOG_PARSE) printf("01");
+ if (IS_ENABLED(LOG_PARSE)) printf("01");
break;
case '1':
jed_set_fuse(data, data->numfuses++, 1);
jed_set_fuse(data, data->numfuses++, 0);
- if (LOG_PARSE) printf("10");
+ if (IS_ENABLED(LOG_PARSE)) printf("10");
break;
// anything goes
@@ -128,7 +128,7 @@ static bool process_terms(jed_data *data, const uint8_t **src, const uint8_t *sr
jed_set_fuse(data, data->numfuses++, 1);
jed_set_fuse(data, data->numfuses++, 1);
- if (LOG_PARSE) printf("11");
+ if (IS_ENABLED(LOG_PARSE)) printf("11");
break;
// this product term is inhibited
@@ -136,14 +136,14 @@ static bool process_terms(jed_data *data, const uint8_t **src, const uint8_t *sr
jed_set_fuse(data, data->numfuses++, 0);
jed_set_fuse(data, data->numfuses++, 0);
- if (LOG_PARSE) printf("00");
+ if (IS_ENABLED(LOG_PARSE)) printf("00");
break;
case ' ': case '\t':
if (curinput > 0)
{
outputs = true;
- if (LOG_PARSE) printf(" ");
+ if (IS_ENABLED(LOG_PARSE)) printf(" ");
}
break;
@@ -160,13 +160,13 @@ static bool process_terms(jed_data *data, const uint8_t **src, const uint8_t *sr
if (**src == '1')
{
jed_set_fuse(data, data->numfuses++, 0);
- if (LOG_PARSE) printf("0");
+ if (IS_ENABLED(LOG_PARSE)) printf("0");
}
else
{
// write 1 for anything else
jed_set_fuse(data, data->numfuses++, 1);
- if (LOG_PARSE) printf("1");
+ if (IS_ENABLED(LOG_PARSE)) printf("1");
}
}
}
@@ -174,7 +174,7 @@ static bool process_terms(jed_data *data, const uint8_t **src, const uint8_t *sr
if (iscrlf(**src) && outputs)
{
outputs = false;
- if (LOG_PARSE) printf("\n");
+ if (IS_ENABLED(LOG_PARSE)) printf("\n");
if (curinput != pinfo->inputs || curoutput != pinfo->outputs)
return false;
@@ -241,7 +241,7 @@ static bool process_field(jed_data *data, const uint8_t **src, const uint8_t *sr
if (pinfo->inputs == 0 || pinfo->inputs >= (JED_MAX_FUSES/2))
return false;
- if (LOG_PARSE) printf("Inputs: %u\n", pinfo->inputs);
+ if (IS_ENABLED(LOG_PARSE)) printf("Inputs: %u\n", pinfo->inputs);
break;
// number of outputs
@@ -250,7 +250,7 @@ static bool process_field(jed_data *data, const uint8_t **src, const uint8_t *sr
if (pinfo->outputs == 0 || pinfo->outputs >= (JED_MAX_FUSES/2))
return false;
- if (LOG_PARSE) printf("Outputs: %u\n", pinfo->outputs);
+ if (IS_ENABLED(LOG_PARSE)) printf("Outputs: %u\n", pinfo->outputs);
break;
// number of product terms (optional)
@@ -259,12 +259,12 @@ static bool process_field(jed_data *data, const uint8_t **src, const uint8_t *sr
if (pinfo->terms == 0 || pinfo->terms >= (JED_MAX_FUSES/2))
return false;
- if (LOG_PARSE) printf("Terms: %u\n", pinfo->terms);
+ if (IS_ENABLED(LOG_PARSE)) printf("Terms: %u\n", pinfo->terms);
break;
// output polarity (optional)
case KW_PHASE:
- if (LOG_PARSE) printf("Phase...\n");
+ if (IS_ENABLED(LOG_PARSE)) printf("Phase...\n");
while (*src < srcend && !iscrlf(**src) && pinfo->xorptr < (JED_MAX_FUSES/2))
{
if (**src == '0' || **src == '1')
@@ -280,7 +280,7 @@ static bool process_field(jed_data *data, const uint8_t **src, const uint8_t *sr
// end of file (optional)
case KW_END:
- if (LOG_PARSE) printf("End of file\n");
+ if (IS_ENABLED(LOG_PARSE)) printf("End of file\n");
break;
}
@@ -349,15 +349,15 @@ int pla_parse(const void *data, size_t length, jed_data *result)
// write output polarity
if (pinfo.xorptr > 0)
{
- if (LOG_PARSE) printf("Polarity: ");
+ if (IS_ENABLED(LOG_PARSE)) printf("Polarity: ");
for (int i = 0; i < pinfo.outputs; i++)
{
int bit = pinfo.xorval[i/32] >> (i & 31) & 1;
jed_set_fuse(result, result->numfuses++, bit);
- if (LOG_PARSE) printf("%d", bit);
+ if (IS_ENABLED(LOG_PARSE)) printf("%d", bit);
}
- if (LOG_PARSE) printf("\n");
+ if (IS_ENABLED(LOG_PARSE)) printf("\n");
}
return JEDERR_NONE;
diff --git a/src/lib/util/vbiparse.cpp b/src/lib/util/vbiparse.cpp
index bfd145dd99f..dc9c22f9176 100644
--- a/src/lib/util/vbiparse.cpp
+++ b/src/lib/util/vbiparse.cpp
@@ -204,7 +204,7 @@ bool vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshi
break;
/* this is useful for debugging issues with white flag detection */
- if (PRINTF_WHITE_FLAG)
+ if (IS_ENABLED(PRINTF_WHITE_FLAG))
{
printf("Histo: min=%02X max=%02X\n", minval, maxval);
for (x = 0; x < 256; x++)
@@ -214,7 +214,7 @@ bool vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshi
/* ignore if we have no dynamic range */
if (maxval - minval < 10)
{
- if (PRINTF_WHITE_FLAG)
+ if (IS_ENABLED(PRINTF_WHITE_FLAG))
printf("White flag NOT detected; threshold too low\n");
return false;
}
@@ -242,7 +242,7 @@ bool vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshi
/* return true if it is above the 90% mark */
result = (peakval > minval + 9 * (maxval - minval) / 10);
- if (PRINTF_WHITE_FLAG)
+ if (IS_ENABLED(PRINTF_WHITE_FLAG))
printf("White flag %s: peak=%02X thresh=%02X\n", result ? "detected" : "NOT detected", peakval, minval + 9 * (maxval - minval) / 10);
return result;