gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r9887: Silence compiler warnings and


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9887: Silence compiler warnings and verbose debugging messages.
Date: Wed, 01 Oct 2008 15:34:58 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9887
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2008-10-01 15:34:58 +0200
message:
  Silence compiler warnings and verbose debugging messages.
modified:
  libcore/asobj/XMLSocket_as.cpp
  libcore/character.cpp
  libcore/matrix.cpp
    ------------------------------------------------------------
    revno: 9886.1.1
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2008-10-01 09:30:48 +0200
    message:
      Drop or comment out debugging.
    modified:
      libcore/character.cpp
    ------------------------------------------------------------
    revno: 9886.1.2
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2008-10-01 09:54:38 +0200
    message:
      Fix warnings by casting to size_t. The number can never be negative, so 
it's
      not a problem.
    modified:
      libcore/asobj/XMLSocket_as.cpp
    ------------------------------------------------------------
    revno: 9886.1.3
    committer: Benjamin Wolsey <address@hidden>
    branch nick: work
    timestamp: Wed 2008-10-01 09:59:20 +0200
    message:
      Silence debug logging.
    modified:
      libcore/matrix.cpp
=== modified file 'libcore/asobj/XMLSocket_as.cpp'
--- a/libcore/asobj/XMLSocket_as.cpp    2008-09-28 20:20:51 +0000
+++ b/libcore/asobj/XMLSocket_as.cpp    2008-10-01 07:54:38 +0000
@@ -160,8 +160,8 @@
         return;
     }
 
-    fd_set                fdset;
-    struct timeval        tval;
+    fd_set fdset;
+    struct timeval tval;
     size_t retries = 10;
 
     const int bufSize = 10000;
@@ -193,7 +193,7 @@
 
         const size_t bytesRead = read(_sockfd, buf.get(), bufSize - 1);
 
-       // Return if there's no data.
+        // Return if there's no data.
         if (!bytesRead) return;
 
         if (buf[bytesRead - 1] != 0)
@@ -204,13 +204,15 @@
         }
 
         char* ptr = buf.get();
-        while (ptr - buf.get() < bytesRead - 1)
+        while (static_cast<size_t>(ptr - buf.get()) < bytesRead - 1)
         {
             log_debug ("read: %d, this string ends: %d",
                            bytesRead, ptr + std::strlen(ptr) - buf.get());
             // If the string reaches to the final byte read, it's
-            // incomplete. Store it and continue. 
-            if (ptr + std::strlen(ptr) - buf.get() == bytesRead)
+            // incomplete. Store it and continue. The buffer is 
+            // NULL-terminated, so this cannot read past the end.
+            if (static_cast<size_t>(
+                ptr + std::strlen(ptr) - buf.get()) == bytesRead)
             {
                 log_debug ("Setting remainder");
                 _remainder += std::string(ptr);

=== modified file 'libcore/character.cpp'
--- a/libcore/character.cpp     2008-09-30 21:38:48 +0000
+++ b/libcore/character.cpp     2008-10-01 07:30:48 +0000
@@ -565,7 +565,7 @@
         double xscale = _xscale / 100.0;
         double rotation = _rotation * PI / 180.0;
 
-        log_debug("setting yscale from %g to %g", _yscale, yscale*100);
+        //log_debug("setting yscale from %g to %g", _yscale, yscale*100);
 
         matrix m = get_matrix();
         m.set_scale_rotation(xscale, yscale, rotation);
@@ -826,9 +826,8 @@
     {
         if (scale_percent * _xscale < 0.0)
         {
-            log_debug("Flipping x scale (%d, %d)", scale_percent, _xscale);
             xscale = -std::abs(xscale);
-         }
+        }
         else xscale = std::abs(xscale);
     }
 
@@ -904,12 +903,10 @@
     {
         if (scale_percent * _yscale < 0.0)
         {
-            log_debug("Flipping y scale (%d, %d)", scale_percent, _yscale);
             yscale = -std::abs(yscale);
         }
         else yscale = std::abs(yscale);
     }
-    //log_debug("yscale factor: %d, old percent: %d", yscale, _yscale);
 
        _yscale = scale_percent;
 

=== modified file 'libcore/matrix.cpp'
--- a/libcore/matrix.cpp        2008-09-30 22:17:43 +0000
+++ b/libcore/matrix.cpp        2008-10-01 07:59:20 +0000
@@ -196,9 +196,6 @@
     shy = -DoubleToFixed16(yscale * std::sin(rot_y));
     sy  =  DoubleToFixed16(yscale * std::cos(rot_y));
 
-    log_debug("yscale %d, shy: %d, sy: %d", yscale, shy, sy);
-
-
 #else
     double angle = get_rotation();
     double cos_v = cos(angle);


reply via email to

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