gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-


From: Bastiaan Jacques
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2098-g8d97158
Date: Mon, 02 Jun 2014 00:07:45 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  8d97158535322b57251b625a863a8d7bdb289109 (commit)
       via  cf16ac435fa4d5d1f5cf47534d1e51fbb76ab055 (commit)
       via  737ca78ac329fde9232a3088c1b0ba000ef2bdaa (commit)
       via  4892e1fcd90df77236d2fb6690316ee035125efd (commit)
       via  58ba55dd0428196726ff94e62b43a042149c23a6 (commit)
       via  850f6f13f8c50f0f95c2ee3543a99f105d07db0a (commit)
      from  36b1a2fd4fa3a4a6f7e1aa7d80a2e8ec924aed74 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=8d97158535322b57251b625a863a8d7bdb289109


commit 8d97158535322b57251b625a863a8d7bdb289109
Author: Bastiaan Jacques <address@hidden>
Date:   Mon Jun 2 01:24:50 2014 +0200

    Make sure the MediaFactory singleton really is a singleton.
    
    GnashFactory singletons aren't guaranteed to be singletons,
    because the compiler creates a fresh template instance whenever
    a template is fully specified. This is normally resolved at link
    time for (at least for templated function with local statics),
    when GCC chucks out all but one instantiation of the template
    class.
    
    Unfortunately this doesn't work with Clang, which happily creates
    two instances, one for each DSO that instantiates the template, I
    suspect, and the ambiguity is not resolved by the linker.
    
    We now explicitly instantiate the template class in
    MediaHandler.cpp, which is made possible by C++11's extern
    template.
    
    With this change, all tests that rely on a working media handler
    now pass with a Clang-built Gnash.

diff --git a/libmedia/MediaHandler.cpp b/libmedia/MediaHandler.cpp
index aecf39c..9b08248 100644
--- a/libmedia/MediaHandler.cpp
+++ b/libmedia/MediaHandler.cpp
@@ -35,6 +35,12 @@
 #endif
 
 namespace gnash {
+    // Instantiate MediaFactory here.
+    template class GnashFactory<media::MediaHandler, 
media::RegisterAllHandlers,
+        std::string>;
+}
+
+namespace gnash {
 namespace media {
 
 bool
diff --git a/libmedia/MediaHandler.h b/libmedia/MediaHandler.h
index 3dd5b7b..cf0465b 100644
--- a/libmedia/MediaHandler.h
+++ b/libmedia/MediaHandler.h
@@ -28,10 +28,11 @@
 #include <memory>
 #include <string>
 
+#include "GnashFactory.h"
+
 // Forward declarations
 namespace gnash {
     class IOChannel;
-    template<typename T, typename Init, typename Key> class GnashFactory;
     namespace media {
         class VideoDecoder;
         class AudioDecoder;
@@ -170,6 +171,13 @@ protected:
 
 
 } // gnash.media namespace 
+
+// In order for GnashFactory to work correctly, there must be only a single
+// instantiation of MediaFactory. Therefore, we declare its type as extern,
+// which we can now that its dependent types are fully specified.
+extern template class GnashFactory<media::MediaHandler,
+    media::RegisterAllHandlers, std::string>; // I.e., typedef MediaFactory.
+
 } // namespace gnash
 
 #endif 

http://git.savannah.gnu.org/cgit//commit/?id=cf16ac435fa4d5d1f5cf47534d1e51fbb76ab055


commit cf16ac435fa4d5d1f5cf47534d1e51fbb76ab055
Author: Bastiaan Jacques <address@hidden>
Date:   Mon Jun 2 01:11:10 2014 +0200

    Don't register Gstreamer and Haiku media handlers.
    
    This is already done in MediaHandler.cpp. Presumably these were
    forgotten when similar registration code was removed for ffmpeg in
    79db04c4b964.

diff --git a/libmedia/gst/MediaHandlerGst.cpp b/libmedia/gst/MediaHandlerGst.cpp
index 60e43c8..21613eb 100644
--- a/libmedia/gst/MediaHandlerGst.cpp
+++ b/libmedia/gst/MediaHandlerGst.cpp
@@ -186,12 +186,6 @@ MediaHandlerGst::cameraNames(std::vector<std::string>& 
names) const
     VideoInputGst::getNames(names);
 }
 
-#ifdef REGISTER_MEDIA_HANDLERS
-namespace {
-    MediaFactory::RegisterHandler<MediaHandlerGst> reg("gst");
-}
-#endif
-
 } // gnash.media.gst namespace
 } // gnash.media namespace 
 } // gnash namespace
diff --git a/libmedia/haiku/MediaHandlerHaiku.cpp 
b/libmedia/haiku/MediaHandlerHaiku.cpp
index 4172cad..0d0259e 100644
--- a/libmedia/haiku/MediaHandlerHaiku.cpp
+++ b/libmedia/haiku/MediaHandlerHaiku.cpp
@@ -148,12 +148,6 @@ MediaHandlerHaiku::cameraNames(std::vector<std::string>& 
/*names*/) const
 ////    return FF_INPUT_BUFFER_PADDING_SIZE;
 //}
 
-#ifdef REGISTER_MEDIA_HANDLERS
-namespace {
-    MediaFactory::RegisterHandler<MediaHandlerHaiku> reg("haiku");
-}
-#endif
-
 } // gnash.media.haiku namespace 
 } // gnash.media namespace 
 } // gnash namespace

http://git.savannah.gnu.org/cgit//commit/?id=737ca78ac329fde9232a3088c1b0ba000ef2bdaa


commit 737ca78ac329fde9232a3088c1b0ba000ef2bdaa
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Jun 1 22:21:54 2014 +0200

    Remove unused headers.

diff --git a/libcore/SWFCxForm.h b/libcore/SWFCxForm.h
index 81be5e6..74ccbae 100644
--- a/libcore/SWFCxForm.h
+++ b/libcore/SWFCxForm.h
@@ -21,7 +21,6 @@
 
 #include "dsodefs.h" // for DSOEXPORT
 
-#include <string>
 #include <iosfwd>
 #include <cstdint>
 
diff --git a/libcore/swf/DefinitionTag.h b/libcore/swf/DefinitionTag.h
index 6ab5300..77556e2 100644
--- a/libcore/swf/DefinitionTag.h
+++ b/libcore/swf/DefinitionTag.h
@@ -20,7 +20,6 @@
 #define GNASH_DEFINITION_TAG_H
 
 
-#include <boost/noncopyable.hpp>
 #include <cstdint>
 
 #include "ControlTag.h"
diff --git a/libcore/swf/SoundStreamHeadTag.h b/libcore/swf/SoundStreamHeadTag.h
index 0a2ce78..f3de563 100644
--- a/libcore/swf/SoundStreamHeadTag.h
+++ b/libcore/swf/SoundStreamHeadTag.h
@@ -20,8 +20,6 @@
 #define GNASH_SWF_SOUNDSTREAMHEAD_TAG_H
 
 
-#include <cstdint>
- 
 #include "SWF.h"
 
 // Forward declarations

http://git.savannah.gnu.org/cgit//commit/?id=4892e1fcd90df77236d2fb6690316ee035125efd


commit 4892e1fcd90df77236d2fb6690316ee035125efd
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Jun 1 21:46:30 2014 +0200

    A few more range-based loops.

diff --git a/libmedia/gst/VideoInputGst.cpp b/libmedia/gst/VideoInputGst.cpp
index caa0d82..86bbf49 100644
--- a/libmedia/gst/VideoInputGst.cpp
+++ b/libmedia/gst/VideoInputGst.cpp
@@ -283,8 +283,7 @@ VideoInputGst::getNames(std::vector<std::string>& names)
     // Check for devices
     findVidDevs(cams);
     
-    for (size_t i = 0; i < cams.size(); ++i) {
-        GnashWebcam* cam = cams[i];
+    for (GnashWebcam* cam : cams) {
         if (cam) names.push_back(cam->getProductName());
     }
 }
diff --git a/librender/agg/Renderer_agg.cpp b/librender/agg/Renderer_agg.cpp
index fec2649..46113b2 100644
--- a/librender/agg/Renderer_agg.cpp
+++ b/librender/agg/Renderer_agg.cpp
@@ -1575,9 +1575,7 @@ public:
     agg::path_storage path; 
     agg::conv_curve<agg::path_storage> curve(path);
 
