Bug 1835 - xf86pciInfo.c uses it's own broken MIN() macro
Summary: xf86pciInfo.c uses it's own broken MIN() macro
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: All All
: high trivial
Assignee: Xorg Project Team
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-11 14:02 UTC by Kristian Høgsberg
Modified: 2004-12-07 03:11 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
[FIXED_X11R68x] min macro patch (993 bytes, patch)
2004-11-11 14:04 UTC, Kristian Høgsberg
roland.mainz: 6.8-branch+
Details | Splinter Review

Description Kristian Høgsberg 2004-11-11 14:02:37 UTC
xf86pciInfo.c uses this MIN() macro:

  #define MIN(x,y) ((x<y)?x:y)

which doesn't use () around the arguments in the macro body.

Attached patch changes the code to use the standard min() macro from
Xserver/include/misc.h
Comment 1 Kristian Høgsberg 2004-11-11 14:04:12 UTC
Created attachment 1293 [details] [review]
[FIXED_X11R68x] min macro patch

Patch to make code use standard min() macro.
Comment 2 Roland Mainz 2004-11-13 01:49:56 UTC
Comment on attachment 1293 [details] [review]
[FIXED_X11R68x] min macro patch

Erm... are you sure this works on all platforms ? AFAIK the |min()| thing may
be a library function which isn't available on all platforms.
Comment 3 Kristian Høgsberg 2004-11-13 18:37:55 UTC
(In reply to comment #2)
> (From update of attachment 1293 [details] [review] [edit])
> Erm... are you sure this works on all platforms ? AFAIK the |min()| thing may
> be a library function which isn't available on all platforms.

As I said in the comment #0, the min() macro is defined in
Xserver/include/misc.h, so it's independent of you platform.
Comment 4 Roland Mainz 2004-11-19 07:34:41 UTC
Comment on attachment 1293 [details] [review]
[FIXED_X11R68x] min macro patch

Approved for the X11R6.8.x branch in the 2004-11-17 release-wranglers phone
call.
Please don't commit it yourself, I'll handle that once the CVS service is
available again.
Comment 5 Roland Mainz 2004-12-07 22:09:09 UTC
Comment on attachment 1293 [details] [review]
[FIXED_X11R68x] min macro patch

Patch checked-in into X11R6.8.x stable branch:

/cvs/xorg/xc/ChangeLog,v  <--  ChangeLog
new revision: 1.365.2.10; previous revision: 1.365.2.9
cvs commit: Using deprecated info format strings.  Convert your scripts to use
the new argument format and remove '1's from your info file format strings.
/cvs/xorg/xc/programs/Xserver/hw/xfree86/common/xf86pciBus.c,v	<-- 
xf86pciBus.c
new revision: 1.4.2.1; previous revision: 1.4
cvs commit: Using deprecated info format strings.  Convert your scripts to use
the new argument format and remove '1's from your info file format strings.
Mailing the commit message to xorg-commit@lists.freedesktop.org...
Comment 6 Roland Mainz 2004-12-07 22:11:10 UTC
The patch seems to be commited to Xorg trunk and has now been commited to
X11R6.8.x stable branch, too - marking bug as FIXED (please reopen if there are
any issues left).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.