Revision: 75758
          http://sourceforge.net/p/brlcad/code/75758
Author:   starseeker
Date:     2020-05-08 14:24:29 +0000 (Fri, 08 May 2020)
Log Message:
-----------
merging RELEASE branch to STABLE branch, r75561 through r75757

Modified Paths:
--------------
    brlcad/branches/STABLE/ChangeLog
    brlcad/branches/STABLE/NEWS
    brlcad/branches/STABLE/bench/pixcmp.c
    brlcad/branches/STABLE/include/bio.h
    brlcad/branches/STABLE/include/bu/file.h
    brlcad/branches/STABLE/include/bu/glob.h
    brlcad/branches/STABLE/include/bu/ptbl.h
    brlcad/branches/STABLE/include/bu/time.h
    brlcad/branches/STABLE/include/bu/vls.h
    brlcad/branches/STABLE/include/common.h
    brlcad/branches/STABLE/include/config_win.h.in
    brlcad/branches/STABLE/include/rt/db_fullpath.h
    brlcad/branches/STABLE/include/rt/db_instance.h
    brlcad/branches/STABLE/include/rt/db_io.h
    brlcad/branches/STABLE/include/rt/directory.h
    brlcad/branches/STABLE/include/rt/mater.h
    brlcad/branches/STABLE/include/rt/mem.h
    brlcad/branches/STABLE/misc/attributes/gen-attributes-file.cpp
    brlcad/branches/STABLE/regress/CMakeLists.txt
    brlcad/branches/STABLE/src/conv/asc/asc2g.c
    brlcad/branches/STABLE/src/conv/conv-vg2g.c
    brlcad/branches/STABLE/src/conv/dxf/dxf-g.c
    brlcad/branches/STABLE/src/conv/fast4-g.c
    brlcad/branches/STABLE/src/conv/g-acad.c
    brlcad/branches/STABLE/src/conv/g-obj.c
    brlcad/branches/STABLE/src/conv/iges/findp.c
    brlcad/branches/STABLE/src/conv/iges/g-iges.c
    brlcad/branches/STABLE/src/conv/iges/readrec.c
    brlcad/branches/STABLE/src/conv/iges/recsize.c
    brlcad/branches/STABLE/src/conv/intaval/tgf-g.cpp
    brlcad/branches/STABLE/src/conv/k-g.cpp
    brlcad/branches/STABLE/src/conv/nastran-g.c
    brlcad/branches/STABLE/src/conv/raw/raw-g.cpp
    brlcad/branches/STABLE/src/conv/vdeck/vdeck.c
    brlcad/branches/STABLE/src/conv/vdeck/vextern.h
    brlcad/branches/STABLE/src/fb/bw-fb.c
    brlcad/branches/STABLE/src/fb/pix-fb.c
    brlcad/branches/STABLE/src/fb/tests/fbthreadtest.c
    brlcad/branches/STABLE/src/gtools/CMakeLists.txt
    brlcad/branches/STABLE/src/gtools/gdiff/gdiff.c
    brlcad/branches/STABLE/src/libanalyze/nirt.cpp
    brlcad/branches/STABLE/src/libbu/dir.c
    brlcad/branches/STABLE/src/libbu/file.c
    brlcad/branches/STABLE/src/libbu/mappedfile.c
    brlcad/branches/STABLE/src/libbu/vfont.c
    brlcad/branches/STABLE/src/libbu/vfont.h
    brlcad/branches/STABLE/src/libbu/vls.c
    brlcad/branches/STABLE/src/libfb/fb_generic.c
    brlcad/branches/STABLE/src/libfb/if_X24.c
    brlcad/branches/STABLE/src/libfb/if_disk.c
    brlcad/branches/STABLE/src/libgcv/plugins/fastgen4/fastgen4_read.c
    brlcad/branches/STABLE/src/libgcv/plugins/fastgen4/fastgen4_write.cpp
    brlcad/branches/STABLE/src/libgcv/plugins/obj/obj_write.c
    brlcad/branches/STABLE/src/libgcv/plugins/vrml/vrml_read/file_util.cpp
    brlcad/branches/STABLE/src/libged/dup.c
    brlcad/branches/STABLE/src/libged/ged.c
    brlcad/branches/STABLE/src/libged/tables.c
    brlcad/branches/STABLE/src/libicv/rot.c
    brlcad/branches/STABLE/src/liboptical/oslexec_pvt.h
    brlcad/branches/STABLE/src/libpkg/pkg.c
    brlcad/branches/STABLE/src/librt/db5_alloc.c
    brlcad/branches/STABLE/src/librt/db5_scan.c
    brlcad/branches/STABLE/src/librt/db_alloc.c
    brlcad/branches/STABLE/src/librt/db_corrupt.c
    brlcad/branches/STABLE/src/librt/db_fullpath.c
    brlcad/branches/STABLE/src/librt/db_inmem.c
    brlcad/branches/STABLE/src/librt/db_io.c
    brlcad/branches/STABLE/src/librt/db_lookup.c
    brlcad/branches/STABLE/src/librt/db_open.c
    brlcad/branches/STABLE/src/librt/db_scan.c
    brlcad/branches/STABLE/src/librt/librt_private.h
    brlcad/branches/STABLE/src/librt/mater.c
    brlcad/branches/STABLE/src/librt/memalloc.c
    brlcad/branches/STABLE/src/librt/primitives/primitive_util.c
    brlcad/branches/STABLE/src/mged/edsol.c
    brlcad/branches/STABLE/src/mged/wdb_obj.c
    brlcad/branches/STABLE/src/nirt/main.cpp
    brlcad/branches/STABLE/src/other/libregex/regex.h
    brlcad/branches/STABLE/src/other/stepcode/src/clstepcore/complexSupport.h
    brlcad/branches/STABLE/src/rt/do.c
    brlcad/branches/STABLE/src/rt/view.c
    brlcad/branches/STABLE/src/util/ap-pix.c
    brlcad/branches/STABLE/src/util/bwcrop.c
    brlcad/branches/STABLE/src/util/bwhisteq.c
    brlcad/branches/STABLE/src/util/bwrot.c
    brlcad/branches/STABLE/src/util/bwscale.c
    brlcad/branches/STABLE/src/util/pixbustup.c
    brlcad/branches/STABLE/src/util/pixcrop.c
    brlcad/branches/STABLE/src/util/pixrot.c
    brlcad/branches/STABLE/src/util/pixscale.c
    brlcad/branches/STABLE/src/util/plot3rot.c

Added Paths:
-----------
    brlcad/branches/STABLE/regress/gchecker/
    brlcad/branches/STABLE/src/gtools/gchecker.cpp

Property Changed:
----------------
    brlcad/branches/STABLE/
    brlcad/branches/STABLE/NEWS
    brlcad/branches/STABLE/src/libbu/

Index: brlcad/branches/STABLE
===================================================================
--- brlcad/branches/STABLE      2020-05-08 14:22:16 UTC (rev 75757)
+++ brlcad/branches/STABLE      2020-05-08 14:24:29 UTC (rev 75758)

Property changes on: brlcad/branches/STABLE
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
-/brlcad/branches/RELEASE:60491,61063,61075-66129,66135,66164,66169-68615,68617-75561
+/brlcad/branches/RELEASE:60491,61063,61075-66129,66135,66164,66169-68615,68617-75757
 /brlcad/branches/STABLE:66164
 
/brlcad/branches/brep-debug:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69168,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
 /brlcad/branches/bullet:62518
## -7,4 +7,4 ##
 /brlcad/branches/opencl:65867-66137
 /brlcad/branches/osg:62110-62113
 /brlcad/branches/prep-cache:68236-68933
-/brlcad/trunk:36844-37285,37571-38764,38777-38845,41559-43155,43159-43908,44241-44324,44326-44385,44710-45373,45377,45379-47342,47370-66123,66128-66132,66134-68122,68125-74976,74981,74991,75056,75325,75375,75377-75378,75387,75470-75472,75477,75492,75495,75549
\ No newline at end of property
+/brlcad/trunk:36844-37285,37571-38764,38777-38845,41559-43155,43159-43908,44241-44324,44326-44385,44710-45373,45377,45379-47342,47370-66123,66128-66132,66134-68122,68125-74976,74981,74991,75000,75056,75063-75064,75077-75078,75084,75325,75375,75377-75378,75387,75470-75472,75477,75492,75495,75549,75656-75661,75672,75675,75678
\ No newline at end of property
Modified: brlcad/branches/STABLE/ChangeLog
===================================================================
--- brlcad/branches/STABLE/ChangeLog    2020-05-08 14:22:16 UTC (rev 75757)
+++ brlcad/branches/STABLE/ChangeLog    2020-05-08 14:24:29 UTC (rev 75758)
@@ -1,3 +1,120 @@
+2020-05-05 18:39  starseeker
+
+       * [r75697] src/other/libregex/regex.h:
+         libregex doesn't appear to use lseek and it's making VS2019
+         unhappy to redefine it.
+
+2020-05-04 17:35  starseeker
+
+       * [r75687] include/bu/vls.h:
+         don't need stdio.h here
+
+2020-05-04 16:11  starseeker
+
+       * [r75685] misc/attributes/gen-attributes-file.cpp:
+         ditto gen-attributes-file.cpp - needs off_t update
+
+2020-05-04 16:09  starseeker
+
+       * [r75684] src/other/stepcode/src/clstepcore/complexSupport.h:
+         stepcode needs the same off_t bit
+
+2020-05-04 15:52  starseeker
+
+       * [r75682] src/libpkg/pkg.c:
+         Use bio.h here
+
+2020-05-04 15:45  starseeker
+
+       * [r75681] src/other/libregex/regex.h:
+         ws
+
+2020-05-04 15:44  starseeker
+
+       * [r75680] src/other/libregex/regex.h:
+         Update our bundled regex.h to use the same type of off_t
+         definition as bio.h
+
+2020-05-04 15:23  starseeker
+
+       * [r75679] ., include/bu/glob.h, include/bu/vls.h:
+         Cherrypick r75678
+
+2020-05-04 14:08  starseeker
+
+       * [r75677] ., include/bio.h, include/config_win.h.in,
+         src/conv/intaval/tgf-g.cpp, src/conv/k-g.cpp,
+         src/conv/raw/raw-g.cpp, src/libanalyze/nirt.cpp,
+         src/libgcv/plugins/fastgen4/fastgen4_write.cpp,
+         src/libgcv/plugins/vrml/vrml_read/file_util.cpp,
+         src/nirt/main.cpp:
+         Cherrypick r75077, r75078 and r75084 - off_t fixes
+
+2020-05-04 13:34  starseeker
+
+       * [r75676] ., src/gtools/gchecker.cpp:
+         Cherrypick r75675
+
+2020-05-04 13:07  starseeker
+
+       * [r75674] ., bench/pixcmp.c, include/bio.h, include/bu/file.h,
+         include/bu/ptbl.h, include/bu/time.h, include/common.h,
+         include/rt/db_fullpath.h, include/rt/db_instance.h,
+         include/rt/db_io.h, include/rt/directory.h, include/rt/mater.h,
+         include/rt/mem.h, src/conv/asc/asc2g.c, src/conv/conv-vg2g.c,
+         src/conv/dxf/dxf-g.c, src/conv/fast4-g.c, src/conv/g-acad.c,
+         src/conv/g-obj.c, src/conv/iges/findp.c, src/conv/iges/g-iges.c,
+         src/conv/iges/readrec.c, src/conv/iges/recsize.c,
+         src/conv/intaval/tgf-g.cpp, src/conv/k-g.cpp,
+         src/conv/nastran-g.c, src/conv/raw/raw-g.cpp,
+         src/conv/vdeck/vdeck.c, src/conv/vdeck/vextern.h, src/fb/bw-fb.c,
+         src/fb/pix-fb.c, src/fb/tests/fbthreadtest.c,
+         src/gtools/gdiff/gdiff.c, src/libanalyze/nirt.cpp, src/libbu,
+         src/libbu/file.c, src/libbu/mappedfile.c, src/libbu/vfont.c,
+         src/libbu/vfont.h, src/libbu/vls.c, src/libfb/fb_generic.c,
+         src/libfb/if_X24.c, src/libfb/if_disk.c,
+         src/libgcv/plugins/fastgen4/fastgen4_read.c,
+         src/libgcv/plugins/fastgen4/fastgen4_write.cpp,
+         src/libgcv/plugins/obj/obj_write.c,
+         src/libgcv/plugins/vrml/vrml_read/file_util.cpp,
+         src/libged/dup.c, src/libged/ged.c, src/libged/tables.c,
+         src/libicv/rot.c, src/liboptical/oslexec_pvt.h,
+         src/librt/db5_alloc.c, src/librt/db5_scan.c,
+         src/librt/db_alloc.c, src/librt/db_corrupt.c,
+         src/librt/db_fullpath.c, src/librt/db_inmem.c, src/librt/db_io.c,
+         src/librt/db_lookup.c, src/librt/db_open.c, src/librt/db_scan.c,
+         src/librt/librt_private.h, src/librt/mater.c,
+         src/librt/memalloc.c, src/librt/primitives/primitive_util.c,
+         src/mged/edsol.c, src/mged/wdb_obj.c, src/nirt/main.cpp,
+         src/rt/do.c, src/rt/view.c, src/util/ap-pix.c, src/util/bwcrop.c,
+         src/util/bwhisteq.c, src/util/bwrot.c, src/util/bwscale.c,
+         src/util/pixbustup.c, src/util/pixcrop.c, src/util/pixrot.c,
+         src/util/pixscale.c, src/util/plot3rot.c:
+         Cherrypick r75063 - switch to b_off_t for newer MSVC 64 bit
+         offsets.
+
+2020-05-04 12:59  starseeker
+
+       * [r75673] ., regress/gchecker/CMakeLists.txt:
+         Cherrypick r75672 - dependencies for regress-gchecker
+
+2020-05-04 12:52  starseeker
+
+       * [r75671] ., NEWS, regress/CMakeLists.txt, regress/gchecker,
+         src/gtools/CMakeLists.txt, src/gtools/gchecker.cpp:
+         Cherrypick cross-platform generator of overlap outputs from trunk
+
+2020-05-04 12:50  starseeker
+
+       * [r75670] src/libbu, src/libbu/dir.c:
+         Cherrypick r75000 from trunk - bu_dir fix for ext and libext
+
+2020-04-22 20:02  starseeker
+
+       * [r75551] ChangeLog:
+         update changelog
+
+
 2020-04-22 20:01  starseeker
 
        * [r75550] ., src/libged/draw.c, src/libged/vdraw.c,

Modified: brlcad/branches/STABLE/NEWS
===================================================================
--- brlcad/branches/STABLE/NEWS 2020-05-08 14:22:16 UTC (rev 75757)
+++ brlcad/branches/STABLE/NEWS 2020-05-08 14:24:29 UTC (rev 75758)
@@ -10,9 +10,10 @@
 changes made.  See document footer for additional details.
 
 ----------------------------------------------------------------------
