From cb65a6f640f89d1b037c0f2e4e288d8393f7df94 Mon Sep 17 00:00:00 2001
From: Andrew Meadows <andrew@highfidelity.io>
Date: Mon, 7 Dec 2015 15:21:45 -0800
Subject: [PATCH 01/28] fix cmake to build bullet-2.83

---
 cmake/externals/bullet/CMakeLists.txt | 6 +++---
 cmake/macros/TargetBullet.cmake       | 2 +-
 cmake/modules/FindBullet.cmake        | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/cmake/externals/bullet/CMakeLists.txt b/cmake/externals/bullet/CMakeLists.txt
index ff0eb22241..6eca1b5b88 100644
--- a/cmake/externals/bullet/CMakeLists.txt
+++ b/cmake/externals/bullet/CMakeLists.txt
@@ -30,9 +30,9 @@ else ()
   ExternalProject_Add(
     ${EXTERNAL_NAME}
     #URL http://bullet.googlecode.com/files/bullet-2.82-r2704.tgz
-    URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.82-ccd-fix.tgz
-    URL_MD5 fb140a4983b4109aa1c825a162aa8d64
-    CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_DEMOS=0 -DUSE_GLUT=0
+    URL http://localhost/~andrew/bullet-2.83-ccd-and-cmake-fixes.tgz
+    URL_MD5 03051bf112dcc78ddd296f9cab38fd68
+    CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0
     LOG_DOWNLOAD 1
     LOG_CONFIGURE 1
     LOG_BUILD 1
diff --git a/cmake/macros/TargetBullet.cmake b/cmake/macros/TargetBullet.cmake
index 600ae9e63b..207595d23f 100644
--- a/cmake/macros/TargetBullet.cmake
+++ b/cmake/macros/TargetBullet.cmake
@@ -15,4 +15,4 @@ macro(TARGET_BULLET)
       target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${BULLET_INCLUDE_DIRS})
     endif()
     target_link_libraries(${TARGET_NAME} ${BULLET_LIBRARIES})
-endmacro()
\ No newline at end of file
+endmacro()
diff --git a/cmake/modules/FindBullet.cmake b/cmake/modules/FindBullet.cmake
index 9ef25f7e1e..32af5ecd7a 100644
--- a/cmake/modules/FindBullet.cmake
+++ b/cmake/modules/FindBullet.cmake
@@ -88,4 +88,4 @@ find_package_handle_standard_args(Bullet "Could NOT find Bullet, try to set the
     BULLET_INCLUDE_DIRS
     BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY BULLET_SOFTBODY_LIBRARY
     BULLET_LIBRARIES
-)
\ No newline at end of file
+)

From 9231692d231a801ba2e548f9d8641dfe996d5c90 Mon Sep 17 00:00:00 2001
From: Andrew Meadows <andrew@highfidelity.io>
Date: Mon, 7 Dec 2015 17:00:38 -0800
Subject: [PATCH 02/28] fix asset URL and windows cmake command for bullet

---
 cmake/externals/bullet/CMakeLists.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmake/externals/bullet/CMakeLists.txt b/cmake/externals/bullet/CMakeLists.txt
index 6eca1b5b88..046cc301b0 100644
--- a/cmake/externals/bullet/CMakeLists.txt
+++ b/cmake/externals/bullet/CMakeLists.txt
@@ -18,9 +18,9 @@ if (WIN32)
   ExternalProject_Add(
     ${EXTERNAL_NAME}
     # URL https://bullet.googlecode.com/files/bullet-2.82-r2704.zip
-    URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.82-ccd-fix.zip
-    URL_MD5 d95b07eb120de7dd7786361c0b5a8d9f
-    CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_DEMOS=0 -DUSE_GLUT=0 -DUSE_DX11=0
+    URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.83-ccd-and-cmake-fixes.tgz
+    URL_MD5 03051bf112dcc78ddd296f9cab38fd68
+    CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0 -DUSE_DX11=0
     LOG_DOWNLOAD 1
     LOG_CONFIGURE 1
     LOG_BUILD 1
@@ -30,7 +30,7 @@ else ()
   ExternalProject_Add(
     ${EXTERNAL_NAME}
     #URL http://bullet.googlecode.com/files/bullet-2.82-r2704.tgz
-    URL http://localhost/~andrew/bullet-2.83-ccd-and-cmake-fixes.tgz
+    URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.83-ccd-and-cmake-fixes.tgz
     URL_MD5 03051bf112dcc78ddd296f9cab38fd68
     CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0
     LOG_DOWNLOAD 1

From 6d7597e9fc828e7827fa349dcc08607da2f88920 Mon Sep 17 00:00:00 2001
From: Andrew Meadows <andrew@highfidelity.io>
Date: Tue, 8 Dec 2015 10:21:42 -0800
Subject: [PATCH 03/28] remove comments and remove dangling whitespace

---
 cmake/externals/bullet/CMakeLists.txt | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/cmake/externals/bullet/CMakeLists.txt b/cmake/externals/bullet/CMakeLists.txt
index 046cc301b0..125432002c 100644
--- a/cmake/externals/bullet/CMakeLists.txt
+++ b/cmake/externals/bullet/CMakeLists.txt
@@ -4,7 +4,7 @@ if (WIN32)
   set(PLATFORM_CMAKE_ARGS "-DUSE_MSVC_RUNTIME_LIBRARY_DLL=1")
 else ()
   set(PLATFORM_CMAKE_ARGS "-DBUILD_SHARED_LIBS=1")
-  
+
   if (ANDROID)
     list(APPEND PLATFORM_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" "-DANDROID_NATIVE_API_LEVEL=19")
   elseif (APPLE)
@@ -14,10 +14,9 @@ endif ()
 
 include(ExternalProject)
 
-if (WIN32)  
+if (WIN32)
   ExternalProject_Add(
     ${EXTERNAL_NAME}
-    # URL https://bullet.googlecode.com/files/bullet-2.82-r2704.zip
     URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.83-ccd-and-cmake-fixes.tgz
     URL_MD5 03051bf112dcc78ddd296f9cab38fd68
     CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0 -DUSE_DX11=0
@@ -25,11 +24,10 @@ if (WIN32)
     LOG_CONFIGURE 1
     LOG_BUILD 1
     BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build
-  )  
+  )
 else ()
   ExternalProject_Add(
     ${EXTERNAL_NAME}
-    #URL http://bullet.googlecode.com/files/bullet-2.82-r2704.tgz
     URL http://hifi-public.s3.amazonaws.com/dependencies/bullet-2.83-ccd-and-cmake-fixes.tgz
     URL_MD5 03051bf112dcc78ddd296f9cab38fd68
     CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DBUILD_EXTRAS=0 -DINSTALL_LIBS=1 -DBUILD_BULLET3=0 -DBUILD_OPENGL3_DEMOS=0 -DBUILD_BULLET2_DEMOS=0 -DBUILD_UNIT_TESTS=0 -DUSE_GLUT=0
@@ -37,7 +35,7 @@ else ()
     LOG_CONFIGURE 1
     LOG_BUILD 1
     BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build
-  )  
+  )
 endif ()
 
 # Hide this external target (for ide users)
@@ -55,7 +53,7 @@ if (APPLE OR UNIX OR ANDROID)
   else ()
     set(BULLET_LIB_EXT "so")
   endif ()
-  
+
   set(LIB_PREFIX "lib")
 elseif (WIN32)
   set(BULLET_LIB_EXT "lib")
@@ -63,13 +61,13 @@ endif ()
 
 if (DEFINED BULLET_LIB_EXT)
   set(_BULLET_LIB_PAIRS "DYNAMICS_LIBRARY\;BulletDynamics" "COLLISION_LIBRARY\;BulletCollision" "MATH_LIBRARY\;LinearMath" "SOFTBODY_LIBRARY\;BulletSoftBody")
-  
+
   foreach(_LIB_PAIR ${_BULLET_LIB_PAIRS})
     list(GET _LIB_PAIR 0 _LIB_VAR_NAME)
     list(GET _LIB_PAIR 1 _LIB_NAME)
-    
+
     set(${EXTERNAL_NAME_UPPER}_${_LIB_VAR_NAME}_RELEASE ${BULLET_LIB_DIR}/${LIB_PREFIX}${_LIB_NAME}.${BULLET_LIB_EXT} CACHE FILEPATH "${_LIB_NAME} release library location")
-    
+
     if (WIN32)
       set(${EXTERNAL_NAME_UPPER}_${_LIB_VAR_NAME}_DEBUG ${BULLET_LIB_DIR}/${LIB_PREFIX}${_LIB_NAME}_Debug.${BULLET_LIB_EXT} CACHE FILEPATH "${_LIB_NAME} debug library location")
     else ()

From a07d7494f011b104e56f9d0527e5d43b3072a9b4 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Thu, 10 Dec 2015 17:08:34 -0800
Subject: [PATCH 04/28] More OS X warning cleanup

---
 interface/src/avatar/Avatar.h                 | 26 +++++------
 .../display-plugins/OpenGLDisplayPlugin.cpp   |  5 +-
 .../src/RenderableModelEntityItem.h           |  2 +-
 libraries/entities/src/EntityItem.h           |  2 +-
 libraries/entities/src/EntityTree.h           | 46 +++++++++----------
 libraries/octree/src/JurisdictionListener.h   |  2 +-
 libraries/octree/src/JurisdictionSender.h     |  2 +-
 libraries/physics/src/CharacterController.h   |  4 +-
 8 files changed, 45 insertions(+), 44 deletions(-)

diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h
index 09685c318e..4e775ad425 100644
--- a/interface/src/avatar/Avatar.h
+++ b/interface/src/avatar/Avatar.h
@@ -100,25 +100,25 @@ public:
     /// Returns the distance to use as a LOD parameter.
     float getLODDistance() const;
 
-    virtual bool isMyAvatar() const { return false; }
+    virtual bool isMyAvatar() const override { return false; }
 
-    virtual QVector<glm::quat> getJointRotations() const;
-    virtual glm::quat getJointRotation(int index) const;
-    virtual glm::vec3 getJointTranslation(int index) const;
-    virtual int getJointIndex(const QString& name) const;
-    virtual QStringList getJointNames() const;
+    virtual QVector<glm::quat> getJointRotations() const override;
+    virtual glm::quat getJointRotation(int index) const override;
+    virtual glm::vec3 getJointTranslation(int index) const override;
+    virtual int getJointIndex(const QString& name) const override;
+    virtual QStringList getJointNames() const override;
 
     virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
     virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
 
-    virtual void setFaceModelURL(const QUrl& faceModelURL);
-    virtual void setSkeletonModelURL(const QUrl& skeletonModelURL);
-    virtual void setAttachmentData(const QVector<AttachmentData>& attachmentData);
-    virtual void setBillboard(const QByteArray& billboard);
+    virtual void setFaceModelURL(const QUrl& faceModelURL) override;
+    virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
+    virtual void setAttachmentData(const QVector<AttachmentData>& attachmentData) override;
+    virtual void setBillboard(const QByteArray& billboard) override;
 
     void setShowDisplayName(bool showDisplayName);
 
-    virtual int parseDataFromBuffer(const QByteArray& buffer);
+    virtual int parseDataFromBuffer(const QByteArray& buffer) override;
 
     static void renderJointConnectingCone( gpu::Batch& batch, glm::vec3 position1, glm::vec3 position2,
                                                 float radius1, float radius2, const glm::vec4& color);
@@ -144,7 +144,7 @@ public:
     void scaleVectorRelativeToPosition(glm::vec3 &positionToScale) const;
 
     void slamPosition(const glm::vec3& position);
-    virtual void updateAttitude() { _skeletonModel.updateAttitude(); }
+    virtual void updateAttitude() override { _skeletonModel.updateAttitude(); }
 
     // Call this when updating Avatar position with a delta.  This will allow us to
     // _accurately_ measure position changes and compute the resulting velocity
@@ -217,7 +217,7 @@ protected:
     virtual bool shouldRenderHead(const RenderArgs* renderArgs) const;
     virtual void fixupModelsInScene();
 
-    virtual void updateJointMappings();
+    virtual void updateJointMappings() override;
 
     render::ItemID _renderItemID;
 
diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
index 880e4a16b3..58fd53e39d 100644
--- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
+++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
@@ -15,7 +15,8 @@
 
 #include <QtOpenGL/QGLWidget>
 #include <QtGui/QImage>
-#include <QtGui/QOpenGLContext>
+
+#include <QOpenGLContextWrapper.h>
 
 #include <gl/GLWidget.h>
 #include <NumericalConstants.h>
@@ -104,7 +105,7 @@ public:
 
             // take the latest texture and present it
             _context->makeCurrent();
-            if (QOpenGLContext::currentContext() == _context->contextHandle()) {
+            if (isCurrentContext(_context->contextHandle())) {
                 currentPlugin->present();
                 _context->doneCurrent();
             } else {
diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.h b/libraries/entities-renderer/src/RenderableModelEntityItem.h
index 0aaa7a0977..143113146e 100644
--- a/libraries/entities-renderer/src/RenderableModelEntityItem.h
+++ b/libraries/entities-renderer/src/RenderableModelEntityItem.h
@@ -29,7 +29,7 @@ public:
     virtual ~RenderableModelEntityItem();
 
     virtual void setDimensions(const glm::vec3& value) override;
-    virtual void setModelURL(const QString& url);
+    virtual void setModelURL(const QString& url) override;
 
     virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
     virtual bool setProperties(const EntityItemProperties& properties) override;
diff --git a/libraries/entities/src/EntityItem.h b/libraries/entities/src/EntityItem.h
index a1fc89c5e0..244198f7b8 100644
--- a/libraries/entities/src/EntityItem.h
+++ b/libraries/entities/src/EntityItem.h
@@ -389,7 +389,7 @@ protected:
     const QByteArray getActionDataInternal() const;
     void setActionDataInternal(QByteArray actionData);
 
-    virtual void locationChanged();
+    virtual void locationChanged() override;
     EntityTypes::EntityType _type;
     quint64 _lastSimulated; // last time this entity called simulate(), this includes velocity, angular velocity,
                             // and physics changes
diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h
index e893c69259..5e54e562a0 100644
--- a/libraries/entities/src/EntityTree.h
+++ b/libraries/entities/src/EntityTree.h
@@ -58,7 +58,7 @@ public:
     void createRootElement();
 
     /// Implements our type specific root element factory
-    virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL);
+    virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL) override;
 
     /// Type safe version of getRoot()
     EntityTreeElementPointer getRoot() {
@@ -68,15 +68,15 @@ public:
         return std::static_pointer_cast<EntityTreeElement>(_rootElement);
     }
 
-    virtual void eraseAllOctreeElements(bool createNewRoot = true);
+    virtual void eraseAllOctreeElements(bool createNewRoot = true) override;
 
     // These methods will allow the OctreeServer to send your tree inbound edit packets of your
     // own definition. Implement these to allow your octree based server to support editing
-    virtual bool getWantSVOfileVersions() const { return true; }
-    virtual PacketType expectedDataPacketType() const { return PacketType::EntityData; }
-    virtual bool canProcessVersion(PacketVersion thisVersion) const
+    virtual bool getWantSVOfileVersions() const override { return true; }
+    virtual PacketType expectedDataPacketType() const override { return PacketType::EntityData; }
+    virtual bool canProcessVersion(PacketVersion thisVersion) const override
                     { return thisVersion >= VERSION_ENTITIES_USE_METERS_AND_RADIANS; }
-    virtual bool handlesEditPacketType(PacketType packetType) const;
+    virtual bool handlesEditPacketType(PacketType packetType) const override;
     void fixupTerseEditLogging(EntityItemProperties& properties, QList<QString>& changedProperties);
     virtual int processEditPacketData(ReceivedMessage& message, const unsigned char* editData, int maxLength,
                                       const SharedNodePointer& senderNode) override;
@@ -89,18 +89,18 @@ public:
         bool* accurateResult = NULL,
         bool precisionPicking = false);
 
-    virtual bool rootElementHasData() const { return true; }
+    virtual bool rootElementHasData() const override { return true; }
 
     // the root at least needs to store the number of entities in the packet/buffer
-    virtual int minimumRequiredRootDataBytes() const { return sizeof(uint16_t); }
-    virtual bool suppressEmptySubtrees() const { return false; }
-    virtual void releaseSceneEncodeData(OctreeElementExtraEncodeData* extraEncodeData) const;
-    virtual bool mustIncludeAllChildData() const { return false; }
+    virtual int minimumRequiredRootDataBytes() const override { return sizeof(uint16_t); }
+    virtual bool suppressEmptySubtrees() const override { return false; }
+    virtual void releaseSceneEncodeData(OctreeElementExtraEncodeData* extraEncodeData) const override;
+    virtual bool mustIncludeAllChildData() const override { return false; }
 
-    virtual bool versionHasSVOfileBreaks(PacketVersion thisVersion) const
+    virtual bool versionHasSVOfileBreaks(PacketVersion thisVersion) const override
                     { return thisVersion >= VERSION_ENTITIES_HAS_FILE_BREAKS; }
 
-    virtual void update();
+    virtual void update() override;
 
     // The newer API...
     void postAddEntity(EntityItemPointer entityItem);
@@ -177,8 +177,8 @@ public:
     EntityTreeElementPointer getContainingElement(const EntityItemID& entityItemID)  /*const*/;
     void setContainingElement(const EntityItemID& entityItemID, EntityTreeElementPointer element);
     void debugDumpMap();
-    virtual void dumpTree();
-    virtual void pruneTree();
+    virtual void dumpTree() override;
+    virtual void pruneTree() override;
 
     QVector<EntityItemID> sendEntities(EntityEditPacketSender* packetSender, EntityTreePointer localTree,
                                        float x, float y, float z);
@@ -198,12 +198,12 @@ public:
 
     void remapIDs();
 
-    bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues);
-    bool readFromMap(QVariantMap& entityDescription);
+    virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues) override;
+    virtual bool readFromMap(QVariantMap& entityDescription) override;
 
     float getContentsLargestDimension();
 
