Re: [PATCH] trident_video.c

2005-12-09 Thread Tim Roberts

Jeff Chua wrote:

The following patch is needed in order to compile trident_video.c with 
gcc-2.95.3 ...


--- 
xfree86/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c.org
2005-12-09 12:05:15 +0800
+++ 
xfree86/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c
2005-12-09 12:05:43 +0800

@@ -666,10 +666,11 @@
 OUTW(vgaIOBase + 4, ((width1)  0xff00)  | 0x91);
 OUTW(vgaIOBase + 4, ((offset)  0xff)  8 | 0x92);
 OUTW(vgaIOBase + 4, ((offset)  0xff00)| 0x93);
-if (pTrident-Chipset = CYBER9397)
+if (pTrident-Chipset = CYBER9397) {
 OUTW(vgaIOBase + 4, ((offset)  0x0f)  8 | 0x94);
-else
+} else {
 OUTW(vgaIOBase + 4, ((offset)  0x07)  8 | 0x94);
+}



Why?  If the OUTW macro is generating multiple statements, then the OUTW 
macro should be fixed.  Otherwise, this is just a nasty bug waiting to 
happen.


--
Tim Roberts, [EMAIL PROTECTED]
Providenza  Boekelheide, Inc.

___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


Re: [PATCH] trident_video.c

2005-12-09 Thread David Dawes
On Fri, Dec 09, 2005 at 09:14:40AM -0800, Tim Roberts wrote:
Jeff Chua wrote:

The following patch is needed in order to compile trident_video.c with 
gcc-2.95.3 ...

--- 
xfree86/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c.org 
2005-12-09 12:05:15 +0800
+++ 
xfree86/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c
2005-12-09 12:05:43 +0800
@@ -666,10 +666,11 @@
 OUTW(vgaIOBase + 4, ((width1)  0xff00)  | 0x91);
 OUTW(vgaIOBase + 4, ((offset)  0xff)  8 | 0x92);
 OUTW(vgaIOBase + 4, ((offset)  0xff00)| 0x93);
-if (pTrident-Chipset = CYBER9397)
+if (pTrident-Chipset = CYBER9397) {
 OUTW(vgaIOBase + 4, ((offset)  0x0f)  8 | 0x94);
-else
+} else {
 OUTW(vgaIOBase + 4, ((offset)  0x07)  8 | 0x94);
+}


Why?  If the OUTW macro is generating multiple statements, then the OUTW 
macro should be fixed.  Otherwise, this is just a nasty bug waiting to 
happen.

Yes, it needs to be fixed.  It is currently a { ... } block.  The
do { ... } while (0) trick would fix it.

David
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel


[PATCH] trident_video.c

2005-12-08 Thread Jeff Chua
The following patch is needed in order to compile trident_video.c with 
gcc-2.95.3 ...


Thanks,
Jeff

--- xfree86/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c.org  
2005-12-09 12:05:15 +0800
+++ xfree86/xc/programs/Xserver/hw/xfree86/drivers/trident/trident_video.c  
2005-12-09 12:05:43 +0800
@@ -666,10 +666,11 @@
 OUTW(vgaIOBase + 4, ((width1)  0xff00)  | 0x91);
 OUTW(vgaIOBase + 4, ((offset)  0xff)  8 | 0x92);
 OUTW(vgaIOBase + 4, ((offset)  0xff00)| 0x93);
-if (pTrident-Chipset = CYBER9397)
+if (pTrident-Chipset = CYBER9397) {
OUTW(vgaIOBase + 4, ((offset)  0x0f)  8 | 0x94);
-else
+} else {
OUTW(vgaIOBase + 4, ((offset)  0x07)  8 | 0x94);
+}

 /* Horizontal Zoom */
 if (pTrident-videoFlags  VID_ZOOM_INV) {
___
Devel mailing list
Devel@XFree86.Org
http://XFree86.Org/mailman/listinfo/devel