Mercurial > mplayer.hg
comparison vidix/drivers/sis_vid.c @ 17566:f580a7755ac5
Patch by Stefan Huehner / stefan % huehner ! org \
patch replaces '()' for the correct '(void)' in function
declarations/prototypes which have no parameters. The '()' syntax tell
thats there is a variable list of arguments, so that the compiler cannot
check this. The extra CFLAG '-Wstrict-declarations' shows those cases.
Comments about a similar patch applied to ffmpeg:
That in C++ these mean the same, but in ANSI C the semantics are
different; function() is an (obsolete) K&R C style forward declaration,
it basically means that the function can have any number and any types
of parameters, effectively completely preventing the compiler from doing
any sort of type checking. -- Erik Slagter
Defining functions with unspecified arguments is allowed but bad.
With arguments unspecified the compiler can't report an error/warning
if the function is called with incorrect arguments. -- M\ns Rullg\rd
author | rathann |
---|---|
date | Thu, 09 Feb 2006 14:08:03 +0000 |
parents | 401b440a6d76 |
children | 8f9d757af58e |
comparison
equal
deleted
inserted
replaced
17565:dc65faaadb04 | 17566:f580a7755ac5 |
---|---|
165 DEVICE_SIS_650_VGA | 165 DEVICE_SIS_650_VGA |
166 }; | 166 }; |
167 | 167 |
168 /** function declarations **/ | 168 /** function declarations **/ |
169 | 169 |
170 extern void sis_init_video_bridge(); | 170 extern void sis_init_video_bridge(void); |
171 | 171 |
172 | 172 |
173 static void set_overlay(SISOverlayPtr pOverlay, int index); | 173 static void set_overlay(SISOverlayPtr pOverlay, int index); |
174 static void close_overlay(); | 174 static void close_overlay(void); |
175 static void calc_scale_factor(SISOverlayPtr pOverlay, | 175 static void calc_scale_factor(SISOverlayPtr pOverlay, |
176 int index, int iscrt2); | 176 int index, int iscrt2); |
177 static void set_line_buf_size(SISOverlayPtr pOverlay); | 177 static void set_line_buf_size(SISOverlayPtr pOverlay); |
178 static void merge_line_buf(int enable); | 178 static void merge_line_buf(int enable); |
179 static void set_format(SISOverlayPtr pOverlay); | 179 static void set_format(SISOverlayPtr pOverlay); |
180 static void set_colorkey(); | 180 static void set_colorkey(void); |
181 | 181 |
182 static void set_brightness(uint8_t brightness); | 182 static void set_brightness(uint8_t brightness); |
183 static void set_contrast(uint8_t contrast); | 183 static void set_contrast(uint8_t contrast); |
184 static void set_saturation(char saturation); | 184 static void set_saturation(char saturation); |
185 static void set_hue(uint8_t hue); | 185 static void set_hue(uint8_t hue); |
217 data = (data & mask) | (old & (~mask)); | 217 data = (data & mask) | (old & (~mask)); |
218 outSISIDXREG(SISSR, reg, data); | 218 outSISIDXREG(SISSR, reg, data); |
219 } | 219 } |
220 | 220 |
221 /* vblank checking*/ | 221 /* vblank checking*/ |
222 static uint8_t vblank_active_CRT1() | 222 static uint8_t vblank_active_CRT1(void) |
223 { | 223 { |
224 /* this may be too simplistic? */ | 224 /* this may be too simplistic? */ |
225 return (inSISREG(SISINPSTAT) & 0x08); | 225 return (inSISREG(SISINPSTAT) & 0x08); |
226 } | 226 } |
227 | 227 |
228 static uint8_t vblank_active_CRT2() | 228 static uint8_t vblank_active_CRT2(void) |
229 { | 229 { |
230 uint8_t ret; | 230 uint8_t ret; |
231 if (sis_vga_engine == SIS_315_VGA) { | 231 if (sis_vga_engine == SIS_315_VGA) { |
232 inSISIDXREG(SISPART1, Index_310_CRT2_FC_VR, ret); | 232 inSISIDXREG(SISPART1, Index_310_CRT2_FC_VR, ret); |
233 } else { | 233 } else { |
443 } else | 443 } else |
444 to->depth = to->flags = 0; | 444 to->depth = to->flags = 0; |
445 return ENOSYS; | 445 return ENOSYS; |
446 } | 446 } |
447 | 447 |
448 static int bridge_in_slave_mode() | 448 static int bridge_in_slave_mode(void) |
449 { | 449 { |
450 unsigned char usScratchP1_00; | 450 unsigned char usScratchP1_00; |
451 | 451 |
452 if (!(sis_vbflags & VB_VIDEOBRIDGE)) | 452 if (!(sis_vbflags & VB_VIDEOBRIDGE)) |
453 return 0; | 453 return 0; |
463 } | 463 } |
464 } | 464 } |
465 | 465 |
466 /* This does not handle X dual head mode, since 1) vidix doesn't support it | 466 /* This does not handle X dual head mode, since 1) vidix doesn't support it |
467 and 2) it doesn't make sense for other gfx drivers */ | 467 and 2) it doesn't make sense for other gfx drivers */ |
468 static void set_dispmode() | 468 static void set_dispmode(void) |
469 { | 469 { |
470 sis_bridge_is_slave = 0; | 470 sis_bridge_is_slave = 0; |
471 | 471 |
472 if (bridge_in_slave_mode()) | 472 if (bridge_in_slave_mode()) |
473 sis_bridge_is_slave = 1; | 473 sis_bridge_is_slave = 1; |
487 sis_displaymode = DISPMODE_SINGLE2; /* TW: CRT2 only */ | 487 sis_displaymode = DISPMODE_SINGLE2; /* TW: CRT2 only */ |
488 } | 488 } |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 static void set_disptype_regs() | 492 static void set_disptype_regs(void) |
493 { | 493 { |
494 switch (sis_displaymode) { | 494 switch (sis_displaymode) { |
495 case DISPMODE_SINGLE1: /* TW: CRT1 only */ | 495 case DISPMODE_SINGLE1: /* TW: CRT1 only */ |
496 if (sis_verbose > 2) { | 496 if (sis_verbose > 2) { |
497 printf("[SiS] Setting up overlay on CRT1\n"); | 497 printf("[SiS] Setting up overlay on CRT1\n"); |
525 setsrregmask(0x32, 0x80, 0xc0); | 525 setsrregmask(0x32, 0x80, 0xc0); |
526 break; | 526 break; |
527 } | 527 } |
528 } | 528 } |
529 | 529 |
530 static void init_overlay() | 530 static void init_overlay(void) |
531 { | 531 { |
532 /* Initialize first overlay (CRT1) */ | 532 /* Initialize first overlay (CRT1) */ |
533 | 533 |
534 /* Write-enable video registers */ | 534 /* Write-enable video registers */ |
535 setvideoregmask(Index_VI_Control_Misc2, 0x80, 0x81); | 535 setvideoregmask(Index_VI_Control_Misc2, 0x80, 0x81); |
1152 setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x20); | 1152 setvideoregmask(Index_VI_Control_Misc1, 0x00, 0x20); |
1153 } | 1153 } |
1154 | 1154 |
1155 | 1155 |
1156 /* TW: Overlay MUST NOT be switched off while beam is over it */ | 1156 /* TW: Overlay MUST NOT be switched off while beam is over it */ |
1157 static void close_overlay() | 1157 static void close_overlay(void) |
1158 { | 1158 { |
1159 uint32_t watchdog; | 1159 uint32_t watchdog; |
1160 | 1160 |
1161 if ((sis_displaymode == DISPMODE_SINGLE2) || | 1161 if ((sis_displaymode == DISPMODE_SINGLE2) || |
1162 (sis_displaymode == DISPMODE_MIRROR)) { | 1162 (sis_displaymode == DISPMODE_MIRROR)) { |
1491 break; | 1491 break; |
1492 } | 1492 } |
1493 setvideoregmask(Index_VI_Control_Misc0, fmt, 0x7c); | 1493 setvideoregmask(Index_VI_Control_Misc0, fmt, 0x7c); |
1494 } | 1494 } |
1495 | 1495 |
1496 static void set_colorkey() | 1496 static void set_colorkey(void) |
1497 { | 1497 { |
1498 uint8_t r, g, b; | 1498 uint8_t r, g, b; |
1499 | 1499 |
1500 b = (uint8_t) sis_grkey.ckey.blue; | 1500 b = (uint8_t) sis_grkey.ckey.blue; |
1501 g = (uint8_t) sis_grkey.ckey.green; | 1501 g = (uint8_t) sis_grkey.ckey.green; |