Revision: 65265
          http://sourceforge.net/p/brlcad/code/65265
Author:   ejno
Date:     2015-06-11 16:21:33 +0000 (Thu, 11 Jun 2015)
Log Message:
-----------
update maximum name length

Modified Paths:
--------------
    brlcad/trunk/src/libgcv/conv/fastgen4/fastgen4_write.cpp

Modified: brlcad/trunk/src/libgcv/conv/fastgen4/fastgen4_write.cpp
===================================================================
--- brlcad/trunk/src/libgcv/conv/fastgen4/fastgen4_write.cpp    2015-06-11 
16:05:28 UTC (rev 65264)
+++ brlcad/trunk/src/libgcv/conv/fastgen4/fastgen4_write.cpp    2015-06-11 
16:21:33 UTC (rev 65265)
@@ -250,6 +250,8 @@
 class RecordWriter::Record
 {
 public:
+    static const std::size_t FIELD_WIDTH = 8;
+
     explicit Record(RecordWriter &writer);
     ~Record();
 
@@ -260,7 +262,6 @@
 
 
 private:
-    static const std::size_t FIELD_WIDTH = 8;
     static const std::size_t RECORD_WIDTH = 10;
 
     static std::string truncate_float(fastf_t value);
@@ -353,8 +354,7 @@
     const std::size_t end_digit = result.find_last_not_of('0');
     const std::size_t end_point = result.find('.');
 
-    if (end_digit != std::string::npos)
-       result.substr(0, std::max(end_digit, end_point + 1) + 1).swap(result);
+    result.erase(std::max(end_point + 2, end_digit + 1));
 
     if (end_point >= result.size() - 1)
        throw std::runtime_error("value too large");
@@ -654,7 +654,7 @@
 
 
 private:
-    static const std::size_t MAX_NAME_SIZE = 25;
+    static const std::size_t MAX_NAME_SIZE = RecordWriter::Record::FIELD_WIDTH 
* 3;
 
     const std::string m_name;
     const bool m_volume_mode;

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