gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2273-gc98c271
Date: Tue, 29 Mar 2016 10:27:24 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  c98c271596356118b074a4023c7816623a5514ab (commit)
       via  2f264a33249e4cfe03ff728ba2f54c6ee2b96d74 (commit)
      from  a72afa572ede07393cead17211a0ab61210394e4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=c98c271596356118b074a4023c7816623a5514ab


commit c98c271596356118b074a4023c7816623a5514ab
Author: Nutchanon Wetchasit <address@hidden>
Date:   Tue Mar 29 11:44:03 2016 +0200

    Use enough digits to represent double in plugin's ExternalInterface.
    
    See bug #47280 <https://savannah.gnu.org/bugs/?47280>

diff --git a/plugin/npapi/external.cpp b/plugin/npapi/external.cpp
index a49d0c5..4ebce1d 100644
--- a/plugin/npapi/external.cpp
+++ b/plugin/npapi/external.cpp
@@ -372,6 +372,7 @@ ExternalInterface::convertNPVariant (const NPVariant *value)
     
     if (NPVARIANT_IS_DOUBLE(*value)) {
         double num = NPVARIANT_TO_DOUBLE(*value);
+        ss.precision(std::numeric_limits<double>::max_digits10);
         ss << "<number>" << num << "</number>";
     } else if (NPVARIANT_IS_STRING(*value)) {
         std::string str = NPStringToString(NPVARIANT_TO_STRING(*value));

http://git.savannah.gnu.org/cgit//commit/?id=2f264a33249e4cfe03ff728ba2f54c6ee2b96d74


commit 2f264a33249e4cfe03ff728ba2f54c6ee2b96d74
Author: Nutchanon Wetchasit <address@hidden>
Date:   Tue Mar 29 11:43:51 2016 +0200

    Always parse "<number>" in plugin's ExternalInterface as double.
    
    See bug #47280 <https://savannah.gnu.org/bugs/?47280>

diff --git a/plugin/npapi/external.cpp b/plugin/npapi/external.cpp
index 1183fba..a49d0c5 100644
--- a/plugin/npapi/external.cpp
+++ b/plugin/npapi/external.cpp
@@ -293,13 +293,8 @@ ExternalInterface::parseXML(GnashPluginScriptObject 
*scriptobj, const std::strin
             start = end;
             end = xml.find("</number>");
             std::string str = xml.substr(start, end-start);
-            if (str.find(".") != std::string::npos) {
-                double num = strtod(str.c_str(), nullptr);
-                DOUBLE_TO_NPVARIANT(num, value);
-            } else {
-                int num = strtol(str.c_str(), nullptr, 0);
-                INT32_TO_NPVARIANT(num, value);
-            }
+            double num = strtod(str.c_str(), nullptr);
+            DOUBLE_TO_NPVARIANT(num, value);
         } else if (tag == "<string>") {
             start = end;
             end = xml.find("</string>");

-----------------------------------------------------------------------

Summary of changes:
 plugin/npapi/external.cpp |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]