-    for (size_t pno=0, pcount=paths.size(); pno < pcount; ++pno) {
-
-      const Path& this_path = paths[pno];
+    for (const Path& this_path : paths) {
 
       path.remove_all();
       

http://git.savannah.gnu.org/cgit//commit/?id=58ba55dd0428196726ff94e62b43a042149c23a6


commit 58ba55dd0428196726ff94e62b43a042149c23a6
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Jun 1 21:05:18 2014 +0200

    Use range-based for loops here and there.

diff --git a/gui/ScreenShotter.cpp b/gui/ScreenShotter.cpp
index 4acaeb7..587b9bd 100644
--- a/gui/ScreenShotter.cpp
+++ b/gui/ScreenShotter.cpp
@@ -47,12 +47,12 @@ typeFromFileName(const std::string& filename)
             { ".jpeg", GNASH_FILETYPE_JPEG }
         };
     
-    for (size_t i = 0; i < 3; ++i) {
-        const char* ext = matches[i].ext;
+    for (const auto& match : matches) {
+        const char* ext = match.ext;
         const std::string::size_type pos = filename.rfind(ext);
         if (pos != std::string::npos &&
                 pos + std::strlen(ext) == filename.size()) {
-            return matches[i].type;
+            return match.type;
         }
     }
     return GNASH_FILETYPE_PNG;
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 13691a3..b248926 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -1148,10 +1148,10 @@ Gui::getMovieInfo() const
     _stage->gc().countCollectables(cc);
     
     const std::string lbl = "GC managed ";
-    for (GC::CollectablesCount::iterator i=cc.begin(), e=cc.end(); i!=e; ++i) {
-        const std::string& typ = i->first;
+    for (auto& countinfo : cc) {
+        const std::string& typ = countinfo.first;
         std::ostringstream ss;
-        ss << i->second;
+        ss << countinfo.second;
         firstLevelIter = tr->append_child(topIter,
                     std::make_pair(lbl + typ, ss.str()));
     }
@@ -1240,8 +1240,8 @@ Gui::fpsCounterTick()
 void
 Gui::addFlashVars(Gui::VariableMap& from)
 {
-    for (VariableMap::iterator i=from.begin(), ie=from.end(); i!=ie; ++i) {
-        _flashVars[i->first] = i->second;
+    for (auto& variable : from) {
+        _flashVars[variable.first] = variable.second;
     }
 }
 
diff --git a/libbase/GC.cpp b/libbase/GC.cpp
index 23c4fb5..1974bf1 100644
--- a/libbase/GC.cpp
+++ b/libbase/GC.cpp
@@ -131,9 +131,8 @@ GC::runCycle()
 void
 GC::countCollectables(CollectablesCount& count) const
 {
-    for (ResList::const_iterator i = _resList.begin(), e = _resList.end();
-            i!=e; ++i) {
-        ++count[typeName(**i)];
+    for (const GcResource* resource : _resList) {
+        ++count[typeName(*resource)];
     }
 }
 
diff --git a/libbase/NetworkAdapter.cpp b/libbase/NetworkAdapter.cpp
index 9da32a6..f7b060e 100644
--- a/libbase/NetworkAdapter.cpp
+++ b/libbase/NetworkAdapter.cpp
@@ -984,12 +984,11 @@ CurlStreamFile::CurlStreamFile(const std::string& url, 
const std::string& vars,
     assert ( ! _customHeaders );
     _customHeaders = curl_slist_append(_customHeaders, "Expect:");
 
-    for (NetworkAdapter::RequestHeaders::const_iterator i = headers.begin(),
-            e = headers.end(); i != e; ++i) {
+    for (const auto& header : headers) {
         // Check here to see whether header name is allowed.
-        if (!NetworkAdapter::isHeaderAllowed(i->first)) continue;
+        if (!NetworkAdapter::isHeaderAllowed(header.first)) continue;
         std::ostringstream os;
-        os << i->first << ": " << i->second;
+        os << header.first << ": " << header.second;
         _customHeaders = curl_slist_append(_customHeaders, os.str().c_str());
     }
 
diff --git a/libbase/URLAccessManager.cpp b/libbase/URLAccessManager.cpp
index 43b58f1..a6c31d5 100644
--- a/libbase/URLAccessManager.cpp
+++ b/libbase/URLAccessManager.cpp
@@ -160,10 +160,8 @@ local_check(const std::string& path, const URL& baseUrl)
     typedef RcInitFile::PathList PathList;
     const PathList& sandbox = rcfile.getLocalSandboxPath();
 
-    for (PathList::const_iterator i=sandbox.begin(), e=sandbox.end();
-            i!=e; ++i)
+    for (const std::string& dir : sandbox)
     {
-        const std::string& dir = *i;
         if ( pathIsUnderDir(path, dir) ) 
         {
             log_security(_("Load of file %s granted (under local sandbox %s)"),
diff --git a/libbase/arg_parser.cpp b/libbase/arg_parser.cpp
index d60febf..3589553 100644
--- a/libbase/arg_parser.cpp
+++ b/libbase/arg_parser.cpp
@@ -154,9 +154,9 @@ Arg_parser::Arg_parser( const int argc, const char * const 
argv[],
     if(! _error.empty() ) {
         data.clear();
     } else {
-        for( unsigned int i = 0; i < non_options.size(); ++i ) {
+        for(auto& non_option : non_options) {
             data.push_back( Record() );
-            data.back().argument.swap( non_options[i] );
+            data.back().argument.swap( non_option );
         }
         while( argind < argc ) {
             data.push_back( Record() );
diff --git a/libbase/log.cpp b/libbase/log.cpp
index 870e10e..c74cd5c 100644
--- a/libbase/log.cpp
+++ b/libbase/log.cpp
@@ -55,18 +55,17 @@ hexify(const unsigned char *p, size_t length, bool ascii)
     // For hex output, fill single-digit numbers with a leading 0.
     if (!ascii) ss << std::hex << std::setfill('0');
     
-    for (std::vector<unsigned char>::const_iterator i = bytes.begin(),
-            e = bytes.end(); i != e; ++i)
+    for (const unsigned char& byte : bytes)
         {
         if (ascii) {
-            if (std::isprint(*i) || *i == 0xd) {
-                ss << *i;
+            if (std::isprint(byte) || byte == 0xd) {
+                ss << byte;
             }
             else ss << ".";
         }
         else  {
             // Not ascii
-            ss << std::setw(2) << static_cast<int>(*i) << " ";    
+            ss << std::setw(2) << static_cast<int>(byte) << " ";    
         }
     }    
     
diff --git a/libbase/snappingrange.h b/libbase/snappingrange.h
index d265190..603a3e7 100644
--- a/libbase/snappingrange.h
+++ b/libbase/snappingrange.h
@@ -451,8 +451,8 @@ public:
         
         // update ourselves with the union of the "list"
         setNull();
-        for (size_type lno=0, lcount=list.size(); lno<lcount; lno++) {
-            add(list[lno]);
+        for (auto& range : list) {
+            add(range);
         }
                             
     }
diff --git a/libcore/Button.cpp b/libcore/Button.cpp
index 3c8d1f8..6487fff 100644
--- a/libcore/Button.cpp
+++ b/libcore/Button.cpp
@@ -369,9 +369,8 @@ Button::display(Renderer& renderer, const Transform& base)
     // TODO: by keeping chars sorted by depth we'd avoid the sort on display
     std::sort(actChars.begin(), actChars.end(), charDepthLessThen);
 
-    for (DisplayObjects::iterator it = actChars.begin(), e = actChars.end();
-            it != e; ++it) {
-        (*it)->display(renderer, xform);
+    for (auto& actChar : actChars) {
+        actChar->display(renderer, xform);
     }
 
     clear_invalidated();
@@ -799,9 +798,9 @@ Button::construct(as_object* initObj)
     // Instantiate the hit DisplayObjects
     ActiveRecords hitChars;
     get_active_records(hitChars, MOUSESTATE_HIT);
-    for (ActiveRecords::iterator i=hitChars.begin(),e=hitChars.end(); i!=e; 
++i)
+    for (const auto& hitChar : hitChars)
     {
-        const SWF::ButtonRecord& rec = _def->buttonRecords()[*i];
+        const SWF::ButtonRecord& rec = _def->buttonRecords()[hitChar];
 
         // These should not be named!
         DisplayObject* ch = rec.instantiate(this, false);
@@ -819,10 +818,8 @@ Button::construct(as_object* initObj)
     ActiveRecords upChars;
     get_active_records(upChars, MOUSESTATE_UP);
 
-    for (ActiveRecords::iterator i = upChars.begin(), e=upChars.end();
-            i != e; ++i)
+    for (auto rno : upChars)
     {
-        int rno = *i;
         const SWF::ButtonRecord& rec = _def->buttonRecords()[rno];
 
         DisplayObject* ch = rec.instantiate(this);
@@ -847,10 +844,8 @@ Button::markOwnResources() const
 {
 
     // Mark state DisplayObjects as reachable
-    for (DisplayObjects::const_iterator i = _stateCharacters.begin(),
-            e = _stateCharacters.end(); i != e; ++i)
+    for (DisplayObject* ch : _stateCharacters)
     {
-        DisplayObject* ch = *i;
         if (ch) ch->setReachable();
     }
 
@@ -867,10 +862,8 @@ Button::unloadChildren()
 
     // We need to unload all children, or the global instance list
     // will keep growing forever !
-    for (DisplayObjects::iterator i = _stateCharacters.begin(),
-            e = _stateCharacters.end(); i != e; ++i)
+    for (DisplayObject* ch : _stateCharacters)
     {
-        DisplayObject* ch = *i;
         if (!ch || ch->unloaded()) continue;
         if (ch->unload()) childsHaveUnload = true;
     }
@@ -891,9 +884,7 @@ Button::destroy()
 {
     stage().removeButton(this);
 
-    for (DisplayObjects::iterator i = _stateCharacters.begin(),
-            e=_stateCharacters.end(); i != e; ++i) {
-        DisplayObject* ch = *i;
+    for (DisplayObject* ch : _stateCharacters) {
         if (!ch || ch->isDestroyed()) continue;
         ch->destroy();
     }
diff --git a/libcore/DisplayList.cpp b/libcore/DisplayList.cpp
index bcb967e..0604186 100644
--- a/libcore/DisplayList.cpp
+++ b/libcore/DisplayList.cpp
@@ -119,10 +119,7 @@ DisplayList::getNextHighestDepth() const
     testInvariant();
 
     int nexthighestdepth=0;
-    for (const_iterator it = _charsByDepth.begin(),
-            itEnd = _charsByDepth.end(); it != itEnd; ++it) {
-
-        DisplayObject* ch = *it;
+    for (DisplayObject* ch : _charsByDepth) {
 
         const int chdepth = ch->get_depth();
         if (chdepth >= nexthighestdepth) {
@@ -137,10 +134,7 @@ DisplayList::getDisplayObjectAtDepth(int depth) const
 {
     testInvariant();
 
-    for (const_iterator it = _charsByDepth.begin(), itEnd = 
_charsByDepth.end();
-        it != itEnd; ++it) {
-
-        DisplayObject* ch = *it;
+    for (DisplayObject* ch : _charsByDepth) {
 
         // Should not be there!
         if (ch->isDestroyed()) continue;
diff --git a/libcore/DisplayList.h b/libcore/DisplayList.h
index 1611312..9561500 100644
--- a/libcore/DisplayList.h
+++ b/libcore/DisplayList.h
@@ -372,10 +372,8 @@ template <class V>
 void
 DisplayList::visitAll(V& visitor)
 {
-       for (iterator it = _charsByDepth.begin(), itEnd = _charsByDepth.end();
-               it != itEnd; ++it) {
-
-               visitor(*it);
+       for (DisplayObject* ch : _charsByDepth) {
+               visitor(ch);
        }
 }
 
@@ -383,10 +381,8 @@ template <class V>
 void
 DisplayList::visitAll(V& visitor) const
 {
-       for (const_iterator it = _charsByDepth.begin(),
-            itEnd = _charsByDepth.end(); it != itEnd; ++it) {
-
-               visitor(*it);
+       for (DisplayObject* const ch : _charsByDepth) {
+               visitor(ch);
        }
 }
 
diff --git a/libcore/DisplayObject.cpp b/libcore/DisplayObject.cpp
index b97ad02..3b43731 100644
--- a/libcore/DisplayObject.cpp
+++ b/libcore/DisplayObject.cpp
@@ -412,14 +412,12 @@ DisplayObject::setMatrix(const SWFMatrix& m, bool 
updateCache)
 void
 DisplayObject::set_event_handlers(const Events& copyfrom)
 {
-    for (Events::const_iterator it=copyfrom.begin(), itE=copyfrom.end();
-            it != itE; ++it)
+    for (const auto& event : copyfrom)
     {
-        const event_id& ev = it->first;
-        const BufferList& bufs = it->second;
-        for (size_t i = 0, e = bufs.size(); i < e; ++i)
+        const event_id& ev = event.first;
+        const BufferList& bufs = event.second;
+        for (const action_buffer* buf : bufs) 
         {
-            const action_buffer* buf = bufs[i];
             assert(buf);
             add_event_handler(ev, *buf);
         }    
diff --git a/libcore/MovieClip.cpp b/libcore/MovieClip.cpp
index 67fdf64..a7c5fa8 100644
--- a/libcore/MovieClip.cpp
+++ b/libcore/MovieClip.cpp
@@ -838,8 +838,8 @@ MovieClip::setTextFieldVariables(const ObjectURI& uri, 
const as_value& val)
 
     if (!etc) return false;
 
-    for (TextFields::iterator i=etc->begin(), e=etc->end(); i!=e; ++i) {
-        (*i)->updateText(val.to_string(getSWFVersion(*getObject(this))));
+    for (TextField* textfield : *etc) {
+        textfield->updateText(val.to_string(getSWFVersion(*getObject(this))));
     }
     return true;
 }
@@ -1049,15 +1049,14 @@ MovieClip::executeFrameTags(size_t frame, DisplayList& 
dlist, int typeflags)
         );
 
         // Generally tags should be executed in the order they are found in.
-        for (PlayList::const_iterator it = playlist->begin(),
-                e = playlist->end(); it != e; ++it) {
+        for (const auto& item : *playlist) {
 
             if (typeflags & SWF::ControlTag::TAG_DLIST) {
-                (*it)->executeState(this, dlist);
+                item->executeState(this, dlist);
             }
 
             if (typeflags & SWF::ControlTag::TAG_ACTION) {
-                (*it)->executeActions(this, _displayList);
+                item->executeActions(this, _displayList);
             }
         }
     }
@@ -1591,9 +1590,9 @@ MovieClip::cleanup_textfield_variables()
 
     TextFieldIndex& m = *_text_variables;
 
-    for (TextFieldIndex::iterator i=m.begin(), ie=m.end(); i!=ie; ++i)
+    for (auto& index : m)
     {
-        TextFields& v=i->second;
+        TextFields& v=index.second;
         TextFields::iterator lastValid = std::remove_if(v.begin(), v.end(),
                     std::mem_fn(&DisplayObject::unloaded));
         v.erase(lastValid, v.end());
@@ -1937,11 +1936,10 @@ void
 MovieClip::setVariables(const MovieVariables& vars)
 {
     VM& vm = getVM(*getObject(this));
-    for (MovieVariables::const_iterator it=vars.begin(), itEnd=vars.end();
-        it != itEnd; ++it) {
+    for (const auto& var : vars) {
 
-        const std::string& name = it->first;
-        const std::string& val = it->second;
+        const std::string& name = var.first;
+        const std::string& val = var.second;
         getObject(this)->set_member(getURI(vm, name), val);
     }
 }
diff --git a/libcore/PropertyList.cpp b/libcore/PropertyList.cpp
index f510ede..1d96c94 100644
--- a/libcore/PropertyList.cpp
+++ b/libcore/PropertyList.cpp
@@ -128,10 +128,10 @@ PropertyList::setFlags(const ObjectURI& uri, int 
setFlags, int clearFlags)
 void
 PropertyList::setFlagsAll(int setFlags, int clearFlags)
 {
-    for (const_iterator it = _props.begin(); it != _props.end(); ++it) {
-        PropFlags f = it->getFlags();
+    for (const auto& prop: _props) {
+        PropFlags f = prop.getFlags();
         f.set_flags(setFlags, clearFlags);
-        it->setFlags(f);
+        prop.setFlags(f);
     }
 }
 
@@ -173,12 +173,11 @@ PropertyList::visitKeys(KeyVisitor& visitor, 
PropertyTracker& donelist)
     const
 {
     // We should enumerate in order of creation, not lexicographically.
-       for (const_iterator i = _props.begin(),
-            ie = _props.end(); i != ie; ++i) {
+       for (const auto& prop : _props) {
 
-               if (i->getFlags().test<PropFlags::dontEnum>()) continue;
+               if (prop.getFlags().test<PropFlags::dontEnum>()) continue;
 
-        const ObjectURI& uri = i->uri();
+        const ObjectURI& uri = prop.uri();
 
                if (donelist.insert(uri).second) {
                        visitor(uri);
@@ -190,9 +189,8 @@ void
 PropertyList::dump()
 {
     ObjectURI::Logger l(getStringTable(_owner));
-       for (const_iterator it=_props.begin(), itEnd=_props.end();
-            it != itEnd; ++it) {
-            log_debug("  %s: %s", l(it->uri()), it->getValue(_owner));
+       for (const auto& prop : _props) {
+            log_debug("  %s: %s", l(prop.uri()), prop.getValue(_owner));
        }
 }
 
diff --git a/libcore/PropertyList.h b/libcore/PropertyList.h
index a33658f..7956adc 100644
--- a/libcore/PropertyList.h
+++ b/libcore/PropertyList.h
@@ -150,12 +150,11 @@ public:
     template <class U, class V>
     void visitValues(V& visitor, U cmp = U()) const {
 
-        for (const_iterator it = _props.begin(), ie = _props.end();
-                it != ie; ++it) {
+        for (const auto& prop : _props) {
 
-            if (!cmp(*it)) continue;
-            as_value val = it->getValue(_owner);
-            if (!visitor.accept(it->uri(), val)) return;
+            if (!cmp(prop)) continue;
+            as_value val = prop.getValue(_owner);
+            if (!visitor.accept(prop.uri(), val)) return;
         }
     }
 
diff --git a/libcore/TextField.cpp b/libcore/TextField.cpp
index 95a51fe..a31769e 100644
--- a/libcore/TextField.cpp
+++ b/libcore/TextField.cpp
@@ -747,12 +747,12 @@ TextField::mouseEvent(const event_id& ev)
                        
                        SWF::TextRecord rec;
                        
-                       for (size_t i=0; i < _textRecords.size(); ++i) {
-                               if      ((x_mouse >  _textRecords[i].xOffset()) 
&& 
-                                       (x_mouse < 
_textRecords[i].xOffset()+_textRecords[i].recordWidth()) &&
-                                       (y_mouse > 
_textRecords[i].yOffset()-_textRecords[i].textHeight()) &&
-                                       (y_mouse < _textRecords[i].yOffset())) {
-                                               rec = _textRecords[i];
+                       for (auto& record: _textRecords) {
+                               if      ((x_mouse >  record.xOffset()) && 
+                                       (x_mouse < 
record.xOffset()+record.recordWidth()) &&
+                                       (y_mouse > 
record.yOffset()-record.textHeight()) &&
+                                       (y_mouse < record.yOffset())) {
+                                               rec = record;
                                                break;
                                        }
                        }
@@ -977,10 +977,10 @@ TextField::insertTab(SWF::TextRecord& rec, std::int32_t& 
x, float scale)
         if (!_tabStops.empty()) {
             int tab = _tabStops.back() + 1;
             
-            for (size_t i = 0; i < tabStops.size(); ++i) {        
-                if (tabStops[i] > x) {
-                    if((tabStops[i] - x) < tab) {
-                        tab = tabStops[i] - x;
+            for (auto& tabStop : tabStops) {
+                if (tabStop > x) {
+                    if((tabStop - x) < tab) {
+                        tab = tabStop - x;
                     }
                                }
 
diff --git a/libcore/asobj/Array_as.cpp b/libcore/asobj/Array_as.cpp
index c123fee..a7642d7 100644
--- a/libcore/asobj/Array_as.cpp
+++ b/libcore/asobj/Array_as.cpp
@@ -1601,9 +1601,8 @@ void foreachArray(as_object& array, int start, int end, 
T& pred)
 void
 pushIndices(as_object& o, const std::vector<indexed_as_value>& elems)
 {
-    for (std::vector<indexed_as_value>::const_iterator it = elems.begin();
-        it != elems.end(); ++it) {
-        callMethod(&o, NSV::PROP_PUSH, it->vec_index);
+    for (const auto& elem : elems) {
+        callMethod(&o, NSV::PROP_PUSH, elem.vec_index);
     }
 }
 
diff --git a/libcore/asobj/NetConnection_as.cpp 
b/libcore/asobj/NetConnection_as.cpp
index c5ca68d..7a2e7df 100644
--- a/libcore/asobj/NetConnection_as.cpp
+++ b/libcore/asobj/NetConnection_as.cpp
@@ -289,8 +289,8 @@ public:
             aw.writeString("play");
             aw.writeNumber(0);
             aw.writeNull();
-            for (size_t i = 0; i < args.size(); ++i) {
-               args[i].writeAMF0(aw);
+            for (auto& arg : args) {
+               arg.writeAMF0(aw);
             }
            // TODO Use the play method and the streamId from createStream
            _rtmp.call(buf);
@@ -302,8 +302,8 @@ public:
             const size_t id = asCallback ? callNo() : 0;
             aw.writeNumber(id);
 
-            for (size_t i = 0; i < args.size(); ++i) {
-               args[i].writeAMF0(aw);
+            for (auto& arg : args) {
+               arg.writeAMF0(aw);
             }
            _rtmp.call(buf);
             if (asCallback) {
diff --git a/libcore/asobj/NetStream_as.cpp b/libcore/asobj/NetStream_as.cpp
index d7e02a9..99d2a7a 100644
--- a/libcore/asobj/NetStream_as.cpp
+++ b/libcore/asobj/NetStream_as.cpp
@@ -1363,9 +1363,8 @@ NetStream_as::update()
 
     if (tags.empty()) return;
 
-    for (media::MediaParser::OrderedMetaTags::iterator i = tags.begin(),
-            e = tags.end(); i != e; ++i) {
-        executeTag(**i, owner());
+    for (auto& tag : tags) {
+        executeTag(*tag, owner());
     }
 #endif  // USE_MEDIA
 }
diff --git a/libcore/asobj/TextSnapshot_as.cpp 
b/libcore/asobj/TextSnapshot_as.cpp
index 289de18..9fc042e 100644
--- a/libcore/asobj/TextSnapshot_as.cpp
+++ b/libcore/asobj/TextSnapshot_as.cpp
@@ -233,19 +233,16 @@ TextSnapshot_as::getTextRunInfo(size_t start, size_t end, 
as_object& ri) const
 
     std::string::size_type len = end - start;
 
-    for (TextFields::const_iterator field = _textFields.begin(),
-            e = _textFields.end(); field != e; ++field) {
+    for (const auto& field : _textFields) {
 
-        const Records& rec = field->second;
-        const SWFMatrix& mat = getMatrix(*field->first);
-        const boost::dynamic_bitset<>& selected = field->first->getSelected();
+        const Records& rec = field.second;
+        const SWFMatrix& mat = getMatrix(*field.first);
+        const boost::dynamic_bitset<>& selected = field.first->getSelected();
 
         const std::string::size_type fieldStartIndex = pos;
 
-        for (Records::const_iterator j = rec.begin(), end = rec.end();
-                j != end; ++j) {
+        for (const SWF::TextRecord* tr : rec) {
         
-            const SWF::TextRecord* tr = *j;
             assert(tr);
 
             const SWF::TextRecord::Glyphs& glyphs = tr->glyphs();
@@ -260,11 +257,10 @@ TextSnapshot_as::getTextRunInfo(size_t start, size_t end, 
as_object& ri) const
             assert(font);
 
             double x = tr->xOffset();
-            for (SWF::TextRecord::Glyphs::const_iterator k = glyphs.begin(),
-                    e = glyphs.end(); k != e; ++k) {
+            for (const auto& glyph : glyphs) {
                 
                 if (pos < start) {
-                    x += k->advance;
+                    x += glyph.advance;
                     ++pos;
                     continue;
                 }
@@ -292,7 +288,7 @@ TextSnapshot_as::getTextRunInfo(size_t start, size_t end, 
as_object& ri) const
                 callMethod(&ri, NSV::PROP_PUSH, el);
 
                 ++pos;
-                x += k->advance;
+                x += glyph.advance;
                 if (pos - start > len) return;
             }
         }
@@ -307,23 +303,20 @@ TextSnapshot_as::makeString(std::string& to, bool 
newline, bool selectedOnly,
 
     std::string::size_type pos = 0;
 
-    for (TextFields::const_iterator field = _textFields.begin(),
-            e = _textFields.end(); field != e; ++field)
+    for (const auto& field: _textFields)
     {
         // When newlines are requested, insert one after each individual
         // text field is processed.
         if (newline && pos > start) to += '\n';
 
-        const Records& records = field->second;
-        const boost::dynamic_bitset<>& selected = field->first->getSelected();
+        const Records& records = field.second;
+        const boost::dynamic_bitset<>& selected = field.first->getSelected();
 
         /// Remember the position at the beginning of the StaticText.
         const std::string::size_type fieldStartIndex = pos;
 
-        for (Records::const_iterator j = records.begin(), end = records.end();
-                j != end; ++j) {
+        for (const SWF::TextRecord* tr : records) {
         
-            const SWF::TextRecord* tr = *j;
             assert(tr);
 
             const SWF::TextRecord::Glyphs& glyphs = tr->glyphs();
@@ -337,8 +330,7 @@ TextSnapshot_as::makeString(std::string& to, bool newline, 
bool selectedOnly,
             const Font* font = tr->getFont();
             assert(font);
 
-            for (SWF::TextRecord::Glyphs::const_iterator k = glyphs.begin(),
-                    e = glyphs.end(); k != e; ++k) {
+            for (const auto& glyph : glyphs) {
                 
                 if (pos < start) {
                     ++pos;
@@ -346,7 +338,7 @@ TextSnapshot_as::makeString(std::string& to, bool newline, 
bool selectedOnly,
                 }
                 
                 if (!selectedOnly || selected.test(pos - fieldStartIndex)) {
-                    to += font->codeTableLookup(k->index, true);
+                    to += font->codeTableLookup(glyph.index, true);
                 }
                 ++pos;
                 if (pos - start == len) return;
diff --git a/libcore/asobj/XMLNode_as.cpp b/libcore/asobj/XMLNode_as.cpp
index b1e36b9..cd1721f 100644
--- a/libcore/asobj/XMLNode_as.cpp
+++ b/libcore/asobj/XMLNode_as.cpp
@@ -103,9 +103,8 @@ XMLNode_as::XMLNode_as(const XMLNode_as& tpl, bool deep)
     // only clone children if in deep mode
     if (deep) {
         const Children& from=tpl._children;
-        for (Children::const_iterator it=from.begin(), itEnd=from.end();
-                        it != itEnd; ++it) {
-            _children.push_back(new XMLNode_as(*(*it), deep));
+        for (const auto& child : from) {
+            _children.push_back(new XMLNode_as(*child, deep));
         }
     }
 }
@@ -261,12 +260,11 @@ XMLNode_as::previousSibling() const
        if (_parent->_children.size() <= 1) return nullptr;
 
     XMLNode_as *previous_node = nullptr;
-    for (Children::iterator itx = _parent->_children.begin();
-            itx != _parent->_children.end(); ++itx) {
+    for (XMLNode_as * child : _parent->_children) {
 
-        if (*itx == this) return previous_node;
+        if (child == this) return previous_node;
                
-        previous_node = *itx;
+        previous_node = child;
     }
 
     return nullptr;
@@ -391,9 +389,7 @@ XMLNode_as::extractPrefix(std::string& prefix) const
 void
 XMLNode_as::clearChildren()
 {
-    for (Children::iterator it = _children.begin(), e = _children.end();
-            it != e; ++it) {
-        XMLNode_as* node = *it;
+    for (XMLNode_as* node : _children) {
 
         node->setParent(nullptr);
         if (!node->_object) {
@@ -431,10 +427,9 @@ XMLNode_as::stringify(const XMLNode_as& xml, std::ostream& 
xmlout, bool encode)
         enumerateAttributes(xml, attrs);
         if (!attrs.empty()) {
 
-            for (StringPairs::iterator i = 
-                    attrs.begin(), e = attrs.end(); i != e; ++i) { 
-                escapeXML(i->second);
-                xmlout << " " << i->first << "=\"" << i->second << "\"";
+            for (auto& attr : attrs) { 
+                escapeXML(attr.second);
+                xmlout << " " << attr.first << "=\"" << attr.second << "\"";
             }
         }
 
@@ -465,10 +460,9 @@ XMLNode_as::stringify(const XMLNode_as& xml, std::ostream& 
xmlout, bool encode)
     }
 
     // Childs, after node as_value.
-    for (Children::const_iterator itx = xml._children.begin(); 
-            itx != xml._children.end(); ++itx) {
+    for (XMLNode_as* child : xml._children) {
 
-        (*itx)->toString(xmlout, encode);
+        child->toString(xmlout, encode);
     }
 
     if (!nodeName.empty() || type == Element) {
diff --git a/libcore/asobj/XML_as.cpp b/libcore/asobj/XML_as.cpp
index 1bc12d8..052bfa5 100644
--- a/libcore/asobj/XML_as.cpp
+++ b/libcore/asobj/XML_as.cpp
@@ -105,10 +105,9 @@ escapeXML(std::string& text)
 {
     const Entities& ent = getEntities();
 
-    for (Entities::const_iterator i = ent.begin(), e = ent.end();
-            i != e; ++i)
+    for (const auto& entity : ent)
     {
-        boost::replace_all(text, i->second, i->first);
+        boost::replace_all(text, entity.second, entity.first);
     }
 }
 
@@ -117,9 +116,8 @@ unescapeXML(std::string& text)
 {
     const Entities& ent = getEntities();
 
-    for (Entities::const_iterator i = ent.begin(), e = ent.end();
-            i != e; ++i) {
-        boost::replace_all(text, i->first, i->second);
+    for (const auto& entity : ent) {
+        boost::replace_all(text, entity.first, entity.second);
     }
 
     // Additionally, the &nbsp; entity is unescaped (but never escaped).
diff --git a/libcore/fontlib.cpp b/libcore/fontlib.cpp
index 24e63dc..5adb695 100644
--- a/libcore/fontlib.cpp
+++ b/libcore/fontlib.cpp
@@ -50,13 +50,12 @@ Font*
 get_font(const std::string& name, bool bold, bool italic)
 {
     // Dumb linear search.
-    for (unsigned int i = 0; i < s_fonts.size(); i++)
+    for (auto& font : s_fonts)
     {
-        Font*  f = s_fonts[i].get();
-        assert(f);
-        if ( f->matches(name, bold, italic) )
+        assert(font);
+        if ( font->matches(name, bold, italic) )
         {
-            return f;
+            return font.get();
         }
     }
     Font* f = new Font(name, bold, italic);
@@ -70,9 +69,9 @@ add_font(Font* f)
     assert(f);
 #ifndef NDEBUG
     // Make sure font isn't already in the list.
-    for (unsigned int i = 0; i < s_fonts.size(); i++)
+    for (auto& font : s_fonts)
     {
-        assert(s_fonts[i] != f);
+        assert(font != f);
     }
 #endif // not NDEBUG
 
diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index 441fe6f..6451fa5 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -599,10 +599,8 @@ movie_root::keyEvent(key::code k, bool down)
     }
 
     LiveChars copy = _liveChars;
-    for (LiveChars::iterator iter = copy.begin(), itEnd=copy.end();
-            iter != itEnd; ++iter) {
+    for (MovieClip* const ch : copy) {
 
-        MovieClip* const ch = *iter;
         if (ch->unloaded()) continue;
 
         if (down) {
@@ -1025,8 +1023,8 @@ movie_root::display()
             frame_size.get_x_min(), frame_size.get_x_max(),
             frame_size.get_y_min(), frame_size.get_y_max());
 
-    for (Levels::iterator i=_movies.begin(), e=_movies.end(); i!=e; ++i) {
-        MovieClip* movie = i->second;
+    for (auto& elem : _movies) {
+        MovieClip* movie = elem.second;
 
         movie->clear_invalidated();
 
@@ -1036,7 +1034,7 @@ movie_root::display()
         const SWFRect& sub_frame_size = movie->get_frame_size();
 
         if (sub_frame_size.is_null()) {
-            log_debug("_level%u has null frame size, skipping", i->first);
+            log_debug("_level%u has null frame size, skipping", elem.first);
             continue;
         }
 
@@ -1048,10 +1046,8 @@ bool
 movie_root::notify_mouse_listeners(const event_id& event)
 {
     LiveChars copy = _liveChars;
-    for (LiveChars::iterator iter = copy.begin(), itEnd=copy.end();
-            iter != itEnd; ++iter)
+    for (MovieClip* const ch : copy)
     {
-        MovieClip* const ch = *iter;
         if (!ch->unloaded()) {
             ch->mouseEvent(event);
         }
diff --git a/libcore/parser/SWFMovieDefinition.cpp 
b/libcore/parser/SWFMovieDefinition.cpp
index c827e92..442e51e 100644
--- a/libcore/parser/SWFMovieDefinition.cpp
+++ b/libcore/parser/SWFMovieDefinition.cpp
@@ -195,9 +195,9 @@ SWFMovieDefinition::get_font(const std::string& name, bool 
bold, bool italic)
     const
 {
 
-    for (FontMap::const_iterator it=m_fonts.begin(), itEnd=m_fonts.end(); it 
!= itEnd; ++it)
+    for (const auto& elem : m_fonts)
     {
-       Font* f = it->second.get();
+       Font* f = elem.second.get();
        if ( f->matches(name, bold, italic) ) return f;
     }
     return nullptr;
@@ -398,12 +398,11 @@ std::ostream&
 operator<<(std::ostream& o, const CharacterDictionary& cd)
 {
 
-       for (CharacterDictionary::CharacterConstIterator it = cd.begin(), 
-            endIt = cd.end(); it != endIt; ++it)
+       for (const auto& elem : cd)
        {
            o << std::endl
-             << "Character: " << it->first
-             << " at address: " << static_cast<void*>(it->second.get());
+             << "Character: " << elem.first
+             << " at address: " << static_cast<void*>(elem.second.get());
        }
        
        return o;
@@ -616,8 +615,7 @@ SWFMovieDefinition::importResources(
 
     // Mutex scope.
 
-    for (Imports::const_iterator i = imports.begin(), e = imports.end(); i != 
e;
-            ++i) {
+    for (const auto& import : imports) {
     
         size_t new_loading_frame = source->get_loading_frame();
         
@@ -631,8 +629,8 @@ SWFMovieDefinition::importResources(
         size_t timeout = def_timeout;
         size_t loading_frame = (size_t)-1; // used to keep track of 
advancements
 
-        const int id = i->first;
-        const std::string& symbolName = i->second;
+        const int id = import.first;
+        const std::string& symbolName = import.second;
 
 #ifdef DEBUG_EXPORTS
         log_debug("%s importing %s from %s", get_url(), symbolName,
diff --git a/libcore/swf/DefineButtonCxformTag.cpp 
b/libcore/swf/DefineButtonCxformTag.cpp
index c4be3df..e43de12 100644
--- a/libcore/swf/DefineButtonCxformTag.cpp
+++ b/libcore/swf/DefineButtonCxformTag.cpp
@@ -65,12 +65,11 @@ DefineButtonCxformTag::loader(SWFStream& in, TagType tag, 
movie_definition& m,
     }
     
     DefineButtonTag::ButtonRecords& br = ch->buttonRecords();
-    for (DefineButtonTag::ButtonRecords::iterator i = br.begin(),
-            e = br.end(); i != e; ++i)
+    for (ButtonRecord& record : br)
     {
         // This will throw a parser exception if not enough bytes are
         // left.
-        i->readRGBTransform(in);
+        record.readRGBTransform(in);
     }
 }
 
diff --git a/libcore/swf/DefineButtonSoundTag.cpp 
b/libcore/swf/DefineButtonSoundTag.cpp
index b66befa..3b061ae 100644
--- a/libcore/swf/DefineButtonSoundTag.cpp
+++ b/libcore/swf/DefineButtonSoundTag.cpp
@@ -85,9 +85,8 @@ void
 DefineButtonSoundTag::read(SWFStream& in, movie_definition& m)
 {
 
-       for (Sounds::iterator i = _sounds.begin(), e = _sounds.end(); i != e; 
++i)
+       for (ButtonSound& sound : _sounds)
        {
-               ButtonSound& sound = *i;
                in.ensureBytes(2);
                sound.soundID = in.read_u16();
                if (sound.soundID)
diff --git a/libcore/swf/ExportAssetsTag.h b/libcore/swf/ExportAssetsTag.h
index 9c55657..3ce8c54 100644
--- a/libcore/swf/ExportAssetsTag.h
+++ b/libcore/swf/ExportAssetsTag.h
@@ -53,9 +53,8 @@ public:
     // TODO: use Movie to store the actual exports.
     virtual void executeState(MovieClip* m, DisplayList& /*l*/) const {
         Movie* mov = m->get_root();
-        for (Exports::const_iterator it = _exports.begin(), e = _exports.end();
-                it != e; ++it) {
-            const std::uint16_t id = mov->definition()->exportID(*it);
+        for (const std::string& the_export : _exports) {
+            const std::uint16_t id = mov->definition()->exportID(the_export);
 
             // We exported it, so we assume it is known.
             assert(id);
diff --git a/libcore/swf/ImportAssetsTag.h b/libcore/swf/ImportAssetsTag.h
index bd9973f..0508e40 100644
--- a/libcore/swf/ImportAssetsTag.h
+++ b/libcore/swf/ImportAssetsTag.h
@@ -59,9 +59,8 @@ public:
     /// genuine id of the DefinitionTag.
     virtual void executeState(MovieClip* m, DisplayList& /*l*/) const {
         Movie* mov = m->get_root();
-        for (Imports::const_iterator it = _imports.begin(), e = _imports.end();
-                it != e; ++it) {
-            mov->addCharacter(it->first);
+        for (const Import& import : _imports) {
+            mov->addCharacter(import.first);
         }
     }
 
diff --git a/libcore/swf/ShapeRecord.cpp b/libcore/swf/ShapeRecord.cpp
index 275d378..89eaf4d 100644
--- a/libcore/swf/ShapeRecord.cpp
+++ b/libcore/swf/ShapeRecord.cpp
@@ -114,10 +114,9 @@ public:
     static size_t computeNumberOfEdges(const Paths& paths)
     {
         size_t count=0;
-        for (Paths::const_iterator i = paths.begin(), e = paths.end();
-                i != e; ++i) {
+        for (const Path& path : paths) {
 
-            count += i->size();
+            count += path.size();
         }
         return count;
     }
@@ -170,8 +169,7 @@ Subshape::computeBounds(int swfVersion) const
 {
     SWFRect bounds;
 
-    for (unsigned int i = 0; i < _paths.size(); i++) {
-        const Path& p = _paths[i];
+    for (const Path& p : _paths) {
 
         unsigned thickness = 0;
         if ( p.m_line ) {
@@ -668,10 +666,9 @@ operator<<(std::ostream& o, const ShapeRecord& sh)
     o << boost::format("Shape Record: bounds %1%") % sh.getBounds();
 
 
-    for (ShapeRecord::Subshapes::const_iterator it = sh.subshapes().begin(),
-         end = sh.subshapes().end(); it != end; ++it) {
+    for (const Subshape& subshape : sh.subshapes()) {
 
-        const ShapeRecord::FillStyles& fills = it->fillStyles();
+        const ShapeRecord::FillStyles& fills = subshape.fillStyles();
         std::copy(fills.begin(), fills.end(),
                 std::ostream_iterator<FillStyle>(o, ","));
        }
diff --git a/libcore/swf/ShapeRecord.h b/libcore/swf/ShapeRecord.h
index 4401610..478cd83 100644
--- a/libcore/swf/ShapeRecord.h
+++ b/libcore/swf/ShapeRecord.h
@@ -182,10 +182,9 @@ public:
 
     bool pointTest(std::int32_t x, std::int32_t y,
                    const SWFMatrix& wm) const {
-        for (SWF::ShapeRecord::Subshapes::const_iterator it = 
_subshapes.begin(),
-             end = _subshapes.end(); it != end; ++it) {
+        for (const Subshape& subshape : _subshapes) {
 
-            if (geometry::pointTest(it->paths(), it->lineStyles(), x, y, wm)) {
+            if (geometry::pointTest(subshape.paths(), subshape.lineStyles(), 
x, y, wm)) {
                    return true;
             }
         }
diff --git a/libcore/swf/TextRecord.cpp b/libcore/swf/TextRecord.cpp
index 0999498..e7ab1dd 100644
--- a/libcore/swf/TextRecord.cpp
+++ b/libcore/swf/TextRecord.cpp
@@ -171,12 +171,10 @@ TextRecord::displayRecords(Renderer& renderer, const 
Transform& xform,
     double x = 0.0;
     double y = 0.0;
 
-    for (TextRecords::const_iterator i = records.begin(), e = records.end();
-            i !=e; ++i) {
+    for (const TextRecord& rec : records) {
 
         // Draw the DisplayObjects within the current record; i.e. consecutive
         // chars that share a particular style.
-        const TextRecord& rec = *i;
 
         const Font* fnt = rec.getFont();
         if (!fnt) {
@@ -214,10 +212,7 @@ TextRecord::displayRecords(Renderer& renderer, const 
Transform& xform,
         // Device fonts have no transparency.
         if (!embedded) textColor.m_a = 0xff;
 
-        for (Glyphs::const_iterator j = rec.glyphs().begin(),
-                je = rec.glyphs().end(); j != je; ++j) {
-
-            const TextRecord::GlyphEntry& ge = *j;
+        for (const TextRecord::GlyphEntry& ge : rec.glyphs()) {
 
             const int index = ge.index;
                 
diff --git a/libcore/swf/TextRecord.h b/libcore/swf/TextRecord.h
index bf2a278..ec11028 100644
--- a/libcore/swf/TextRecord.h
+++ b/libcore/swf/TextRecord.h
@@ -140,9 +140,9 @@ public:
 
        float recordWidth() const {
                float width = 0.0f;
-               for (size_t i = 0; i < glyphs().size(); ++i)
+               for (const auto& glyph : glyphs())
                {
-                       width += glyphs()[i].advance;
+                       width += glyph.advance;
                }
         return width;
        }
diff --git a/libcore/vm/ExecutableCode.h b/libcore/vm/ExecutableCode.h
index a14ddd3..889cbb9 100644
--- a/libcore/vm/ExecutableCode.h
+++ b/libcore/vm/ExecutableCode.h
@@ -114,15 +114,14 @@ public:
     }
 
     virtual void execute() {
-        for (BufferList::iterator it = _buffers.begin(),
-            itEnd = _buffers.end(); it != itEnd; ++it) {
+        for (const action_buffer* buffer : _buffers) {
 
             // onClipEvents code are guarded by isDestroyed(),
             // still might be also guarded by unloaded()
             if (target()->isDestroyed()) break;
 
             PoolGuard guard(getVM(target()->get_environment()), nullptr);
-            ActionExec exec(*(*it), target()->get_environment(), false);
+            ActionExec exec(*buffer, target()->get_environment(), false);
             exec();
         }
     }
diff --git a/libcore/vm/SafeStack.h b/libcore/vm/SafeStack.h
index 01b33e4..4dd9444 100644
--- a/libcore/vm/SafeStack.h
+++ b/libcore/vm/SafeStack.h
@@ -215,7 +215,7 @@ public:
        /// Delete the allocated data. 
        ~SafeStack()
        {
-               for (StackSize i = 0; i < _data.size(); ++i) delete [] _data[i];
+               for (auto& elem : _data) delete [] elem;
        }
 
 private:
diff --git a/libmedia/AudioDecoderSpeex.cpp b/libmedia/AudioDecoderSpeex.cpp
index 86157fd..def0c04 100644
--- a/libmedia/AudioDecoderSpeex.cpp
+++ b/libmedia/AudioDecoderSpeex.cpp
@@ -165,9 +165,7 @@ AudioDecoderSpeex::decode(const EncodedAudioFrame& input,
     std::uint8_t* rv = new std::uint8_t[total_size];
     std::uint8_t* ptr = rv;
 
-    for (std::vector<DecodedFrame*>::iterator it = decoded_frames.begin(),
-         end = decoded_frames.end(); it != end; ++it) {
-        DecodedFrame* frame = *it;
+    for (DecodedFrame* frame : decoded_frames) {
 
         memcpy(ptr, frame->data.get(), frame->size);
 
diff --git a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp 
b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
index d111e4f..81256ec 100644
--- a/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
+++ b/libmedia/ffmpeg/VideoDecoderFfmpeg.cpp
@@ -412,9 +412,8 @@ VideoDecoderFfmpeg::pop()
 {
     std::unique_ptr<image::GnashImage> ret;
 
-    for (std::vector<const EncodedVideoFrame*>::iterator it =
-             _video_frames.begin(), end = _video_frames.end(); it != end; 
++it) {
-         ret = decode((*it)->data(), (*it)->dataSize());
+    for (const EncodedVideoFrame* frame : _video_frames) {
+         ret = decode(frame->data(), frame->dataSize());
     }
 
     _video_frames.clear();
diff --git a/librender/agg/Renderer_agg.cpp b/librender/agg/Renderer_agg.cpp
index 6b20151..fec2649 100644
--- a/librender/agg/Renderer_agg.cpp
+++ b/librender/agg/Renderer_agg.cpp
@@ -409,11 +409,8 @@ public:
     template<typename ScanLine>
     void render(ScanLine& sl, Stroke& stroke, const rgba& color)
     {
-        for (ClipBounds::const_iterator i = _clipbounds.begin(),
-                e = _clipbounds.end(); i != e; ++i) {
+        for (const auto& bounds : _clipbounds) {
 
-            const ClipBounds::value_type& bounds = *i;
-              
             applyClipBox<Rasterizer> (_ras, bounds);
 
             // The vectorial pipeline
@@ -487,10 +484,8 @@ private:
         Rasterizer ras;
         agg::renderer_scanline_aa_solid<Renderer> ren_sl(rbase);
 
-        for (ClipBounds::const_iterator i = _clipbounds.begin(),
-            e = _clipbounds.end(); i != e; ++i)
+        for (const auto& cb : _clipbounds)
         {
-            const ClipBounds::value_type& cb = *i;
             applyClipBox<Rasterizer>(ras, cb);
             ras.add_path(path);
 
@@ -630,10 +625,8 @@ private:
             Scanline& sl, SpanGenerator& sg)
     {
         Rasterizer _ras;
-        for (ClipBounds::const_iterator i = _clipbounds.begin(),
-            e = _clipbounds.end(); i != e; ++i)
+        for (const auto& cb : _clipbounds)
         {
-            const ClipBounds::value_type& cb = *i;
             applyClipBox<Rasterizer> (_ras, cb);
 
             _ras.add_path(path);
@@ -859,10 +852,9 @@ public:
     if ( ! _clipbounds.empty() )
     {
         const agg::rgba8& col = agg::rgba8_pre(bg.m_r, bg.m_g, bg.m_b, bg.m_a);
-        for (ClipBounds::const_iterator i = _clipbounds.begin(),
-                e = _clipbounds.end(); i!= e; ++i) 
+        for (const auto& bounds : _clipbounds)
         {
-            clear_framebuffer(*i, col);
+            clear_framebuffer(bounds, col);
         }
     }
     
@@ -1004,9 +996,8 @@ public:
         _alphaMasks.push_back(new AlphaMask(xres, yres));
         AlphaMask& new_mask = _alphaMasks.back();
 
-        for (ClipBounds::const_iterator i = _clipbounds.begin(), 
-                e = _clipbounds.end(); i != e; ++i) {
-            new_mask.clear(*i);
+        for (const auto& bounds : _clipbounds ) {
+            new_mask.clear(bounds);
         }
 
     }
@@ -1091,11 +1082,10 @@ public:
     
     assert(bounds.getRange().isFinite());
     
-    const int count = _clipbounds.size();
-    for (int cno=0; cno<count; ++cno) {
-          
-      if (_clipbounds[cno].intersects(bounds.getRange())) 
-        _clipbounds_selected.push_back(&_clipbounds[cno]);
+    for (const auto& clip : _clipbounds) {
+
+      if (clip.intersects(bounds.getRange())) 
+        _clipbounds_selected.push_back(&clip);
 
     }  
   }
@@ -1107,10 +1097,9 @@ public:
     _clipbounds_selected.clear();
     _clipbounds_selected.reserve(_clipbounds.size());
     
-    for (ClipBounds::iterator i = _clipbounds.begin(),
-            e = _clipbounds.end(); i != e; ++i)
+    for (const auto& clip : _clipbounds)
     {
-      _clipbounds_selected.push_back(&(*i));
+      _clipbounds_selected.push_back(&clip);
     }
   }
 
@@ -1487,10 +1476,8 @@ public:
       rasc.filling_rule(agg::fill_non_zero);
       
     
-    for (unsigned int cno=0; cno<_clipbounds_selected.size(); ++cno) {
-    
-      const geometry::Range2d<int>* bounds = _clipbounds_selected[cno];
-      
+    for (const geometry::Range2d<int>* bounds : _clipbounds_selected) {
+
       applyClipBox<ras_type> (rasc, *bounds);
       
       // push paths to AGG
@@ -1692,10 +1679,8 @@ public:
       agg::renderer_base<PixelFormat> > ren_sl(rbase); // solid fills
       
     
-    for (unsigned int cno=0; cno<_clipbounds_selected.size(); ++cno) {
-    
-      const geometry::Range2d<int>* bounds = _clipbounds_selected[cno];
-          
+    for (const geometry::Range2d<int>* bounds : _clipbounds_selected) {
+
       applyClipBox<ras_type> (ras, *bounds);
       
       for (size_t pno=0, pcount=paths.size(); pno<pcount; ++pno) {
@@ -1821,9 +1806,8 @@ public:
     // -- render --
       
     // iterate through clipping bounds
-    for (unsigned int cno=0; cno<_clipbounds.size(); ++cno) {
-    
-      const ClipBounds::value_type& bounds = _clipbounds[cno];         
+    for (const auto& bounds : _clipbounds) {
+
       applyClipBox<ras_type> (ras, bounds);     
             
       
@@ -1967,8 +1951,8 @@ public:
   
     Range2d<int> pixbounds = Renderer::world_to_pixel(bounds);
     
-    for (unsigned int cno=0; cno<_clipbounds.size(); ++cno) {  
-      if (Intersect(pixbounds, _clipbounds[cno]))
+    for (const auto& bounds : _clipbounds) {
+      if (Intersect(pixbounds, bounds))
         return true;
     }
     return false;
@@ -2026,7 +2010,7 @@ private:  // private variables
 
     /// clipping rectangle
     ClipBounds _clipbounds;
-    std::vector< geometry::Range2d<int>* > _clipbounds_selected;
+    std::vector< geometry::Range2d<int> const* > _clipbounds_selected;
 
     // this flag is set while a mask is drawn
     bool m_drawing_mask; 
diff --git a/librender/cairo/PathParser.cpp b/librender/cairo/PathParser.cpp
index 2fbba9a..6d9c561 100644
--- a/librender/cairo/PathParser.cpp
+++ b/librender/cairo/PathParser.cpp
@@ -55,20 +55,20 @@ PathParser::run(const SWFCxForm& cx, const SWFMatrix& 
/*mat*/)
 
   std::vector<UniPathList> unipathvec(_num_styles);
 
-  for (size_t i = 0; i < _paths.size(); ++i) {
+  for (const Path& path : _paths) {
   
-    if (_paths[i].empty()) {
+    if (path.empty()) {
       continue;
     }
 
-    int leftfill = _paths[i].getLeftFill();
+    int leftfill = path.getLeftFill();
     if (leftfill) {
-      unipathvec[leftfill-1].emplace_front(&_paths[i], 
UnivocalPath::FILL_LEFT);
+      unipathvec[leftfill-1].emplace_front(&path, UnivocalPath::FILL_LEFT);
     }
 
-    int rightfill = _paths[i].getRightFill();
+    int rightfill = path.getRightFill();
     if (rightfill) {
-      unipathvec[rightfill-1].emplace_front(&_paths[i], 
UnivocalPath::FILL_RIGHT);
+      unipathvec[rightfill-1].emplace_front(&path, UnivocalPath::FILL_RIGHT);
     }
   }
 
diff --git a/librender/cairo/Renderer_cairo.cpp 
b/librender/cairo/Renderer_cairo.cpp
index c27d289..656f2a8 100644
--- a/librender/cairo/Renderer_cairo.cpp
+++ b/librender/cairo/Renderer_cairo.cpp
@@ -729,8 +729,8 @@ Renderer_cairo::draw_poly(const std::vector<point>& corners,
         
     cairo_move_to(_cr, corners[0].x, corners[0].y);
     
-    for (size_t i = 0; i < corners.size(); ++i) {
-        cairo_line_to(_cr, corners[i].x, corners[i].y);
+    for (const point& corner : corners) {
+        cairo_line_to(_cr, corner.x, corner.y);
     }
     
     cairo_close_path(_cr);
@@ -806,10 +806,8 @@ Renderer_cairo::add_path(cairo_t* cr, const Path& cur_path)
     snap_to_half_pixel(cr, x, y);
     cairo_move_to(cr, x, y);
     
-    for (std::vector<Edge>::const_iterator it = cur_path.m_edges.begin(),
-         end = cur_path.m_edges.end(); it != end; ++it) {
-        const Edge& cur_edge = *it;
-      
+    for (const Edge& cur_edge : cur_path.m_edges) {
+
         if (cur_edge.straight()) {
             x = cur_edge.ap.x;
             y = cur_edge.ap.y;
@@ -920,9 +918,7 @@ Renderer_cairo::draw_outlines(const PathVec& path_vec,
                               const SWFCxForm& cx,
                               const SWFMatrix& mat)
 {
-    for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
-         it != end; ++it) {
-        const Path& cur_path = *it;
+    for (const Path& cur_path : path_vec) {
 
         if (!cur_path.m_line) {
             continue;
@@ -949,10 +945,8 @@ Renderer_cairo::draw_subshape(const PathVec& path_vec, 
const SWFMatrix& mat,
 void
 Renderer_cairo::draw_mask(const PathVec& path_vec)
 {    
-    for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
-         it != end; ++it) {
-        const Path& cur_path = *it;
-      
+    for (const Path& cur_path : path_vec) {
+
         if (cur_path.m_fill0 || cur_path.m_fill1) {
             _masks.back().push_back(cur_path);     
         }
@@ -962,10 +956,8 @@ Renderer_cairo::draw_mask(const PathVec& path_vec)
 void
 Renderer_cairo::add_paths(const PathVec& path_vec)
 {
-    for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
-         it != end; ++it) {
-        const Path& cur_path = *it;
-        
+    for (const Path& cur_path : path_vec) {
+
         add_path(_cr, cur_path);
     }  
 }
@@ -987,19 +979,18 @@ Renderer_cairo::drawShape(const SWF::ShapeRecord& shape, 
const Transform& xform)
     
     CairoScopeMatrix mat_transformer(_cr, xform.matrix);
 
-    for (SWF::ShapeRecord::Subshapes::const_iterator it = 
shape.subshapes().begin(),
-         end = shape.subshapes().end(); it != end; ++it) {
+    for (const SWF::Subshape& subshape: shape.subshapes()) {
 
         if (_drawing_mask) {      
-            PathVec scaled_path_vec = it->paths();
+            PathVec scaled_path_vec = subshape.paths();
         
             apply_matrix_to_paths(scaled_path_vec, xform.matrix);
             draw_mask(scaled_path_vec); 
             continue;
         }
 
-        draw_subshape(it->paths(), xform.matrix, xform.colorTransform,
-                it->fillStyles(), it->lineStyles());
+        draw_subshape(subshape.paths(), xform.matrix, xform.colorTransform,
+                subshape.fillStyles(), subshape.lineStyles());
     }
 }
   
diff --git a/librender/opengl/Renderer_ogl.cpp 
b/librender/opengl/Renderer_ogl.cpp
index 59fda36..0820b88 100644
--- a/librender/opengl/Renderer_ogl.cpp
+++ b/librender/opengl/Renderer_ogl.cpp
@@ -414,10 +414,8 @@ std::vector<oglVertex> interpolate(const 
std::vector<Edge>& edges,
   std::vector<oglVertex> shape_points;
   shape_points.push_back(oglVertex(anchor));
   
-  for (std::vector<Edge>::const_iterator it = edges.begin(), end = edges.end();
-        it != end; ++it) {
-      const Edge& the_edge = *it;
-      
+  for (const Edge& the_edge : edges) {
+
       point target(the_edge.ap.x, the_edge.ap.y);
 
       if (the_edge.straight()) {
@@ -497,9 +495,8 @@ Tesselator::tesselate()
 {
   gluTessEndPolygon(_tessobj);
 
-  for (std::vector<GLdouble*>::iterator it = _vertices.begin(),
-       end = _vertices.end(); it != end; ++it) {
-    delete [] *it;
+  for (Gldouble* vertex: _vertices) {
+    delete [] vertex;
   }
 
   _vertices.clear();
@@ -1070,8 +1067,8 @@ public:
     glDeleteLists(1, _render_indices.size());
     _render_indices.clear();
 
-    for (size_t i = 0; i < _render_textures.size(); i++)
-        _cached_textures.push_front(_render_textures[i]);
+    for (auto& texture : _render_textures)
+        _cached_textures.push_front(texture);
     _render_textures.clear();
   
     check_error();
@@ -1330,10 +1327,8 @@ public:
   {
     PathVec normalized;
   
-    for (PathVec::const_iterator it = paths.begin(), end = paths.end();
-         it != end; ++it) {
-      const Path& cur_path = *it;
-      
+    for (const Path& cur_path : paths) {
+
       if (cur_path.m_edges.empty()) {
         continue;
       
@@ -1481,9 +1476,7 @@ public:
   
     PathPointMap pathpoints;
     
-    for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
-         it != end; ++it) {
-      const Path& cur_path = *it;
+    for (const Path& cur_path : path_vec) {
 
       if (!cur_path.m_edges.size()) {
         continue;
@@ -1512,10 +1505,8 @@ public:
                 const std::vector<LineStyle>& line_styles)
   {
   
-    for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
-         it != end; ++it) {
-      const Path& cur_path = *it;
-      
+    for (const Path& cur_path : path_vec) {
+
       if (!cur_path.m_line) {
         continue;
       }
@@ -1556,9 +1547,7 @@ public:
     std::list<PathPtrVec> contours;
     
     
-    for (PathPtrVec::const_iterator it = paths.begin(), end = paths.end();
-         it != end; ++it) {
-      const Path* cur_path = *it;
+    for (const Path* cur_path : paths) {
       path_refs.push_back(cur_path);
     }
         
@@ -1600,10 +1589,8 @@ public:
   
   void draw_mask(const PathVec& path_vec)
   {    
-    for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
-         it != end; ++it) {
-      const Path& cur_path = *it;
-      
+    for (const Path& cur_path : path_vec) {
+
       if (cur_path.m_fill0 || cur_path.m_fill1) {
         _masks.back().push_back(cur_path);
         _masks.back().back().m_line = 0;    
@@ -1615,10 +1602,8 @@ public:
   paths_by_style(const PathVec& path_vec, unsigned int style)
   {
     PathPtrVec paths;
-    for (PathVec::const_iterator it = path_vec.begin(), end = path_vec.end();
-         it != end; ++it) {
-      const Path& cur_path = *it;
-      
+    for (const Path& cur_path : path_vec) {
+
       if (cur_path.m_fill0 == style) {
         paths.push_back(&cur_path);
       }
@@ -1670,9 +1655,8 @@ public:
         
         _tesselator.beginContour();
                    
-        for (PathPtrVec::const_iterator it = refs.begin(), end = refs.end();
-             it != end; ++it) {
-          const Path& cur_path = *(*it);          
+        for (const auto& ref : refs) {
+          const Path& cur_path = *ref;
           
           assert(pathpoints.find(&cur_path) != pathpoints.end());
 
@@ -1733,9 +1717,8 @@ public:
     
     oglScopeMatrix scope_mat(xform.matrix);
 
-    for (SWF::ShapeRecord::Subshapes::const_iterator it = 
shape.subshapes().begin(),
-         end = shape.subshapes().end(); it != end; ++it) {
-        const PathVec& path_vec = it->paths();
+    for (const SWF::Subshape& subshape : shape.subshapes()) {
+        const PathVec& path_vec = subshape.paths();
 
         if (!path_vec.size()) {
             // No paths. Nothing to draw...
@@ -1758,8 +1741,8 @@ public:
             continue; // invisible character
         }  
 
-        draw_subshape(it->paths(), xform.matrix, xform.colorTransform,
-                      it->fillStyles(), it->lineStyles());
+        draw_subshape(path_vec, xform.matrix, xform.colorTransform,
+                      subshape.fillStyles(), subshape.lineStyles());
     }
   }
 
diff --git a/libsound/EmbedSound.cpp b/libsound/EmbedSound.cpp
index f92aa42..a4853d8 100644
--- a/libsound/EmbedSound.cpp
+++ b/libsound/EmbedSound.cpp
@@ -118,10 +118,9 @@ void
 EmbedSound::getPlayingInstances(std::vector<InputStream*>& to) const
 {
     std::lock_guard<std::mutex> lock(_soundInstancesMutex);
-    for (Instances::const_iterator i=_soundInstances.begin(), 
e=_soundInstances.end();
-            i!=e; ++i)
+    for (InputStream* stream : _soundInstances)
     {
-        to.push_back(*i);
+        to.push_back(stream);
     }
 }
 
diff --git a/libsound/StreamingSoundData.cpp b/libsound/StreamingSoundData.cpp
index bb075bf..7beba4d 100644
--- a/libsound/StreamingSoundData.cpp
+++ b/libsound/StreamingSoundData.cpp
@@ -136,11 +136,9 @@ void
 StreamingSoundData::getPlayingInstances(std::vector<InputStream*>& to) const
 {
     std::lock_guard<std::mutex> lock(_soundInstancesMutex);
-    for (Instances::const_iterator i=_soundInstances.begin(),
-            e=_soundInstances.end();
-            i!=e; ++i)
+    for (InputStream* stream : _soundInstances)
     {
-        to.push_back(*i);
+        to.push_back(stream);
     }
 }
 
diff --git a/libsound/sound_handler.cpp b/libsound/sound_handler.cpp
index 28ea54c..a984ab5 100644
--- a/libsound/sound_handler.cpp
+++ b/libsound/sound_handler.cpp
@@ -101,11 +101,8 @@ sound_handler::addSoundBlock(std::unique_ptr<SimpleBuffer> 
data,
 void
 sound_handler::delete_all_sounds()
 {
-    for (Sounds::iterator i = _sounds.begin(),
-                          e = _sounds.end(); i != e; ++i)
+    for (EmbedSound* sdef : _sounds)
     {
-        EmbedSound* sdef = *i;
-
         // The sound may have been deleted already.
         if (!sdef) continue;
 
@@ -116,11 +113,8 @@ sound_handler::delete_all_sounds()
     }
     _sounds.clear();
 
-    for (StreamingSounds::iterator i = _streamingSounds.begin(),
-                          e = _streamingSounds.end(); i != e; ++i)
+    for (StreamingSoundData* sdef : _streamingSounds)
     {
-        StreamingSoundData* sdef = *i;
-
         // Streaming sounds are never deleted.
         assert(sdef);
 
@@ -163,18 +157,14 @@ sound_handler::delete_sound(int handle)
 void   
 sound_handler::stop_all_sounds()
 {
-    for (Sounds::iterator i = _sounds.begin(),
-                          e = _sounds.end(); i != e; ++i)
+    for (EmbedSound* sounddata : _sounds)
     {
-        EmbedSound* sounddata = *i;
         if ( ! sounddata ) continue; // could have been deleted already
         stopEmbedSoundInstances(*sounddata);
     }
 
-    for (StreamingSounds::iterator i = _streamingSounds.begin(),
-                          e = _streamingSounds.end(); i != e; ++i)
+    for (StreamingSoundData* sounddata : _streamingSounds)
     {
-        StreamingSoundData* sounddata = *i;
         if (!sounddata) continue; 
         stopEmbedSoundInstances(*sounddata);
     }
@@ -252,9 +242,8 @@ sound_handler::stopAllEventSounds()
     log_debug("stopAllEventSounds called");
 #endif
 
-    for (Sounds::iterator i=_sounds.begin(), e=_sounds.end(); i != e; ++i)
+    for (EmbedSound* sounddata : _sounds)
     {
-        EmbedSound* sounddata = *i;
         if (!sounddata) continue; // possible ?
 
         stopEmbedSoundInstances(*sounddata);
@@ -272,8 +261,7 @@ sound_handler::stopEmbedSoundInstances(StreamingSoundData& 
def)
 
     // Now, for each playing InputStream, unplug it!
     // NOTE: could be optimized...
-    for (InputStreamVect::iterator i=playing.begin(), e=playing.end();
-            i!=e; ++i)
+    for (InputStream* stream : playing)
     {
 #ifdef GNASH_DEBUG_SOUNDS_MANAGEMENT
         log_debug(" unplugging input stream %p from stopEmbedSoundInstances", 
*i);
@@ -282,7 +270,7 @@ sound_handler::stopEmbedSoundInstances(StreamingSoundData& 
def)
         // Explicitly calling the base class implementation
         // is a (dirty?) way to avoid mutex-locking overrides
         // in subclasses causing deadlocks.
-        sound_handler::unplugInputStream(*i);
+        sound_handler::unplugInputStream(stream);
     }
 
     def.clearInstances();
@@ -299,8 +287,7 @@ sound_handler::stopEmbedSoundInstances(EmbedSound& def)
 
     // Now, for each playing InputStream, unplug it!
     // NOTE: could be optimized...
-    for (InputStreamVect::iterator i=playing.begin(), e=playing.end();
-            i!=e; ++i)
+    for (InputStream* stream : playing)
     {
 #ifdef GNASH_DEBUG_SOUNDS_MANAGEMENT
         log_debug(" unplugging input stream %p from stopEmbedSoundInstances", 
*i);
@@ -309,7 +296,7 @@ sound_handler::stopEmbedSoundInstances(EmbedSound& def)
         // Explicitly calling the base class implementation
         // is a (dirty?) way to avoid mutex-locking overrides
         // in subclasses causing deadlocks.
-        sound_handler::unplugInputStream(*i);
+        sound_handler::unplugInputStream(stream);
     }
 
     def.clearInstances();
@@ -573,11 +560,9 @@ 
sound_handler::plugInputStream(std::unique_ptr<InputStream> newStreamer)
 void
 sound_handler::unplugAllInputStreams()
 {
-    for (InputStreams::iterator it=_inputStreams.begin(),
-                                itE=_inputStreams.end();
-            it != itE; ++it)
+    for (const InputStream* stream : _inputStreams)
     {
-        delete *it;
+        delete stream;
     }
     _inputStreams.clear();
 }
@@ -602,12 +587,8 @@ sound_handler::fetchSamples(std::int16_t* to, unsigned int 
nSamples)
 #endif
 
         // Loop through the aux streamers sounds
-        for (InputStreams::iterator it=_inputStreams.begin(),
-                                    end=_inputStreams.end();
-                                    it != end; ++it)
+        for (InputStream* is : _inputStreams)
         {
-            InputStream* is = *it;
-
             unsigned int wrote = is->fetchSamples(buf.get(), nSamples);
             if (wrote < nSamples) {
                 // fill what wasn't written
@@ -664,9 +645,8 @@ sound_handler::streamingSound() const
 {
     if (_inputStreams.empty()) return false;
 
-    for (StreamingSounds::const_iterator it = _streamingSounds.begin(), 
-            e = _streamingSounds.end(); it != e; ++it) {
-        if ((*it)->isPlaying()) return true;
+    for (StreamingSoundData* const stream : _streamingSounds) {
+        if (stream->isPlaying()) return true;
     }
     return false;
 }

http://git.savannah.gnu.org/cgit//commit/?id=850f6f13f8c50f0f95c2ee3543a99f105d07db0a


commit 850f6f13f8c50f0f95c2ee3543a99f105d07db0a
Author: Bastiaan Jacques <address@hidden>
Date:   Sun Jun 1 02:24:01 2014 +0200

    Define a move constructor and a move assignment operator for as_value.

diff --git a/libcore/as_value.h b/libcore/as_value.h
index ece3337..950b375 100644
--- a/libcore/as_value.h
+++ b/libcore/as_value.h
@@ -132,6 +132,14 @@ public:
     {
     }
 
+    /// Move constructor.
+    DSOEXPORT as_value(as_value&& other)
+        : _type(other._type),
+          _value(std::move(other._value))
+    {
+        other._type = UNDEFINED;
+    }
+
     ~as_value() {}
     
     /// Construct a primitive String value 
@@ -182,6 +190,14 @@ public:
         return *this;
     }
 
+    DSOEXPORT as_value& operator=(as_value&& other)
+    {
+        _type = other._type;
+        _value = std::move(other._value);
+        other._type = UNDEFINED;
+        return *this;
+    }
+
     friend std::ostream& operator<<(std::ostream& o, const as_value&);
     
     /// Return the primitive type of this value as a string.

-----------------------------------------------------------------------

Summary of changes:
 gui/ScreenShotter.cpp                  |    6 +-
 gui/gui.cpp                            |   10 ++--
 libbase/GC.cpp                         |    5 +-
 libbase/NetworkAdapter.cpp             |    7 +--
 libbase/URLAccessManager.cpp           |    4 +-
 libbase/arg_parser.cpp                 |    4 +-
 libbase/log.cpp                        |    9 ++--
 libbase/snappingrange.h                |    4 +-
 libcore/Button.cpp                     |   25 ++++--------
 libcore/DisplayList.cpp                |   10 +----
 libcore/DisplayList.h                  |   12 ++----
 libcore/DisplayObject.cpp              |   10 ++---
 libcore/MovieClip.cpp                  |   22 +++++------
 libcore/PropertyList.cpp               |   18 ++++-----
 libcore/PropertyList.h                 |    9 ++--
 libcore/SWFCxForm.h                    |    1 -
 libcore/TextField.cpp                  |   20 +++++-----
 libcore/as_value.h                     |   16 ++++++++
 libcore/asobj/Array_as.cpp             |    5 +-
 libcore/asobj/NetConnection_as.cpp     |    8 ++--
 libcore/asobj/NetStream_as.cpp         |    5 +-
 libcore/asobj/TextSnapshot_as.cpp      |   36 +++++++-----------
 libcore/asobj/XMLNode_as.cpp           |   28 +++++--------
 libcore/asobj/XML_as.cpp               |   10 ++---
 libcore/fontlib.cpp                    |   13 +++---
 libcore/movie_root.cpp                 |   14 ++----
 libcore/parser/SWFMovieDefinition.cpp  |   18 ++++-----
 libcore/swf/DefineButtonCxformTag.cpp  |    5 +-
 libcore/swf/DefineButtonSoundTag.cpp   |    3 +-
 libcore/swf/DefinitionTag.h            |    1 -
 libcore/swf/ExportAssetsTag.h          |    5 +-
 libcore/swf/ImportAssetsTag.h          |    5 +-
 libcore/swf/ShapeRecord.cpp            |   13 ++----
 libcore/swf/ShapeRecord.h              |    5 +-
 libcore/swf/SoundStreamHeadTag.h       |    2 -
 libcore/swf/TextRecord.cpp             |    9 +---
 libcore/swf/TextRecord.h               |    4 +-
 libcore/vm/ExecutableCode.h            |    5 +-
 libcore/vm/SafeStack.h                 |    2 +-
 libmedia/AudioDecoderSpeex.cpp         |    4 +-
 libmedia/MediaHandler.cpp              |    6 +++
 libmedia/MediaHandler.h                |   10 ++++-
 libmedia/ffmpeg/VideoDecoderFfmpeg.cpp |    5 +-
 libmedia/gst/MediaHandlerGst.cpp       |    6 ---
 libmedia/gst/VideoInputGst.cpp         |    3 +-
 libmedia/haiku/MediaHandlerHaiku.cpp   |    6 ---
 librender/agg/Renderer_agg.cpp         |   64 +++++++++++--------------------
 librender/cairo/PathParser.cpp         |   12 +++---
 librender/cairo/Renderer_cairo.cpp     |   35 ++++++-----------
 librender/opengl/Renderer_ogl.cpp      |   61 +++++++++++-------------------
 libsound/EmbedSound.cpp                |    5 +-
 libsound/StreamingSoundData.cpp        |    6 +--
 libsound/sound_handler.cpp             |   48 +++++++-----------------
 53 files changed, 266 insertions(+), 393 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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