Revision: 77858
http://sourceforge.net/p/brlcad/code/77858
Author: starseeker
Date: 2020-12-02 00:03:23 +0000 (Wed, 02 Dec 2020)
Log Message:
-----------
Merge from trunk - r77837 through r77857
Modified Paths:
--------------
brlcad/branches/extbuild/CMakeLists.txt
brlcad/branches/extbuild/TODO
brlcad/branches/extbuild/include/bu/defines.h
brlcad/branches/extbuild/include/bu/tbl.h
brlcad/branches/extbuild/misc/CMake/BRLCAD_Options.cmake
brlcad/branches/extbuild/src/libbu/tbl.c
Property Changed:
----------------
brlcad/branches/extbuild/
brlcad/branches/extbuild/include/
brlcad/branches/extbuild/src/libbu/
brlcad/branches/extbuild/src/other/
Index: brlcad/branches/extbuild
===================================================================
--- brlcad/branches/extbuild 2020-12-01 23:57:05 UTC (rev 77857)
+++ brlcad/branches/extbuild 2020-12-02 00:03:23 UTC (rev 77858)
Property changes on: brlcad/branches/extbuild
___________________________________________________________________
Modified: svn:mergeinfo
## -11,4 +11,4 ##
/brlcad/branches/osg:62110-62113
/brlcad/branches/prep-cache:68236-68933
/brlcad/branches/tcltk86:68300-75257
-/brlcad/trunk:77547-77837
\ No newline at end of property
+/brlcad/trunk:77547-77857
\ No newline at end of property
Modified: brlcad/branches/extbuild/CMakeLists.txt
===================================================================
--- brlcad/branches/extbuild/CMakeLists.txt 2020-12-01 23:57:05 UTC (rev
77857)
+++ brlcad/branches/extbuild/CMakeLists.txt 2020-12-02 00:03:23 UTC (rev
77858)
@@ -433,6 +433,14 @@
message("***********************************************************")
endif(BRLCAD_PRINT_MSGS)
+# Now we define the various options for BRL-CAD - ways to enable and
+# disable features, select which parts of the system to build, etc.
+# As much as possible, sane default options are either selected or
+# detected. Because documentation is autogenerated for BRL-CAD
+# options, be sure to initialize the file.
+set(CONFIG_OPT_STRING "CONFIGURATION OPTIONS\n---------------------\n")
+file(WRITE "${CMAKE_BINARY_DIR}/BRLCAD_OPTIONS" "${CONFIG_OPT_STRING}")
+
# The BRL-CAD CMake build will also generate a configure script
# that emulates the command option style of GNU Autotool's
# configure. Write the pre-defined header into the build-dir template
@@ -754,6 +762,12 @@
CONFIG_H_APPEND(BRLCAD "#define HAVE_WARN_UNUSED_RESULT_ATTRIBUTE 1\n")
endif(HAVE_WARN_UNUSED_RESULT_ATTRIBUTE)
+# Check whether the compiler supports __attribute__((flatten))
+check_c_source_compiles("__attribute__((flatten)) int *func(int *v){(*v)-=1;
return v;} __attribute((flatten)) int main(int argc, char *argv[]) {int v = 1;
int *vp = func(&v); return *vp;}" HAVE_FLATTEN_ATTRIBUTE)
+if(HAVE_FLATTEN_ATTRIBUTE)
+ CONFIG_H_APPEND(BRLCAD "#define HAVE_FLATTEN_ATTRIBUTE 1\n")
+endif(HAVE_FLATTEN_ATTRIBUTE)
+
# Silence check for unused arguments (used to silence clang warnings about
# unused options on the command line). By default clang generates a lot of
# warnings about such arguments, and we don't really care.
@@ -2191,7 +2205,7 @@
DISTCLEAN("${CMAKE_BINARY_DIR}/brlcadexec.cmake")
DISTCLEAN("${CMAKE_BINARY_DIR}/cmake_install.cmake")
DISTCLEAN("${CMAKE_BINARY_DIR}/install_manifest.txt")
- DISTCLEAN("${CMAKE_BINARY_DIR}/OPTIONS")
+ DISTCLEAN("${CMAKE_BINARY_DIR}/BRLCAD_OPTIONS")
DISTCLEAN("${CMAKE_BINARY_DIR}/CMakeFiles")
DISTCLEAN("${CMAKE_BINARY_DIR}/CMakeTmp")
DISTCLEAN("${CMAKE_BINARY_DIR}/configure.new")
@@ -2281,7 +2295,7 @@
file(READ "${BRLCAD_SOURCE_DIR}/INSTALL" SRC_INSTALL_STR)
string(REGEX REPLACE "${CONFIG_OPT_STRING}.*" "" INSTALL_PREFIX
"${SRC_INSTALL_STR}")
file(WRITE "${BRLCAD_BINARY_DIR}/INSTALL.new" "${INSTALL_PREFIX}")
-file(READ "${BRLCAD_BINARY_DIR}/OPTIONS" INSTALL_OPTS)
+file(READ "${BRLCAD_BINARY_DIR}/BRLCAD_OPTIONS" INSTALL_OPTS)
file(APPEND "${BRLCAD_BINARY_DIR}/INSTALL.new" "${INSTALL_OPTS}")
file(APPEND "${BRLCAD_BINARY_DIR}/INSTALL.new" "\n\n*** Note - Do not add or
edit configuration option descriptions and alias
lists in this file - those entries are auto-generated from information in
Modified: brlcad/branches/extbuild/TODO
===================================================================
--- brlcad/branches/extbuild/TODO 2020-12-01 23:57:05 UTC (rev 77857)
+++ brlcad/branches/extbuild/TODO 2020-12-02 00:03:23 UTC (rev 77858)
@@ -18,6 +18,8 @@
THESE TASKS SHOULD HAPPEN BEFORE THE NEXT RELEASE
-------------------------------------------------
+* bounding box reduction command
+
* MGED asynchronous subprocess management appears to be broken with
both mged -c and gui mode on Mac. MGED is blocking when running
"rt" command until after the framebuffer window is closed.
Index: brlcad/branches/extbuild/include
===================================================================
--- brlcad/branches/extbuild/include 2020-12-01 23:57:05 UTC (rev 77857)
+++ brlcad/branches/extbuild/include 2020-12-02 00:03:23 UTC (rev 77858)
Property changes on: brlcad/branches/extbuild/include
___________________________________________________________________
Modified: svn:mergeinfo
## -10,4 +10,4 ##
/brlcad/branches/osg/include:62110-62113
/brlcad/branches/prep-cache/include:68236-68933
/brlcad/branches/tcltk86/include:68300-75257
-/brlcad/trunk/include:77660-77699,77784-77829
\ No newline at end of property
+/brlcad/trunk/include:77660-77699,77784-77829,77838-77857
\ No newline at end of property
Modified: brlcad/branches/extbuild/include/bu/defines.h
===================================================================
--- brlcad/branches/extbuild/include/bu/defines.h 2020-12-01 23:57:05 UTC
(rev 77857)
+++ brlcad/branches/extbuild/include/bu/defines.h 2020-12-02 00:03:23 UTC
(rev 77858)
@@ -190,6 +190,18 @@
/**
+ * shorthand placed before a function _definition_ indicating to some
+ * compilers that it should inline most of the function calls within
+ * the function. this should be used sparingly on functions that are
+ * demonstrably hot, as indicated by a profiler.
+ */
+#ifdef HAVE_FLATTEN_ATTRIBUTE
+# define _BU_ATTR_FLATTEN __attribute__((flatten))
+#else
+# define _BU_ATTR_FLATTEN
+#endif
+
+/**
* This macro is used to take the 'C' function name, and convert it at
* compile time to the FORTRAN calling convention.
*
Modified: brlcad/branches/extbuild/include/bu/tbl.h
===================================================================
--- brlcad/branches/extbuild/include/bu/tbl.h 2020-12-01 23:57:05 UTC (rev
77857)
+++ brlcad/branches/extbuild/include/bu/tbl.h 2020-12-02 00:03:23 UTC (rev
77858)
@@ -39,49 +39,73 @@
/** @file bu/tbl.h */
/**
- * this is pulled from num.c where the guts to the table printer
- * currently resides, moved here for easy reference.
- *
+ * Example 1:
@code
- double vals[16] = {-1.123123123123, 0, 0, 1.0/0.0, 0, 123, 0, 0, 0, -2345,
123123.123123123123, 0, 123123123.123123123, 21, 1.0/0.0, 1};
-
-
- bu_num_print(vals, 16, 4, "my matrix\n[\n", "\t[", NULL, ", ", "]\n",
"]\n]\n");
-
-------------------------------------------------------------------------------
my matrix
[
- [-1.1231231231229999, 0, 0, inf]
- [ 0, 123, 0, 0]
- [ 0, -2345, 123123.12312312312, 0]
- [ 123123123.12312312, 21, inf, 1]
+ [ -1.1231231231229999, 0, 0, inf ]
+ [ 0, 123, 0, 0 ]
+ [ 0, -2345, 123123.12312312312, 0 ]
+ [ 123123123.12312312, 21, inf, 1 ]
]
+ @endcode
+ *
+ * generated from this code:
+ *
+ @code
+ double vals[16] = {-1.123123123123, 0, 0, 1.0/0.0, 0, 123, 0, 0, 0, -2345,
123123.123123123123, 0, 123123123.123123123, 21, 1.0/0.0, 1};
- bu_num_print(vals+5, 3, 3, "POINT { ", NULL, NULL, " ", NULL, " }\n");
- ---------------------------------------------------------------------
-POINT { 123 0 0 }
+ struct bu_tbl *t = bu_tbl_create();
- bu_num_print(vals, 16, 4, "MATRIX [", " [", NULL, ", ", "]\n", "] ]\n");
- -----------------------------------------------------------------------
-MATRIX [ [-1.1231231231229999, 0, 0, inf]
- [ 0, 123, 0, 0]
- [ 0, -2345, 123123.12312312312, 0]
- [ 123123123.12312312, 21, inf, 1] ]
+ bu_tbl_style(t, BU_TBL_STYLE_NONE);
+ bu_tbl_printf(t, "my matrix");
+ bu_tbl_style(t, BU_TBL_ROW_END);
+ bu_tbl_style(t, BU_TBL_ROW_ALIGN_LEFT);
+ bu_tbl_printf(t, "[");
+ bu_tbl_style(t, BU_TBL_ROW_END);
+ bu_tbl_style(t, BU_TBL_ROW_ALIGN_RIGHT);
+ bu_tbl_printf(t, "[|%.17g,|%.17g,|%.17g,|%.17g|]", vals[0], vals[1], vals[2],
vals[3]);
+ bu_tbl_style(t, BU_TBL_ROW_END);
+ bu_tbl_style(t, BU_TBL_ROW_ALIGN_RIGHT);
+ bu_tbl_printf(t, "[|%.17g,|%.17g,|%.17g,|%.17g|]", vals[4], vals[5], vals[6],
vals[7]);
+ bu_tbl_style(t, BU_TBL_ROW_END);
+ bu_tbl_style(t, BU_TBL_ROW_ALIGN_RIGHT);
+ bu_tbl_printf(t, "[|%.17g,|%.17g,|%.17g,|%.17g|]", vals[8], vals[9],
vals[10], vals[11]);
+ bu_tbl_style(t, BU_TBL_ROW_END);
+ bu_tbl_style(t, BU_TBL_ROW_ALIGN_RIGHT);
+ bu_tbl_printf(t, "[|%.17g,|%.17g,|%.17g,|%.17g|]", vals[12], vals[13],
vals[14], vals[15]);
+ bu_tbl_style(t, BU_TBL_ROW_END);
+ bu_tbl_style(t, BU_TBL_ROW_ALIGN_LEFT);
+ bu_tbl_printf(t, "]");
- bu_num_print(vals, 16, 4, NULL, NULL, NULL, " ", " ", "\n");
- --------------------------------------------------------------
--1.1231231231229999 0 0 inf 0 123 0 0 0 -2345 123123.12312312312 0
123123123.12312312 21 inf 1
-
- bu_num_print(vals, 4, 4, NULL, NULL, NULL, NULL, NULL, NULL);
- ------------------------------------------------------------
--1.1231231231229999 0 0 inf
-
- bu_num_print(vals, 16, 4, NULL, NULL, "%017.2lf", " ", "\n", "\n");
- ------------------------------------------------------------------
+ bu_tbl_destroy(t);
+ @endcode
+ *
+ * Example 2:
+ @code
-0000000000001.12 00000000000000.00 00000000000000.00 inf
00000000000000.00 00000000000123.00 00000000000000.00 00000000000000.00
00000000000000.00 -0000000002345.00 00000000123123.12 00000000000000.00
00000123123123.12 00000000000021.00 inf 00000000000001.00
+ @endcode
+ *
+ *
+ *
+ @code
+ double vals[16] = {-1.123123123123, 0, 0, 1.0/0.0, 0, 123, 0, 0, 0, -2345,
123123.123123123123, 0, 123123123.123123123, 21, 1.0/0.0, 1};
+ struct bu_tbl *t = bu_tbl_create();
+
+ bu_tbl_style(t, BU_TBL_STYLE_LIST);
+ bu_tbl_printf(t, "%017.2lf|%017.2lf|%017.2lf|%017.2lf", vals[0], vals[1],
vals[2], vals[3]);
+ bu_tbl_style(t, BU_TBL_ROW_END);
+ bu_tbl_printf(t, "%017.2lf|%017.2lf|%017.2lf|%017.2lf", vals[4], vals[5],
vals[6], vals[7]);
+ bu_tbl_style(t, BU_TBL_ROW_END);
+ bu_tbl_printf(t, "%017.2lf|%017.2lf|%017.2lf|%017.2lf", vals[8], vals[9],
vals[10], vals[11]);
+ bu_tbl_style(t, BU_TBL_ROW_END);
+ bu_tbl_printf(t, "%017.2lf|%017.2lf|%017.2lf|%017.2lf", vals[12], vals[13],
vals[14], vals[15]);
+
+ bu_tbl_destroy(t);
@endcode
*
*/
@@ -116,11 +140,21 @@
bu_tbl_clear(struct bu_tbl *);
+/**
+ * Table styles:
+ *
+ * NONE 1 ------ --- +-------+---+ ╭────────┬───╮ ╔════════╦═══╗
+ * 2 3 LIST 1 | BASIC | 1 | │ SINGLE │ 1 │ ║ DOUBLE ║ 1 ║
+ * 4 5 ------ --- +-------+---+ ├────────┼───┤ ╠════════╬═══╣
+ * 2 3 | 2 | 3 | │ 2 │ 3 │ ║ 2 ║ 3 ║
+ * 4 5 | 4 | 5 | │ 4 │ 5 │ ║ 4 ║ 5 ║
+ * +-------+---+ ╰────────┴───╯ ╚════════╩═══╝
+ */
enum bu_tbl_style {
/* table border style */
BU_TBL_STYLE_NONE,
+ BU_TBL_STYLE_LIST,
BU_TBL_STYLE_BASIC,
- BU_TBL_STYLE_SIMPLE,
BU_TBL_STYLE_SINGLE,
BU_TBL_STYLE_DOUBLE,
@@ -156,17 +190,17 @@
/**
- * set cell position of the current table insertion point.
+ * get cell position for the current table insertion point.
*/
BU_EXPORT extern struct bu_tbl *
-bu_tbl_go_to(struct bu_tbl *, size_t row, size_t col);
+bu_tbl_is_at(struct bu_tbl *, size_t *row, size_t *col);
/**
- * get cell position for the current table insertion point.
+ * set cell position of the current table insertion point.
*/
BU_EXPORT extern struct bu_tbl *
-bu_tbl_is_at(struct bu_tbl *, size_t *row, size_t *col);
+bu_tbl_go_to(struct bu_tbl *, size_t row, size_t col);
/**
Modified: brlcad/branches/extbuild/misc/CMake/BRLCAD_Options.cmake
===================================================================
--- brlcad/branches/extbuild/misc/CMake/BRLCAD_Options.cmake 2020-12-01
23:57:05 UTC (rev 77857)
+++ brlcad/branches/extbuild/misc/CMake/BRLCAD_Options.cmake 2020-12-02
00:03:23 UTC (rev 77858)
@@ -133,7 +133,7 @@
# Write documentation description for BRL-CAD options
function(WRITE_OPTION_DESCRIPTION opt opt_ALIASES opt_DESCRIPTION)
- set(ofile "${CMAKE_BINARY_DIR}/OPTIONS")
+ set(ofile "${CMAKE_BINARY_DIR}/BRLCAD_OPTIONS")
file(APPEND "${ofile}" "\n--- ${opt} ---\n")
file(APPEND "${ofile}" "${${opt_DESCRIPTION}}")
Index: brlcad/branches/extbuild/src/libbu
===================================================================
--- brlcad/branches/extbuild/src/libbu 2020-12-01 23:57:05 UTC (rev 77857)
+++ brlcad/branches/extbuild/src/libbu 2020-12-02 00:03:23 UTC (rev 77858)
Property changes on: brlcad/branches/extbuild/src/libbu
___________________________________________________________________
Modified: svn:mergeinfo
## -3,4 +3,4 ##
/brlcad/branches/brep-debug/src/libbu:69168,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
/brlcad/branches/dm-fb-merge/src/libbu:75426-76198
/brlcad/branches/tcltk86/src/libbu:68300-75257
-/brlcad/trunk/src/libbu:77547-77657,77690-77770,77784-77835
\ No newline at end of property
+/brlcad/trunk/src/libbu:77547-77657,77690-77770,77784-77835,77838-77857
\ No newline at end of property
Modified: brlcad/branches/extbuild/src/libbu/tbl.c
===================================================================
--- brlcad/branches/extbuild/src/libbu/tbl.c 2020-12-01 23:57:05 UTC (rev
77857)
+++ brlcad/branches/extbuild/src/libbu/tbl.c 2020-12-02 00:03:23 UTC (rev
77858)
@@ -41,7 +41,7 @@
struct bu_tbl *
bu_tbl_create()
{
- struct bu_tbl *tbl;
+ struct bu_tbl *tbl = NULL;
tbl = (struct bu_tbl *)bu_calloc(1, sizeof(struct bu_tbl), "bu_tbl alloc");
tbl->t = ft_create_table();
@@ -85,13 +85,17 @@
switch (style) {
case BU_TBL_STYLE_NONE:
ft_set_border_style(tbl->t, FT_EMPTY_STYLE);
+ ft_set_cell_prop(tbl->t, FT_ANY_ROW, FT_ANY_COLUMN,
FT_CPROP_LEFT_PADDING, 0);
+ ft_set_cell_prop(tbl->t, FT_ANY_ROW, FT_ANY_COLUMN,
FT_CPROP_RIGHT_PADDING, 1);
break;
+ case BU_TBL_STYLE_LIST:
+ ft_set_border_style(tbl->t, FT_SIMPLE_STYLE);
+ ft_set_cell_prop(tbl->t, FT_ANY_ROW, FT_ANY_COLUMN,
FT_CPROP_LEFT_PADDING, 0);
+ ft_set_cell_prop(tbl->t, FT_ANY_ROW, FT_ANY_COLUMN,
FT_CPROP_RIGHT_PADDING, 0);
+ break;
case BU_TBL_STYLE_BASIC:
ft_set_border_style(tbl->t, FT_BASIC_STYLE);
break;
- case BU_TBL_STYLE_SIMPLE:
- ft_set_border_style(tbl->t, FT_SIMPLE_STYLE);
- break;
case BU_TBL_STYLE_SINGLE:
ft_set_border_style(tbl->t, FT_SOLID_ROUND_STYLE);
break;
@@ -173,14 +177,14 @@
struct bu_tbl *
bu_tbl_printf(struct bu_tbl *tbl, const char *fmt, ...)
{
- char *cstr;
+ char *cstr = NULL;
va_list ap;
#define BUFSZ 4096
char buf[BUFSZ];
- char *back;
- char *last;
- size_t zeros;
+ char *back = NULL;
+ char *last = NULL;
+ size_t zeros = 0;
if (!fmt)
return tbl;
Index: brlcad/branches/extbuild/src/other
===================================================================
--- brlcad/branches/extbuild/src/other 2020-12-01 23:57:05 UTC (rev 77857)
+++ brlcad/branches/extbuild/src/other 2020-12-02 00:03:23 UTC (rev 77858)
Property changes on: brlcad/branches/extbuild/src/other
___________________________________________________________________
Modified: svn:mergeinfo
## -9,4 +9,4 ##
/brlcad/branches/osg/src/other:62110-62113
/brlcad/branches/prep-cache/src/other:68236-68933
/brlcad/branches/tcltk86/src/other:68300-75257
-/brlcad/trunk/src/other:77547-77657,77836-77837
\ No newline at end of property
+/brlcad/trunk/src/other:77547-77657,77836-77857
\ No newline at end of property
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