Revision: 44810
          http://brlcad.svn.sourceforge.net/brlcad/?rev=44810&view=rev
Author:   erikgreenwald
Date:     2011-06-07 21:52:44 +0000 (Tue, 07 Jun 2011)

Log Message:
-----------
Apple includes stdbool.h in dlfcn.h, so change our various typedefs of bool to 
their actual type.

Modified Paths:
--------------
    brlcad/trunk/src/fb/pl-fb.c
    brlcad/trunk/src/fbed/extern.h
    brlcad/trunk/src/fbed/fbed.c
    brlcad/trunk/src/fbed/glob.c
    brlcad/trunk/src/fbed/std.h
    brlcad/trunk/src/lgt/lgt.h
    brlcad/trunk/src/lgt/reflect.c
    brlcad/trunk/src/lgt/sgi_dep.c
    brlcad/trunk/src/proc-db/vegetation.h
    brlcad/trunk/src/util/bw-imp.c

Modified: brlcad/trunk/src/fb/pl-fb.c
===================================================================
--- brlcad/trunk/src/fb/pl-fb.c 2011-06-07 21:07:31 UTC (rev 44809)
+++ brlcad/trunk/src/fb/pl-fb.c 2011-06-07 21:52:44 UTC (rev 44810)
@@ -154,7 +154,6 @@
 typedef short tiny;            /* for very small numbers */
 #endif
 
-typedef int bool;              /* boolean data type */
 #define false 0
 #define true 1
 
@@ -171,7 +170,7 @@
     coords pixel;              /* starting scan, nib */
     tiny xsign;                        /* 0 or +1 */
     tiny ysign;                        /* -1, 0, or +1 */
-    bool ymajor;               /* true iff Y is major dir. */
+    int ymajor;                /* true iff Y is major dir. */
 #undef major
 #undef minor
     short major;               /* major dir delta (nonneg) */
@@ -434,7 +433,7 @@
 /*
  * OutBuild - rasterize all strokes into raster frame image
  */
