Fixed edid parsing code for older gcc compilers Ozkan Sezer This adds the name 'ad' to two unnamed unions in edid.h and adjusts edid-parse.c for it. Nameless unions are not supported in ancient gcc, which I happened to use on one of my ancient setups.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
diff --git a/src/video/x11/edid-parse.c b/src/video/x11/edid-parse.c
index 57f225b..e22324f 100644
--- a/src/video/x11/edid-parse.c
+++ b/src/video/x11/edid-parse.c
@@ -140,14 +140,14 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
};
bits = get_bits (edid[0x14], 4, 6);
- info->digital.bits_per_primary = bit_depth[bits];
+ info->ad.digital.bits_per_primary = bit_depth[bits];
bits = get_bits (edid[0x14], 0, 3);
if (bits <= 5)
- info->digital.interface = interfaces[bits];
+ info->ad.digital.interface = interfaces[bits];
else
- info->digital.interface = UNDEFINED;
+ info->ad.digital.interface = UNDEFINED;
}
else
{
@@ -161,17 +161,17 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
{ 0.7, 0.0, 0.7 },
};
- info->analog.video_signal_level = levels[bits][0];
- info->analog.sync_signal_level = levels[bits][1];
- info->analog.total_signal_level = levels[bits][2];
+ info->ad.analog.video_signal_level = levels[bits][0];
+ info->ad.analog.sync_signal_level = levels[bits][1];
+ info->ad.analog.total_signal_level = levels[bits][2];
- info->analog.blank_to_black = get_bit (edid[0x14], 4);
+ info->ad.analog.blank_to_black = get_bit (edid[0x14], 4);
- info->analog.separate_hv_sync = get_bit (edid[0x14], 3);
- info->analog.composite_sync_on_h = get_bit (edid[0x14], 2);
- info->analog.composite_sync_on_green = get_bit (edid[0x14], 1);
+ info->ad.analog.separate_hv_sync = get_bit (edid[0x14], 3);
+ info->ad.analog.composite_sync_on_h = get_bit (edid[0x14], 2);
+ info->ad.analog.composite_sync_on_green = get_bit (edid[0x14], 1);
- info->analog.serration_on_vsync = get_bit (edid[0x14], 0);
+ info->ad.analog.serration_on_vsync = get_bit (edid[0x14], 0);
}
/* Screen Size / Aspect Ratio */
@@ -213,11 +213,11 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
if (info->is_digital)
{
- info->digital.rgb444 = TRUE;
+ info->ad.digital.rgb444 = TRUE;
if (get_bit (edid[0x18], 3))
- info->digital.ycrcb444 = 1;
+ info->ad.digital.ycrcb444 = 1;
if (get_bit (edid[0x18], 4))
- info->digital.ycrcb422 = 1;
+ info->ad.digital.ycrcb422 = 1;
}
else
{
@@ -227,7 +227,7 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
MONOCHROME, RGB, OTHER_COLOR, UNDEFINED_COLOR
};
- info->analog.color_type = color_type[bits];
+ info->ad.analog.color_type = color_type[bits];
}
info->srgb_is_standard = get_bit (edid[0x18], 2);
@@ -455,26 +455,26 @@ decode_detailed_timing (const uchar *timing,
detailed->digital_sync = get_bit (bits, 4);
if (detailed->digital_sync)
{
- detailed->digital.composite = !get_bit (bits, 3);
+ detailed->ad.digital.composite = !get_bit (bits, 3);
- if (detailed->digital.composite)
+ if (detailed->ad.digital.composite)
{
- detailed->digital.serrations = get_bit (bits, 2);
- detailed->digital.negative_vsync = FALSE;
+ detailed->ad.digital.serrations = get_bit (bits, 2);
+ detailed->ad.digital.negative_vsync = FALSE;
}
else
{
- detailed->digital.serrations = FALSE;
- detailed->digital.negative_vsync = !get_bit (bits, 2);
+ detailed->ad.digital.serrations = FALSE;
+ detailed->ad.digital.negative_vsync = !get_bit (bits, 2);
}
- detailed->digital.negative_hsync = !get_bit (bits, 0);
+ detailed->ad.digital.negative_hsync = !get_bit (bits, 0);
}
else
{
- detailed->analog.bipolar = get_bit (bits, 3);
- detailed->analog.serrations = get_bit (bits, 2);
- detailed->analog.sync_on_green = !get_bit (bits, 1);
+ detailed->ad.analog.bipolar = get_bit (bits, 3);
+ detailed->ad.analog.serrations = get_bit (bits, 2);
+ detailed->ad.analog.sync_on_green = !get_bit (bits, 1);
}
}
@@ -579,12 +579,12 @@ dump_monitor_info (MonitorInfo *info)
if (info->is_digital)
{
const char *interface;
- if (info->digital.bits_per_primary != -1)
- printf ("Bits Per Primary: %d\n", info->digital.bits_per_primary);
+ if (info->ad.digital.bits_per_primary != -1)
+ printf ("Bits Per Primary: %d\n", info->ad.digital.bits_per_primary);
else
printf ("Bits Per Primary: undefined\n");
- switch (info->digital.interface)
+ switch (info->ad.digital.interface)
{
case DVI: interface = "DVI"; break;
case HDMI_A: interface = "HDMI-a"; break;
@@ -596,27 +596,27 @@ dump_monitor_info (MonitorInfo *info)
}
printf ("Interface: %s\n", interface);
- printf ("RGB 4:4:4: %s\n", yesno (info->digital.rgb444));
- printf ("YCrCb 4:4:4: %s\n", yesno (info->digital.ycrcb444));
- printf ("YCrCb 4:2:2: %s\n", yesno (info->digital.ycrcb422));
+ printf ("RGB 4:4:4: %s\n", yesno (info->ad.digital.rgb444));
+ printf ("YCrCb 4:4:4: %s\n", yesno (info->ad.digital.ycrcb444));
+ printf ("YCrCb 4:2:2: %s\n", yesno (info->ad.digital.ycrcb422));
}
else
{
const char *s;
- printf ("Video Signal Level: %f\n", info->analog.video_signal_level);
- printf ("Sync Signal Level: %f\n", info->analog.sync_signal_level);
- printf ("Total Signal Level: %f\n", info->analog.total_signal_level);
+ printf ("Video Signal Level: %f\n", info->ad.analog.video_signal_level);
+ printf ("Sync Signal Level: %f\n", info->ad.analog.sync_signal_level);
+ printf ("Total Signal Level: %f\n", info->ad.analog.total_signal_level);
printf ("Blank to Black: %s\n",
- yesno (info->analog.blank_to_black));
+ yesno (info->ad.analog.blank_to_black));
printf ("Separate HV Sync: %s\n",
- yesno (info->analog.separate_hv_sync));
+ yesno (info->ad.analog.separate_hv_sync));
printf ("Composite Sync on H: %s\n",
- yesno (info->analog.composite_sync_on_h));
+ yesno (info->ad.analog.composite_sync_on_h));
printf ("Serration on VSync: %s\n",
- yesno (info->analog.serration_on_vsync));
+ yesno (info->ad.analog.serration_on_vsync));
- switch (info->analog.color_type)
+ switch (info->ad.analog.color_type)
{
case UNDEFINED_COLOR: s = "undefined"; break;
case MONOCHROME: s = "monochrome"; break;
@@ -729,20 +729,20 @@ dump_monitor_info (MonitorInfo *info)
if (timing->digital_sync)
{
printf (" Digital Sync:\n");
- printf (" composite: %s\n", yesno (timing->digital.composite));
- printf (" serrations: %s\n", yesno (timing->digital.serrations));
+ printf (" composite: %s\n", yesno (timing->ad.digital.composite));
+ printf (" serrations: %s\n", yesno (timing->ad.digital.serrations));
printf (" negative vsync: %s\n",
- yesno (timing->digital.negative_vsync));
+ yesno (timing->ad.digital.negative_vsync));
printf (" negative hsync: %s\n",
- yesno (timing->digital.negative_hsync));
+ yesno (timing->ad.digital.negative_hsync));
}
else
{
printf (" Analog Sync:\n");
- printf (" bipolar: %s\n", yesno (timing->analog.bipolar));
- printf (" serrations: %s\n", yesno (timing->analog.serrations));
+ printf (" bipolar: %s\n", yesno (timing->ad.analog.bipolar));
+ printf (" serrations: %s\n", yesno (timing->ad.analog.serrations));
printf (" sync on green: %s\n", yesno (
- timing->analog.sync_on_green));
+ timing->ad.analog.sync_on_green));
}
}
diff --git a/src/video/x11/edid.h b/src/video/x11/edid.h
index 8c217eb..cb9f0e8 100644
--- a/src/video/x11/edid.h
+++ b/src/video/x11/edid.h
@@ -74,7 +74,7 @@ struct DetailedTiming
int negative_vsync;
int negative_hsync;
} digital;
- };
+ } ad;
};
struct MonitorInfo
@@ -118,7 +118,7 @@ struct MonitorInfo
int serration_on_vsync;
ColorType color_type;
} analog;
- };
+ } ad;
int width_mm; /* -1 if not specified */
int height_mm; /* -1 if not specified */