aboutsummaryrefslogtreecommitdiffstats
path: root/parse-base-block.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2020-02-12 09:42:43 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-02-12 09:42:43 +0100
commit8f46a81ba8c7fb8d62e8f2b46735a956b0df8974 (patch)
tree1c8cec7f7528c445503d8e9838f4dd702dcd07e8 /parse-base-block.cpp
parentc5b275a6adcbf40d873d795bf8d4802b3593c96f (diff)
edid-decode: cleanups
Move add_str to edid-decode.h and use it where needed. Also rename 'suffix' to 'type' after the print_timings() prototype. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'parse-base-block.cpp')
-rw-r--r--parse-base-block.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index 7000b70..c512385 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -248,7 +248,7 @@ static const struct {
static const struct {
unsigned dmt_id;
struct timings t;
- const char *std_name;
+ const char *type;
} established_timings12[] = {
/* 0x23 bit 7 - 0 */
{ 0x00, { 720, 400, 9, 5, 28320, 0, false,
@@ -1192,14 +1192,6 @@ void edid_state::detailed_epi(const unsigned char *x)
printf(" EPI Version: %u.%u\n", (x[17] & 0xf0) >> 4, x[17] & 0x0f);
}
-static void add_str(std::string &s, const std::string &add)
-{
- if (s.empty())
- s = add;
- else
- s = s + ", " + add;
-}
-
void edid_state::detailed_timings(const char *prefix, const unsigned char *x)
{
struct timings t = {};
@@ -1319,11 +1311,11 @@ void edid_state::detailed_timings(const char *prefix, const unsigned char *x)
calc_ratio(&t);
- bool ok = print_timings(prefix, &t, dtd_name().c_str(), s_flags.c_str(), true);
+ bool ok = print_timings(prefix, &t, dtd_type().c_str(), s_flags.c_str(), true);
if (block_nr == 0 && dtd_cnt == 1) {
preferred_timings = t;
- preferred_type = dtd_name();
+ preferred_type = dtd_type();
preferred_flags = s_flags;
}
@@ -1749,15 +1741,15 @@ void edid_state::parse_base_block(const unsigned char *x)
for (i = 0; i < 17; i++) {
if (x[0x23 + i / 8] & (1 << (7 - i % 8))) {
const struct timings *t;
- const char *suffix = "DMT";
+ const char *type = "DMT";
if (established_timings12[i].dmt_id) {
t = find_dmt_id(established_timings12[i].dmt_id);
} else {
t = &established_timings12[i].t;
- suffix = established_timings12[i].std_name;
+ type = established_timings12[i].type;
}
- print_timings(" ", t, suffix);
+ print_timings(" ", t, type);
}
}
} else {

Privacy Policy