---- 2020-04-22  Release 7.30.8                                     ---
+--- 2020-05-08  Release 7.30.8                                     ---
 ----------------------------------------------------------------------
 
+* added gchecker tool to generate MGED overlap inputs - Cliff Yapp
 * improved behavior of MGED overlap checker GUI - Nick Reed
 * fixed startup dimensions of overlap checker window - Nick Reed
 * fixed rtedge line drawing color when using -W flag - Cliff Yapp


Property changes on: brlcad/branches/STABLE/NEWS
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,4 ##
-/brlcad/branches/RELEASE/NEWS:60491,61063,61075-66129,66164,66169-68615,68617-75561
+/brlcad/branches/RELEASE/NEWS:60491,61063,61075-66129,66164,66169-68615,68617-75757
 /brlcad/branches/STABLE/NEWS:66164
 
/brlcad/branches/brep-debug/NEWS:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69168,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
 /brlcad/branches/bullet/NEWS:62518
Modified: brlcad/branches/STABLE/bench/pixcmp.c
===================================================================
--- brlcad/branches/STABLE/bench/pixcmp.c       2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/bench/pixcmp.c       2020-05-08 14:24:29 UTC (rev 
75758)
@@ -214,7 +214,7 @@
     }
 
     /* skip requested pixels/bytes in FILE1 */
-    if (f1_skip && bu_fseek(f1, f1_skip, SEEK_SET)) {
+    if (f1_skip && fseek(f1, f1_skip, SEEK_SET)) {
        bu_log("ERROR: Unable to seek %zd %s%s in FILE1\n",
               f1_skip,
               print_bytes?"byte":"pixel",
@@ -224,7 +224,7 @@
     }
 
     /* skip requested pixels in FILE2 */
-    if (f2_skip && bu_fseek(f2, f2_skip, SEEK_SET)) {
+    if (f2_skip && 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/branches/STABLE/include/bio.h
===================================================================
--- brlcad/branches/STABLE/include/bio.h        2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/bio.h        2020-05-08 14:24:29 UTC (rev 
75758)
@@ -95,6 +95,35 @@
 #   define S_ISDIR(_st_mode) (((_st_mode) & S_IFMT) == S_IFDIR)
 #endif
 
+/* We want 64 bit (large file) I/O capabilities whenever they are available.
+ * Always define this before we include sys/types.h */
+#ifndef _FILE_OFFSET_BITS
+#  define _FILE_OFFSET_BITS 64
+#endif
+#include <sys/types.h>
+
+/* off_t is 32 bit size even on 64 bit Windows. In the past we have tried to
+ * force off_t to be 64 bit but this is failing on newer Windows/Visual Studio
+ * verions in 2020 - therefore, we instead introduce the b_off_t define to
+ * properly substitute the correct numerical type for the correct platform.  */
+#if defined(_WIN64)
+#  include <sys/stat.h>
+#  define b_off_t __int64
+#  define fseek _fseeki64
+#  define ftell _ftelli64
+#  define fstat _fstati64
+#  define lseek _lseeki64
+#  define stat  _stati64
+#elif defined (_WIN32)
+#  include <sys/stat.h>
+#  define b_off_t _off_t
+#  define fstat _fstat
+#  define lseek _lseek
+#  define stat  _stat
+#else
+#  define b_off_t off_t
+#endif
+
 #endif /* BIO_H */
 
 /** @} */

Modified: brlcad/branches/STABLE/include/bu/file.h
===================================================================
--- brlcad/branches/STABLE/include/bu/file.h    2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/bu/file.h    2020-05-08 14:24:29 UTC (rev 
75758)
@@ -24,7 +24,6 @@
 #include "common.h"
 
 #include <stdio.h> /* for FILE */
-#include <sys/types.h> /* for off_t */
 #include <stddef.h> /* for size_t */
 #include <stdlib.h> /* for getenv */
 
@@ -165,23 +164,6 @@
  */
 BU_EXPORT extern char *bu_file_realpath(const char *path, char *resolved_path);
 
-
-/**
- * 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 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);
-
 /** @} */
 
 __END_DECLS

Modified: brlcad/branches/STABLE/include/bu/glob.h
===================================================================
--- brlcad/branches/STABLE/include/bu/glob.h    2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/bu/glob.h    2020-05-08 14:24:29 UTC (rev 
75758)
@@ -23,7 +23,7 @@
 
 #include "common.h"
 
-#include <sys/types.h> /* for off_t */
+#include "bio.h" /* for b_off_t */
 
 #include "bu/defines.h"
 #include "bu/vls.h"
@@ -58,7 +58,7 @@
  */
 struct bu_stat {
     struct bu_vls name;
-    off_t size;
+    b_off_t size;
     void *data;
 };
 

Modified: brlcad/branches/STABLE/include/bu/ptbl.h
===================================================================
--- brlcad/branches/STABLE/include/bu/ptbl.h    2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/bu/ptbl.h    2020-05-08 14:24:29 UTC (rev 
75758)
@@ -24,7 +24,7 @@
 #include "common.h"
 
 #include <stddef.h> /* for size_t */
-#include <sys/types.h> /* for off_t */
+#include "bio.h" /* for b_off_t */
 
 #include "bu/defines.h"
 #include "bu/magic.h"

Modified: brlcad/branches/STABLE/include/bu/time.h
===================================================================
--- brlcad/branches/STABLE/include/bu/time.h    2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/bu/time.h    2020-05-08 14:24:29 UTC (rev 
75758)
@@ -23,10 +23,9 @@
 
 #include "common.h"
 
-#include <stdio.h> /* For FILE */
-#include <sys/types.h> /* for off_t */
 #include <stddef.h> /* for size_t */
 #include <stdlib.h> /* for getenv */
+#include "bio.h" /* for b_off_t */
 
 #include "bu/defines.h"
 #include "bu/vls.h"

Modified: brlcad/branches/STABLE/include/bu/vls.h
===================================================================
--- brlcad/branches/STABLE/include/bu/vls.h     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/bu/vls.h     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -22,11 +22,11 @@
 #define BU_VLS_H
 
 #include "common.h"
-#include <stdio.h> /* For FILE */
-#include <sys/types.h> /* for off_t */
 #include <stddef.h> /* for size_t */
 #include <stdarg.h> /* For va_list */
 
+#include "bio.h" /* for FILE and off_t */
+
 #include "bu/defines.h"
 #include "bu/magic.h"
 
@@ -166,7 +166,7 @@
  * un-nibbled.
  */
 BU_EXPORT extern void bu_vls_nibble(struct bu_vls *vp,
-                                   off_t len);
+                                   b_off_t len);
 
 /**
  * Releases the memory used for the string buffer.

Modified: brlcad/branches/STABLE/include/common.h
===================================================================
--- brlcad/branches/STABLE/include/common.h     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/common.h     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -150,22 +150,6 @@
 #  define FMIN(a, b)   (((a)<(b))?(a):(b))
 #endif
 
-/* If we've got the wrong off_t size, do something about it (*before*
-   we include sys/types.h, which can hold the incorrect definition.)
-   Also set any other related defines that might be needed. */
-#if defined(OFF_T_SIZE_MISMATCH)
-/*#  pragma message("Fixing off_t definition")*/
-#  ifdef off_t
-#    undef off_t
-#  endif
-typedef ptrdiff_t off_t;
-#  ifdef _off_t
-#    undef _off_t
-#  endif
-typedef ptrdiff_t _off_t;
-#  define _OFF_T_DEFINED
-#endif
-
 /* make sure the old bsd types are defined for portability */
 #if !defined(HAVE_U_TYPES)
 typedef unsigned char u_char;

Modified: brlcad/branches/STABLE/include/config_win.h.in
===================================================================
--- brlcad/branches/STABLE/include/config_win.h.in      2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/include/config_win.h.in      2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -202,29 +202,6 @@
 #  define strtoll _strtoi64
 #endif
 
-/* set up stat */
-#if defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8
-#   define stat _stati64
-#else
-#   define stat _stat
-#endif
-
-/* set up fstat */
-#if defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8
-#   define fstat _fstati64
-#else
-#   define fstat _fstat
-#endif
-
-/* set up lseek */
-#ifndef HAVE_LSEEK
-#  if defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8
-#    define lseek _lseeki64
-#  else
-#    define lseek _lseek
-#  endif
-#endif
-
 #cmakedefine fmax __max
 #define ioctl ioctlsocket
 

Modified: brlcad/branches/STABLE/include/rt/db_fullpath.h
===================================================================
--- brlcad/branches/STABLE/include/rt/db_fullpath.h     2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/include/rt/db_fullpath.h     2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -22,6 +22,7 @@
 #define RT_DB_FULLPATH_H
 
 #include "common.h"
+#include "bio.h" /* for b_off_t */
 #include "bu/vls.h"
 #include "rt/defines.h"
 
@@ -93,7 +94,7 @@
  */
 RT_EXPORT extern void db_dup_path_tail(struct db_full_path *newp,
                                       const struct db_full_path *oldp,
-                                      off_t start);
+                                      b_off_t start);
 
 
 /**

Modified: brlcad/branches/STABLE/include/rt/db_instance.h
===================================================================
--- brlcad/branches/STABLE/include/rt/db_instance.h     2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/include/rt/db_instance.h     2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -25,6 +25,7 @@
 #define RT_DB_INSTANCE_H
 
 #include "common.h"
+#include "bio.h" /* for b_off_t */
 
 /* interface headers */
 #include "bu/magic.h"
@@ -76,7 +77,7 @@
 
     struct directory * dbi_Head[RT_DBNHASH]; /** @brief PRIVATE: object hash 
table */
     FILE * dbi_fp;                      /**< @brief PRIVATE: standard file 
pointer */
-    off_t dbi_eof;                      /**< @brief PRIVATE: End+1 pos after 
db_scan() */
+    b_off_t dbi_eof;                      /**< @brief PRIVATE: End+1 pos after 
db_scan() */
     size_t dbi_nrec;                    /**< @brief PRIVATE: # records after 
db_scan() */
     int dbi_uses;                       /**< @brief PRIVATE: # of uses of this 
struct */
     struct mem_map * dbi_freep;         /**< @brief PRIVATE: map of free 
granules */

Modified: brlcad/branches/STABLE/include/rt/db_io.h
===================================================================
--- brlcad/branches/STABLE/include/rt/db_io.h   2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/rt/db_io.h   2020-05-08 14:24:29 UTC (rev 
75758)
@@ -33,7 +33,7 @@
 #include "rt/defines.h"
 
 /* system headers */
-#include "bio.h" /* for FILE */
+#include "bio.h" /* for FILE, b_off_t */
 
 __BEGIN_DECLS
 
@@ -432,7 +432,7 @@
 RT_EXPORT extern int db_write(struct db_i      *dbip,
                              const void *      addr,
                              size_t            count,
-                             off_t             offset);
+                             b_off_t           offset);
 
 /**
  * Add name from dp->d_namep to external representation of solid, and
@@ -486,7 +486,7 @@
 RT_EXPORT extern int db_get(const struct db_i *,
                            const struct directory *dp,
                            union record *where,
-                           off_t offset,
+                           b_off_t offset,
                            size_t len);
 /* put several records into db */
 
@@ -501,7 +501,7 @@
 RT_EXPORT extern int db_put(struct db_i *,
                            const struct directory *dp,
                            union record *where,
-                           off_t offset, size_t len);
+                           b_off_t offset, size_t len);
 
 /**
  * Obtains a object from the database, leaving it in external
@@ -548,7 +548,7 @@
 RT_EXPORT extern int db_scan(struct db_i *,
                             int (*handler)(struct db_i *,
                                            const char *name,
-                                           off_t addr,
+                                           b_off_t addr,
                                            size_t nrec,
                                            int flags,
                                            void *client_data),
@@ -641,7 +641,7 @@
 RT_EXPORT extern int db_dirbuild(struct db_i *dbip);
 RT_EXPORT extern struct directory *db5_diradd(struct db_i *dbip,
                                              const struct db5_raw_internal 
*rip,
-                                             off_t laddr,
+                                             b_off_t laddr,
                                              void *client_data);
 
 /**
@@ -654,7 +654,7 @@
 RT_EXPORT extern int db5_scan(struct db_i *dbip,
                              void (*handler)(struct db_i *,
                                              const struct db5_raw_internal *,
-                                             off_t addr,
+                                             b_off_t addr,
                                              void *client_data),
                              void *client_data);
 
@@ -805,13 +805,13 @@
  */
 RT_EXPORT extern struct directory *db_diradd(struct db_i *,
                                             const char *name,
-                                            off_t laddr,
+                                            b_off_t laddr,
                                             size_t len,
                                             int flags,
                                             void *ptr);
 RT_EXPORT extern struct directory *db_diradd5(struct db_i *dbip,
                                              const char *name,
-                                             off_t                             
laddr,
+                                             b_off_t                           
laddr,
                                              unsigned char                     
major_type,
                                              unsigned char                     
minor_type,
                                              unsigned char                     
name_hidden,

Modified: brlcad/branches/STABLE/include/rt/directory.h
===================================================================
--- brlcad/branches/STABLE/include/rt/directory.h       2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/include/rt/directory.h       2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -25,6 +25,7 @@
 #define RT_DIRECTORY_H
 
 #include "common.h"
+#include "bio.h" /* for b_off_T */
 #include "vmath.h"
 #include "bu/list.h"
 #include "rt/anim.h"
@@ -35,7 +36,7 @@
  * One of these structures is allocated in memory to represent each
  * named object in the database.
  *
- * Note that a d_addr of RT_DIR_PHONY_ADDR ((off_t)-1) means that
+ * Note that a d_addr of RT_DIR_PHONY_ADDR ((b_off_t)-1) means that
  * database storage has not been allocated yet.
  *
  * Note that there is special handling for RT_DIR_INMEM "in memory"
@@ -60,7 +61,7 @@
     uint32_t d_magic;   /**< @brief Magic number */
     char * d_namep;             /**< @brief pointer to name string */
     union {
-       off_t file_offset;      /**< @brief disk address in obj file */
+       b_off_t file_offset;      /**< @brief disk address in obj file */
        void *ptr;              /**< @brief ptr to in-memory-only obj */
     } d_un;
     struct directory * d_forw;  /**< @brief link to next dir entry */
@@ -79,7 +80,7 @@
 #define RT_CK_DIR(_dp) BU_CKMAG(_dp, RT_DIR_MAGIC, "(librt)directory")
 
 #define d_addr  d_un.file_offset
-#define RT_DIR_PHONY_ADDR       ((off_t)-1)     /**< @brief Special marker for 
d_addr field */
+#define RT_DIR_PHONY_ADDR       ((b_off_t)-1)     /**< @brief Special marker 
for d_addr field */
 
 /* flags for db_diradd() and friends */
 #define RT_DIR_SOLID    0x1   /**< @brief this name is a solid */

Modified: brlcad/branches/STABLE/include/rt/mater.h
===================================================================
--- brlcad/branches/STABLE/include/rt/mater.h   2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/rt/mater.h   2020-05-08 14:24:29 UTC (rev 
75758)
@@ -25,6 +25,7 @@
 #define RT_MATER_H
 
 #include "common.h"
+#include "bio.h" /* for b_off_t */
 #include "rt/defines.h"
 #include "bu/vls.h"
 
@@ -53,11 +54,11 @@
     unsigned char      mt_r;           /**< @brief color */
     unsigned char      mt_g;
     unsigned char      mt_b;
-    off_t              mt_daddr;       /**< @brief db address, for updating */
+    b_off_t            mt_daddr;       /**< @brief db address, for updating */
     struct mater       *mt_forw;       /**< @brief next in chain */
 };
 #define MATER_NULL     ((struct mater *)0)
