Revision: 72495
          http://sourceforge.net/p/brlcad/code/72495
Author:   starseeker
Date:     2019-02-21 21:26:14 +0000 (Thu, 21 Feb 2019)
Log Message:
-----------
For the moment at least, let's keep the old material limit

Modified Paths:
--------------
    brlcad/trunk/src/libanalyze/density.cxx
    brlcad/trunk/src/libanalyze/tests/density.cxx

Modified: brlcad/trunk/src/libanalyze/density.cxx
===================================================================
--- brlcad/trunk/src/libanalyze/density.cxx     2019-02-21 21:01:14 UTC (rev 
72494)
+++ brlcad/trunk/src/libanalyze/density.cxx     2019-02-21 21:26:14 UTC (rev 
72495)
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <climits>
 #include <map>
 #include <string>
 #include <sstream>
@@ -28,8 +29,8 @@
 
 #include "analyze.h"
 
-#define MAX_MATERIAL_ID   9999999999
-#define MAX_MATERIAL_CNT 10000000000
+#define MAX_MATERIAL_ID  32768
+#define MAX_MATERIAL_CNT 1000000
 
 struct analyze_densities_impl {
     std::map<long int,std::string> id2name;
@@ -79,7 +80,7 @@
 
     if (id > MAX_MATERIAL_ID) {
        if (msgs) {
-           bu_vls_printf(msgs, "Error: material id %ld is large than 
MAX_MATERIAL_ID (%ld)\n", id, MAX_MATERIAL_ID);
+           bu_vls_printf(msgs, "Error: material id %ld is large than 
MAX_MATERIAL_ID (%d)\n", id, MAX_MATERIAL_ID);
        }
        return -1;
     }
@@ -86,7 +87,7 @@
 
     if (a->i->id2density.size() == MAX_MATERIAL_CNT) {
        if (msgs) {
-           bu_vls_printf(msgs, "Error: analyze densities database is full - 
maximum density count of %ld has been reached\n", MAX_MATERIAL_CNT);
+           bu_vls_printf(msgs, "Error: analyze densities database is full - 
maximum density count of %d has been reached\n", MAX_MATERIAL_CNT);
        }
        return -1;
     }

Modified: brlcad/trunk/src/libanalyze/tests/density.cxx
===================================================================
--- brlcad/trunk/src/libanalyze/tests/density.cxx       2019-02-21 21:01:14 UTC 
(rev 72494)
+++ brlcad/trunk/src/libanalyze/tests/density.cxx       2019-02-21 21:26:14 UTC 
(rev 72495)
@@ -46,7 +46,7 @@
     "               12   3.00      Gunner\n"
     "               14   10.00     Fuel\n"
     "#  Material ID too high \n"
-    "99999999999 70.84    Kryptonite\n";
+    "99999 70.84    Kryptonite\n";
 
 const char *tbuff_out_ctrl =
     "2 7.82    Carbon Tool Steel\n"

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



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

Reply via email to