aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-11-23 09:12:48 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-11-23 09:12:48 +0100
commit8a370df2c4eae8d159aa0a9d2469898cd65a1e5f (patch)
treece5903e9b1130dfc5a052e764a220db1f2f56925
parent770c658e5fefe3c67c8fc1bd5162bf4240a3c8a4 (diff)
edid-decode: all error/warn messages should end with '.'
Make sure the message formatting is consistent. Most fail/warn messages ended with a period, but not all. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--edid-decode.cpp20
-rw-r--r--parse-base-block.cpp6
-rw-r--r--parse-cta-block.cpp52
-rw-r--r--parse-di-ext-block.cpp2
-rw-r--r--parse-displayid-block.cpp8
5 files changed, 44 insertions, 44 deletions
diff --git a/edid-decode.cpp b/edid-decode.cpp
index aae7a6b..948eacf 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -762,7 +762,7 @@ static bool extract_edid(int fd, FILE *error)
/* Assume binary */
if (edid_data.size() > sizeof(edid)) {
- fprintf(error, "Binary EDID length %zu is greater than %zu\n",
+ fprintf(error, "Binary EDID length %zu is greater than %zu.\n",
edid_data.size(), sizeof(edid));
return false;
}
@@ -835,7 +835,7 @@ static void hexdumpedid(FILE *f, const unsigned char *edid, unsigned size)
fprintf(f, "\n");
}
if (!crc_ok(buf))
- fprintf(f, "Block %u has a checksum error (should be 0x%02x)\n",
+ fprintf(f, "Block %u has a checksum error (should be 0x%02x).\n",
b, crc_calc(buf));
}
}
@@ -858,7 +858,7 @@ static void carraydumpedid(FILE *f, const unsigned char *edid, unsigned size)
fprintf(f, "\n");
}
if (!crc_ok(buf))
- fprintf(f, "\t/* Block %u has a checksum error (should be 0x%02x) */\n",
+ fprintf(f, "\t/* Block %u has a checksum error (should be 0x%02x). */\n",
b, crc_calc(buf));
}
fprintf(f, "};\n");
@@ -939,15 +939,15 @@ static int edid_from_file(const char *from_file, FILE *error)
odd_hex_digits = false;
if (!extract_edid(fd, error)) {
- fprintf(error, "EDID extract of '%s' failed ", from_file);
+ fprintf(error, "EDID extract of '%s' failed: ", from_file);
if (odd_hex_digits)
- fprintf(error, "(odd number of hexadecimal digits)\n");
+ fprintf(error, "odd number of hexadecimal digits.\n");
else
- fprintf(error, "(unknown format)\n");
+ fprintf(error, "unknown format.\n");
return -1;
}
if (state.edid_size % EDID_PAGE_SIZE) {
- fprintf(error, "EDID length %u is not a multiple of %u\n",
+ fprintf(error, "EDID length %u is not a multiple of %u.\n",
state.edid_size, EDID_PAGE_SIZE);
return -1;
}
@@ -956,7 +956,7 @@ static int edid_from_file(const char *from_file, FILE *error)
close(fd);
if (memcmp(edid, "\x00\xFF\xFF\xFF\xFF\xFF\xFF\x00", 8)) {
- fprintf(error, "No EDID header found in '%s'\n", from_file);
+ fprintf(error, "No EDID header found in '%s'.\n", from_file);
return -1;
}
return 0;
@@ -1238,12 +1238,12 @@ int main(int argc, char **argv)
}
break;
case ':':
- fprintf(stderr, "Option '%s' requires a value\n",
+ fprintf(stderr, "Option '%s' requires a value.\n",
argv[optind]);
usage();
return -1;
case '?':
- fprintf(stderr, "Unknown argument '%s'\n",
+ fprintf(stderr, "Unknown argument '%s'.\n",
argv[optind]);
usage();
return -1;
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index 9a88083..4976e3f 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -1732,7 +1732,7 @@ void edid_state::parse_base_block(const unsigned char *x)
// is the native timing.
base.preferred_is_also_native = true;
} else if (base.edid_minor == 3) {
- fail("EDID 1.3 requires that the first detailed timing is the preferred timing\n");
+ fail("EDID 1.3 requires that the first detailed timing is the preferred timing.\n");
}
}
@@ -1916,9 +1916,9 @@ void edid_state::check_base_block()
msg(!out_of_range || base.edid_minor >= 4, "%s", err.c_str());
}
if (base.edid_minor == 3 && num_blocks > 2 && !block_map.saw_block_1)
- fail("EDID 1.3 requires a Block Map Extension in Block 1 if there are more than 2 blocks in the EDID\n");
+ fail("EDID 1.3 requires a Block Map Extension in Block 1 if there are more than 2 blocks in the EDID.\n");
if (base.edid_minor == 3 && num_blocks > 128 && !block_map.saw_block_128)
- fail("EDID 1.3 requires a Block Map Extension in Block 128 if there are more than 128 blocks in the EDID\n");
+ fail("EDID 1.3 requires a Block Map Extension in Block 128 if there are more than 128 blocks in the EDID.\n");
if (block_map.saw_block_128 && num_blocks > 255)
fail("If there is a Block Map Extension in Block 128 then the maximum number of blocks is 255.\n");
}
diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
index b9e59d5..6b1ff3b 100644
--- a/parse-cta-block.cpp
+++ b/parse-cta-block.cpp
@@ -227,7 +227,7 @@ static std::string audio_ext_format(unsigned char x)
case 13: return "L-PCM 3D Audio";
default: break;
}
- fail("Unknown Audio Ext Format 0x%02x\n", x);
+ fail("Unknown Audio Ext Format 0x%02x.\n", x);
return std::string("Unknown Audio Ext Format (") + utohex(x) + ")";
}
@@ -250,7 +250,7 @@ static std::string audio_format(unsigned char x)
case 14: return "WMA Pro";
default: break;
}
- fail("Unknown Audio Format 0x%02x\n", x);
+ fail("Unknown Audio Format 0x%02x.\n", x);
return std::string("Unknown Audio Format (") + utohex(x) + ")";
}
@@ -265,7 +265,7 @@ static std::string mpeg_h_3d_audio_level(unsigned char x)
case 5: return "Level 5";
default: break;
}
- fail("Unknown MPEG-H 3D Audio Level 0x%02x\n", x);
+ fail("Unknown MPEG-H 3D Audio Level 0x%02x.\n", x);
return std::string("Unknown MPEG-H 3D Audio Level (") + utohex(x) + ")";
}
@@ -274,7 +274,7 @@ static void cta_audio_block(const unsigned char *x, unsigned length)
unsigned i, format, ext_format = 0;
if (length % 3) {
- fail("Broken CTA-861 audio block length %d\n", length);
+ fail("Broken CTA-861 audio block length %d.\n", length);
return;
}
@@ -283,7 +283,7 @@ static void cta_audio_block(const unsigned char *x, unsigned length)
ext_format = (x[i + 2] & 0xf8) >> 3;
if (format == 0) {
printf(" Reserved (0x00)\n");
- fail("Audio Format Code 0x00 is reserved\n");
+ fail("Audio Format Code 0x00 is reserved.\n");
continue;
}
if (format != 15)
@@ -491,7 +491,7 @@ void edid_state::cta_vfpdb(const unsigned char *x, unsigned length)
unsigned i;
if (length == 0) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
cta.preferred_timings.clear();
@@ -541,7 +541,7 @@ void edid_state::cta_hdmi_block(const unsigned char *x, unsigned length)
unsigned len_vic, len_3d;
if (length < 4) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
printf(" Source physical address: %u.%u.%u.%u\n", x[3] >> 4, x[3] & 0x0f,
@@ -1077,7 +1077,7 @@ static void cta_sadb(const unsigned char *x, unsigned length)
unsigned i;
if (length < 3) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
@@ -1286,7 +1286,7 @@ static void cta_rcdb(const unsigned char *x, unsigned length)
unsigned i;
if (length < 4) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
@@ -1346,7 +1346,7 @@ static const char *speaker_location[] = {
static void cta_sldb(const unsigned char *x, unsigned length)
{
if (length < 2) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
while (length >= 2) {
@@ -1373,7 +1373,7 @@ void edid_state::cta_vcdb(const unsigned char *x, unsigned length)
cta.has_vcdb = true;
if (length < 1) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
printf(" YCbCr quantization: %s\n",
@@ -1453,7 +1453,7 @@ static void cta_colorimetry_block(const unsigned char *x, unsigned length)
unsigned i;
if (length < 2) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
for (i = 0; i < ARRAY_SIZE(colorimetry_map); i++) {
@@ -1478,7 +1478,7 @@ static void cta_hdr_static_metadata_block(const unsigned char *x, unsigned lengt
unsigned i;
if (length < 2) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
printf(" Electro optical transfer functions:\n");
@@ -1514,7 +1514,7 @@ static void cta_hdr_static_metadata_block(const unsigned char *x, unsigned lengt
static void cta_hdr_dyn_metadata_block(const unsigned char *x, unsigned length)
{
if (length < 3) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
while (length >= 3) {
@@ -1554,7 +1554,7 @@ static void cta_ifdb(const unsigned char *x, unsigned length)
unsigned len_hdr = x[0] >> 5;
if (length < 2) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
printf(" VSIFs: %u\n", x[1]);
@@ -1587,7 +1587,7 @@ static void cta_hdmi_audio_block(const unsigned char *x, unsigned length)
unsigned num_descs;
if (length < 2) {
- fail("Empty Data Block with length %u\n", length);
+ fail("Empty Data Block with length %u.\n", length);
return;
}
if (x[0] & 3)
@@ -1706,7 +1706,7 @@ void edid_state::cta_ext_block(const unsigned char *x, unsigned length)
case 0x01:
if (length < 3) {
data_block = std::string("Vendor-Specific Video Data Block");
- fail("Invalid length %u < 3\n", length);
+ fail("Invalid length %u < 3.\n", length);
return;
}
oui = (x[3] << 16) + (x[2] << 8) + x[1];
@@ -1746,7 +1746,7 @@ void edid_state::cta_ext_block(const unsigned char *x, unsigned length)
case 0x11:
if (length < 3) {
data_block = std::string("Vendor-Specific Audio Data Block");
- fail("Invalid length %u < 3\n", length);
+ fail("Invalid length %u < 3.\n", length);
return;
}
oui = (x[3] << 16) + (x[2] << 8) + x[1];
@@ -1788,7 +1788,7 @@ void edid_state::cta_ext_block(const unsigned char *x, unsigned length)
fail("Duplicate HDMI Forum VSDB/SCDB.\n");
if (length < 2) {
data_block = std::string("HDMI Forum SCDB");
- fail("Invalid length %u < 2\n", length);
+ fail("Invalid length %u < 2.\n", length);
return;
}
if (x[1] || x[2])
@@ -1959,13 +1959,13 @@ void edid_state::parse_cta_block(const unsigned char *x)
printf(" Revision: %u\n", version);
if (version == 0)
- fail("Invalid CTA-861 Extension revision 0\n");
+ fail("Invalid CTA-861 Extension revision 0.\n");
if (version == 2)
- fail("Deprecated CTA-861 Extension revision 2\n");
+ fail("Deprecated CTA-861 Extension revision 2.\n");
if (cta.has_hdmi && version != 3)
- fail("The HDMI Specification requires CTA Extension revision 3\n");
+ fail("The HDMI Specification requires CTA Extension revision 3.\n");
if (version > 3)
- warn("Unknown CTA-861 Extension revision %u\n", version);
+ warn("Unknown CTA-861 Extension revision %u.\n", version);
if (version >= 1) do {
if (version == 1 && x[3] != 0)
@@ -1976,7 +1976,7 @@ void edid_state::parse_cta_block(const unsigned char *x)
if (version < 3 && ((offset - 4) / 8)) {
printf(" 8-byte timing descriptors: %u\n", (offset - 4) / 8);
- fail("8-byte descriptors were never used\n");
+ fail("8-byte descriptors were never used.\n");
}
if (version >= 2) {
@@ -2020,7 +2020,7 @@ void edid_state::parse_cta_block(const unsigned char *x)
cta.native_timings.push_back(timings_ext(i + 129, type));
}
if (cta.has_hdmi && block_nr != (block_map.saw_block_1 ? 2 : 1))
- fail("The HDMI Specification requires that the first Extension Block (that is not a Block Map) is an CTA-861 Extension Block\n");
+ fail("The HDMI Specification requires that the first Extension Block (that is not a Block Map) is an CTA-861 Extension Block.\n");
}
}
if (version >= 3) {
@@ -2031,7 +2031,7 @@ void edid_state::parse_cta_block(const unsigned char *x)
data_block.clear();
if (i != offset)
- fail("Offset is %u, but should be %u\n", offset, i);
+ fail("Offset is %u, but should be %u.\n", offset, i);
}
data_block = "Detailed Timing Descriptors";
diff --git a/parse-di-ext-block.cpp b/parse-di-ext-block.cpp
index 7a3c5b6..9751363 100644
--- a/parse-di-ext-block.cpp
+++ b/parse-di-ext-block.cpp
@@ -494,6 +494,6 @@ void edid_state::parse_di_ext_block(const unsigned char *x)
if (!memchk(x + 0x37, 17))
fail("Bytes 0x37-0x47 should be 0.\n");
if (!memchk(x + 0x48, 9))
- fail("Bytes 0x48-0x50 should be 0\n");
+ fail("Bytes 0x48-0x50 should be 0.\n");
parse_display_xfer(x);
}
diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp
index 545f948..d5bf2eb 100644
--- a/parse-displayid-block.cpp
+++ b/parse-displayid-block.cpp
@@ -1347,7 +1347,7 @@ void edid_state::parse_displayid_cta_data_block(const unsigned char *x)
unsigned i;
if (len > 248) {
- fail("Length is > 248\n");
+ fail("Length is > 248.\n");
len = 248;
}
x += 3;
@@ -1356,7 +1356,7 @@ void edid_state::parse_displayid_cta_data_block(const unsigned char *x)
cta_block(x + i);
if (i != len)
- fail("Length is %u instead of %u\n", len, i);
+ fail("Length is %u instead of %u.\n", len, i);
}
// DisplayID main
@@ -1457,7 +1457,7 @@ void edid_state::parse_displayid_block(const unsigned char *x)
if (!prod_type)
fail("DisplayID Base Block has no product type.\n");
if (ext_count != dispid.preparse_displayid_blocks - 1)
- fail("Expected %u DisplayID Extension Block%s, but got %u\n",
+ fail("Expected %u DisplayID Extension Block%s, but got %u.\n",
ext_count,
ext_count > 1 ? "s" : "",
dispid.preparse_displayid_blocks - 1);
@@ -1536,7 +1536,7 @@ void edid_state::parse_displayid_block(const unsigned char *x)
else
data_block = "Vendor-Specific Data Block, OUI " + ouitohex(oui);
if (reversed)
- fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order\n").c_str());
+ fail((std::string("OUI ") + ouitohex(oui) + " is in the wrong byte order.\n").c_str());
} else {
data_block = "Unknown DisplayID Data Block (" + utohex(tag) + ")";
}

Privacy Policy