-#define MATER_NO_ADDR  ((off_t)0)              /**< @brief invalid mt_daddr */
+#define MATER_NO_ADDR  ((b_off_t)0)            /**< @brief invalid mt_daddr */
 
 
 RT_EXPORT extern void rt_region_color_map(struct region *regp);
@@ -68,7 +69,7 @@
                                      int r,
                                      int g,
                                      int b,
-                                     off_t addr);
+                                     b_off_t addr);
 RT_EXPORT extern void rt_insert_color(struct mater *newp);
 RT_EXPORT extern void rt_vls_color_map(struct bu_vls *str);
 RT_EXPORT extern struct mater *rt_material_head(void);

Modified: brlcad/branches/STABLE/include/rt/mem.h
===================================================================
--- brlcad/branches/STABLE/include/rt/mem.h     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/include/rt/mem.h     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -25,6 +25,7 @@
 #define RT_MEM_H
 
 #include "common.h"
+#include "bio.h" /* for b_off_t */
 #include "vmath.h"
 #include "rt/defines.h"
 
@@ -37,7 +38,7 @@
 struct mem_map {
     struct mem_map *m_nxtp;     /**< @brief Linking pointer to next element */
     size_t m_size;              /**< @brief Size of this free element */
-    off_t m_addr;               /**< @brief Address of start of this element */
+    b_off_t m_addr;               /**< @brief Address of start of this element 
*/
 };
 #define MAP_NULL        ((struct mem_map *) 0)
 
@@ -80,7 +81,7 @@
  */
 RT_EXPORT extern void rt_memfree(struct mem_map **pp,
                                 size_t size,
-                                off_t addr);
+                                b_off_t addr);
 
 /**
  * Take everything on the current memory chain, and place it on the

Modified: brlcad/branches/STABLE/misc/attributes/gen-attributes-file.cpp
===================================================================
--- brlcad/branches/STABLE/misc/attributes/gen-attributes-file.cpp      
2020-05-08 14:22:16 UTC (rev 75757)
+++ brlcad/branches/STABLE/misc/attributes/gen-attributes-file.cpp      
2020-05-08 14:24:29 UTC (rev 75758)
@@ -14,8 +14,9 @@
 
 /* needed on mac in c90 mode */
 #ifndef HAVE_DECL_FSEEKO
-extern "C" int fseeko(FILE *, off_t, int);
-extern "C" off_t ftello(FILE *);
+#include "bio.h"
+extern "C" int fseeko(FILE *, b_off_t, int);
+extern "C" b_off_t ftello(FILE *);
 #endif
 #include <fstream>
 

Modified: brlcad/branches/STABLE/regress/CMakeLists.txt
===================================================================
--- brlcad/branches/STABLE/regress/CMakeLists.txt       2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/regress/CMakeLists.txt       2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -52,6 +52,9 @@
 # MGED command tests
 add_subdirectory(mged)
 
+# gchecker tests
+add_subdirectory(gchecker)
+
 if(SH_EXEC)
   macro(Sh_Regression_Test testname depends_list)
     CMAKE_PARSE_ARGUMENTS(${testname} "EXCLUDE_FROM_REGRESS" "" "" ${ARGN})

