gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] gnash configure.ac libamf/amf.cpp libamf/amf.h ...


From: Bastiaan Jacques
Subject: [Gnash-commit] gnash configure.ac libamf/amf.cpp libamf/amf.h ...
Date: Tue, 03 Apr 2007 16:13:08 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Bastiaan Jacques <bjacques>     07/04/03 16:13:08

Modified files:
        .              : configure.ac 
        libamf         : amf.cpp amf.h 
        libbase        : log.h 
        server         : as_object.cpp edit_text_character.cpp 
                         movie_root.cpp sprite_instance.cpp 
        server/parser  : morph2_character_def.cpp movie_def_impl.cpp 
        server/vm      : ASHandlers.cpp 
        utilities      : processor.cpp 

Log message:
                * configure.ac: Check for the correct SIZET_FMT trial-by-
                error style. 
                * libamf/amf{.h, .cpp}: Make the void* argument which is 
                exclusively read a const pointer. Fix warnings.
                * libbase/log.h: Remove definition of SIZET_FMT.
                * server: More use of SIZET_FMT

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/configure.ac?cvsroot=gnash&r1=1.285&r2=1.286
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/amf.cpp?cvsroot=gnash&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/gnash/libamf/amf.h?cvsroot=gnash&r1=1.16&r2=1.17
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/log.h?cvsroot=gnash&r1=1.42&r2=1.43
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_object.cpp?cvsroot=gnash&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/gnash/server/edit_text_character.cpp?cvsroot=gnash&r1=1.49&r2=1.50
http://cvs.savannah.gnu.org/viewcvs/gnash/server/movie_root.cpp?cvsroot=gnash&r1=1.52&r2=1.53
http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.218&r2=1.219
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/morph2_character_def.cpp?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/gnash/server/vm/ASHandlers.cpp?cvsroot=gnash&r1=1.78&r2=1.79
http://cvs.savannah.gnu.org/viewcvs/gnash/utilities/processor.cpp?cvsroot=gnash&r1=1.53&r2=1.54

Patches:
Index: configure.ac
===================================================================
RCS file: /sources/gnash/gnash/configure.ac,v
retrieving revision 1.285
retrieving revision 1.286
diff -u -b -r1.285 -r1.286
--- configure.ac        2 Apr 2007 17:22:29 -0000       1.285
+++ configure.ac        3 Apr 2007 16:13:07 -0000       1.286
@@ -15,7 +15,7 @@
 dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 dnl  
 
-dnl $Id: configure.ac,v 1.285 2007/04/02 17:22:29 strk Exp $
+dnl $Id: configure.ac,v 1.286 2007/04/03 16:13:07 bjacques Exp $
 
 AC_PREREQ(2.50)
 AC_INIT(gnash, cvs)
@@ -54,6 +54,28 @@
 
 AC_DISABLE_STATIC dnl Disable building static libs.
 
