Revision: 65321
          http://sourceforge.net/p/brlcad/code/65321
Author:   starseeker
Date:     2015-06-16 02:24:58 +0000 (Tue, 16 Jun 2015)
Log Message:
-----------
looks like the rle_config.h header has provisions for this

Modified Paths:
--------------
    brlcad/trunk/src/other/URToolkit/cnv/aliastorle.c
    brlcad/trunk/src/other/URToolkit/cnv/rletoabA60.c
    brlcad/trunk/src/other/URToolkit/cnv/rletoalias.c
    brlcad/trunk/src/other/URToolkit/cnv/rletorla.c
    brlcad/trunk/src/other/URToolkit/tools/avg4.c
    brlcad/trunk/src/other/URToolkit/tools/crop.c
    brlcad/trunk/src/other/URToolkit/tools/fant.c
    brlcad/trunk/src/other/URToolkit/tools/mcut.c
    brlcad/trunk/src/other/URToolkit/tools/rlecomp.c
    brlcad/trunk/src/other/URToolkit/tools/rleldmap.c
    brlcad/trunk/src/other/URToolkit/tools/rlestereo.c
    brlcad/trunk/src/other/libutahrle/colorquant.c
    brlcad/trunk/src/other/libutahrle/include/rle_config.h
    brlcad/trunk/src/other/libutahrle/rle_getrow.c
    brlcad/trunk/src/other/libutahrle/rle_hdr.c
    brlcad/trunk/src/other/libutahrle/rle_open_f.c
    brlcad/trunk/src/other/libutahrle/rle_rawrow.c

Modified: brlcad/trunk/src/other/URToolkit/cnv/aliastorle.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/cnv/aliastorle.c   2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/cnv/aliastorle.c   2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -600,7 +600,7 @@
    * Usually compilers fill buffers with zeros,
    * but ...
    */
-  memset( ptr, 0, size );
+  bzero( ptr, size );
   return ptr;
 }
 

Modified: brlcad/trunk/src/other/URToolkit/cnv/rletoabA60.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/cnv/rletoabA60.c   2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/cnv/rletoabA60.c   2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -106,9 +106,9 @@
     /*
      * Initialize some variables.
      */
-    memset( scanred, 0, LINE_LENGTH * FRAME_LENGTH );
-    memset( scangrn, 0, LINE_LENGTH * FRAME_LENGTH );
-    memset( scanblu, 0, LINE_LENGTH * FRAME_LENGTH );
+    bzero( scanred, LINE_LENGTH * FRAME_LENGTH );
+    bzero( scangrn, LINE_LENGTH * FRAME_LENGTH );
+    bzero( scanblu, LINE_LENGTH * FRAME_LENGTH );
 
     for (i=0; i<3; i++)
        scanbuf[i] = (rle_pixel *) malloc ( LINE_LENGTH * sizeof(rle_pixel));

Modified: brlcad/trunk/src/other/URToolkit/cnv/rletoalias.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/cnv/rletoalias.c   2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/cnv/rletoalias.c   2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -465,7 +465,7 @@
    * Usually compilers fill buffers with zeros,
    * but ...
    */
-  memset( ptr, 0, size );
+  bzero( ptr, size );
   return ptr;
 }
 

Modified: brlcad/trunk/src/other/URToolkit/cnv/rletorla.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/cnv/rletorla.c     2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/cnv/rletorla.c     2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -178,7 +178,7 @@
    char                *d_str;
    long                second;
 
-   memset(&rlb_head, 0, 740);
+   bzero(&rlb_head, 740);
    rlb_head.window.left   = minx;
    rlb_head.window.right  = maxx;
    rlb_head.window.top    = maxy;

Modified: brlcad/trunk/src/other/URToolkit/tools/avg4.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/tools/avg4.c       2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/tools/avg4.c       2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -121,7 +121,7 @@
                 */
                if ((chan == RLE_ALPHA) && (!in_hdr.alpha))
                {
-                   memset(alphptr, 0, new_xlen);
+                   bzero(alphptr, new_xlen);
                }
                else for( i = 0; i < new_xlen; i++)
                {

Modified: brlcad/trunk/src/other/URToolkit/tools/crop.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/tools/crop.c       2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/tools/crop.c       2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -173,7 +173,7 @@
                    *pix = c;
            }
            else
