Revision: 71996
          http://sourceforge.net/p/brlcad/code/71996
Author:   starseeker
Date:     2018-11-08 21:11:26 +0000 (Thu, 08 Nov 2018)
Log Message:
-----------
Nope - second parameter of 64 bit fseek function also causes MSVC problems.

Modified Paths:
--------------
    brlcad/trunk/bench/pixcmp.c
    brlcad/trunk/include/bu/file.h
    brlcad/trunk/include/config_win.h.in
    brlcad/trunk/src/anim/anim_sort.c
    brlcad/trunk/src/conv/asc/asc2g.c
    brlcad/trunk/src/conv/dxf/dxf-g.c
    brlcad/trunk/src/conv/fast4-g.c
    brlcad/trunk/src/conv/g-acad.c
    brlcad/trunk/src/conv/iges/findp.c
    brlcad/trunk/src/conv/iges/g-iges.c
    brlcad/trunk/src/conv/iges/readrec.c
    brlcad/trunk/src/conv/iges/recsize.c
    brlcad/trunk/src/conv/nastran-g.c
    brlcad/trunk/src/conv/vdeck/vdeck.c
    brlcad/trunk/src/fbed/char.c
    brlcad/trunk/src/lgt/char.c
    brlcad/trunk/src/lgt/ir.c
    brlcad/trunk/src/lgt/octree.c
    brlcad/trunk/src/libbu/file.c
    brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c
    brlcad/trunk/src/libicv/rot.c
    brlcad/trunk/src/librt/db_corrupt.c
    brlcad/trunk/src/librt/db_io.c
    brlcad/trunk/src/librt/db_scan.c
    brlcad/trunk/src/rt/do.c
    brlcad/trunk/src/rt/view.c
    brlcad/trunk/src/util/ap-pix.c
    brlcad/trunk/src/util/bwcrop.c
    brlcad/trunk/src/util/bwhisteq.c
    brlcad/trunk/src/util/bwrot.c
    brlcad/trunk/src/util/bwscale.c
    brlcad/trunk/src/util/hex.c
    brlcad/trunk/src/util/pixcrop.c
    brlcad/trunk/src/util/pixrot.c
    brlcad/trunk/src/util/pixscale.c

Modified: brlcad/trunk/bench/pixcmp.c
===================================================================
--- brlcad/trunk/bench/pixcmp.c 2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/bench/pixcmp.c 2018-11-08 21:11:26 UTC (rev 71996)
@@ -215,7 +215,7 @@
     }
 
     /* skip requested pixels/bytes in FILE1 */
