gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash ChangeLog server/action_buffer.cpp server...


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/action_buffer.cpp server...
Date: Thu, 06 Jul 2006 21:56:48 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/07/06 21:56:48

Modified files:
        .              : ChangeLog 
        server         : action_buffer.cpp 
        server/swf     : ASHandlers.cpp 

Log message:
                removed -pedantic compiler warnings, fixed a bug in
                fix_stack_underrun pushing more undefined values then
                required.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.473&r2=1.474
http://cvs.savannah.gnu.org/viewcvs/gnash/server/action_buffer.cpp?cvsroot=gnash&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/ASHandlers.cpp?cvsroot=gnash&r1=1.30&r2=1.31

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.473
retrieving revision 1.474
diff -u -b -r1.473 -r1.474
--- ChangeLog   6 Jul 2006 11:38:19 -0000       1.473
+++ ChangeLog   6 Jul 2006 21:56:47 -0000       1.474
@@ -1,3 +1,10 @@
+2006-07-07 Sandro Santilli <address@hidden>
+
+       * server/action_buffer.cpp, server/swf/ASHandlers.cpp:
+       removed -pedantic compiler warnings, fixed a bug in
+       fix_stack_underrun pushing more undefined values then
+       required.
+
 2006-07-06 Sandro Santilli <address@hidden>
 
        * server/array.cpp, server/array.h: implemented

Index: server/action_buffer.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/action_buffer.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- server/action_buffer.cpp    5 Jul 2006 17:10:39 -0000       1.6
+++ server/action_buffer.cpp    6 Jul 2006 21:56:48 -0000       1.7
@@ -77,7 +77,7 @@
     :
     m_decl_dict_processed_at(-1)
 {
-       static int count=0;
+//     static int count=0;
 //     printf("Action buffer %d created\n", ++count);
 }
 