Modified: brlcad/branches/STABLE/src/conv/asc/asc2g.c
===================================================================
--- brlcad/branches/STABLE/src/conv/asc/asc2g.c 2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/conv/asc/asc2g.c 2020-05-08 14:24:29 UTC (rev 
75758)
@@ -1038,7 +1038,7 @@
 {
     char *cp;
     char *name;
-    off_t startpos;
+    b_off_t startpos;
     size_t nlines;
     struct rt_pg_internal *pg;
     struct rt_db_internal intern;
@@ -1049,7 +1049,7 @@
     name = bu_strdup(cp);
 
     /* Count up the number of poly data lines which follow */
-    startpos = bu_ftell(ifp);
+    startpos = ftell(ifp);
     for (nlines = 0;; nlines++) {
        if (bu_fgets(buf, BUFSIZE, ifp) == NULL) break;
        if (buf[0] != ID_P_DATA) break; /* 'Q' */
@@ -1065,7 +1065,7 @@
     pg->max_npts = 0;
 
     /* Return to first 'Q' record */
-    bu_fseek(ifp, startpos, 0);
+    fseek(ifp, startpos, 0);
 
     for (nlines = 0; nlines < pg->npoly; nlines++) {
        struct rt_pg_face_internal *fp = &pg->poly[nlines];

Modified: brlcad/branches/STABLE/src/conv/conv-vg2g.c
===================================================================
--- brlcad/branches/STABLE/src/conv/conv-vg2g.c 2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/conv/conv-vg2g.c 2020-05-08 14:24:29 UTC (rev 
75758)
@@ -206,7 +206,7 @@
            case ID_ARS_A:
                if (rec.a.a_name[0] == '\0') {
                    /* Skip deleted junk */
-                   lseek(ifd, (off_t)(rec.a.a_totlen * sizeof(rec)), 1);
+                   lseek(ifd, (b_off_t)(rec.a.a_totlen * sizeof(rec)), 1);
                    goto top;
                }
                rec.a.a_xmin *= factor;

Modified: brlcad/branches/STABLE/src/conv/dxf/dxf-g.c
===================================================================
--- brlcad/branches/STABLE/src/conv/dxf/dxf-g.c 2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/conv/dxf/dxf-g.c 2020-05-08 14:24:29 UTC (rev 
75758)
@@ -62,7 +62,7 @@
 struct state_data {
     struct bu_list l;
     struct block_list *curr_block;
-    off_t file_offset;
+    b_off_t file_offset;
     int state;
     int sub_state;
     mat_t xform;
@@ -107,7 +107,7 @@
 struct block_list {
     struct bu_list l;
     char *block_name;
-    off_t offset;
+    b_off_t offset;
     char handle[17];
     point_t base;
 };
@@ -629,7 +629,7 @@
            } else if (!bu_strncmp(line, "BLOCK", 5)) {
                /* start of a new block */
                BU_ALLOC(curr_block, struct block_list);
-               curr_block->offset = bu_ftell(dxf);
+               curr_block->offset = ftell(dxf);
                BU_LIST_INSERT(&(block_head), &(curr_block->l));
                break;
            }
@@ -1109,7 +1109,7 @@
                    break;
                }
                bu_free((char *)tmp_state, "curr_state");
-               bu_fseek(dxf, curr_state->file_offset, SEEK_SET);
+               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 
%jd)\n", (intmax_t)curr_state->file_offset);
@@ -1223,7 +1223,7 @@
                BU_LIST_PUSH(&state_stack, &(curr_state->l));
                curr_state = new_state;
                new_state = NULL;
-               bu_fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
+               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;
-                   bu_fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
+                   fseek(dxf, curr_state->curr_block->offset, SEEK_SET);
                    curr_state->state = ENTITIES_SECTION;
                    curr_state->sub_state = UNKNOWN_ENTITY_STATE;
                    if (verbose) {
@@ -3083,7 +3083,7 @@
     size_t line_len;
     static int line_num = 0;
 
-    curr_state->file_offset = bu_ftell(dxf);
+    curr_state->file_offset = ftell(dxf);
 
     if (bu_fgets(line, MAX_LINE_SIZE, dxf) == NULL) {
        return ERROR_FLAG;

Modified: brlcad/branches/STABLE/src/conv/fast4-g.c
===================================================================
--- brlcad/branches/STABLE/src/conv/fast4-g.c   2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/conv/fast4-g.c   2020-05-08 14:24:29 UTC (rev 
75758)
@@ -2062,10 +2062,10 @@
 static void
 skip_section(void)
 {
-    off_t section_start;
+    b_off_t section_start;
 
     /* skip to start of next section */
-    section_start = bu_ftell(fpin);
+    section_start = ftell(fpin);
     if (section_start < 0) {
        bu_exit(1, "Error: couldn't get input file's current file position.\n");
     }
@@ -2076,7 +2076,7 @@
               bu_strncmp(line, "WALL", 4) &&
               bu_strncmp(line, "VEHICLE", 7))
        {
-           section_start = bu_ftell(fpin);
+           section_start = ftell(fpin);
            if (section_start < 0) {
                bu_exit(1, "Error: couldn't get input file's current file 
position.\n");
            }
@@ -2085,7 +2085,7 @@
        }
     }
     /* seek to start of the section */
-    bu_fseek(fpin, section_start, SEEK_SET);
+    fseek(fpin, section_start, SEEK_SET);
 }
 
 

Modified: brlcad/branches/STABLE/src/conv/g-acad.c
===================================================================
--- brlcad/branches/STABLE/src/conv/g-acad.c    2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/conv/g-acad.c    2020-05-08 14:24:29 UTC (rev 
75758)
@@ -649,7 +649,7 @@
     /* Write out number of facet entities to .facet file */
 
     rewind(fp);
-    bu_fseek(fp, 46, 0); /* Re-position pointer to 2nd line */
+    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/branches/STABLE/src/conv/g-obj.c
===================================================================
--- brlcad/branches/STABLE/src/conv/g-obj.c     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/conv/g-obj.c     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -59,8 +59,8 @@
 }
 
 
-static off_t vert_offset=0;
-static off_t norm_offset=0;
+static b_off_t vert_offset=0;
+static b_off_t norm_offset=0;
 static int do_normals=0;
 static int NMG_debug;  /* saved arg of -X, for longjmp handling */
 static int verbose=0;

Modified: brlcad/branches/STABLE/src/conv/iges/findp.c
===================================================================
--- brlcad/branches/STABLE/src/conv/iges/findp.c        2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/conv/iges/findp.c        2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -36,7 +36,7 @@
 {
     int saverec, rec2;
     size_t i;
-    off_t offset;
+    b_off_t offset;
     char str[8];
 
     str[7] = '\0';
@@ -44,13 +44,13 @@
 
     saverec = currec;  /* save current record number */
 
-    if (bu_fseek(fd, 0, 2)) {
+    if (fseek(fd, 0, 2)) {
        /* go to end of file */
        bu_log("Cannot seek to end of file\n");
        perror("Findp");
        bu_exit(1, NULL);
     }
-    offset = bu_ftell(fd);     /* get file length */
+    offset = ftell(fd);        /* get file length */
     rec2 = offset/reclen;      /* calculate record number for last record */
     Readrec(rec2);     /* read last record into "card" buffer */
     dstart = 0;

Modified: brlcad/branches/STABLE/src/conv/iges/g-iges.c
===================================================================
--- brlcad/branches/STABLE/src/conv/iges/g-iges.c       2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/conv/iges/g-iges.c       2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -402,7 +402,7 @@
 
     if (!multi_file) {
        /* Copy the parameter section from the temporary file to the output 
file */
-       if ((bu_fseek(fp_param, 0, 0))) {
+       if ((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 ((bu_fseek(fp_param, 0, 0))) {
+           if ((fseek(fp_param, 0, 0))) {
                perror("g-iges");
                bu_exit(1, "Cannot seek to start of temporary file\n");
            }

Modified: brlcad/branches/STABLE/src/conv/iges/readrec.c
===================================================================
--- brlcad/branches/STABLE/src/conv/iges/readrec.c      2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/conv/iges/readrec.c      2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -40,11 +40,11 @@
 {
 
     int i, ch;
-    off_t offset;
+    b_off_t offset;
 
     currec = recno;
     offset = (recno - 1) * reclen;
-    if (bu_fseek(fd, offset, 0)) {
+    if (fseek(fd, offset, 0)) {
        bu_log("Error in seek\n");
        perror("Readrec");
        bu_exit(1, NULL);

Modified: brlcad/branches/STABLE/src/conv/iges/recsize.c
===================================================================
--- brlcad/branches/STABLE/src/conv/iges/recsize.c      2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/conv/iges/recsize.c      2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -68,7 +68,7 @@
     if (k == (-1))     /* We didn't encounter an early EOF */
        k = NRECS;
 
-    if (bu_fseek(fd, 0, 0)) {
+    if (fseek(fd, 0, 0)) {
        /* rewind file */
        bu_log("Cannot rewind file\n");
        perror("Recsize");

Modified: brlcad/branches/STABLE/src/conv/intaval/tgf-g.cpp
===================================================================
--- brlcad/branches/STABLE/src/conv/intaval/tgf-g.cpp   2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/conv/intaval/tgf-g.cpp   2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -34,9 +34,9 @@
 #include <iostream>
 
 #ifndef HAVE_DECL_FSEEKO
-#include <sys/types.h> /* for off_t */
-extern "C" int fseeko(FILE *, off_t, int);
-extern "C" off_t ftello(FILE *);
+#include "bio.h" /* for b_off_t */
+extern "C" int fseeko(FILE *, b_off_t, int);
+extern "C" b_off_t ftello(FILE *);
 #endif
 #include <fstream>
 

Modified: brlcad/branches/STABLE/src/conv/k-g.cpp
===================================================================
--- brlcad/branches/STABLE/src/conv/k-g.cpp     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/conv/k-g.cpp     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -30,8 +30,9 @@
 #include <algorithm>
 
 #ifndef HAVE_DECL_FSEEKO
-extern "C" int fseeko(FILE *, off_t, int);
-extern "C" off_t ftello(FILE *);
+#include "bio.h" /* for b_off_t */
+extern "C" int fseeko(FILE *, b_off_t, int);
+extern "C" b_off_t ftello(FILE *);
 #endif
 #include <fstream>
 

Modified: brlcad/branches/STABLE/src/conv/nastran-g.c
===================================================================
--- brlcad/branches/STABLE/src/conv/nastran-g.c 2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/conv/nastran-g.c 2020-05-08 14:24:29 UTC (rev 
75758)
@@ -108,7 +108,7 @@
 static FILE *fpin;                     /* NASTRAN input file */
 static FILE *fptmp;                    /* temporary version of NASTRAN input */
 static char *usage = "[-xX lvl] [-t tol.dist] [-n] [-m] [-i NASTRAN_file] -o 
BRL-CAD_file\n";
-static off_t start_off;
+static b_off_t start_off;
 static char *delims=", \t";
 static struct coord_sys coord_head;    /* head of linked list of coordinate 
systems */
 static struct pbar pbar_head;          /* head of linked list of PBAR's */
@@ -161,7 +161,7 @@
     for (i=0; i < 20; i++)
        prev_rec[i][0] = '\0';
 
-    bu_fseek(fpin, start_off, SEEK_SET);
+    fseek(fpin, start_off, SEEK_SET);
     line_count = bulk_data_start_line;
 
     tmp = bu_fgets(next_line, MAX_LINE_SIZE, fpin);
@@ -1193,7 +1193,7 @@
        if (bu_strncmp(line, "BEGIN BULK", 10))
            continue;
 
-       start_off = bu_ftell(fpin);
+       start_off = ftell(fpin);
        break;
     }
 
@@ -1219,7 +1219,7 @@
     nmg_model = (struct model *)NULL;
 
     /* count grid points */
-    bu_fseek(fptmp, 0, SEEK_SET);
+    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 */
-    bu_fseek(fptmp, 0, SEEK_SET);
+    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 */
-    bu_fseek(fptmp, 0, SEEK_SET);
+    fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        int gid;
        int cid;
@@ -1287,7 +1287,7 @@
 
 
     /* find coordinate systems */
-    bu_fseek(fptmp, 0, SEEK_SET);
+    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 */
-    bu_fseek(fptmp, 0, SEEK_SET);
+    fseek(fptmp, 0, SEEK_SET);
     while (get_next_record(fptmp, 1, 0)) {
        if (!bu_strncmp(curr_rec[0], "CBAR", 4))
            get_cbar();

Modified: brlcad/branches/STABLE/src/conv/raw/raw-g.cpp
===================================================================
--- brlcad/branches/STABLE/src/conv/raw/raw-g.cpp       2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/conv/raw/raw-g.cpp       2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -33,8 +33,9 @@
 #include <iostream>
 
 #ifndef HAVE_DECL_FSEEKO
-extern "C" int fseeko(FILE *, off_t, int);
-extern "C" off_t ftello(FILE *);
+#include "bio.h" /* for b_off_t */
+extern "C" int fseeko(FILE *, b_off_t, int);
+extern "C" b_off_t ftello(FILE *);
 #endif
 #include <fstream>
 

Modified: brlcad/branches/STABLE/src/conv/vdeck/vdeck.c
===================================================================
--- brlcad/branches/STABLE/src/conv/vdeck/vdeck.c       2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/conv/vdeck/vdeck.c       2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -144,7 +144,7 @@
 /* Miscellaneous globals leftover from Keith's KARDS code.             */
 int            delsol = 0, delreg = 0;
 char           buff[30];
-off_t          savsol;         /* File position of # of solids & regions       
*/
+b_off_t                savsol;         /* File position of # of solids & 
regions       */
 
 /* Structures.                                                         */
 mat_t          identity;
@@ -1218,7 +1218,7 @@
     ewrite(solfp, LF, 1);
 
     /* Save space for number of solids and regions.                    */
-    savsol = bu_ftell(solfp);
+    savsol = ftell(solfp);
     if (savsol < 0) {
        perror("ftell");
     }
@@ -1272,7 +1272,7 @@
 
     /* Go back, and add number of solids and regions on second card. */
     if (savsol >= 0)
-       bu_fseek(solfp, savsol, 0);
+       fseek(solfp, savsol, 0);
 
     vdeck_itoa(nns, buff, 5);
     ewrite(solfp, buff, 5);

Modified: brlcad/branches/STABLE/src/conv/vdeck/vextern.h
===================================================================
--- brlcad/branches/STABLE/src/conv/vdeck/vextern.h     2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/conv/vdeck/vextern.h     2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -80,7 +80,7 @@
 
 extern int                     delsol, delreg;
 extern char                    buff[];
-extern off_t                   savsol;
+extern b_off_t                 savsol;
 
 extern jmp_buf         env;
 #define EPSILON                0.0001

Modified: brlcad/branches/STABLE/src/fb/bw-fb.c
===================================================================
--- brlcad/branches/STABLE/src/fb/bw-fb.c       2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/fb/bw-fb.c       2020-05-08 14:24:29 UTC (rev 
75758)
@@ -46,7 +46,7 @@
 #include "fb.h"
 
 
-int skipbytes(int fd, off_t num);
+int skipbytes(int fd, b_off_t num);
 
 #define MAX_LINE (16*1024)     /* Largest output scan line length */
 
@@ -334,7 +334,7 @@
  * Throw bytes away.  Use reads into ibuf buffer if a pipe, else seek.
  */
 int
-skipbytes(int fd, off_t num)
+skipbytes(int fd, b_off_t num)
 {
     int n, tries;
 

Modified: brlcad/branches/STABLE/src/fb/pix-fb.c
===================================================================
--- brlcad/branches/STABLE/src/fb/pix-fb.c      2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/fb/pix-fb.c      2020-05-08 14:24:29 UTC (rev 
75758)
@@ -186,7 +186,7 @@
  * Throw bytes away.  Use reads into scanline buffer if a pipe, else seek.
  */
 int
-skipbytes(int fd, off_t num)
+skipbytes(int fd, b_off_t num)
 {
     int n, tries;
 
@@ -309,7 +309,7 @@
        }
     }
 
-    if (file_yoff != 0) skipbytes(infd, 
(off_t)file_yoff*(off_t)file_width*sizeof(RGBpixel));
+    if (file_yoff != 0) skipbytes(infd, 
(b_off_t)file_yoff*(b_off_t)file_width*sizeof(RGBpixel));
 
     if (multiple_lines) {
        /* Bottom to top with multi-line reads & writes */
@@ -340,11 +340,11 @@
        /* Normal way -- bottom to top */
        for (y = scr_yoff; y < scr_yoff + yout; y++) {
            if (y < 0 || y > scr_height) {
-               skipbytes(infd, (off_t)file_width*sizeof(RGBpixel));
+               skipbytes(infd, (b_off_t)file_width*sizeof(RGBpixel));
                continue;
            }
            if (file_xoff+xskip != 0)
-               skipbytes(infd, (off_t)(file_xoff+xskip)*sizeof(RGBpixel));
+               skipbytes(infd, (b_off_t)(file_xoff+xskip)*sizeof(RGBpixel));
            n = bu_mread(infd, (char *)scanline, scanbytes);
            if (n <= 0) break;
            m = fb_write(fbp, xstart, y, scanline, xout);
@@ -356,17 +356,17 @@
            }
            /* slop at the end of the line? */
            if ((size_t)file_xoff+xskip+scanpix < file_width)
-               skipbytes(infd, 
(off_t)(file_width-file_xoff-xskip-scanpix)*sizeof(RGBpixel));
+               skipbytes(infd, 
(b_off_t)(file_width-file_xoff-xskip-scanpix)*sizeof(RGBpixel));
        }
     } else {
        /* Inverse -- top to bottom */
        for (y = scr_height-1-scr_yoff; y >= scr_height-scr_yoff-yout; y--) {
            if (y < 0 || y >= scr_height) {
-               skipbytes(infd, (off_t)file_width*sizeof(RGBpixel));
+               skipbytes(infd, (b_off_t)file_width*sizeof(RGBpixel));
                continue;
            }
            if (file_xoff+xskip != 0)
-               skipbytes(infd, (off_t)(file_xoff+xskip)*sizeof(RGBpixel));
+               skipbytes(infd, (b_off_t)(file_xoff+xskip)*sizeof(RGBpixel));
            n = bu_mread(infd, (char *)scanline, scanbytes);
            if (n <= 0) break;
            m = fb_write(fbp, xstart, y, scanline, xout);
@@ -378,7 +378,7 @@
            }
            /* slop at the end of the line? */
            if ((size_t)file_xoff+xskip+scanpix < file_width)
-               skipbytes(infd, 
(off_t)(file_width-file_xoff-xskip-scanpix)*sizeof(RGBpixel));
+               skipbytes(infd, 
(b_off_t)(file_width-file_xoff-xskip-scanpix)*sizeof(RGBpixel));
        }
     }
     bu_snooze(BU_SEC2USEC(pause_sec));

Modified: brlcad/branches/STABLE/src/fb/tests/fbthreadtest.c
===================================================================
--- brlcad/branches/STABLE/src/fb/tests/fbthreadtest.c  2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/fb/tests/fbthreadtest.c  2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -93,7 +93,7 @@
 }
 
 
-int skipbytes(int fd, off_t num);
+int skipbytes(int fd, b_off_t num);
 
 static unsigned char *scanline;                /* 1 scanline pixel buffer */
 static int scanbytes;          /* # of bytes of scanline */

Modified: brlcad/branches/STABLE/src/gtools/CMakeLists.txt
===================================================================
--- brlcad/branches/STABLE/src/gtools/CMakeLists.txt    2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/gtools/CMakeLists.txt    2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -16,6 +16,7 @@
 BRLCAD_ADDEXEC(gex "gex.cpp" "libbu;librt")
 BRLCAD_ADDEXEC(glint glint.cpp "librt;${M_LIBRARY}")
 BRLCAD_ADDEXEC(gqa gqa.c "libged;librt")
+BRLCAD_ADDEXEC(gchecker gchecker.cpp "libged;librt;libbu")
 
 set(GSH_SRCS
   gsh.cpp

Copied: brlcad/branches/STABLE/src/gtools/gchecker.cpp (from rev 75757, 
brlcad/branches/RELEASE/src/gtools/gchecker.cpp)
===================================================================
--- brlcad/branches/STABLE/src/gtools/gchecker.cpp                              
(rev 0)
+++ brlcad/branches/STABLE/src/gtools/gchecker.cpp      2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -0,0 +1,398 @@
+/*                    G C H E C K E R . C P P
+ * BRL-CAD
+ *
+ * Copyright (c) 2020 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+/** @file gchecker.cpp
+ *
+ * C++ version of the check.tcl logic generating overlap files used
+ * by the MGED Overlap Tool
+ *
+ */
+
+#include "common.h"
+
+#ifdef HAVE_SYS_STAT_H
+#  include <sys/stat.h> /* for mkdir */
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#  include <direct.h> /* For chdir */
+#endif
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <regex>
+#include <set>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include "bu/app.h"
+#include "bu/file.h"
+#include "bu/opt.h"
+#include "bu/path.h"
+#include "ged.h"
+
+static void
+_cmd_help(const char *usage, struct bu_opt_desc *d)
+{
+    struct bu_vls str = BU_VLS_INIT_ZERO;
+    char *option_help;
+
+    bu_vls_sprintf(&str, "%s", usage);
+
+    if ((option_help = bu_opt_describe(d, NULL))) {
+        bu_vls_printf(&str, "Options:\n%s\n", option_help);
+        bu_free(option_help, "help str");
+    }
+
+    bu_log("%s", bu_vls_cstr(&str));
+    bu_vls_free(&str);
+}
+
+
+int
+main(int argc, const char **argv)
+{
+    int print_help = 0;
+    int dry_run = 0;
+    int verbose = 0;
+    const char *usage = "Usage: gchecker [options] file.g  [objects ...]\n\n";
+    struct bu_opt_desc d[4];
+    BU_OPT(d[0], "h", "help",    "",  NULL, &print_help, "Print help and 
exit");
+    BU_OPT(d[1], "d", "dry-run", "",  NULL, &dry_run,    "Step through the 
checker stages, but don't raytrace");
+    BU_OPT(d[2], "v", "verbose", "",  NULL, &verbose,    "Print verbose 
information about result processing");
+    BU_OPT_NULL(d[3]);
+
+    std::set<std::pair<std::string, std::string>> unique_pairs;
+    std::multimap<std::pair<std::string, std::string>, double> pair_sizes;
+    std::map<std::pair<std::string, std::string>, double> pair_avg_sizes;
+
+
+    bu_setprogname(argv[0]);
+
+    argc-=(argc>0); argv+=(argc>0);
+
+       /* must be wanting help */
+    if (argc < 1) {
+        _cmd_help(usage, d);
+        return 0;
+    }
+
+    /* parse standard options */
+    int opt_ret = bu_opt_parse(NULL, argc, argv, d);
+
+    if (print_help) {
+        _cmd_help(usage, d);
+        return 0;
+    }
+
+    /* adjust argc to match the leftovers of the options parsing */
+    argc = opt_ret;
+
+    if (argc < 1) {
+       _cmd_help(usage, d);
+       return 1;
+    }
+
+
+    char gqa_exe[MAXPATHLEN] = {0};
+    char mged_exe[MAXPATHLEN] = {0};
+    char rtcheck_exe[MAXPATHLEN] = {0};
+    bu_dir(gqa_exe, MAXPATHLEN, BU_DIR_BIN, "gqa", BU_DIR_EXT, NULL);
+    bu_dir(mged_exe, MAXPATHLEN, BU_DIR_BIN, "mged", BU_DIR_EXT, NULL);
+    bu_dir(rtcheck_exe, MAXPATHLEN, BU_DIR_BIN, "rtcheck", BU_DIR_EXT, NULL);
+
+    if (!bu_file_exists(gqa_exe, NULL)) {
+       bu_exit(1, "could not locate gqa executable");
+    }
+    if (!bu_file_exists(mged_exe, NULL)) {
+       bu_exit(1, "could not locate mged executable");
+    }
+    if (!bu_file_exists(rtcheck_exe, NULL)) {
+       bu_exit(1, "could not locate rtcheck executable");
+    }
+
+    // Have programs - see if we have the .g file
+    struct bu_vls gfile = BU_VLS_INIT_ZERO;
+    bu_vls_sprintf(&gfile, "%s", argv[0]);
+    if (!bu_file_exists(bu_vls_cstr(&gfile), NULL)) {
+       char fpgfile[MAXPATHLEN] = {0};
+       bu_dir(fpgfile, MAXPATHLEN, BU_DIR_CURR, bu_vls_cstr(&gfile), NULL);
+       bu_vls_sprintf(&gfile, "%s", fpgfile);
+       if (!bu_file_exists(bu_vls_cstr(&gfile), NULL)) {
+           bu_vls_free(&gfile);
+           bu_exit(1, "file %s does not exist", argv[0]);
+       }
+    }
+
+    struct bu_vls gbasename = BU_VLS_INIT_ZERO;
+    if (!bu_path_component(&gbasename, bu_vls_cstr(&gfile), BU_PATH_BASENAME)) 
{
+       bu_vls_free(&gfile);
+       bu_exit(1, "Could not identify basename in geometry file path \"%s\"", 
argv[0]);
+    }
+    struct bu_vls wdir = BU_VLS_INIT_ZERO;
+    bu_vls_printf(&wdir, "%s.ck", bu_vls_cstr(&gbasename));
+    if (bu_file_exists(bu_vls_cstr(&wdir), NULL)) {
+       bu_vls_free(&gfile);
+       bu_vls_free(&gbasename);
+       bu_exit(1, "Working directory\"%s\" already exists - remove to 
continue", bu_vls_cstr(&wdir));
+    }
+
+
+    if (dry_run) {
+       bu_log("(Note: dry run - skipping rtcheck)\n");
+    }
+
+    // Make the working directory
+#ifdef HAVE_WINDOWS_H
+    CreateDirectory(bu_vls_cstr(&wdir), NULL);
+#else
+    /* mode: 775 */
+    mkdir(bu_vls_cstr(&wdir), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
+#endif
+
+    // Put a copy of the .g file in the working directory
+    std::ifstream sgfile(bu_vls_cstr(&gfile), std::ios::binary);
+    std::ofstream dgfile;
+    dgfile.open(bu_dir(NULL, 0, bu_vls_cstr(&wdir), bu_vls_cstr(&gbasename), 
NULL), std::ios::binary);
+    dgfile << sgfile.rdbuf();
+    dgfile.close();
+    sgfile.close();
+
+    // Change working directory
+    if (chdir(bu_vls_cstr(&wdir))) {
+       bu_exit(1, "Failed to chdir to \"%s\" ", bu_vls_cstr(&wdir));
+    }
+
+    if (verbose) {
+       bu_log("Working on a copy in %s\n", bu_vls_cstr(&wdir));
+    }
+
+    // All set - open up the .g file and go to work.
+    struct ged *gedp = ged_open("db", bu_vls_cstr(&gbasename), 1);
+    if (gedp == GED_NULL) {
+       bu_exit(1, "Failed to open \"%s\" ", bu_vls_cstr(&gbasename));
+    }
+
+    // Make sure our reference counts are up to date, so we can tell
+    // which objects are top level
+    db_update_nref(gedp->ged_wdbp->dbip, &rt_uniresource);
+
+    std::vector<struct directory *> objs;
+    if (argc > 1) {
+       for (int i = 1; i < argc; i++) {
+           struct directory *dp = db_lookup(gedp->ged_wdbp->dbip, argv[i], 
LOOKUP_QUIET);
+           if (dp == RT_DIR_NULL) {
+               bu_exit(1, "Failed to open object \"%s\" in \"%s\" ", argv[i], 
bu_vls_cstr(&gbasename));
+           }
+           objs.push_back(dp);
+       }
+    } else {
+       // Get all top level objects
+       struct directory **all_paths;
+       int obj_cnt = db_ls(gedp->ged_wdbp->dbip, DB_LS_TOPS, NULL, &all_paths);
+       for (int i = 0; i < obj_cnt; i++) {
+           objs.push_back(all_paths[i]);
+       }
+       bu_free(all_paths, "free db_tops output");
+    }
+
+    if (objs.size() == 1) {
+       bu_log("Processing tops object: %s\n", objs[0]->d_namep);
+    } else {
+       bu_log("Processing tops objects:\n");
+       for (size_t i = 0; i < objs.size(); i++) {
+           bu_log("   %s\n", objs[i]->d_namep);
+       }
+    }
+
+    int total_views = 0;
+    for (size_t i = 0; i < objs.size(); i++) {
+       for (int az = 0; az < 180; az+=45) {
+           for (int el = 0; el < 180; el+=45) {
+               total_views++;
+           }
+       }
+    }
+
+    if (total_views != (int)(16 * objs.size())) {
+       bu_exit(1, "view incrementing error\n");
+    }
+
+    // Run rtcheck equiv.
+    if (!dry_run) {
+       std::regex oregex("<(.*),.(.*)>: ([0-9]*).* (.*).mm");
+       for (size_t i = 0; i < objs.size(); i++) {
+           for (int az = 0; az < 180; az+=45) {
+               for (int el = 0; el < 180; el+=45) {
+                   struct bu_vls str = BU_VLS_INIT_ZERO;
+                   const char **av = (const char **)bu_calloc(8, sizeof(char 
*), "cmd array");
+                   av[0] = bu_strdup("check");
+                   av[1] = bu_strdup("overlaps");
+                   av[2] = bu_strdup("-G1024");
+                   bu_vls_sprintf(&str, "-a%d", az);
+                   av[3] = bu_strdup(bu_vls_cstr(&str));
+                   bu_vls_sprintf(&str, "-e%d", el);
+                   av[4] = bu_strdup(bu_vls_cstr(&str));
+                   av[5] = bu_strdup("-q");
+                   av[6] = bu_strdup(objs[i]->d_namep);
+                   bu_vls_trunc(gedp->ged_result_str, 0);
+                   if (ged_check(gedp, 7, av) != GED_OK) {
+                       bu_exit(1, "error running ged_check\n");
+                   }
+                   for (int j = 0; j < 7; j++) bu_free((void *)av[j], "str");
+                   bu_free(av, "av array");
+                   bu_vls_free(&str);
+
+                   // Split up results into something we can process with regex
+                   std::istringstream sres(bu_vls_cstr(gedp->ged_result_str));
+                   std::string line;
+                   while (std::getline(sres, line)) {
+                       std::smatch nvar;
+                       if (!std::regex_search(line, nvar, oregex) || 
nvar.size() != 5) {
+                           continue;
+                       }
+                       if (verbose) {
+                           bu_log("%zd: %s\n", nvar.size(), line.c_str());
+                           for (size_t m = 0; m < nvar.size(); m++) {
+                               bu_log("   %zd: %s\n", m, nvar.str(m).c_str());
+                           }
+                       }
+                       std::pair<std::string, std::string> key;
+                       // sort left and right strings lexicographically to 
produce unique pairing keys
+                       key = (nvar.str(1) < nvar.str(2)) ? 
std::make_pair(nvar.str(1), nvar.str(2)) :  std::make_pair(nvar.str(2), 
nvar.str(1));
+                       // size = count * depth
+                       double val = std::stod(nvar.str(3)) * 
std::stod(nvar.str(4));
+                       unique_pairs.insert(key);
+                       pair_sizes.insert(std::make_pair(key, val));
+                       if (verbose) {
+                           bu_log("Inserting: %s,%s -> %f\n", 
key.first.c_str(), key.second.c_str(), val);
+                       }
+                   }
+               }
+           }
+       }
+
+       // Run gqa equiv.
+       for (size_t i = 0; i < objs.size(); i++) {
+           for (int az = 0; az < 180; az+=45) {
+               for (int el = 0; el < 180; el+=45) {
+                   const char **av = (const char **)bu_calloc(6, sizeof(char 
*), "cmd array");
+                   av[0] = bu_strdup("check");
+                   av[1] = bu_strdup("overlaps");
+                   av[2] = bu_strdup("-g1mm,1mm");
+                   av[3] = bu_strdup("-q");
+                   av[4] = bu_strdup(objs[i]->d_namep);
+                   bu_vls_trunc(gedp->ged_result_str, 0);
+                   if (ged_check(gedp, 5, av) != GED_OK) {
+                       bu_exit(1, "error running ged_check\n");
+                   }
+                   for (int j = 0; j < 5; j++) bu_free((void *)av[j], "str");
+                   bu_free(av, "av array");
+
+                   // Split up results into something we can process with regex
+                   std::istringstream sres(bu_vls_cstr(gedp->ged_result_str));
+                   std::string line;
+                   while (std::getline(sres, line)) {
+                       std::smatch nvar;
+                       if (!std::regex_search(line, nvar, oregex) || 
nvar.size() != 5) {
+                           continue;
+                       }
+                       if (verbose) {
+                           bu_log("%zd: %s\n", nvar.size(), line.c_str());
+                           for (size_t m = 0; m < nvar.size(); m++) {
+                               bu_log("   %zd: %s\n", m, nvar.str(m).c_str());
+                           }
+                       }
+                       std::pair<std::string, std::string> key;
+                       // sort left and right strings lexicographically to 
produce unique pairing keys
+                       key = (nvar.str(1) < nvar.str(2)) ? 
std::make_pair(nvar.str(1), nvar.str(2)) :  std::make_pair(nvar.str(2), 
nvar.str(1));
+                       // size = count * depth
+                       double val = std::stod(nvar.str(3)) * 
std::stod(nvar.str(4));
+                       unique_pairs.insert(key);
+                       pair_sizes.insert(std::make_pair(key, val));
+                       if (verbose) {
+                           bu_log("Inserting: %s,%s -> %f\n", 
key.first.c_str(), key.second.c_str(), val);
+                       }
+                   }
+               }
+           }
+       }
+    }
+
+    if (verbose) {
+       bu_log("Found %zd unique pairings: \n", unique_pairs.size());
+    }
+    std::set<std::pair<std::string, std::string>>::iterator p_it;
+    for (p_it = unique_pairs.begin(); p_it != unique_pairs.end(); p_it++) {
+       if (verbose) {
+           bu_log("     %s + %s: \n", p_it->first.c_str(), 
p_it->second.c_str());
+       }
+       // For each pairing, get the average size
+       size_t scnt = pair_sizes.count(*p_it);
+       double ssum = 0.0;
+       if (verbose) {
+           bu_log("     Have %zd sizes: \n", scnt);
+       }
+       std::multimap<std::pair<std::string, std::string>, double>::iterator 
s_it;
+       for (s_it = pair_sizes.equal_range(*p_it).first; s_it != 
pair_sizes.equal_range(*p_it).second; s_it++) {
+           double s = (*s_it).second;
+           ssum += s;
+           if (verbose) {
+               bu_log("                   %f \n", s);
+           }
+       }
+       if (verbose) {
+           bu_log("     Avg: %f\n", ssum/(double)scnt);
+       }
+       pair_avg_sizes[*p_it] = ssum/(double)scnt;
+    }
+
+    // If we have something to write out, do so
+    if (pair_avg_sizes.size()) {
+       std::string ofile = std::string("ck.") + 
std::string(bu_vls_cstr(&gbasename)) + std::string(".overlaps");
+       std::ofstream of(ofile);
+       std::map<std::pair<std::string, std::string>, double>::iterator a_it;
+       for (a_it = pair_avg_sizes.begin(); a_it != pair_avg_sizes.end(); 
a_it++) {
+           bu_log("%s + %s: %f\n", a_it->first.first.c_str(), 
a_it->first.second.c_str(), a_it->second);
+           of << a_it->first.first.c_str() << " " << 
a_it->first.second.c_str() << " " << std::fixed << std::setprecision(5) << 
a_it->second << "\n";
+       }
+       of.close();
+    }
+
+    // Remove the copy of the .g file
+    std::remove(bu_vls_cstr(&gbasename));
+
+    // Clean up
+    bu_vls_free(&gfile);
+    bu_vls_free(&gbasename);
+    bu_vls_free(&wdir);
+
+    return 0;
+}
+
+// Local Variables:
+// tab-width: 8
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: t
+// c-file-style: "stroustrup"
+// End:
+// ex: shiftwidth=4 tabstop=8

Modified: brlcad/branches/STABLE/src/gtools/gdiff/gdiff.c
===================================================================
--- brlcad/branches/STABLE/src/gtools/gdiff/gdiff.c     2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/gtools/gdiff/gdiff.c     2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -84,7 +84,7 @@
        struct db_i *inmem_dbip;
        BU_PTBL_INIT(&diff3_results);
        BU_GET(inmem_dbip, struct db_i);
-       inmem_dbip->dbi_eof = (off_t)-1L;
+       inmem_dbip->dbi_eof = (b_off_t)-1L;
        inmem_dbip->dbi_fp = NULL;
        inmem_dbip->dbi_mf = NULL;
        inmem_dbip->dbi_read_only = 0;

Modified: brlcad/branches/STABLE/src/libanalyze/nirt.cpp
===================================================================
--- brlcad/branches/STABLE/src/libanalyze/nirt.cpp      2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/libanalyze/nirt.cpp      2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -35,8 +35,9 @@
 
 /* needed on mac in c90 mode */
 #ifndef HAVE_DECL_FSEEKO
-extern "C" int fseeko(FILE *, off_t, int);
-extern "C" off_t ftello(FILE *);
+#include "bio.h"
+extern "C" int fseeko(FILE *, b_off_t, int);
+extern "C" b_off_t ftello(FILE *);
 #endif
 #include <fstream>
 #include <iomanip>

Index: brlcad/branches/STABLE/src/libbu
===================================================================
--- brlcad/branches/STABLE/src/libbu    2020-05-08 14:22:16 UTC (rev 75757)
+++ brlcad/branches/STABLE/src/libbu    2020-05-08 14:24:29 UTC (rev 75758)

Property changes on: brlcad/branches/STABLE/src/libbu
___________________________________________________________________
Modified: svn:mergeinfo
## -1,2 +1,2 ##
-/brlcad/branches/RELEASE/src/libbu:72828-75050
-/brlcad/trunk/src/libbu:72525-74373,74376-74976
\ No newline at end of property
+/brlcad/branches/RELEASE/src/libbu:72828-75050,75562-75757
+/brlcad/trunk/src/libbu:72525-74373,74376-74976,75000,75063
\ No newline at end of property
Modified: brlcad/branches/STABLE/src/libbu/dir.c
===================================================================
--- brlcad/branches/STABLE/src/libbu/dir.c      2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libbu/dir.c      2020-05-08 14:24:29 UTC (rev 
75758)
@@ -285,7 +285,7 @@
 
 
 static void
-append(struct bu_vls *vp, const char *buf)
+path_append(struct bu_vls *vp, const char *buf)
 {
     size_t len = bu_vls_strlen(vp);
     if (len && bu_vls_addr(vp)[len-1] != BU_DIR_SEPARATOR)
@@ -527,64 +527,64 @@
        switch ((bu_dir_t)arg) {
            case BU_DIR_CURR:
                bu_getcwd(buf, MAXPATHLEN);
-               append(&vls, buf);
+               path_append(&vls, buf);
                break;
            case BU_DIR_INIT:
                bu_getiwd(buf, MAXPATHLEN);
-               append(&vls, buf);
+               path_append(&vls, buf);
                break;
            case BU_DIR_BIN:
                cpath = _bu_dir_brlcad_root(BRLCAD_BIN_DIR, 1);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_LIB:
                cpath = _bu_dir_brlcad_root(BRLCAD_LIB_DIR, 1);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_LIBEXEC:
                cpath = _bu_dir_brlcad_root(BRLCAD_LIBEXEC_DIR, 1);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_INCLUDE:
                cpath = _bu_dir_brlcad_root(BRLCAD_INCLUDE_DIR, 1);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_DATA:
                cpath = _bu_dir_brlcad_root(BRLCAD_DATA_DIR, 1);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_DOC:
                cpath = _bu_dir_brlcad_root(BRLCAD_DOC_DIR, 1);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_MAN:
                cpath = _bu_dir_brlcad_root(BRLCAD_MAN_DIR, 1);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_TEMP:
                cpath = dir_temp(buf, MAXPATHLEN);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_HOME:
                cpath = dir_home(buf, MAXPATHLEN);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_CACHE:
                cpath = dir_cache(buf, MAXPATHLEN);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_CONFIG:
                cpath = dir_config(buf, MAXPATHLEN);
-               append(&vls, cpath);
+               path_append(&vls, cpath);
                break;
            case BU_DIR_EXT:
-               append(&vls, EXECUTABLE_SUFFIX);
+               bu_vls_strcat(&vls, EXECUTABLE_SUFFIX);
                break;
            case BU_DIR_LIBEXT:
-               append(&vls, SHARED_LIBRARY_SUFFIX);
+               bu_vls_strcat(&vls, SHARED_LIBRARY_SUFFIX);
                break;
            default:
-               append(&vls, (const char *)arg);
+               path_append(&vls, (const char *)arg);
                break;
        }
        arg = va_arg(args, uintptr_t);

Modified: brlcad/branches/STABLE/src/libbu/file.c
===================================================================
--- brlcad/branches/STABLE/src/libbu/file.c     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libbu/file.c     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -490,38 +490,6 @@
     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)
-{
-    off_t ret;
-
-#if defined(HAVE__FTELLI64) && defined(SIZEOF_VOID_P) && SIZEOF_VOID_P == 8
-    /* windows 64bit */
-    ret = _ftelli64(stream);
-#else
-    ret = ftell(stream);
-#endif
-
-    return ret;
-}
-
-
 /*
  * Local Variables:
  * mode: C

Modified: brlcad/branches/STABLE/src/libbu/mappedfile.c
===================================================================
--- brlcad/branches/STABLE/src/libbu/mappedfile.c       2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/libbu/mappedfile.c       2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -75,7 +75,7 @@
 
 
 static void *
-win_mmap(void *start, size_t length, int prot, int flags, int fd, off_t 
offset, void **handle)
+win_mmap(void *start, size_t length, int prot, int flags, int fd, b_off_t 
offset, void **handle)
 {
     if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC))
        return MAP_FAILED;
@@ -102,7 +102,7 @@
     else
        flProtect = PAGE_READONLY;
 
-    off_t end = length + offset;
+    b_off_t end = length + offset;
     HANDLE mmap_fd, h;
     if (fd == -1)
        mmap_fd = INVALID_HANDLE_VALUE;

Modified: brlcad/branches/STABLE/src/libbu/vfont.c
===================================================================
--- brlcad/branches/STABLE/src/libbu/vfont.c    2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libbu/vfont.c    2020-05-08 14:24:29 UTC (rev 
75758)
@@ -99,7 +99,7 @@
     /* Addresses of characters in the file are relative to point in
      * the file after the directory, so grab the current position.
      */
-    font.offset = bu_ftell(font.ffdes);
+    font.offset = ftell(font.ffdes);
 
     return font;
 }

Modified: brlcad/branches/STABLE/src/libbu/vfont.h
===================================================================
--- brlcad/branches/STABLE/src/libbu/vfont.h    2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libbu/vfont.h    2020-05-08 14:24:29 UTC (rev 
75758)
@@ -27,7 +27,7 @@
 #define LIBBU_VFONT_H
 
 #include "common.h"
-
+#include "bio.h" /* for b_off_T */
 #include "bu/file.h"
 #include "bu/endian.h"
 #include "bu/str.h"
@@ -67,7 +67,7 @@
 
 struct vfont_file {
     FILE               *ffdes;         /* File pointer for current font.       
*/
-    off_t              offset;         /* Current offset to character data.    
*/
+    b_off_t            offset;         /* Current offset to character data.    
*/
     struct header      hdr;            /* Header for font file.                
*/
     struct dispatch    dir[256];       /* Directory for character font.        
*/
     int                        width;          /* Current character width.     
        */

Modified: brlcad/branches/STABLE/src/libbu/vls.c
===================================================================
--- brlcad/branches/STABLE/src/libbu/vls.c      2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libbu/vls.c      2020-05-08 14:24:29 UTC (rev 
75758)
@@ -221,7 +221,7 @@
 
 
 void
-bu_vls_nibble(struct bu_vls *vp, off_t len)
+bu_vls_nibble(struct bu_vls *vp, b_off_t len)
 {
     BU_CK_VLS(vp);
 

Modified: brlcad/branches/STABLE/src/libfb/fb_generic.c
===================================================================
--- brlcad/branches/STABLE/src/libfb/fb_generic.c       2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/libfb/fb_generic.c       2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -670,7 +670,7 @@
  * Throw bytes away.  Use reads into scanline buffer if a pipe, else seek.
  */
 static int
-fb_skip_bytes(int fd, off_t num, int fileinput, int scanbytes, unsigned char 
*scanline)
+fb_skip_bytes(int fd, b_off_t num, int fileinput, int scanbytes, unsigned char 
*scanline)
 {
     int n, tries;
 
@@ -785,7 +785,7 @@
        }
     }
 
-    if (file_yoff != 0) fb_skip_bytes(fd, 
(off_t)file_yoff*(off_t)file_width*sizeof(RGBpixel), fileinput, scanbytes, 
scanline);
+    if (file_yoff != 0) fb_skip_bytes(fd, 
(b_off_t)file_yoff*(b_off_t)file_width*sizeof(RGBpixel), fileinput, scanbytes, 
scanline);
 
     if (multiple_lines) {
        /* Bottom to top with multi-line reads & writes */
@@ -816,11 +816,11 @@
        /* Normal way -- bottom to top */
        for (y = scr_yoff; y < scr_yoff + yout; y++) {
            if (y < 0 || y > scr_height) {
-               fb_skip_bytes(fd, (off_t)file_width*sizeof(RGBpixel), 
fileinput, scanbytes, scanline);
+               fb_skip_bytes(fd, (b_off_t)file_width*sizeof(RGBpixel), 
fileinput, scanbytes, scanline);
                continue;
            }
            if (file_xoff+xskip != 0)
-               fb_skip_bytes(fd, (off_t)(file_xoff+xskip)*sizeof(RGBpixel), 
fileinput, scanbytes, scanline);
+               fb_skip_bytes(fd, (b_off_t)(file_xoff+xskip)*sizeof(RGBpixel), 
fileinput, scanbytes, scanline);
            n = bu_mread(fd, (char *)scanline, scanbytes);
            if (n <= 0) break;
            m = fb_write(ifp, xstart, y, scanline, xout);
@@ -832,17 +832,17 @@
            }
            /* slop at the end of the line? */
            if ((size_t)file_xoff+xskip+scanpix < (size_t)file_width)
-               fb_skip_bytes(fd, 
(off_t)(file_width-file_xoff-xskip-scanpix)*sizeof(RGBpixel), fileinput, 
scanbytes, scanline);
+               fb_skip_bytes(fd, 
(b_off_t)(file_width-file_xoff-xskip-scanpix)*sizeof(RGBpixel), fileinput, 
scanbytes, scanline);
        }
     } else {
        /* Inverse -- top to bottom */
        for (y = scr_height-1-scr_yoff; y >= scr_height-scr_yoff-yout; y--) {
            if (y < 0 || y >= scr_height) {
-               fb_skip_bytes(fd, (off_t)file_width*sizeof(RGBpixel), 
fileinput, scanbytes, scanline);
+               fb_skip_bytes(fd, (b_off_t)file_width*sizeof(RGBpixel), 
fileinput, scanbytes, scanline);
                continue;
            }
            if (file_xoff+xskip != 0)
-               fb_skip_bytes(fd, (off_t)(file_xoff+xskip)*sizeof(RGBpixel), 
fileinput, scanbytes, scanline);
+               fb_skip_bytes(fd, (b_off_t)(file_xoff+xskip)*sizeof(RGBpixel), 
fileinput, scanbytes, scanline);
            n = bu_mread(fd, (char *)scanline, scanbytes);
            if (n <= 0) break;
            m = fb_write(ifp, xstart, y, scanline, xout);
@@ -854,7 +854,7 @@
            }
            /* slop at the end of the line? */
            if ((size_t)file_xoff+xskip+scanpix < (size_t)file_width)
-               fb_skip_bytes(fd, 
(off_t)(file_width-file_xoff-xskip-scanpix)*sizeof(RGBpixel), fileinput, 
scanbytes, scanline);
+               fb_skip_bytes(fd, 
(b_off_t)(file_width-file_xoff-xskip-scanpix)*sizeof(RGBpixel), fileinput, 
scanbytes, scanline);
        }
     }
     free(scanline);

Modified: brlcad/branches/STABLE/src/libfb/if_X24.c
===================================================================
--- brlcad/branches/STABLE/src/libfb/if_X24.c   2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libfb/if_X24.c   2020-05-08 14:24:29 UTC (rev 
75758)
@@ -2009,7 +2009,7 @@
                fd = open(BS_NAME, O_RDWR | O_CREAT | O_BINARY, 0666);
                if (fd < 0)
                    fb_log("X24_getmem: can't create fb file, using private 
memory instead, errno %d\n", errno);
-               else if (lseek(fd, (off_t)size, SEEK_SET) < 0)
+               else if (lseek(fd, (b_off_t)size, SEEK_SET) < 0)
                    fb_log("X24_getmem: can't seek fb file, using private 
memory instead, errno %d\n", errno);
                else if (write(fd, &isnew, 1) < 0)
                    fb_log("X24_getmem: can't zero fb file, using private 
memory instead, errno %d\n", errno);

Modified: brlcad/branches/STABLE/src/libfb/if_disk.c
===================================================================
--- brlcad/branches/STABLE/src/libfb/if_disk.c  2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libfb/if_disk.c  2020-05-08 14:24:29 UTC (rev 
75758)
@@ -262,7 +262,7 @@
 
     dest = (y * ifp->if_width + x) * sizeof(RGBpixel);
     if (dest != ifp->if_seekpos) {
-       if (lseek(ifp->if_fd, (off_t)dest, 0) == -1) {
+       if (lseek(ifp->if_fd, (b_off_t)dest, 0) == -1) {
            fb_log("disk_buffer_write : seek to %zd failed.\n", dest);
            return -1;
        }
@@ -293,7 +293,7 @@
     if (fd == 1) fd = 0;
 
     if (ifp->if_seekpos != FILE_CMAP_SIZE &&
-       lseek(fd, (off_t)FILE_CMAP_SIZE, 0) == -1) {
+       lseek(fd, (b_off_t)FILE_CMAP_SIZE, 0) == -1) {
        fb_log("disk_colormap_read : seek to %zd failed.\n", FILE_CMAP_SIZE);
        return -1;
     }
@@ -316,7 +316,7 @@
        return 0;
     if (fb_is_linear_cmap(cmap))
        return 0;
-    if (lseek(ifp->if_fd, (off_t)FILE_CMAP_SIZE, 0) == -1) {
+    if (lseek(ifp->if_fd, (b_off_t)FILE_CMAP_SIZE, 0) == -1) {
        fb_log("disk_colormap_write : seek to %zd failed.\n", FILE_CMAP_SIZE);
        return -1;
     }

Modified: brlcad/branches/STABLE/src/libgcv/plugins/fastgen4/fastgen4_read.c
===================================================================
--- brlcad/branches/STABLE/src/libgcv/plugins/fastgen4/fastgen4_read.c  
2020-05-08 14:22:16 UTC (rev 75757)
+++ brlcad/branches/STABLE/src/libgcv/plugins/fastgen4/fastgen4_read.c  
2020-05-08 14:24:29 UTC (rev 75758)
@@ -2158,10 +2158,10 @@
 HIDDEN void
 skip_section(struct conversion_state *pstate)
 {
-    off_t section_start;
+    b_off_t section_start;
 
     /* skip to start of next section */
-    section_start = bu_ftell(pstate->fpin);
+    section_start = ftell(pstate->fpin);
     if (section_start < 0) {
        bu_bomb("Error: couldn't get input file's current file position.");
     }
@@ -2172,7 +2172,7 @@
               bu_strncmp(pstate->line, "WALL", 4) &&
               bu_strncmp(pstate->line, "vehicle", 7))
        {
-           section_start = bu_ftell(pstate->fpin);
+           section_start = ftell(pstate->fpin);
            if (section_start < 0) {
                bu_bomb("Error: couldn't get input file's current file 
position.");
            }
@@ -2181,7 +2181,7 @@
        }
     }
     /* seek to start of the section */
-    bu_fseek(pstate->fpin, section_start, SEEK_SET);
+    fseek(pstate->fpin, section_start, SEEK_SET);
 }
 
 

Modified: brlcad/branches/STABLE/src/libgcv/plugins/fastgen4/fastgen4_write.cpp
===================================================================
--- brlcad/branches/STABLE/src/libgcv/plugins/fastgen4/fastgen4_write.cpp       
2020-05-08 14:22:16 UTC (rev 75757)
+++ brlcad/branches/STABLE/src/libgcv/plugins/fastgen4/fastgen4_write.cpp       
2020-05-08 14:24:29 UTC (rev 75758)
@@ -36,8 +36,9 @@
 #include <cstdlib>
 
 #ifndef HAVE_DECL_FSEEKO
-extern "C" int fseeko(FILE *, off_t, int);
-extern "C" off_t ftello(FILE *);
+#include "bio.h" /* for b_off_t */
+extern "C" int fseeko(FILE *, b_off_t, int);
+extern "C" b_off_t ftello(FILE *);
 #endif
 #include <fstream>
 

Modified: brlcad/branches/STABLE/src/libgcv/plugins/obj/obj_write.c
===================================================================
--- brlcad/branches/STABLE/src/libgcv/plugins/obj/obj_write.c   2020-05-08 
14:22:16 UTC (rev 75757)
+++ brlcad/branches/STABLE/src/libgcv/plugins/obj/obj_write.c   2020-05-08 
14:24:29 UTC (rev 75758)
@@ -58,8 +58,8 @@
     const struct obj_write_options *obj_write_options;
     FILE *fp;
 
-    off_t vert_offset;
-    off_t norm_offset;
+    b_off_t vert_offset;
+    b_off_t norm_offset;
     size_t regions_tried;
     size_t regions_converted;
     size_t regions_written;

Modified: brlcad/branches/STABLE/src/libgcv/plugins/vrml/vrml_read/file_util.cpp
===================================================================
--- brlcad/branches/STABLE/src/libgcv/plugins/vrml/vrml_read/file_util.cpp      
2020-05-08 14:22:16 UTC (rev 75757)
+++ brlcad/branches/STABLE/src/libgcv/plugins/vrml/vrml_read/file_util.cpp      
2020-05-08 14:24:29 UTC (rev 75758)
@@ -33,9 +33,9 @@
 #include <iostream>
 
 #ifndef HAVE_DECL_FSEEKO
-#include <sys/types.h> /* for off_t */
-extern "C" int fseeko(FILE *, off_t, int);
-extern "C" off_t ftello(FILE *);
+#include "bio.h" /* for b_off_t */
+extern "C" int fseeko(FILE *, b_off_t, int);
+extern "C" b_off_t ftello(FILE *);
 #endif
 #include <fstream>
 

Modified: brlcad/branches/STABLE/src/libged/dup.c
===================================================================
--- brlcad/branches/STABLE/src/libged/dup.c     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libged/dup.c     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -42,7 +42,7 @@
 static void
 dup_dir_check5(struct db_i *input_dbip,
               const struct db5_raw_internal *rip,
-              off_t addr,
+              b_off_t addr,
               void *ptr)
 {
     char *name;
@@ -105,7 +105,7 @@
  * Check a name against the global directory.
  */
 static int
-dup_dir_check(struct db_i *input_dbip, const char *name, off_t UNUSED(laddr), 
size_t UNUSED(len), int UNUSED(flags), void *ptr)
+dup_dir_check(struct db_i *input_dbip, const char *name, b_off_t 
UNUSED(laddr), size_t UNUSED(len), int UNUSED(flags), void *ptr)
 {
     struct directory *dupdp;
     struct bu_vls local = BU_VLS_INIT_ZERO;

Modified: brlcad/branches/STABLE/src/libged/ged.c
===================================================================
--- brlcad/branches/STABLE/src/libged/ged.c     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libged/ged.c     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -426,7 +426,7 @@
            int i;
 
            BU_ALLOC(dbip, struct db_i);
-           dbip->dbi_eof = (off_t)-1L;
+           dbip->dbi_eof = (b_off_t)-1L;
            dbip->dbi_fp = NULL;
            dbip->dbi_mf = NULL;
            dbip->dbi_read_only = 0;

Modified: brlcad/branches/STABLE/src/libged/tables.c
===================================================================
--- brlcad/branches/STABLE/src/libged/tables.c  2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libged/tables.c  2020-05-08 14:24:29 UTC (rev 
75758)
@@ -101,7 +101,7 @@
 HIDDEN size_t
 tables_sol_number(const matp_t matrix, char *name, size_t *old, size_t *numsol)
 {
-    off_t i;
+    b_off_t i;
     struct identt idbuf1, idbuf2;
     static struct identt identt = {0, {0}, MAT_INIT_ZERO};
     ssize_t readval;

Modified: brlcad/branches/STABLE/src/libicv/rot.c
===================================================================
--- brlcad/branches/STABLE/src/libicv/rot.c     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libicv/rot.c     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -291,7 +291,7 @@
     ssize_t x, y;
     size_t j;
     int ret = 0;
-    off_t outbyte, outplace;
+    b_off_t outbyte, outplace;
     FILE *ifp, *ofp;
     unsigned char *obuf;
     unsigned char *buffer;
@@ -353,7 +353,7 @@
                xout = (nyin - 1) - lasty;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%jd)\n", argv[0], (void *)ofp, (intmax_t)outbyte);
@@ -383,7 +383,7 @@
                xout = yin;
                outbyte = ((yout * nyin) + xout) * pixbytes;
                if (outplace != outbyte) {
-                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%jd)\n", argv[0], (void *)ofp, (intmax_t)outbyte);
@@ -405,7 +405,7 @@
                yout = (nyin - 1) - y + 1;
                outbyte = yout * scanbytes;
                if (outplace != outbyte) {
-                   if (bu_fseek(ofp, outbyte, SEEK_SET) < 0) {
+                   if (fseek(ofp, outbyte, SEEK_SET) < 0) {
                        ret = 3;
                        perror("fseek");
                        bu_log("ERROR: %s can't seek on output (ofp=%p, 
outbyte=%jd)\n", argv[0], (void *)ofp, (intmax_t)outbyte);

Modified: brlcad/branches/STABLE/src/liboptical/oslexec_pvt.h
===================================================================
--- brlcad/branches/STABLE/src/liboptical/oslexec_pvt.h 2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/liboptical/oslexec_pvt.h 2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -190,7 +190,7 @@
 /// Template to count a vector's allocated size, in bytes.
 ///
 template<class T>
-inline off_t vectorbytes (const std::vector<T> &v)
+inline b_off_t vectorbytes (const std::vector<T> &v)
 {
     return v.capacity() * sizeof(T);
 }
@@ -798,20 +798,20 @@
     double m_stat_llvm_opt_time;          ///<     llvm IR optimization time
     double m_stat_llvm_jit_time;          ///<     llvm JIT time
 
-    PeakCounter<off_t> m_stat_memory;     ///< Stat: all shading system memory
+    PeakCounter<b_off_t> m_stat_memory;     ///< Stat: all shading system 
memory
 
-    PeakCounter<off_t> m_stat_mem_master; ///< Stat: master-related mem
-    PeakCounter<off_t> m_stat_mem_master_ops;
-    PeakCounter<off_t> m_stat_mem_master_args;
-    PeakCounter<off_t> m_stat_mem_master_syms;
-    PeakCounter<off_t> m_stat_mem_master_defaults;
-    PeakCounter<off_t> m_stat_mem_master_consts;
-    PeakCounter<off_t> m_stat_mem_inst;   ///< Stat: instance-related mem
-    PeakCounter<off_t> m_stat_mem_inst_ops;
-    PeakCounter<off_t> m_stat_mem_inst_args;
-    PeakCounter<off_t> m_stat_mem_inst_syms;
-    PeakCounter<off_t> m_stat_mem_inst_paramvals;
-    PeakCounter<off_t> m_stat_mem_inst_connections;
+    PeakCounter<b_off_t> m_stat_mem_master; ///< Stat: master-related mem
+    PeakCounter<b_off_t> m_stat_mem_master_ops;
+    PeakCounter<b_off_t> m_stat_mem_master_args;
+    PeakCounter<b_off_t> m_stat_mem_master_syms;
+    PeakCounter<b_off_t> m_stat_mem_master_defaults;
+    PeakCounter<b_off_t> m_stat_mem_master_consts;
+    PeakCounter<b_off_t> m_stat_mem_inst;   ///< Stat: instance-related mem
+    PeakCounter<b_off_t> m_stat_mem_inst_ops;
+    PeakCounter<b_off_t> m_stat_mem_inst_args;
+    PeakCounter<b_off_t> m_stat_mem_inst_syms;
+    PeakCounter<b_off_t> m_stat_mem_inst_paramvals;
+    PeakCounter<b_off_t> m_stat_mem_inst_connections;
 
     spin_mutex m_stat_mutex;              ///< Mutex for non-atomic stats
     ClosureRegistry m_closure_registry;

Modified: brlcad/branches/STABLE/src/libpkg/pkg.c
===================================================================
--- brlcad/branches/STABLE/src/libpkg/pkg.c     2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/libpkg/pkg.c     2020-05-08 14:24:29 UTC (rev 
75758)
@@ -27,11 +27,11 @@
 #include "common.h"
 
 #include <stdlib.h>
-#include <stdio.h>
 #include <ctype.h>             /* used by inet_addr() routine, below */
 #include <time.h>
 #include <string.h>
 
+
 #ifdef HAVE_SYS_PARAM_H
 #  include <sys/param.h>
 #endif
@@ -58,15 +58,6 @@
 #  undef LITTLE_ENDIAN         /* defined in netinet/{ip.h, tcp.h} */
 #endif
 
-#ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-#else
-#  include <windows.h>
-#  include <io.h>
-#  include <fcntl.h>
-#endif
-
-
 /* Not all systems with "BSD Networking" include UNIX Domain sockets */
 #ifdef HAVE_SYS_UN_H
 #  include <sys/un.h>          /* UNIX Domain sockets */
@@ -86,6 +77,9 @@
 #endif
 
 #include <errno.h>
+
+#include "bio.h"
+
 #include "pkg.h"
 
 #if defined(HAVE_GETHOSTBYNAME) && !defined(HAVE_DECL_GETHOSTBYNAME) && 
!defined(_WINSOCKAPI_)

Modified: brlcad/branches/STABLE/src/librt/db5_alloc.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db5_alloc.c        2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/librt/db5_alloc.c        2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -95,7 +95,7 @@
 int
 db5_realloc(struct db_i *dbip, struct directory *dp, struct bu_external *ep)
 {
-    off_t baseaddr;
+    b_off_t baseaddr;
     size_t baselen;
 
     RT_CK_DBI(dbip);
@@ -155,7 +155,7 @@
        if (db5_write_free(dbip, dp, dp->d_len) < 0) return -1;
 
        /* Second, erase back half of storage to remainder. */
-       dp->d_addr = baseaddr + (off_t)ep->ext_nbytes;
+       dp->d_addr = baseaddr + (b_off_t)ep->ext_nbytes;
        dp->d_len = baselen - ep->ext_nbytes;
        if (db5_write_free(dbip, dp, dp->d_len) < 0) return -1;
 
@@ -185,7 +185,7 @@
      */
     {
        struct mem_map *mmp;
-       off_t newaddr;
+       b_off_t newaddr;
 
        if ((mmp = rt_memalloc_nosplit(&(dbip->dbi_freep), ep->ext_nbytes)) != 
MAP_NULL) {
            if (RT_G_DEBUG&RT_DEBUG_DB)
@@ -201,7 +201,7 @@
            newaddr = mmp->m_addr;
            if ((size_t)mmp->m_size > (size_t)ep->ext_nbytes) {
                /* Reformat and free the surplus */
-               dp->d_addr = mmp->m_addr + (off_t)ep->ext_nbytes;
+               dp->d_addr = mmp->m_addr + (b_off_t)ep->ext_nbytes;
                dp->d_len = mmp->m_size - ep->ext_nbytes;
                if (RT_G_DEBUG&RT_DEBUG_DB)
                    bu_log("db5_realloc(%s) returning surplus at %jd, 
len=%zu\n",
@@ -223,7 +223,7 @@
 
     /* No free storage of the desired size, extend the database */
     dp->d_addr = dbip->dbi_eof;
-    dbip->dbi_eof += (off_t)ep->ext_nbytes;
+    dbip->dbi_eof += (b_off_t)ep->ext_nbytes;
     dp->d_len = ep->ext_nbytes;
     if (RT_G_DEBUG & RT_DEBUG_DB)
        bu_log("db5_realloc(%s) extending database addr=%jd, len=%zu\n",

Modified: brlcad/branches/STABLE/src/librt/db5_scan.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db5_scan.c 2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/librt/db5_scan.c 2020-05-08 14:24:29 UTC (rev 
75758)
@@ -37,7 +37,7 @@
     struct db_i *dbip,
     void (*handler)(struct db_i *,
                    const struct db5_raw_internal *,
-                   off_t addr, void *client_data),
+                   b_off_t addr, void *client_data),
     void *client_data)
 {
     unsigned char header[8];
@@ -44,7 +44,7 @@
     struct db5_raw_internal raw;
     int got;
     size_t nrec;
-    off_t addr;
+    b_off_t addr;
 
     RT_CK_DBI(dbip);
     if (RT_G_DEBUG&RT_DEBUG_DB) bu_log("db5_scan(%p, %lx)\n",
@@ -56,9 +56,9 @@
     /* Fast-path when file is already memory-mapped */
     if (dbip->dbi_mf) {
        const unsigned char *cp = (const unsigned char *)dbip->dbi_inmem;
-       off_t eof;
+       b_off_t eof;
 
-       eof = (off_t)dbip->dbi_mf->buflen;
+       eof = (b_off_t)dbip->dbi_mf->buflen;
 
        if (db5_header_is_valid(cp) == 0) {
            bu_log("db5_scan ERROR:  %s is lacking a proper BRL-CAD v5 database 
header\n", dbip->dbi_filename);
@@ -65,7 +65,7 @@
            goto fatal;
        }
        cp += sizeof(header);
-       addr = (off_t)sizeof(header);
+       addr = (b_off_t)sizeof(header);
        while (addr < eof) {
            if ((cp = db5_get_raw_internal_ptr(&raw, cp)) == NULL) {
                goto fatal;
@@ -72,10 +72,10 @@
            }
            (*handler)(dbip, &raw, addr, client_data);
            nrec++;
-           addr += (off_t)raw.object_length;
+           addr += (b_off_t)raw.object_length;
        }
        dbip->dbi_eof = addr;
-       BU_ASSERT(dbip->dbi_eof == (off_t)dbip->dbi_mf->buflen);
+       BU_ASSERT(dbip->dbi_eof == (b_off_t)dbip->dbi_mf->buflen);
     } else {
        /* In a totally portable way, read the database with stdio */
        rewind(dbip->dbi_fp);
@@ -85,7 +85,7 @@
            goto fatal;
        }
        for (;;) {
-           addr = bu_ftell(dbip->dbi_fp);
+           addr = ftell(dbip->dbi_fp);
            if ((got = db5_get_raw_internal_fp(&raw, dbip->dbi_fp)) < 0) {
                if (got == -1) break;           /* EOF */
                goto fatal;
@@ -97,7 +97,7 @@
                raw.buf = NULL;
            }
        }
-       dbip->dbi_eof = bu_ftell(dbip->dbi_fp);
+       dbip->dbi_eof = ftell(dbip->dbi_fp);
        rewind(dbip->dbi_fp);
     }
 
@@ -114,7 +114,7 @@
 db_diradd5(
     struct db_i *dbip,
     const char *name,
-    off_t laddr,
+    b_off_t laddr,
     unsigned char major_type,
     unsigned char minor_type,
     unsigned char name_hidden,
@@ -186,7 +186,7 @@
 struct directory *
 db5_diradd(struct db_i *dbip,
           const struct db5_raw_internal *rip,
-          off_t laddr,
+          b_off_t laddr,
           void *client_data)
 {
     struct directory **headp;
@@ -271,7 +271,7 @@
 db5_diradd_handler(
     struct db_i *dbip,
     const struct db5_raw_internal *rip,
-    off_t laddr,
+    b_off_t laddr,
     void *client_data) /* unused client_data from db5_scan() */
 {
     RT_CK_DBI(dbip);
@@ -297,7 +297,7 @@
 }
 
 HIDDEN int
-db_diradd4(struct db_i *dbi, const char *s, off_t o,  size_t st,  int i,  void 
*v)
+db_diradd4(struct db_i *dbi, const char *s, b_off_t o,  size_t st,  int i,  
void *v)
 {
     if (!db_diradd(dbi, s, o, st, i, v)) return 0;
     return 1;

Modified: brlcad/branches/STABLE/src/librt/db_alloc.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db_alloc.c 2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/librt/db_alloc.c 2020-05-08 14:24:29 UTC (rev 
75758)
@@ -81,11 +81,11 @@
                return -1;
            }
            dp->d_len = count;
-           dbip->dbi_eof += (off_t)(count * sizeof(union record));
+           dbip->dbi_eof += (b_off_t)(count * sizeof(union record));
            dbip->dbi_nrec += count;
            break;
        }
-       dp->d_addr = (off_t)(len * sizeof(union record));
+       dp->d_addr = (b_off_t)(len * sizeof(union record));
        dp->d_len = count;
        if (db_get(dbip, dp, &rec, 0, 1) < 0)
            return -1;
@@ -201,7 +201,7 @@
 
     for (i=0; i < todo; i++)
        rp[i].u_id = ID_FREE;
-    ret = db_put(dbip, dp, rp, (off_t)start, todo);
+    ret = db_put(dbip, dp, rp, (b_off_t)start, todo);
     bu_free((char *)rp, "db_zapper buf");
     return ret;
 }

Modified: brlcad/branches/STABLE/src/librt/db_corrupt.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db_corrupt.c       2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/librt/db_corrupt.c       2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -25,8 +25,8 @@
  */
 
 #include "common.h"
+#include "bio.h" /* for b_off_t */
 
-
 #include "vmath.h"
 #include "raytrace.h"
 #include "rt/db4.h"
@@ -41,7 +41,7 @@
 
 
 static int
-db_corrupt_handler(struct db_i *dbip, const char *name, off_t offset, size_t 
size, int UNUSED(type), void *data)
+db_corrupt_handler(struct db_i *dbip, const char *name, b_off_t offset, size_t 
size, int UNUSED(type), void *data)
 {
     struct counter *cnt = (struct counter *)data;
     struct bu_external ext;
@@ -54,7 +54,7 @@
     RT_CK_DBI(dbip);
 
     /* get into position */
-    ret = bu_fseek(dbip->dbi_fp, offset, 0);
+    ret = fseek(dbip->dbi_fp, offset, 0);
     if (ret) {
        bu_log("Database seek failure, unable to seek [%s]\n", name);
        return 0;

Modified: brlcad/branches/STABLE/src/librt/db_fullpath.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db_fullpath.c      2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/librt/db_fullpath.c      2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -162,7 +162,7 @@
 
 
 void
-db_dup_path_tail(struct db_full_path *newp, const struct db_full_path *oldp, 
off_t start)
+db_dup_path_tail(struct db_full_path *newp, const struct db_full_path *oldp, 
b_off_t start)
 {
     RT_CK_FULL_PATH(newp);
     RT_CK_FULL_PATH(oldp);

Modified: brlcad/branches/STABLE/src/librt/db_inmem.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db_inmem.c 2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/librt/db_inmem.c 2020-05-08 14:24:29 UTC (rev 
75758)
@@ -52,7 +52,7 @@
     register int i;
 
     BU_ALLOC(dbip, struct db_i);
-    dbip->dbi_eof = (off_t)-1L;
+    dbip->dbi_eof = (b_off_t)-1L;
     dbip->dbi_fp = NULL;
     dbip->dbi_mf = NULL;
 

Modified: brlcad/branches/STABLE/src/librt/db_io.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db_io.c    2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/librt/db_io.c    2020-05-08 14:24:29 UTC (rev 
75758)
@@ -50,7 +50,7 @@
  * -1 FAILURE
  */
 int
-db_read(const struct db_i *dbip, void *addr, size_t count, off_t offset)
+db_read(const struct db_i *dbip, void *addr, size_t count, b_off_t offset)
 /* byte count */
 /* byte offset from start of file */
 {
@@ -80,7 +80,7 @@
     }
     bu_semaphore_acquire(BU_SEM_SYSCALL);
 
-    ret = bu_fseek(dbip->dbi_fp, offset, 0);
+    ret = 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);
@@ -134,7 +134,7 @@
 
 
 int
-db_get(const struct db_i *dbip, const struct directory *dp, union record 
*where, off_t offset, size_t len)
+db_get(const struct db_i *dbip, const struct directory *dp, union record 
*where, b_off_t offset, size_t len)
 {
 
     RT_CK_DBI(dbip);
@@ -173,7 +173,7 @@
 
 
 int
-db_write(struct db_i *dbip, const void *addr, size_t count, off_t offset)
+db_write(struct db_i *dbip, const void *addr, size_t count, b_off_t offset)
 {
     register size_t got;
 
@@ -198,7 +198,7 @@
     bu_semaphore_acquire(BU_SEM_SYSCALL);
     bu_interrupt_suspend();
 
-    (void)bu_fseek(dbip->dbi_fp, offset, 0);
+    (void)fseek(dbip->dbi_fp, offset, 0);
     got = fwrite(addr, 1, count, dbip->dbi_fp);
     fflush(dbip->dbi_fp);
 
@@ -216,7 +216,7 @@
 
 
 int
-db_put(struct db_i *dbip, const struct directory *dp, union record *where, 
off_t offset, size_t len)
+db_put(struct db_i *dbip, const struct directory *dp, union record *where, 
b_off_t offset, size_t len)
 {
     RT_CK_DBI(dbip);
     RT_CK_DIR(dp);

Modified: brlcad/branches/STABLE/src/librt/db_lookup.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db_lookup.c        2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/librt/db_lookup.c        2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -230,7 +230,7 @@
 
 
 struct directory *
-db_diradd(struct db_i *dbip, const char *name, off_t laddr, size_t len, int 
flags, void *ptr)
+db_diradd(struct db_i *dbip, const char *name, b_off_t laddr, size_t len, int 
flags, void *ptr)
 {
     struct directory **headp;
     struct directory *dp;

Modified: brlcad/branches/STABLE/src/librt/db_open.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db_open.c  2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/librt/db_open.c  2020-05-08 14:24:29 UTC (rev 
75758)
@@ -131,7 +131,7 @@
 
        BU_ALLOC(dbip, struct db_i);
        dbip->dbi_mf = mfp;
-       dbip->dbi_eof = (off_t)mfp->buflen;
+       dbip->dbi_eof = (b_off_t)mfp->buflen;
        dbip->dbi_inmem = mfp->buf;
        dbip->dbi_mf->apbuf = (void *)dbip;
 
@@ -149,7 +149,7 @@
        /* Read-write mode */
 
        BU_ALLOC(dbip, struct db_i);
-       dbip->dbi_eof = (off_t)-1L;
+       dbip->dbi_eof = (b_off_t)-1L;
 
        if ((dbip->dbi_fp = fopen(name, "r+b")) == NULL) {
            if (RT_G_DEBUG & RT_DEBUG_DB) {

Modified: brlcad/branches/STABLE/src/librt/db_scan.c
===================================================================
--- brlcad/branches/STABLE/src/librt/db_scan.c  2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/librt/db_scan.c  2020-05-08 14:24:29 UTC (rev 
75758)
@@ -28,8 +28,8 @@
 
 #include "common.h"
 
-#include <stdio.h>
 #include <string.h>
+#include "bio.h" /* for b_off_t */
 #include "bnetwork.h"
 
 #include "bu/units.h"
@@ -72,7 +72,7 @@
  * -1 Fatal Error
  */
 int
-db_scan(struct db_i *dbip, int (*handler) (struct db_i *, const char *, off_t, 
size_t, int, void *), int do_old_matter, void *client_data)
+db_scan(struct db_i *dbip, int (*handler) (struct db_i *, const char *, 
b_off_t, size_t, int, void *), int do_old_matter, void *client_data)
 
 
 /* argument for handler */
@@ -79,9 +79,9 @@
 {
     union record record;       /* Initial record, holds name */
     union record rec2;         /* additional record(s) */
-    register off_t addr;       /* start of current rec */
-    register off_t here;               /* intermediate positions */
-    register off_t next;               /* start of next rec */
+    register b_off_t addr;     /* start of current rec */
+    register b_off_t here;             /* intermediate positions */
+    register b_off_t next;             /* start of next rec */
     register int nrec;         /* # records for this solid */
     register int totrec;       /* # records for database */
     register long j;
@@ -99,7 +99,7 @@
        return -1;
     }
     rewind(dbip->dbi_fp);
-    next = bu_ftell(dbip->dbi_fp);
+    next = ftell(dbip->dbi_fp);
     if (next < 0) {
        perror("ftell");
        next = 0;
@@ -111,7 +111,7 @@
     totrec = 0;
     while (1) {
        nrec = 0;
-       if (bu_fseek(dbip->dbi_fp, next, 0) != 0) {
+       if (fseek(dbip->dbi_fp, next, 0) != 0) {
            bu_log("db_scan:  fseek(offset=%jd) failure\n", (intmax_t)next);
            return -1;
        }
@@ -120,7 +120,7 @@
        if (fread((char *)&record, sizeof record, 1, dbip->dbi_fp) != 1
            || feof(dbip->dbi_fp))
            break;
-       next = bu_ftell(dbip->dbi_fp);
+       next = ftell(dbip->dbi_fp);
        if (next < 0) {
            perror("db_scan:  ftell:  ");
            return -1;
@@ -146,18 +146,18 @@
                break;
            case ID_ARS_A:
                while (1) {
-                   here = bu_ftell(dbip->dbi_fp);
+                   here = ftell(dbip->dbi_fp);
                    if (fread((char *)&rec2, sizeof(rec2),
                              1, dbip->dbi_fp) != 1)
                        break;
                    RT_DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_ARS_B) {
-                       bu_fseek(dbip->dbi_fp, here, 0);
+                       fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
                    nrec++;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                handler(dbip, record.a.a_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case ID_ARS_B:
@@ -171,7 +171,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                handler(dbip, record.ss.ss_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case ID_MATERIAL:
@@ -192,17 +192,17 @@
                break;
            case ID_P_HEAD:
                while (1) {
-                   here = bu_ftell(dbip->dbi_fp);
+                   here = ftell(dbip->dbi_fp);
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                    RT_DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_P_DATA) {
-                       bu_fseek(dbip->dbi_fp, here, 0);
+                       fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
                    nrec++;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                handler(dbip, record.p.p_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case ID_P_DATA:
@@ -211,12 +211,12 @@
            case ID_BSOLID:
                while (1) {
                    /* Find and skip subsequent BSURFs */
-                   here = bu_ftell(dbip->dbi_fp);
+                   here = ftell(dbip->dbi_fp);
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                    RT_DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_BSURF) {
-                       bu_fseek(dbip->dbi_fp, here, 0);
+                       fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
 
@@ -227,7 +227,7 @@
                        if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) 
!= 1)
                            break;
                    }
-                   next = bu_ftell(dbip->dbi_fp);
+                   next = ftell(dbip->dbi_fp);
                }
                handler(dbip, record.B.B_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
@@ -249,7 +249,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                handler(dbip, record.n.n_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_PARTICLE:
@@ -262,7 +262,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                handler(dbip, record.pwr.pwr_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_NMG:
@@ -272,7 +272,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                handler(dbip, record.nmg.N_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_SKETCH:
@@ -282,7 +282,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                handler(dbip, record.skt.skt_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_EXTR:
@@ -292,7 +292,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                handler(dbip, record.extr.ex_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case DBID_CLINE:
@@ -305,7 +305,7 @@
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                handler(dbip, record.s.s_name, addr, nrec, RT_DIR_SOLID, 
client_data);
                break;
            case ID_MEMB:
@@ -313,17 +313,17 @@
                break;
            case ID_COMB:
                while (1) {
-                   here = bu_ftell(dbip->dbi_fp);
+                   here = ftell(dbip->dbi_fp);
                    if (fread((char *)&rec2, sizeof(rec2), 1, dbip->dbi_fp) != 
1)
                        break;
                    RT_DEBUG_PR(here, rec2);
                    if (rec2.u_id != ID_MEMB) {
-                       bu_fseek(dbip->dbi_fp, here, 0);
+                       fseek(dbip->dbi_fp, here, 0);
                        break;
                    }
                    nrec++;
                }
-               next = bu_ftell(dbip->dbi_fp);
+               next = ftell(dbip->dbi_fp);
                switch (record.c.c_flags) {
                    default:
                    case DBV4_NON_REGION:
@@ -346,7 +346,7 @@
        totrec += nrec;
     }
     dbip->dbi_nrec = totrec;
-    next = bu_ftell(dbip->dbi_fp);
+    next = ftell(dbip->dbi_fp);
     if (next < 0)
        dbip->dbi_eof = -1;
     else
@@ -396,7 +396,7 @@
        return db5_update_ident(dbip, new_title, local2mm);
 
     RT_DIR_SET_NAMEP(&dir, ident);
-    dir.d_addr = (off_t)0L;
+    dir.d_addr = (b_off_t)0L;
     dir.d_len = 1;
     dir.d_magic = RT_DIR_MAGIC;
     dir.d_flags = 0;

Modified: brlcad/branches/STABLE/src/librt/librt_private.h
===================================================================
--- brlcad/branches/STABLE/src/librt/librt_private.h    2020-05-08 14:22:16 UTC 
(rev 75757)
+++ brlcad/branches/STABLE/src/librt/librt_private.h    2020-05-08 14:24:29 UTC 
(rev 75758)
@@ -133,7 +133,7 @@
 extern int tcl_list_to_avs(const char *tcl_list, struct bu_attribute_value_set 
*avs, int offset);
 
 /* db_io.c */
-extern int db_read(const struct db_i *dbip, void *addr, size_t count, off_t 
offset);
+extern int db_read(const struct db_i *dbip, void *addr, size_t count, b_off_t 
offset);
 
 /* db5_io.c */
 #define DB_SIZE_OBJ 0x1

Modified: brlcad/branches/STABLE/src/librt/mater.c
===================================================================
--- brlcad/branches/STABLE/src/librt/mater.c    2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/librt/mater.c    2020-05-08 14:24:29 UTC (rev 
75758)
@@ -171,7 +171,7 @@
  * Called from db_scan() when initially scanning database.
  */
 void
-rt_color_addrec(int low, int hi, int r, int g, int b, off_t addr)
+rt_color_addrec(int low, int hi, int r, int g, int b, b_off_t addr)
 {
     register struct mater *mp;
 

Modified: brlcad/branches/STABLE/src/librt/memalloc.c
===================================================================
--- brlcad/branches/STABLE/src/librt/memalloc.c 2020-05-08 14:22:16 UTC (rev 
75757)
+++ brlcad/branches/STABLE/src/librt/memalloc.c 2020-05-08 14:24:29 UTC (rev 
75758)
@@ -82,7 +82,7 @@
        return 0L;      /* No more space */
 
     addr = (size_t)curp->m_addr;
-    curp->m_addr += (off_t)size;
+    curp->m_addr += (b_off_t)size;
 
     /* If the element size goes to zero, put it on the freelist */
 
@@ -137,12 +137,12 @@
 
 
 void
-rt_memfree(struct mem_map **pp, size_t size, off_t addr)
+rt_memfree(struct mem_map **pp, size_t size, b_off_t addr)
 {
     register int type = 0;
     register struct mem_map *prevp = MAP_NULL;
     register struct mem_map *curp;
-    off_t il;
+    b_off_t il;
     struct mem_map *tmap;
 
     if (size == 0)
@@ -156,7 +156,7 @@
     /* Make up the `type' variable */
 
     if (prevp) {
-       il = prevp->m_addr + (off_t)prevp->m_size;
+       il = prevp->m_addr + (b_off_t)prevp->m_size;
        if (il > addr)
            type |= M_BOVFL;
        if (il == addr)
@@ -163,7 +163,7 @@
            type |= M_BMTCH;
     }
     if (curp) {
-       il = addr + (off_t)size;
+       il = addr + (b_off_t)size;
        if (il > curp->m_addr)
            type |= M_TOVFL;
        if (il == curp->m_addr)
@@ -203,7 +203,7 @@
 
        case M_TMTCH:           /* Expand top element downward */
            curp->m_size += size;
-           curp->m_addr -= (off_t)size;
+           curp->m_addr -= (b_off_t)size;
            break;
 
        default:                /* No matches; allocate and insert */

Modified: brlcad/branches/STABLE/src/librt/primitives/primitive_util.c
===================================================================

@@ Diff output truncated at 100000 characters. @@
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