gnash-dev
[Top][All Lists]
Advanced

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

[Gnash-dev] [patch] Final (?) compiler warning fixes


From: Petter Reinholdtsen
Subject: [Gnash-dev] [patch] Final (?) compiler warning fixes
Date: Thu, 30 Mar 2006 10:42:46 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (usg-unix-v)

There is a build error now in utilities/, as the mad library isn't
linked into the binaries.  This patch fixes that problem:

Index: utilities/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/utilities/Makefile.am,v
retrieving revision 1.15
diff -u -3 -p -u -r1.15 Makefile.am
--- utilities/Makefile.am       30 Mar 2006 01:52:00 -0000      1.15
+++ utilities/Makefile.am       30 Mar 2006 08:36:03 -0000
@@ -40,7 +40,8 @@ AM_LDFLAGS = \
         $(LIBXML_LIBS)         \
         $(OPENGL_LIBS)         \
        $(GLEXT_LIBS)           \
-       $(GTK2_LIBS)
+       $(GTK2_LIBS)            \
+       $(MP3_LIBS)
 
 INCLUDES = -I.. \
         -I$(top_srcdir)                \

Then there are a few signed/unsigned compares that should be rewritten
to use unsigned on both sides:

Index: libgeometry/kd_tree_packed.cpp
===================================================================
RCS file: /sources/gnash/gnash/libgeometry/kd_tree_packed.cpp,v
retrieving revision 1.3
diff -u -3 -p -u -r1.3 kd_tree_packed.cpp
--- libgeometry/kd_tree_packed.cpp      24 Feb 2006 00:06:21 -0000      1.3
+++ libgeometry/kd_tree_packed.cpp      30 Mar 2006 08:36:02 -0000
@@ -190,7 +190,7 @@ struct kd_node
        {
                if (has_pos_child())
                {
-                       int offset = (m_flags[1]) + (m_flags[2] << 8) + 
(m_flags[3] << 16);
+                       unsigned int offset = (m_flags[1]) + (m_flags[2] << 8) 
+ (m_flags[3] << 16);
                        assert(offset >= sizeof(kd_node));      // sanity check
 
                        return (kd_node*) (((uint8*) this) + offset);
Index: server/sound_handler_mp3.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/sound_handler_mp3.cpp,v
retrieving revision 1.5
diff -u -3 -p -u -r1.5 sound_handler_mp3.cpp
--- server/sound_handler_mp3.cpp        25 Feb 2006 11:20:31 -0000      1.5
+++ server/sound_handler_mp3.cpp        30 Mar 2006 08:36:02 -0000
@@ -194,13 +194,13 @@ void convert_mp3_data(Sint16 **adjusted_
                *adjusted_data = (Sint16*) p;
                *adjusted_size = total * sizeof(Sint16);
                // stuff all that crap together
-               {for (int i=0; i<out.size(); ++i)
+               {for (unsigned int i=0; i<out.size(); ++i)
                        p = out[i]->collate(p,stereo);
                }
        }
 
 cleanup:
-       {for (int i=0; i<out.size(); ++i) delete out[i]; }
+       {for (unsigned int i=0; i<out.size(); ++i) delete out[i]; }
        mad_synth_finish(&synth);
        mad_frame_finish(&frame);
        mad_stream_finish(&stream);

There is also an uninitialized value being printed to the log:

Index: server/xml.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/xml.cpp,v
retrieving revision 1.16
diff -u -3 -p -u -r1.16 xml.cpp
--- server/xml.cpp      11 Mar 2006 19:24:27 -0000      1.16
+++ server/xml.cpp      30 Mar 2006 08:36:02 -0000
@@ -844,7 +844,7 @@ XML::stringify(XMLNode *xml)
 {
     int           child;
     unsigned int  i;
-    const char    *nodename;
+    const char    *nodename =     xml->nodeName();;
     int           length;
     string       str;
     
Ah, and a leftover const cast issue:

Index: server/shape.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/shape.cpp,v
retrieving revision 1.11
diff -u -3 -p -u -r1.11 shape.cpp
--- server/shape.cpp    29 Mar 2006 05:42:41 -0000      1.11
+++ server/shape.cpp    30 Mar 2006 08:36:02 -0000
@@ -1232,8 +1232,8 @@ void      shape_character_def::display(
 
 static int     sort_by_decreasing_error(const void* A, const void* B)
 {
-    const mesh_set*    a = *(const mesh_set**) A;
-    const mesh_set*    b = *(const mesh_set**) B;
+    const mesh_set*    a = *(const mesh_set* const *) A;
+    const mesh_set*    b = *(const mesh_set* const *) B;
 
     if (a->get_error_tolerance() < b->get_error_tolerance()) {
        return 1;

I believe that fixes all the warnings about other things than unused
variables.  I'll check when these fixes get committed if there are any
leftover patches in my CVS tree. :)

Friendly,
-- 
Petter Reinholdtsen




reply via email to

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