gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/dlist.cpp server/parser/...


From: Benjamin Wolsey
Subject: [Gnash-commit] gnash ChangeLog server/dlist.cpp server/parser/...
Date: Tue, 29 Apr 2008 12:58:48 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Benjamin Wolsey <bwy>   08/04/29 12:58:48

Modified files:
        .              : ChangeLog 
        server         : dlist.cpp 
        server/parser  : filter_factory.cpp filter_factory.h 

Log message:
                * server/parser/filter_factory.{h,cpp}: drop invalid const 
qualifier
                  on static int read(), fix the gcc 4.3 bracket warnings that 
then
                  appear.
                * server/dlist.cpp (get_character_by_name{_i}): was a thought 
at an
                  optimization (cache _charsByDepth.end()) that I never tested 
but
                  don't really want to revert.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6443&r2=1.6444
http://cvs.savannah.gnu.org/viewcvs/gnash/server/dlist.cpp?cvsroot=gnash&r1=1.120&r2=1.121
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/filter_factory.cpp?cvsroot=gnash&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/filter_factory.h?cvsroot=gnash&r1=1.4&r2=1.5

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6443
retrieving revision 1.6444
diff -u -b -r1.6443 -r1.6444
--- ChangeLog   29 Apr 2008 12:51:37 -0000      1.6443
+++ ChangeLog   29 Apr 2008 12:58:47 -0000      1.6444
@@ -1,3 +1,12 @@
+2008-04-29 Benjamin Wolsey <address@hidden>
+
+       * server/parser/filter_factory.{h,cpp}: drop invalid const qualifier
+         on static int read(), fix the gcc 4.3 bracket warnings that then
+         appear.
+       * server/dlist.cpp (get_character_by_name{_i}): was a thought at an
+         optimization (cache _charsByDepth.end()) that I never tested but
+         don't really want to revert.
+
 2008-04-29 Sandro Santilli <address@hidden>
 
        * testsuite/misc-ming.all/Makefile.am: fix build of tests

Index: server/dlist.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/dlist.cpp,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -b -r1.120 -r1.121
--- server/dlist.cpp    28 Apr 2008 09:04:02 -0000      1.120
+++ server/dlist.cpp    29 Apr 2008 12:58:48 -0000      1.121
@@ -149,13 +149,15 @@
 {
   testInvariant();
 
-  container_type::iterator it = std::find_if(
-      _charsByDepth.begin(),
-      _charsByDepth.end(),
+  const container_type::iterator e = _charsByDepth.end();
+
+  container_type::const_iterator it = std::find_if(
+      _charsByDepth.begin(), e,
       NameEquals(name));
 
-  if ( it == _charsByDepth.end() ) return NULL;
-  else return it->get();
+  if ( it == e ) return NULL;
+  
+  return it->get();
 
 }
 
@@ -164,13 +166,15 @@
 {
   testInvariant();
 
-  container_type::iterator it = std::find_if(
-      _charsByDepth.begin(),
-      _charsByDepth.end(),
+  const container_type::iterator e = _charsByDepth.end();
+
+  container_type::const_iterator it = std::find_if(
+      _charsByDepth.begin(), e,
       NameEqualsNoCase(name));
 
-  if ( it == _charsByDepth.end() ) return NULL;
-  else return it->get();
+  if ( it == e ) return NULL;
+  
+  return it->get();
 }
 
 void

Index: server/parser/filter_factory.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/filter_factory.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- server/parser/filter_factory.cpp    14 Mar 2008 22:33:57 -0000      1.11
+++ server/parser/filter_factory.cpp    29 Apr 2008 12:58:48 -0000      1.12
@@ -44,9 +44,11 @@
     GRADIENT_BEVEL = 7
 } filter_types;
 
-int const filter_factory::read(stream& in, 
-    bool read_multiple, Filters* store)
+int
+filter_factory::read(stream& in, bool read_multiple, Filters* store)
 {
+    //GNASH_REPORT_FUNCTION;
+
     int count = 1;
 
     if (read_multiple)
@@ -118,7 +120,7 @@
 {
     in.ensureBytes(4 + 8 + 8 + 2 + 1);
 
-    m_color = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+    m_color = in.read_u8() << (16 + in.read_u8()) << (8 + in.read_u8());
     m_alpha = in.read_u8();
 
     m_blurX = in.read_fixed();
@@ -164,9 +166,11 @@
 
 bool GlowFilter::read(stream& in)
 {
+    //GNASH_REPORT_FUNCTION;
+
     in.ensureBytes(4 + 8 + 2 + 1);
 
-    m_color = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+    m_color = in.read_u8() << (16 + in.read_u8()) << (8 + in.read_u8());
     m_alpha = in.read_u8();
 
     m_blurX = in.read_fixed();
@@ -193,10 +197,10 @@
     // TODO: It is possible that the order of these two should be reversed.
     // highlight might come first. Find out for sure and then fix and remove
     // this comment.
-    m_shadowColor = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+    m_shadowColor = in.read_u8() << (16 + in.read_u8()) << (8 + in.read_u8());
     m_shadowAlpha = in.read_u8();
 
-    m_highlightColor = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+    m_highlightColor = in.read_u8() << (16 + in.read_u8()) << (8 + 
in.read_u8());
     m_highlightAlpha = in.read_u8();
 
     m_blurX = in.read_fixed();
@@ -238,7 +242,7 @@
 
     for (int i = 0; i < count; ++i)
     {
-        m_colors.push_back(in.read_u8() << 16 + in.read_u8() << 8 + 
in.read_u8());
+        m_colors.push_back(in.read_u8() << (16 + in.read_u8()) << (8 + 
in.read_u8()));
         m_alphas.push_back(in.read_u8());
     }
 
@@ -291,7 +295,7 @@
         m_matrix.push_back(in.read_long_float());
     }
 
-    m_color = in.read_u8() << 16 + in.read_u8() << 8 + in.read_u8();
+    m_color = in.read_u8() << (16 + in.read_u8()) << (8 + in.read_u8());
     m_alpha = in.read_u8();
 
     static_cast<void> (in.read_uint(6)); // Throw away.
@@ -343,7 +347,7 @@
     m_ratios.reserve(count);
     for (int i = 0; i < count; ++i)
     {
-        m_colors.push_back(in.read_u8() << 16 + in.read_u8() << 8 + 
in.read_u8());
+        m_colors.push_back(in.read_u8() << (16 + in.read_u8()) << (8 + 
in.read_u8()));
         m_alphas.push_back(in.read_u8());
     }
 

Index: server/parser/filter_factory.h
===================================================================
RCS file: /sources/gnash/gnash/server/parser/filter_factory.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- server/parser/filter_factory.h      5 Mar 2008 03:56:02 -0000       1.4
+++ server/parser/filter_factory.h      29 Apr 2008 12:58:48 -0000      1.5
@@ -39,7 +39,7 @@
     /// and push them into the vector store. Returns the number read.
     /// If read_multiple is true, the first byte of the stream is
     /// expected to contain the number of filters to be read.
-    static int const read(stream& in, bool read_multiple,
+    static int read(stream& in, bool read_multiple,
         Filters* store);
 };
 




reply via email to

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