-    virtual void resetEditStats() {
+    virtual void resetEditStats() override {
         _totalEditMessages = 0;
         _totalUpdates = 0;
         _totalCreates = 0;
@@ -214,11 +214,11 @@ public:
         _totalLoggingTime = 0;
     }
 
-    virtual quint64 getAverageDecodeTime() const { return _totalEditMessages == 0 ? 0 : _totalDecodeTime / _totalEditMessages; }
-    virtual quint64 getAverageLookupTime() const { return _totalEditMessages == 0 ? 0 : _totalLookupTime / _totalEditMessages; }
-    virtual quint64 getAverageUpdateTime() const { return _totalUpdates == 0 ? 0 : _totalUpdateTime / _totalUpdates; }
-    virtual quint64 getAverageCreateTime() const { return _totalCreates == 0 ? 0 : _totalCreateTime / _totalCreates; }
-    virtual quint64 getAverageLoggingTime() const { return _totalEditMessages == 0 ? 0 : _totalLoggingTime / _totalEditMessages; }
+    virtual quint64 getAverageDecodeTime() const override { return _totalEditMessages == 0 ? 0 : _totalDecodeTime / _totalEditMessages; }
+    virtual quint64 getAverageLookupTime() const override { return _totalEditMessages == 0 ? 0 : _totalLookupTime / _totalEditMessages; }
+    virtual quint64 getAverageUpdateTime() const override { return _totalUpdates == 0 ? 0 : _totalUpdateTime / _totalUpdates; }
+    virtual quint64 getAverageCreateTime() const override { return _totalCreates == 0 ? 0 : _totalCreateTime / _totalCreates; }
+    virtual quint64 getAverageLoggingTime() const override { return _totalEditMessages == 0 ? 0 : _totalLoggingTime / _totalEditMessages; }
 
     void trackIncomingEntityLastEdited(quint64 lastEditedTime, int bytesRead);
     quint64 getAverageEditDeltas() const
diff --git a/libraries/octree/src/JurisdictionListener.h b/libraries/octree/src/JurisdictionListener.h
index 0c713ca27f..7aee1659ff 100644
--- a/libraries/octree/src/JurisdictionListener.h
+++ b/libraries/octree/src/JurisdictionListener.h
@@ -32,7 +32,7 @@ public:
 
     JurisdictionListener(NodeType_t type = NodeType::EntityServer);
     
-    virtual bool process();
+    virtual bool process() override;
 
     NodeToJurisdictionMap* getJurisdictions() { return &_jurisdictions; }
 
diff --git a/libraries/octree/src/JurisdictionSender.h b/libraries/octree/src/JurisdictionSender.h
index a0a3b5b4dd..b2d738cd36 100644
--- a/libraries/octree/src/JurisdictionSender.h
+++ b/libraries/octree/src/JurisdictionSender.h
@@ -32,7 +32,7 @@ public:
 
     void setJurisdiction(JurisdictionMap* map) { _jurisdictionMap = map; }
 
-    virtual bool process();
+    virtual bool process() override;
 
     NodeType_t getNodeType() const { return _nodeType; }
     void setNodeType(NodeType_t type) { _nodeType = type; }
diff --git a/libraries/physics/src/CharacterController.h b/libraries/physics/src/CharacterController.h
index 6edbabdab8..88c02d0940 100644
--- a/libraries/physics/src/CharacterController.h
+++ b/libraries/physics/src/CharacterController.h
@@ -43,7 +43,7 @@ public:
     virtual void updateShapeIfNecessary() = 0;
 
     // overrides from btCharacterControllerInterface
-    virtual void setWalkDirection(const btVector3 &walkDirection) { assert(false); }
+    virtual void setWalkDirection(const btVector3 &walkDirection) override { assert(false); }
     virtual void setVelocityForTimeInterval(const btVector3 &velocity, btScalar timeInterval) override { assert(false); }
     virtual void reset(btCollisionWorld* collisionWorld) override { }
     virtual void warp(const btVector3& origin) override { }
@@ -57,7 +57,7 @@ public:
     virtual void playerStep(btCollisionWorld *collisionWorld, btScalar dt) override;
     virtual bool canJump() const override { assert(false); return false; } // never call this
     virtual void jump() override;
-    virtual bool onGround() const;
+    virtual bool onGround() const override;
 
     void preSimulation();
     void postSimulation();

From 66ed8dc0531c7472485162fdbddc1e8edea6b148 Mon Sep 17 00:00:00 2001
From: Ryan Huffman <ryanhuffman@gmail.com>
Date: Fri, 11 Dec 2015 14:51:14 -0800
Subject: [PATCH 05/28] Add AssignmentParentFinder to Agent

---
 assignment-client/src/Agent.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/assignment-client/src/Agent.cpp b/assignment-client/src/Agent.cpp
index 46fa8c8181..f4c4ffaf99 100644
--- a/assignment-client/src/Agent.cpp
+++ b/assignment-client/src/Agent.cpp
@@ -37,6 +37,7 @@
 #include <EntityScriptingInterface.h> // TODO: consider moving to scriptengine.h
 
 #include "avatars/ScriptableAvatar.h"
+#include "entities/AssignmentParentFinder.h"
 #include "RecordingScriptingInterface.h"
 #include "AbstractAudioInterface.h"
 
@@ -62,6 +63,8 @@ Agent::Agent(ReceivedMessage& message) :
     connect(assetThread, &QThread::started, assetClient.data(), &AssetClient::init);
     assetThread->start();
 
+    DependencyManager::registerInheritance<SpatialParentFinder, AssignmentParentFinder>();
+
     DependencyManager::set<ResourceCacheSharedItems>();
     DependencyManager::set<SoundCache>();
     DependencyManager::set<AudioInjectorManager>();
@@ -284,6 +287,8 @@ void Agent::executeScript() {
 
     entityScriptingInterface->setEntityTree(_entityViewer.getTree());
 
+    DependencyManager::set<AssignmentParentFinder>(_entityViewer.getTree());
+
     // wire up our additional agent related processing to the update signal
     QObject::connect(_scriptEngine.get(), &ScriptEngine::update, this, &Agent::processAgentAvatarAndAudio);
 

From f72eb679c691ae53a399526345c1cc421efc701d Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 15:04:33 -0800
Subject: [PATCH 06/28] More warning fixes

---
 libraries/gl/src/gl/GLEscrow.h              | 1 -
 libraries/gl/src/gl/OffscreenGLCanvas.cpp   | 3 +++
 libraries/gl/src/gl/OffscreenGLCanvas.h     | 3 ++-
 libraries/gl/src/gl/OffscreenQmlSurface.cpp | 8 +++-----
 libraries/octree/src/OctreeQuery.cpp        | 2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/libraries/gl/src/gl/GLEscrow.h b/libraries/gl/src/gl/GLEscrow.h
index d860f1239c..511dec6a10 100644
--- a/libraries/gl/src/gl/GLEscrow.h
+++ b/libraries/gl/src/gl/GLEscrow.h
@@ -15,7 +15,6 @@
 #include <deque>
 #include <forward_list>
 #include <functional>
-#include <GL/glew.h>
 #include <mutex>
 
 #include <SharedUtil.h>
diff --git a/libraries/gl/src/gl/OffscreenGLCanvas.cpp b/libraries/gl/src/gl/OffscreenGLCanvas.cpp
index 640c8ed5f5..6ce80296e9 100644
--- a/libraries/gl/src/gl/OffscreenGLCanvas.cpp
+++ b/libraries/gl/src/gl/OffscreenGLCanvas.cpp
@@ -76,3 +76,6 @@ void OffscreenGLCanvas::doneCurrent() {
     _context->doneCurrent();
 }
 
+QObject* OffscreenGLCanvas::getContextObject() {
+    return _context;
+}
diff --git a/libraries/gl/src/gl/OffscreenGLCanvas.h b/libraries/gl/src/gl/OffscreenGLCanvas.h
index e278f550f0..0f02e7c76f 100644
--- a/libraries/gl/src/gl/OffscreenGLCanvas.h
+++ b/libraries/gl/src/gl/OffscreenGLCanvas.h
@@ -29,7 +29,8 @@ public:
     QOpenGLContext* getContext() {
         return _context;
     }
-
+    QObject* getContextObject();
+    
 protected:
     std::once_flag _reportOnce;
     QOpenGLContext* _context;
diff --git a/libraries/gl/src/gl/OffscreenQmlSurface.cpp b/libraries/gl/src/gl/OffscreenQmlSurface.cpp
index d30294ae7c..bddc7d19ae 100644
--- a/libraries/gl/src/gl/OffscreenQmlSurface.cpp
+++ b/libraries/gl/src/gl/OffscreenQmlSurface.cpp
@@ -17,15 +17,14 @@
 #include <QtQuick/QQuickRenderControl>
 #include <QtCore/QWaitCondition>
 #include <QtCore/QMutex>
-#include <QtGui/QOpenGLContext>
 
 #include <shared/NsightHelpers.h>
 #include <PerfStat.h>
 #include <DependencyManager.h>
 #include <NumericalConstants.h>
 
-#include "GLEscrow.h"
 #include "OffscreenGLCanvas.h"
+#include "GLEscrow.h"
 
 
 // Time between receiving a request to render the offscreen UI actually triggering
@@ -60,7 +59,6 @@ static const QEvent::Type INIT = QEvent::Type(QEvent::User + 1);
 static const QEvent::Type RENDER = QEvent::Type(QEvent::User + 2);
 static const QEvent::Type RESIZE = QEvent::Type(QEvent::User + 3);
 static const QEvent::Type STOP = QEvent::Type(QEvent::User + 4);
-static const QEvent::Type UPDATE = QEvent::Type(QEvent::User + 5);
 
 class OffscreenQmlRenderer : public OffscreenGLCanvas {
     friend class OffscreenQmlSurface;
@@ -84,7 +82,7 @@ public:
 
         // Qt 5.5
         _renderControl->prepareThread(&_thread);
-        _context->moveToThread(&_thread);
+        getContextObject()->moveToThread(&_thread);
         moveToThread(&_thread);
         _thread.setObjectName("QML Thread");
         _thread.start();
@@ -176,7 +174,7 @@ private:
 
         doneCurrent();
 
-        _context->moveToThread(QCoreApplication::instance()->thread());
+        getContextObject()->moveToThread(QCoreApplication::instance()->thread());
         _cond.wakeOne();
     }
 
diff --git a/libraries/octree/src/OctreeQuery.cpp b/libraries/octree/src/OctreeQuery.cpp
index 5a30e178f8..0e7f565c00 100644
--- a/libraries/octree/src/OctreeQuery.cpp
+++ b/libraries/octree/src/OctreeQuery.cpp
@@ -109,7 +109,7 @@ int OctreeQuery::parseData(ReceivedMessage& message) {
 
     auto bytesRead = sourceBuffer - startPosition;
     auto bytesLeft = message.getSize() - bytesRead;
-    if (bytesLeft >= sizeof(_keyholeRadius)) {
+    if (bytesLeft >= (int)sizeof(_keyholeRadius)) {
         memcpy(&_keyholeRadius, sourceBuffer, sizeof(_keyholeRadius));
         sourceBuffer += sizeof(_keyholeRadius);
     }

From ce51350b6500306e68b0d376a7ce1ec1d60440de Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 11:47:59 -0800
Subject: [PATCH 07/28] Fix warnings on windows 64bit

---
 assignment-client/src/Agent.cpp               |  2 +-
 .../src/audio/AudioMixerClientData.cpp        |  2 +-
 .../octree/OctreeInboundPacketProcessor.cpp   |  2 +-
 interface/src/Application.cpp                 |  2 +-
 interface/src/devices/DeviceTracker.cpp       |  4 +--
 interface/src/devices/Faceshift.cpp           |  2 +-
 interface/src/devices/MotionTracker.cpp       |  2 +-
 interface/src/devices/MotionTracker.h         |  2 +-
 interface/src/ui/Stats.cpp                    | 16 ++++++------
 .../animation/src/AnimBlendLinearMove.cpp     |  8 +++---
 libraries/animation/src/AnimClip.cpp          |  6 ++---
 .../animation/src/AnimInverseKinematics.cpp   | 12 ++++-----
 libraries/animation/src/AnimSkeleton.cpp      |  6 ++---
 libraries/animation/src/AnimSkeleton.h        |  2 +-
 libraries/animation/src/Rig.cpp               | 10 +++----
 libraries/animation/src/Rig.h                 |  2 +-
 .../animation/src/SwingTwistConstraint.cpp    |  6 ++---
 libraries/audio-client/src/AudioClient.cpp    |  4 +--
 .../src/RenderableBoxEntityItem.cpp           |  2 +-
 .../RenderableParticleEffectEntityItem.cpp    |  2 +-
 .../src/RenderablePolyVoxEntityItem.cpp       |  2 +-
 .../src/RenderableSphereEntityItem.cpp        |  2 +-
 libraries/entities/src/EntityItem.cpp         |  4 +--
 .../entities/src/EntityItemProperties.cpp     |  2 +-
 libraries/entities/src/EntityTree.cpp         |  4 +--
 libraries/environment/src/EnvironmentData.cpp |  4 +--
 libraries/environment/src/EnvironmentData.h   |  4 +--
 libraries/fbx/src/FBXReader.h                 |  3 +--
 libraries/fbx/src/FBXReader_Mesh.cpp          |  2 +-
 libraries/gpu/src/gpu/GLBackendOutput.cpp     | 10 +++----
 libraries/gpu/src/gpu/GLBackendTexture.cpp    |  4 +--
 libraries/gpu/src/gpu/Texture.cpp             |  2 +-
 .../src/model-networking/ModelCache.cpp       |  4 +--
 libraries/model/src/model/Geometry.h          |  8 +++---
 libraries/networking/src/LimitedNodeList.h    |  2 +-
 libraries/networking/src/PacketSender.cpp     |  2 +-
 libraries/networking/src/PacketSender.h       |  2 +-
 .../networking/src/ReceivedPacketProcessor.h  |  2 +-
 libraries/networking/src/udt/PacketList.cpp   |  2 +-
 libraries/networking/src/udt/PacketList.h     |  2 +-
 libraries/octree/src/JurisdictionMap.cpp      |  2 +-
 libraries/octree/src/JurisdictionMap.h        |  2 +-
 libraries/octree/src/Octree.cpp               |  8 +++---
 .../octree/src/OctreeEditPacketSender.cpp     |  4 +--
 libraries/octree/src/OctreePacketData.cpp     |  2 +-
 libraries/octree/src/OctreeSceneStats.cpp     | 14 +++++-----
 .../octree/src/OctreeScriptingInterface.h     |  2 +-
 libraries/physics/src/MeshMassProperties.cpp  |  4 +--
 .../procedural/src/procedural/Procedural.cpp  |  4 +--
 libraries/render-utils/src/AnimDebugDraw.cpp  |  6 ++---
 .../src/DeferredLightingEffect.cpp            |  2 +-
 libraries/render-utils/src/GeometryCache.cpp  | 26 +++++++++----------
 libraries/render-utils/src/Model.h            |  2 +-
 .../render-utils/src/RenderDeferredTask.cpp   | 16 ++++++------
 libraries/render/src/render/DrawTask.h        |  2 +-
 libraries/render/src/render/Scene.h           |  2 +-
 libraries/shared/src/BufferParser.h           |  2 +-
 libraries/shared/src/PropertyFlags.h          |  4 +--
 libraries/shared/src/RenderArgs.h             |  4 +--
 libraries/shared/src/SharedUtil.cpp           |  4 +--
 libraries/shared/src/shared/JSONHelpers.cpp   |  4 +--
 tests/entities/src/main.cpp                   |  2 +-
 tests/gpu-test/src/main.cpp                   |  8 +++---
 tests/render-utils/src/main.cpp               |  2 +-
 tests/ui/src/main.cpp                         |  2 +-
 tools/scribe/src/TextTemplate.cpp             |  4 +--
 tools/udt-test/src/UDTTest.cpp                |  4 +--
 tools/vhacd-util/src/VHACDUtil.cpp            |  6 ++---
 68 files changed, 152 insertions(+), 153 deletions(-)

diff --git a/assignment-client/src/Agent.cpp b/assignment-client/src/Agent.cpp
index 46fa8c8181..610fab3d35 100644
--- a/assignment-client/src/Agent.cpp
+++ b/assignment-client/src/Agent.cpp
@@ -384,7 +384,7 @@ void Agent::processAgentAvatarAndAudio(float deltaTime) {
                 int numAvailableBytes = (soundByteArray.size() - _numAvatarSoundSentBytes) > SCRIPT_AUDIO_BUFFER_BYTES
                     ? SCRIPT_AUDIO_BUFFER_BYTES
                     : soundByteArray.size() - _numAvatarSoundSentBytes;
-                numAvailableSamples = numAvailableBytes / sizeof(int16_t);
+                numAvailableSamples = (int16_t)numAvailableBytes / sizeof(int16_t);
 
 
                 // check if the all of the _numAvatarAudioBufferSamples to be sent are silence
diff --git a/assignment-client/src/audio/AudioMixerClientData.cpp b/assignment-client/src/audio/AudioMixerClientData.cpp
index 729e9fa633..f2fa29f12c 100644
--- a/assignment-client/src/audio/AudioMixerClientData.cpp
+++ b/assignment-client/src/audio/AudioMixerClientData.cpp
@@ -171,7 +171,7 @@ void AudioMixerClientData::sendAudioStreamStatsPackets(const SharedNodePointer&
         statsPacket->writePrimitive(appendFlag);
         appendFlag = 1;
 
-        int numStreamStatsRoomFor = (statsPacket->size() - sizeof(quint8) - sizeof(quint16)) / sizeof(AudioStreamStats);
+        int numStreamStatsRoomFor = (int)(statsPacket->size() - sizeof(quint8) - sizeof(quint16)) / sizeof(AudioStreamStats);
 
         // calculate and pack the number of stream stats to follow
         quint16 numStreamStatsToPack = std::min(numStreamStatsRemaining, numStreamStatsRoomFor);
diff --git a/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp b/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp
index 6e4e822196..c5d010871c 100644
--- a/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp
+++ b/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp
@@ -293,7 +293,7 @@ int OctreeInboundPacketProcessor::sendNackPackets() {
 
             qDebug() << "NACK Sent back to editor/client... destinationNode=" << nodeUUID;
 
-            packetsSent += nackPacketList->getNumPackets();
+            packetsSent += (int)nackPacketList->getNumPackets();
 
             // send the list of nack packets
             totalBytesSent += nodeList->sendPacketList(std::move(nackPacketList), *destinationNode);
diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp
index 24175c0cac..b420dca1a7 100644
--- a/interface/src/Application.cpp
+++ b/interface/src/Application.cpp
@@ -3054,7 +3054,7 @@ int Application::sendNackPackets() {
             }
 
             if (nackPacketList->getNumPackets()) {
-                packetsSent += nackPacketList->getNumPackets();
+                packetsSent += (int)nackPacketList->getNumPackets();
 
                 // send the packet list
                 nodeList->sendPacketList(std::move(nackPacketList), *node);
diff --git a/interface/src/devices/DeviceTracker.cpp b/interface/src/devices/DeviceTracker.cpp
index 2a956a42de..2cd4950064 100644
--- a/interface/src/devices/DeviceTracker.cpp
+++ b/interface/src/devices/DeviceTracker.cpp
@@ -20,7 +20,7 @@ DeviceTracker::SingletonData::~SingletonData() {
 }
 
 int DeviceTracker::getNumDevices() {
-    return Singleton::get()->_devicesMap.size();
+    return (int)Singleton::get()->_devicesMap.size();
 }
 
 DeviceTracker::ID DeviceTracker::getDeviceID(const Name& name) {
@@ -58,7 +58,7 @@ DeviceTracker::ID DeviceTracker::registerDevice(const Name& name, DeviceTracker*
     }
 
     // Good to register the device
-    deviceID = Singleton::get()->_devicesVector.size();
+    deviceID = (ID)Singleton::get()->_devicesVector.size();
     Singleton::get()->_devicesMap.insert(Map::value_type(name, deviceID));
     Singleton::get()->_devicesVector.push_back(device);
     device->assignIDAndName(deviceID, name);
diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp
index a25135cd76..3596c79419 100644
--- a/interface/src/devices/Faceshift.cpp
+++ b/interface/src/devices/Faceshift.cpp
@@ -255,7 +255,7 @@ void Faceshift::receive(const QByteArray& buffer) {
             }
             case fsMsg::MSG_OUT_BLENDSHAPE_NAMES: {
                 const vector<string>& names = static_pointer_cast<fsMsgBlendshapeNames>(msg)->blendshape_names();
-                for (size_t i = 0; i < names.size(); i++) {
+                for (auto i = 0; i < names.size(); i++) {
                     if (names[i] == "EyeBlink_L") {
                         _leftBlinkIndex = i;
 
diff --git a/interface/src/devices/MotionTracker.cpp b/interface/src/devices/MotionTracker.cpp
index 97c02b48bf..234a8d0c0c 100644
--- a/interface/src/devices/MotionTracker.cpp
+++ b/interface/src/devices/MotionTracker.cpp
@@ -90,7 +90,7 @@ MotionTracker::Index MotionTracker::addJoint(const Semantic& semantic, Index par
     
 
     // All good then allocate the joint
-    Index newIndex = _jointsArray.size();
+    Index newIndex = (Index)_jointsArray.size();
     _jointsArray.push_back(JointTracker(semantic, parent));
     _jointsMap.insert(JointTracker::Map::value_type(semantic, newIndex));
 
diff --git a/interface/src/devices/MotionTracker.h b/interface/src/devices/MotionTracker.h
index edfd3ae991..a4b5e6735e 100644
--- a/interface/src/devices/MotionTracker.h
+++ b/interface/src/devices/MotionTracker.h
@@ -90,7 +90,7 @@ public:
 
     virtual bool isConnected() const;
 
-    Index numJointTrackers() const { return _jointsArray.size(); }
+    Index numJointTrackers() const { return (Index)_jointsArray.size(); }
 
     /// Access a Joint from it's index.
     /// Index 0 is always the "Root".
diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp
index 55751d8631..6acacee41d 100644
--- a/interface/src/ui/Stats.cpp
+++ b/interface/src/ui/Stats.cpp
@@ -118,7 +118,7 @@ void Stats::updateStats(bool force) {
     STAT_UPDATE(avatarCount, avatarManager->size() - 1);
     STAT_UPDATE(avatarRenderableCount, avatarManager->getNumberInRenderRange());
     STAT_UPDATE(avatarRenderDistance, (int) round(avatarManager->getRenderDistance())); // deliberately truncating
-    STAT_UPDATE(serverCount, nodeList->size());
+    STAT_UPDATE(serverCount, (int)nodeList->size());
     STAT_UPDATE(renderrate, (int)qApp->getFps());
     if (qApp->getActiveDisplayPlugin()) {
         STAT_UPDATE(presentrate, (int)round(qApp->getActiveDisplayPlugin()->presentRate()));
@@ -270,7 +270,7 @@ void Stats::updateStats(bool force) {
     if (voxelPacketsToProcess == 0) {
         _resetRecentMaxPacketsSoon = true;
     } else if (voxelPacketsToProcess > _recentMaxPackets) {
-        _recentMaxPackets = voxelPacketsToProcess;
+        _recentMaxPackets = (int)voxelPacketsToProcess;
     }
 
     // Server Octree Elements
@@ -344,18 +344,18 @@ void Stats::setRenderDetails(const RenderDetails& details) {
     STAT_UPDATE(triangles, details._trianglesRendered);
     STAT_UPDATE(materialSwitches, details._materialSwitches);
     if (_expanded) {
-        STAT_UPDATE(opaqueConsidered, details._opaque._considered);
+        STAT_UPDATE(opaqueConsidered, (int)details._opaque._considered);
         STAT_UPDATE(opaqueOutOfView, details._opaque._outOfView);
         STAT_UPDATE(opaqueTooSmall, details._opaque._tooSmall);
-        STAT_UPDATE(opaqueRendered, details._opaque._rendered);
-        STAT_UPDATE(translucentConsidered, details._translucent._considered);
+        STAT_UPDATE(opaqueRendered, (int)details._opaque._rendered);
+        STAT_UPDATE(translucentConsidered, (int)details._translucent._considered);
         STAT_UPDATE(translucentOutOfView, details._translucent._outOfView);
         STAT_UPDATE(translucentTooSmall, details._translucent._tooSmall);
-        STAT_UPDATE(translucentRendered, details._translucent._rendered);
-        STAT_UPDATE(otherConsidered, details._other._considered);
+        STAT_UPDATE(translucentRendered, (int)details._translucent._rendered);
+        STAT_UPDATE(otherConsidered, (int)details._other._considered);
         STAT_UPDATE(otherOutOfView, details._other._outOfView);
         STAT_UPDATE(otherTooSmall, details._other._tooSmall);
-        STAT_UPDATE(otherRendered, details._other._rendered);
+        STAT_UPDATE(otherRendered, (int)details._other._rendered);
     }
 }
 
diff --git a/libraries/animation/src/AnimBlendLinearMove.cpp b/libraries/animation/src/AnimBlendLinearMove.cpp
index d8985f8b72..3be6a0f1b8 100644
--- a/libraries/animation/src/AnimBlendLinearMove.cpp
+++ b/libraries/animation/src/AnimBlendLinearMove.cpp
@@ -46,10 +46,10 @@ const AnimPoseVec& AnimBlendLinearMove::evaluate(const AnimVariantMap& animVars,
         evaluateAndBlendChildren(animVars, triggersOut, alpha, prevPoseIndex, nextPoseIndex, prevDeltaTime, nextDeltaTime);
     } else {
 
-        float clampedAlpha = glm::clamp(_alpha, 0.0f, (float)(_children.size() - 1));
-        size_t prevPoseIndex = glm::floor(clampedAlpha);
-        size_t nextPoseIndex = glm::ceil(clampedAlpha);
-        float alpha = glm::fract(clampedAlpha);
+        auto clampedAlpha = glm::clamp(_alpha, 0.0f, (float)(_children.size() - 1));
+        auto prevPoseIndex = glm::floor(clampedAlpha);
+        auto nextPoseIndex = glm::ceil(clampedAlpha);
+        auto alpha = glm::fract(clampedAlpha);
         float prevDeltaTime, nextDeltaTime;
         setFrameAndPhase(dt, alpha, prevPoseIndex, nextPoseIndex, &prevDeltaTime, &nextDeltaTime, triggersOut);
         evaluateAndBlendChildren(animVars, triggersOut, alpha, prevPoseIndex, nextPoseIndex, prevDeltaTime, nextDeltaTime);
diff --git a/libraries/animation/src/AnimClip.cpp b/libraries/animation/src/AnimClip.cpp
index 9eed3ad14c..986bb0a30e 100644
--- a/libraries/animation/src/AnimClip.cpp
+++ b/libraries/animation/src/AnimClip.cpp
@@ -57,7 +57,7 @@ const AnimPoseVec& AnimClip::evaluate(const AnimVariantMap& animVars, float dt,
 
         // It can be quite possible for the user to set _startFrame and _endFrame to
         // values before or past valid ranges.  We clamp the frames here.
-        int frameCount = _anim.size();
+        int frameCount = (int)_anim.size();
         prevIndex = std::min(std::max(0, prevIndex), frameCount - 1);
         nextIndex = std::min(std::max(0, nextIndex), frameCount - 1);
 
@@ -92,8 +92,8 @@ void AnimClip::copyFromNetworkAnim() {
     // by matching joints with the same name.
     const FBXGeometry& geom = _networkAnim->getGeometry();
     AnimSkeleton animSkeleton(geom);
-    const int animJointCount = animSkeleton.getNumJoints();
-    const int skeletonJointCount = _skeleton->getNumJoints();
+    const auto animJointCount = animSkeleton.getNumJoints();
+    const auto skeletonJointCount = _skeleton->getNumJoints();
     std::vector<int> jointMap;
     jointMap.reserve(animJointCount);
     for (int i = 0; i < animJointCount; i++) {
diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp
index c057147c03..9276b96714 100644
--- a/libraries/animation/src/AnimInverseKinematics.cpp
+++ b/libraries/animation/src/AnimInverseKinematics.cpp
@@ -114,7 +114,7 @@ void AnimInverseKinematics::computeTargets(const AnimVariantMap& animVars, std::
     }
 
     if (removeUnfoundJoints) {
-        int numVars = _targetVarVec.size();
+        auto numVars = _targetVarVec.size();
         int i = 0;
         while (i < numVars) {
             if (_targetVarVec[i].jointIndex == -1) {
@@ -145,7 +145,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
     int numLoops = 0;
     const int MAX_IK_LOOPS = 4;
     do {
-        int lowestMovedIndex = _relativePoses.size();
+        auto lowestMovedIndex = _relativePoses.size();
         for (auto& target: targets) {
             IKTarget::Type targetType = target.getType();
             if (targetType == IKTarget::Type::RotationOnly) {
@@ -274,8 +274,8 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
         ++numLoops;
 
         // harvest accumulated rotations and apply the average
-        const int numJoints = (int)_accumulators.size();
-        for (int i = 0; i < numJoints; ++i) {
+        const size_t numJoints = _accumulators.size();
+        for (auto i = 0; i < numJoints; ++i) {
             if (_accumulators[i].size() > 0) {
                 _relativePoses[i].rot = _accumulators[i].getAverage();
                 _accumulators[i].clear();
@@ -283,8 +283,8 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
         }
 
         // only update the absolutePoses that need it: those between lowestMovedIndex and _maxTargetIndex
-        for (int i = lowestMovedIndex; i <= _maxTargetIndex; ++i) {
-            int parentIndex = _skeleton->getParentIndex(i);
+        for (auto i = lowestMovedIndex; i <= _maxTargetIndex; ++i) {
+            auto parentIndex = _skeleton->getParentIndex((int)i);
             if (parentIndex != -1) {
                 absolutePoses[i] = absolutePoses[parentIndex] * _relativePoses[i];
             }
diff --git a/libraries/animation/src/AnimSkeleton.cpp b/libraries/animation/src/AnimSkeleton.cpp
index 7879c8a776..8dcb2157c5 100644
--- a/libraries/animation/src/AnimSkeleton.cpp
+++ b/libraries/animation/src/AnimSkeleton.cpp
@@ -31,7 +31,7 @@ AnimSkeleton::AnimSkeleton(const std::vector<FBXJoint>& joints) {
 }
 
 int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
-    for (size_t i = 0; i < _joints.size(); i++) {
+    for (auto i = 0; i < _joints.size(); i++) {
         if (_joints[i].name == jointName) {
             return i;
         }
@@ -39,7 +39,7 @@ int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
     return -1;
 }
 
-int AnimSkeleton::getNumJoints() const {
+size_t AnimSkeleton::getNumJoints() const {
     return _joints.size();
 }
 
@@ -101,7 +101,7 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
     _relativeDefaultPoses.reserve(joints.size());
 
     // iterate over FBXJoints and extract the bind pose information.
-    for (size_t i = 0; i < joints.size(); i++) {
+    for (auto i = 0; i < joints.size(); i++) {
 
         // build relative and absolute default poses
         glm::mat4 rotTransform = glm::mat4_cast(_joints[i].preRotation * _joints[i].rotation * _joints[i].postRotation);
diff --git a/libraries/animation/src/AnimSkeleton.h b/libraries/animation/src/AnimSkeleton.h
index 7312fea6b1..73e31d090a 100644
--- a/libraries/animation/src/AnimSkeleton.h
+++ b/libraries/animation/src/AnimSkeleton.h
@@ -27,7 +27,7 @@ public:
     AnimSkeleton(const std::vector<FBXJoint>& joints);
     int nameToJointIndex(const QString& jointName) const;
     const QString& getJointName(int jointIndex) const;
-    int getNumJoints() const;
+    size_t getNumJoints() const;
 
     // absolute pose, not relative to parent
     const AnimPose& getAbsoluteBindPose(int jointIndex) const;
diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp
index 464ff28980..950ac58ae2 100644
--- a/libraries/animation/src/Rig.cpp
+++ b/libraries/animation/src/Rig.cpp
@@ -233,7 +233,7 @@ bool Rig::jointStatesEmpty() {
     return _internalPoseSet._relativePoses.empty();
 }
 
-int Rig::getJointStateCount() const {
+size_t Rig::getJointStateCount() const {
     return _internalPoseSet._relativePoses.size();
 }
 
@@ -434,7 +434,7 @@ void Rig::calcAnimAlpha(float speed, const std::vector<float>& referenceSpeeds,
 
 void Rig::computeEyesInRootFrame(const AnimPoseVec& poses) {
     // TODO: use cached eye/hips indices for these calculations
-    int numPoses = poses.size();
+    auto numPoses = poses.size();
     int hipsIndex = _animSkeleton->nameToJointIndex(QString("Hips"));
     int headIndex = _animSkeleton->nameToJointIndex(QString("Head"));
     if (hipsIndex > 0 && headIndex > 0) {
@@ -1066,8 +1066,8 @@ glm::mat4 Rig::getJointTransform(int jointIndex) const {
 }
 
 void Rig::copyJointsIntoJointData(QVector<JointData>& jointDataVec) const {
-    jointDataVec.resize(getJointStateCount());
-    for (int i = 0; i < jointDataVec.size(); i++) {
+    jointDataVec.resize((int)getJointStateCount());
+    for (auto i = 0; i < jointDataVec.size(); i++) {
         JointData& data = jointDataVec[i];
         data.rotationSet |= getJointStateRotation(i, data.rotation);
         // geometry offset is used here so that translations are in meters.
@@ -1164,7 +1164,7 @@ void Rig::computeAvatarBoundingCapsule(
     // even if they do not have legs (default robot)
     totalExtents.addPoint(glm::vec3(0.0f));
 
-    int numPoses = finalPoses.size();
+    auto numPoses = finalPoses.size();
     for (int i = 0; i < numPoses; i++) {
         const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
         AnimPose pose = finalPoses[i];
diff --git a/libraries/animation/src/Rig.h b/libraries/animation/src/Rig.h
index e3ec5d18cf..8d8d425112 100644
--- a/libraries/animation/src/Rig.h
+++ b/libraries/animation/src/Rig.h
@@ -89,7 +89,7 @@ public:
     void initJointStates(const FBXGeometry& geometry, const glm::mat4& modelOffset);
     void reset(const FBXGeometry& geometry);
     bool jointStatesEmpty();
-    int getJointStateCount() const;
+    size_t getJointStateCount() const;
     int indexOfJoint(const QString& jointName) const;
 
     void setModelOffset(const glm::mat4& modelOffsetMat);
diff --git a/libraries/animation/src/SwingTwistConstraint.cpp b/libraries/animation/src/SwingTwistConstraint.cpp
index f9cea2abad..c29f75202c 100644
--- a/libraries/animation/src/SwingTwistConstraint.cpp
+++ b/libraries/animation/src/SwingTwistConstraint.cpp
@@ -36,7 +36,7 @@ void SwingTwistConstraint::SwingLimitFunction::setCone(float maxAngle) {
 }
 
 void SwingTwistConstraint::SwingLimitFunction::setMinDots(const std::vector<float>& minDots) {
-    uint32_t numDots = minDots.size();
+    uint32_t numDots = (uint32_t)minDots.size();
     _minDots.clear();
     if (numDots == 0) {
         // push two copies of MIN_MINDOT
@@ -90,7 +90,7 @@ void SwingTwistConstraint::setSwingLimits(const std::vector<glm::vec3>& swungDir
     };
     std::vector<SwingLimitData> limits;
 
-    uint32_t numLimits = swungDirections.size();
+    uint32_t numLimits = (uint32_t)swungDirections.size();
     limits.reserve(numLimits);
 
     // compute the limit pairs: <theta, minDot>
@@ -108,7 +108,7 @@ void SwingTwistConstraint::setSwingLimits(const std::vector<glm::vec3>& swungDir
     }
 
     std::vector<float> minDots;
-    numLimits = limits.size();
+    numLimits = (uint32_t)limits.size();
     if (numLimits == 0) {
         // trivial case: nearly free constraint
         std::vector<float> minDots;
diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp
index a8a68de60d..0fa43e203b 100644
--- a/libraries/audio-client/src/AudioClient.cpp
+++ b/libraries/audio-client/src/AudioClient.cpp
@@ -1184,11 +1184,11 @@ float AudioClient::getAudioOutputMsecsUnplayed() const {
 }
 
 qint64 AudioClient::AudioOutputIODevice::readData(char * data, qint64 maxSize) {
-    int samplesRequested = maxSize / sizeof(int16_t);
+    auto samplesRequested = maxSize / sizeof(int16_t);
     int samplesPopped;
     int bytesWritten;
 
-    if ((samplesPopped = _receivedAudioStream.popSamples(samplesRequested, false)) > 0) {
+    if ((samplesPopped = _receivedAudioStream.popSamples((int)samplesRequested, false)) > 0) {
         AudioRingBuffer::ConstIterator lastPopOutput = _receivedAudioStream.getLastPopOutput();
         lastPopOutput.readSamples((int16_t*)data, samplesPopped);
         bytesWritten = samplesPopped * sizeof(int16_t);
diff --git a/libraries/entities-renderer/src/RenderableBoxEntityItem.cpp b/libraries/entities-renderer/src/RenderableBoxEntityItem.cpp
index 54fe491c46..a1cdbbaf51 100644
--- a/libraries/entities-renderer/src/RenderableBoxEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableBoxEntityItem.cpp
@@ -66,5 +66,5 @@ void RenderableBoxEntityItem::render(RenderArgs* args) {
         DependencyManager::get<DeferredLightingEffect>()->renderSolidCubeInstance(batch, getTransformToCenter(), cubeColor);
     }
     static const auto triCount = DependencyManager::get<GeometryCache>()->getCubeTriangleCount();
-    args->_details._trianglesRendered += triCount;
+    args->_details._trianglesRendered += (int)triCount;
 }
diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp
index 520069abdf..4abd8dbafd 100644
--- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp
@@ -106,7 +106,7 @@ public:
         batch.setInputBuffer(0, _particleBuffer, 0, sizeof(ParticlePrimitive));
 
         auto numParticles = _particleBuffer->getSize() / sizeof(ParticlePrimitive);
-        batch.drawInstanced(numParticles, gpu::TRIANGLE_STRIP, VERTEX_PER_PARTICLE);
+        batch.drawInstanced((gpu::uint32)numParticles, gpu::TRIANGLE_STRIP, (gpu::uint32)VERTEX_PER_PARTICLE);
     }
 
 protected:
diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp
index 10593a9e04..22f83d37f6 100644
--- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp
@@ -539,7 +539,7 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
     int voxelVolumeSizeLocation = _pipeline->getProgram()->getUniforms().findLocation("voxelVolumeSize");
     batch._glUniform3f(voxelVolumeSizeLocation, _voxelVolumeSize.x, _voxelVolumeSize.y, _voxelVolumeSize.z);
 
-    batch.drawIndexed(gpu::TRIANGLES, mesh->getNumIndices(), 0);
+    batch.drawIndexed(gpu::TRIANGLES, (gpu::uint32)mesh->getNumIndices(), 0);
 }
 
 bool RenderablePolyVoxEntityItem::addToScene(EntityItemPointer self,
diff --git a/libraries/entities-renderer/src/RenderableSphereEntityItem.cpp b/libraries/entities-renderer/src/RenderableSphereEntityItem.cpp
index 8768e41a07..6c72dc488c 100644
--- a/libraries/entities-renderer/src/RenderableSphereEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableSphereEntityItem.cpp
@@ -72,5 +72,5 @@ void RenderableSphereEntityItem::render(RenderArgs* args) {
         DependencyManager::get<DeferredLightingEffect>()->renderSolidSphereInstance(batch, modelTransform, sphereColor);
     }
     static const auto triCount = DependencyManager::get<GeometryCache>()->getSphereTriangleCount();
-    args->_details._trianglesRendered += triCount;
+    args->_details._trianglesRendered += (int)triCount;
 }
diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp
index f74cdedb9d..13d5c2836f 100644
--- a/libraries/entities/src/EntityItem.cpp
+++ b/libraries/entities/src/EntityItem.cpp
@@ -620,7 +620,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
     Q_ASSERT(parser.data() + parser.offset() == dataAt);
 #else
     const unsigned char* dataAt = parser.data() + parser.offset();
-    int bytesRead = parser.offset();
+    int bytesRead = (int)parser.offset();
 #endif
 
     auto nodeList = DependencyManager::get<NodeList>();
@@ -749,7 +749,7 @@ void EntityItem::debugDump() const {
 void EntityItem::adjustEditPacketForClockSkew(QByteArray& buffer, int clockSkew) {
     unsigned char* dataAt = reinterpret_cast<unsigned char*>(buffer.data());
     int octets = numberOfThreeBitSectionsInCode(dataAt);
-    int lengthOfOctcode = bytesRequiredForCodeLength(octets);
+    int lengthOfOctcode = (int)bytesRequiredForCodeLength(octets);
     dataAt += lengthOfOctcode;
 
     // lastEdited
diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp
index 2e785519da..98a099fcaa 100644
--- a/libraries/entities/src/EntityItemProperties.cpp
+++ b/libraries/entities/src/EntityItemProperties.cpp
@@ -1124,7 +1124,7 @@ bool EntityItemProperties::decodeEntityEditPacket(const unsigned char* data, int
     // the first part of the data is an octcode, this is a required element of the edit packet format, but we don't
     // actually use it, we do need to skip it and read to the actual data we care about.
     int octets = numberOfThreeBitSectionsInCode(data);
-    int bytesToReadOfOctcode = bytesRequiredForCodeLength(octets);
+    int bytesToReadOfOctcode = (int)bytesRequiredForCodeLength(octets);
 
     // we don't actually do anything with this octcode...
     dataAt += bytesToReadOfOctcode;
diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp
index 5090ebb7e0..c89619448d 100644
--- a/libraries/entities/src/EntityTree.cpp
+++ b/libraries/entities/src/EntityTree.cpp
@@ -1055,7 +1055,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
                 break; // bail to prevent buffer overflow
             }
 
-            QByteArray encodedID = dataByteArray.mid(processedBytes, NUM_BYTES_RFC4122_UUID);
+            QByteArray encodedID = dataByteArray.mid((int)processedBytes, NUM_BYTES_RFC4122_UUID);
             QUuid entityID = QUuid::fromRfc4122(encodedID);
             dataAt += encodedID.size();
             processedBytes += encodedID.size();
@@ -1074,7 +1074,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
         }
         deleteEntities(entityItemIDsToDelete, true, true);
     }
-    return processedBytes;
+    return (int)processedBytes;
 }
 
 EntityTreeElementPointer EntityTree::getContainingElement(const EntityItemID& entityItemID)  /*const*/ {
diff --git a/libraries/environment/src/EnvironmentData.cpp b/libraries/environment/src/EnvironmentData.cpp
index 4cb8f7a010..7a0bd29bc0 100644
--- a/libraries/environment/src/EnvironmentData.cpp
+++ b/libraries/environment/src/EnvironmentData.cpp
@@ -38,7 +38,7 @@ glm::vec3 EnvironmentData::getSunLocation(const glm::vec3& cameraPosition) const
     return _sunLocation;
 }
 
-int EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const {
+size_t EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const {
     unsigned char* bufferStart = destinationBuffer;
     
     memcpy(destinationBuffer, &_id, sizeof(_id));
@@ -77,7 +77,7 @@ int EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const {
     return destinationBuffer - bufferStart;
 }
 
-int EnvironmentData::parseData(const unsigned char* sourceBuffer, int numBytes) {
+size_t EnvironmentData::parseData(const unsigned char* sourceBuffer, int numBytes) {
     const unsigned char* startPosition = sourceBuffer;
     
     memcpy(&_id, sourceBuffer, sizeof(_id));
diff --git a/libraries/environment/src/EnvironmentData.h b/libraries/environment/src/EnvironmentData.h
index ebbb3d1fb0..daed752d4c 100644
--- a/libraries/environment/src/EnvironmentData.h
+++ b/libraries/environment/src/EnvironmentData.h
@@ -54,8 +54,8 @@ public:
     glm::vec3 getAtmosphereCenter(const glm::vec3& cameraPosition) const;
     glm::vec3 getSunLocation(const glm::vec3& cameraPosition) const;
 
-    int getBroadcastData(unsigned char* destinationBuffer) const;
-    int parseData(const unsigned char* sourceBuffer, int numBytes);
+    size_t getBroadcastData(unsigned char* destinationBuffer) const;
+    size_t parseData(const unsigned char* sourceBuffer, int numBytes);
     
 private:
 
diff --git a/libraries/fbx/src/FBXReader.h b/libraries/fbx/src/FBXReader.h
index 0ddbc11bda..51cb5baf9f 100644
--- a/libraries/fbx/src/FBXReader.h
+++ b/libraries/fbx/src/FBXReader.h
@@ -195,8 +195,7 @@ public:
     QMultiHash<int, int> newIndices;
     QVector<QHash<int, int> > blendshapeIndexMaps;
     QVector<QPair<int, int> > partMaterialTextures;
-    QHash<QString, int> texcoordSetMap;
-    std::map<QString, int> texcoordSetMap2;
+    QHash<QString, size_t> texcoordSetMap;
 };
 
 /// A single animation frame extracted from an FBX document.
diff --git a/libraries/fbx/src/FBXReader_Mesh.cpp b/libraries/fbx/src/FBXReader_Mesh.cpp
index dbada15588..5a824aa284 100644
--- a/libraries/fbx/src/FBXReader_Mesh.cpp
+++ b/libraries/fbx/src/FBXReader_Mesh.cpp
@@ -288,7 +288,7 @@ ExtractedMesh FBXReader::extractMesh(const FBXNode& object, unsigned int& meshIn
 #endif
                 }
 
-                QHash<QString, int>::iterator it = data.extracted.texcoordSetMap.find(attrib.name);
+                QHash<QString, size_t>::iterator it = data.extracted.texcoordSetMap.find(attrib.name);
                 if (it == data.extracted.texcoordSetMap.end()) {
                     data.extracted.texcoordSetMap.insert(attrib.name, data.attributes.size());
                     data.attributes.push_back(attrib);
diff --git a/libraries/gpu/src/gpu/GLBackendOutput.cpp b/libraries/gpu/src/gpu/GLBackendOutput.cpp
index 3ae8ee5435..6d8ce7b2c6 100755
--- a/libraries/gpu/src/gpu/GLBackendOutput.cpp
+++ b/libraries/gpu/src/gpu/GLBackendOutput.cpp
@@ -118,7 +118,7 @@ GLBackend::GLFramebuffer* GLBackend::syncGPUObject(const Framebuffer& framebuffe
 
         // Last but not least, define where we draw
         if (!colorBuffers.empty()) {
-            glDrawBuffers(colorBuffers.size(), colorBuffers.data());
+            glDrawBuffers((GLsizei)colorBuffers.size(), colorBuffers.data());
         } else {
             glDrawBuffer( GL_NONE );
         }
@@ -253,7 +253,7 @@ void GLBackend::do_clearFramebuffer(Batch& batch, size_t paramOffset) {
             }
 
             if (!drawBuffers.empty()) {
-                glDrawBuffers(drawBuffers.size(), drawBuffers.data());
+                glDrawBuffers((GLsizei)drawBuffers.size(), drawBuffers.data());
                 glClearColor(color.x, color.y, color.z, color.w);
                 glmask |= GL_COLOR_BUFFER_BIT;
             
@@ -291,7 +291,7 @@ void GLBackend::do_clearFramebuffer(Batch& batch, size_t paramOffset) {
     if (_output._framebuffer && !drawBuffers.empty()) {
         auto glFramebuffer = syncGPUObject(*_output._framebuffer);
         if (glFramebuffer) {
-            glDrawBuffers(glFramebuffer->_colorBuffers.size(), glFramebuffer->_colorBuffers.data());
+            glDrawBuffers((GLsizei)glFramebuffer->_colorBuffers.size(), glFramebuffer->_colorBuffers.data());
         }
     }
 
@@ -301,13 +301,13 @@ void GLBackend::do_clearFramebuffer(Batch& batch, size_t paramOffset) {
 void GLBackend::do_blit(Batch& batch, size_t paramOffset) {
     auto srcframebuffer = batch._framebuffers.get(batch._params[paramOffset]._uint);
     Vec4i srcvp;
-    for (size_t i = 0; i < 4; ++i) {
+    for (auto i = 0; i < 4; ++i) {
         srcvp[i] = batch._params[paramOffset + 1 + i]._int;
     }
 
     auto dstframebuffer = batch._framebuffers.get(batch._params[paramOffset + 5]._uint);
     Vec4i dstvp;
-    for (size_t i = 0; i < 4; ++i) {
+    for (auto i = 0; i < 4; ++i) {
         dstvp[i] = batch._params[paramOffset + 6 + i]._int;
     }
 
diff --git a/libraries/gpu/src/gpu/GLBackendTexture.cpp b/libraries/gpu/src/gpu/GLBackendTexture.cpp
index 71c5a83331..65f2e5ca8a 100755
--- a/libraries/gpu/src/gpu/GLBackendTexture.cpp
+++ b/libraries/gpu/src/gpu/GLBackendTexture.cpp
@@ -357,7 +357,7 @@ GLBackend::GLTexture* GLBackend::syncGPUObject(const Texture& texture) {
 
                 object->_storageStamp = texture.getStamp();
                 object->_contentStamp = texture.getDataStamp();
-                object->_size = texture.getSize();
+                object->_size = (GLuint)texture.getSize();
             }
 
             glBindTexture(GL_TEXTURE_2D, boundTex);
@@ -435,7 +435,7 @@ GLBackend::GLTexture* GLBackend::syncGPUObject(const Texture& texture) {
 
                 object->_storageStamp = texture.getStamp();
                 object->_contentStamp = texture.getDataStamp();
-                object->_size = texture.getSize();
+                object->_size = (GLuint)texture.getSize();
             }
 
             glBindTexture(GL_TEXTURE_CUBE_MAP, boundTex);
diff --git a/libraries/gpu/src/gpu/Texture.cpp b/libraries/gpu/src/gpu/Texture.cpp
index ae6f3b740d..3f2415d240 100755
--- a/libraries/gpu/src/gpu/Texture.cpp
+++ b/libraries/gpu/src/gpu/Texture.cpp
@@ -99,7 +99,7 @@ bool Texture::Storage::assignMipData(uint16 level, const Element& format, Size s
     // The bytes assigned here are supposed to contain all the faces bytes of the mip.
     // For tex1D, 2D, 3D there is only one face
     // For Cube, we expect the 6 faces in the order X+, X-, Y+, Y-, Z+, Z-
-    int sizePerFace = size / mip.size();
+    auto sizePerFace = size / mip.size();
     auto faceBytes = bytes;
     Size allocated = 0;
     for (auto& face : mip) {
diff --git a/libraries/model-networking/src/model-networking/ModelCache.cpp b/libraries/model-networking/src/model-networking/ModelCache.cpp
index c7d3523496..e1aeb92e41 100644
--- a/libraries/model-networking/src/model-networking/ModelCache.cpp
+++ b/libraries/model-networking/src/model-networking/ModelCache.cpp
@@ -335,7 +335,7 @@ void NetworkGeometry::modelParseSuccess(FBXGeometry* geometry) {
         _meshes.emplace_back(buildNetworkMesh(mesh, _textureBaseUrl));
     }
 
-    QHash<QString, int> fbxMatIDToMatID;
+    QHash<QString, size_t> fbxMatIDToMatID;
     foreach(const FBXMaterial& material, _geometry->materials) {
         fbxMatIDToMatID[material.materialID] = _materials.size();
         _materials.emplace_back(buildNetworkMaterial(material, _textureBaseUrl));
@@ -349,7 +349,7 @@ void NetworkGeometry::modelParseSuccess(FBXGeometry* geometry) {
             NetworkShape* networkShape = new NetworkShape();
             networkShape->_meshID = meshID;
             networkShape->_partID = partID;
-            networkShape->_materialID = fbxMatIDToMatID[part.materialID];
+            networkShape->_materialID = (int)fbxMatIDToMatID[part.materialID];
             _shapes.emplace_back(networkShape);
             partID++;
         }
diff --git a/libraries/model/src/model/Geometry.h b/libraries/model/src/model/Geometry.h
index a35d55d938..fa29faff5f 100755
--- a/libraries/model/src/model/Geometry.h
+++ b/libraries/model/src/model/Geometry.h
@@ -46,11 +46,11 @@ public:
     // Vertex buffer
     void setVertexBuffer(const BufferView& buffer);
     const BufferView& getVertexBuffer() const { return _vertexBuffer; }
-    uint getNumVertices() const { return _vertexBuffer.getNumElements(); }
+    size_t getNumVertices() const { return _vertexBuffer.getNumElements(); }
     bool hasVertexData() const { return _vertexBuffer._buffer.get() != nullptr; }
 
     // Attribute Buffers
-    int getNumAttributes() const { return _attributeBuffers.size(); }
+    size_t getNumAttributes() const { return _attributeBuffers.size(); }
     void addAttribute(Slot slot, const BufferView& buffer);
     const BufferView getAttributeBuffer(int attrib) const;
 
@@ -63,7 +63,7 @@ public:
     // Index Buffer
     void setIndexBuffer(const BufferView& buffer);
     const BufferView& getIndexBuffer() const { return _indexBuffer; }
-    uint getNumIndices() const { return _indexBuffer.getNumElements(); }
+    size_t getNumIndices() const { return _indexBuffer.getNumElements(); }
 
     // Access vertex position value
     const Vec3& getPos3(Index index) const { return _vertexBuffer.get<Vec3>(index); }
@@ -104,7 +104,7 @@ public:
 
     void setPartBuffer(const BufferView& buffer);
     const BufferView& getPartBuffer() const { return _partBuffer; }
-    uint getNumParts() const { return _partBuffer.getNumElements(); }
+    size_t getNumParts() const { return _partBuffer.getNumElements(); }
 
     // evaluate the bounding box of A part
     Box evalPartBound(int partNum) const;
diff --git a/libraries/networking/src/LimitedNodeList.h b/libraries/networking/src/LimitedNodeList.h
index 7f95291e5b..c89949b9fd 100644
--- a/libraries/networking/src/LimitedNodeList.h
+++ b/libraries/networking/src/LimitedNodeList.h
@@ -131,7 +131,7 @@ public:
 
     void (*linkedDataCreateCallback)(Node *);
 
-    int size() const { return _nodeHash.size(); }
+    size_t size() const { return _nodeHash.size(); }
 
     SharedNodePointer nodeWithUUID(const QUuid& nodeUUID);
 
diff --git a/libraries/networking/src/PacketSender.cpp b/libraries/networking/src/PacketSender.cpp
index 14737dfb8d..0cfd67cc4e 100644
--- a/libraries/networking/src/PacketSender.cpp
+++ b/libraries/networking/src/PacketSender.cpp
@@ -259,7 +259,7 @@ bool PacketSender::nonThreadedProcess() {
         }
     }
 
-    int packetsLeft = _packets.size();
+    auto packetsLeft = _packets.size();
 
     // Now that we know how many packets to send this call to process, just send them.
     while ((packetsSentThisCall < packetsToSendThisCall) && (packetsLeft > 0)) {
diff --git a/libraries/networking/src/PacketSender.h b/libraries/networking/src/PacketSender.h
index e4792c55c3..e177172788 100644
--- a/libraries/networking/src/PacketSender.h
+++ b/libraries/networking/src/PacketSender.h
@@ -50,7 +50,7 @@ public:
     bool hasPacketsToSend() const { return _packets.size() > 0; }
 
     /// how many packets are there in the send queue waiting to be sent
-    int packetsToSendCount() const { return _packets.size(); }
+    size_t packetsToSendCount() const { return _packets.size(); }
 
     /// If you're running in non-threaded mode, call this to give us a hint as to how frequently you will call process.
     /// This has no effect in threaded mode. This is only considered a hint in non-threaded mode.
diff --git a/libraries/networking/src/ReceivedPacketProcessor.h b/libraries/networking/src/ReceivedPacketProcessor.h
index 3a0e93ee09..1d9580f3d0 100644
--- a/libraries/networking/src/ReceivedPacketProcessor.h
+++ b/libraries/networking/src/ReceivedPacketProcessor.h
@@ -44,7 +44,7 @@ public:
     }
 
     /// How many received packets waiting are to be processed
-    int packetsToProcessCount() const { return _packets.size(); }
+    size_t packetsToProcessCount() const { return _packets.size(); }
 
     float getIncomingPPS() const { return _incomingPPS.getAverage(); }
     float getProcessedPPS() const { return _processedPPS.getAverage(); }
diff --git a/libraries/networking/src/udt/PacketList.cpp b/libraries/networking/src/udt/PacketList.cpp
index e4212ccb88..978df9b9bb 100644
--- a/libraries/networking/src/udt/PacketList.cpp
+++ b/libraries/networking/src/udt/PacketList.cpp
@@ -129,7 +129,7 @@ QByteArray PacketList::getMessage() const {
     }
 
     QByteArray data;
-    data.reserve(sizeBytes);
+    data.reserve((int)sizeBytes);
 
     for (auto& packet : _packets) {
         data.append(packet->getPayload(), packet->getPayloadSize());
diff --git a/libraries/networking/src/udt/PacketList.h b/libraries/networking/src/udt/PacketList.h
index 2c6c14f42f..4f1e46e616 100644
--- a/libraries/networking/src/udt/PacketList.h
+++ b/libraries/networking/src/udt/PacketList.h
@@ -39,7 +39,7 @@ public:
     bool isReliable() const { return _isReliable; }
     bool isOrdered() const { return _isOrdered; }
     
-    int getNumPackets() const { return _packets.size() + (_currentPacket ? 1 : 0); }
+    size_t getNumPackets() const { return _packets.size() + (_currentPacket ? 1 : 0); }
     size_t getDataSize() const;
     size_t getMessageSize() const;
     QByteArray getMessage() const;
diff --git a/libraries/octree/src/JurisdictionMap.cpp b/libraries/octree/src/JurisdictionMap.cpp
index d473b3973e..5e66e21242 100644
--- a/libraries/octree/src/JurisdictionMap.cpp
+++ b/libraries/octree/src/JurisdictionMap.cpp
@@ -278,7 +278,7 @@ std::unique_ptr<NLPacket> JurisdictionMap::packIntoPacket() {
         packet->write(reinterpret_cast<char*>(_rootOctalCode), bytes);
 
         // if and only if there's a root jurisdiction, also include the end nodes
-        int endNodeCount = _endNodes.size();
+        auto endNodeCount = _endNodes.size();
         packet->writePrimitive(endNodeCount);
 
         for (int i=0; i < endNodeCount; i++) {
diff --git a/libraries/octree/src/JurisdictionMap.h b/libraries/octree/src/JurisdictionMap.h
index 3f415efba8..18d2bbbeed 100644
--- a/libraries/octree/src/JurisdictionMap.h
+++ b/libraries/octree/src/JurisdictionMap.h
@@ -52,7 +52,7 @@ public:
 
     unsigned char* getRootOctalCode() const { return _rootOctalCode; }
     unsigned char* getEndNodeOctalCode(int index) const { return _endNodes[index]; }
-    int getEndNodeCount() const { return _endNodes.size(); }
+    size_t getEndNodeCount() const { return _endNodes.size(); }
 
     void copyContents(unsigned char* rootCodeIn, const std::vector<unsigned char*>& endNodesIn);
 
diff --git a/libraries/octree/src/Octree.cpp b/libraries/octree/src/Octree.cpp
index aacb57f31d..636d1a9a1a 100644
--- a/libraries/octree/src/Octree.cpp
+++ b/libraries/octree/src/Octree.cpp
@@ -479,12 +479,12 @@ void Octree::readBitstreamToTree(const unsigned char * bitstream, unsigned long
             }
         }
 
-        int octalCodeBytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInStream);
+        auto octalCodeBytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInStream);
 
         int theseBytesRead = 0;
-        theseBytesRead += octalCodeBytes;
+        theseBytesRead += (int)octalCodeBytes;
         int lowerLevelBytes = readElementData(bitstreamRootElement, bitstreamAt + octalCodeBytes,
-                                       bufferSizeBytes - (bytesRead + octalCodeBytes), args);
+                                       bufferSizeBytes - (bytesRead + (int)octalCodeBytes), args);
 
         theseBytesRead += lowerLevelBytes;
 
@@ -921,7 +921,7 @@ int Octree::encodeTreeBitstream(OctreeElementPointer element,
         }
     } else {
         roomForOctalCode = packetData->startSubTree(element->getOctalCode());
-        codeLength = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(element->getOctalCode()));
+        codeLength = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(element->getOctalCode()));
     }
 
     // If the octalcode couldn't fit, then we can return, because no nodes below us will fit...
diff --git a/libraries/octree/src/OctreeEditPacketSender.cpp b/libraries/octree/src/OctreeEditPacketSender.cpp
index df53a0f873..d3a72ce113 100644
--- a/libraries/octree/src/OctreeEditPacketSender.cpp
+++ b/libraries/octree/src/OctreeEditPacketSender.cpp
@@ -149,7 +149,7 @@ void OctreeEditPacketSender::queuePendingPacketToNodes(std::unique_ptr<NLPacket>
         _pendingPacketsLock.lock();
         _preServerSingleMessagePackets.push_back(std::move(packet));
         // if we've saved MORE than our max, then clear out the oldest packet...
-        int allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
+        auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
         if (allPendingMessages > _maxPendingMessages) {
             _preServerSingleMessagePackets.pop_front();
         }
@@ -210,7 +210,7 @@ void OctreeEditPacketSender::queueOctreeEditMessage(PacketType type, QByteArray&
             _preServerEdits.push_back(messagePair);
 
             // if we've saved MORE than out max, then clear out the oldest packet...
-            int allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
+            auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
             if (allPendingMessages > _maxPendingMessages) {
                 _preServerEdits.pop_front();
             }
diff --git a/libraries/octree/src/OctreePacketData.cpp b/libraries/octree/src/OctreePacketData.cpp
index 811e96fcf4..f063c60fd7 100644
--- a/libraries/octree/src/OctreePacketData.cpp
+++ b/libraries/octree/src/OctreePacketData.cpp
@@ -149,7 +149,7 @@ bool OctreePacketData::startSubTree(const unsigned char* octcode) {
     int possibleStartAt = _bytesInUse;
     int length = 0;
     if (octcode) {
-        length = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(octcode));
+        length = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(octcode));
         success = append(octcode, length); // handles checking compression
     } else {
         // NULL case, means root node, which is 0
diff --git a/libraries/octree/src/OctreeSceneStats.cpp b/libraries/octree/src/OctreeSceneStats.cpp
index 822fbb2c50..8b9334eafd 100644
--- a/libraries/octree/src/OctreeSceneStats.cpp
+++ b/libraries/octree/src/OctreeSceneStats.cpp
@@ -123,14 +123,14 @@ void OctreeSceneStats::copyFromOther(const OctreeSceneStats& other) {
 
     // Now copy the values from the other
     if (other._jurisdictionRoot) {
-        int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(other._jurisdictionRoot));
+        auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(other._jurisdictionRoot));
         _jurisdictionRoot = new unsigned char[bytes];
         memcpy(_jurisdictionRoot, other._jurisdictionRoot, bytes);
     }
     for (size_t i = 0; i < other._jurisdictionEndNodes.size(); i++) {
         unsigned char* endNodeCode = other._jurisdictionEndNodes[i];
         if (endNodeCode) {
-            int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
+            auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
             unsigned char* endNodeCodeCopy = new unsigned char[bytes];
             memcpy(endNodeCodeCopy, endNodeCode, bytes);
             _jurisdictionEndNodes.push_back(endNodeCodeCopy);
@@ -178,7 +178,7 @@ void OctreeSceneStats::sceneStarted(bool isFullScene, bool isMoving, OctreeEleme
     if (jurisdictionMap) {
         unsigned char* jurisdictionRoot = jurisdictionMap->getRootOctalCode();
         if (jurisdictionRoot) {
-            int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(jurisdictionRoot));
+            auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(jurisdictionRoot));
             _jurisdictionRoot = new unsigned char[bytes];
             memcpy(_jurisdictionRoot, jurisdictionRoot, bytes);
         }
@@ -187,7 +187,7 @@ void OctreeSceneStats::sceneStarted(bool isFullScene, bool isMoving, OctreeEleme
         for (int i = 0; i < jurisdictionMap->getEndNodeCount(); i++) {
             unsigned char* endNodeCode = jurisdictionMap->getEndNodeOctalCode(i);
             if (endNodeCode) {
-                int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
+                auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
                 unsigned char* endNodeCodeCopy = new unsigned char[bytes];
                 memcpy(endNodeCodeCopy, endNodeCode, bytes);
                 _jurisdictionEndNodes.push_back(endNodeCodeCopy);
@@ -418,18 +418,18 @@ int OctreeSceneStats::packIntoPacket() {
     // add the root jurisdiction
     if (_jurisdictionRoot) {
         // copy the
-        int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
+        auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
         _statsPacket->writePrimitive(bytes);
         _statsPacket->write(reinterpret_cast<char*>(_jurisdictionRoot), bytes);
 
         // if and only if there's a root jurisdiction, also include the end elements
-        int endNodeCount = _jurisdictionEndNodes.size();
+        auto endNodeCount = _jurisdictionEndNodes.size();
 
         _statsPacket->writePrimitive(endNodeCount);
 
         for (int i=0; i < endNodeCount; i++) {
             unsigned char* endNodeCode = _jurisdictionEndNodes[i];
-            int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
+            auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
             _statsPacket->writePrimitive(bytes);
             _statsPacket->write(reinterpret_cast<char*>(endNodeCode), bytes);
         }
diff --git a/libraries/octree/src/OctreeScriptingInterface.h b/libraries/octree/src/OctreeScriptingInterface.h
index 47b01c64f9..86b9730393 100644
--- a/libraries/octree/src/OctreeScriptingInterface.h
+++ b/libraries/octree/src/OctreeScriptingInterface.h
@@ -51,7 +51,7 @@ public slots:
     bool hasPacketsToSend() const { return _packetSender->hasPacketsToSend(); }
 
     /// how many packets are there in the send queue waiting to be sent
-    int packetsToSendCount() const { return _packetSender->packetsToSendCount(); }
+    int packetsToSendCount() const { return (int)_packetSender->packetsToSendCount(); }
 
     /// returns the packets per second send rate of this object over its lifetime
     float getLifetimePPS() const { return _packetSender->getLifetimePPS(); }
diff --git a/libraries/physics/src/MeshMassProperties.cpp b/libraries/physics/src/MeshMassProperties.cpp
index d18c068d26..a6a33932aa 100644
--- a/libraries/physics/src/MeshMassProperties.cpp
+++ b/libraries/physics/src/MeshMassProperties.cpp
@@ -271,7 +271,7 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
 
     // create some variables to hold temporary results
     #ifndef NDEBUG
-    uint32_t numPoints = points.size();
+    uint32_t numPoints = (uint32_t)points.size();
     #endif
     const btVector3 p0(0.0f, 0.0f, 0.0f);
     btMatrix3x3 tetraInertia;
@@ -280,7 +280,7 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
     btVector3 center;
     
     // loop over triangles
-    uint32_t numTriangles = triangleIndices.size() / 3;
+    uint32_t numTriangles = (uint32_t)triangleIndices.size() / 3;
     for (uint32_t i = 0; i < numTriangles; ++i) {
         uint32_t t = 3 * i;
         #ifndef NDEBUG
diff --git a/libraries/procedural/src/procedural/Procedural.cpp b/libraries/procedural/src/procedural/Procedural.cpp
index 69a433d5e1..b1e4bd53ed 100644
--- a/libraries/procedural/src/procedural/Procedural.cpp
+++ b/libraries/procedural/src/procedural/Procedural.cpp
@@ -123,7 +123,7 @@ void Procedural::parse(const QJsonObject& proceduralData) {
             _parsedChannels = channels.toArray();
             size_t channelCount = std::min(MAX_PROCEDURAL_TEXTURE_CHANNELS, (size_t)_parsedChannels.size());
             for (size_t i = 0; i < channelCount; ++i) {
-                QString url = _parsedChannels.at(i).toString();
+                QString url = _parsedChannels.at((int)i).toString();
                 _channels[i] = textureCache->getTexture(QUrl(url));
             }
         }
@@ -238,7 +238,7 @@ void Procedural::prepare(gpu::Batch& batch, const glm::vec3& position, const glm
                 gpuTexture->setSampler(sampler);
                 gpuTexture->autoGenerateMips(-1);
             }
-            batch.setResourceTexture(i, gpuTexture);
+            batch.setResourceTexture((gpu::uint32)i, gpuTexture);
         }
     }
 }
diff --git a/libraries/render-utils/src/AnimDebugDraw.cpp b/libraries/render-utils/src/AnimDebugDraw.cpp
index d17676fe90..aa366f04b9 100644
--- a/libraries/render-utils/src/AnimDebugDraw.cpp
+++ b/libraries/render-utils/src/AnimDebugDraw.cpp
@@ -48,7 +48,7 @@ public:
         batch.setIndexBuffer(gpu::UINT16, _indexBuffer, 0);
 
         auto numIndices = _indexBuffer->getSize() / sizeof(uint16_t);
-        batch.drawIndexed(gpu::LINES, numIndices);
+        batch.drawIndexed(gpu::LINES, (int)numIndices);
     }
 
     gpu::PipelinePointer _pipeline;
@@ -321,12 +321,12 @@ void AnimDebugDraw::update() {
         const float POSE_RADIUS = 0.1f; // 10 cm
 
         // figure out how many verts we will need.
-        int numVerts = 0;
+        size_t numVerts = 0;
 
         for (auto& iter : _absolutePoses) {
             AnimSkeleton::ConstPointer& skeleton = std::get<0>(iter.second);
             numVerts += skeleton->getNumJoints() * VERTICES_PER_BONE;
-            for (int i = 0; i < skeleton->getNumJoints(); i++) {
+            for (auto i = 0; i < skeleton->getNumJoints(); i++) {
                 auto parentIndex = skeleton->getParentIndex(i);
                 if (parentIndex >= 0) {
                     numVerts += VERTICES_PER_LINK;
diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp
index 342471454d..10b58b156b 100644
--- a/libraries/render-utils/src/DeferredLightingEffect.cpp
+++ b/libraries/render-utils/src/DeferredLightingEffect.cpp
@@ -314,7 +314,7 @@ void DeferredLightingEffect::addPointLight(const glm::vec3& position, float radi
 void DeferredLightingEffect::addSpotLight(const glm::vec3& position, float radius, const glm::vec3& color,
     float intensity, const glm::quat& orientation, float exponent, float cutoff) {
     
-    unsigned int lightID = _pointLights.size() + _spotLights.size() + _globalLights.size();
+    unsigned int lightID = (unsigned int)(_pointLights.size() + _spotLights.size() + _globalLights.size());
     if (lightID >= _allocatedLights.size()) {
         _allocatedLights.push_back(std::make_shared<model::Light>());
     }
diff --git a/libraries/render-utils/src/GeometryCache.cpp b/libraries/render-utils/src/GeometryCache.cpp
index b9fdcd95a4..5ae90e2124 100644
--- a/libraries/render-utils/src/GeometryCache.cpp
+++ b/libraries/render-utils/src/GeometryCache.cpp
@@ -93,28 +93,28 @@ void GeometryCache::ShapeData::setupBatch(gpu::Batch& batch) const {
 void GeometryCache::ShapeData::draw(gpu::Batch& batch) const {
     if (_indexCount) {
         setupBatch(batch);
-        batch.drawIndexed(gpu::TRIANGLES, _indexCount, _indexOffset);
+        batch.drawIndexed(gpu::TRIANGLES, (gpu::uint32)_indexCount, (gpu::uint32)_indexOffset);
     }
 }
 
 void GeometryCache::ShapeData::drawWire(gpu::Batch& batch) const {
     if (_wireIndexCount) {
         setupBatch(batch);
-        batch.drawIndexed(gpu::LINES, _wireIndexCount, _wireIndexOffset);
+        batch.drawIndexed(gpu::LINES, (gpu::uint32)_wireIndexCount, (gpu::uint32)_wireIndexOffset);
     }
 }
 
 void GeometryCache::ShapeData::drawInstances(gpu::Batch& batch, size_t count) const {
     if (_indexCount) {
         setupBatch(batch);
-        batch.drawIndexedInstanced(count, gpu::TRIANGLES, _indexCount, _indexOffset);
+        batch.drawIndexedInstanced((gpu::uint32)count, gpu::TRIANGLES, (gpu::uint32)_indexCount, (gpu::uint32)_indexOffset);
     }
 }
 
 void GeometryCache::ShapeData::drawWireInstances(gpu::Batch& batch, size_t count) const {
     if (_wireIndexCount) {
         setupBatch(batch);
-        batch.drawIndexedInstanced(count, gpu::LINES, _wireIndexCount, _wireIndexOffset);
+        batch.drawIndexedInstanced((gpu::uint32)count, gpu::LINES, (gpu::uint32)_wireIndexCount, (gpu::uint32)_wireIndexOffset);
     }
 }
 
@@ -235,7 +235,7 @@ size_t GeometryCache::getCubeTriangleCount() {
 void GeometryCache::buildShapes() {
     auto vertexBuffer = std::make_shared<gpu::Buffer>();
     auto indexBuffer = std::make_shared<gpu::Buffer>();
-    uint16_t startingIndex = 0;
+    size_t startingIndex = 0;
     
     // Cube 
     startingIndex = _shapeVertices->getSize() / SHAPE_VERTEX_STRIDE;
@@ -324,7 +324,7 @@ void GeometryCache::buildShapes() {
             20, 21, 22, 22, 23, 20  // back
         };
         for (auto& index : indices) {
-            index += startingIndex;
+            index += (uint16_t)startingIndex;
         }
 
         IndexVector wireIndices{
@@ -334,7 +334,7 @@ void GeometryCache::buildShapes() {
         };
 
         for (size_t i = 0; i < wireIndices.size(); ++i) {
-            indices[i] += startingIndex;
+            indices[i] += (uint16_t)startingIndex;
         }
 
         shapeData.setupIndices(_shapeIndices, indices, wireIndices);
@@ -375,7 +375,7 @@ void GeometryCache::buildShapes() {
             for (size_t j = 0; j < VERTICES_PER_TRIANGLE; ++j) {
                 auto triangleVertexIndex = j;
                 auto vertexIndex = triangleStartIndex + triangleVertexIndex;
-                indices.push_back(vertexIndex + startingIndex);
+                indices.push_back((uint16_t)(vertexIndex + startingIndex));
             }
         }
 
@@ -385,7 +385,7 @@ void GeometryCache::buildShapes() {
         };
 
         for (size_t i = 0; i < wireIndices.size(); ++i) {
-            wireIndices[i] += startingIndex;
+            wireIndices[i] += (uint16_t)startingIndex;
         }
 
         shapeData.setupIndices(_shapeIndices, indices, wireIndices);
@@ -411,7 +411,7 @@ void GeometryCache::buildShapes() {
                     // Spheres use the same values for vertices and normals
                     vertices.push_back(vertex);
                     vertices.push_back(vertex);
-                    indices.push_back(vertexIndex + startingIndex);
+                    indices.push_back((uint16_t)(vertexIndex + startingIndex));
                 }
             }
         }
@@ -445,7 +445,7 @@ void GeometryCache::buildShapes() {
                     auto vertexIndex = triangleStartIndex + triangleVertexIndex;
                     vertices.push_back(glm::normalize(originalVertices[vertexIndex]));
                     vertices.push_back(faceNormal);
-                    indices.push_back(vertexIndex + startingIndex);
+                    indices.push_back((uint16_t)(vertexIndex + startingIndex));
                 }
             }
         }
@@ -465,8 +465,8 @@ void GeometryCache::buildShapes() {
         });
         IndexVector wireIndices;
         // Only two indices
-        wireIndices.push_back(0 + startingIndex);
-        wireIndices.push_back(1 + startingIndex);
+        wireIndices.push_back(0 + (uint16_t)startingIndex);
+        wireIndices.push_back(1 + (uint16_t)startingIndex);
 
         shapeData.setupIndices(_shapeIndices, IndexVector(), wireIndices);
     }
diff --git a/libraries/render-utils/src/Model.h b/libraries/render-utils/src/Model.h
index 08abb74316..2465bd5c29 100644
--- a/libraries/render-utils/src/Model.h
+++ b/libraries/render-utils/src/Model.h
@@ -156,7 +156,7 @@ public:
     }
 
     /// Returns the number of joint states in the model.
-    int getJointStateCount() const { return _rig->getJointStateCount(); }
+    int getJointStateCount() const { return (int)_rig->getJointStateCount(); }
     bool getJointPositionInWorldFrame(int jointIndex, glm::vec3& position) const;
     bool getJointRotationInWorldFrame(int jointIndex, glm::quat& rotation) const;
     bool getJointCombinedRotation(int jointIndex, glm::quat& rotation) const;
diff --git a/libraries/render-utils/src/RenderDeferredTask.cpp b/libraries/render-utils/src/RenderDeferredTask.cpp
index 1430651c86..275e8af29c 100755
--- a/libraries/render-utils/src/RenderDeferredTask.cpp
+++ b/libraries/render-utils/src/RenderDeferredTask.cpp
@@ -91,12 +91,12 @@ RenderDeferredTask::RenderDeferredTask() : Task() {
     _jobs.push_back(Job(new AmbientOcclusion::JobModel("AmbientOcclusion")));
 
     _jobs.back().setEnabled(false);
-    _occlusionJobIndex = _jobs.size() - 1;
+    _occlusionJobIndex = (int)_jobs.size() - 1;
 
     _jobs.push_back(Job(new Antialiasing::JobModel("Antialiasing")));
 
     _jobs.back().setEnabled(false);
-    _antialiasingJobIndex = _jobs.size() - 1;
+    _antialiasingJobIndex = (int)_jobs.size() - 1;
 
     _jobs.push_back(Job(new FetchItems::JobModel("FetchTransparent",
          FetchItems(
@@ -119,13 +119,13 @@ RenderDeferredTask::RenderDeferredTask() : Task() {
     _jobs.push_back(Job(new render::DrawStatus::JobModel("DrawStatus", renderedOpaques, DrawStatus(statusIconMap))));
 
     _jobs.back().setEnabled(false);
-    _drawStatusJobIndex = _jobs.size() - 1;
+    _drawStatusJobIndex = (int)_jobs.size() - 1;
 
     _jobs.push_back(Job(new DrawOverlay3D::JobModel("DrawOverlay3D")));
 
     _jobs.push_back(Job(new HitEffect::JobModel("HitEffect")));
     _jobs.back().setEnabled(false);
-    _drawHitEffectJobIndex = _jobs.size() -1;
+    _drawHitEffectJobIndex = (int)_jobs.size() -1;
 
 
     // Give ourselves 3 frmaes of timer queries
@@ -181,7 +181,7 @@ void DrawOpaqueDeferred::run(const SceneContextPointer& sceneContext, const Rend
         batch.setStateScissorRect(args->_viewport);
         args->_batch = &batch;
 
-        renderContext->_numDrawnOpaqueItems = inItems.size();
+        renderContext->_numDrawnOpaqueItems = (int)inItems.size();
 
         glm::mat4 projMat;
         Transform viewMat;
@@ -210,7 +210,7 @@ void DrawTransparentDeferred::run(const SceneContextPointer& sceneContext, const
         batch.setStateScissorRect(args->_viewport);
         args->_batch = &batch;
     
-        renderContext->_numDrawnTransparentItems = inItems.size();
+        renderContext->_numDrawnTransparentItems = (int)inItems.size();
 
         glm::mat4 projMat;
         Transform viewMat;
@@ -262,8 +262,8 @@ void DrawOverlay3D::run(const SceneContextPointer& sceneContext, const RenderCon
             inItems.emplace_back(id);
         }
     }
-    renderContext->_numFeedOverlay3DItems = inItems.size();
-    renderContext->_numDrawnOverlay3DItems = inItems.size();
+    renderContext->_numFeedOverlay3DItems = (int)inItems.size();
+    renderContext->_numDrawnOverlay3DItems = (int)inItems.size();
 
     if (!inItems.empty()) {
         RenderArgs* args = renderContext->args;
diff --git a/libraries/render/src/render/DrawTask.h b/libraries/render/src/render/DrawTask.h
index 3f628c3a02..5dd61e347f 100755
--- a/libraries/render/src/render/DrawTask.h
+++ b/libraries/render/src/render/DrawTask.h
@@ -216,7 +216,7 @@ void renderItems(const SceneContextPointer& sceneContext, const RenderContextPoi
 
 class FetchItems {
 public:
-    typedef std::function<void (const RenderContextPointer& context, int count)> ProbeNumItems;
+    typedef std::function<void (const RenderContextPointer& context, size_t count)> ProbeNumItems;
     FetchItems(const ProbeNumItems& probe): _probeNumItems(probe) {}
     FetchItems(const ItemFilter& filter, const ProbeNumItems& probe): _filter(filter), _probeNumItems(probe) {}
 
diff --git a/libraries/render/src/render/Scene.h b/libraries/render/src/render/Scene.h
index 6ddd60cce8..1976801c96 100644
--- a/libraries/render/src/render/Scene.h
+++ b/libraries/render/src/render/Scene.h
@@ -495,7 +495,7 @@ public:
     /// WARNING, There is No check on the validity of the ID, so this could return a bad Item
     const Item& getItem(const ItemID& id) const { return _items[id]; }
 
-    unsigned int getNumItems() const { return _items.size(); }
+    size_t getNumItems() const { return _items.size(); }
 
 
     void processPendingChangesQueue();
diff --git a/libraries/shared/src/BufferParser.h b/libraries/shared/src/BufferParser.h
index bf06387a11..74b47cb72f 100644
--- a/libraries/shared/src/BufferParser.h
+++ b/libraries/shared/src/BufferParser.h
@@ -51,7 +51,7 @@ public:
     inline void readCompressedCount(T& result) {
         // FIXME switch to a heapless implementation as soon as Brad provides it.
         ByteCountCoded<T> codec;
-        _offset += codec.decode(reinterpret_cast<const char*>(_data + _offset), remaining());
+        _offset += codec.decode(reinterpret_cast<const char*>(_data + _offset), (int)remaining());
         result = codec.data;
     }
 
diff --git a/libraries/shared/src/PropertyFlags.h b/libraries/shared/src/PropertyFlags.h
index 2d512ece61..a4ff193a77 100644
--- a/libraries/shared/src/PropertyFlags.h
+++ b/libraries/shared/src/PropertyFlags.h
@@ -201,7 +201,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
     clear(); // we are cleared out!
 
     size_t bytesConsumed = 0;
-    int bitCount = BITS_IN_BYTE * size;
+    auto bitCount = BITS_IN_BYTE * size;
 
     int encodedByteCount = 1; // there is at least 1 byte (after the leadBits)
     int leadBits = 1; // there is always at least 1 lead bit
@@ -246,7 +246,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
             break;
         }
     }
-    _encodedLength = bytesConsumed;
+    _encodedLength = (int)bytesConsumed;
     return bytesConsumed;
 }
 
diff --git a/libraries/shared/src/RenderArgs.h b/libraries/shared/src/RenderArgs.h
index fcacf7aaed..061e07c600 100644
--- a/libraries/shared/src/RenderArgs.h
+++ b/libraries/shared/src/RenderArgs.h
@@ -35,8 +35,8 @@ public:
     };
     
     struct Item {
-        int _considered = 0;
-        int _rendered = 0;
+        size_t _considered = 0;
+        size_t _rendered = 0;
         int _outOfView = 0;
         int _tooSmall = 0;
     };
diff --git a/libraries/shared/src/SharedUtil.cpp b/libraries/shared/src/SharedUtil.cpp
index 145ec4ec37..298d5f669b 100644
--- a/libraries/shared/src/SharedUtil.cpp
+++ b/libraries/shared/src/SharedUtil.cpp
@@ -334,8 +334,8 @@ unsigned char* pointToVoxel(float x, float y, float z, float s, unsigned char r,
         voxelSizeInOctets++;
     }
 
-    unsigned int voxelSizeInBytes = bytesRequiredForCodeLength(voxelSizeInOctets); // (voxelSizeInBits/8)+1;
-    unsigned int voxelBufferSize = voxelSizeInBytes + sizeof(rgbColor); // 3 for color
+    auto voxelSizeInBytes = bytesRequiredForCodeLength(voxelSizeInOctets); // (voxelSizeInBits/8)+1;
+    auto voxelBufferSize = voxelSizeInBytes + sizeof(rgbColor); // 3 for color
 
     // allocate our resulting buffer
     unsigned char* voxelOut = new unsigned char[voxelBufferSize];
diff --git a/libraries/shared/src/shared/JSONHelpers.cpp b/libraries/shared/src/shared/JSONHelpers.cpp
index c0a8820d95..19d76ec132 100644
--- a/libraries/shared/src/shared/JSONHelpers.cpp
+++ b/libraries/shared/src/shared/JSONHelpers.cpp
@@ -30,8 +30,8 @@ T glmFromJson(const QJsonValue& json) {
     T result;
     if (json.isArray()) {
         QJsonArray array = json.toArray();
-        size_t length = std::min(array.size(), result.length());
-        for (size_t i = 0; i < length; ++i) {
+        auto length = std::min(array.size(), result.length());
+        for (auto i = 0; i < length; ++i) {
             result[i] = (float)array[i].toDouble();
         }
     }
diff --git a/tests/entities/src/main.cpp b/tests/entities/src/main.cpp
index 0cbd354e92..c0e21276d8 100644
--- a/tests/entities/src/main.cpp
+++ b/tests/entities/src/main.cpp
@@ -121,7 +121,7 @@ void testPropertyFlags(uint32_t value) {
 
     {
         #ifndef QT_NO_DEBUG
-        int decodeSize = decodeNew.decode((const uint8_t*)encoded.data(), encoded.size());
+        int decodeSize = (int)decodeNew.decode((const uint8_t*)encoded.data(), (int)encoded.size());
         Q_ASSERT(originalSize == decodeSize);
         Q_ASSERT(decodeNew == original);
         #endif
diff --git a/tests/gpu-test/src/main.cpp b/tests/gpu-test/src/main.cpp
index aa763196d1..0b701887f9 100644
--- a/tests/gpu-test/src/main.cpp
+++ b/tests/gpu-test/src/main.cpp
@@ -58,7 +58,7 @@ public:
     }
 
     unsigned int count() const {
-        return times.size() - 1;
+        return (unsigned int)times.size() - 1;
     }
 
     float elapsed() const {
@@ -283,10 +283,10 @@ public:
                     GeometryCache::ShapeData shapeData = geometryCache->_shapes[shape];
                     {
                         gpu::Batch::DrawIndexedIndirectCommand indirectCommand;
-                        indirectCommand._count = shapeData._indexCount;
+                        indirectCommand._count = (uint)shapeData._indexCount;
                         indirectCommand._instanceCount = ITEM_COUNT;
-                        indirectCommand._baseInstance = i * ITEM_COUNT;
-                        indirectCommand._firstIndex = shapeData._indexOffset / 2;
+                        indirectCommand._baseInstance = (uint)(i * ITEM_COUNT);
+                        indirectCommand._firstIndex = (uint)shapeData._indexOffset / 2;
                         indirectCommand._baseVertex = 0;
                         indirectBuffer->append(indirectCommand);
                     }
diff --git a/tests/render-utils/src/main.cpp b/tests/render-utils/src/main.cpp
index 4afb2d4807..c8fa03fec6 100644
--- a/tests/render-utils/src/main.cpp
+++ b/tests/render-utils/src/main.cpp
@@ -38,7 +38,7 @@ public:
     }
 
     unsigned int count() const {
-        return times.size() - 1;
+        return (unsigned int)times.size() - 1;
     }
 
     float elapsed() const {
diff --git a/tests/ui/src/main.cpp b/tests/ui/src/main.cpp
index 3879d0b029..18f62dc016 100644
--- a/tests/ui/src/main.cpp
+++ b/tests/ui/src/main.cpp
@@ -49,7 +49,7 @@ public:
         times.clear();
     }
 
-    unsigned int count() const {
+    size_t count() const {
         return times.size() - 1;
     }
 
diff --git a/tools/scribe/src/TextTemplate.cpp b/tools/scribe/src/TextTemplate.cpp
index 027a73da5d..01567d9255 100755
--- a/tools/scribe/src/TextTemplate.cpp
+++ b/tools/scribe/src/TextTemplate.cpp
@@ -730,7 +730,7 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
                 BlockPointer funcBlock = _config->_funcs.findFunc(block->command.arguments.front().c_str());
                 if (funcBlock) {
                     // before diving in the func tree, let's modify the vars with the local defs:
-                    int nbParams = std::min(block->command.arguments.size(), funcBlock->command.arguments.size());
+                    auto nbParams = std::min(block->command.arguments.size(), funcBlock->command.arguments.size());
                     std::vector< String > paramCache;
                     paramCache.push_back("");
                     String val;
@@ -839,7 +839,7 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
                 String val;
                 for (unsigned int t = 1; t < block->command.arguments.size(); t++) {
                     // detect if a param is a var
-                    int len = block->command.arguments[t].length();
+                    auto len = block->command.arguments[t].length();
                     if ((block->command.arguments[t][0] == Tag::VAR)
                         && (block->command.arguments[t][len - 1] == Tag::VAR)) {
                         String var = block->command.arguments[t].substr(1, len - 2);
diff --git a/tools/udt-test/src/UDTTest.cpp b/tools/udt-test/src/UDTTest.cpp
index d4054527f9..533e6371e9 100644
--- a/tools/udt-test/src/UDTTest.cpp
+++ b/tools/udt-test/src/UDTTest.cpp
@@ -311,8 +311,8 @@ void UDTTest::sendPacket() {
             
             packetList->closeCurrentPacket();
             
-            _totalQueuedBytes += packetList->getDataSize();
-            _totalQueuedPackets += packetList->getNumPackets();
+            _totalQueuedBytes += (int)packetList->getDataSize();
+            _totalQueuedPackets += (int)packetList->getNumPackets();
             
             _socket.writePacketList(std::move(packetList), _target);
         }
diff --git a/tools/vhacd-util/src/VHACDUtil.cpp b/tools/vhacd-util/src/VHACDUtil.cpp
index 75a1a9dc3a..d997f63e53 100644
--- a/tools/vhacd-util/src/VHACDUtil.cpp
+++ b/tools/vhacd-util/src/VHACDUtil.cpp
@@ -95,7 +95,7 @@ void vhacd::VHACDUtil::fattenMeshes(const FBXMesh& mesh, FBXMesh& result,
         getTrianglesInMeshPart(meshPart, triangles);
     }
 
-    unsigned int triangleCount = triangles.size() / 3;
+    auto triangleCount = triangles.size() / 3;
     if (triangleCount == 0) {
         return;
     }
@@ -230,7 +230,7 @@ bool vhacd::VHACDUtil::computeVHACD(FBXGeometry& geometry,
                 continue;
             }
 
-            int nPoints = vertices.size();
+            auto nPoints = vertices.size();
             AABox aaBox = getAABoxForMeshPart(mesh, meshPart);
             const float largestDimension = aaBox.getLargestDimension();
 
@@ -251,7 +251,7 @@ bool vhacd::VHACDUtil::computeVHACD(FBXGeometry& geometry,
 
 
             // compute approximate convex decomposition
-            bool res = interfaceVHACD->Compute(&vertices[0].x, 3, nPoints, &triangles[0], 3, triangleCount, params);
+            bool res = interfaceVHACD->Compute(&vertices[0].x, 3, (uint)nPoints, &triangles[0], 3, triangleCount, params);
             if (!res){
                 qDebug() << "V-HACD computation failed for Mesh : " << count;
                 count++;

From da63357254b429050e9ba2237335b0ef402114b4 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 15:25:36 -0800
Subject: [PATCH 08/28] More warning fixes

---
 libraries/animation/src/AnimSkeleton.cpp | 4 ++--
 libraries/animation/src/AnimSkeleton.h   | 2 +-
 libraries/animation/src/Rig.cpp          | 4 ++--
 libraries/animation/src/Rig.h            | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libraries/animation/src/AnimSkeleton.cpp b/libraries/animation/src/AnimSkeleton.cpp
index 8dcb2157c5..72fd806a1d 100644
--- a/libraries/animation/src/AnimSkeleton.cpp
+++ b/libraries/animation/src/AnimSkeleton.cpp
@@ -39,8 +39,8 @@ int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
     return -1;
 }
 
-size_t AnimSkeleton::getNumJoints() const {
-    return _joints.size();
+int AnimSkeleton::getNumJoints() const {
+    return (int)_joints.size();
 }
 
 const AnimPose& AnimSkeleton::getAbsoluteBindPose(int jointIndex) const {
diff --git a/libraries/animation/src/AnimSkeleton.h b/libraries/animation/src/AnimSkeleton.h
index 73e31d090a..7312fea6b1 100644
--- a/libraries/animation/src/AnimSkeleton.h
+++ b/libraries/animation/src/AnimSkeleton.h
@@ -27,7 +27,7 @@ public:
     AnimSkeleton(const std::vector<FBXJoint>& joints);
     int nameToJointIndex(const QString& jointName) const;
     const QString& getJointName(int jointIndex) const;
-    size_t getNumJoints() const;
+    int getNumJoints() const;
 
     // absolute pose, not relative to parent
     const AnimPose& getAbsoluteBindPose(int jointIndex) const;
diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp
index 950ac58ae2..56135ce821 100644
--- a/libraries/animation/src/Rig.cpp
+++ b/libraries/animation/src/Rig.cpp
@@ -233,8 +233,8 @@ bool Rig::jointStatesEmpty() {
     return _internalPoseSet._relativePoses.empty();
 }
 
-size_t Rig::getJointStateCount() const {
-    return _internalPoseSet._relativePoses.size();
+int Rig::getJointStateCount() const {
+    return (int)_internalPoseSet._relativePoses.size();
 }
 
 int Rig::indexOfJoint(const QString& jointName) const {
diff --git a/libraries/animation/src/Rig.h b/libraries/animation/src/Rig.h
index 8d8d425112..e3ec5d18cf 100644
--- a/libraries/animation/src/Rig.h
+++ b/libraries/animation/src/Rig.h
@@ -89,7 +89,7 @@ public:
     void initJointStates(const FBXGeometry& geometry, const glm::mat4& modelOffset);
     void reset(const FBXGeometry& geometry);
     bool jointStatesEmpty();
-    size_t getJointStateCount() const;
+    int getJointStateCount() const;
     int indexOfJoint(const QString& jointName) const;
 
     void setModelOffset(const glm::mat4& modelOffsetMat);

From d3224bfde36583de19c19739bd299dd6fe731fc5 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 16:03:44 -0800
Subject: [PATCH 09/28] More warning fixes

---
 interface/src/devices/Faceshift.cpp                | 2 +-
 libraries/animation/src/AnimInverseKinematics.cpp  | 8 ++++----
 libraries/animation/src/AnimSkeleton.cpp           | 4 ++--
 libraries/animation/src/Rig.cpp                    | 4 ++--
 libraries/networking/src/ReceivedPacketProcessor.h | 2 +-
 libraries/octree/src/JurisdictionMap.cpp           | 2 +-
 libraries/octree/src/JurisdictionMap.h             | 2 +-
 libraries/octree/src/OctreeEditPacketSender.cpp    | 4 ++--
 libraries/octree/src/OctreeSceneStats.cpp          | 4 ++--
 libraries/render-utils/src/AnimDebugDraw.cpp       | 2 +-
 libraries/shared/src/PropertyFlags.h               | 2 +-
 tools/scribe/src/TextTemplate.cpp                  | 3 ++-
 12 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp
index 3596c79419..81c099c740 100644
--- a/interface/src/devices/Faceshift.cpp
+++ b/interface/src/devices/Faceshift.cpp
@@ -255,7 +255,7 @@ void Faceshift::receive(const QByteArray& buffer) {
             }
             case fsMsg::MSG_OUT_BLENDSHAPE_NAMES: {
                 const vector<string>& names = static_pointer_cast<fsMsgBlendshapeNames>(msg)->blendshape_names();
-                for (auto i = 0; i < names.size(); i++) {
+                for (int i = 0; i < (int)names.size(); i++) {
                     if (names[i] == "EyeBlink_L") {
                         _leftBlinkIndex = i;
 
diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp
index 9276b96714..415ee72d7b 100644
--- a/libraries/animation/src/AnimInverseKinematics.cpp
+++ b/libraries/animation/src/AnimInverseKinematics.cpp
@@ -114,7 +114,7 @@ void AnimInverseKinematics::computeTargets(const AnimVariantMap& animVars, std::
     }
 
     if (removeUnfoundJoints) {
-        auto numVars = _targetVarVec.size();
+        int numVars = (int)_targetVarVec.size();
         int i = 0;
         while (i < numVars) {
             if (_targetVarVec[i].jointIndex == -1) {
@@ -145,7 +145,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
     int numLoops = 0;
     const int MAX_IK_LOOPS = 4;
     do {
-        auto lowestMovedIndex = _relativePoses.size();
+        int lowestMovedIndex = (int)_relativePoses.size();
         for (auto& target: targets) {
             IKTarget::Type targetType = target.getType();
             if (targetType == IKTarget::Type::RotationOnly) {
@@ -274,8 +274,8 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
         ++numLoops;
 
         // harvest accumulated rotations and apply the average
-        const size_t numJoints = _accumulators.size();
-        for (auto i = 0; i < numJoints; ++i) {
+        const int numJoints = (int)_accumulators.size();
+        for (int i = 0; i < numJoints; ++i) {
             if (_accumulators[i].size() > 0) {
                 _relativePoses[i].rot = _accumulators[i].getAverage();
                 _accumulators[i].clear();
diff --git a/libraries/animation/src/AnimSkeleton.cpp b/libraries/animation/src/AnimSkeleton.cpp
index 72fd806a1d..c9c6e43a02 100644
--- a/libraries/animation/src/AnimSkeleton.cpp
+++ b/libraries/animation/src/AnimSkeleton.cpp
@@ -31,7 +31,7 @@ AnimSkeleton::AnimSkeleton(const std::vector<FBXJoint>& joints) {
 }
 
 int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
-    for (auto i = 0; i < _joints.size(); i++) {
+    for (int i = 0; i < (int)_joints.size(); i++) {
         if (_joints[i].name == jointName) {
             return i;
         }
@@ -101,7 +101,7 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
     _relativeDefaultPoses.reserve(joints.size());
 
     // iterate over FBXJoints and extract the bind pose information.
-    for (auto i = 0; i < joints.size(); i++) {
+    for (int i = 0; i < (int)joints.size(); i++) {
 
         // build relative and absolute default poses
         glm::mat4 rotTransform = glm::mat4_cast(_joints[i].preRotation * _joints[i].rotation * _joints[i].postRotation);
diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp
index 56135ce821..acfb4f87db 100644
--- a/libraries/animation/src/Rig.cpp
+++ b/libraries/animation/src/Rig.cpp
@@ -434,7 +434,7 @@ void Rig::calcAnimAlpha(float speed, const std::vector<float>& referenceSpeeds,
 
 void Rig::computeEyesInRootFrame(const AnimPoseVec& poses) {
     // TODO: use cached eye/hips indices for these calculations
-    auto numPoses = poses.size();
+    int numPoses = (int)poses.size();
     int hipsIndex = _animSkeleton->nameToJointIndex(QString("Hips"));
     int headIndex = _animSkeleton->nameToJointIndex(QString("Head"));
     if (hipsIndex > 0 && headIndex > 0) {
@@ -1164,7 +1164,7 @@ void Rig::computeAvatarBoundingCapsule(
     // even if they do not have legs (default robot)
     totalExtents.addPoint(glm::vec3(0.0f));
 
-    auto numPoses = finalPoses.size();
+    int numPoses = (int)finalPoses.size();
     for (int i = 0; i < numPoses; i++) {
         const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
         AnimPose pose = finalPoses[i];
diff --git a/libraries/networking/src/ReceivedPacketProcessor.h b/libraries/networking/src/ReceivedPacketProcessor.h
index 1d9580f3d0..cbb27fa5d6 100644
--- a/libraries/networking/src/ReceivedPacketProcessor.h
+++ b/libraries/networking/src/ReceivedPacketProcessor.h
@@ -44,7 +44,7 @@ public:
     }
 
     /// How many received packets waiting are to be processed
-    size_t packetsToProcessCount() const { return _packets.size(); }
+    int packetsToProcessCount() const { return (int)_packets.size(); }
 
     float getIncomingPPS() const { return _incomingPPS.getAverage(); }
     float getProcessedPPS() const { return _processedPPS.getAverage(); }
diff --git a/libraries/octree/src/JurisdictionMap.cpp b/libraries/octree/src/JurisdictionMap.cpp
index 5e66e21242..cac2211d29 100644
--- a/libraries/octree/src/JurisdictionMap.cpp
+++ b/libraries/octree/src/JurisdictionMap.cpp
@@ -278,7 +278,7 @@ std::unique_ptr<NLPacket> JurisdictionMap::packIntoPacket() {
         packet->write(reinterpret_cast<char*>(_rootOctalCode), bytes);
 
         // if and only if there's a root jurisdiction, also include the end nodes
-        auto endNodeCount = _endNodes.size();
+        int endNodeCount = (int)_endNodes.size();
         packet->writePrimitive(endNodeCount);
 
         for (int i=0; i < endNodeCount; i++) {
diff --git a/libraries/octree/src/JurisdictionMap.h b/libraries/octree/src/JurisdictionMap.h
index 18d2bbbeed..fb217e59db 100644
--- a/libraries/octree/src/JurisdictionMap.h
+++ b/libraries/octree/src/JurisdictionMap.h
@@ -52,7 +52,7 @@ public:
 
     unsigned char* getRootOctalCode() const { return _rootOctalCode; }
     unsigned char* getEndNodeOctalCode(int index) const { return _endNodes[index]; }
-    size_t getEndNodeCount() const { return _endNodes.size(); }
+    int getEndNodeCount() const { return (int)_endNodes.size(); }
 
     void copyContents(unsigned char* rootCodeIn, const std::vector<unsigned char*>& endNodesIn);
 
diff --git a/libraries/octree/src/OctreeEditPacketSender.cpp b/libraries/octree/src/OctreeEditPacketSender.cpp
index d3a72ce113..ad59dcbf99 100644
--- a/libraries/octree/src/OctreeEditPacketSender.cpp
+++ b/libraries/octree/src/OctreeEditPacketSender.cpp
@@ -149,7 +149,7 @@ void OctreeEditPacketSender::queuePendingPacketToNodes(std::unique_ptr<NLPacket>
         _pendingPacketsLock.lock();
         _preServerSingleMessagePackets.push_back(std::move(packet));
         // if we've saved MORE than our max, then clear out the oldest packet...
-        auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
+        int allPendingMessages = (int)(_preServerSingleMessagePackets.size() + _preServerEdits.size());
         if (allPendingMessages > _maxPendingMessages) {
             _preServerSingleMessagePackets.pop_front();
         }
@@ -210,7 +210,7 @@ void OctreeEditPacketSender::queueOctreeEditMessage(PacketType type, QByteArray&
             _preServerEdits.push_back(messagePair);
 
             // if we've saved MORE than out max, then clear out the oldest packet...
-            auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
+            int allPendingMessages = (int)(_preServerSingleMessagePackets.size() + _preServerEdits.size());
             if (allPendingMessages > _maxPendingMessages) {
                 _preServerEdits.pop_front();
             }
diff --git a/libraries/octree/src/OctreeSceneStats.cpp b/libraries/octree/src/OctreeSceneStats.cpp
index 8b9334eafd..f761d9ad05 100644
--- a/libraries/octree/src/OctreeSceneStats.cpp
+++ b/libraries/octree/src/OctreeSceneStats.cpp
@@ -418,12 +418,12 @@ int OctreeSceneStats::packIntoPacket() {
     // add the root jurisdiction
     if (_jurisdictionRoot) {
         // copy the
-        auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
+        int bytes = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
         _statsPacket->writePrimitive(bytes);
         _statsPacket->write(reinterpret_cast<char*>(_jurisdictionRoot), bytes);
 
         // if and only if there's a root jurisdiction, also include the end elements
-        auto endNodeCount = _jurisdictionEndNodes.size();
+        int endNodeCount = (int)_jurisdictionEndNodes.size();
 
         _statsPacket->writePrimitive(endNodeCount);
 
diff --git a/libraries/render-utils/src/AnimDebugDraw.cpp b/libraries/render-utils/src/AnimDebugDraw.cpp
index aa366f04b9..04a1962899 100644
--- a/libraries/render-utils/src/AnimDebugDraw.cpp
+++ b/libraries/render-utils/src/AnimDebugDraw.cpp
@@ -321,7 +321,7 @@ void AnimDebugDraw::update() {
         const float POSE_RADIUS = 0.1f; // 10 cm
 
         // figure out how many verts we will need.
-        size_t numVerts = 0;
+        int numVerts = 0;
 
         for (auto& iter : _absolutePoses) {
             AnimSkeleton::ConstPointer& skeleton = std::get<0>(iter.second);
diff --git a/libraries/shared/src/PropertyFlags.h b/libraries/shared/src/PropertyFlags.h
index a4ff193a77..985a08fa05 100644
--- a/libraries/shared/src/PropertyFlags.h
+++ b/libraries/shared/src/PropertyFlags.h
@@ -201,7 +201,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
     clear(); // we are cleared out!
 
     size_t bytesConsumed = 0;
-    auto bitCount = BITS_IN_BYTE * size;
+    int bitCount = BITS_IN_BYTE * (int)size;
 
     int encodedByteCount = 1; // there is at least 1 byte (after the leadBits)
     int leadBits = 1; // there is always at least 1 lead bit
diff --git a/tools/scribe/src/TextTemplate.cpp b/tools/scribe/src/TextTemplate.cpp
index 01567d9255..3ccb0baea0 100755
--- a/tools/scribe/src/TextTemplate.cpp
+++ b/tools/scribe/src/TextTemplate.cpp
@@ -730,7 +730,8 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
                 BlockPointer funcBlock = _config->_funcs.findFunc(block->command.arguments.front().c_str());
                 if (funcBlock) {
                     // before diving in the func tree, let's modify the vars with the local defs:
-                    auto nbParams = std::min(block->command.arguments.size(), funcBlock->command.arguments.size());
+                    int nbParams = (int)std::min(block->command.arguments.size(),
+                                                 funcBlock->command.arguments.size());
                     std::vector< String > paramCache;
                     paramCache.push_back("");
                     String val;

From f308ef7aa91814e102177c3c50ed2548794dc786 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 16:17:17 -0800
Subject: [PATCH 10/28] Move QOpenGL wrappers to the gl lib

---
 .../{render-utils/src => gl/src/gl}/QOpenGLContextWrapper.cpp     | 0
 libraries/{render-utils/src => gl/src/gl}/QOpenGLContextWrapper.h | 0
 .../{render-utils/src => gl/src/gl}/QOpenGLDebugLoggerWrapper.cpp | 0
 .../{render-utils/src => gl/src/gl}/QOpenGLDebugLoggerWrapper.h   | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 rename libraries/{render-utils/src => gl/src/gl}/QOpenGLContextWrapper.cpp (100%)
 rename libraries/{render-utils/src => gl/src/gl}/QOpenGLContextWrapper.h (100%)
 rename libraries/{render-utils/src => gl/src/gl}/QOpenGLDebugLoggerWrapper.cpp (100%)
 rename libraries/{render-utils/src => gl/src/gl}/QOpenGLDebugLoggerWrapper.h (100%)

diff --git a/libraries/render-utils/src/QOpenGLContextWrapper.cpp b/libraries/gl/src/gl/QOpenGLContextWrapper.cpp
similarity index 100%
rename from libraries/render-utils/src/QOpenGLContextWrapper.cpp
rename to libraries/gl/src/gl/QOpenGLContextWrapper.cpp
diff --git a/libraries/render-utils/src/QOpenGLContextWrapper.h b/libraries/gl/src/gl/QOpenGLContextWrapper.h
similarity index 100%
rename from libraries/render-utils/src/QOpenGLContextWrapper.h
rename to libraries/gl/src/gl/QOpenGLContextWrapper.h
diff --git a/libraries/render-utils/src/QOpenGLDebugLoggerWrapper.cpp b/libraries/gl/src/gl/QOpenGLDebugLoggerWrapper.cpp
similarity index 100%
rename from libraries/render-utils/src/QOpenGLDebugLoggerWrapper.cpp
rename to libraries/gl/src/gl/QOpenGLDebugLoggerWrapper.cpp
diff --git a/libraries/render-utils/src/QOpenGLDebugLoggerWrapper.h b/libraries/gl/src/gl/QOpenGLDebugLoggerWrapper.h
similarity index 100%
rename from libraries/render-utils/src/QOpenGLDebugLoggerWrapper.h
rename to libraries/gl/src/gl/QOpenGLDebugLoggerWrapper.h

From 146581714a86645178ca89a192f003649f7ebe52 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 16:17:41 -0800
Subject: [PATCH 11/28] More warning fixes

---
 interface/src/Application.cpp                                 | 2 +-
 .../src/display-plugins/OpenGLDisplayPlugin.cpp               | 2 +-
 libraries/render-utils/src/AnimDebugDraw.cpp                  | 4 ++--
 tests/gpu-test/src/main.cpp                                   | 4 ++--
 tests/render-utils/src/main.cpp                               | 4 ++--
 tests/shaders/src/main.cpp                                    | 4 ++--
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp
index b420dca1a7..480a9ebb8b 100644
--- a/interface/src/Application.cpp
+++ b/interface/src/Application.cpp
@@ -45,7 +45,7 @@
 #include <QtNetwork/QNetworkDiskCache>
 
 #include <gl/Config.h>
-#include <QOpenGLContextWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
 
 #include <AccountManager.h>
 #include <AddressManager.h>
diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
index 58fd53e39d..ffe8fbe3c1 100644
--- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
+++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
@@ -16,7 +16,7 @@
 #include <QtOpenGL/QGLWidget>
 #include <QtGui/QImage>
 
-#include <QOpenGLContextWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
 
 #include <gl/GLWidget.h>
 #include <NumericalConstants.h>
diff --git a/libraries/render-utils/src/AnimDebugDraw.cpp b/libraries/render-utils/src/AnimDebugDraw.cpp
index 04a1962899..060aaa218b 100644
--- a/libraries/render-utils/src/AnimDebugDraw.cpp
+++ b/libraries/render-utils/src/AnimDebugDraw.cpp
@@ -336,9 +336,9 @@ void AnimDebugDraw::update() {
 
         // count marker verts from shared DebugDraw singleton
         auto markerMap = DebugDraw::getInstance().getMarkerMap();
-        numVerts += markerMap.size() * VERTICES_PER_BONE;
+        numVerts += (int)markerMap.size() * VERTICES_PER_BONE;
         auto myAvatarMarkerMap = DebugDraw::getInstance().getMyAvatarMarkerMap();
-        numVerts += myAvatarMarkerMap.size() * VERTICES_PER_BONE;
+        numVerts += (int)myAvatarMarkerMap.size() * VERTICES_PER_BONE;
 
         // allocate verts!
         data._vertexBuffer->resize(sizeof(Vertex) * numVerts);
diff --git a/tests/gpu-test/src/main.cpp b/tests/gpu-test/src/main.cpp
index 0b701887f9..e185266408 100644
--- a/tests/gpu-test/src/main.cpp
+++ b/tests/gpu-test/src/main.cpp
@@ -33,8 +33,8 @@
 #include <gpu/StandardShaderLib.h>
 #include <gpu/GLBackend.h>
 
-#include <QOpenGLContextWrapper.h>
-#include <QOpenGLDebugLoggerWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
+#include <gl/QOpenGLDebugLoggerWrapper.h>
 
 #include <GLMHelpers.h>
 #include <PathUtils.h>
diff --git a/tests/render-utils/src/main.cpp b/tests/render-utils/src/main.cpp
index c8fa03fec6..6a4154c8c3 100644
--- a/tests/render-utils/src/main.cpp
+++ b/tests/render-utils/src/main.cpp
@@ -14,8 +14,8 @@
 
 #include <gpu/GLBackend.h>
 
-#include <QOpenGLContextWrapper.h>
-#include <QOpenGLDebugLoggerWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
+#include <gl/QOpenGLDebugLoggerWrapper.h>
 
 #include <QDir>
 #include <QElapsedTimer>
diff --git a/tests/shaders/src/main.cpp b/tests/shaders/src/main.cpp
index 52e43e2faa..dd1170edeb 100644
--- a/tests/shaders/src/main.cpp
+++ b/tests/shaders/src/main.cpp
@@ -20,8 +20,8 @@
 
 #include <gl/GLHelpers.h>
 
-#include <QOpenGLDebugLoggerWrapper.h>
-#include <QOpenGLContextWrapper.h>
+#include <gl/QOpenGLDebugLoggerWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
 
 #include "../model/Skybox_vert.h"
 #include "../model/Skybox_frag.h"

From 0f49653da31b71e1107d5f5568dd8f707fe0e459 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Thu, 10 Dec 2015 17:08:34 -0800
Subject: [PATCH 12/28] More OS X warning cleanup

---
 interface/src/avatar/Avatar.h                 | 26 +++++------
 .../display-plugins/OpenGLDisplayPlugin.cpp   |  5 +-
 .../src/RenderableModelEntityItem.h           |  2 +-
 libraries/entities/src/EntityItem.h           |  2 +-
 libraries/entities/src/EntityTree.h           | 46 +++++++++----------
 libraries/octree/src/JurisdictionListener.h   |  2 +-
 libraries/octree/src/JurisdictionSender.h     |  2 +-
 libraries/physics/src/CharacterController.h   |  4 +-
 8 files changed, 45 insertions(+), 44 deletions(-)

diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h
index 09685c318e..4e775ad425 100644
--- a/interface/src/avatar/Avatar.h
+++ b/interface/src/avatar/Avatar.h
@@ -100,25 +100,25 @@ public:
     /// Returns the distance to use as a LOD parameter.
     float getLODDistance() const;
 
-    virtual bool isMyAvatar() const { return false; }
+    virtual bool isMyAvatar() const override { return false; }
 
-    virtual QVector<glm::quat> getJointRotations() const;
-    virtual glm::quat getJointRotation(int index) const;
-    virtual glm::vec3 getJointTranslation(int index) const;
-    virtual int getJointIndex(const QString& name) const;
-    virtual QStringList getJointNames() const;
+    virtual QVector<glm::quat> getJointRotations() const override;
+    virtual glm::quat getJointRotation(int index) const override;
+    virtual glm::vec3 getJointTranslation(int index) const override;
+    virtual int getJointIndex(const QString& name) const override;
+    virtual QStringList getJointNames() const override;
 
     virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
     virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
 
-    virtual void setFaceModelURL(const QUrl& faceModelURL);
-    virtual void setSkeletonModelURL(const QUrl& skeletonModelURL);
-    virtual void setAttachmentData(const QVector<AttachmentData>& attachmentData);
-    virtual void setBillboard(const QByteArray& billboard);
+    virtual void setFaceModelURL(const QUrl& faceModelURL) override;
+    virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
+    virtual void setAttachmentData(const QVector<AttachmentData>& attachmentData) override;
+    virtual void setBillboard(const QByteArray& billboard) override;
 
     void setShowDisplayName(bool showDisplayName);
 
-    virtual int parseDataFromBuffer(const QByteArray& buffer);
+    virtual int parseDataFromBuffer(const QByteArray& buffer) override;
 
     static void renderJointConnectingCone( gpu::Batch& batch, glm::vec3 position1, glm::vec3 position2,
                                                 float radius1, float radius2, const glm::vec4& color);
@@ -144,7 +144,7 @@ public:
     void scaleVectorRelativeToPosition(glm::vec3 &positionToScale) const;
 
     void slamPosition(const glm::vec3& position);
-    virtual void updateAttitude() { _skeletonModel.updateAttitude(); }
+    virtual void updateAttitude() override { _skeletonModel.updateAttitude(); }
 
     // Call this when updating Avatar position with a delta.  This will allow us to
     // _accurately_ measure position changes and compute the resulting velocity
@@ -217,7 +217,7 @@ protected:
     virtual bool shouldRenderHead(const RenderArgs* renderArgs) const;
     virtual void fixupModelsInScene();
 
-    virtual void updateJointMappings();
+    virtual void updateJointMappings() override;
 
     render::ItemID _renderItemID;
 
diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
index 880e4a16b3..58fd53e39d 100644
--- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
+++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
@@ -15,7 +15,8 @@
 
 #include <QtOpenGL/QGLWidget>
 #include <QtGui/QImage>
-#include <QtGui/QOpenGLContext>
+
+#include <QOpenGLContextWrapper.h>
 
 #include <gl/GLWidget.h>
 #include <NumericalConstants.h>
@@ -104,7 +105,7 @@ public:
 
             // take the latest texture and present it
             _context->makeCurrent();
-            if (QOpenGLContext::currentContext() == _context->contextHandle()) {
+            if (isCurrentContext(_context->contextHandle())) {
                 currentPlugin->present();
                 _context->doneCurrent();
             } else {
diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.h b/libraries/entities-renderer/src/RenderableModelEntityItem.h
index 0aaa7a0977..143113146e 100644
--- a/libraries/entities-renderer/src/RenderableModelEntityItem.h
+++ b/libraries/entities-renderer/src/RenderableModelEntityItem.h
@@ -29,7 +29,7 @@ public:
     virtual ~RenderableModelEntityItem();
 
     virtual void setDimensions(const glm::vec3& value) override;
-    virtual void setModelURL(const QString& url);
+    virtual void setModelURL(const QString& url) override;
 
     virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
     virtual bool setProperties(const EntityItemProperties& properties) override;
diff --git a/libraries/entities/src/EntityItem.h b/libraries/entities/src/EntityItem.h
index a1fc89c5e0..244198f7b8 100644
--- a/libraries/entities/src/EntityItem.h
+++ b/libraries/entities/src/EntityItem.h
@@ -389,7 +389,7 @@ protected:
     const QByteArray getActionDataInternal() const;
     void setActionDataInternal(QByteArray actionData);
 
-    virtual void locationChanged();
+    virtual void locationChanged() override;
     EntityTypes::EntityType _type;
     quint64 _lastSimulated; // last time this entity called simulate(), this includes velocity, angular velocity,
                             // and physics changes
diff --git a/libraries/entities/src/EntityTree.h b/libraries/entities/src/EntityTree.h
index e893c69259..5e54e562a0 100644
--- a/libraries/entities/src/EntityTree.h
+++ b/libraries/entities/src/EntityTree.h
@@ -58,7 +58,7 @@ public:
     void createRootElement();
 
     /// Implements our type specific root element factory
-    virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL);
+    virtual OctreeElementPointer createNewElement(unsigned char* octalCode = NULL) override;
 
     /// Type safe version of getRoot()
     EntityTreeElementPointer getRoot() {
@@ -68,15 +68,15 @@ public:
         return std::static_pointer_cast<EntityTreeElement>(_rootElement);
     }
 
-    virtual void eraseAllOctreeElements(bool createNewRoot = true);
+    virtual void eraseAllOctreeElements(bool createNewRoot = true) override;
 
     // These methods will allow the OctreeServer to send your tree inbound edit packets of your
     // own definition. Implement these to allow your octree based server to support editing
-    virtual bool getWantSVOfileVersions() const { return true; }
-    virtual PacketType expectedDataPacketType() const { return PacketType::EntityData; }
-    virtual bool canProcessVersion(PacketVersion thisVersion) const
+    virtual bool getWantSVOfileVersions() const override { return true; }
+    virtual PacketType expectedDataPacketType() const override { return PacketType::EntityData; }
+    virtual bool canProcessVersion(PacketVersion thisVersion) const override
                     { return thisVersion >= VERSION_ENTITIES_USE_METERS_AND_RADIANS; }
-    virtual bool handlesEditPacketType(PacketType packetType) const;
+    virtual bool handlesEditPacketType(PacketType packetType) const override;
     void fixupTerseEditLogging(EntityItemProperties& properties, QList<QString>& changedProperties);
     virtual int processEditPacketData(ReceivedMessage& message, const unsigned char* editData, int maxLength,
                                       const SharedNodePointer& senderNode) override;
@@ -89,18 +89,18 @@ public:
         bool* accurateResult = NULL,
         bool precisionPicking = false);
 
-    virtual bool rootElementHasData() const { return true; }
+    virtual bool rootElementHasData() const override { return true; }
 
     // the root at least needs to store the number of entities in the packet/buffer
-    virtual int minimumRequiredRootDataBytes() const { return sizeof(uint16_t); }
-    virtual bool suppressEmptySubtrees() const { return false; }
-    virtual void releaseSceneEncodeData(OctreeElementExtraEncodeData* extraEncodeData) const;
-    virtual bool mustIncludeAllChildData() const { return false; }
+    virtual int minimumRequiredRootDataBytes() const override { return sizeof(uint16_t); }
+    virtual bool suppressEmptySubtrees() const override { return false; }
+    virtual void releaseSceneEncodeData(OctreeElementExtraEncodeData* extraEncodeData) const override;
+    virtual bool mustIncludeAllChildData() const override { return false; }
 
-    virtual bool versionHasSVOfileBreaks(PacketVersion thisVersion) const
+    virtual bool versionHasSVOfileBreaks(PacketVersion thisVersion) const override
                     { return thisVersion >= VERSION_ENTITIES_HAS_FILE_BREAKS; }
 
-    virtual void update();
+    virtual void update() override;
 
     // The newer API...
     void postAddEntity(EntityItemPointer entityItem);
@@ -177,8 +177,8 @@ public:
     EntityTreeElementPointer getContainingElement(const EntityItemID& entityItemID)  /*const*/;
     void setContainingElement(const EntityItemID& entityItemID, EntityTreeElementPointer element);
     void debugDumpMap();
-    virtual void dumpTree();
-    virtual void pruneTree();
+    virtual void dumpTree() override;
+    virtual void pruneTree() override;
 
     QVector<EntityItemID> sendEntities(EntityEditPacketSender* packetSender, EntityTreePointer localTree,
                                        float x, float y, float z);
@@ -198,12 +198,12 @@ public:
 
     void remapIDs();
 
-    bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues);
-    bool readFromMap(QVariantMap& entityDescription);
+    virtual bool writeToMap(QVariantMap& entityDescription, OctreeElementPointer element, bool skipDefaultValues) override;
+    virtual bool readFromMap(QVariantMap& entityDescription) override;
 
     float getContentsLargestDimension();
 
-    virtual void resetEditStats() {
+    virtual void resetEditStats() override {
         _totalEditMessages = 0;
         _totalUpdates = 0;
         _totalCreates = 0;
@@ -214,11 +214,11 @@ public:
         _totalLoggingTime = 0;
     }
 
-    virtual quint64 getAverageDecodeTime() const { return _totalEditMessages == 0 ? 0 : _totalDecodeTime / _totalEditMessages; }
-    virtual quint64 getAverageLookupTime() const { return _totalEditMessages == 0 ? 0 : _totalLookupTime / _totalEditMessages; }
-    virtual quint64 getAverageUpdateTime() const { return _totalUpdates == 0 ? 0 : _totalUpdateTime / _totalUpdates; }
-    virtual quint64 getAverageCreateTime() const { return _totalCreates == 0 ? 0 : _totalCreateTime / _totalCreates; }
-    virtual quint64 getAverageLoggingTime() const { return _totalEditMessages == 0 ? 0 : _totalLoggingTime / _totalEditMessages; }
+    virtual quint64 getAverageDecodeTime() const override { return _totalEditMessages == 0 ? 0 : _totalDecodeTime / _totalEditMessages; }
+    virtual quint64 getAverageLookupTime() const override { return _totalEditMessages == 0 ? 0 : _totalLookupTime / _totalEditMessages; }
+    virtual quint64 getAverageUpdateTime() const override { return _totalUpdates == 0 ? 0 : _totalUpdateTime / _totalUpdates; }
+    virtual quint64 getAverageCreateTime() const override { return _totalCreates == 0 ? 0 : _totalCreateTime / _totalCreates; }
+    virtual quint64 getAverageLoggingTime() const override { return _totalEditMessages == 0 ? 0 : _totalLoggingTime / _totalEditMessages; }
 
     void trackIncomingEntityLastEdited(quint64 lastEditedTime, int bytesRead);
     quint64 getAverageEditDeltas() const
diff --git a/libraries/octree/src/JurisdictionListener.h b/libraries/octree/src/JurisdictionListener.h
index 0c713ca27f..7aee1659ff 100644
--- a/libraries/octree/src/JurisdictionListener.h
+++ b/libraries/octree/src/JurisdictionListener.h
@@ -32,7 +32,7 @@ public:
 
     JurisdictionListener(NodeType_t type = NodeType::EntityServer);
     
-    virtual bool process();
+    virtual bool process() override;
 
     NodeToJurisdictionMap* getJurisdictions() { return &_jurisdictions; }
 
diff --git a/libraries/octree/src/JurisdictionSender.h b/libraries/octree/src/JurisdictionSender.h
index a0a3b5b4dd..b2d738cd36 100644
--- a/libraries/octree/src/JurisdictionSender.h
+++ b/libraries/octree/src/JurisdictionSender.h
@@ -32,7 +32,7 @@ public:
 
     void setJurisdiction(JurisdictionMap* map) { _jurisdictionMap = map; }
 
-    virtual bool process();
+    virtual bool process() override;
 
     NodeType_t getNodeType() const { return _nodeType; }
     void setNodeType(NodeType_t type) { _nodeType = type; }
diff --git a/libraries/physics/src/CharacterController.h b/libraries/physics/src/CharacterController.h
index 6edbabdab8..88c02d0940 100644
--- a/libraries/physics/src/CharacterController.h
+++ b/libraries/physics/src/CharacterController.h
@@ -43,7 +43,7 @@ public:
     virtual void updateShapeIfNecessary() = 0;
 
     // overrides from btCharacterControllerInterface
-    virtual void setWalkDirection(const btVector3 &walkDirection) { assert(false); }
+    virtual void setWalkDirection(const btVector3 &walkDirection) override { assert(false); }
     virtual void setVelocityForTimeInterval(const btVector3 &velocity, btScalar timeInterval) override { assert(false); }
     virtual void reset(btCollisionWorld* collisionWorld) override { }
     virtual void warp(const btVector3& origin) override { }
@@ -57,7 +57,7 @@ public:
     virtual void playerStep(btCollisionWorld *collisionWorld, btScalar dt) override;
     virtual bool canJump() const override { assert(false); return false; } // never call this
     virtual void jump() override;
-    virtual bool onGround() const;
+    virtual bool onGround() const override;
 
     void preSimulation();
     void postSimulation();

From 9e51947c2504e7d7c4078fc12a6388446b8a8a74 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 15:04:33 -0800
Subject: [PATCH 13/28] More warning fixes

---
 libraries/gl/src/gl/GLEscrow.h              | 1 -
 libraries/gl/src/gl/OffscreenGLCanvas.cpp   | 3 +++
 libraries/gl/src/gl/OffscreenGLCanvas.h     | 3 ++-
 libraries/gl/src/gl/OffscreenQmlSurface.cpp | 8 +++-----
 libraries/octree/src/OctreeQuery.cpp        | 2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/libraries/gl/src/gl/GLEscrow.h b/libraries/gl/src/gl/GLEscrow.h
index 9da3ce0b0b..7e126835ab 100644
--- a/libraries/gl/src/gl/GLEscrow.h
+++ b/libraries/gl/src/gl/GLEscrow.h
@@ -15,7 +15,6 @@
 #include <deque>
 #include <forward_list>
 #include <functional>
-#include <GL/glew.h>
 #include <mutex>
 
 #include <SharedUtil.h>
diff --git a/libraries/gl/src/gl/OffscreenGLCanvas.cpp b/libraries/gl/src/gl/OffscreenGLCanvas.cpp
index 640c8ed5f5..6ce80296e9 100644
--- a/libraries/gl/src/gl/OffscreenGLCanvas.cpp
+++ b/libraries/gl/src/gl/OffscreenGLCanvas.cpp
@@ -76,3 +76,6 @@ void OffscreenGLCanvas::doneCurrent() {
     _context->doneCurrent();
 }
 
+QObject* OffscreenGLCanvas::getContextObject() {
+    return _context;
+}
diff --git a/libraries/gl/src/gl/OffscreenGLCanvas.h b/libraries/gl/src/gl/OffscreenGLCanvas.h
index e278f550f0..0f02e7c76f 100644
--- a/libraries/gl/src/gl/OffscreenGLCanvas.h
+++ b/libraries/gl/src/gl/OffscreenGLCanvas.h
@@ -29,7 +29,8 @@ public:
     QOpenGLContext* getContext() {
         return _context;
     }
-
+    QObject* getContextObject();
+    
 protected:
     std::once_flag _reportOnce;
     QOpenGLContext* _context;
diff --git a/libraries/gl/src/gl/OffscreenQmlSurface.cpp b/libraries/gl/src/gl/OffscreenQmlSurface.cpp
index d30294ae7c..bddc7d19ae 100644
--- a/libraries/gl/src/gl/OffscreenQmlSurface.cpp
+++ b/libraries/gl/src/gl/OffscreenQmlSurface.cpp
@@ -17,15 +17,14 @@
 #include <QtQuick/QQuickRenderControl>
 #include <QtCore/QWaitCondition>
 #include <QtCore/QMutex>
-#include <QtGui/QOpenGLContext>
 
 #include <shared/NsightHelpers.h>
 #include <PerfStat.h>
 #include <DependencyManager.h>
 #include <NumericalConstants.h>
 
-#include "GLEscrow.h"
 #include "OffscreenGLCanvas.h"
+#include "GLEscrow.h"
 
 
 // Time between receiving a request to render the offscreen UI actually triggering
@@ -60,7 +59,6 @@ static const QEvent::Type INIT = QEvent::Type(QEvent::User + 1);
 static const QEvent::Type RENDER = QEvent::Type(QEvent::User + 2);
 static const QEvent::Type RESIZE = QEvent::Type(QEvent::User + 3);
 static const QEvent::Type STOP = QEvent::Type(QEvent::User + 4);
-static const QEvent::Type UPDATE = QEvent::Type(QEvent::User + 5);
 
 class OffscreenQmlRenderer : public OffscreenGLCanvas {
     friend class OffscreenQmlSurface;
@@ -84,7 +82,7 @@ public:
 
         // Qt 5.5
         _renderControl->prepareThread(&_thread);
-        _context->moveToThread(&_thread);
+        getContextObject()->moveToThread(&_thread);
         moveToThread(&_thread);
         _thread.setObjectName("QML Thread");
         _thread.start();
@@ -176,7 +174,7 @@ private:
 
         doneCurrent();
 
-        _context->moveToThread(QCoreApplication::instance()->thread());
+        getContextObject()->moveToThread(QCoreApplication::instance()->thread());
         _cond.wakeOne();
     }
 
diff --git a/libraries/octree/src/OctreeQuery.cpp b/libraries/octree/src/OctreeQuery.cpp
index 5a30e178f8..0e7f565c00 100644
--- a/libraries/octree/src/OctreeQuery.cpp
+++ b/libraries/octree/src/OctreeQuery.cpp
@@ -109,7 +109,7 @@ int OctreeQuery::parseData(ReceivedMessage& message) {
 
     auto bytesRead = sourceBuffer - startPosition;
     auto bytesLeft = message.getSize() - bytesRead;
-    if (bytesLeft >= sizeof(_keyholeRadius)) {
+    if (bytesLeft >= (int)sizeof(_keyholeRadius)) {
         memcpy(&_keyholeRadius, sourceBuffer, sizeof(_keyholeRadius));
         sourceBuffer += sizeof(_keyholeRadius);
     }

From 79fdb2e882ab6c60f7564e5e07cd238acc1b3db7 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 11:47:59 -0800
Subject: [PATCH 14/28] Fix warnings on windows 64bit

---
 assignment-client/src/Agent.cpp               |  2 +-
 .../src/audio/AudioMixerClientData.cpp        |  2 +-
 .../octree/OctreeInboundPacketProcessor.cpp   |  2 +-
 interface/src/Application.cpp                 |  2 +-
 interface/src/devices/DeviceTracker.cpp       |  4 +--
 interface/src/devices/Faceshift.cpp           |  2 +-
 interface/src/devices/MotionTracker.cpp       |  2 +-
 interface/src/devices/MotionTracker.h         |  2 +-
 interface/src/ui/Stats.cpp                    | 16 ++++++------
 .../animation/src/AnimBlendLinearMove.cpp     |  8 +++---
 libraries/animation/src/AnimClip.cpp          |  6 ++---
 .../animation/src/AnimInverseKinematics.cpp   | 12 ++++-----
 libraries/animation/src/AnimSkeleton.cpp      |  6 ++---
 libraries/animation/src/AnimSkeleton.h        |  2 +-
 libraries/animation/src/Rig.cpp               | 10 +++----
 libraries/animation/src/Rig.h                 |  2 +-
 .../animation/src/SwingTwistConstraint.cpp    |  6 ++---
 libraries/audio-client/src/AudioClient.cpp    |  4 +--
 .../src/RenderableBoxEntityItem.cpp           |  2 +-
 .../RenderableParticleEffectEntityItem.cpp    |  2 +-
 .../src/RenderablePolyVoxEntityItem.cpp       |  2 +-
 .../src/RenderableSphereEntityItem.cpp        |  2 +-
 libraries/entities/src/EntityItem.cpp         |  4 +--
 .../entities/src/EntityItemProperties.cpp     |  2 +-
 libraries/entities/src/EntityTree.cpp         |  4 +--
 libraries/environment/src/EnvironmentData.cpp |  4 +--
 libraries/environment/src/EnvironmentData.h   |  4 +--
 libraries/fbx/src/FBXReader.h                 |  3 +--
 libraries/fbx/src/FBXReader_Mesh.cpp          |  2 +-
 libraries/gpu/src/gpu/GLBackendOutput.cpp     | 10 +++----
 libraries/gpu/src/gpu/GLBackendTexture.cpp    |  4 +--
 libraries/gpu/src/gpu/Texture.cpp             |  2 +-
 .../src/model-networking/ModelCache.cpp       |  4 +--
 libraries/model/src/model/Geometry.h          |  8 +++---
 libraries/networking/src/LimitedNodeList.h    |  2 +-
 libraries/networking/src/PacketSender.cpp     |  2 +-
 libraries/networking/src/PacketSender.h       |  2 +-
 .../networking/src/ReceivedPacketProcessor.h  |  2 +-
 libraries/networking/src/udt/PacketList.cpp   |  2 +-
 libraries/networking/src/udt/PacketList.h     |  2 +-
 libraries/octree/src/JurisdictionMap.cpp      |  2 +-
 libraries/octree/src/JurisdictionMap.h        |  2 +-
 libraries/octree/src/Octree.cpp               |  8 +++---
 .../octree/src/OctreeEditPacketSender.cpp     |  4 +--
 libraries/octree/src/OctreePacketData.cpp     |  2 +-
 libraries/octree/src/OctreeSceneStats.cpp     | 14 +++++-----
 .../octree/src/OctreeScriptingInterface.h     |  2 +-
 libraries/physics/src/MeshMassProperties.cpp  |  4 +--
 .../procedural/src/procedural/Procedural.cpp  |  4 +--
 libraries/render-utils/src/AnimDebugDraw.cpp  |  6 ++---
 .../src/DeferredLightingEffect.cpp            |  2 +-
 libraries/render-utils/src/GeometryCache.cpp  | 26 +++++++++----------
 libraries/render-utils/src/Model.h            |  2 +-
 .../render-utils/src/RenderDeferredTask.cpp   | 16 ++++++------
 libraries/render/src/render/DrawTask.h        |  2 +-
 libraries/render/src/render/Scene.h           |  2 +-
 libraries/shared/src/BufferParser.h           |  2 +-
 libraries/shared/src/PropertyFlags.h          |  4 +--
 libraries/shared/src/RenderArgs.h             |  4 +--
 libraries/shared/src/SharedUtil.cpp           |  4 +--
 libraries/shared/src/shared/JSONHelpers.cpp   |  4 +--
 tests/entities/src/main.cpp                   |  2 +-
 tests/gpu-test/src/main.cpp                   |  8 +++---
 tests/render-utils/src/main.cpp               |  2 +-
 tests/ui/src/main.cpp                         |  2 +-
 tools/scribe/src/TextTemplate.cpp             |  4 +--
 tools/udt-test/src/UDTTest.cpp                |  4 +--
 tools/vhacd-util/src/VHACDUtil.cpp            |  6 ++---
 68 files changed, 152 insertions(+), 153 deletions(-)

diff --git a/assignment-client/src/Agent.cpp b/assignment-client/src/Agent.cpp
index 46fa8c8181..610fab3d35 100644
--- a/assignment-client/src/Agent.cpp
+++ b/assignment-client/src/Agent.cpp
@@ -384,7 +384,7 @@ void Agent::processAgentAvatarAndAudio(float deltaTime) {
                 int numAvailableBytes = (soundByteArray.size() - _numAvatarSoundSentBytes) > SCRIPT_AUDIO_BUFFER_BYTES
                     ? SCRIPT_AUDIO_BUFFER_BYTES
                     : soundByteArray.size() - _numAvatarSoundSentBytes;
-                numAvailableSamples = numAvailableBytes / sizeof(int16_t);
+                numAvailableSamples = (int16_t)numAvailableBytes / sizeof(int16_t);
 
 
                 // check if the all of the _numAvatarAudioBufferSamples to be sent are silence
diff --git a/assignment-client/src/audio/AudioMixerClientData.cpp b/assignment-client/src/audio/AudioMixerClientData.cpp
index 729e9fa633..f2fa29f12c 100644
--- a/assignment-client/src/audio/AudioMixerClientData.cpp
+++ b/assignment-client/src/audio/AudioMixerClientData.cpp
@@ -171,7 +171,7 @@ void AudioMixerClientData::sendAudioStreamStatsPackets(const SharedNodePointer&
         statsPacket->writePrimitive(appendFlag);
         appendFlag = 1;
 
-        int numStreamStatsRoomFor = (statsPacket->size() - sizeof(quint8) - sizeof(quint16)) / sizeof(AudioStreamStats);
+        int numStreamStatsRoomFor = (int)(statsPacket->size() - sizeof(quint8) - sizeof(quint16)) / sizeof(AudioStreamStats);
 
         // calculate and pack the number of stream stats to follow
         quint16 numStreamStatsToPack = std::min(numStreamStatsRemaining, numStreamStatsRoomFor);
diff --git a/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp b/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp
index 6e4e822196..c5d010871c 100644
--- a/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp
+++ b/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp
@@ -293,7 +293,7 @@ int OctreeInboundPacketProcessor::sendNackPackets() {
 
             qDebug() << "NACK Sent back to editor/client... destinationNode=" << nodeUUID;
 
-            packetsSent += nackPacketList->getNumPackets();
+            packetsSent += (int)nackPacketList->getNumPackets();
 
             // send the list of nack packets
             totalBytesSent += nodeList->sendPacketList(std::move(nackPacketList), *destinationNode);
diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp
index 8ebfaf7ff1..d82da2b237 100644
--- a/interface/src/Application.cpp
+++ b/interface/src/Application.cpp
@@ -3054,7 +3054,7 @@ int Application::sendNackPackets() {
             }
 
             if (nackPacketList->getNumPackets()) {
-                packetsSent += nackPacketList->getNumPackets();
+                packetsSent += (int)nackPacketList->getNumPackets();
 
                 // send the packet list
                 nodeList->sendPacketList(std::move(nackPacketList), *node);
diff --git a/interface/src/devices/DeviceTracker.cpp b/interface/src/devices/DeviceTracker.cpp
index 2a956a42de..2cd4950064 100644
--- a/interface/src/devices/DeviceTracker.cpp
+++ b/interface/src/devices/DeviceTracker.cpp
@@ -20,7 +20,7 @@ DeviceTracker::SingletonData::~SingletonData() {
 }
 
 int DeviceTracker::getNumDevices() {
-    return Singleton::get()->_devicesMap.size();
+    return (int)Singleton::get()->_devicesMap.size();
 }
 
 DeviceTracker::ID DeviceTracker::getDeviceID(const Name& name) {
@@ -58,7 +58,7 @@ DeviceTracker::ID DeviceTracker::registerDevice(const Name& name, DeviceTracker*
     }
 
     // Good to register the device
-    deviceID = Singleton::get()->_devicesVector.size();
+    deviceID = (ID)Singleton::get()->_devicesVector.size();
     Singleton::get()->_devicesMap.insert(Map::value_type(name, deviceID));
     Singleton::get()->_devicesVector.push_back(device);
     device->assignIDAndName(deviceID, name);
diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp
index a25135cd76..3596c79419 100644
--- a/interface/src/devices/Faceshift.cpp
+++ b/interface/src/devices/Faceshift.cpp
@@ -255,7 +255,7 @@ void Faceshift::receive(const QByteArray& buffer) {
             }
             case fsMsg::MSG_OUT_BLENDSHAPE_NAMES: {
                 const vector<string>& names = static_pointer_cast<fsMsgBlendshapeNames>(msg)->blendshape_names();
-                for (size_t i = 0; i < names.size(); i++) {
+                for (auto i = 0; i < names.size(); i++) {
                     if (names[i] == "EyeBlink_L") {
                         _leftBlinkIndex = i;
 
diff --git a/interface/src/devices/MotionTracker.cpp b/interface/src/devices/MotionTracker.cpp
index 97c02b48bf..234a8d0c0c 100644
--- a/interface/src/devices/MotionTracker.cpp
+++ b/interface/src/devices/MotionTracker.cpp
@@ -90,7 +90,7 @@ MotionTracker::Index MotionTracker::addJoint(const Semantic& semantic, Index par
     
 
     // All good then allocate the joint
-    Index newIndex = _jointsArray.size();
+    Index newIndex = (Index)_jointsArray.size();
     _jointsArray.push_back(JointTracker(semantic, parent));
     _jointsMap.insert(JointTracker::Map::value_type(semantic, newIndex));
 
diff --git a/interface/src/devices/MotionTracker.h b/interface/src/devices/MotionTracker.h
index edfd3ae991..a4b5e6735e 100644
--- a/interface/src/devices/MotionTracker.h
+++ b/interface/src/devices/MotionTracker.h
@@ -90,7 +90,7 @@ public:
 
     virtual bool isConnected() const;
 
-    Index numJointTrackers() const { return _jointsArray.size(); }
+    Index numJointTrackers() const { return (Index)_jointsArray.size(); }
 
     /// Access a Joint from it's index.
     /// Index 0 is always the "Root".
diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp
index 55751d8631..6acacee41d 100644
--- a/interface/src/ui/Stats.cpp
+++ b/interface/src/ui/Stats.cpp
@@ -118,7 +118,7 @@ void Stats::updateStats(bool force) {
     STAT_UPDATE(avatarCount, avatarManager->size() - 1);
     STAT_UPDATE(avatarRenderableCount, avatarManager->getNumberInRenderRange());
     STAT_UPDATE(avatarRenderDistance, (int) round(avatarManager->getRenderDistance())); // deliberately truncating
-    STAT_UPDATE(serverCount, nodeList->size());
+    STAT_UPDATE(serverCount, (int)nodeList->size());
     STAT_UPDATE(renderrate, (int)qApp->getFps());
     if (qApp->getActiveDisplayPlugin()) {
         STAT_UPDATE(presentrate, (int)round(qApp->getActiveDisplayPlugin()->presentRate()));
@@ -270,7 +270,7 @@ void Stats::updateStats(bool force) {
     if (voxelPacketsToProcess == 0) {
         _resetRecentMaxPacketsSoon = true;
     } else if (voxelPacketsToProcess > _recentMaxPackets) {
-        _recentMaxPackets = voxelPacketsToProcess;
+        _recentMaxPackets = (int)voxelPacketsToProcess;
     }
 
     // Server Octree Elements
@@ -344,18 +344,18 @@ void Stats::setRenderDetails(const RenderDetails& details) {
     STAT_UPDATE(triangles, details._trianglesRendered);
     STAT_UPDATE(materialSwitches, details._materialSwitches);
     if (_expanded) {
-        STAT_UPDATE(opaqueConsidered, details._opaque._considered);
+        STAT_UPDATE(opaqueConsidered, (int)details._opaque._considered);
         STAT_UPDATE(opaqueOutOfView, details._opaque._outOfView);
         STAT_UPDATE(opaqueTooSmall, details._opaque._tooSmall);
-        STAT_UPDATE(opaqueRendered, details._opaque._rendered);
-        STAT_UPDATE(translucentConsidered, details._translucent._considered);
+        STAT_UPDATE(opaqueRendered, (int)details._opaque._rendered);
+        STAT_UPDATE(translucentConsidered, (int)details._translucent._considered);
         STAT_UPDATE(translucentOutOfView, details._translucent._outOfView);
         STAT_UPDATE(translucentTooSmall, details._translucent._tooSmall);
-        STAT_UPDATE(translucentRendered, details._translucent._rendered);
-        STAT_UPDATE(otherConsidered, details._other._considered);
+        STAT_UPDATE(translucentRendered, (int)details._translucent._rendered);
+        STAT_UPDATE(otherConsidered, (int)details._other._considered);
         STAT_UPDATE(otherOutOfView, details._other._outOfView);
         STAT_UPDATE(otherTooSmall, details._other._tooSmall);
-        STAT_UPDATE(otherRendered, details._other._rendered);
+        STAT_UPDATE(otherRendered, (int)details._other._rendered);
     }
 }
 
diff --git a/libraries/animation/src/AnimBlendLinearMove.cpp b/libraries/animation/src/AnimBlendLinearMove.cpp
index d8985f8b72..3be6a0f1b8 100644
--- a/libraries/animation/src/AnimBlendLinearMove.cpp
+++ b/libraries/animation/src/AnimBlendLinearMove.cpp
@@ -46,10 +46,10 @@ const AnimPoseVec& AnimBlendLinearMove::evaluate(const AnimVariantMap& animVars,
         evaluateAndBlendChildren(animVars, triggersOut, alpha, prevPoseIndex, nextPoseIndex, prevDeltaTime, nextDeltaTime);
     } else {
 
-        float clampedAlpha = glm::clamp(_alpha, 0.0f, (float)(_children.size() - 1));
-        size_t prevPoseIndex = glm::floor(clampedAlpha);
-        size_t nextPoseIndex = glm::ceil(clampedAlpha);
-        float alpha = glm::fract(clampedAlpha);
+        auto clampedAlpha = glm::clamp(_alpha, 0.0f, (float)(_children.size() - 1));
+        auto prevPoseIndex = glm::floor(clampedAlpha);
+        auto nextPoseIndex = glm::ceil(clampedAlpha);
+        auto alpha = glm::fract(clampedAlpha);
         float prevDeltaTime, nextDeltaTime;
         setFrameAndPhase(dt, alpha, prevPoseIndex, nextPoseIndex, &prevDeltaTime, &nextDeltaTime, triggersOut);
         evaluateAndBlendChildren(animVars, triggersOut, alpha, prevPoseIndex, nextPoseIndex, prevDeltaTime, nextDeltaTime);
diff --git a/libraries/animation/src/AnimClip.cpp b/libraries/animation/src/AnimClip.cpp
index 9eed3ad14c..986bb0a30e 100644
--- a/libraries/animation/src/AnimClip.cpp
+++ b/libraries/animation/src/AnimClip.cpp
@@ -57,7 +57,7 @@ const AnimPoseVec& AnimClip::evaluate(const AnimVariantMap& animVars, float dt,
 
         // It can be quite possible for the user to set _startFrame and _endFrame to
         // values before or past valid ranges.  We clamp the frames here.
-        int frameCount = _anim.size();
+        int frameCount = (int)_anim.size();
         prevIndex = std::min(std::max(0, prevIndex), frameCount - 1);
         nextIndex = std::min(std::max(0, nextIndex), frameCount - 1);
 
@@ -92,8 +92,8 @@ void AnimClip::copyFromNetworkAnim() {
     // by matching joints with the same name.
     const FBXGeometry& geom = _networkAnim->getGeometry();
     AnimSkeleton animSkeleton(geom);
-    const int animJointCount = animSkeleton.getNumJoints();
-    const int skeletonJointCount = _skeleton->getNumJoints();
+    const auto animJointCount = animSkeleton.getNumJoints();
+    const auto skeletonJointCount = _skeleton->getNumJoints();
     std::vector<int> jointMap;
     jointMap.reserve(animJointCount);
     for (int i = 0; i < animJointCount; i++) {
diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp
index c057147c03..9276b96714 100644
--- a/libraries/animation/src/AnimInverseKinematics.cpp
+++ b/libraries/animation/src/AnimInverseKinematics.cpp
@@ -114,7 +114,7 @@ void AnimInverseKinematics::computeTargets(const AnimVariantMap& animVars, std::
     }
 
     if (removeUnfoundJoints) {
-        int numVars = _targetVarVec.size();
+        auto numVars = _targetVarVec.size();
         int i = 0;
         while (i < numVars) {
             if (_targetVarVec[i].jointIndex == -1) {
@@ -145,7 +145,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
     int numLoops = 0;
     const int MAX_IK_LOOPS = 4;
     do {
-        int lowestMovedIndex = _relativePoses.size();
+        auto lowestMovedIndex = _relativePoses.size();
         for (auto& target: targets) {
             IKTarget::Type targetType = target.getType();
             if (targetType == IKTarget::Type::RotationOnly) {
@@ -274,8 +274,8 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
         ++numLoops;
 
         // harvest accumulated rotations and apply the average
-        const int numJoints = (int)_accumulators.size();
-        for (int i = 0; i < numJoints; ++i) {
+        const size_t numJoints = _accumulators.size();
+        for (auto i = 0; i < numJoints; ++i) {
             if (_accumulators[i].size() > 0) {
                 _relativePoses[i].rot = _accumulators[i].getAverage();
                 _accumulators[i].clear();
@@ -283,8 +283,8 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
         }
 
         // only update the absolutePoses that need it: those between lowestMovedIndex and _maxTargetIndex
-        for (int i = lowestMovedIndex; i <= _maxTargetIndex; ++i) {
-            int parentIndex = _skeleton->getParentIndex(i);
+        for (auto i = lowestMovedIndex; i <= _maxTargetIndex; ++i) {
+            auto parentIndex = _skeleton->getParentIndex((int)i);
             if (parentIndex != -1) {
                 absolutePoses[i] = absolutePoses[parentIndex] * _relativePoses[i];
             }
diff --git a/libraries/animation/src/AnimSkeleton.cpp b/libraries/animation/src/AnimSkeleton.cpp
index 7879c8a776..8dcb2157c5 100644
--- a/libraries/animation/src/AnimSkeleton.cpp
+++ b/libraries/animation/src/AnimSkeleton.cpp
@@ -31,7 +31,7 @@ AnimSkeleton::AnimSkeleton(const std::vector<FBXJoint>& joints) {
 }
 
 int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
-    for (size_t i = 0; i < _joints.size(); i++) {
+    for (auto i = 0; i < _joints.size(); i++) {
         if (_joints[i].name == jointName) {
             return i;
         }
@@ -39,7 +39,7 @@ int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
     return -1;
 }
 
-int AnimSkeleton::getNumJoints() const {
+size_t AnimSkeleton::getNumJoints() const {
     return _joints.size();
 }
 
@@ -101,7 +101,7 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
     _relativeDefaultPoses.reserve(joints.size());
 
     // iterate over FBXJoints and extract the bind pose information.
-    for (size_t i = 0; i < joints.size(); i++) {
+    for (auto i = 0; i < joints.size(); i++) {
 
         // build relative and absolute default poses
         glm::mat4 rotTransform = glm::mat4_cast(_joints[i].preRotation * _joints[i].rotation * _joints[i].postRotation);
diff --git a/libraries/animation/src/AnimSkeleton.h b/libraries/animation/src/AnimSkeleton.h
index 7312fea6b1..73e31d090a 100644
--- a/libraries/animation/src/AnimSkeleton.h
+++ b/libraries/animation/src/AnimSkeleton.h
@@ -27,7 +27,7 @@ public:
     AnimSkeleton(const std::vector<FBXJoint>& joints);
     int nameToJointIndex(const QString& jointName) const;
     const QString& getJointName(int jointIndex) const;
-    int getNumJoints() const;
+    size_t getNumJoints() const;
 
     // absolute pose, not relative to parent
     const AnimPose& getAbsoluteBindPose(int jointIndex) const;
diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp
index 464ff28980..950ac58ae2 100644
--- a/libraries/animation/src/Rig.cpp
+++ b/libraries/animation/src/Rig.cpp
@@ -233,7 +233,7 @@ bool Rig::jointStatesEmpty() {
     return _internalPoseSet._relativePoses.empty();
 }
 
-int Rig::getJointStateCount() const {
+size_t Rig::getJointStateCount() const {
     return _internalPoseSet._relativePoses.size();
 }
 
@@ -434,7 +434,7 @@ void Rig::calcAnimAlpha(float speed, const std::vector<float>& referenceSpeeds,
 
 void Rig::computeEyesInRootFrame(const AnimPoseVec& poses) {
     // TODO: use cached eye/hips indices for these calculations
-    int numPoses = poses.size();
+    auto numPoses = poses.size();
     int hipsIndex = _animSkeleton->nameToJointIndex(QString("Hips"));
     int headIndex = _animSkeleton->nameToJointIndex(QString("Head"));
     if (hipsIndex > 0 && headIndex > 0) {
@@ -1066,8 +1066,8 @@ glm::mat4 Rig::getJointTransform(int jointIndex) const {
 }
 
 void Rig::copyJointsIntoJointData(QVector<JointData>& jointDataVec) const {
-    jointDataVec.resize(getJointStateCount());
-    for (int i = 0; i < jointDataVec.size(); i++) {
+    jointDataVec.resize((int)getJointStateCount());
+    for (auto i = 0; i < jointDataVec.size(); i++) {
         JointData& data = jointDataVec[i];
         data.rotationSet |= getJointStateRotation(i, data.rotation);
         // geometry offset is used here so that translations are in meters.
@@ -1164,7 +1164,7 @@ void Rig::computeAvatarBoundingCapsule(
     // even if they do not have legs (default robot)
     totalExtents.addPoint(glm::vec3(0.0f));
 
-    int numPoses = finalPoses.size();
+    auto numPoses = finalPoses.size();
     for (int i = 0; i < numPoses; i++) {
         const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
         AnimPose pose = finalPoses[i];
diff --git a/libraries/animation/src/Rig.h b/libraries/animation/src/Rig.h
index e3ec5d18cf..8d8d425112 100644
--- a/libraries/animation/src/Rig.h
+++ b/libraries/animation/src/Rig.h
@@ -89,7 +89,7 @@ public:
     void initJointStates(const FBXGeometry& geometry, const glm::mat4& modelOffset);
     void reset(const FBXGeometry& geometry);
     bool jointStatesEmpty();
-    int getJointStateCount() const;
+    size_t getJointStateCount() const;
     int indexOfJoint(const QString& jointName) const;
 
     void setModelOffset(const glm::mat4& modelOffsetMat);
diff --git a/libraries/animation/src/SwingTwistConstraint.cpp b/libraries/animation/src/SwingTwistConstraint.cpp
index f9cea2abad..c29f75202c 100644
--- a/libraries/animation/src/SwingTwistConstraint.cpp
+++ b/libraries/animation/src/SwingTwistConstraint.cpp
@@ -36,7 +36,7 @@ void SwingTwistConstraint::SwingLimitFunction::setCone(float maxAngle) {
 }
 
 void SwingTwistConstraint::SwingLimitFunction::setMinDots(const std::vector<float>& minDots) {
-    uint32_t numDots = minDots.size();
+    uint32_t numDots = (uint32_t)minDots.size();
     _minDots.clear();
     if (numDots == 0) {
         // push two copies of MIN_MINDOT
@@ -90,7 +90,7 @@ void SwingTwistConstraint::setSwingLimits(const std::vector<glm::vec3>& swungDir
     };
     std::vector<SwingLimitData> limits;
 
-    uint32_t numLimits = swungDirections.size();
+    uint32_t numLimits = (uint32_t)swungDirections.size();
     limits.reserve(numLimits);
 
     // compute the limit pairs: <theta, minDot>
@@ -108,7 +108,7 @@ void SwingTwistConstraint::setSwingLimits(const std::vector<glm::vec3>& swungDir
     }
 
     std::vector<float> minDots;
-    numLimits = limits.size();
+    numLimits = (uint32_t)limits.size();
     if (numLimits == 0) {
         // trivial case: nearly free constraint
         std::vector<float> minDots;
diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp
index a8a68de60d..0fa43e203b 100644
--- a/libraries/audio-client/src/AudioClient.cpp
+++ b/libraries/audio-client/src/AudioClient.cpp
@@ -1184,11 +1184,11 @@ float AudioClient::getAudioOutputMsecsUnplayed() const {
 }
 
 qint64 AudioClient::AudioOutputIODevice::readData(char * data, qint64 maxSize) {
-    int samplesRequested = maxSize / sizeof(int16_t);
+    auto samplesRequested = maxSize / sizeof(int16_t);
     int samplesPopped;
     int bytesWritten;
 
-    if ((samplesPopped = _receivedAudioStream.popSamples(samplesRequested, false)) > 0) {
+    if ((samplesPopped = _receivedAudioStream.popSamples((int)samplesRequested, false)) > 0) {
         AudioRingBuffer::ConstIterator lastPopOutput = _receivedAudioStream.getLastPopOutput();
         lastPopOutput.readSamples((int16_t*)data, samplesPopped);
         bytesWritten = samplesPopped * sizeof(int16_t);
diff --git a/libraries/entities-renderer/src/RenderableBoxEntityItem.cpp b/libraries/entities-renderer/src/RenderableBoxEntityItem.cpp
index 54fe491c46..a1cdbbaf51 100644
--- a/libraries/entities-renderer/src/RenderableBoxEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableBoxEntityItem.cpp
@@ -66,5 +66,5 @@ void RenderableBoxEntityItem::render(RenderArgs* args) {
         DependencyManager::get<DeferredLightingEffect>()->renderSolidCubeInstance(batch, getTransformToCenter(), cubeColor);
     }
     static const auto triCount = DependencyManager::get<GeometryCache>()->getCubeTriangleCount();
-    args->_details._trianglesRendered += triCount;
+    args->_details._trianglesRendered += (int)triCount;
 }
diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp
index 520069abdf..4abd8dbafd 100644
--- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp
@@ -106,7 +106,7 @@ public:
         batch.setInputBuffer(0, _particleBuffer, 0, sizeof(ParticlePrimitive));
 
         auto numParticles = _particleBuffer->getSize() / sizeof(ParticlePrimitive);
-        batch.drawInstanced(numParticles, gpu::TRIANGLE_STRIP, VERTEX_PER_PARTICLE);
+        batch.drawInstanced((gpu::uint32)numParticles, gpu::TRIANGLE_STRIP, (gpu::uint32)VERTEX_PER_PARTICLE);
     }
 
 protected:
diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp
index 10593a9e04..22f83d37f6 100644
--- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp
@@ -539,7 +539,7 @@ void RenderablePolyVoxEntityItem::render(RenderArgs* args) {
     int voxelVolumeSizeLocation = _pipeline->getProgram()->getUniforms().findLocation("voxelVolumeSize");
     batch._glUniform3f(voxelVolumeSizeLocation, _voxelVolumeSize.x, _voxelVolumeSize.y, _voxelVolumeSize.z);
 
-    batch.drawIndexed(gpu::TRIANGLES, mesh->getNumIndices(), 0);
+    batch.drawIndexed(gpu::TRIANGLES, (gpu::uint32)mesh->getNumIndices(), 0);
 }
 
 bool RenderablePolyVoxEntityItem::addToScene(EntityItemPointer self,
diff --git a/libraries/entities-renderer/src/RenderableSphereEntityItem.cpp b/libraries/entities-renderer/src/RenderableSphereEntityItem.cpp
index 8768e41a07..6c72dc488c 100644
--- a/libraries/entities-renderer/src/RenderableSphereEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableSphereEntityItem.cpp
@@ -72,5 +72,5 @@ void RenderableSphereEntityItem::render(RenderArgs* args) {
         DependencyManager::get<DeferredLightingEffect>()->renderSolidSphereInstance(batch, modelTransform, sphereColor);
     }
     static const auto triCount = DependencyManager::get<GeometryCache>()->getSphereTriangleCount();
-    args->_details._trianglesRendered += triCount;
+    args->_details._trianglesRendered += (int)triCount;
 }
diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp
index f74cdedb9d..13d5c2836f 100644
--- a/libraries/entities/src/EntityItem.cpp
+++ b/libraries/entities/src/EntityItem.cpp
@@ -620,7 +620,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
     Q_ASSERT(parser.data() + parser.offset() == dataAt);
 #else
     const unsigned char* dataAt = parser.data() + parser.offset();
-    int bytesRead = parser.offset();
+    int bytesRead = (int)parser.offset();
 #endif
 
     auto nodeList = DependencyManager::get<NodeList>();
@@ -749,7 +749,7 @@ void EntityItem::debugDump() const {
 void EntityItem::adjustEditPacketForClockSkew(QByteArray& buffer, int clockSkew) {
     unsigned char* dataAt = reinterpret_cast<unsigned char*>(buffer.data());
     int octets = numberOfThreeBitSectionsInCode(dataAt);
-    int lengthOfOctcode = bytesRequiredForCodeLength(octets);
+    int lengthOfOctcode = (int)bytesRequiredForCodeLength(octets);
     dataAt += lengthOfOctcode;
 
     // lastEdited
diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp
index 2e785519da..98a099fcaa 100644
--- a/libraries/entities/src/EntityItemProperties.cpp
+++ b/libraries/entities/src/EntityItemProperties.cpp
@@ -1124,7 +1124,7 @@ bool EntityItemProperties::decodeEntityEditPacket(const unsigned char* data, int
     // the first part of the data is an octcode, this is a required element of the edit packet format, but we don't
     // actually use it, we do need to skip it and read to the actual data we care about.
     int octets = numberOfThreeBitSectionsInCode(data);
-    int bytesToReadOfOctcode = bytesRequiredForCodeLength(octets);
+    int bytesToReadOfOctcode = (int)bytesRequiredForCodeLength(octets);
 
     // we don't actually do anything with this octcode...
     dataAt += bytesToReadOfOctcode;
diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp
index fb2acf3fe7..ba6294f8a8 100644
--- a/libraries/entities/src/EntityTree.cpp
+++ b/libraries/entities/src/EntityTree.cpp
@@ -1062,7 +1062,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
                 break; // bail to prevent buffer overflow
             }
 
-            QByteArray encodedID = dataByteArray.mid(processedBytes, NUM_BYTES_RFC4122_UUID);
+            QByteArray encodedID = dataByteArray.mid((int)processedBytes, NUM_BYTES_RFC4122_UUID);
             QUuid entityID = QUuid::fromRfc4122(encodedID);
             dataAt += encodedID.size();
             processedBytes += encodedID.size();
@@ -1081,7 +1081,7 @@ int EntityTree::processEraseMessageDetails(const QByteArray& dataByteArray, cons
         }
         deleteEntities(entityItemIDsToDelete, true, true);
     }
-    return processedBytes;
+    return (int)processedBytes;
 }
 
 EntityTreeElementPointer EntityTree::getContainingElement(const EntityItemID& entityItemID)  /*const*/ {
diff --git a/libraries/environment/src/EnvironmentData.cpp b/libraries/environment/src/EnvironmentData.cpp
index 4cb8f7a010..7a0bd29bc0 100644
--- a/libraries/environment/src/EnvironmentData.cpp
+++ b/libraries/environment/src/EnvironmentData.cpp
@@ -38,7 +38,7 @@ glm::vec3 EnvironmentData::getSunLocation(const glm::vec3& cameraPosition) const
     return _sunLocation;
 }
 
-int EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const {
+size_t EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const {
     unsigned char* bufferStart = destinationBuffer;
     
     memcpy(destinationBuffer, &_id, sizeof(_id));
@@ -77,7 +77,7 @@ int EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const {
     return destinationBuffer - bufferStart;
 }
 
-int EnvironmentData::parseData(const unsigned char* sourceBuffer, int numBytes) {
+size_t EnvironmentData::parseData(const unsigned char* sourceBuffer, int numBytes) {
     const unsigned char* startPosition = sourceBuffer;
     
     memcpy(&_id, sourceBuffer, sizeof(_id));
diff --git a/libraries/environment/src/EnvironmentData.h b/libraries/environment/src/EnvironmentData.h
index ebbb3d1fb0..daed752d4c 100644
--- a/libraries/environment/src/EnvironmentData.h
+++ b/libraries/environment/src/EnvironmentData.h
@@ -54,8 +54,8 @@ public:
     glm::vec3 getAtmosphereCenter(const glm::vec3& cameraPosition) const;
     glm::vec3 getSunLocation(const glm::vec3& cameraPosition) const;
 
-    int getBroadcastData(unsigned char* destinationBuffer) const;
-    int parseData(const unsigned char* sourceBuffer, int numBytes);
+    size_t getBroadcastData(unsigned char* destinationBuffer) const;
+    size_t parseData(const unsigned char* sourceBuffer, int numBytes);
     
 private:
 
diff --git a/libraries/fbx/src/FBXReader.h b/libraries/fbx/src/FBXReader.h
index 0ddbc11bda..51cb5baf9f 100644
--- a/libraries/fbx/src/FBXReader.h
+++ b/libraries/fbx/src/FBXReader.h
@@ -195,8 +195,7 @@ public:
     QMultiHash<int, int> newIndices;
     QVector<QHash<int, int> > blendshapeIndexMaps;
     QVector<QPair<int, int> > partMaterialTextures;
-    QHash<QString, int> texcoordSetMap;
-    std::map<QString, int> texcoordSetMap2;
+    QHash<QString, size_t> texcoordSetMap;
 };
 
 /// A single animation frame extracted from an FBX document.
diff --git a/libraries/fbx/src/FBXReader_Mesh.cpp b/libraries/fbx/src/FBXReader_Mesh.cpp
index dbada15588..5a824aa284 100644
--- a/libraries/fbx/src/FBXReader_Mesh.cpp
+++ b/libraries/fbx/src/FBXReader_Mesh.cpp
@@ -288,7 +288,7 @@ ExtractedMesh FBXReader::extractMesh(const FBXNode& object, unsigned int& meshIn
 #endif
                 }
 
-                QHash<QString, int>::iterator it = data.extracted.texcoordSetMap.find(attrib.name);
+                QHash<QString, size_t>::iterator it = data.extracted.texcoordSetMap.find(attrib.name);
                 if (it == data.extracted.texcoordSetMap.end()) {
                     data.extracted.texcoordSetMap.insert(attrib.name, data.attributes.size());
                     data.attributes.push_back(attrib);
diff --git a/libraries/gpu/src/gpu/GLBackendOutput.cpp b/libraries/gpu/src/gpu/GLBackendOutput.cpp
index 3ae8ee5435..6d8ce7b2c6 100755
--- a/libraries/gpu/src/gpu/GLBackendOutput.cpp
+++ b/libraries/gpu/src/gpu/GLBackendOutput.cpp
@@ -118,7 +118,7 @@ GLBackend::GLFramebuffer* GLBackend::syncGPUObject(const Framebuffer& framebuffe
 
         // Last but not least, define where we draw
         if (!colorBuffers.empty()) {
-            glDrawBuffers(colorBuffers.size(), colorBuffers.data());
+            glDrawBuffers((GLsizei)colorBuffers.size(), colorBuffers.data());
         } else {
             glDrawBuffer( GL_NONE );
         }
@@ -253,7 +253,7 @@ void GLBackend::do_clearFramebuffer(Batch& batch, size_t paramOffset) {
             }
 
             if (!drawBuffers.empty()) {
-                glDrawBuffers(drawBuffers.size(), drawBuffers.data());
+                glDrawBuffers((GLsizei)drawBuffers.size(), drawBuffers.data());
                 glClearColor(color.x, color.y, color.z, color.w);
                 glmask |= GL_COLOR_BUFFER_BIT;
             
@@ -291,7 +291,7 @@ void GLBackend::do_clearFramebuffer(Batch& batch, size_t paramOffset) {
     if (_output._framebuffer && !drawBuffers.empty()) {
         auto glFramebuffer = syncGPUObject(*_output._framebuffer);
         if (glFramebuffer) {
-            glDrawBuffers(glFramebuffer->_colorBuffers.size(), glFramebuffer->_colorBuffers.data());
+            glDrawBuffers((GLsizei)glFramebuffer->_colorBuffers.size(), glFramebuffer->_colorBuffers.data());
         }
     }
 
@@ -301,13 +301,13 @@ void GLBackend::do_clearFramebuffer(Batch& batch, size_t paramOffset) {
 void GLBackend::do_blit(Batch& batch, size_t paramOffset) {
     auto srcframebuffer = batch._framebuffers.get(batch._params[paramOffset]._uint);
     Vec4i srcvp;
-    for (size_t i = 0; i < 4; ++i) {
+    for (auto i = 0; i < 4; ++i) {
         srcvp[i] = batch._params[paramOffset + 1 + i]._int;
     }
 
     auto dstframebuffer = batch._framebuffers.get(batch._params[paramOffset + 5]._uint);
     Vec4i dstvp;
-    for (size_t i = 0; i < 4; ++i) {
+    for (auto i = 0; i < 4; ++i) {
         dstvp[i] = batch._params[paramOffset + 6 + i]._int;
     }
 
diff --git a/libraries/gpu/src/gpu/GLBackendTexture.cpp b/libraries/gpu/src/gpu/GLBackendTexture.cpp
index 71c5a83331..65f2e5ca8a 100755
--- a/libraries/gpu/src/gpu/GLBackendTexture.cpp
+++ b/libraries/gpu/src/gpu/GLBackendTexture.cpp
@@ -357,7 +357,7 @@ GLBackend::GLTexture* GLBackend::syncGPUObject(const Texture& texture) {
 
                 object->_storageStamp = texture.getStamp();
                 object->_contentStamp = texture.getDataStamp();
-                object->_size = texture.getSize();
+                object->_size = (GLuint)texture.getSize();
             }
 
             glBindTexture(GL_TEXTURE_2D, boundTex);
@@ -435,7 +435,7 @@ GLBackend::GLTexture* GLBackend::syncGPUObject(const Texture& texture) {
 
                 object->_storageStamp = texture.getStamp();
                 object->_contentStamp = texture.getDataStamp();
-                object->_size = texture.getSize();
+                object->_size = (GLuint)texture.getSize();
             }
 
             glBindTexture(GL_TEXTURE_CUBE_MAP, boundTex);
diff --git a/libraries/gpu/src/gpu/Texture.cpp b/libraries/gpu/src/gpu/Texture.cpp
index ae6f3b740d..3f2415d240 100755
--- a/libraries/gpu/src/gpu/Texture.cpp
+++ b/libraries/gpu/src/gpu/Texture.cpp
@@ -99,7 +99,7 @@ bool Texture::Storage::assignMipData(uint16 level, const Element& format, Size s
     // The bytes assigned here are supposed to contain all the faces bytes of the mip.
     // For tex1D, 2D, 3D there is only one face
     // For Cube, we expect the 6 faces in the order X+, X-, Y+, Y-, Z+, Z-
-    int sizePerFace = size / mip.size();
+    auto sizePerFace = size / mip.size();
     auto faceBytes = bytes;
     Size allocated = 0;
     for (auto& face : mip) {
diff --git a/libraries/model-networking/src/model-networking/ModelCache.cpp b/libraries/model-networking/src/model-networking/ModelCache.cpp
index c7d3523496..e1aeb92e41 100644
--- a/libraries/model-networking/src/model-networking/ModelCache.cpp
+++ b/libraries/model-networking/src/model-networking/ModelCache.cpp
@@ -335,7 +335,7 @@ void NetworkGeometry::modelParseSuccess(FBXGeometry* geometry) {
         _meshes.emplace_back(buildNetworkMesh(mesh, _textureBaseUrl));
     }
 
-    QHash<QString, int> fbxMatIDToMatID;
+    QHash<QString, size_t> fbxMatIDToMatID;
     foreach(const FBXMaterial& material, _geometry->materials) {
         fbxMatIDToMatID[material.materialID] = _materials.size();
         _materials.emplace_back(buildNetworkMaterial(material, _textureBaseUrl));
@@ -349,7 +349,7 @@ void NetworkGeometry::modelParseSuccess(FBXGeometry* geometry) {
             NetworkShape* networkShape = new NetworkShape();
             networkShape->_meshID = meshID;
             networkShape->_partID = partID;
-            networkShape->_materialID = fbxMatIDToMatID[part.materialID];
+            networkShape->_materialID = (int)fbxMatIDToMatID[part.materialID];
             _shapes.emplace_back(networkShape);
             partID++;
         }
diff --git a/libraries/model/src/model/Geometry.h b/libraries/model/src/model/Geometry.h
index a35d55d938..fa29faff5f 100755
--- a/libraries/model/src/model/Geometry.h
+++ b/libraries/model/src/model/Geometry.h
@@ -46,11 +46,11 @@ public:
     // Vertex buffer
     void setVertexBuffer(const BufferView& buffer);
     const BufferView& getVertexBuffer() const { return _vertexBuffer; }
-    uint getNumVertices() const { return _vertexBuffer.getNumElements(); }
+    size_t getNumVertices() const { return _vertexBuffer.getNumElements(); }
     bool hasVertexData() const { return _vertexBuffer._buffer.get() != nullptr; }
 
     // Attribute Buffers
-    int getNumAttributes() const { return _attributeBuffers.size(); }
+    size_t getNumAttributes() const { return _attributeBuffers.size(); }
     void addAttribute(Slot slot, const BufferView& buffer);
     const BufferView getAttributeBuffer(int attrib) const;
 
@@ -63,7 +63,7 @@ public:
     // Index Buffer
     void setIndexBuffer(const BufferView& buffer);
     const BufferView& getIndexBuffer() const { return _indexBuffer; }
-    uint getNumIndices() const { return _indexBuffer.getNumElements(); }
+    size_t getNumIndices() const { return _indexBuffer.getNumElements(); }
 
     // Access vertex position value
     const Vec3& getPos3(Index index) const { return _vertexBuffer.get<Vec3>(index); }
@@ -104,7 +104,7 @@ public:
 
     void setPartBuffer(const BufferView& buffer);
     const BufferView& getPartBuffer() const { return _partBuffer; }
-    uint getNumParts() const { return _partBuffer.getNumElements(); }
+    size_t getNumParts() const { return _partBuffer.getNumElements(); }
 
     // evaluate the bounding box of A part
     Box evalPartBound(int partNum) const;
diff --git a/libraries/networking/src/LimitedNodeList.h b/libraries/networking/src/LimitedNodeList.h
index 7f95291e5b..c89949b9fd 100644
--- a/libraries/networking/src/LimitedNodeList.h
+++ b/libraries/networking/src/LimitedNodeList.h
@@ -131,7 +131,7 @@ public:
 
     void (*linkedDataCreateCallback)(Node *);
 
-    int size() const { return _nodeHash.size(); }
+    size_t size() const { return _nodeHash.size(); }
 
     SharedNodePointer nodeWithUUID(const QUuid& nodeUUID);
 
diff --git a/libraries/networking/src/PacketSender.cpp b/libraries/networking/src/PacketSender.cpp
index 14737dfb8d..0cfd67cc4e 100644
--- a/libraries/networking/src/PacketSender.cpp
+++ b/libraries/networking/src/PacketSender.cpp
@@ -259,7 +259,7 @@ bool PacketSender::nonThreadedProcess() {
         }
     }
 
-    int packetsLeft = _packets.size();
+    auto packetsLeft = _packets.size();
 
     // Now that we know how many packets to send this call to process, just send them.
     while ((packetsSentThisCall < packetsToSendThisCall) && (packetsLeft > 0)) {
diff --git a/libraries/networking/src/PacketSender.h b/libraries/networking/src/PacketSender.h
index e4792c55c3..e177172788 100644
--- a/libraries/networking/src/PacketSender.h
+++ b/libraries/networking/src/PacketSender.h
@@ -50,7 +50,7 @@ public:
     bool hasPacketsToSend() const { return _packets.size() > 0; }
 
     /// how many packets are there in the send queue waiting to be sent
-    int packetsToSendCount() const { return _packets.size(); }
+    size_t packetsToSendCount() const { return _packets.size(); }
 
     /// If you're running in non-threaded mode, call this to give us a hint as to how frequently you will call process.
     /// This has no effect in threaded mode. This is only considered a hint in non-threaded mode.
diff --git a/libraries/networking/src/ReceivedPacketProcessor.h b/libraries/networking/src/ReceivedPacketProcessor.h
index 3a0e93ee09..1d9580f3d0 100644
--- a/libraries/networking/src/ReceivedPacketProcessor.h
+++ b/libraries/networking/src/ReceivedPacketProcessor.h
@@ -44,7 +44,7 @@ public:
     }
 
     /// How many received packets waiting are to be processed
-    int packetsToProcessCount() const { return _packets.size(); }
+    size_t packetsToProcessCount() const { return _packets.size(); }
 
     float getIncomingPPS() const { return _incomingPPS.getAverage(); }
     float getProcessedPPS() const { return _processedPPS.getAverage(); }
diff --git a/libraries/networking/src/udt/PacketList.cpp b/libraries/networking/src/udt/PacketList.cpp
index e4212ccb88..978df9b9bb 100644
--- a/libraries/networking/src/udt/PacketList.cpp
+++ b/libraries/networking/src/udt/PacketList.cpp
@@ -129,7 +129,7 @@ QByteArray PacketList::getMessage() const {
     }
 
     QByteArray data;
-    data.reserve(sizeBytes);
+    data.reserve((int)sizeBytes);
 
     for (auto& packet : _packets) {
         data.append(packet->getPayload(), packet->getPayloadSize());
diff --git a/libraries/networking/src/udt/PacketList.h b/libraries/networking/src/udt/PacketList.h
index 2c6c14f42f..4f1e46e616 100644
--- a/libraries/networking/src/udt/PacketList.h
+++ b/libraries/networking/src/udt/PacketList.h
@@ -39,7 +39,7 @@ public:
     bool isReliable() const { return _isReliable; }
     bool isOrdered() const { return _isOrdered; }
     
-    int getNumPackets() const { return _packets.size() + (_currentPacket ? 1 : 0); }
+    size_t getNumPackets() const { return _packets.size() + (_currentPacket ? 1 : 0); }
     size_t getDataSize() const;
     size_t getMessageSize() const;
     QByteArray getMessage() const;
diff --git a/libraries/octree/src/JurisdictionMap.cpp b/libraries/octree/src/JurisdictionMap.cpp
index d473b3973e..5e66e21242 100644
--- a/libraries/octree/src/JurisdictionMap.cpp
+++ b/libraries/octree/src/JurisdictionMap.cpp
@@ -278,7 +278,7 @@ std::unique_ptr<NLPacket> JurisdictionMap::packIntoPacket() {
         packet->write(reinterpret_cast<char*>(_rootOctalCode), bytes);
 
         // if and only if there's a root jurisdiction, also include the end nodes
-        int endNodeCount = _endNodes.size();
+        auto endNodeCount = _endNodes.size();
         packet->writePrimitive(endNodeCount);
 
         for (int i=0; i < endNodeCount; i++) {
diff --git a/libraries/octree/src/JurisdictionMap.h b/libraries/octree/src/JurisdictionMap.h
index 3f415efba8..18d2bbbeed 100644
--- a/libraries/octree/src/JurisdictionMap.h
+++ b/libraries/octree/src/JurisdictionMap.h
@@ -52,7 +52,7 @@ public:
 
     unsigned char* getRootOctalCode() const { return _rootOctalCode; }
     unsigned char* getEndNodeOctalCode(int index) const { return _endNodes[index]; }
-    int getEndNodeCount() const { return _endNodes.size(); }
+    size_t getEndNodeCount() const { return _endNodes.size(); }
 
     void copyContents(unsigned char* rootCodeIn, const std::vector<unsigned char*>& endNodesIn);
 
diff --git a/libraries/octree/src/Octree.cpp b/libraries/octree/src/Octree.cpp
index aacb57f31d..636d1a9a1a 100644
--- a/libraries/octree/src/Octree.cpp
+++ b/libraries/octree/src/Octree.cpp
@@ -479,12 +479,12 @@ void Octree::readBitstreamToTree(const unsigned char * bitstream, unsigned long
             }
         }
 
-        int octalCodeBytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInStream);
+        auto octalCodeBytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInStream);
 
         int theseBytesRead = 0;
-        theseBytesRead += octalCodeBytes;
+        theseBytesRead += (int)octalCodeBytes;
         int lowerLevelBytes = readElementData(bitstreamRootElement, bitstreamAt + octalCodeBytes,
-                                       bufferSizeBytes - (bytesRead + octalCodeBytes), args);
+                                       bufferSizeBytes - (bytesRead + (int)octalCodeBytes), args);
 
         theseBytesRead += lowerLevelBytes;
 
@@ -921,7 +921,7 @@ int Octree::encodeTreeBitstream(OctreeElementPointer element,
         }
     } else {
         roomForOctalCode = packetData->startSubTree(element->getOctalCode());
-        codeLength = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(element->getOctalCode()));
+        codeLength = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(element->getOctalCode()));
     }
 
     // If the octalcode couldn't fit, then we can return, because no nodes below us will fit...
diff --git a/libraries/octree/src/OctreeEditPacketSender.cpp b/libraries/octree/src/OctreeEditPacketSender.cpp
index df53a0f873..d3a72ce113 100644
--- a/libraries/octree/src/OctreeEditPacketSender.cpp
+++ b/libraries/octree/src/OctreeEditPacketSender.cpp
@@ -149,7 +149,7 @@ void OctreeEditPacketSender::queuePendingPacketToNodes(std::unique_ptr<NLPacket>
         _pendingPacketsLock.lock();
         _preServerSingleMessagePackets.push_back(std::move(packet));
         // if we've saved MORE than our max, then clear out the oldest packet...
-        int allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
+        auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
         if (allPendingMessages > _maxPendingMessages) {
             _preServerSingleMessagePackets.pop_front();
         }
@@ -210,7 +210,7 @@ void OctreeEditPacketSender::queueOctreeEditMessage(PacketType type, QByteArray&
             _preServerEdits.push_back(messagePair);
 
             // if we've saved MORE than out max, then clear out the oldest packet...
-            int allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
+            auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
             if (allPendingMessages > _maxPendingMessages) {
                 _preServerEdits.pop_front();
             }
diff --git a/libraries/octree/src/OctreePacketData.cpp b/libraries/octree/src/OctreePacketData.cpp
index 811e96fcf4..f063c60fd7 100644
--- a/libraries/octree/src/OctreePacketData.cpp
+++ b/libraries/octree/src/OctreePacketData.cpp
@@ -149,7 +149,7 @@ bool OctreePacketData::startSubTree(const unsigned char* octcode) {
     int possibleStartAt = _bytesInUse;
     int length = 0;
     if (octcode) {
-        length = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(octcode));
+        length = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(octcode));
         success = append(octcode, length); // handles checking compression
     } else {
         // NULL case, means root node, which is 0
diff --git a/libraries/octree/src/OctreeSceneStats.cpp b/libraries/octree/src/OctreeSceneStats.cpp
index 822fbb2c50..8b9334eafd 100644
--- a/libraries/octree/src/OctreeSceneStats.cpp
+++ b/libraries/octree/src/OctreeSceneStats.cpp
@@ -123,14 +123,14 @@ void OctreeSceneStats::copyFromOther(const OctreeSceneStats& other) {
 
     // Now copy the values from the other
     if (other._jurisdictionRoot) {
-        int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(other._jurisdictionRoot));
+        auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(other._jurisdictionRoot));
         _jurisdictionRoot = new unsigned char[bytes];
         memcpy(_jurisdictionRoot, other._jurisdictionRoot, bytes);
     }
     for (size_t i = 0; i < other._jurisdictionEndNodes.size(); i++) {
         unsigned char* endNodeCode = other._jurisdictionEndNodes[i];
         if (endNodeCode) {
-            int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
+            auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
             unsigned char* endNodeCodeCopy = new unsigned char[bytes];
             memcpy(endNodeCodeCopy, endNodeCode, bytes);
             _jurisdictionEndNodes.push_back(endNodeCodeCopy);
@@ -178,7 +178,7 @@ void OctreeSceneStats::sceneStarted(bool isFullScene, bool isMoving, OctreeEleme
     if (jurisdictionMap) {
         unsigned char* jurisdictionRoot = jurisdictionMap->getRootOctalCode();
         if (jurisdictionRoot) {
-            int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(jurisdictionRoot));
+            auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(jurisdictionRoot));
             _jurisdictionRoot = new unsigned char[bytes];
             memcpy(_jurisdictionRoot, jurisdictionRoot, bytes);
         }
@@ -187,7 +187,7 @@ void OctreeSceneStats::sceneStarted(bool isFullScene, bool isMoving, OctreeEleme
         for (int i = 0; i < jurisdictionMap->getEndNodeCount(); i++) {
             unsigned char* endNodeCode = jurisdictionMap->getEndNodeOctalCode(i);
             if (endNodeCode) {
-                int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
+                auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
                 unsigned char* endNodeCodeCopy = new unsigned char[bytes];
                 memcpy(endNodeCodeCopy, endNodeCode, bytes);
                 _jurisdictionEndNodes.push_back(endNodeCodeCopy);
@@ -418,18 +418,18 @@ int OctreeSceneStats::packIntoPacket() {
     // add the root jurisdiction
     if (_jurisdictionRoot) {
         // copy the
-        int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
+        auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
         _statsPacket->writePrimitive(bytes);
         _statsPacket->write(reinterpret_cast<char*>(_jurisdictionRoot), bytes);
 
         // if and only if there's a root jurisdiction, also include the end elements
-        int endNodeCount = _jurisdictionEndNodes.size();
+        auto endNodeCount = _jurisdictionEndNodes.size();
 
         _statsPacket->writePrimitive(endNodeCount);
 
         for (int i=0; i < endNodeCount; i++) {
             unsigned char* endNodeCode = _jurisdictionEndNodes[i];
-            int bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
+            auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(endNodeCode));
             _statsPacket->writePrimitive(bytes);
             _statsPacket->write(reinterpret_cast<char*>(endNodeCode), bytes);
         }
diff --git a/libraries/octree/src/OctreeScriptingInterface.h b/libraries/octree/src/OctreeScriptingInterface.h
index 47b01c64f9..86b9730393 100644
--- a/libraries/octree/src/OctreeScriptingInterface.h
+++ b/libraries/octree/src/OctreeScriptingInterface.h
@@ -51,7 +51,7 @@ public slots:
     bool hasPacketsToSend() const { return _packetSender->hasPacketsToSend(); }
 
     /// how many packets are there in the send queue waiting to be sent
-    int packetsToSendCount() const { return _packetSender->packetsToSendCount(); }
+    int packetsToSendCount() const { return (int)_packetSender->packetsToSendCount(); }
 
     /// returns the packets per second send rate of this object over its lifetime
     float getLifetimePPS() const { return _packetSender->getLifetimePPS(); }
diff --git a/libraries/physics/src/MeshMassProperties.cpp b/libraries/physics/src/MeshMassProperties.cpp
index d18c068d26..a6a33932aa 100644
--- a/libraries/physics/src/MeshMassProperties.cpp
+++ b/libraries/physics/src/MeshMassProperties.cpp
@@ -271,7 +271,7 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
 
     // create some variables to hold temporary results
     #ifndef NDEBUG
-    uint32_t numPoints = points.size();
+    uint32_t numPoints = (uint32_t)points.size();
     #endif
     const btVector3 p0(0.0f, 0.0f, 0.0f);
     btMatrix3x3 tetraInertia;
@@ -280,7 +280,7 @@ void MeshMassProperties::computeMassProperties(const VectorOfPoints& points, con
     btVector3 center;
     
     // loop over triangles
-    uint32_t numTriangles = triangleIndices.size() / 3;
+    uint32_t numTriangles = (uint32_t)triangleIndices.size() / 3;
     for (uint32_t i = 0; i < numTriangles; ++i) {
         uint32_t t = 3 * i;
         #ifndef NDEBUG
diff --git a/libraries/procedural/src/procedural/Procedural.cpp b/libraries/procedural/src/procedural/Procedural.cpp
index 69a433d5e1..b1e4bd53ed 100644
--- a/libraries/procedural/src/procedural/Procedural.cpp
+++ b/libraries/procedural/src/procedural/Procedural.cpp
@@ -123,7 +123,7 @@ void Procedural::parse(const QJsonObject& proceduralData) {
             _parsedChannels = channels.toArray();
             size_t channelCount = std::min(MAX_PROCEDURAL_TEXTURE_CHANNELS, (size_t)_parsedChannels.size());
             for (size_t i = 0; i < channelCount; ++i) {
-                QString url = _parsedChannels.at(i).toString();
+                QString url = _parsedChannels.at((int)i).toString();
                 _channels[i] = textureCache->getTexture(QUrl(url));
             }
         }
@@ -238,7 +238,7 @@ void Procedural::prepare(gpu::Batch& batch, const glm::vec3& position, const glm
                 gpuTexture->setSampler(sampler);
                 gpuTexture->autoGenerateMips(-1);
             }
-            batch.setResourceTexture(i, gpuTexture);
+            batch.setResourceTexture((gpu::uint32)i, gpuTexture);
         }
     }
 }
diff --git a/libraries/render-utils/src/AnimDebugDraw.cpp b/libraries/render-utils/src/AnimDebugDraw.cpp
index d17676fe90..aa366f04b9 100644
--- a/libraries/render-utils/src/AnimDebugDraw.cpp
+++ b/libraries/render-utils/src/AnimDebugDraw.cpp
@@ -48,7 +48,7 @@ public:
         batch.setIndexBuffer(gpu::UINT16, _indexBuffer, 0);
 
         auto numIndices = _indexBuffer->getSize() / sizeof(uint16_t);
-        batch.drawIndexed(gpu::LINES, numIndices);
+        batch.drawIndexed(gpu::LINES, (int)numIndices);
     }
 
     gpu::PipelinePointer _pipeline;
@@ -321,12 +321,12 @@ void AnimDebugDraw::update() {
         const float POSE_RADIUS = 0.1f; // 10 cm
 
         // figure out how many verts we will need.
-        int numVerts = 0;
+        size_t numVerts = 0;
 
         for (auto& iter : _absolutePoses) {
             AnimSkeleton::ConstPointer& skeleton = std::get<0>(iter.second);
             numVerts += skeleton->getNumJoints() * VERTICES_PER_BONE;
-            for (int i = 0; i < skeleton->getNumJoints(); i++) {
+            for (auto i = 0; i < skeleton->getNumJoints(); i++) {
                 auto parentIndex = skeleton->getParentIndex(i);
                 if (parentIndex >= 0) {
                     numVerts += VERTICES_PER_LINK;
diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp
index 342471454d..10b58b156b 100644
--- a/libraries/render-utils/src/DeferredLightingEffect.cpp
+++ b/libraries/render-utils/src/DeferredLightingEffect.cpp
@@ -314,7 +314,7 @@ void DeferredLightingEffect::addPointLight(const glm::vec3& position, float radi
 void DeferredLightingEffect::addSpotLight(const glm::vec3& position, float radius, const glm::vec3& color,
     float intensity, const glm::quat& orientation, float exponent, float cutoff) {
     
-    unsigned int lightID = _pointLights.size() + _spotLights.size() + _globalLights.size();
+    unsigned int lightID = (unsigned int)(_pointLights.size() + _spotLights.size() + _globalLights.size());
     if (lightID >= _allocatedLights.size()) {
         _allocatedLights.push_back(std::make_shared<model::Light>());
     }
diff --git a/libraries/render-utils/src/GeometryCache.cpp b/libraries/render-utils/src/GeometryCache.cpp
index b9fdcd95a4..5ae90e2124 100644
--- a/libraries/render-utils/src/GeometryCache.cpp
+++ b/libraries/render-utils/src/GeometryCache.cpp
@@ -93,28 +93,28 @@ void GeometryCache::ShapeData::setupBatch(gpu::Batch& batch) const {
 void GeometryCache::ShapeData::draw(gpu::Batch& batch) const {
     if (_indexCount) {
         setupBatch(batch);
-        batch.drawIndexed(gpu::TRIANGLES, _indexCount, _indexOffset);
+        batch.drawIndexed(gpu::TRIANGLES, (gpu::uint32)_indexCount, (gpu::uint32)_indexOffset);
     }
 }
 
 void GeometryCache::ShapeData::drawWire(gpu::Batch& batch) const {
     if (_wireIndexCount) {
         setupBatch(batch);
-        batch.drawIndexed(gpu::LINES, _wireIndexCount, _wireIndexOffset);
+        batch.drawIndexed(gpu::LINES, (gpu::uint32)_wireIndexCount, (gpu::uint32)_wireIndexOffset);
     }
 }
 
 void GeometryCache::ShapeData::drawInstances(gpu::Batch& batch, size_t count) const {
     if (_indexCount) {
         setupBatch(batch);
-        batch.drawIndexedInstanced(count, gpu::TRIANGLES, _indexCount, _indexOffset);
+        batch.drawIndexedInstanced((gpu::uint32)count, gpu::TRIANGLES, (gpu::uint32)_indexCount, (gpu::uint32)_indexOffset);
     }
 }
 
 void GeometryCache::ShapeData::drawWireInstances(gpu::Batch& batch, size_t count) const {
     if (_wireIndexCount) {
         setupBatch(batch);
-        batch.drawIndexedInstanced(count, gpu::LINES, _wireIndexCount, _wireIndexOffset);
+        batch.drawIndexedInstanced((gpu::uint32)count, gpu::LINES, (gpu::uint32)_wireIndexCount, (gpu::uint32)_wireIndexOffset);
     }
 }
 
@@ -235,7 +235,7 @@ size_t GeometryCache::getCubeTriangleCount() {
 void GeometryCache::buildShapes() {
     auto vertexBuffer = std::make_shared<gpu::Buffer>();
     auto indexBuffer = std::make_shared<gpu::Buffer>();
-    uint16_t startingIndex = 0;
+    size_t startingIndex = 0;
     
     // Cube 
     startingIndex = _shapeVertices->getSize() / SHAPE_VERTEX_STRIDE;
@@ -324,7 +324,7 @@ void GeometryCache::buildShapes() {
             20, 21, 22, 22, 23, 20  // back
         };
         for (auto& index : indices) {
-            index += startingIndex;
+            index += (uint16_t)startingIndex;
         }
 
         IndexVector wireIndices{
@@ -334,7 +334,7 @@ void GeometryCache::buildShapes() {
         };
 
         for (size_t i = 0; i < wireIndices.size(); ++i) {
-            indices[i] += startingIndex;
+            indices[i] += (uint16_t)startingIndex;
         }
 
         shapeData.setupIndices(_shapeIndices, indices, wireIndices);
@@ -375,7 +375,7 @@ void GeometryCache::buildShapes() {
             for (size_t j = 0; j < VERTICES_PER_TRIANGLE; ++j) {
                 auto triangleVertexIndex = j;
                 auto vertexIndex = triangleStartIndex + triangleVertexIndex;
-                indices.push_back(vertexIndex + startingIndex);
+                indices.push_back((uint16_t)(vertexIndex + startingIndex));
             }
         }
 
@@ -385,7 +385,7 @@ void GeometryCache::buildShapes() {
         };
 
         for (size_t i = 0; i < wireIndices.size(); ++i) {
-            wireIndices[i] += startingIndex;
+            wireIndices[i] += (uint16_t)startingIndex;
         }
 
         shapeData.setupIndices(_shapeIndices, indices, wireIndices);
@@ -411,7 +411,7 @@ void GeometryCache::buildShapes() {
                     // Spheres use the same values for vertices and normals
                     vertices.push_back(vertex);
                     vertices.push_back(vertex);
-                    indices.push_back(vertexIndex + startingIndex);
+                    indices.push_back((uint16_t)(vertexIndex + startingIndex));
                 }
             }
         }
@@ -445,7 +445,7 @@ void GeometryCache::buildShapes() {
                     auto vertexIndex = triangleStartIndex + triangleVertexIndex;
                     vertices.push_back(glm::normalize(originalVertices[vertexIndex]));
                     vertices.push_back(faceNormal);
-                    indices.push_back(vertexIndex + startingIndex);
+                    indices.push_back((uint16_t)(vertexIndex + startingIndex));
                 }
             }
         }
@@ -465,8 +465,8 @@ void GeometryCache::buildShapes() {
         });
         IndexVector wireIndices;
         // Only two indices
-        wireIndices.push_back(0 + startingIndex);
-        wireIndices.push_back(1 + startingIndex);
+        wireIndices.push_back(0 + (uint16_t)startingIndex);
+        wireIndices.push_back(1 + (uint16_t)startingIndex);
 
         shapeData.setupIndices(_shapeIndices, IndexVector(), wireIndices);
     }
diff --git a/libraries/render-utils/src/Model.h b/libraries/render-utils/src/Model.h
index 08abb74316..2465bd5c29 100644
--- a/libraries/render-utils/src/Model.h
+++ b/libraries/render-utils/src/Model.h
@@ -156,7 +156,7 @@ public:
     }
 
     /// Returns the number of joint states in the model.
-    int getJointStateCount() const { return _rig->getJointStateCount(); }
+    int getJointStateCount() const { return (int)_rig->getJointStateCount(); }
     bool getJointPositionInWorldFrame(int jointIndex, glm::vec3& position) const;
     bool getJointRotationInWorldFrame(int jointIndex, glm::quat& rotation) const;
     bool getJointCombinedRotation(int jointIndex, glm::quat& rotation) const;
diff --git a/libraries/render-utils/src/RenderDeferredTask.cpp b/libraries/render-utils/src/RenderDeferredTask.cpp
index 1430651c86..275e8af29c 100755
--- a/libraries/render-utils/src/RenderDeferredTask.cpp
+++ b/libraries/render-utils/src/RenderDeferredTask.cpp
@@ -91,12 +91,12 @@ RenderDeferredTask::RenderDeferredTask() : Task() {
     _jobs.push_back(Job(new AmbientOcclusion::JobModel("AmbientOcclusion")));
 
     _jobs.back().setEnabled(false);
-    _occlusionJobIndex = _jobs.size() - 1;
+    _occlusionJobIndex = (int)_jobs.size() - 1;
 
     _jobs.push_back(Job(new Antialiasing::JobModel("Antialiasing")));
 
     _jobs.back().setEnabled(false);
-    _antialiasingJobIndex = _jobs.size() - 1;
+    _antialiasingJobIndex = (int)_jobs.size() - 1;
 
     _jobs.push_back(Job(new FetchItems::JobModel("FetchTransparent",
          FetchItems(
@@ -119,13 +119,13 @@ RenderDeferredTask::RenderDeferredTask() : Task() {
     _jobs.push_back(Job(new render::DrawStatus::JobModel("DrawStatus", renderedOpaques, DrawStatus(statusIconMap))));
 
     _jobs.back().setEnabled(false);
-    _drawStatusJobIndex = _jobs.size() - 1;
+    _drawStatusJobIndex = (int)_jobs.size() - 1;
 
     _jobs.push_back(Job(new DrawOverlay3D::JobModel("DrawOverlay3D")));
 
     _jobs.push_back(Job(new HitEffect::JobModel("HitEffect")));
     _jobs.back().setEnabled(false);
-    _drawHitEffectJobIndex = _jobs.size() -1;
+    _drawHitEffectJobIndex = (int)_jobs.size() -1;
 
 
     // Give ourselves 3 frmaes of timer queries
@@ -181,7 +181,7 @@ void DrawOpaqueDeferred::run(const SceneContextPointer& sceneContext, const Rend
         batch.setStateScissorRect(args->_viewport);
         args->_batch = &batch;
 
-        renderContext->_numDrawnOpaqueItems = inItems.size();
+        renderContext->_numDrawnOpaqueItems = (int)inItems.size();
 
         glm::mat4 projMat;
         Transform viewMat;
@@ -210,7 +210,7 @@ void DrawTransparentDeferred::run(const SceneContextPointer& sceneContext, const
         batch.setStateScissorRect(args->_viewport);
         args->_batch = &batch;
     
-        renderContext->_numDrawnTransparentItems = inItems.size();
+        renderContext->_numDrawnTransparentItems = (int)inItems.size();
 
         glm::mat4 projMat;
         Transform viewMat;
@@ -262,8 +262,8 @@ void DrawOverlay3D::run(const SceneContextPointer& sceneContext, const RenderCon
             inItems.emplace_back(id);
         }
     }
-    renderContext->_numFeedOverlay3DItems = inItems.size();
-    renderContext->_numDrawnOverlay3DItems = inItems.size();
+    renderContext->_numFeedOverlay3DItems = (int)inItems.size();
+    renderContext->_numDrawnOverlay3DItems = (int)inItems.size();
 
     if (!inItems.empty()) {
         RenderArgs* args = renderContext->args;
diff --git a/libraries/render/src/render/DrawTask.h b/libraries/render/src/render/DrawTask.h
index 3f628c3a02..5dd61e347f 100755
--- a/libraries/render/src/render/DrawTask.h
+++ b/libraries/render/src/render/DrawTask.h
@@ -216,7 +216,7 @@ void renderItems(const SceneContextPointer& sceneContext, const RenderContextPoi
 
 class FetchItems {
 public:
-    typedef std::function<void (const RenderContextPointer& context, int count)> ProbeNumItems;
+    typedef std::function<void (const RenderContextPointer& context, size_t count)> ProbeNumItems;
     FetchItems(const ProbeNumItems& probe): _probeNumItems(probe) {}
     FetchItems(const ItemFilter& filter, const ProbeNumItems& probe): _filter(filter), _probeNumItems(probe) {}
 
diff --git a/libraries/render/src/render/Scene.h b/libraries/render/src/render/Scene.h
index 6ddd60cce8..1976801c96 100644
--- a/libraries/render/src/render/Scene.h
+++ b/libraries/render/src/render/Scene.h
@@ -495,7 +495,7 @@ public:
     /// WARNING, There is No check on the validity of the ID, so this could return a bad Item
     const Item& getItem(const ItemID& id) const { return _items[id]; }
 
-    unsigned int getNumItems() const { return _items.size(); }
+    size_t getNumItems() const { return _items.size(); }
 
 
     void processPendingChangesQueue();
diff --git a/libraries/shared/src/BufferParser.h b/libraries/shared/src/BufferParser.h
index bf06387a11..74b47cb72f 100644
--- a/libraries/shared/src/BufferParser.h
+++ b/libraries/shared/src/BufferParser.h
@@ -51,7 +51,7 @@ public:
     inline void readCompressedCount(T& result) {
         // FIXME switch to a heapless implementation as soon as Brad provides it.
         ByteCountCoded<T> codec;
-        _offset += codec.decode(reinterpret_cast<const char*>(_data + _offset), remaining());
+        _offset += codec.decode(reinterpret_cast<const char*>(_data + _offset), (int)remaining());
         result = codec.data;
     }
 
diff --git a/libraries/shared/src/PropertyFlags.h b/libraries/shared/src/PropertyFlags.h
index 2d512ece61..a4ff193a77 100644
--- a/libraries/shared/src/PropertyFlags.h
+++ b/libraries/shared/src/PropertyFlags.h
@@ -201,7 +201,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
     clear(); // we are cleared out!
 
     size_t bytesConsumed = 0;
-    int bitCount = BITS_IN_BYTE * size;
+    auto bitCount = BITS_IN_BYTE * size;
 
     int encodedByteCount = 1; // there is at least 1 byte (after the leadBits)
     int leadBits = 1; // there is always at least 1 lead bit
@@ -246,7 +246,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
             break;
         }
     }
-    _encodedLength = bytesConsumed;
+    _encodedLength = (int)bytesConsumed;
     return bytesConsumed;
 }
 
diff --git a/libraries/shared/src/RenderArgs.h b/libraries/shared/src/RenderArgs.h
index fcacf7aaed..061e07c600 100644
--- a/libraries/shared/src/RenderArgs.h
+++ b/libraries/shared/src/RenderArgs.h
@@ -35,8 +35,8 @@ public:
     };
     
     struct Item {
-        int _considered = 0;
-        int _rendered = 0;
+        size_t _considered = 0;
+        size_t _rendered = 0;
         int _outOfView = 0;
         int _tooSmall = 0;
     };
diff --git a/libraries/shared/src/SharedUtil.cpp b/libraries/shared/src/SharedUtil.cpp
index 145ec4ec37..298d5f669b 100644
--- a/libraries/shared/src/SharedUtil.cpp
+++ b/libraries/shared/src/SharedUtil.cpp
@@ -334,8 +334,8 @@ unsigned char* pointToVoxel(float x, float y, float z, float s, unsigned char r,
         voxelSizeInOctets++;
     }
 
-    unsigned int voxelSizeInBytes = bytesRequiredForCodeLength(voxelSizeInOctets); // (voxelSizeInBits/8)+1;
-    unsigned int voxelBufferSize = voxelSizeInBytes + sizeof(rgbColor); // 3 for color
+    auto voxelSizeInBytes = bytesRequiredForCodeLength(voxelSizeInOctets); // (voxelSizeInBits/8)+1;
+    auto voxelBufferSize = voxelSizeInBytes + sizeof(rgbColor); // 3 for color
 
     // allocate our resulting buffer
     unsigned char* voxelOut = new unsigned char[voxelBufferSize];
diff --git a/libraries/shared/src/shared/JSONHelpers.cpp b/libraries/shared/src/shared/JSONHelpers.cpp
index c0a8820d95..19d76ec132 100644
--- a/libraries/shared/src/shared/JSONHelpers.cpp
+++ b/libraries/shared/src/shared/JSONHelpers.cpp
@@ -30,8 +30,8 @@ T glmFromJson(const QJsonValue& json) {
     T result;
     if (json.isArray()) {
         QJsonArray array = json.toArray();
-        size_t length = std::min(array.size(), result.length());
-        for (size_t i = 0; i < length; ++i) {
+        auto length = std::min(array.size(), result.length());
+        for (auto i = 0; i < length; ++i) {
             result[i] = (float)array[i].toDouble();
         }
     }
diff --git a/tests/entities/src/main.cpp b/tests/entities/src/main.cpp
index 0cbd354e92..c0e21276d8 100644
--- a/tests/entities/src/main.cpp
+++ b/tests/entities/src/main.cpp
@@ -121,7 +121,7 @@ void testPropertyFlags(uint32_t value) {
 
     {
         #ifndef QT_NO_DEBUG
-        int decodeSize = decodeNew.decode((const uint8_t*)encoded.data(), encoded.size());
+        int decodeSize = (int)decodeNew.decode((const uint8_t*)encoded.data(), (int)encoded.size());
         Q_ASSERT(originalSize == decodeSize);
         Q_ASSERT(decodeNew == original);
         #endif
diff --git a/tests/gpu-test/src/main.cpp b/tests/gpu-test/src/main.cpp
index aa763196d1..0b701887f9 100644
--- a/tests/gpu-test/src/main.cpp
+++ b/tests/gpu-test/src/main.cpp
@@ -58,7 +58,7 @@ public:
     }
 
     unsigned int count() const {
-        return times.size() - 1;
+        return (unsigned int)times.size() - 1;
     }
 
     float elapsed() const {
@@ -283,10 +283,10 @@ public:
                     GeometryCache::ShapeData shapeData = geometryCache->_shapes[shape];
                     {
                         gpu::Batch::DrawIndexedIndirectCommand indirectCommand;
-                        indirectCommand._count = shapeData._indexCount;
+                        indirectCommand._count = (uint)shapeData._indexCount;
                         indirectCommand._instanceCount = ITEM_COUNT;
-                        indirectCommand._baseInstance = i * ITEM_COUNT;
-                        indirectCommand._firstIndex = shapeData._indexOffset / 2;
+                        indirectCommand._baseInstance = (uint)(i * ITEM_COUNT);
+                        indirectCommand._firstIndex = (uint)shapeData._indexOffset / 2;
                         indirectCommand._baseVertex = 0;
                         indirectBuffer->append(indirectCommand);
                     }
diff --git a/tests/render-utils/src/main.cpp b/tests/render-utils/src/main.cpp
index 4afb2d4807..c8fa03fec6 100644
--- a/tests/render-utils/src/main.cpp
+++ b/tests/render-utils/src/main.cpp
@@ -38,7 +38,7 @@ public:
     }
 
     unsigned int count() const {
-        return times.size() - 1;
+        return (unsigned int)times.size() - 1;
     }
 
     float elapsed() const {
diff --git a/tests/ui/src/main.cpp b/tests/ui/src/main.cpp
index 3879d0b029..18f62dc016 100644
--- a/tests/ui/src/main.cpp
+++ b/tests/ui/src/main.cpp
@@ -49,7 +49,7 @@ public:
         times.clear();
     }
 
-    unsigned int count() const {
+    size_t count() const {
         return times.size() - 1;
     }
 
diff --git a/tools/scribe/src/TextTemplate.cpp b/tools/scribe/src/TextTemplate.cpp
index 027a73da5d..01567d9255 100755
--- a/tools/scribe/src/TextTemplate.cpp
+++ b/tools/scribe/src/TextTemplate.cpp
@@ -730,7 +730,7 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
                 BlockPointer funcBlock = _config->_funcs.findFunc(block->command.arguments.front().c_str());
                 if (funcBlock) {
                     // before diving in the func tree, let's modify the vars with the local defs:
-                    int nbParams = std::min(block->command.arguments.size(), funcBlock->command.arguments.size());
+                    auto nbParams = std::min(block->command.arguments.size(), funcBlock->command.arguments.size());
                     std::vector< String > paramCache;
                     paramCache.push_back("");
                     String val;
@@ -839,7 +839,7 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
                 String val;
                 for (unsigned int t = 1; t < block->command.arguments.size(); t++) {
                     // detect if a param is a var
-                    int len = block->command.arguments[t].length();
+                    auto len = block->command.arguments[t].length();
                     if ((block->command.arguments[t][0] == Tag::VAR)
                         && (block->command.arguments[t][len - 1] == Tag::VAR)) {
                         String var = block->command.arguments[t].substr(1, len - 2);
diff --git a/tools/udt-test/src/UDTTest.cpp b/tools/udt-test/src/UDTTest.cpp
index d4054527f9..533e6371e9 100644
--- a/tools/udt-test/src/UDTTest.cpp
+++ b/tools/udt-test/src/UDTTest.cpp
@@ -311,8 +311,8 @@ void UDTTest::sendPacket() {
             
             packetList->closeCurrentPacket();
             
-            _totalQueuedBytes += packetList->getDataSize();
-            _totalQueuedPackets += packetList->getNumPackets();
+            _totalQueuedBytes += (int)packetList->getDataSize();
+            _totalQueuedPackets += (int)packetList->getNumPackets();
             
             _socket.writePacketList(std::move(packetList), _target);
         }
diff --git a/tools/vhacd-util/src/VHACDUtil.cpp b/tools/vhacd-util/src/VHACDUtil.cpp
index 75a1a9dc3a..d997f63e53 100644
--- a/tools/vhacd-util/src/VHACDUtil.cpp
+++ b/tools/vhacd-util/src/VHACDUtil.cpp
@@ -95,7 +95,7 @@ void vhacd::VHACDUtil::fattenMeshes(const FBXMesh& mesh, FBXMesh& result,
         getTrianglesInMeshPart(meshPart, triangles);
     }
 
-    unsigned int triangleCount = triangles.size() / 3;
+    auto triangleCount = triangles.size() / 3;
     if (triangleCount == 0) {
         return;
     }
@@ -230,7 +230,7 @@ bool vhacd::VHACDUtil::computeVHACD(FBXGeometry& geometry,
                 continue;
             }
 
-            int nPoints = vertices.size();
+            auto nPoints = vertices.size();
             AABox aaBox = getAABoxForMeshPart(mesh, meshPart);
             const float largestDimension = aaBox.getLargestDimension();
 
@@ -251,7 +251,7 @@ bool vhacd::VHACDUtil::computeVHACD(FBXGeometry& geometry,
 
 
             // compute approximate convex decomposition
-            bool res = interfaceVHACD->Compute(&vertices[0].x, 3, nPoints, &triangles[0], 3, triangleCount, params);
+            bool res = interfaceVHACD->Compute(&vertices[0].x, 3, (uint)nPoints, &triangles[0], 3, triangleCount, params);
             if (!res){
                 qDebug() << "V-HACD computation failed for Mesh : " << count;
                 count++;

From 5300963183126ad491b7b1ab559f89f91c117bc2 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 15:25:36 -0800
Subject: [PATCH 15/28] More warning fixes

---
 libraries/animation/src/AnimSkeleton.cpp | 4 ++--
 libraries/animation/src/AnimSkeleton.h   | 2 +-
 libraries/animation/src/Rig.cpp          | 4 ++--
 libraries/animation/src/Rig.h            | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libraries/animation/src/AnimSkeleton.cpp b/libraries/animation/src/AnimSkeleton.cpp
index 8dcb2157c5..72fd806a1d 100644
--- a/libraries/animation/src/AnimSkeleton.cpp
+++ b/libraries/animation/src/AnimSkeleton.cpp
@@ -39,8 +39,8 @@ int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
     return -1;
 }
 
-size_t AnimSkeleton::getNumJoints() const {
-    return _joints.size();
+int AnimSkeleton::getNumJoints() const {
+    return (int)_joints.size();
 }
 
 const AnimPose& AnimSkeleton::getAbsoluteBindPose(int jointIndex) const {
diff --git a/libraries/animation/src/AnimSkeleton.h b/libraries/animation/src/AnimSkeleton.h
index 73e31d090a..7312fea6b1 100644
--- a/libraries/animation/src/AnimSkeleton.h
+++ b/libraries/animation/src/AnimSkeleton.h
@@ -27,7 +27,7 @@ public:
     AnimSkeleton(const std::vector<FBXJoint>& joints);
     int nameToJointIndex(const QString& jointName) const;
     const QString& getJointName(int jointIndex) const;
-    size_t getNumJoints() const;
+    int getNumJoints() const;
 
     // absolute pose, not relative to parent
     const AnimPose& getAbsoluteBindPose(int jointIndex) const;
diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp
index 950ac58ae2..56135ce821 100644
--- a/libraries/animation/src/Rig.cpp
+++ b/libraries/animation/src/Rig.cpp
@@ -233,8 +233,8 @@ bool Rig::jointStatesEmpty() {
     return _internalPoseSet._relativePoses.empty();
 }
 
-size_t Rig::getJointStateCount() const {
-    return _internalPoseSet._relativePoses.size();
+int Rig::getJointStateCount() const {
+    return (int)_internalPoseSet._relativePoses.size();
 }
 
 int Rig::indexOfJoint(const QString& jointName) const {
diff --git a/libraries/animation/src/Rig.h b/libraries/animation/src/Rig.h
index 8d8d425112..e3ec5d18cf 100644
--- a/libraries/animation/src/Rig.h
+++ b/libraries/animation/src/Rig.h
@@ -89,7 +89,7 @@ public:
     void initJointStates(const FBXGeometry& geometry, const glm::mat4& modelOffset);
     void reset(const FBXGeometry& geometry);
     bool jointStatesEmpty();
-    size_t getJointStateCount() const;
+    int getJointStateCount() const;
     int indexOfJoint(const QString& jointName) const;
 
     void setModelOffset(const glm::mat4& modelOffsetMat);

From 8bd301e45e333869948d34c4b5c3c9898917d750 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 16:03:44 -0800
Subject: [PATCH 16/28] More warning fixes

---
 interface/src/devices/Faceshift.cpp                | 2 +-
 libraries/animation/src/AnimInverseKinematics.cpp  | 8 ++++----
 libraries/animation/src/AnimSkeleton.cpp           | 4 ++--
 libraries/animation/src/Rig.cpp                    | 4 ++--
 libraries/networking/src/ReceivedPacketProcessor.h | 2 +-
 libraries/octree/src/JurisdictionMap.cpp           | 2 +-
 libraries/octree/src/JurisdictionMap.h             | 2 +-
 libraries/octree/src/OctreeEditPacketSender.cpp    | 4 ++--
 libraries/octree/src/OctreeSceneStats.cpp          | 4 ++--
 libraries/render-utils/src/AnimDebugDraw.cpp       | 2 +-
 libraries/shared/src/PropertyFlags.h               | 2 +-
 tools/scribe/src/TextTemplate.cpp                  | 3 ++-
 12 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp
index 3596c79419..81c099c740 100644
--- a/interface/src/devices/Faceshift.cpp
+++ b/interface/src/devices/Faceshift.cpp
@@ -255,7 +255,7 @@ void Faceshift::receive(const QByteArray& buffer) {
             }
             case fsMsg::MSG_OUT_BLENDSHAPE_NAMES: {
                 const vector<string>& names = static_pointer_cast<fsMsgBlendshapeNames>(msg)->blendshape_names();
-                for (auto i = 0; i < names.size(); i++) {
+                for (int i = 0; i < (int)names.size(); i++) {
                     if (names[i] == "EyeBlink_L") {
                         _leftBlinkIndex = i;
 
diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp
index 9276b96714..415ee72d7b 100644
--- a/libraries/animation/src/AnimInverseKinematics.cpp
+++ b/libraries/animation/src/AnimInverseKinematics.cpp
@@ -114,7 +114,7 @@ void AnimInverseKinematics::computeTargets(const AnimVariantMap& animVars, std::
     }
 
     if (removeUnfoundJoints) {
-        auto numVars = _targetVarVec.size();
+        int numVars = (int)_targetVarVec.size();
         int i = 0;
         while (i < numVars) {
             if (_targetVarVec[i].jointIndex == -1) {
@@ -145,7 +145,7 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
     int numLoops = 0;
     const int MAX_IK_LOOPS = 4;
     do {
-        auto lowestMovedIndex = _relativePoses.size();
+        int lowestMovedIndex = (int)_relativePoses.size();
         for (auto& target: targets) {
             IKTarget::Type targetType = target.getType();
             if (targetType == IKTarget::Type::RotationOnly) {
@@ -274,8 +274,8 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
         ++numLoops;
 
         // harvest accumulated rotations and apply the average
-        const size_t numJoints = _accumulators.size();
-        for (auto i = 0; i < numJoints; ++i) {
+        const int numJoints = (int)_accumulators.size();
+        for (int i = 0; i < numJoints; ++i) {
             if (_accumulators[i].size() > 0) {
                 _relativePoses[i].rot = _accumulators[i].getAverage();
                 _accumulators[i].clear();
diff --git a/libraries/animation/src/AnimSkeleton.cpp b/libraries/animation/src/AnimSkeleton.cpp
index 72fd806a1d..c9c6e43a02 100644
--- a/libraries/animation/src/AnimSkeleton.cpp
+++ b/libraries/animation/src/AnimSkeleton.cpp
@@ -31,7 +31,7 @@ AnimSkeleton::AnimSkeleton(const std::vector<FBXJoint>& joints) {
 }
 
 int AnimSkeleton::nameToJointIndex(const QString& jointName) const {
-    for (auto i = 0; i < _joints.size(); i++) {
+    for (int i = 0; i < (int)_joints.size(); i++) {
         if (_joints[i].name == jointName) {
             return i;
         }
@@ -101,7 +101,7 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector<FBXJoint>& joints)
     _relativeDefaultPoses.reserve(joints.size());
 
     // iterate over FBXJoints and extract the bind pose information.
-    for (auto i = 0; i < joints.size(); i++) {
+    for (int i = 0; i < (int)joints.size(); i++) {
 
         // build relative and absolute default poses
         glm::mat4 rotTransform = glm::mat4_cast(_joints[i].preRotation * _joints[i].rotation * _joints[i].postRotation);
diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp
index 56135ce821..acfb4f87db 100644
--- a/libraries/animation/src/Rig.cpp
+++ b/libraries/animation/src/Rig.cpp
@@ -434,7 +434,7 @@ void Rig::calcAnimAlpha(float speed, const std::vector<float>& referenceSpeeds,
 
 void Rig::computeEyesInRootFrame(const AnimPoseVec& poses) {
     // TODO: use cached eye/hips indices for these calculations
-    auto numPoses = poses.size();
+    int numPoses = (int)poses.size();
     int hipsIndex = _animSkeleton->nameToJointIndex(QString("Hips"));
     int headIndex = _animSkeleton->nameToJointIndex(QString("Head"));
     if (hipsIndex > 0 && headIndex > 0) {
@@ -1164,7 +1164,7 @@ void Rig::computeAvatarBoundingCapsule(
     // even if they do not have legs (default robot)
     totalExtents.addPoint(glm::vec3(0.0f));
 
-    auto numPoses = finalPoses.size();
+    int numPoses = (int)finalPoses.size();
     for (int i = 0; i < numPoses; i++) {
         const FBXJointShapeInfo& shapeInfo = geometry.joints.at(i).shapeInfo;
         AnimPose pose = finalPoses[i];
diff --git a/libraries/networking/src/ReceivedPacketProcessor.h b/libraries/networking/src/ReceivedPacketProcessor.h
index 1d9580f3d0..cbb27fa5d6 100644
--- a/libraries/networking/src/ReceivedPacketProcessor.h
+++ b/libraries/networking/src/ReceivedPacketProcessor.h
@@ -44,7 +44,7 @@ public:
     }
 
     /// How many received packets waiting are to be processed
-    size_t packetsToProcessCount() const { return _packets.size(); }
+    int packetsToProcessCount() const { return (int)_packets.size(); }
 
     float getIncomingPPS() const { return _incomingPPS.getAverage(); }
     float getProcessedPPS() const { return _processedPPS.getAverage(); }
diff --git a/libraries/octree/src/JurisdictionMap.cpp b/libraries/octree/src/JurisdictionMap.cpp
index 5e66e21242..cac2211d29 100644
--- a/libraries/octree/src/JurisdictionMap.cpp
+++ b/libraries/octree/src/JurisdictionMap.cpp
@@ -278,7 +278,7 @@ std::unique_ptr<NLPacket> JurisdictionMap::packIntoPacket() {
         packet->write(reinterpret_cast<char*>(_rootOctalCode), bytes);
 
         // if and only if there's a root jurisdiction, also include the end nodes
-        auto endNodeCount = _endNodes.size();
+        int endNodeCount = (int)_endNodes.size();
         packet->writePrimitive(endNodeCount);
 
         for (int i=0; i < endNodeCount; i++) {
diff --git a/libraries/octree/src/JurisdictionMap.h b/libraries/octree/src/JurisdictionMap.h
index 18d2bbbeed..fb217e59db 100644
--- a/libraries/octree/src/JurisdictionMap.h
+++ b/libraries/octree/src/JurisdictionMap.h
@@ -52,7 +52,7 @@ public:
 
     unsigned char* getRootOctalCode() const { return _rootOctalCode; }
     unsigned char* getEndNodeOctalCode(int index) const { return _endNodes[index]; }
-    size_t getEndNodeCount() const { return _endNodes.size(); }
+    int getEndNodeCount() const { return (int)_endNodes.size(); }
 
     void copyContents(unsigned char* rootCodeIn, const std::vector<unsigned char*>& endNodesIn);
 
diff --git a/libraries/octree/src/OctreeEditPacketSender.cpp b/libraries/octree/src/OctreeEditPacketSender.cpp
index d3a72ce113..ad59dcbf99 100644
--- a/libraries/octree/src/OctreeEditPacketSender.cpp
+++ b/libraries/octree/src/OctreeEditPacketSender.cpp
@@ -149,7 +149,7 @@ void OctreeEditPacketSender::queuePendingPacketToNodes(std::unique_ptr<NLPacket>
         _pendingPacketsLock.lock();
         _preServerSingleMessagePackets.push_back(std::move(packet));
         // if we've saved MORE than our max, then clear out the oldest packet...
-        auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
+        int allPendingMessages = (int)(_preServerSingleMessagePackets.size() + _preServerEdits.size());
         if (allPendingMessages > _maxPendingMessages) {
             _preServerSingleMessagePackets.pop_front();
         }
@@ -210,7 +210,7 @@ void OctreeEditPacketSender::queueOctreeEditMessage(PacketType type, QByteArray&
             _preServerEdits.push_back(messagePair);
 
             // if we've saved MORE than out max, then clear out the oldest packet...
-            auto allPendingMessages = _preServerSingleMessagePackets.size() + _preServerEdits.size();
+            int allPendingMessages = (int)(_preServerSingleMessagePackets.size() + _preServerEdits.size());
             if (allPendingMessages > _maxPendingMessages) {
                 _preServerEdits.pop_front();
             }
diff --git a/libraries/octree/src/OctreeSceneStats.cpp b/libraries/octree/src/OctreeSceneStats.cpp
index 8b9334eafd..f761d9ad05 100644
--- a/libraries/octree/src/OctreeSceneStats.cpp
+++ b/libraries/octree/src/OctreeSceneStats.cpp
@@ -418,12 +418,12 @@ int OctreeSceneStats::packIntoPacket() {
     // add the root jurisdiction
     if (_jurisdictionRoot) {
         // copy the
-        auto bytes = bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
+        int bytes = (int)bytesRequiredForCodeLength(numberOfThreeBitSectionsInCode(_jurisdictionRoot));
         _statsPacket->writePrimitive(bytes);
         _statsPacket->write(reinterpret_cast<char*>(_jurisdictionRoot), bytes);
 
         // if and only if there's a root jurisdiction, also include the end elements
-        auto endNodeCount = _jurisdictionEndNodes.size();
+        int endNodeCount = (int)_jurisdictionEndNodes.size();
 
         _statsPacket->writePrimitive(endNodeCount);
 
diff --git a/libraries/render-utils/src/AnimDebugDraw.cpp b/libraries/render-utils/src/AnimDebugDraw.cpp
index aa366f04b9..04a1962899 100644
--- a/libraries/render-utils/src/AnimDebugDraw.cpp
+++ b/libraries/render-utils/src/AnimDebugDraw.cpp
@@ -321,7 +321,7 @@ void AnimDebugDraw::update() {
         const float POSE_RADIUS = 0.1f; // 10 cm
 
         // figure out how many verts we will need.
-        size_t numVerts = 0;
+        int numVerts = 0;
 
         for (auto& iter : _absolutePoses) {
             AnimSkeleton::ConstPointer& skeleton = std::get<0>(iter.second);
diff --git a/libraries/shared/src/PropertyFlags.h b/libraries/shared/src/PropertyFlags.h
index a4ff193a77..985a08fa05 100644
--- a/libraries/shared/src/PropertyFlags.h
+++ b/libraries/shared/src/PropertyFlags.h
@@ -201,7 +201,7 @@ inline size_t PropertyFlags<Enum>::decode(const uint8_t* data, size_t size) {
     clear(); // we are cleared out!
 
     size_t bytesConsumed = 0;
-    auto bitCount = BITS_IN_BYTE * size;
+    int bitCount = BITS_IN_BYTE * (int)size;
 
     int encodedByteCount = 1; // there is at least 1 byte (after the leadBits)
     int leadBits = 1; // there is always at least 1 lead bit
diff --git a/tools/scribe/src/TextTemplate.cpp b/tools/scribe/src/TextTemplate.cpp
index 01567d9255..3ccb0baea0 100755
--- a/tools/scribe/src/TextTemplate.cpp
+++ b/tools/scribe/src/TextTemplate.cpp
@@ -730,7 +730,8 @@ int TextTemplate::evalBlockGeneration(std::ostream& dst, const BlockPointer& blo
                 BlockPointer funcBlock = _config->_funcs.findFunc(block->command.arguments.front().c_str());
                 if (funcBlock) {
                     // before diving in the func tree, let's modify the vars with the local defs:
-                    auto nbParams = std::min(block->command.arguments.size(), funcBlock->command.arguments.size());
+                    int nbParams = (int)std::min(block->command.arguments.size(),
+                                                 funcBlock->command.arguments.size());
                     std::vector< String > paramCache;
                     paramCache.push_back("");
                     String val;

From d9583064f1e8d8d79b4d7014eb9115242b275455 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 16:17:17 -0800
Subject: [PATCH 17/28] Move QOpenGL wrappers to the gl lib

---
 .../{render-utils/src => gl/src/gl}/QOpenGLContextWrapper.cpp     | 0
 libraries/{render-utils/src => gl/src/gl}/QOpenGLContextWrapper.h | 0
 .../{render-utils/src => gl/src/gl}/QOpenGLDebugLoggerWrapper.cpp | 0
 .../{render-utils/src => gl/src/gl}/QOpenGLDebugLoggerWrapper.h   | 0
 4 files changed, 0 insertions(+), 0 deletions(-)
 rename libraries/{render-utils/src => gl/src/gl}/QOpenGLContextWrapper.cpp (100%)
 rename libraries/{render-utils/src => gl/src/gl}/QOpenGLContextWrapper.h (100%)
 rename libraries/{render-utils/src => gl/src/gl}/QOpenGLDebugLoggerWrapper.cpp (100%)
 rename libraries/{render-utils/src => gl/src/gl}/QOpenGLDebugLoggerWrapper.h (100%)

diff --git a/libraries/render-utils/src/QOpenGLContextWrapper.cpp b/libraries/gl/src/gl/QOpenGLContextWrapper.cpp
similarity index 100%
rename from libraries/render-utils/src/QOpenGLContextWrapper.cpp
rename to libraries/gl/src/gl/QOpenGLContextWrapper.cpp
diff --git a/libraries/render-utils/src/QOpenGLContextWrapper.h b/libraries/gl/src/gl/QOpenGLContextWrapper.h
similarity index 100%
rename from libraries/render-utils/src/QOpenGLContextWrapper.h
rename to libraries/gl/src/gl/QOpenGLContextWrapper.h
diff --git a/libraries/render-utils/src/QOpenGLDebugLoggerWrapper.cpp b/libraries/gl/src/gl/QOpenGLDebugLoggerWrapper.cpp
similarity index 100%
rename from libraries/render-utils/src/QOpenGLDebugLoggerWrapper.cpp
rename to libraries/gl/src/gl/QOpenGLDebugLoggerWrapper.cpp
diff --git a/libraries/render-utils/src/QOpenGLDebugLoggerWrapper.h b/libraries/gl/src/gl/QOpenGLDebugLoggerWrapper.h
similarity index 100%
rename from libraries/render-utils/src/QOpenGLDebugLoggerWrapper.h
rename to libraries/gl/src/gl/QOpenGLDebugLoggerWrapper.h

From c782b01fde0f3a7436d090f89fcfeac9a951d908 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 16:17:41 -0800
Subject: [PATCH 18/28] More warning fixes

---
 interface/src/Application.cpp                                 | 2 +-
 .../src/display-plugins/OpenGLDisplayPlugin.cpp               | 2 +-
 libraries/render-utils/src/AnimDebugDraw.cpp                  | 4 ++--
 tests/gpu-test/src/main.cpp                                   | 4 ++--
 tests/render-utils/src/main.cpp                               | 4 ++--
 tests/shaders/src/main.cpp                                    | 4 ++--
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp
index d82da2b237..981de190d3 100644
--- a/interface/src/Application.cpp
+++ b/interface/src/Application.cpp
@@ -45,7 +45,7 @@
 #include <QtNetwork/QNetworkDiskCache>
 
 #include <gl/Config.h>
-#include <QOpenGLContextWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
 
 #include <AccountManager.h>
 #include <AddressManager.h>
diff --git a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
index 58fd53e39d..ffe8fbe3c1 100644
--- a/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
+++ b/libraries/display-plugins/src/display-plugins/OpenGLDisplayPlugin.cpp
@@ -16,7 +16,7 @@
 #include <QtOpenGL/QGLWidget>
 #include <QtGui/QImage>
 
-#include <QOpenGLContextWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
 
 #include <gl/GLWidget.h>
 #include <NumericalConstants.h>
diff --git a/libraries/render-utils/src/AnimDebugDraw.cpp b/libraries/render-utils/src/AnimDebugDraw.cpp
index 04a1962899..060aaa218b 100644
--- a/libraries/render-utils/src/AnimDebugDraw.cpp
+++ b/libraries/render-utils/src/AnimDebugDraw.cpp
@@ -336,9 +336,9 @@ void AnimDebugDraw::update() {
 
         // count marker verts from shared DebugDraw singleton
         auto markerMap = DebugDraw::getInstance().getMarkerMap();
-        numVerts += markerMap.size() * VERTICES_PER_BONE;
+        numVerts += (int)markerMap.size() * VERTICES_PER_BONE;
         auto myAvatarMarkerMap = DebugDraw::getInstance().getMyAvatarMarkerMap();
-        numVerts += myAvatarMarkerMap.size() * VERTICES_PER_BONE;
+        numVerts += (int)myAvatarMarkerMap.size() * VERTICES_PER_BONE;
 
         // allocate verts!
         data._vertexBuffer->resize(sizeof(Vertex) * numVerts);
diff --git a/tests/gpu-test/src/main.cpp b/tests/gpu-test/src/main.cpp
index 0b701887f9..e185266408 100644
--- a/tests/gpu-test/src/main.cpp
+++ b/tests/gpu-test/src/main.cpp
@@ -33,8 +33,8 @@
 #include <gpu/StandardShaderLib.h>
 #include <gpu/GLBackend.h>
 
-#include <QOpenGLContextWrapper.h>
-#include <QOpenGLDebugLoggerWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
+#include <gl/QOpenGLDebugLoggerWrapper.h>
 
 #include <GLMHelpers.h>
 #include <PathUtils.h>
diff --git a/tests/render-utils/src/main.cpp b/tests/render-utils/src/main.cpp
index c8fa03fec6..6a4154c8c3 100644
--- a/tests/render-utils/src/main.cpp
+++ b/tests/render-utils/src/main.cpp
@@ -14,8 +14,8 @@
 
 #include <gpu/GLBackend.h>
 
-#include <QOpenGLContextWrapper.h>
-#include <QOpenGLDebugLoggerWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
+#include <gl/QOpenGLDebugLoggerWrapper.h>
 
 #include <QDir>
 #include <QElapsedTimer>
diff --git a/tests/shaders/src/main.cpp b/tests/shaders/src/main.cpp
index 52e43e2faa..dd1170edeb 100644
--- a/tests/shaders/src/main.cpp
+++ b/tests/shaders/src/main.cpp
@@ -20,8 +20,8 @@
 
 #include <gl/GLHelpers.h>
 
-#include <QOpenGLDebugLoggerWrapper.h>
-#include <QOpenGLContextWrapper.h>
+#include <gl/QOpenGLDebugLoggerWrapper.h>
+#include <gl/QOpenGLContextWrapper.h>
 
 #include "../model/Skybox_vert.h"
 #include "../model/Skybox_frag.h"

From b7478c4594e66641df7e1b2cda85169afb2c80e1 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 16:38:19 -0800
Subject: [PATCH 19/28] Fix gcc warning

---
 libraries/audio/src/AudioEffectOptions.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/audio/src/AudioEffectOptions.cpp b/libraries/audio/src/AudioEffectOptions.cpp
index 758875e896..9d3ce9299b 100644
--- a/libraries/audio/src/AudioEffectOptions.cpp
+++ b/libraries/audio/src/AudioEffectOptions.cpp
@@ -55,7 +55,7 @@ static const float LATE_MIX_RIGHT_DEFAULT = 90.0f;
 static const float WET_DRY_MIX_DEFAULT = 50.0f;
 
 static void setOption(QScriptValue arguments, const QString name, float defaultValue, float& variable) {
-    variable = arguments.property(name).isNumber() ? arguments.property(name).toNumber() : defaultValue;
+    variable = arguments.property(name).isNumber() ? (float)arguments.property(name).toNumber() : defaultValue;
 }
 
 AudioEffectOptions::AudioEffectOptions(QScriptValue arguments) {

From 4fb72667b690326aa4a96f41bf869be7c4a122ec Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 16:43:48 -0800
Subject: [PATCH 20/28] Fix stack manager warning

---
 stack-manager/src/AppDelegate.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/stack-manager/src/AppDelegate.cpp b/stack-manager/src/AppDelegate.cpp
index 3e65406bc5..dfe5c56714 100644
--- a/stack-manager/src/AppDelegate.cpp
+++ b/stack-manager/src/AppDelegate.cpp
@@ -72,6 +72,9 @@ void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const Q
         case QtFatalMsg:
             fprintf(stdout, "Fatal: %s\n", qPrintable(msg));
             txt += msg;
+        default:
+            fprintf(stdout, "UnknownMsgType: %s\n", qPrintable(msg));
+            txt += msg;
     }
 
     if (outStream) {

From b7ba3c5f17b0ac1203e9ba9b2297d2416a89e505 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 17:02:03 -0800
Subject: [PATCH 21/28] More warning fixes

---
 libraries/render/src/render/DrawTask.cpp | 2 +-
 libraries/render/src/render/DrawTask.h   | 2 +-
 stack-manager/src/AppDelegate.cpp        | 5 +++++
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libraries/render/src/render/DrawTask.cpp b/libraries/render/src/render/DrawTask.cpp
index 877567aecd..c0e50037e0 100755
--- a/libraries/render/src/render/DrawTask.cpp
+++ b/libraries/render/src/render/DrawTask.cpp
@@ -107,7 +107,7 @@ void FetchItems::run(const SceneContextPointer& sceneContext, const RenderContex
     }
 
     if (_probeNumItems) {
-        _probeNumItems(renderContext, outItems.size());
+        _probeNumItems(renderContext, (int)outItems.size());
     }
 }
 
diff --git a/libraries/render/src/render/DrawTask.h b/libraries/render/src/render/DrawTask.h
index 5dd61e347f..3f628c3a02 100755
--- a/libraries/render/src/render/DrawTask.h
+++ b/libraries/render/src/render/DrawTask.h
@@ -216,7 +216,7 @@ void renderItems(const SceneContextPointer& sceneContext, const RenderContextPoi
 
 class FetchItems {
 public:
-    typedef std::function<void (const RenderContextPointer& context, size_t count)> ProbeNumItems;
+    typedef std::function<void (const RenderContextPointer& context, int count)> ProbeNumItems;
     FetchItems(const ProbeNumItems& probe): _probeNumItems(probe) {}
     FetchItems(const ItemFilter& filter, const ProbeNumItems& probe): _filter(filter), _probeNumItems(probe) {}
 
diff --git a/stack-manager/src/AppDelegate.cpp b/stack-manager/src/AppDelegate.cpp
index 3e65406bc5..61d6a8ee48 100644
--- a/stack-manager/src/AppDelegate.cpp
+++ b/stack-manager/src/AppDelegate.cpp
@@ -57,6 +57,10 @@ void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const Q
 
     //in this function, you can write the message to any stream!
     switch (type) {
+        case QtInfoMsg:
+            fprintf(stdout, "UnknownType: %s\n", qPrintable(msg));
+            txt += msg;
+            break;
         case QtDebugMsg:
             fprintf(stdout, "Debug: %s\n", qPrintable(msg));
             txt += msg;
@@ -72,6 +76,7 @@ void myMessageHandler(QtMsgType type, const QMessageLogContext &context, const Q
         case QtFatalMsg:
             fprintf(stdout, "Fatal: %s\n", qPrintable(msg));
             txt += msg;
+            break;
     }
 
     if (outStream) {

From 7472673dae0432dffc9e7677c960e08eeb9fc66f Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 17:23:12 -0800
Subject: [PATCH 22/28] More warning fixes

---
 libraries/render/src/render/DrawTask.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/render/src/render/DrawTask.h b/libraries/render/src/render/DrawTask.h
index 5dd61e347f..3f628c3a02 100755
--- a/libraries/render/src/render/DrawTask.h
+++ b/libraries/render/src/render/DrawTask.h
@@ -216,7 +216,7 @@ void renderItems(const SceneContextPointer& sceneContext, const RenderContextPoi
 
 class FetchItems {
 public:
-    typedef std::function<void (const RenderContextPointer& context, size_t count)> ProbeNumItems;
+    typedef std::function<void (const RenderContextPointer& context, int count)> ProbeNumItems;
     FetchItems(const ProbeNumItems& probe): _probeNumItems(probe) {}
     FetchItems(const ItemFilter& filter, const ProbeNumItems& probe): _filter(filter), _probeNumItems(probe) {}
 

From 8ec84bdde826edecdc5260abf6bde4239f4d892e Mon Sep 17 00:00:00 2001
From: Seth Alves <seth.alves@gmail.com>
Date: Fri, 11 Dec 2015 17:35:18 -0800
Subject: [PATCH 23/28] don't simulate model until it has geometry

---
 .../src/RenderableModelEntityItem.cpp             | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp
index f2826db43f..b5203ea460 100644
--- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp
@@ -455,13 +455,6 @@ bool RenderableModelEntityItem::isReadyToComputeShape() {
             return false; // hmm...
         }
 
-        if (_needsInitialSimulation) {
-            // the _model's offset will be wrong until _needsInitialSimulation is false
-            PerformanceTimer perfTimer("_model->simulate");
-            _model->simulate(0.0f);
-            _needsInitialSimulation = false;
-        }
-
         assert(!_model->getCollisionURL().isEmpty());
     
         if (_model->getURL().isEmpty()) {
@@ -475,6 +468,14 @@ bool RenderableModelEntityItem::isReadyToComputeShape() {
         if ((collisionNetworkGeometry && collisionNetworkGeometry->isLoaded()) &&
             (renderNetworkGeometry && renderNetworkGeometry->isLoaded())) {
             // we have both URLs AND both geometries AND they are both fully loaded.
+
+            if (_needsInitialSimulation) {
+                // the _model's offset will be wrong until _needsInitialSimulation is false
+                PerformanceTimer perfTimer("_model->simulate");
+                _model->simulate(0.0f);
+                _needsInitialSimulation = false;
+            }
+
             return true;
         }
 

From eb8fc2e156fed0120fc6533ff0508cedcc168880 Mon Sep 17 00:00:00 2001
From: Atlante45 <clement.brisset@gmail.com>
Date: Fri, 11 Dec 2015 17:37:36 -0800
Subject: [PATCH 24/28] Fix last of the windows warnings

---
 .../entities-renderer/src/RenderablePolyVoxEntityItem.cpp  | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp
index 22f83d37f6..25530fe41a 100644
--- a/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp
+++ b/libraries/entities-renderer/src/RenderablePolyVoxEntityItem.cpp
@@ -32,11 +32,18 @@
 #include <PerfStat.h>
 #include <render/Scene.h>
 
+#ifdef _WIN32
+#pragma warning(push)
+#pragma warning( disable : 4267 )
+#endif
 #include <PolyVoxCore/CubicSurfaceExtractorWithNormals.h>
 #include <PolyVoxCore/MarchingCubesSurfaceExtractor.h>
 #include <PolyVoxCore/SurfaceMesh.h>
 #include <PolyVoxCore/SimpleVolume.h>
 #include <PolyVoxCore/Material.h>
+#ifdef _WIN32
+#pragma warning(pop)
+#endif
 
 #include "model/Geometry.h"
 #include "EntityTreeRenderer.h"

From 2815cb0fef65fc19fcb87dd4976cd8ccfcfa934b Mon Sep 17 00:00:00 2001
From: Brad Hefta-Gaub <brad@highfidelity.io>
Date: Sat, 12 Dec 2015 14:51:27 -0800
Subject: [PATCH 25/28] first cut at adding advanced and developer menu
 groupings

---
 examples/edit.js                              |  64 +++--
 interface/resources/qml/VrMenuItem.qml        |   7 +-
 interface/src/Menu.cpp                        | 224 +++++++++++++-----
 interface/src/Menu.h                          |  33 ++-
 .../script-engine/src/MenuItemProperties.cpp  |   1 +
 .../script-engine/src/MenuItemProperties.h    |   2 +
 libraries/ui/src/VrMenu.cpp                   |  20 +-
 7 files changed, 250 insertions(+), 101 deletions(-)

diff --git a/examples/edit.js b/examples/edit.js
index 5d5d642f47..59b6ae3e7d 100644
--- a/examples/edit.js
+++ b/examples/edit.js
@@ -1002,7 +1002,8 @@ function setupModelMenus() {
         menuName: "Edit",
         menuItemName: "Models",
         isSeparator: true,
-        beforeItem: "Physics"
+        beforeItem: "Physics",
+        grouping: "Advanced"
     });
     if (!Menu.menuItemExists("Edit", "Delete")) {
         print("no delete... adding ours");
@@ -1012,7 +1013,8 @@ function setupModelMenus() {
             shortcutKeyEvent: {
                 text: "backspace"
             },
-            afterItem: "Models"
+            afterItem: "Models",
+            grouping: "Advanced"
         });
         modelMenuAddedDelete = true;
     } else {
@@ -1023,7 +1025,8 @@ function setupModelMenus() {
         menuName: "Edit",
         menuItemName: "Entity List...",
         shortcutKey: "CTRL+META+L",
-        afterItem: "Models"
+        afterItem: "Models",
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
         menuName: "Edit",
@@ -1031,7 +1034,8 @@ function setupModelMenus() {
         shortcutKey: "CTRL+META+L",
         afterItem: "Entity List...",
         isCheckable: true,
-        isChecked: true
+        isChecked: true,
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
         menuName: "Edit",
@@ -1039,79 +1043,91 @@ function setupModelMenus() {
         shortcutKey: "CTRL+META+S",
         afterItem: "Allow Selecting of Large Models",
         isCheckable: true,
-        isChecked: true
+        isChecked: true,
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
         menuName: "Edit",
         menuItemName: "Allow Selecting of Lights",
         shortcutKey: "CTRL+SHIFT+META+L",
         afterItem: "Allow Selecting of Small Models",
-        isCheckable: true
+        isCheckable: true,
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
         menuName: "Edit",
         menuItemName: "Select All Entities In Box",
         shortcutKey: "CTRL+SHIFT+META+A",
-        afterItem: "Allow Selecting of Lights"
+        afterItem: "Allow Selecting of Lights",
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
         menuName: "Edit",
         menuItemName: "Select All Entities Touching Box",
         shortcutKey: "CTRL+SHIFT+META+T",
-        afterItem: "Select All Entities In Box"
+        afterItem: "Select All Entities In Box",
+        grouping: "Advanced"
     });
 
     Menu.addMenuItem({
         menuName: "File",
         menuItemName: "Models",
         isSeparator: true,
-        beforeItem: "Settings"
+        beforeItem: "Settings",
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
         menuName: "File",
         menuItemName: "Export Entities",
         shortcutKey: "CTRL+META+E",
-        afterItem: "Models"
+        afterItem: "Models",
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
         menuName: "File",
         menuItemName: "Import Entities",
         shortcutKey: "CTRL+META+I",
-        afterItem: "Export Entities"
+        afterItem: "Export Entities",
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
         menuName: "File",
         menuItemName: "Import Entities from URL",
         shortcutKey: "CTRL+META+U",
-        afterItem: "Import Entities"
+        afterItem: "Import Entities",
+        grouping: "Advanced"
     });
 
     Menu.addMenuItem({
-        menuName: "View",
+        menuName: "Edit",
         menuItemName: MENU_AUTO_FOCUS_ON_SELECT,
         isCheckable: true,
-        isChecked: Settings.getValue(SETTING_AUTO_FOCUS_ON_SELECT) == "true"
+        isChecked: Settings.getValue(SETTING_AUTO_FOCUS_ON_SELECT) == "true",
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
-        menuName: "View",
+        menuName: "Edit",
         menuItemName: MENU_EASE_ON_FOCUS,
         afterItem: MENU_AUTO_FOCUS_ON_SELECT,
         isCheckable: true,
-        isChecked: Settings.getValue(SETTING_EASE_ON_FOCUS) == "true"
+        isChecked: Settings.getValue(SETTING_EASE_ON_FOCUS) == "true",
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
-        menuName: "View",
+        menuName: "Edit",
         menuItemName: MENU_SHOW_LIGHTS_IN_EDIT_MODE,
         afterItem: MENU_EASE_ON_FOCUS,
         isCheckable: true,
-        isChecked: Settings.getValue(SETTING_SHOW_LIGHTS_IN_EDIT_MODE) == "true"
+        isChecked: Settings.getValue(SETTING_SHOW_LIGHTS_IN_EDIT_MODE) == "true",
+        grouping: "Advanced"
     });
     Menu.addMenuItem({
-        menuName: "View",
+        menuName: "Edit",
         menuItemName: MENU_SHOW_ZONES_IN_EDIT_MODE,
         afterItem: MENU_SHOW_LIGHTS_IN_EDIT_MODE,
         isCheckable: true,
-        isChecked: Settings.getValue(SETTING_SHOW_ZONES_IN_EDIT_MODE) == "true"
+        isChecked: Settings.getValue(SETTING_SHOW_ZONES_IN_EDIT_MODE) == "true",
+        grouping: "Advanced"
     });
 
     Entities.setLightsArePickable(false);
@@ -1138,10 +1154,10 @@ function cleanupModelMenus() {
     Menu.removeMenuItem("File", "Import Entities");
     Menu.removeMenuItem("File", "Import Entities from URL");
 
-    Menu.removeMenuItem("View", MENU_AUTO_FOCUS_ON_SELECT);
-    Menu.removeMenuItem("View", MENU_EASE_ON_FOCUS);
-    Menu.removeMenuItem("View", MENU_SHOW_LIGHTS_IN_EDIT_MODE);
-    Menu.removeMenuItem("View", MENU_SHOW_ZONES_IN_EDIT_MODE);
+    Menu.removeMenuItem("Edit", MENU_AUTO_FOCUS_ON_SELECT);
+    Menu.removeMenuItem("Edit", MENU_EASE_ON_FOCUS);
+    Menu.removeMenuItem("Edit", MENU_SHOW_LIGHTS_IN_EDIT_MODE);
+    Menu.removeMenuItem("Edit", MENU_SHOW_ZONES_IN_EDIT_MODE);
 }
 
 Script.scriptEnding.connect(function() {
diff --git a/interface/resources/qml/VrMenuItem.qml b/interface/resources/qml/VrMenuItem.qml
index 7a351cec85..fbde35059d 100644
--- a/interface/resources/qml/VrMenuItem.qml
+++ b/interface/resources/qml/VrMenuItem.qml
@@ -47,8 +47,9 @@ Item {
         }
    }
 
-    implicitHeight: label.implicitHeight * 1.5
+    implicitHeight: source.visible ? label.implicitHeight * 1.5 : 0
     implicitWidth: label.implicitWidth + label.height * 2.5
+    visible: source.visible
 
     Timer {
         id: timer
@@ -66,6 +67,7 @@ Item {
         color: label.color
         text: checkText()
         size: label.height
+        visible: source.visible
         font.pixelSize: size
         function checkText() {
             if (!source || source.type != 1 || !source.checkable) {
@@ -89,6 +91,7 @@ Item {
         verticalAlignment: Text.AlignVCenter
         color: source.enabled ? hifi.colors.text : hifi.colors.disabledText
         enabled: source.enabled && source.visible
+        visible: source.visible
         function typedText() {
             if (source) {
                 switch (source.type) {
@@ -109,7 +112,7 @@ Item {
         x: listView.width - width - 4
         size: label.height
         width: implicitWidth
-        visible: source.type == 2
+        visible: source.visible && (source.type == 2)
         text: "\uF0DA"
         anchors.verticalCenter: parent.verticalCenter
         color: label.color
diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp
index 86b3987af1..b03e223c07 100644
--- a/interface/src/Menu.cpp
+++ b/interface/src/Menu.cpp
@@ -68,16 +68,22 @@ Menu::Menu() {
                 dialogsManager.data(), &DialogsManager::toggleLoginDialog);
     }
 
-    addDisabledActionAndSeparator(fileMenu, "Scripts");
+    // File Menu > Scripts section -- "Advanced" grouping
+    addDisabledActionAndSeparator(fileMenu, "Scripts", UNSPECIFIED_POSITION, "Advanced");
     addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScript, Qt::CTRL | Qt::Key_O,
-                                  qApp, SLOT(loadDialog()));
+                                  qApp, SLOT(loadDialog()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
     addActionToQMenuAndActionHash(fileMenu, MenuOption::LoadScriptURL,
-                                    Qt::CTRL | Qt::SHIFT | Qt::Key_O, qApp, SLOT(loadScriptURLDialog()));
-    addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, qApp, SLOT(stopAllScripts()));
+                                    Qt::CTRL | Qt::SHIFT | Qt::Key_O, qApp, SLOT(loadScriptURLDialog()),
+                                    QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
+    addActionToQMenuAndActionHash(fileMenu, MenuOption::StopAllScripts, 0, qApp, SLOT(stopAllScripts()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
     addActionToQMenuAndActionHash(fileMenu, MenuOption::ReloadAllScripts, Qt::CTRL | Qt::Key_R,
-                                  qApp, SLOT(reloadAllScripts()));
+                                  qApp, SLOT(reloadAllScripts()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
     addActionToQMenuAndActionHash(fileMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J,
-                                  qApp, SLOT(toggleRunningScriptsWidget()));
+                                  qApp, SLOT(toggleRunningScriptsWidget()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
 
     auto addressManager = DependencyManager::get<AddressManager>();
 
@@ -112,9 +118,11 @@ Menu::Menu() {
                                   dialogsManager.data(),
                                   SLOT(toggleAddressBar()));
     addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyAddress, 0,
-                                  addressManager.data(), SLOT(copyAddress()));
+                                  addressManager.data(), SLOT(copyAddress()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
     addActionToQMenuAndActionHash(fileMenu, MenuOption::CopyPath, 0,
-                                  addressManager.data(), SLOT(copyPath()));
+                                  addressManager.data(), SLOT(copyPath()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
 
     addActionToQMenuAndActionHash(fileMenu,
                                   MenuOption::Quit,
@@ -143,11 +151,13 @@ Menu::Menu() {
                                   QAction::PreferencesRole);
 
     addActionToQMenuAndActionHash(editMenu, MenuOption::Attachments, 0,
-                                  dialogsManager.data(), SLOT(editAttachments()));
+                                  dialogsManager.data(), SLOT(editAttachments()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
 
     MenuWrapper* toolsMenu = addMenu("Tools");
     addActionToQMenuAndActionHash(toolsMenu, MenuOption::ScriptEditor,  Qt::ALT | Qt::Key_S,
-                                  dialogsManager.data(), SLOT(showScriptEditor()));
+                                  dialogsManager.data(), SLOT(showScriptEditor()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
 
 #if defined(Q_OS_MAC) || defined(Q_OS_WIN)
     auto speechRecognizer = DependencyManager::get<SpeechRecognizer>();
@@ -155,13 +165,16 @@ Menu::Menu() {
                                                                              Qt::CTRL | Qt::SHIFT | Qt::Key_C,
                                                                              speechRecognizer->getEnabled(),
                                                                              speechRecognizer.data(),
-                                                                             SLOT(setEnabled(bool)));
+                                                                             SLOT(setEnabled(bool)),
+                                                                             UNSPECIFIED_POSITION, "Advanced");
     connect(speechRecognizer.data(), SIGNAL(enabledUpdated(bool)), speechRecognizerAction, SLOT(setChecked(bool)));
 #endif
 
     addActionToQMenuAndActionHash(toolsMenu, MenuOption::Chat,
                                   0, // QML Qt::Key_Backslash,
-                                  dialogsManager.data(), SLOT(showIRCLink()));
+                                  dialogsManager.data(), SLOT(showIRCLink()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
+
     addActionToQMenuAndActionHash(toolsMenu, MenuOption::AddRemoveFriends, 0,
                                   qApp, SLOT(showFriendsWindow()));
 
@@ -193,22 +206,26 @@ Menu::Menu() {
                                   MenuOption::ToolWindow,
                                   Qt::CTRL | Qt::ALT | Qt::Key_T,
                                   dialogsManager.data(),
-                                  SLOT(toggleToolWindow()));
+                                  SLOT(toggleToolWindow()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
 
     addActionToQMenuAndActionHash(toolsMenu,
                                   MenuOption::Console,
                                   Qt::CTRL | Qt::ALT | Qt::Key_J,
                                   DependencyManager::get<StandAloneJSConsole>().data(),
-                                  SLOT(toggleConsole()));
+                                  SLOT(toggleConsole()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
 
     addActionToQMenuAndActionHash(toolsMenu,
                                   MenuOption::ResetSensors,
                                   0, // QML Qt::Key_Apostrophe,
                                   qApp,
-                                  SLOT(resetSensors()));
+                                  SLOT(resetSensors()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
 
     addActionToQMenuAndActionHash(toolsMenu, MenuOption::PackageModel, 0,
-                                  qApp, SLOT(packageModel()));
+                                  qApp, SLOT(packageModel()),
+                                  QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
 
     addMenu(DisplayPlugin::MENU_PATH());
     {
@@ -220,7 +237,7 @@ Menu::Menu() {
     MenuWrapper* avatarMenu = addMenu("Avatar");
     QObject* avatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
 
-    MenuWrapper* inputModeMenu = addMenu(MenuOption::InputMenu);
+    MenuWrapper* inputModeMenu = addMenu(MenuOption::InputMenu, "Advanced");
     QActionGroup* inputModeGroup = new QActionGroup(inputModeMenu);
     inputModeGroup->setExclusive(false);
     
@@ -241,17 +258,15 @@ Menu::Menu() {
                                   avatar,
                                   SLOT(resetSize()));
 
-    addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::KeyboardMotorControl,
-            Qt::CTRL | Qt::SHIFT | Qt::Key_K, true, avatar, SLOT(updateMotionBehaviorFromMenu()));
-    addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::ScriptedMotorControl, 0, true,
-            avatar, SLOT(updateMotionBehaviorFromMenu()));
-    addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::NamesAboveHeads, 0, true);
-    addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::BlueSpeechSphere, 0, true);
-    addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::EnableCharacterController, 0, true,
-            avatar, SLOT(updateMotionBehaviorFromMenu()));
+    addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::NamesAboveHeads, 0, true, 
+                NULL, NULL, UNSPECIFIED_POSITION, "Advanced");
+
+    addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::BlueSpeechSphere, 0, true,
+                NULL, NULL, UNSPECIFIED_POSITION, "Advanced");
 
     MenuWrapper* viewMenu = addMenu("View");
-    addActionToQMenuAndActionHash(viewMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()));
+    addActionToQMenuAndActionHash(viewMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()), 
+                QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
 
     MenuWrapper* cameraModeMenu = viewMenu->addMenu("Camera Mode");
     QActionGroup* cameraModeGroup = new QActionGroup(cameraModeMenu);
@@ -275,30 +290,29 @@ Menu::Menu() {
     addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Mirror,
         0, //QML Qt::SHIFT | Qt::Key_H,
         true);
-    addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::FullscreenMirror,
-        0, // QML Qt::Key_H,
-        false, qApp, SLOT(cameraMenuChanged()));
     
     addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::CenterPlayerInView,
-                                           0, false, qApp, SLOT(rotationModeChanged()));
+                                           0, false, qApp, SLOT(rotationModeChanged()),
+                                           UNSPECIFIED_POSITION, "Advanced");
 
-    addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::TurnWithHead, 0, false);
-
-    addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::WorldAxes);
-
-    addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats);
+    addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::WorldAxes, 0, false, NULL, NULL, UNSPECIFIED_POSITION, "Developer");
+    addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats, 0, false, NULL, NULL, UNSPECIFIED_POSITION, "Developer");
     addActionToQMenuAndActionHash(viewMenu, MenuOption::Log,
-        Qt::CTRL | Qt::SHIFT | Qt::Key_L,
-        qApp, SLOT(toggleLogDialog()));
+                Qt::CTRL | Qt::SHIFT | Qt::Key_L, 
+                qApp, SLOT(toggleLogDialog()), QAction::NoRole, UNSPECIFIED_POSITION, "Developer");
+
     addActionToQMenuAndActionHash(viewMenu, MenuOption::AudioNetworkStats, 0,
-                                  dialogsManager.data(), SLOT(audioStatsDetails()));
+                dialogsManager.data(), SLOT(audioStatsDetails()), QAction::NoRole, UNSPECIFIED_POSITION, "Developer");
+
     addActionToQMenuAndActionHash(viewMenu, MenuOption::BandwidthDetails, 0,
-                                  dialogsManager.data(), SLOT(bandwidthDetails()));
+                dialogsManager.data(), SLOT(bandwidthDetails()), QAction::NoRole, UNSPECIFIED_POSITION, "Developer");
     addActionToQMenuAndActionHash(viewMenu, MenuOption::OctreeStats, 0,
-                                  dialogsManager.data(), SLOT(octreeStatsDetails()));
+                dialogsManager.data(), SLOT(octreeStatsDetails()), QAction::NoRole, UNSPECIFIED_POSITION, "Developer");
 
+    addCheckableActionToQMenuAndActionHash(viewMenu, "Advanced Menus", 0, false, this, SLOT(toggleAdvancedMenus()));
+    addCheckableActionToQMenuAndActionHash(viewMenu, "Developer Menus", 0, false, this, SLOT(toggleDeveloperMenus()));
 
-    MenuWrapper* developerMenu = addMenu("Developer");
+    MenuWrapper* developerMenu = addMenu("Developer", "Developer");
 
     MenuWrapper* renderOptionsMenu = developerMenu->addMenu("Render");
     addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Atmosphere,
@@ -447,9 +461,23 @@ Menu::Menu() {
     addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::MeshVisible, 0, true,
                                            avatar, SLOT(setEnableMeshVisible(bool)));
     addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::DisableEyelidAdjustment, 0, false);
-
+    addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::TurnWithHead, 0, false);
     addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ComfortMode, 0, true);
 
+    addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::KeyboardMotorControl,
+        Qt::CTRL | Qt::SHIFT | Qt::Key_K, true, avatar, SLOT(updateMotionBehaviorFromMenu()),
+        UNSPECIFIED_POSITION, "Developer");
+
+    addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::ScriptedMotorControl, 0, true,
+        avatar, SLOT(updateMotionBehaviorFromMenu()),
+        UNSPECIFIED_POSITION, "Developer");
+
+    addCheckableActionToQMenuAndActionHash(avatarDebugMenu, MenuOption::EnableCharacterController, 0, true,
+        avatar, SLOT(updateMotionBehaviorFromMenu()),
+        UNSPECIFIED_POSITION, "Developer");
+
+
+
     MenuWrapper* handOptionsMenu = developerMenu->addMenu("Hands");
     addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false);
     addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::EnableHandMouseInput, 0, false);
@@ -573,6 +601,14 @@ Menu::Menu() {
 #endif
 }
 
+void Menu::toggleAdvancedMenus() {
+    setGroupingIsVisible("Advanced", !getGroupingIsVisible("Advanced"));
+}
+
+void Menu::toggleDeveloperMenus() {
+    setGroupingIsVisible("Developer", !getGroupingIsVisible("Developer"));
+}
+
 void Menu::loadSettings() {
     scanMenuBar(&Menu::loadAction);
 }
@@ -610,23 +646,36 @@ void Menu::scanMenu(QMenu& menu, settingsAction modifySetting, Settings& setting
     settings.endGroup();
 }
 
-void Menu::addDisabledActionAndSeparator(MenuWrapper* destinationMenu, const QString& actionName, int menuItemLocation) {
+void Menu::addDisabledActionAndSeparator(MenuWrapper* destinationMenu, const QString& actionName, 
+                                            int menuItemLocation, const QString& grouping) {
     QAction* actionBefore = NULL;
+    QAction* separator;
+    QAction* separatorText;
+
     if (menuItemLocation >= 0 && destinationMenu->actions().size() > menuItemLocation) {
         actionBefore = destinationMenu->actions()[menuItemLocation];
     }
     if (actionBefore) {
-        QAction* separator = new QAction("",destinationMenu);
+        separator = new QAction("",destinationMenu);
         destinationMenu->insertAction(actionBefore, separator);
         separator->setSeparator(true);
 
-        QAction* separatorText = new QAction(actionName,destinationMenu);
+        separatorText = new QAction(actionName,destinationMenu);
         separatorText->setEnabled(false);
         destinationMenu->insertAction(actionBefore, separatorText);
 
     } else {
-        destinationMenu->addSeparator();
-        (destinationMenu->addAction(actionName))->setEnabled(false);
+        separator = destinationMenu->addSeparator();
+        separatorText = destinationMenu->addAction(actionName);
+        separatorText->setEnabled(false);
+    }
+
+    if (isValidGrouping(grouping)) {
+        _groupingActions[grouping] << separator;
+        _groupingActions[grouping] << separatorText;
+        bool isVisible = getGroupingIsVisible(grouping);
+        separator->setVisible(isVisible);
+        separatorText->setVisible(isVisible);
     }
 }
 
@@ -636,7 +685,8 @@ QAction* Menu::addActionToQMenuAndActionHash(MenuWrapper* destinationMenu,
                                              const QObject* receiver,
                                              const char* member,
                                              QAction::MenuRole role,
-                                             int menuItemLocation) {
+                                             int menuItemLocation, 
+                                             const QString& grouping) {
     QAction* action = NULL;
     QAction* actionBefore = NULL;
 
@@ -664,6 +714,11 @@ QAction* Menu::addActionToQMenuAndActionHash(MenuWrapper* destinationMenu,
 
     _actionHash.insert(actionName, action);
 
+    if (isValidGrouping(grouping)) {
+        _groupingActions[grouping] << action;
+        action->setVisible(getGroupingIsVisible(grouping));
+    }
+
     return action;
 }
 
@@ -672,7 +727,8 @@ QAction* Menu::addActionToQMenuAndActionHash(MenuWrapper* destinationMenu,
                                              const QString& actionName,
                                              const QKeySequence& shortcut,
                                              QAction::MenuRole role,
-                                             int menuItemLocation) {
+                                             int menuItemLocation, 
+                                             const QString& grouping) {
     QAction* actionBefore = NULL;
 
     if (menuItemLocation >= 0 && destinationMenu->actions().size() > menuItemLocation) {
@@ -699,6 +755,11 @@ QAction* Menu::addActionToQMenuAndActionHash(MenuWrapper* destinationMenu,
 
     _actionHash.insert(action->text(), action);
 
+    if (isValidGrouping(grouping)) {
+        _groupingActions[grouping] << action;
+        action->setVisible(getGroupingIsVisible(grouping));
+    }
+
     return action;
 }
 
@@ -708,19 +769,29 @@ QAction* Menu::addCheckableActionToQMenuAndActionHash(MenuWrapper* destinationMe
                                                       const bool checked,
                                                       const QObject* receiver,
                                                       const char* member,
-                                                      int menuItemLocation) {
+                                                      int menuItemLocation, 
+                                                      const QString& grouping) {
 
     QAction* action = addActionToQMenuAndActionHash(destinationMenu, actionName, shortcut, receiver, member,
                                                         QAction::NoRole, menuItemLocation);
     action->setCheckable(true);
     action->setChecked(checked);
 
+    if (isValidGrouping(grouping)) {
+        _groupingActions[grouping] << action;
+        action->setVisible(getGroupingIsVisible(grouping));
+    }
+
     return action;
 }
 
 void Menu::removeAction(MenuWrapper* menu, const QString& actionName) {
-    menu->removeAction(_actionHash.value(actionName));
+    auto action = _actionHash.value(actionName);
+    menu->removeAction(action);
     _actionHash.remove(actionName);
+    for (auto& grouping : _groupingActions) {
+        grouping.remove(action);
+    }
 }
 
 void Menu::setIsOptionChecked(const QString& menuOption, bool isChecked) {
@@ -850,7 +921,7 @@ int Menu::positionBeforeSeparatorIfNeeded(MenuWrapper* menu, int requestedPositi
 }
 
 
-MenuWrapper* Menu::addMenu(const QString& menuName) {
+MenuWrapper* Menu::addMenu(const QString& menuName, const QString& grouping) {
     QStringList menuTree = menuName.split(">");
     MenuWrapper* addTo = NULL;
     MenuWrapper* menu = NULL;
@@ -866,6 +937,14 @@ MenuWrapper* Menu::addMenu(const QString& menuName) {
         addTo = menu;
     }
 
+    if (isValidGrouping(grouping)) {
+        auto action = getMenuAction(menuName);
+        if (action) {
+            _groupingActions[grouping] << action;
+            action->setVisible(getGroupingIsVisible(grouping));
+        }
+    }
+
     QMenuBar::repaint();
     return menu;
 }
@@ -897,7 +976,7 @@ bool Menu::menuExists(const QString& menuName) {
     return false;
 }
 
-void Menu::addSeparator(const QString& menuName, const QString& separatorName) {
+void Menu::addSeparator(const QString& menuName, const QString& separatorName, const QString& grouping) {
     MenuWrapper* menuObj = getMenu(menuName);
     if (menuObj) {
         addDisabledActionAndSeparator(menuObj, separatorName);
@@ -952,15 +1031,16 @@ void Menu::addMenuItem(const MenuItemProperties& properties) {
 
         QAction* menuItemAction = NULL;
         if (properties.isSeparator) {
-            addDisabledActionAndSeparator(menuObj, properties.menuItemName, requestedPosition);
+            addDisabledActionAndSeparator(menuObj, properties.menuItemName, requestedPosition, properties.grouping);
         } else if (properties.isCheckable) {
             menuItemAction = addCheckableActionToQMenuAndActionHash(menuObj, properties.menuItemName,
                                                                     properties.shortcutKeySequence, properties.isChecked,
-                                                                    MenuScriptingInterface::getInstance(), SLOT(menuItemTriggered()), requestedPosition);
+                                                                    MenuScriptingInterface::getInstance(), SLOT(menuItemTriggered()), 
+                                                                    requestedPosition, properties.grouping);
         } else {
             menuItemAction = addActionToQMenuAndActionHash(menuObj, properties.menuItemName, properties.shortcutKeySequence,
                                                            MenuScriptingInterface::getInstance(), SLOT(menuItemTriggered()),
-                                                           QAction::NoRole, requestedPosition);
+                                                           QAction::NoRole, requestedPosition, properties.grouping);
         }
         if (shortcut && menuItemAction) {
             connect(shortcut, SIGNAL(activated()), menuItemAction, SLOT(trigger()));
@@ -975,7 +1055,7 @@ void Menu::removeMenuItem(const QString& menu, const QString& menuitem) {
         removeAction(menuObj, menuitem);
         QMenuBar::repaint();
     }
-};
+}
 
 bool Menu::menuItemExists(const QString& menu, const QString& menuitem) {
     QAction* menuItemAction = _actionHash.value(menuitem);
@@ -983,7 +1063,31 @@ bool Menu::menuItemExists(const QString& menu, const QString& menuitem) {
         return (getMenu(menu) != NULL);
     }
     return false;
-};
+}
+
+bool Menu::getGroupingIsVisible(const QString& grouping) {
+    if (grouping.isEmpty() || grouping.isNull()) {
+        return true;
+    }
+    if (_groupingVisible.contains(grouping)) {
+        return _groupingVisible[grouping];
+    }
+    return false;
+}
+
+void Menu::setGroupingIsVisible(const QString& grouping, bool isVisible) {
+    // NOTE: Default grouping always visible
+    if (grouping.isEmpty() || grouping.isNull()) {
+        return;
+    }
+    _groupingVisible[grouping] = isVisible;
+
+    for (auto action: _groupingActions[grouping]) {
+        action->setVisible(isVisible);
+    }
+
+    QMenuBar::repaint();
+}
 
 
 MenuWrapper::MenuWrapper(QMenu* menu) : _realMenu(menu) {
@@ -1005,8 +1109,8 @@ void MenuWrapper::setEnabled(bool enabled) {
     _realMenu->setEnabled(enabled);
 }
 
-void MenuWrapper::addSeparator() {
-    _realMenu->addSeparator();
+QAction* MenuWrapper::addSeparator() {
+    return _realMenu->addSeparator();
 }
 
 void MenuWrapper::addAction(QAction* action) {
diff --git a/interface/src/Menu.h b/interface/src/Menu.h
index 3ff0b149f4..d6047bf711 100644
--- a/interface/src/Menu.h
+++ b/interface/src/Menu.h
@@ -30,7 +30,7 @@ public:
     QList<QAction*> actions();
     MenuWrapper* addMenu(const QString& menuName);
     void setEnabled(bool enabled = true);
-    void addSeparator();
+    QAction* addSeparator();
     void addAction(QAction* action);
 
     QAction* addAction(const QString& menuName);
@@ -74,28 +74,33 @@ public:
                                            const QObject* receiver = NULL,
                                            const char* member = NULL,
                                            QAction::MenuRole role = QAction::NoRole,
-                                           int menuItemLocation = UNSPECIFIED_POSITION);
+                                           int menuItemLocation = UNSPECIFIED_POSITION,
+                                           const QString& grouping = QString());
+
     QAction* addActionToQMenuAndActionHash(MenuWrapper* destinationMenu,
                                            QAction* action,
                                            const QString& actionName = QString(),
                                            const QKeySequence& shortcut = 0,
                                            QAction::MenuRole role = QAction::NoRole,
-                                           int menuItemLocation = UNSPECIFIED_POSITION);
+                                           int menuItemLocation = UNSPECIFIED_POSITION,
+                                           const QString& grouping = QString());
+
     QAction* addCheckableActionToQMenuAndActionHash(MenuWrapper* destinationMenu,
                                                     const QString& actionName,
                                                     const QKeySequence& shortcut = 0,
                                                     const bool checked = false,
                                                     const QObject* receiver = NULL,
                                                     const char* member = NULL,
-                                                    int menuItemLocation = UNSPECIFIED_POSITION);
+                                                    int menuItemLocation = UNSPECIFIED_POSITION,
+                                                    const QString& grouping = QString());
 
     void removeAction(MenuWrapper* menu, const QString& actionName);
 
 public slots:
-    MenuWrapper* addMenu(const QString& menuName);
+    MenuWrapper* addMenu(const QString& menuName, const QString& grouping = QString());
     void removeMenu(const QString& menuName);
     bool menuExists(const QString& menuName);
-    void addSeparator(const QString& menuName, const QString& separatorName);
+    void addSeparator(const QString& menuName, const QString& separatorName, const QString& grouping = QString());
     void removeSeparator(const QString& menuName, const QString& separatorName);
     void addMenuItem(const MenuItemProperties& properties);
     void removeMenuItem(const QString& menuName, const QString& menuitem);
@@ -103,6 +108,12 @@ public slots:
     bool isOptionChecked(const QString& menuOption) const;
     void setIsOptionChecked(const QString& menuOption, bool isChecked);
 
+    bool getGroupingIsVisible(const QString& grouping);
+    void setGroupingIsVisible(const QString& grouping, bool isVisible); /// NOTE: the "" grouping is always visible
+
+    void toggleDeveloperMenus();
+    void toggleAdvancedMenus();
+
 private:
     typedef void(*settingsAction)(Settings&, QAction&);
     static void loadAction(Settings& settings, QAction& action);
@@ -111,8 +122,10 @@ private:
     void scanMenu(QMenu& menu, settingsAction modifySetting, Settings& settings);
 
     /// helper method to have separators with labels that are also compatible with OS X
-    void addDisabledActionAndSeparator(MenuWrapper* destinationMenu, const QString& actionName,
-                                       int menuItemLocation = UNSPECIFIED_POSITION);
+    void addDisabledActionAndSeparator(MenuWrapper* destinationMenu, 
+                                       const QString& actionName,
+                                       int menuItemLocation = UNSPECIFIED_POSITION, 
+                                       const QString& grouping = QString());
 
     QAction* getActionFromName(const QString& menuName, MenuWrapper* menu);
     MenuWrapper* getSubMenuFromName(const QString& menuName, MenuWrapper* menu);
@@ -123,6 +136,10 @@ private:
     int positionBeforeSeparatorIfNeeded(MenuWrapper* menu, int requestedPosition);
 
     QHash<QString, QAction*> _actionHash;
+
+    bool isValidGrouping(const QString& grouping) const { return grouping == "Advanced" || grouping == "Developer"; }
+    QHash<QString, bool> _groupingVisible;
+    QHash<QString, QSet<QAction*>> _groupingActions;
 };
 
 namespace MenuOption {
diff --git a/libraries/script-engine/src/MenuItemProperties.cpp b/libraries/script-engine/src/MenuItemProperties.cpp
index 04c467c3b6..c5f037eba8 100644
--- a/libraries/script-engine/src/MenuItemProperties.cpp
+++ b/libraries/script-engine/src/MenuItemProperties.cpp
@@ -95,6 +95,7 @@ void menuItemPropertiesFromScriptValue(const QScriptValue& object, MenuItemPrope
     }
     properties.beforeItem = object.property("beforeItem").toVariant().toString();
     properties.afterItem = object.property("afterItem").toVariant().toString();
+    properties.grouping = object.property("grouping").toVariant().toString();
 }
 
 
diff --git a/libraries/script-engine/src/MenuItemProperties.h b/libraries/script-engine/src/MenuItemProperties.h
index e58ebe2afb..68fd32a6fa 100644
--- a/libraries/script-engine/src/MenuItemProperties.h
+++ b/libraries/script-engine/src/MenuItemProperties.h
@@ -43,6 +43,8 @@ public:
     bool isCheckable;
     bool isChecked;
     bool isSeparator;
+
+    QString grouping; /// Either: "", "Advanced", or "Developer"
 };
 Q_DECLARE_METATYPE(MenuItemProperties)
 QScriptValue menuItemPropertiesToScriptValue(QScriptEngine* engine, const MenuItemProperties& props);
diff --git a/libraries/ui/src/VrMenu.cpp b/libraries/ui/src/VrMenu.cpp
index 41cf27efb2..2d9dd57ba9 100644
--- a/libraries/ui/src/VrMenu.cpp
+++ b/libraries/ui/src/VrMenu.cpp
@@ -95,6 +95,14 @@ void VrMenu::setRootMenu(QObject* rootMenu) {
     _rootMenu = rootMenu;
 }
 
+void updateQmlItemFromAction(QObject* target, QAction* source) {
+    target->setProperty("checkable", source->isCheckable());
+    target->setProperty("enabled", source->isEnabled());
+    target->setProperty("text", source->text());
+    target->setProperty("checked", source->isChecked());
+    target->setProperty("visible", source->isVisible());
+}
+
 void VrMenu::addMenu(QMenu* menu) {
     Q_ASSERT(!MenuUserData::forObject(menu));
     QObject* parent = menu->parent();
@@ -119,14 +127,12 @@ void VrMenu::addMenu(QMenu* menu) {
 
     // Bind the QML and Widget together
     new MenuUserData(menu, result);
-}
+    auto menuAction = menu->menuAction();
+    updateQmlItemFromAction(result, menuAction);
+    QObject::connect(menuAction, &QAction::changed, [=] {
+        updateQmlItemFromAction(result, menuAction);
+    });
 
-void updateQmlItemFromAction(QObject* target, QAction* source) {
-    target->setProperty("checkable", source->isCheckable());
-    target->setProperty("enabled", source->isEnabled());
-    target->setProperty("visible", source->isVisible());
-    target->setProperty("text", source->text());
-    target->setProperty("checked", source->isChecked());
 }
 
 void bindActionToQmlAction(QObject* qmlAction, QAction* action) {

From be058398a2477cfe7ee0c7a67faccc47aaaeeb14 Mon Sep 17 00:00:00 2001
From: Brad Hefta-Gaub <brad@highfidelity.io>
Date: Sun, 13 Dec 2015 12:02:39 -0800
Subject: [PATCH 26/28] remove blue sphere while speaking

---
 interface/src/Menu.cpp          |  3 ---
 interface/src/Menu.h            |  1 -
 interface/src/avatar/Avatar.cpp | 33 ---------------------------------
 3 files changed, 37 deletions(-)

diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp
index b03e223c07..b965607b39 100644
--- a/interface/src/Menu.cpp
+++ b/interface/src/Menu.cpp
@@ -261,9 +261,6 @@ Menu::Menu() {
     addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::NamesAboveHeads, 0, true, 
                 NULL, NULL, UNSPECIFIED_POSITION, "Advanced");
 
-    addCheckableActionToQMenuAndActionHash(avatarMenu, MenuOption::BlueSpeechSphere, 0, true,
-                NULL, NULL, UNSPECIFIED_POSITION, "Advanced");
-
     MenuWrapper* viewMenu = addMenu("View");
     addActionToQMenuAndActionHash(viewMenu, MenuOption::ReloadContent, 0, qApp, SLOT(reloadResourceCaches()), 
                 QAction::NoRole, UNSPECIFIED_POSITION, "Advanced");
diff --git a/interface/src/Menu.h b/interface/src/Menu.h
index d6047bf711..13618d1808 100644
--- a/interface/src/Menu.h
+++ b/interface/src/Menu.h
@@ -168,7 +168,6 @@ namespace MenuOption {
     const QString Back = "Back";
     const QString BandwidthDetails = "Bandwidth Details";
     const QString BinaryEyelidControl = "Binary Eyelid Control";
-    const QString BlueSpeechSphere = "Blue Sphere While Speaking";
     const QString BookmarkLocation = "Bookmark Location";
     const QString Bookmarks = "Bookmarks";
     const QString CachesSize = "RAM Caches Size";
diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp
index 218d679898..42fc023013 100644
--- a/interface/src/avatar/Avatar.cpp
+++ b/interface/src/avatar/Avatar.cpp
@@ -495,39 +495,6 @@ void Avatar::render(RenderArgs* renderArgs, const glm::vec3& cameraPosition) {
                 }
             }
         }
-
-        // quick check before falling into the code below:
-        // (a 10 degree breadth of an almost 2 meter avatar kicks in at about 12m)
-        const float MIN_VOICE_SPHERE_DISTANCE = 12.0f;
-        if (Menu::getInstance()->isOptionChecked(MenuOption::BlueSpeechSphere)
-            && distanceToTarget > MIN_VOICE_SPHERE_DISTANCE) {
-            PROFILE_RANGE_BATCH(batch, __FUNCTION__":renderVoiceSphere");
-
-            // render voice intensity sphere for avatars that are farther away
-            const float MAX_SPHERE_ANGLE = 10.0f * RADIANS_PER_DEGREE;
-            const float MIN_SPHERE_ANGLE = 0.5f * RADIANS_PER_DEGREE;
-            const float MIN_SPHERE_SIZE = 0.01f;
-            const float SPHERE_LOUDNESS_SCALING = 0.0005f;
-            const float SPHERE_COLOR[] = { 0.5f, 0.8f, 0.8f };
-            float height = getSkeletonHeight();
-            glm::vec3 delta = height * (getHead()->getCameraOrientation() * IDENTITY_UP) / 2.0f;
-            float angle = abs(angleBetween(toTarget + delta, toTarget - delta));
-            float sphereRadius = getHead()->getAverageLoudness() * SPHERE_LOUDNESS_SCALING;
-
-            if (renderArgs->_renderMode == RenderArgs::DEFAULT_RENDER_MODE && (sphereRadius > MIN_SPHERE_SIZE) &&
-                    (angle < MAX_SPHERE_ANGLE) && (angle > MIN_SPHERE_ANGLE)) {
-                batch.setModelTransform(Transform());
-
-
-                Transform transform;
-                transform.setTranslation(getPosition());
-                transform.setScale(height);
-                transform.postScale(sphereRadius);
-                DependencyManager::get<DeferredLightingEffect>()->renderSolidSphereInstance(batch,
-                    transform,
-                    glm::vec4(SPHERE_COLOR[0], SPHERE_COLOR[1], SPHERE_COLOR[2], 1.0f - angle / MAX_SPHERE_ANGLE));
-            }
-        }
     }
 
     const float DISPLAYNAME_DISTANCE = 20.0f;

From 67d6965f14d89a7c608d52cf796e9071b9b490ad Mon Sep 17 00:00:00 2001
From: Ken Cooke <ken@highfidelity.io>
Date: Sun, 13 Dec 2015 16:14:38 -0800
Subject: [PATCH 27/28] Revert "Fix the broken skybox and simplify a bit the
 vertex shader used"

This reverts commit 68134aafe5d22fe1efe19bbdc65fac32f9dfa4bc.
---
 .../procedural/src/procedural/ProceduralSkybox.cpp     | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libraries/procedural/src/procedural/ProceduralSkybox.cpp b/libraries/procedural/src/procedural/ProceduralSkybox.cpp
index 68645045b4..bd61de7338 100644
--- a/libraries/procedural/src/procedural/ProceduralSkybox.cpp
+++ b/libraries/procedural/src/procedural/ProceduralSkybox.cpp
@@ -51,6 +51,14 @@ void ProceduralSkybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum,
     static gpu::Stream::FormatPointer theFormat;
 
     if (skybox._procedural && skybox._procedural->_enabled && skybox._procedural->ready()) {
+        if (!theBuffer) {
+            const float CLIP = 1.0f;
+            const glm::vec2 vertices[4] = { { -CLIP, -CLIP }, { CLIP, -CLIP }, { -CLIP, CLIP }, { CLIP, CLIP } };
+            theBuffer = std::make_shared<gpu::Buffer>(sizeof(vertices), (const gpu::Byte*) vertices);
+            theFormat = std::make_shared<gpu::Stream::Format>();
+            theFormat->setAttribute(gpu::Stream::POSITION, gpu::Stream::POSITION, gpu::Element(gpu::VEC2, gpu::FLOAT, gpu::XYZ));
+        }
+
         glm::mat4 projMat;
         viewFrustum.evalProjectionMatrix(projMat);
 
@@ -59,6 +67,8 @@ void ProceduralSkybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum,
         batch.setProjectionTransform(projMat);
         batch.setViewTransform(viewTransform);
         batch.setModelTransform(Transform()); // only for Mac
+        batch.setInputBuffer(gpu::Stream::POSITION, theBuffer, 0, 8);
+        batch.setInputFormat(theFormat);
 
         if (skybox.getCubemap() && skybox.getCubemap()->isDefined()) {
             batch.setResourceTexture(0, skybox.getCubemap());

From 7190c26c40aa776de182adbfe219590e5381edf1 Mon Sep 17 00:00:00 2001
From: David Rowe <david@ctrlaltstudio.com>
Date: Mon, 14 Dec 2015 15:37:10 +1300
Subject: [PATCH 28/28] Update Windows build instructions for 64-bit builds

---
 BUILD_WIN.md | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/BUILD_WIN.md b/BUILD_WIN.md
index 48781ca34a..671fed5a97 100644
--- a/BUILD_WIN.md
+++ b/BUILD_WIN.md
@@ -1,5 +1,7 @@
 Please read the [general build guide](BUILD.md) for information on dependencies required for all platforms. Only Windows specific instructions are found in this file.
 
+Interface can be built as 32 or 64 bit.
+
 ###Visual Studio 2013
 
 You can use the Community or Professional editions of Visual Studio 2013.
@@ -25,25 +27,26 @@ We expect nmake.exe to be located at the following path.
 ###Qt
 You can use the online installer or the offline installer. If you use the offline installer, be sure to select the "OpenGL" version.
 
-NOTE: Qt does not support 64-bit builds on Windows 7, so you must use the 32-bit version of libraries for interface.exe to run. The 32-bit version of the static library is the one linked by our CMake find modules.
-
 * [Download the online installer](http://qt-project.org/downloads)
-    * When it asks you to select components, ONLY select the following:
+    * When it asks you to select components, ONLY select one of the following, 32- or 64-bit to match your build preference:
         * Qt > Qt 5.5.1 > **msvc2013 32-bit**
+        * Qt > Qt 5.5.1 > **msvc2013 64-bit**
 
-* [Download the offline installer](http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-msvc2013-5.5.1.exe)
+* Download the offline installer, 32- or 64-bit to match your build preference:
+    * [32-bit](http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-msvc2013-5.5.1.exe)
+    * [64-bit](http://download.qt.io/official_releases/qt/5.5/5.5.1/qt-opensource-windows-x86-msvc2013_64-5.5.1.exe)
 
 Once Qt is installed, you need to manually configure the following:
-* Set the QT_CMAKE_PREFIX_PATH environment variable to your `Qt\5.5.1\msvc2013\lib\cmake` directory.
+* Set the QT_CMAKE_PREFIX_PATH environment variable to your `Qt\5.5.1\msvc2013\lib\cmake` or `Qt\5.5.1\msvc2013_64\lib\cmake` directory.
   * You can set an environment variable from Control Panel > System > Advanced System Settings > Environment Variables > New
 
 ###External Libraries
 
-As it stands, Hifi/Interface is a 32-bit application, so all libraries should also be 32-bit.
+All libraries should be 32- or 64-bit to match your build preference.
 
 CMake will need to know where the headers and libraries for required external dependencies are.
 
-We use CMake's `fixup_bundle` to find the DLLs all of our exectuable targets require, and then copy them beside the executable in a post-build step. If `fixup_bundle` is having problems finding a DLL, you can fix it manually on your end by adding the folder containing that DLL to your path. Let us know which DLL CMake had trouble finding, as it is possible a tweak to our CMake files is required.
+We use CMake's `fixup_bundle` to find the DLLs all of our executable targets require, and then copy them beside the executable in a post-build step. If `fixup_bundle` is having problems finding a DLL, you can fix it manually on your end by adding the folder containing that DLL to your path. Let us know which DLL CMake had trouble finding, as it is possible a tweak to our CMake files is required.
 
 The recommended route for CMake to find the external dependencies is to place all of the dependencies in one folder and set one ENV variable - HIFI_LIB_DIR. That ENV variable should point to a directory with the following structure:
 
@@ -69,17 +72,23 @@ Your system may already have several versions of the OpenSSL DLL's (ssleay32.dll
     QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb
     QSslSocket: cannot resolve SSL_get0_next_proto_negotiated
 
-To prevent these problems, install OpenSSL yourself. Download the following binary packages [from this website](http://slproweb.com/products/Win32OpenSSL.html):
-* Visual C++ 2008 Redistributables
-* Win32 OpenSSL v1.0.1p
+To prevent these problems, install OpenSSL yourself. Download one of the following binary packages [from this website](http://slproweb.com/products/Win32OpenSSL.html):
+* Win32 OpenSSL v1.0.1q
+* Win64 OpenSSL v1.0.1q
 
 Install OpenSSL into the Windows system directory, to make sure that Qt uses the version that you've just installed, and not some other version.
 
 ###Build High Fidelity using Visual Studio
 Follow the same build steps from the CMake section of [BUILD.md](BUILD.md), but pass a different generator to CMake.
 
+For 32-bit builds:
+
     cmake .. -G "Visual Studio 12"
 
+For 64-bit builds:
+
+    cmake .. -G "Visual Studio 12 Win64"
+
 Open %HIFI_DIR%\build\hifi.sln and compile.
 
 ###Running Interface