gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog libbase/rc.cpp libbase/rc.h


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog libbase/rc.cpp libbase/rc.h
Date: Tue, 19 Feb 2008 08:04:28 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  08/02/19 08:04:28

Modified files:
        .              : ChangeLog 
        libbase        : rc.cpp rc.h 

Log message:
        return as soon as directive matches pattern while parsing 'set' lines.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5687&r2=1.5688
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.cpp?cvsroot=gnash&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/rc.h?cvsroot=gnash&r1=1.44&r2=1.45

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5687
retrieving revision 1.5688
diff -u -b -r1.5687 -r1.5688
--- ChangeLog   19 Feb 2008 07:50:06 -0000      1.5687
+++ ChangeLog   19 Feb 2008 08:04:27 -0000      1.5688
@@ -1,5 +1,7 @@
 2008-02-19 Sandro Santilli <address@hidden>
 
+       * libbase/rc.{cpp,h}: return as soon as directive matches
+         pattern while parsing 'set' lines.
        * testsuite/libamf.all/Makefile.am: set GNASHRC to use
          testsuite-specific configuration.
 

Index: libbase/rc.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- libbase/rc.cpp      19 Feb 2008 00:47:17 -0000      1.61
+++ libbase/rc.cpp      19 Feb 2008 08:04:28 -0000      1.62
@@ -168,11 +168,12 @@
             //cout <<  variable << ": disabled" << endl;
             *var = false;
         }
+       return true;
     }
-    return *var;
+    else return false;
 }
 
-boost::uint32_t
+bool
 RcInitFile::extractNumber(boost::uint32_t *num, const char *pattern, 
std::string &variable,
                            std::string &value)
 {      
@@ -188,8 +189,9 @@
             cerr << "RcInitFile::extractNumber: conversion overflow!: " << foo 
<< endl;
             
         }
+       return true;
     }
-    return *num;
+    else return false;
 }
 
 /// Takes references to action ('set' or 'append'), items
@@ -249,7 +251,7 @@
 
 }
 
-void
+bool
 RcInitFile::extractDouble(double& out, const char *pattern, std::string 
&variable,
                            std::string &value)
 {
@@ -261,8 +263,10 @@
 
     if ( noCaseCompare(variable, pattern) ) {
         out = strtod(value.c_str(), 0);
+       return true;
        //printf("strtod returned %g\n", out);
     }
+    else return false;
 }
 
 void
@@ -457,41 +461,59 @@
 
                if (noCaseCompare(action , "set") ) {
                      extractSetting(&_splashScreen, "splashScreen", variable,
-                               value);
+                               value)
+                               || 
                      extractSetting(&_localhostOnly, "localhost", variable,
-                               value);
+                               value)
+                               || 
                      extractSetting(&_localdomainOnly, "localdomain", variable,
-                               value);
+                               value)
+                               ||
                      extractSetting(&_insecureSSL, "InsecureSSL", variable,
-                               value);
-                     extractSetting(&_debugger, "debugger", variable, value);
-                     extractSetting(&_actionDump, "actionDump", variable, 
value);
-                     extractSetting(&_parserDump, "parserDump", variable, 
value);
-                     extractSetting(&_writeLog, "writelog", variable, value);
-                     extractSetting(&_sound, "sound", variable, value);
-                     extractSetting(&_pluginSound, "pluginsound", variable, 
value);
+                               value)
+                               ||
+                     extractSetting(&_debugger, "debugger", variable, value)
+                               ||
+                     extractSetting(&_actionDump, "actionDump", variable, 
value)
+                               ||
+                     extractSetting(&_parserDump, "parserDump", variable, 
value)
+                               ||
+                     extractSetting(&_writeLog, "writelog", variable, value)
+                               ||
+                     extractSetting(&_sound, "sound", variable, value)
+                               ||
+                     extractSetting(&_pluginSound, "pluginsound", variable, 
value)
+                               ||
                      extractSetting(&_verboseASCodingErrors,
-                               "ASCodingErrorsVerbosity", variable, value);
+                               "ASCodingErrorsVerbosity", variable, value)
+                               ||
                      extractSetting(&_verboseMalformedSWF, 
"MalformedSWFVerbosity",
-                               variable, value);
+                               variable, value)
+                               ||
                      extractSetting(&_extensionsEnabled, "EnableExtensions",
-                               variable, value);
-                     extractSetting(&_startStopped, "StartStopped", variable, 
value);
-
-                     extractDouble(_streamsTimeout, "StreamsTimeout", 
variable, value);
-
-                     extractNumber(&_movieLibraryLimit, "movieLibraryLimit", 
variable, value);                
-                     extractNumber(&_delay, "delay", variable, value);
-                     extractNumber(&_verbosity, "verbosity", variable, value);
-
-
+                               variable, value)
+                               ||
+                     extractSetting(&_startStopped, "StartStopped", variable, 
value)
+                               ||
                      extractSetting(&_solreadonly, "SOLReadOnly", variable,
-                               value);
+                               value)
+                               ||
                      extractSetting(&_lcdisabled, "LocalConnection", variable,
-                               value);
+                               value)
+                               ||
                      extractSetting(&_lctrace, "LCTrace", variable,
-                               value);
-                     extractNumber(&_lcshmkey, "LCShmkey", variable, value);
+                               value)
+                               ||
+                     extractNumber(&_movieLibraryLimit, "movieLibraryLimit", 
variable, value)
+                               ||
+                     extractNumber(&_delay, "delay", variable, value)
+                               ||
+                     extractNumber(&_verbosity, "verbosity", variable, value)
+                               ||
+                     extractNumber(&_lcshmkey, "LCShmkey", variable, value)
+                               ||
+                     extractDouble(_streamsTimeout, "StreamsTimeout", 
variable, value);
+
                }
             }
         }

Index: libbase/rc.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/rc.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -b -r1.44 -r1.45
--- libbase/rc.h        11 Feb 2008 08:13:06 -0000      1.44
+++ libbase/rc.h        19 Feb 2008 08:04:28 -0000      1.45
@@ -345,13 +345,31 @@
     /// Performs substitution on a path string (~) 
     void expandPath(std::string& path);
 
+    /// \brief
+    /// If variable matches pattern (case-insensitive)
+    /// set *var according to value
+    //
+    /// @return true if variable matches patter, false otherwise
+    ///
     static bool extractSetting(bool *var, const char *pattern,
                         std::string &variable, std::string &value);
     
-    static boost::uint32_t extractNumber(boost::uint32_t *num, const char 
*pattern,
+    /// \brief
+    /// If variable matches pattern (case-insensitive)
+    /// set *num according to value
+    //
+    /// @return true if variable matches patter, false otherwise
+    ///
+    static bool extractNumber(boost::uint32_t *num, const char *pattern,
                         std::string &variable, std::string &value);
 
-    static void extractDouble(double& out, const char *pattern,
+    /// \brief
+    /// If variable matches pattern (case-insensitive)
+    /// set out according to value
+    //
+    /// @return true if variable matches patter, false otherwise
+    ///
+    static bool extractDouble(double& out, const char *pattern,
                         std::string &variable, std::string &value);
 
     void parseList(std::vector<std::string>& list, std::string &action,




reply via email to

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