-    if (f1_skip && fseek(f1, f1_skip, SEEK_SET)) {
+    if (f1_skip && bu_fseek(f1, f1_skip, SEEK_SET)) {
        bu_log("ERROR: Unable to seek %zd %s%s in FILE1\n",
               f1_skip,
               print_bytes?"byte":"pixel",
@@ -225,7 +225,7 @@
     }
 
     /* skip requested pixels in FILE2 */
-    if (f2_skip && fseek(f2, f2_skip, SEEK_SET)) {
+    if (f2_skip && bu_fseek(f2, f2_skip, SEEK_SET)) {
        bu_log("ERROR: Unable to seek %zd %s%s in FILE2\n",
               f1_skip,
               print_bytes?"byte":"pixel",

Modified: brlcad/trunk/include/bu/file.h
===================================================================
--- brlcad/trunk/include/bu/file.h      2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/include/bu/file.h      2018-11-08 21:11:26 UTC (rev 71996)
@@ -177,6 +177,14 @@
  * function signatures (a simple define of the 32 bit version to the 64 bit
  * version will produce compile errors.)
  */
+BU_EXPORT extern int bu_fseek(FILE *stream, off_t offset, int origin);
+
+/**
+ * This wrapper appears to be necessary (at least on Visual Studio) to handle
+ * situations where 32 and 64 bit versions of this function have different
+ * function signatures (a simple define of the 32 bit version to the 64 bit
+ * version will produce compile errors.)
+ */
 BU_EXPORT extern off_t bu_ftell(FILE *stream);
 
 /** @} */

Modified: brlcad/trunk/include/config_win.h.in
===================================================================
--- brlcad/trunk/include/config_win.h.in        2018-11-08 21:02:50 UTC (rev 
71995)
+++ brlcad/trunk/include/config_win.h.in        2018-11-08 21:11:26 UTC (rev 
71996)
@@ -212,13 +212,6 @@
 #   define lseek _lseek
 #endif
 
-/* set up fseek */
-#if defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8
-#   define fseek _fseeki64
-#else
-#   define fseek _fseek
-#endif
-
 #cmakedefine fmax __max
 #define ioctl ioctlsocket
 

Modified: brlcad/trunk/src/anim/anim_sort.c
===================================================================
--- brlcad/trunk/src/anim/anim_sort.c   2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/anim/anim_sort.c   2018-11-08 21:11:26 UTC (rev 71996)
@@ -134,9 +134,9 @@
        number = -1;
        success = 0; /* tells whether or not any frames have been found which 
have the current frame number*/
        if (incremental) {
-           fseek(stdin, 0, 0);
+           bu_fseek(stdin, 0, 0);
        } else {
-           fseek(stdin, last_pos, 0);
+           bu_fseek(stdin, last_pos, 0);
        }
 
        reserve = MAXLEN*MAXLINES;

Modified: brlcad/trunk/src/conv/asc/asc2g.c
===================================================================
--- brlcad/trunk/src/conv/asc/asc2g.c   2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/conv/asc/asc2g.c   2018-11-08 21:11:26 UTC (rev 71996)
@@ -1065,7 +1065,7 @@
     pg->max_npts = 0;
 
     /* Return to first 'Q' record */
-    fseek(ifp, startpos, 0);
+    bu_fseek(ifp, startpos, 0);
 
     for (nlines = 0; nlines < pg->npoly; nlines++) {
        struct rt_pg_face_internal *fp = &pg->poly[nlines];

Modified: brlcad/trunk/src/conv/dxf/dxf-g.c
===================================================================
--- brlcad/trunk/src/conv/dxf/dxf-g.c   2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/conv/dxf/dxf-g.c   2018-11-08 21:11:26 UTC (rev 71996)
@@ -1109,7 +1109,7 @@
                    break;
                }
                bu_free((char *)tmp_state, "curr_state");
-               fseek(dxf, curr_state->file_offset, SEEK_SET);
+               bu_fseek(dxf, curr_state->file_offset, SEEK_SET);
                curr_state->sub_state = UNKNOWN_ENTITY_STATE;
                if (verbose) {
                    bu_log("Popped state at end of inserted block (seeked to 
%ld)\n", curr_state->file_offset);
@@ -1223,7 +1223,7 @@
                BU_LIST_PUSH(&state_stack, &(curr_state->l));
                curr_state = new_state;
                new_state = NULL;
-               fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
+               bu_fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
                curr_state->state = ENTITIES_SECTION;
                curr_state->sub_state = UNKNOWN_ENTITY_STATE;
                if (verbose) {
@@ -2504,7 +2504,7 @@
                    BU_LIST_PUSH(&state_stack, &(curr_state->l));
                    curr_state = new_state;
                    new_state = NULL;
-                   fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
+                   bu_fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
                    curr_state->state = ENTITIES_SECTION;
                    curr_state->sub_state = UNKNOWN_ENTITY_STATE;
                    if (verbose) {

Modified: brlcad/trunk/src/conv/fast4-g.c
===================================================================
--- brlcad/trunk/src/conv/fast4-g.c     2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/conv/fast4-g.c     2018-11-08 21:11:26 UTC (rev 71996)
@@ -2095,7 +2095,7 @@
        }
     }
     /* seek to start of the section */
-    fseek(fpin, section_start, SEEK_SET);
+    bu_fseek(fpin, section_start, SEEK_SET);
 }
 
 

Modified: brlcad/trunk/src/conv/g-acad.c
===================================================================
--- brlcad/trunk/src/conv/g-acad.c      2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/conv/g-acad.c      2018-11-08 21:11:26 UTC (rev 71996)
@@ -649,7 +649,7 @@
     /* Write out number of facet entities to .facet file */
 
     rewind(fp);
-    fseek(fp, 46, 0); /* Re-position pointer to 2nd line */
+    bu_fseek(fp, 46, 0); /* Re-position pointer to 2nd line */
     fprintf(fp, "%d\n", regions_written); /* Write out number of regions */
     fclose(fp);
 

Modified: brlcad/trunk/src/conv/iges/findp.c
===================================================================
--- brlcad/trunk/src/conv/iges/findp.c  2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/conv/iges/findp.c  2018-11-08 21:11:26 UTC (rev 71996)
@@ -44,7 +44,7 @@
 
     saverec = currec;  /* save current record number */
 
-    if (fseek(fd, 0, 2)) {
+    if (bu_fseek(fd, 0, 2)) {
        /* go to end of file */
        bu_log("Cannot seek to end of file\n");
        perror("Findp");

Modified: brlcad/trunk/src/conv/iges/g-iges.c
===================================================================
--- brlcad/trunk/src/conv/iges/g-iges.c 2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/conv/iges/g-iges.c 2018-11-08 21:11:26 UTC (rev 71996)
@@ -402,7 +402,7 @@
 
     if (!multi_file) {
        /* Copy the parameter section from the temporary file to the output 
file */
-       if ((fseek(fp_param, 0, 0))) {
+       if ((bu_fseek(fp_param, 0, 0))) {
            perror("g-iges");
            bu_exit(1, "Cannot seek to start of temporary file\n");
        }
@@ -619,7 +619,7 @@
            char copy_buffer[CP_BUF_SIZE] = {0};
 
            /* Copy the parameter section from the temporary file to the output 
file */
-           if ((fseek(fp_param, 0, 0))) {
+           if ((bu_fseek(fp_param, 0, 0))) {
                perror("g-iges");
                bu_exit(1, "Cannot seek to start of temporary file\n");
            }

Modified: brlcad/trunk/src/conv/iges/readrec.c
===================================================================
--- brlcad/trunk/src/conv/iges/readrec.c        2018-11-08 21:02:50 UTC (rev 
71995)
+++ brlcad/trunk/src/conv/iges/readrec.c        2018-11-08 21:11:26 UTC (rev 
71996)
@@ -44,7 +44,7 @@
 
     currec = recno;
     offset = (recno - 1) * reclen;
-    if (fseek(fd, offset, 0)) {
+    if (bu_fseek(fd, offset, 0)) {
        bu_log("Error in seek\n");
        perror("Readrec");
        bu_exit(1, NULL);

Modified: brlcad/trunk/src/conv/iges/recsize.c
===================================================================
--- brlcad/trunk/src/conv/iges/recsize.c        2018-11-08 21:02:50 UTC (rev 
71995)
+++ brlcad/trunk/src/conv/iges/recsize.c        2018-11-08 21:11:26 UTC (rev 
71996)
@@ -68,7 +68,7 @@
     if (k == (-1))     /* We didn't encounter an early EOF */
        k = NRECS;
 
-    if (fseek(fd, 0, 0)) {
+    if (bu_fseek(fd, 0, 0)) {
        /* rewind file */
        bu_log("Cannot rewind file\n");
        perror("Recsize");

Modified: brlcad/trunk/src/conv/nastran-g.c
===================================================================
--- brlcad/trunk/src/conv/nastran-g.c   2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/conv/nastran-g.c   2018-11-08 21:11:26 UTC (rev 71996)
@@ -161,7 +161,7 @@
     for (i=0; i < 20; i++)
        prev_rec[i][0] = '\0';
 
-    fseek(fpin, start_off, SEEK_SET);
+    bu_fseek(fpin, start_off, SEEK_SET);
     line_count = bulk_data_start_line;
 
     tmp = bu_fgets(next_line, MAX_LINE_SIZE, fpin);
@@ -1219,7 +1219,7 @@
     nmg_model = (struct model *)NULL;
 
     /* count grid points */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (bu_fgets(line, MAX_LINE_SIZE, fptmp)) {
        if (!bu_strncmp(line, "GRID", 4))
            grid_count++;
@@ -1229,7 +1229,7 @@
     }
 
     /* get default values and properties */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        if (!bu_strncmp(curr_rec[0], "BAROR", 5)) {
            /* get BAR defaults */
@@ -1262,7 +1262,7 @@
     g_pts = (struct grid_point *)bu_calloc(grid_count, sizeof(struct 
grid_point), "grid points");
 
     /* get all grid points */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        int gid;
        int cid;
@@ -1287,7 +1287,7 @@
 
 
     /* find coordinate systems */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        if (bu_strncmp(curr_rec[0], "CORD", 4))
            continue;
@@ -1306,7 +1306,7 @@
     mk_id(fpout, nastran_file);
 
     /* get elements */
-    fseek(fptmp, 0, SEEK_SET);
+    bu_fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        if (!bu_strncmp(curr_rec[0], "CBAR", 4))
            get_cbar();

Modified: brlcad/trunk/src/conv/vdeck/vdeck.c
===================================================================
--- brlcad/trunk/src/conv/vdeck/vdeck.c 2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/conv/vdeck/vdeck.c 2018-11-08 21:11:26 UTC (rev 71996)
@@ -1272,7 +1272,7 @@
 
     /* Go back, and add number of solids and regions on second card. */
     if (savsol >= 0)
-       fseek(solfp, savsol, 0);
+       bu_fseek(solfp, savsol, 0);
 
     itoa(nns, buff, 5);
     ewrite(solfp, buff, 5);

Modified: brlcad/trunk/src/fbed/char.c
===================================================================
--- brlcad/trunk/src/fbed/char.c        2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/fbed/char.c        2018-11-08 21:11:26 UTC (rev 71996)
@@ -70,7 +70,7 @@
        char_id = (int) line[char_count] & 0377;
 
        /* locate the bitmap for the character in the file */
-       if (fseek(font.ffdes, SWABV(font.dir[char_id].addr) + font.offset, 0) 
== EOF) {
+       if (bu_fseek(font.ffdes, SWABV(font.dir[char_id].addr) + font.offset, 
0) == EOF) {
            fb_log("fseek() to %zd failed.\n",
                   (SWABV(font.dir[char_id].addr) + font.offset));
            return;

Modified: brlcad/trunk/src/lgt/char.c
===================================================================
--- brlcad/trunk/src/lgt/char.c 2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/lgt/char.c 2018-11-08 21:11:26 UTC (rev 71996)
@@ -70,7 +70,7 @@
        }
 
        /* locate the bitmap for the character in the file */
-       if (fseek(font.ffdes, SWABV(font.dir[char_id].addr)+font.offset, 0) == 
EOF) {
+       if (bu_fseek(font.ffdes, SWABV(font.dir[char_id].addr)+font.offset, 0) 
== EOF) {
            bu_log("fseek() to %zd failed.\n",
                   (SWABV(font.dir[char_id].addr) + font.offset)
                );

Modified: brlcad/trunk/src/lgt/ir.c
===================================================================
--- brlcad/trunk/src/lgt/ir.c   2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/lgt/ir.c   2018-11-08 21:11:26 UTC (rev 71996)
@@ -152,7 +152,7 @@
 static int
 get_IR(int x, int y, int *fahp, FILE *fp)
 {
-    if (fseek(fp, (y*IR_DATA_WID + x)*sizeof(int), 0) != 0)
+    if (bu_fseek(fp, (y*IR_DATA_WID + x)*sizeof(int), 0) != 0)
        return 0;
     else
        if (fread((char *) fahp, (int) sizeof(int), 1, fp) != 1)

Modified: brlcad/trunk/src/lgt/octree.c
===================================================================
--- brlcad/trunk/src/lgt/octree.c       2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/lgt/octree.c       2018-11-08 21:11:26 UTC (rev 71996)
@@ -337,7 +337,7 @@
     }
     if (hdr_ptlist.f_length > 0) {
        /* Go back and fudge point count.                       */
-       if (fseek(fp, addr, 0)) {
+       if (bu_fseek(fp, addr, 0)) {
            bu_log("\"%s\"(%d) Fseek failed.\n", __FILE__, __LINE__);
            return 0;
        }
@@ -349,7 +349,7 @@
            return 0;
        }
        /* Re-position write pointer to end-of-file.            */
-       if (fseek(fp, 0, 2)) {
+       if (bu_fseek(fp, 0, 2)) {
            bu_log("\"%s\"(%d) Fseek failed.\n", __FILE__, __LINE__);
            return 0;
        }

Modified: brlcad/trunk/src/libbu/file.c
===================================================================
--- brlcad/trunk/src/libbu/file.c       2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/libbu/file.c       2018-11-08 21:11:26 UTC (rev 71996)
@@ -384,6 +384,22 @@
     return 1;
 }
 
+
+int
+bu_fseek(FILE *stream, off_t offset, int origin)
+{
+    int ret;
+
+#if defined(HAVE__FSEEKI64) && defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8
+    ret = _fseeki64(stream, offset, origin);
+#else
+    ret = fseek(stream, offset, origin);
+#endif
+
+    return ret;
+}
+
+
 off_t
 bu_ftell(FILE *stream)
 {

Modified: brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c
===================================================================
--- brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c    2018-11-08 
21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/libgcv/plugins/fastgen4/fastgen4_read.c    2018-11-08 
21:11:26 UTC (rev 71996)
@@ -2189,7 +2189,7 @@
        }
     }
     /* seek to start of the section */
-    fseek(pstate->fpin, section_start, SEEK_SET);
+    bu_fseek(pstate->fpin, section_start, SEEK_SET);
 }
 
 

Modified: brlcad/trunk/src/libicv/rot.c
===================================================================
--- brlcad/trunk/src/libicv/rot.c       2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/libicv/rot.c       2018-11-08 21:11:26 UTC (rev 71996)
@@ -351,7 +351,7 @@
                xout = (nyin - 1) - lasty;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%zd)\n", argv[0], (void *)ofp, outbyte);
@@ -381,7 +381,7 @@
                xout = yin;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%zd)\n", argv[0], (void *)ofp, outbyte);
@@ -403,7 +403,7 @@
                yout = (nyin - 1) - y + 1;
                outbyte = yout * scanbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%zd)\n", argv[0], (void *)ofp, outbyte);

Modified: brlcad/trunk/src/librt/db_corrupt.c
===================================================================
--- brlcad/trunk/src/librt/db_corrupt.c 2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/librt/db_corrupt.c 2018-11-08 21:11:26 UTC (rev 71996)
@@ -54,7 +54,7 @@
     RT_CK_DBI(dbip);
 
     /* get into position */
-    ret = fseek(dbip->dbi_fp, offset, 0);
+    ret = bu_fseek(dbip->dbi_fp, offset, 0);
     if (ret) {
        bu_log("Database seek failure, unable to seek [%s]\n", name);
        return 0;

Modified: brlcad/trunk/src/librt/db_io.c
===================================================================
--- brlcad/trunk/src/librt/db_io.c      2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/librt/db_io.c      2018-11-08 21:11:26 UTC (rev 71996)
@@ -78,7 +78,7 @@
     }
     bu_semaphore_acquire(BU_SEM_SYSCALL);
 
-    ret = fseek(dbip->dbi_fp, offset, 0);
+    ret = bu_fseek(dbip->dbi_fp, offset, 0);
     if (ret)
        bu_bomb("db_read: fseek error\n");
     got = (size_t)fread(addr, 1, count, dbip->dbi_fp);
@@ -192,7 +192,7 @@
     bu_semaphore_acquire(BU_SEM_SYSCALL);
     bu_interrupt_suspend();
 
-    (void)fseek(dbip->dbi_fp, offset, 0);
+    (void)bu_fseek(dbip->dbi_fp, offset, 0);
     got = fwrite(addr, 1, count, dbip->dbi_fp);
     fflush(dbip->dbi_fp);
 

Modified: brlcad/trunk/src/librt/db_scan.c
===================================================================
--- brlcad/trunk/src/librt/db_scan.c    2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/librt/db_scan.c    2018-11-08 21:11:26 UTC (rev 71996)
@@ -108,7 +108,7 @@
     totrec = 0;
     while (1) {
        nrec = 0;
-       if (fseek(dbip->dbi_fp, next, 0) != 0) {
+       if (bu_fseek(dbip->dbi_fp, next, 0) != 0) {
            bu_log("db_scan:  fseek(offset=%zd) failure\n", next);
            return -1;
        }
@@ -149,7 +149,7 @@
                        break;
                    DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_ARS_B) {
-                       fseek(dbip->dbi_fp, here, 0);
+                       bu_fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
                    nrec++;
@@ -194,7 +194,7 @@
                        break;
                    DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_P_DATA) {
-                       fseek(dbip->dbi_fp, here, 0);
+                       bu_fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
                    nrec++;
@@ -213,7 +213,7 @@
                        break;
                    DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_BSURF) {
-                       fseek(dbip->dbi_fp, here, 0);
+                       bu_fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
 
@@ -315,7 +315,7 @@
                        break;
                    DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_MEMB) {
-                       fseek(dbip->dbi_fp, here, 0);
+                       bu_fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
                    nrec++;

Modified: brlcad/trunk/src/rt/do.c
===================================================================
--- brlcad/trunk/src/rt/do.c    2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/rt/do.c    2018-11-08 21:11:26 UTC (rev 71996)
@@ -613,7 +613,7 @@
     }
     if (outfp) {
         bu_semaphore_acquire(BU_SEM_SYSCALL);
-        if (fseek(outfp, cur_pixel*clt_o[1], 0) != 0)
+        if (bu_fseek(outfp, cur_pixel*clt_o[1], 0) != 0)
             fprintf(stderr, "fseek error\n");
         if (fwrite(pixelp, size, 1, outfp) != 1)
             bu_exit(EXIT_FAILURE, "pixel fwrite error");

Modified: brlcad/trunk/src/rt/view.c
===================================================================
--- brlcad/trunk/src/rt/view.c  2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/rt/view.c  2018-11-08 21:11:26 UTC (rev 71996)
@@ -306,7 +306,7 @@
                    icv_writepixel(bif, ap->a_x, ap->a_y, ap->a_color);
                } else if (outfp != NULL) {
                    bu_semaphore_acquire(BU_SEM_SYSCALL);
-                   if (fseek(outfp, (ap->a_y*width*pwidth) + (ap->a_x*pwidth), 
0) != 0)
+                   if (bu_fseek(outfp, (ap->a_y*width*pwidth) + 
(ap->a_x*pwidth), 0) != 0)
                        fprintf(stderr, "fseek error\n");
                    if (fwrite(p, 3, 1, outfp) != 1)
                        bu_exit(EXIT_FAILURE, "pixel fwrite error");
@@ -512,7 +512,7 @@
                size_t count;
 
                bu_semaphore_acquire(BU_SEM_SYSCALL);
-               if (fseek(outfp, ap->a_y*width*pwidth, 0) != 0)
+               if (bu_fseek(outfp, ap->a_y*width*pwidth, 0) != 0)
                    fprintf(stderr, "fseek error\n");
                count = fwrite(scanline[ap->a_y].sl_buf,
                               sizeof(char), width*pwidth, outfp);

Modified: brlcad/trunk/src/util/ap-pix.c
===================================================================
--- brlcad/trunk/src/util/ap-pix.c      2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/util/ap-pix.c      2018-11-08 21:11:26 UTC (rev 71996)
@@ -80,9 +80,9 @@
        bu_exit(2, "%s: can't open \"%s\"\n", argv0, argv[1]);
     }
     yelfp = fopen(argv[1], "r");
-    fseek(yelfp, 50*sizeof(yelline), 0);
+    bu_fseek(yelfp, 50*sizeof(yelline), 0);
     cyafp = fopen(argv[1], "r");
-    fseek(cyafp, 100*sizeof(cyaline), 0);
+    bu_fseek(cyafp, 100*sizeof(cyaline), 0);
 
     line = 0;
     while ((int)fread(&cyaline, sizeof(cyaline), 1, cyafp) > 0) {

Modified: brlcad/trunk/src/util/bwcrop.c
===================================================================
--- brlcad/trunk/src/util/bwcrop.c      2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/util/bwcrop.c      2018-11-08 21:11:26 UTC (rev 71996)
@@ -103,7 +103,7 @@
     if (buf_start < 0)
        buf_start = 0;
 
-    fseek(ifp, buf_start * scanlen, 0);
+    bu_fseek(ifp, buf_start * scanlen, 0);
     ret = fread(buffer, scanlen, buflines, ifp);
     if (ret == 0)
        perror("fread");

Modified: brlcad/trunk/src/util/bwhisteq.c
===================================================================
--- brlcad/trunk/src/util/bwhisteq.c    2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/util/bwhisteq.c    2018-11-08 21:11:26 UTC (rev 71996)
@@ -105,7 +105,7 @@
            fprintf(stderr, "result[%d] = %d\n", i, result[i]);
     }
 
-    fseek(fp, 0, 0);
+    bu_fseek(fp, 0, 0);
     while ((n = fread(buf, 1, BUFSIZE, fp)) > 0) {
        for (i = 0; i < n; i++) {
            long idx = buf[i];

Modified: brlcad/trunk/src/util/bwrot.c
===================================================================
--- brlcad/trunk/src/util/bwrot.c       2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/util/bwrot.c       2018-11-08 21:11:26 UTC (rev 71996)
@@ -358,7 +358,7 @@
                xout = (nyin - 1) - lasty;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%zd)\n", bu_getprogname(), (void *)ofp, outbyte);
@@ -384,7 +384,7 @@
                xout = yin;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%zd)\n", bu_getprogname(), (void *)ofp, outbyte);
@@ -402,7 +402,7 @@
                yout = (nyin - 1) - y + 1;
                outbyte = yout * scanbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%zd)\n", bu_getprogname(), (void *)ofp, outbyte);

Modified: brlcad/trunk/src/util/bwscale.c
===================================================================
--- brlcad/trunk/src/util/bwscale.c     2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/util/bwscale.c     2018-11-08 21:11:26 UTC (rev 71996)
@@ -87,7 +87,7 @@
     buf_start = y - buflines/2;
     if (buf_start < 0) buf_start = 0;
 
-    if (fseek(buffp, buf_start * scanlen, 0) < 0) {
+    if (bu_fseek(buffp, buf_start * scanlen, 0) < 0) {
        fprintf(stderr, "bwscale: Can't seek to input pixel!\n");
        /* bu_exit (3, NULL); */
     }

Modified: brlcad/trunk/src/util/hex.c
===================================================================
--- brlcad/trunk/src/util/hex.c 2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/util/hex.c 2018-11-08 21:11:26 UTC (rev 71996)
@@ -63,7 +63,7 @@
 
     if (offset != 0) {
        /* skip over "offset" bytes first */
-       if (fseek(fd, offset, 0)) {
+       if (bu_fseek(fd, offset, 0)) {
 
            /* If fseek fails, try reading our way to the desired offset.
             * The fseek will fail if we're reading from a pipe.

Modified: brlcad/trunk/src/util/pixcrop.c
===================================================================
--- brlcad/trunk/src/util/pixcrop.c     2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/util/pixcrop.c     2018-11-08 21:11:26 UTC (rev 71996)
@@ -102,7 +102,7 @@
     buf_start = y - buflines/2;
     if (buf_start < 0) buf_start = 0;
 
-    fseek(ifp, 0, 0);
+    bu_fseek(ifp, 0, 0);
     ret = fread(buffer, scanlen, 3*buflines, ifp);
     if (ret == 0)
        perror("fread");

Modified: brlcad/trunk/src/util/pixrot.c
===================================================================
--- brlcad/trunk/src/util/pixrot.c      2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/util/pixrot.c      2018-11-08 21:11:26 UTC (rev 71996)
@@ -190,7 +190,7 @@
                xout = (nyin - 1) - lasty;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, 0) < 0) {
+                   if (bu_fseek(ofp, outbyte, 0) < 0) {
                        bu_exit(3, "pixrot: Can't seek on output, yet I need 
to!\n");
                    }
                    outplace = outbyte;
@@ -215,7 +215,7 @@
                xout = yin;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, 0) < 0) {
+                   if (bu_fseek(ofp, outbyte, 0) < 0) {
                        bu_exit(3, "pixrot: Can't seek on output, yet I need 
to!\n");
                    }
                    outplace = outbyte;
@@ -232,7 +232,7 @@
                yout = (nyin - 1) - y;
                outbyte = yout * scanbytes;
                if (outplace != outbyte) {
-                   if (fseek(ofp, outbyte, 0) < 0) {
+                   if (bu_fseek(ofp, outbyte, 0) < 0) {
                        bu_exit(3, "pixrot: Can't seek on output, yet I need 
to!\n");
                    }
                    outplace = outbyte;

Modified: brlcad/trunk/src/util/pixscale.c
===================================================================
--- brlcad/trunk/src/util/pixscale.c    2018-11-08 21:02:50 UTC (rev 71995)
+++ brlcad/trunk/src/util/pixscale.c    2018-11-08 21:11:26 UTC (rev 71996)
@@ -90,7 +90,7 @@
     if (buf_start < 0) buf_start = 0;
 
     if (file_pos != buf_start * scanlen) {
-       if (fseek(buffp, buf_start * scanlen, 0) < 0) {
+       if (bu_fseek(buffp, buf_start * scanlen, 0) < 0) {
            bu_exit(3, "pixscale: Can't seek to input pixel! y=%d\n", y);
        }
        file_pos = buf_start * scanlen;

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



_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to