-static bool
+static int
 OutBuild(void)                         /* returns true if successful */
 {
     struct band *hp;   /* *hp -> head of descr list */
@@ -696,7 +695,7 @@
  * banded buffered mode, we link the descriptor(s) into its starting
  * point band(s).
  */
-static bool
+static int
 BuildStr(coords *pt1, coords *pt2)             /* returns true or dies */
     /* endpoints */
 {
@@ -749,7 +748,7 @@
 }
 
 
-static bool
+static int
 GetCoords(coords *coop)
     /* -> input coordinates */
 {
@@ -791,10 +790,10 @@
 /*
   GetCoords - input x, y coordinates and scale into pixels
 */
-bool Get3Coords(coords *coop)
+int Get3Coords(coords *coop)
 {
     char trash[2];
-    bool ret;
+    int ret;
 
     ret = GetCoords(coop);
     if (fread(trash, sizeof(trash), 1, pfin) != 1)
@@ -805,7 +804,7 @@
 
 
 /* IEEE coordinates */
-bool Get3DCoords(coords *coop)
+int Get3DCoords(coords *coop)
 {
     static unsigned char in[3*8];
     static double out[2];
@@ -842,7 +841,7 @@
 }
 
 
-bool
+int
 GetDCoords(coords *coop)
     /* -> input coordinates */
 {
@@ -956,13 +955,13 @@
 static int
 DoFile(void)   /* returns vpl status code */
 {
-    bool plotted;      /* false => empty frame image */
+    int plotted;       /* false => empty frame image */
     int c;             /* input character */
     static coords newpos;      /* current input coordinates */
     static coords virpos;      /* virtual pen position */
     static unsigned char buf3[6*2];
     static unsigned char buf2[4*2];
-    static bool firsterase = true;
+    static int firsterase = true;
 
     /* process each frame into a raster image file */
 

Modified: brlcad/trunk/src/fbed/extern.h
===================================================================
--- brlcad/trunk/src/fbed/extern.h      2011-06-07 21:07:31 UTC (rev 44809)
+++ brlcad/trunk/src/fbed/extern.h      2011-06-07 21:52:44 UTC (rev 44810)
@@ -69,7 +69,7 @@
 extern Point windo_center;
 extern Point windo_anchor;
 extern Try *try_rootp;
-extern bool isSGI;
+extern int isSGI;
 extern char cread_buf[MACROBUFSZ], *cptr;
 extern char macro_buf[MACROBUFSZ], *macro_ptr;
 extern int brush_sz;

Modified: brlcad/trunk/src/fbed/fbed.c
===================================================================
--- brlcad/trunk/src/fbed/fbed.c        2011-06-07 21:07:31 UTC (rev 44809)
+++ brlcad/trunk/src/fbed/fbed.c        2011-06-07 21:52:44 UTC (rev 44810)
@@ -69,7 +69,7 @@
 
 struct vfont font;
 
-bool AproxEqColor(unsigned int a, unsigned int b, long t)
+int AproxEqColor(unsigned int a, unsigned int b, long t)
 {
     long c = a-b;
     if ( Abs( c ) > t )
@@ -78,7 +78,7 @@
        return true;
 }
 
-bool AproxPixel(RGBpixel a, RGBpixel b, int t)
+int AproxPixel(RGBpixel a, RGBpixel b, int t)
 {
     return (AproxEqColor(a[RED], b[RED], t) &&
            AproxEqColor(a[GRN], b[GRN], t) &&
@@ -103,11 +103,11 @@
 static int tolerance = 0;
 
 HIDDEN RGBpixel *pixel_Avg();
-HIDDEN bool drawRect2D(Rect2D *rectp, unsigned char *pixelp);
-HIDDEN bool getColor(unsigned char *pixelp, char *prompt, char *buffer);
-HIDDEN bool paintNonBorder(unsigned char *borderpix, Point *pt);
-HIDDEN bool paintSolidRegion(unsigned char *regionpix, Point *pt);
-HIDDEN bool popPoint(Point *pt, PtStack **spp);
+HIDDEN int drawRect2D(Rect2D *rectp, unsigned char *pixelp);
+HIDDEN int getColor(unsigned char *pixelp, char *prompt, char *buffer);
+HIDDEN int paintNonBorder(unsigned char *borderpix, Point *pt);
+HIDDEN int paintSolidRegion(unsigned char *regionpix, Point *pt);
+HIDDEN int popPoint(Point *pt, PtStack **spp);
 HIDDEN int do_Bitpad(Point *pointp);
 HIDDEN int fb_Setup(void);
 HIDDEN int pars_Argv(int argc, char **argv);
@@ -428,7 +428,7 @@
     return 0; /* shut up stupid compilers */
 }
 
-HIDDEN bool
+HIDDEN int
 drawRect2D(Rect2D *rectp, unsigned char *pixelp)
 {      
     int x, y;
@@ -483,7 +483,7 @@
     }
 }
 
-HIDDEN bool
+HIDDEN int
 paintNonBorder(unsigned char *borderpix, Point *pt)
 {
     RGBpixel currentpix;
@@ -504,7 +504,7 @@
                return true;
 }
 
-HIDDEN bool
+HIDDEN int
 paintSolidRegion(unsigned char *regionpix, Point *pt)
 {
     RGBpixel currentpix;
@@ -537,7 +537,7 @@
     *spp = new;
 }
 
-HIDDEN bool
+HIDDEN int
 popPoint(Point *pt, PtStack **spp)
 {
     PtStack *next;
@@ -622,7 +622,7 @@
     return;
 }
 
-HIDDEN bool
+HIDDEN int
 getColor(unsigned char *pixelp, char *prompt, char *buffer)
 {
     static char promptbuf[PROMPT_LEN];

Modified: brlcad/trunk/src/fbed/glob.c
===================================================================
--- brlcad/trunk/src/fbed/glob.c        2011-06-07 21:07:31 UTC (rev 44809)
+++ brlcad/trunk/src/fbed/glob.c        2011-06-07 21:52:44 UTC (rev 44810)
@@ -39,7 +39,7 @@
 Point windo_center; /* Center of screen, image coords. */
 Point windo_anchor; /* Saved "windo_center". */
 Try            *try_rootp = (Try *) NULL;
-bool isSGI = false; /* Are we running on an SGI with graphics. */
+int isSGI = false; /* Are we running on an SGI with graphics. */
 char cread_buf[MACROBUFSZ] = { 0 }, *cptr = cread_buf;
 char macro_buf[MACROBUFSZ] = { 0 }, *macro_ptr = macro_buf;
 int brush_sz = 0;

Modified: brlcad/trunk/src/fbed/std.h
===================================================================
--- brlcad/trunk/src/fbed/std.h 2011-06-07 21:07:31 UTC (rev 44809)
+++ brlcad/trunk/src/fbed/std.h 2011-06-07 21:52:44 UTC (rev 44810)
@@ -40,7 +40,6 @@
 #define NULL   0                       /* null pointer, all types */
 #endif
 
-typedef int bool;                      /* Boolean data */
 #define        false   0
 #define        true    1
 

Modified: brlcad/trunk/src/lgt/lgt.h
===================================================================
--- brlcad/trunk/src/lgt/lgt.h  2011-06-07 21:07:31 UTC (rev 44809)
+++ brlcad/trunk/src/lgt/lgt.h  2011-06-07 21:52:44 UTC (rev 44810)
@@ -80,8 +80,6 @@
 #define DEBUG_CELLSIZE 0x800000
 #define DEBUG_OCTREE   0x1000000
 
-typedef int    bool;
-
 /* Light source (LS) specific global information.
    Directions are with respect to the center of the model as calculated
    by 'librt.a'.
@@ -107,10 +105,10 @@
 
 typedef struct
 {
-    bool       m_fullscreen;
-    bool       m_lgts;
-    bool       m_over;
-    bool       m_keys;
+    int        m_fullscreen;
+    int        m_lgts;
+    int        m_over;
+    int        m_keys;
     int        m_noframes;
     int        m_curframe;
     int        m_endframe;

Modified: brlcad/trunk/src/lgt/reflect.c
===================================================================
--- brlcad/trunk/src/lgt/reflect.c      2011-06-07 21:07:31 UTC (rev 44809)
+++ brlcad/trunk/src/lgt/reflect.c      2011-06-07 21:52:44 UTC (rev 44810)
@@ -193,7 +193,7 @@
                }\
        }
 
-static bool hi_Obliq(RGBpixel (*pix));
+static int hi_Obliq(RGBpixel (*pix));
 
 static fastf_t myIpow(fastf_t d, int n);
 static fastf_t correct_Lgt(struct application *ap, struct partition *pp, 
Lgt_Source *lgt_entry);
@@ -655,7 +655,7 @@
 #define MA_WHITESP ", \t"      /* seperators for parameter list */
 #define MA_MID    "mid"
 /*
-  bool getMaMID( struct mater_info *map, int *id )
+  int getMaMID( struct mater_info *map, int *id )
 
   This is a kludge to permit material ids to be assigned to groups
   in 'mged'.  Since the mater_info struct can be inherited down the
@@ -663,7 +663,7 @@
   ma_matparm array, we will assign those digits to the material id
   of this region.
 */
-static bool
+static int
 getMaMID(struct mater_info *map, int *id)
 {
     char *copy;
@@ -1828,7 +1828,7 @@
     return;
 }
 
-static bool
+static int
 hi_Obliq(RGBpixel (*pix))
 {
     fastf_t    dir[3];
@@ -1904,7 +1904,7 @@
                xi < grid_sz && ! user_interrupt;
                xi++ )
        {
-           bool on = false;
+           int on = false;
            /* Output pixel based on bitmap value.  If bit is
               ON, pixel should be ON. */
            if ( anti_aliasing )

Modified: brlcad/trunk/src/lgt/sgi_dep.c
===================================================================
--- brlcad/trunk/src/lgt/sgi_dep.c      2011-06-07 21:07:31 UTC (rev 44809)
+++ brlcad/trunk/src/lgt/sgi_dep.c      2011-06-07 21:52:44 UTC (rev 44810)
@@ -82,7 +82,7 @@
 };
 
 /*
-  bool tryGetOrigin( long *xp, long *yp )
+  int tryGetOrigin( long *xp, long *yp )
 
   There is no way to inquire as to the frame buffer window origin
   through the frame buffer library (libfb(3)), so we need to use
@@ -94,7 +94,7 @@
   frame buffer since it doesn't advertise the values returned by
   fb_gettype().
 */
-static bool
+static int
 tryGetOrigin( xp, yp )
     long *xp, *yp;
 {

Modified: brlcad/trunk/src/proc-db/vegetation.h
===================================================================
--- brlcad/trunk/src/proc-db/vegetation.h       2011-06-07 21:07:31 UTC (rev 
44809)
+++ brlcad/trunk/src/proc-db/vegetation.h       2011-06-07 21:52:44 UTC (rev 
44810)
@@ -85,10 +85,8 @@
 #define TRUE 1
 #define FALSE 0
 
-typedef unsigned char bool;
-
 typedef struct growthPoint {
-    bool alive;
+    char alive;
     unsigned int growthEnergy;
     int growthEnergyDelta; /* amount growth energy changes per age */
     double length;

Modified: brlcad/trunk/src/util/bw-imp.c
===================================================================
--- brlcad/trunk/src/util/bw-imp.c      2011-06-07 21:07:31 UTC (rev 44809)
+++ brlcad/trunk/src/util/bw-imp.c      2011-06-07 21:52:44 UTC (rev 44810)
@@ -35,7 +35,6 @@
 
 #include "bu.h"
 
-typedef int bool;
 #define true 1
 #define false 0
 
@@ -87,16 +86,16 @@
 static size_t im_wpatches;             /* # 32-bit patches width */
 static size_t im_hpatches;             /* # 32-bit patches height */
 
-bool get_args(int argc, char **argv);
-bool im_close(void);
-bool im_header(void);
+int get_args(int argc, char **argv);
+int im_close(void);
+int im_header(void);
 void im_write(int y);
 
 char usage[] = "\
 Usage: bw-imp [-h -D] [-s squaresize] [-w width] [-n height]\n\
        [-X page_xoff] [-Y page_yoff] [-t thresh] [file.bw] > impress\n";
 
-bool
+int
 get_args(int argc, char **argv)
 {
     int c;
@@ -204,7 +203,7 @@
 }
 
 
-bool
+int
 im_header(void)
 {
 
@@ -308,7 +307,7 @@
 }
 
 
-bool
+int
 im_close(void)
 {
 /* (void)putchar(219);         ENDPAGE */


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to