-               memset( (char *)&scanline[j][out_hdr.xmin], 0,
+               bzero( (char *)&scanline[j][out_hdr.xmin],
                       out_hdr.xmax - out_hdr.xmin + 1 );
 
        bottom_row = in_hdr.ymin;

Modified: brlcad/trunk/src/other/URToolkit/tools/fant.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/tools/fant.c       2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/tools/fant.c       2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -748,7 +748,7 @@
 clear_raster(ras_ptr)
 rle_pixel ***ras_ptr;
 {
-    memset( &(ras_ptr[cur_chan][0][0]), 0, array_width * array_lines );
+    bzero( &(ras_ptr[cur_chan][0][0]), array_width * array_lines );
 }
 
 #ifdef DEBUG

Modified: brlcad/trunk/src/other/URToolkit/tools/mcut.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/tools/mcut.c       2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/tools/mcut.c       2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -381,7 +381,7 @@
     /* Get a color box. */
     cb = (color_box_t *) malloc( sizeof( color_box_t ) );
     RLE_CHECK_ALLOC( cmd_nm, cb, 0 );
-    memset( cb, 0, sizeof( color_box_t ) );
+    bzero( cb, sizeof( color_box_t ) );
 
     /* Compact histogram. */
     for ( oldh = newh = 0; oldh < 32768; oldh++ )
@@ -502,7 +502,7 @@
      */
     newbox = (color_box_t *) malloc( sizeof(color_box_t) );
     RLE_CHECK_ALLOC( cmd_nm, newbox, 0 );
-    memset( newbox, 0, sizeof( color_box_t ) );
+    bzero( newbox, sizeof( color_box_t ) );
 
     newbox->hist = &box->hist[i];
     newbox->hsize = box->hsize - i;

Modified: brlcad/trunk/src/other/URToolkit/tools/rlecomp.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/tools/rlecomp.c    2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/tools/rlecomp.c    2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -184,13 +184,13 @@
        {
            A_hdr.bg_color = (int *)malloc( A_hdr.ncolors * sizeof(int) );
            RLE_CHECK_ALLOC( A_hdr.cmd, A_hdr.bg_color, "background color" );
-           memset( A_hdr.bg_color, 0, A_hdr.ncolors * sizeof(int) );
+           bzero( A_hdr.bg_color, A_hdr.ncolors * sizeof(int) );
        }
        if ( B_hdr.bg_color == 0 )
        {
            B_hdr.bg_color = (int *)malloc( B_hdr.ncolors * sizeof(int) );
            RLE_CHECK_ALLOC( B_hdr.cmd, B_hdr.bg_color, "background color" );
-           memset( B_hdr.bg_color, 0, B_hdr.ncolors * sizeof(int) );
+           bzero( B_hdr.bg_color, B_hdr.ncolors * sizeof(int) );
        }
 
        /*
@@ -204,8 +204,8 @@
            MALLOC_ERR;
        for ( i = RLE_ALPHA; i < out_hdr.ncolors; i++ )
        {
-           memset( Ascanline[i], 0, out_hdr.xmax + 1 );
-           memset( Bscanline[i], 0, out_hdr.xmax + 1 );
+           bzero( Ascanline[i], out_hdr.xmax + 1 );
+           bzero( Bscanline[i], out_hdr.xmax + 1 );
        }
 
        if (rle_row_alloc( &out_hdr, &scanout ) < 0)
@@ -433,7 +433,7 @@
     if (*num_skip > 0)         /* Generate a blank (skipped) scanline */
     {
        for( i = RLE_ALPHA; i < the_hdr->ncolors; i++ )
-           memset( scanline[i], 0, the_hdr->xmax );
+           bzero( scanline[i], the_hdr->xmax );
        (*num_skip)--;
        if (*num_skip == 0)
            *num_skip = -1;     /* Flag raw data available */
@@ -537,7 +537,7 @@
            /*
             * Create a "bytemask" of the non-zero pixels.
             */
-           memset( non_zero_pixels, 0, xlen );
+           bzero( non_zero_pixels, xlen );
            for (chan = 0; chan < in_hdr->ncolors; chan++ )
            {
                register int bgc = in_hdr->bg_color[chan];

Modified: brlcad/trunk/src/other/URToolkit/tools/rleldmap.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/tools/rleldmap.c   2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/tools/rleldmap.c   2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -238,7 +238,7 @@
            else
                break;
            /* Build in_hdr for non-existant image (all zeros works fine) */
-           memset( &in_hdr, 0, sizeof in_hdr );
+           bzero( &in_hdr, sizeof in_hdr );
        }
 
        /* If apply flag was given, check for compatibility of color maps */

Modified: brlcad/trunk/src/other/URToolkit/tools/rlestereo.c
===================================================================
--- brlcad/trunk/src/other/URToolkit/tools/rlestereo.c  2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/URToolkit/tools/rlestereo.c  2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -195,10 +195,10 @@
             */
            if (GreenFlag) {
                RightIndex = 1;
-               memset(outline[2], 0, Xres * sizeof(rle_pixel));
+               bzero(outline[2], Xres * sizeof(rle_pixel));
            } else {
                RightIndex = 2;
-               memset(outline[1], 0, Xres * sizeof(rle_pixel));
+               bzero(outline[1], Xres * sizeof(rle_pixel));
            }
 
            /*

Modified: brlcad/trunk/src/other/libutahrle/colorquant.c
===================================================================
--- brlcad/trunk/src/other/libutahrle/colorquant.c      2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/libutahrle/colorquant.c      2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -126,6 +126,10 @@
  * The colorquant() routine has been tested on an Iris 4D70 workstation,
  * a Sun 3/60 workstation, and (to some extent), a Macintosh.
  *
+ * Calls to bzero() may have to be replaced with the appropriate thing on
+ * your system.  (bzero(ptr, len) writes 'len' 0-bytes starting at the location
+ * pointed to by ptr.)
+ *
  * Although I've tried to avoid integer overflow problems where ever possible,
  * it's likely I've missed a spot where an 'int' should really be a 'long'.
  * (On the machine this was developed on, an int == long == 32 bits.)
@@ -268,9 +272,9 @@
        /*
         * Zero-out the projected frequency arrays of the largest box.
         */
-       memset(Boxes->freq[0], 0, ColormaxI * sizeof(unsigned long));
-       memset(Boxes->freq[1], 0, ColormaxI * sizeof(unsigned long));
-       memset(Boxes->freq[2], 0, ColormaxI * sizeof(unsigned long));
+       bzero(Boxes->freq[0], ColormaxI * sizeof(unsigned long));
+       bzero(Boxes->freq[1], ColormaxI * sizeof(unsigned long));
+       bzero(Boxes->freq[2], ColormaxI * sizeof(unsigned long));
        SumPixels = 0;
     }
 
@@ -550,9 +554,9 @@
        register int b, g, r;
        int roff;
 
-       memset(box1->freq[0], 0, ColormaxI * sizeof(unsigned long));
-       memset(box1->freq[1], 0, ColormaxI * sizeof(unsigned long));
-       memset(box1->freq[2], 0, ColormaxI * sizeof(unsigned long));
+       bzero(box1->freq[0], ColormaxI * sizeof(unsigned long));
+       bzero(box1->freq[1], ColormaxI * sizeof(unsigned long));
+       bzero(box1->freq[2], ColormaxI * sizeof(unsigned long));
 
        for (r = box1->low[0]; r < box1->high[0]; r++) {
                roff = r << Bits;

Modified: brlcad/trunk/src/other/libutahrle/include/rle_config.h
===================================================================
--- brlcad/trunk/src/other/libutahrle/include/rle_config.h      2015-06-16 
02:17:52 UTC (rev 65320)
+++ brlcad/trunk/src/other/libutahrle/include/rle_config.h      2015-06-16 
02:24:58 UTC (rev 65321)
@@ -110,6 +110,10 @@
 #endif /* __STDC__ */
 #endif /* USE_STRING_H */
 
+#if defined(__MINGW32__)
+#  define NEED_BSTRING
+#endif
+
 #ifdef NEED_BSTRING
     /* From bstring.c. */
     /*****************************************************************

Modified: brlcad/trunk/src/other/libutahrle/rle_getrow.c
===================================================================
--- brlcad/trunk/src/other/libutahrle/rle_getrow.c      2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/libutahrle/rle_getrow.c      2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -356,13 +356,13 @@
     if ( the_hdr->background != 1 )
     {
        if ( the_hdr->alpha && RLE_BIT( *the_hdr, -1 ) )
-           memset( (char *)scanline[-1] + the_hdr->xmin,
-                  0, the_hdr->xmax - the_hdr->xmin + 1 );
+           bzero( (char *)scanline[-1] + the_hdr->xmin,
+                  the_hdr->xmax - the_hdr->xmin + 1 );
        for ( nc = 0; nc < the_hdr->ncolors; nc++ )
            if ( RLE_BIT( *the_hdr, nc ) )
                /* Unless bg color given explicitly, use 0. */
                if ( the_hdr->background != 2 || the_hdr->bg_color[nc] == 0 )
-                   memset( (char *)scanline[nc] + the_hdr->xmin, 0,
+                   bzero( (char *)scanline[nc] + the_hdr->xmin,
                           the_hdr->xmax - the_hdr->xmin + 1 );
                else
                    bfill( (char *)scanline[nc] + the_hdr->xmin,

Modified: brlcad/trunk/src/other/libutahrle/rle_hdr.c
===================================================================
--- brlcad/trunk/src/other/libutahrle/rle_hdr.c 2015-06-16 02:17:52 UTC (rev 
65320)
+++ brlcad/trunk/src/other/libutahrle/rle_hdr.c 2015-06-16 02:24:58 UTC (rev 
65321)
@@ -153,7 +153,7 @@
        int size = to_hdr->ncolors * sizeof(int);
        to_hdr->bg_color = (int *)malloc( size );
        RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->bg_color, "background color" );
-       memcpy( from_hdr->bg_color, to_hdr->bg_color, size );
+       bcopy( from_hdr->bg_color, to_hdr->bg_color, size );
     }
 
     if ( to_hdr->cmap )
@@ -161,7 +161,7 @@
        int size = to_hdr->ncmap * (1 << to_hdr->cmaplen) * sizeof(rle_map);
        to_hdr->cmap = (rle_map *)malloc( size );
        RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->cmap, "color map" );
-       memcpy( from_hdr->cmap, to_hdr->cmap, size );
+       bcopy( from_hdr->cmap, to_hdr->cmap, size );
     }
 
     /* Only copy array of pointers, as the original comment memory
@@ -180,7 +180,7 @@
            size *= sizeof(char *);
            to_hdr->comments = (CONST_DECL char **)malloc( size );
            RLE_CHECK_ALLOC( to_hdr->cmd, to_hdr->comments, "comments" );
-           memcpy( (const void *)from_hdr->comments, (void *)to_hdr->comments, 
size );
+           bcopy( (const void *)from_hdr->comments, (void *)to_hdr->comments, 
size );
        }
        else
            to_hdr->comments = NULL;    /* Blow off empty comment list. */