@@ -126,7 +126,7 @@
 {
     assert(stop_pc <= m_buffer.size());
     
-    if (m_decl_dict_processed_at == start_pc) {
+    if (static_cast<size_t>(m_decl_dict_processed_at) == start_pc) {
        // We've already processed this decl_dict.
 #ifndef NDEBUG
        int count = read_int16(start_pc+3);

Index: server/swf/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/ASHandlers.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- server/swf/ASHandlers.cpp   5 Jul 2006 23:56:08 -0000       1.30
+++ server/swf/ASHandlers.cpp   6 Jul 2006 21:56:48 -0000       1.31
@@ -543,7 +543,7 @@
        // TODO: make sure the NULL terminations are there
        // we could implement a safe_read_string(pc, maxlen)
        // and use tag length as maxlen
-       size_t tag_length = code.read_int16(pc+1);
+       //size_t tag_length = code.read_int16(pc+1);
        const char* url = code.read_string(pc+3);
        size_t url_len = strlen(url)+1;
        const char* target = code.read_string(pc+3+url_len);
@@ -612,7 +612,7 @@
 {
 //     GNASH_REPORT_FUNCTION;
 
-       as_environment& env = thread.env;
+       //as_environment& env = thread.env;
        const action_buffer& code = thread.code;
 
        assert( code[thread.pc] == SWF::ACTION_WAITFORFRAME );
@@ -632,10 +632,11 @@
        //
        // Since we don't load incrementally, just ignore this opcode.
 
-       unsigned int framenum = code.read_int16(thread.pc+3);
-       int skip = code[thread.pc+4];
+       //unsigned int framenum = code.read_int16(thread.pc+3);
+       //int skip = code[thread.pc+4];
 
 #if 0 // pseudo-code, to be implemented
+
        if ( target.loaded_frames() < framenum )
        {
                // better delegate this to ActionExec
@@ -1179,10 +1180,10 @@
 }
 
 void
-SWFHandlers::ActionMbLength(ActionExec& thread)
+SWFHandlers::ActionMbLength(ActionExec& /*thread*/)
 {
 //    GNASH_REPORT_FUNCTION;
-    as_environment& env = thread.env;
+//    as_environment& env = thread.env;
     dbglogfile << __PRETTY_FUNCTION__ << ": unimplemented!" << endl;
 }
 
@@ -1216,26 +1217,26 @@
 }
 
 void
-SWFHandlers::ActionMbSubString(ActionExec& thread)
+SWFHandlers::ActionMbSubString(ActionExec& /*thread*/)
 {
 //    GNASH_REPORT_FUNCTION;
-    as_environment& env = thread.env;
+//    as_environment& env = thread.env;
     dbglogfile << __PRETTY_FUNCTION__ << ": unimplemented!" << endl;
 }
 
 void
-SWFHandlers::ActionMbOrd(ActionExec& thread)
+SWFHandlers::ActionMbOrd(ActionExec& /*thread*/)
 {
 //    GNASH_REPORT_FUNCTION;
-    as_environment& env = thread.env;
+//    as_environment& env = thread.env;
     dbglogfile << __PRETTY_FUNCTION__ << ": unimplemented!" << endl;
 }
 
 void
-SWFHandlers::ActionMbChr(ActionExec& thread)
+SWFHandlers::ActionMbChr(ActionExec& /*thread*/)
 {
 //    GNASH_REPORT_FUNCTION;
-    as_environment& env = thread.env;
+//    as_environment& env = thread.env;
     dbglogfile << __PRETTY_FUNCTION__ << ": unimplemented!" << endl;
 }
 
@@ -1245,12 +1246,12 @@
 {
 //     GNASH_REPORT_FUNCTION;
        as_environment& env = thread.env;
-       const action_buffer& code = thread.code;
+       //const action_buffer& code = thread.code;
 
        ensure_stack(env, 1); // expression
 
        // how many actions to skip if frame has not been loaded
-       short unsigned int skip = code[thread.pc+3];
+       //short unsigned int skip = code[thread.pc+3];
 
        // env.top(0) contains frame specification,
        // evaluated as for ActionGotoExpression
@@ -1285,7 +1286,7 @@
 
        //---------------
        size_t i = pc;
-       while (i - pc < length) {
+       while (i - pc < static_cast<size_t>(length)) {
              uint8_t type = code[3 + i];
                log_action("-------------- push type=%d", type);
              i++;
@@ -1321,7 +1322,7 @@
                      log_action("-------------- pushed local register[%d] = 
'%s'\n",
                                  reg,
                                  env.top(0).to_string());
-                 } else if (reg < 0 || reg >= 4) {
+                 } else if (reg >= 4) {
                      env.push(as_value());
                      log_error("push register[%d] -- register out of 
bounds!\n", reg);
                  } else {
@@ -1928,10 +1929,10 @@
 }
 
 void
-SWFHandlers::ActionTargetPath(ActionExec& thread)
+SWFHandlers::ActionTargetPath(ActionExec& /*thread*/)
 {
 //    GNASH_REPORT_FUNCTION;
-    as_environment& env = thread.env;
+//    as_environment& env = thread.env;
     dbglogfile << __PRETTY_FUNCTION__ << ": unimplemented!" << endl;
 }
 
@@ -2230,10 +2231,10 @@
 }
 
 void
-SWFHandlers::ActionNewMethod(ActionExec& thread)
+SWFHandlers::ActionNewMethod(ActionExec& /*thread*/)
 {
 //    GNASH_REPORT_FUNCTION;
-    as_environment& env = thread.env;
+//    as_environment& env = thread.env;
     dbglogfile << __PRETTY_FUNCTION__ << ": unimplemented!" << endl;
 }
 
@@ -2269,10 +2270,10 @@
 }
 
 void
-SWFHandlers::ActionEnum2(ActionExec& thread)
+SWFHandlers::ActionEnum2(ActionExec& /*thread*/)
 {
 //    GNASH_REPORT_FUNCTION;
-    as_environment& env = thread.env;
+//    as_environment& env = thread.env;
     dbglogfile << __PRETTY_FUNCTION__ << ": unimplemented!" << endl;
 }
 
@@ -2377,7 +2378,7 @@
 }
 
 void
-SWFHandlers::ActionExtends(ActionExec& thread)
+SWFHandlers::ActionExtends(ActionExec& /*thread*/)
 {
 //    GNASH_REPORT_FUNCTION;
     dbglogfile << __PRETTY_FUNCTION__ << ": unimplemented!" << endl;
@@ -2473,7 +2474,7 @@
 }
 
 void
-SWFHandlers::ActionTry(ActionExec& thread)
+SWFHandlers::ActionTry(ActionExec& /*thread*/)
 {
 //    GNASH_REPORT_FUNCTION;
     dbglogfile << __PRETTY_FUNCTION__ << ": unimplemented!" << endl;
@@ -2609,7 +2610,7 @@
                        reg, env.top(0).to_string());
 
        }
-       else if (reg >= 0 && reg < 4)
+       else if (reg < 4)
        {
                env.global_register(reg) = env.top(0);
                      
@@ -2628,7 +2629,7 @@
 const char*
 SWFHandlers::action_name(action_type x) const
 {
-       if ( x > _handlers.size() )
+       if ( static_cast<size_t>(x) > _handlers.size() )
        {
                log_error("at SWFHandlers::action_name(%d) call time, _handlers 
size is %d", x, _handlers.size());
                return NULL;
@@ -2645,12 +2646,13 @@
 {
     assert ( env.stack_size() < required );
 
+    size_t missing = required-env.stack_size();
+
     log_error("Stack underrun: %d elements required, %d available. "
-        "Fixing by pushing undefined values on the missing slots.",
-        required, env.stack_size());
+        "Fixing by pushing %d undefined values on the missing slots.",
+        required, env.stack_size(), missing);
 
-    size_t missing = required-env.stack_size();
-    for (size_t i=0; i<required; ++i)
+    for (size_t i=0; i<missing; ++i)
     {
         env.push(as_value());
     }




reply via email to

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