[Bug 2968] New: Clean up the huge plethora of MIN() macro definitions in XFree86 server.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Apr 11 22:00:32 EST 2005


Please do not reply to this email: if you want to comment on the bug, go to    
       
the URL shown below and enter yourcomments there.     
   
https://bugs.freedesktop.org/show_bug.cgi?id=2968          
     
           Summary: Clean up the huge plethora of MIN() macro definitions in
                    XFree86 server.
           Product: xorg
           Version: CVS_head
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Server/general
        AssignedTo: xorg-bugzilla-noise at freedesktop.org
        ReportedBy: mharris at www.linux.org.uk


This is somewhat of a janitorial cleanup issue.  The X server has numerous
definitions of MIN()/MAX() macros throughout it, many of which are just
plain wrong.  There is almost no consistency:

[mharris at devel Xserver]$ grep -ri 'define\WMIN(' *
Xprint/pcl/Pcl.h:#define MIN(a,b) (((a)<(b))?(a):(b))
Xprint/ps/Ps.h:#define MIN(a,b) (((a)<(b))?(a):(b))
dix/main.c:#define MIN(a,b) (((a) < (b)) ? (a) : (b))
fb/fbtrap.c:#define MIN(a, b) ((a) < (b) ? (a) : (b))
hw/xfree86/drivers/apm/apm_regs.h:#define MIN(a,b)      ((a) < (b) ? (a) : (b))
hw/xfree86/drivers/glide/glide_driver.c:#define MIN(a,b) ((a) < (b) ? (a) : (b))
hw/xfree86/drivers/glint/pm2_video.c:#define MIN(a, b) (((a) < (b)) ? (a) : (b))
hw/xfree86/drivers/siliconmotion/smi_video.c:#define MIN(a, b) (((a) < (b)) ?
(a) : (b))
hw/xfree86/drivers/vmware/vmware.h:#define MIN(a,b) ((a)<(b)?(a):(b))
hw/xfree86/common/xf86Bus.c:#define MIN(x,y) ((x<y)?x:y)
hw/xfree86/common/xf86pciBus.c:#define MIN(x,y) (((x)<(y))?(x):(y))
hw/xfree86/common/xf86pciBus.c.Xserver-common-fix-broken-MIN-macro-definition:#define
MIN(x,y) ((x<y)?x:y)
hw/xfree86/etc/MTRR-Lynx.shar:X#define min(a,b) MIN(a,b)
hw/xfree86/loader/aoutloader.c:#define MIN(a,b) ((a)<(b)?(a):(b))
hw/xfree86/shadowfb/shadow.c:#define MIN(a,b) (((a)<(b))?(a):(b))
hw/xfree86/xf4bpp/OScompiler.h:#define MIN(a,b) (((a)<(b))?(a):(b))
hw/xfree86/xf86cfg/text-mode.c:#define  MIN(a, b)       ((a) < (b) ? (a) : (b))
include/misc.h:#define min(a, b) (((a) < (b)) ? (a) : (b))
miext/rootless/rootlessCommon.h:#define MIN(x,y) ((x) < (y) ? (x) : (y))


At a bare miniumum, all of these macros should be defined correctly,
and consistenly.  An improvement over that, would be defining them
in one place and using them everywhere.

An additional improvement over that, would be using Linux kernel style
min()/max() macros which are much safer but require usage modification.          
     
     
--           
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email         
     
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the xorg-bugzilla-noise mailing list