Modified: brlcad/trunk/src/other/libutahrle/rle_open_f.c
===================================================================
--- brlcad/trunk/src/other/libutahrle/rle_open_f.c      2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/libutahrle/rle_open_f.c      2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -24,10 +24,6 @@
 #endif
 #include <errno.h>
 
-#if defined(__MINGW32__)
-#  define NO_OPEN_PIPES
-#endif
-
 /* Count outstanding children.  Assume no more than 100 possible. */
 #define MAX_CHILDREN 100
 static int catching_children = 0;

Modified: brlcad/trunk/src/other/libutahrle/rle_rawrow.c
===================================================================
--- brlcad/trunk/src/other/libutahrle/rle_rawrow.c      2015-06-16 02:17:52 UTC 
(rev 65320)
+++ brlcad/trunk/src/other/libutahrle/rle_rawrow.c      2015-06-16 02:24:58 UTC 
(rev 65321)
@@ -52,7 +52,7 @@
                    *outptr = j;
            }
            else
-               memset( (char *)&outrows[chan][the_hdr->xmin], 0,
+               bzero( (char *)&outrows[chan][the_hdr->xmin],
                       the_hdr->xmax - the_hdr->xmin + 1 );
 
            for( i = 0; i < nraw[chan]; i++ )
@@ -61,7 +61,7 @@
                switch (raw[chan][i].opcode)
                {
                case RByteDataOp:
-                   memcpy( (char *)raw[chan][i].u.pixels, (char *)outptr,
+                   bcopy( (char *)raw[chan][i].u.pixels, (char *)outptr,
                           raw[chan][i].length );
                    break;
 

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


------------------------------------------------------------------------------
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to