+
+save_CFLAGS="$CFLAGS";
+CFLAGS="$CFLAGS -Werror -Wformat";
+
+AC_TRY_COMPILE([#include <stdio.h>], [
+  size_t num = 0;
+  printf("%d", num); ],
+  AC_DEFINE(SIZET_FMT, ["%d"], [size_t printf modifier is d])
+)
+AC_TRY_COMPILE([#include <stdio.h>], [
+  size_t num = 0;
+  printf("%u", num); ],
+  AC_DEFINE(SIZET_FMT, ["%u"], [size_t printf modifier is u])
+)
+AC_TRY_COMPILE([#include <stdio.h>], [
+  size_t num = 0;
+  printf("%lu", num); ],
+  AC_DEFINE(SIZET_FMT, ["%lu"], [size_t printf modifier is lu])
+)
+
+CFLAGS="$save_CFLAGS";
+
 AC_ARG_ENABLE(debugger,
   AC_HELP_STRING([--disable-debugger],[Disable the Flash debugger]),
 [case "${enableval}" in

Index: libamf/amf.cpp
===================================================================
RCS file: /sources/gnash/gnash/libamf/amf.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- libamf/amf.cpp      19 Mar 2007 17:11:14 -0000      1.28
+++ libamf/amf.cpp      3 Apr 2007 16:13:07 -0000       1.29
@@ -16,7 +16,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: amf.cpp,v 1.28 2007/03/19 17:11:14 bjacques Exp $ */
+/* $Id: amf.cpp,v 1.29 2007/04/03 16:13:07 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -279,7 +279,7 @@
 /// characters, but for now we just leave them as standard multibyte
 /// characters.
 void *
-AMF::encodeElement(astype_e type, void *in, int nbytes)
+AMF::encodeElement(astype_e type, const void *in, int nbytes)
 {
     GNASH_REPORT_FUNCTION;
 

Index: libamf/amf.h
===================================================================
RCS file: /sources/gnash/gnash/libamf/amf.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- libamf/amf.h        17 Mar 2007 14:14:36 -0000      1.16
+++ libamf/amf.h        3 Apr 2007 16:13:07 -0000       1.17
@@ -179,13 +179,13 @@
     void *swapBytes(void *word, int size);
 
     // encode an element
-    void *encodeElement(astype_e type, void *in, int nbytes);
+    void *encodeElement(astype_e type, const void *in, int nbytes);
     // encode a string
     void *encodeString(char *str)  {
         return encodeElement (STRING, str, strlen(str));
     };
     void *encodeString(std::string &str) {
-        return encodeElement (STRING, (void *)str.c_str(), str.size());
+        return encodeElement (STRING, static_cast<const void *>(str.c_str()), 
str.size());
     };
     // encode a 64 bit number
     void *encodeNumber(amfnum_t num)  {

Index: libbase/log.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/log.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -b -r1.42 -r1.43
--- libbase/log.h       21 Feb 2007 20:22:59 -0000      1.42
+++ libbase/log.h       3 Apr 2007 16:13:07 -0000       1.43
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: log.h,v 1.42 2007/02/21 20:22:59 strk Exp $ */
+/* $Id: log.h,v 1.43 2007/04/03 16:13:07 bjacques Exp $ */
 
 #ifndef GNASH_LOG_H
 #define GNASH_LOG_H
@@ -34,14 +34,6 @@
 #define TIMESTAMP_LENGTH 24             // timestamp length
 #define TIMESTAMP_FORMAT "%Y-%m-%d %H:%M:%S     " // timestamp format
 
-#if SIZEOF_SIZE_T == SIZEOF_INT // try "int" first
-  #define SIZET_FMT "%d"
-#elif SIZEOF_SIZE_T == SIZEOF_LONG
-  #define SIZET_FMT "%ld"
-#elif SIZEOF_SIZE_T == SIZEOF_SHORT
-  #define SIZET_FMT "%hd"
-#endif
-
 namespace gnash {
 
 extern std::ostream& stampon(std::ostream& x);

Index: server/as_object.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_object.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- server/as_object.cpp        29 Mar 2007 14:29:15 -0000      1.46
+++ server/as_object.cpp        3 Apr 2007 16:13:07 -0000       1.47
@@ -389,7 +389,7 @@
 void
 as_object::dump_members() 
 {
-       log_msg("%d Members of object %p follow",
+       log_msg(SIZET_FMT " members of object %p follow",
                _members.size(), (const void*)this);
        _members.dump(*this);
 }

Index: server/edit_text_character.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/edit_text_character.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -b -r1.49 -r1.50
--- server/edit_text_character.cpp      28 Mar 2007 20:38:35 -0000      1.49
+++ server/edit_text_character.cpp      3 Apr 2007 16:13:07 -0000       1.50
@@ -15,7 +15,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 
-/* $Id: edit_text_character.cpp,v 1.49 2007/03/28 20:38:35 strk Exp $ */
+/* $Id: edit_text_character.cpp,v 1.50 2007/04/03 16:13:07 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -926,6 +926,12 @@
 
                        _font = newfont;
                }
+               else
+               {
+                       log_error("Current font has no glyphs and I couldn't"
+                                 " find another font with glyphs... :(");
+               }
+
        }
 
 

Index: server/movie_root.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/movie_root.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -b -r1.52 -r1.53
--- server/movie_root.cpp       2 Apr 2007 17:22:29 -0000       1.52
+++ server/movie_root.cpp       3 Apr 2007 16:13:07 -0000       1.53
@@ -686,7 +686,8 @@
 
 void movie_root::notify_keypress_listeners(key::code k)
 {
-       log_msg("Notifying %u keypress listeners", m_keypress_listeners.size());
+       log_msg("Notifying " SIZET_FMT " keypress listeners", 
+               m_keypress_listeners.size());
        for (ListenerSet::iterator iter = m_keypress_listeners.begin();
                         iter != m_keypress_listeners.end(); ++iter)
        {

Index: server/sprite_instance.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v
retrieving revision 1.218
retrieving revision 1.219
diff -u -b -r1.218 -r1.219
--- server/sprite_instance.cpp  3 Apr 2007 13:43:32 -0000       1.218
+++ server/sprite_instance.cpp  3 Apr 2007 16:13:07 -0000       1.219
@@ -1693,8 +1693,8 @@
        testInvariant();
 
        IF_VERBOSE_ACTION(
-               log_action("Executing %u actions in frame %u/%u"
-                       " of sprite %s",
+               log_action("Executing " SIZET_FMT " actions in frame %u/"
+                       SIZET_FMT " of sprite %s",
                        m_action_list.size(),
                        m_current_frame+1,
                        m_def->get_frame_count(), getTargetPath().c_str());
@@ -2405,7 +2405,8 @@
 void
 sprite_instance::goto_frame(size_t target_frame_number)
 {
-       log_msg("sprite %s ::goto_frame(%d) - current frame is %d",
+       log_msg("sprite %s ::goto_frame(" SIZET_FMT ") - current frame is "
+               SIZET_FMT,
                        getTargetPath().c_str(), target_frame_number, 
m_current_frame);
        assert(! isUnloaded() );
 

Index: server/parser/morph2_character_def.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/morph2_character_def.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- server/parser/morph2_character_def.cpp      26 Feb 2007 10:42:24 -0000      
1.5
+++ server/parser/morph2_character_def.cpp      3 Apr 2007 16:13:07 -0000       
1.6
@@ -355,8 +355,8 @@
 
                IF_VERBOSE_PARSE(
                  log_parse("morph: "
-                         "startShape(paths:%u, edges:%u), "
-                         "endShape(paths:%u, edges:%u)",
+                         "startShape(paths:" SIZET_FMT ", edges:%u), "
+                         "endShape(paths:" SIZET_FMT ", edges:%u)",
                          m_shape1->m_paths.size(), edges_count1,
                          m_shape2->m_paths.size(), edges_count2);
                );
@@ -368,8 +368,8 @@
                if ( m_shape1->m_paths.size() != m_shape2->m_paths.size() )
                {
                        log_swferror("Different number of paths "
-                               "in start (%u) and end (%u) shapes "
-                               "of a morph",
+                               "in start (" SIZET_FMT ") and end (" SIZET_FMT
+                               ") shapes of a morph",
                                m_shape1->m_paths.size(),
                                m_shape2->m_paths.size());
                }

Index: server/parser/movie_def_impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- server/parser/movie_def_impl.cpp    27 Feb 2007 09:10:20 -0000      1.61
+++ server/parser/movie_def_impl.cpp    3 Apr 2007 16:13:07 -0000       1.62
@@ -923,7 +923,7 @@
        if ( ! m_playlist[_frames_loaded].empty() || ! 
m_init_action_list[_frames_loaded].empty() )
        {
                IF_VERBOSE_MALFORMED_SWF(
-               log_swferror("%d action blocks and %d init action blocks are 
NOT followed by"
+               log_swferror(SIZET_FMT " action blocks and " SIZET_FMT " init 
action blocks are NOT followed by"
                        " a SHOWFRAME tag",
                        m_playlist[_frames_loaded].size(),
                        m_init_action_list[_frames_loaded].size());
@@ -1062,8 +1062,8 @@
                if ( loading_frame >= m_frame_count )
                {
                        log_msg("At end of stream, still no '%s' symbol found "
-                               "in m_exports (%u entries in it, follow)",
-                               symbol.c_str(), m_exports.size());
+                               "in m_exports (" SIZET_FMT " entries in it, "
+                               "follow)", symbol.c_str(), m_exports.size());
                        return res;
                }
 

Index: server/vm/ASHandlers.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/vm/ASHandlers.cpp,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -b -r1.78 -r1.79
--- server/vm/ASHandlers.cpp    30 Mar 2007 07:23:19 -0000      1.78
+++ server/vm/ASHandlers.cpp    3 Apr 2007 16:13:07 -0000       1.79
@@ -14,7 +14,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
-/* $Id: ASHandlers.cpp,v 1.78 2007/03/30 07:23:19 strk Exp $ */
+/* $Id: ASHandlers.cpp,v 1.79 2007/04/03 16:13:07 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1657,11 +1657,11 @@
                IF_VERBOSE_ACTION (
                if ( type == pushDict8 || type == pushDict16 )
                {
-                       log_action("\t%d) type=%s (%d), value=%s", count, 
pushType[type], id, env.top(0).to_debug_string().c_str());
+                       log_action("\t" SIZET_FMT ") type=%s (%d), value=%s", 
count, pushType[type], id, env.top(0).to_debug_string().c_str());
                }
                else
                {
-                       log_action("\t%d) type=%s, value=%s", count, 
pushType[type], env.top(0).to_debug_string().c_str());
+                       log_action("\t" SIZET_FMT ") type=%s, value=%s", count, 
pushType[type], env.top(0).to_debug_string().c_str());
                }
                ++count;
                );
@@ -3191,8 +3191,8 @@
                IF_VERBOSE_MALFORMED_SWF(
                        log_swferror("function2 code len (%u) "
                                "overflows DOACTION tag boundaries "
-                               "(DOACTION tag len=%u, "
-                               "function2 code offset=%u). "
+                               "(DOACTION tag len=" SIZET_FMT
+                               ", function2 code offset=" SIZET_FMT "). "
                                "Forcing code len to eat the whole buffer "
                                "(would this work?).",
                                code_size, actionbuf_size, thread.next_pc);

Index: utilities/processor.cpp
===================================================================
RCS file: /sources/gnash/gnash/utilities/processor.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- utilities/processor.cpp     15 Mar 2007 22:39:54 -0000      1.53
+++ utilities/processor.cpp     3 Apr 2007 16:13:07 -0000       1.54
@@ -15,7 +15,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 // 
 
-/* $Id: processor.cpp,v 1.53 2007/03/15 22:39:54 strk Exp $ */
+/* $Id: processor.cpp,v 1.54 2007/04/03 16:13:07 bjacques Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -344,7 +344,7 @@
        ++nadvances;
        if ( limit_advances && nadvances >= limit_advances)
        {
-               printf("exiting after %d advances\n", nadvances);
+               printf("exiting after " SIZET_FMT " advances\n", nadvances);
                break;
        }
 
@@ -355,7 +355,8 @@
        {
                if ( allowed_end_hits && ++end_hitcount >= allowed_end_hits )
                {
-                       printf("exiting after %d times last frame was 
reached\n", end_hitcount);
+                       printf("exiting after " SIZET_FMT 
+                              " times last frame was reached\n", end_hitcount);
                        break;
                }
        }




reply via email to

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