aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--edid-decode.cpp1
-rw-r--r--edid-decode.h68
-rw-r--r--parse-base-block.cpp1
-rw-r--r--parse-cta-block.cpp1
-rw-r--r--parse-displayid-block.cpp1
5 files changed, 51 insertions, 21 deletions
diff --git a/edid-decode.cpp b/edid-decode.cpp
index ef50da2..a3c6172 100644
--- a/edid-decode.cpp
+++ b/edid-decode.cpp
@@ -14,7 +14,6 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include "edid-decode.h"
diff --git a/edid-decode.h b/edid-decode.h
index 53253b9..dd2608e 100644
--- a/edid-decode.h
+++ b/edid-decode.h
@@ -12,6 +12,7 @@
#include <string>
#include <vector>
+#include <string.h>
#define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
#define min(a, b) ((a) < (b) ? (a) : (b))
@@ -53,11 +54,61 @@ struct timings {
struct edid_state {
edid_state()
{
+ // Global state
+ edid_size = num_blocks = block_nr = 0;
+ max_hor_freq_hz = max_vert_freq_hz = max_pixclk_khz = 0;
min_hor_freq_hz = 0xffffff;
min_vert_freq_hz = 0xffffffff;
+ warnings = failures = 0;
+ memset(&preferred_timings, 0, sizeof(preferred_timings));
+
+ // Base block state
+ edid_minor = 0;
+ has_name_descriptor = has_display_range_descriptor =
+ has_serial_number = has_serial_string =
+ supports_continuous_freq = supports_gtf =
+ supports_cvt = uses_gtf = uses_cvt = has_spwg =
+ seen_non_detailed_descriptor = false;
+ timing_descr_cnt = 0;
+
+ min_display_hor_freq_hz = max_display_hor_freq_hz =
+ min_display_vert_freq_hz = max_display_vert_freq_hz =
+ max_display_pixclk_khz = max_display_width_mm =
+ max_display_height_mm = 0;
+
+ // CTA-861 block state
+ has_640x480p60_est_timing = has_cta861_vic_1 =
+ first_svd_might_be_preferred = has_hdmi = false;
+ last_block_was_hdmi_vsdb = have_hf_vsdb = have_hf_scdb = 0;
first_block = 1;
+ supported_hdmi_vic_codes = supported_hdmi_vic_vsb_codes = 0;
+ memset(vics, 0, sizeof(vics));
+ memset(preparsed_has_vic, 0, sizeof(preparsed_has_vic));
+
+ // DisplayID block state
+ preparse_color_ids = preparse_xfer_ids = 0;
+
+ // Block Map block state
+ saw_block_1 = false;
}
+ // Global state
+ unsigned edid_size;
+ unsigned num_blocks;
+ unsigned block_nr;
+ std::string block;
+ std::string data_block;
+ timings preferred_timings;
+
+ unsigned min_hor_freq_hz;
+ unsigned max_hor_freq_hz;
+ unsigned min_vert_freq_hz;
+ unsigned max_vert_freq_hz;
+ unsigned max_pixclk_khz;
+
+ unsigned warnings;
+ unsigned failures;
+
// Base block state
unsigned edid_minor;
bool has_name_descriptor;
@@ -102,23 +153,6 @@ struct edid_state {
// Block Map block state
bool saw_block_1;
- // Global state
- unsigned edid_size;
- unsigned num_blocks;
- unsigned block_nr;
- std::string block;
- std::string data_block;
- timings preferred_timings;
-
- unsigned min_hor_freq_hz;
- unsigned max_hor_freq_hz;
- unsigned min_vert_freq_hz;
- unsigned max_vert_freq_hz;
- unsigned max_pixclk_khz;
-
- unsigned warnings;
- unsigned failures;
-
bool print_timings(const char *prefix, const struct timings *t,
const char *suffix, const char *flags = 0);
bool match_timings(const timings &t1, const timings &t2);
diff --git a/parse-base-block.cpp b/parse-base-block.cpp
index 9685d9e..55c967f 100644
--- a/parse-base-block.cpp
+++ b/parse-base-block.cpp
@@ -9,7 +9,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <math.h>
#include <time.h>
diff --git a/parse-cta-block.cpp b/parse-cta-block.cpp
index 7fb9fb8..0132c8a 100644
--- a/parse-cta-block.cpp
+++ b/parse-cta-block.cpp
@@ -8,7 +8,6 @@
*/
#include <stdio.h>
-#include <string.h>
#include <math.h>
#include "edid-decode.h"
diff --git a/parse-displayid-block.cpp b/parse-displayid-block.cpp
index 215f000..bc24098 100644
--- a/parse-displayid-block.cpp
+++ b/parse-displayid-block.cpp
@@ -7,7 +7,6 @@
* Maintainer: Hans Verkuil <hverkuil-cisco@xs4all.nl>
*/
-#include <string.h>
#include <math.h>
#include "edid-decode.h"

Privacy Policy