From a2e9c6ca82c7ccfe1bd3d8d76c2c3aa4189f4d41 Mon Sep 17 00:00:00 2001 From: Benjamin Wolsey Date: Tue, 10 Jul 2012 18:20:39 +0000 Subject: Fix binding error --- diff --git a/libcore/asobj/AsBroadcaster.cpp b/libcore/asobj/AsBroadcaster.cpp index ef0ca3e..198f325 100644 --- a/libcore/asobj/AsBroadcaster.cpp +++ b/libcore/asobj/AsBroadcaster.cpp @@ -127,7 +127,7 @@ private: /// Name of the event being broadcasted /// appropriately cased based on SWF version /// of the current VM - const ObjectURI& _eventURI; + const ObjectURI _eventURI; /// Number of event dispatches size_t _dispatched; -- cgit v0.9.0.2 From 0652068222b1cabf3044489c65e9dded445e5552 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 26 Mar 2012 15:20:16 +0000 Subject: use time_t instead of size_t for time. This eliminates the compiler narrowing warning. --- diff --git a/libbase/GnashSleep.h b/libbase/GnashSleep.h index ab4b372..46effce 100644 --- a/libbase/GnashSleep.h +++ b/libbase/GnashSleep.h @@ -32,12 +32,12 @@ namespace gnash { /// Sleep compatibly for the specified number of microseconds // /// @param useconds microseconds to sleep. -inline void gnashSleep(size_t useconds) +inline void gnashSleep(time_t useconds) { #if defined(_WIN32) || defined(WIN32) Sleep(useconds / 1000); #else - const size_t m = 1000000; + const time_t m = 1000000; const struct timespec t = { useconds / m, (useconds % m) * 1000 }; ::nanosleep(&t, 0); #endif -- cgit v0.9.0.2 From 941e9a6a32e7394c76ceeba84ad5eed03b0c98cd Mon Sep 17 00:00:00 2001 From: Bastiaan Jacques Date: Sun, 29 Apr 2012 13:53:16 +0000 Subject: Fixing access to a private member; even though GCC accepts this (See GCC #41437), Clang does not. --- diff --git a/libcore/swf/DefineButtonTag.h b/libcore/swf/DefineButtonTag.h index 7e1281c..9910e06 100644 --- a/libcore/swf/DefineButtonTag.h +++ b/libcore/swf/DefineButtonTag.h @@ -157,8 +157,6 @@ public: return (_conditions & KEYPRESS); } -private: - /// Return the keycode triggering this action // /// Return 0 if no key is supposed to trigger us @@ -166,6 +164,8 @@ private: return (_conditions & KEYPRESS) >> 9; } +private: + enum Condition { IDLE_TO_OVER_UP = 1 << 0, -- cgit v0.9.0.2 From 2f7a683cc61c8911d12828041c81b2fa1704036d Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 26 Mar 2012 16:32:31 +0000 Subject: add const to cast to drop compiler warning. --- diff --git a/libcore/asobj/NetConnection_as.cpp b/libcore/asobj/NetConnection_as.cpp index 6cf9607..3d56a69 100644 --- a/libcore/asobj/NetConnection_as.cpp +++ b/libcore/asobj/NetConnection_as.cpp @@ -882,7 +882,7 @@ handleAMFInvoke(amf::Reader& rd, const boost::uint8_t*& b, if (b + namelength > end) { throw amf::AMFException("Invoke buffer too short"); } - std::string headerName((char*)b, namelength); + std::string headerName((const char*)b, namelength); #ifdef GNASH_DEBUG_REMOTING log_debug("Invoke name %s", headerName); -- cgit v0.9.0.2 From 57a4e9c2c32202cd8625a807f7bd5f55e4bf8933 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 26 Mar 2012 21:47:13 +0000 Subject: cast 0 so comparisons with pointers doesn't generate a compiler warning --- diff --git a/cygnal/libamf/element.cpp b/cygnal/libamf/element.cpp index 692161f..81d131d 100644 --- a/cygnal/libamf/element.cpp +++ b/cygnal/libamf/element.cpp @@ -481,7 +481,7 @@ Element::encode(bool notobject) if (!notobject) { *buf = Element::OBJECT_AMF0; } - if (_name > 0) { + if (_name > static_cast(0)) { size_t length = getNameSize(); boost::uint16_t enclength = length; swapBytes(&enclength, 2); diff --git a/cygnal/libamf/lcshm.cpp b/cygnal/libamf/lcshm.cpp index 5fdb8db..70558d6 100644 --- a/cygnal/libamf/lcshm.cpp +++ b/cygnal/libamf/lcshm.cpp @@ -516,7 +516,7 @@ LcShm::connect(const string& names) return false; } - if (SharedMem::begin() <= 0) { + if (SharedMem::begin() <= static_cast(0)) { log_error(_("Failed to open shared memory segment: \"%s\""), names.c_str()); return false; } @@ -557,7 +557,7 @@ LcShm::connect(key_t key) return false; } - if (SharedMem::begin() <= 0) { + if (SharedMem::begin() <= static_cast(0)) { log_error(_("Failed to open shared memory segment: 0x%x"), key); return false; } diff --git a/cygnal/libnet/network.cpp b/cygnal/libnet/network.cpp index 12f08c8..050aa0b 100644 --- a/cygnal/libnet/network.cpp +++ b/cygnal/libnet/network.cpp @@ -564,7 +564,7 @@ Network::createClient(const string &hostname, short port) } const struct hostent *hent = ::gethostbyname(hostname.c_str()); - if (hent > 0) { + if (hent > static_cast< const struct hostent *>(0)) { ::memcpy(&sock_in.sin_addr, hent->h_addr, hent->h_length); } sock_in.sin_family = AF_INET; diff --git a/utilities/soldumper.cpp b/utilities/soldumper.cpp index b78168d..68f12f0 100644 --- a/utilities/soldumper.cpp +++ b/utilities/soldumper.cpp @@ -173,7 +173,7 @@ main(int argc, char *argv[]) entry = readdir(library_dir); } if (library_dir != NULL) { - for (i=0; entry>0; i++) { + for (i=0; entry>static_cast(0); i++) { entry = readdir(library_dir); if (entry != NULL) { //string::size_type pos; -- cgit v0.9.0.2 From b2e83be5822c46beb694d5a98cffabf132343e8f Mon Sep 17 00:00:00 2001 From: Steve Grubb Date: Sun, 11 Mar 2012 17:34:28 +0000 Subject: fix descriptor leaks --- diff --git a/gui/fb/fb.cpp b/gui/fb/fb.cpp index 6c33630..f5020da 100644 --- a/gui/fb/fb.cpp +++ b/gui/fb/fb.cpp @@ -553,6 +553,7 @@ FBGui::disable_terminal() if (ioctl(fd, VT_GETSTATE, &vts) == -1) { log_error(_("Could not get current VT state")); close(_fd); + close(fd); return false; } @@ -674,6 +675,7 @@ FBGui::enable_terminal() if (ioctl(fd, VT_ACTIVATE, _original_vt)) { log_error(_("Could not activate VT number %d"), _original_vt); close(_fd); + close(fd); return false; } -- cgit v0.9.0.2