Added debug output

Added debug output

--- client/include/client_server_instance.hpp
+++ client/include/client_server_instance.hpp
@@ -81,6 +81,9 @@
         // Signals for administative rights
         signal_t<void(request::server::admin_rights::failure::reason)> on_admin_rights_denied;
         signal_t<void()> on_admin_rights_granted;
+
+        // Signals for debugging
+        signal_t<void(std::string)> on_debug_message;
     };
 }


Add a link to the "rainbow" page.

Add a link to the "rainbow" page.

--- core/base/src/TColor.cxx
+++ core/base/src/TColor.cxx
@@ -254,6 +254,8 @@
 ##  High quality predefined palettes
 \since **6.04:**
 62 high quality palettes are predefined with 255 colors each.
+Despite the [disadvantages of the Rainbow color map](https://root.cern.ch/rainbow-color-map),
+it was kept in the list of predefined color maps.
 These palettes can be accessed "by name" with `gStyle->SetPalette(num)`.
 `num` can be taken within the following enum:


Doxygen

Doxygen

--- core/base/src/TNamed.cxx
+++ core/base/src/TNamed.cxx
@@ -9,17 +9,14 @@
  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
  *************************************************************************/

-//////////////////////////////////////////////////////////////////////////
-//                                                                      //
-// TNamed                                                               //
-//                                                                      //
-// The TNamed class is the base class for all named ROOT classes        //
-// A TNamed contains the essential elements (name, title)               //
-// to identify a derived object in containers, directories and files.   //
-// Most member functions defined in this base class are in general      //
-// overridden by the derived classes.                                   //
-//                                                                      //
-//////////////////////////////////////////////////////////////////////////
+/** \class TNamed
+The TNamed class is the base class for all named ROOT classes.
+
+A TNamed contains the essential elements (name, title)
+to identify a derived object in containers, directories and files.
+Most member functions defined in this base class are in general
+overridden by the derived classes.
+*/

 #include "Riostream.h"
 #include "Strlen.h"
@@ -136,6 +133,7 @@

 ////////////////////////////////////////////////////////////////////////////////
 /// Change (i.e. set) all the TNamed parameters (name and title).
+//
 /// WARNING: if the name is changed and the object is a member of a
 /// THashTable or THashList container the container must be Rehash()'ed
 /// after SetName(). For example the list of objects in the current


- After Revision 25519, the Frame Fill Color of the "Plain" style has to be set
  to 0. Previously it was not set at all therefore the default value was used.
  The default value is now 19 and not 0 as it was before Revision 25519.
  This problem has been reported here:
  https://savannah.cern.ch/bugs/index.php?42462

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@25687 27541ba8-7e3a-0410-8455-c3a389f83636

--- core/base/src/TStyle.cxx
+++ core/base/src/TStyle.cxx
@@ -109,6 +109,7 @@
    //may be a standard style to be initialized
    if (strcmp(name,"Plain") == 0) {
       SetFrameBorderMode(0);
+      SetFrameFillColor(0);
       SetCanvasBorderMode(0);
       SetPadBorderMode(0);
       SetPadColor(0);


planning: delete obstacle history trajectory points if too old


QtWidgets: assertion fix

QtWidgets: assertion fix

--- modules/qtwidgets/properties/colorlineedit.cpp
+++ modules/qtwidgets/properties/colorlineedit.cpp
@@ -184,7 +184,7 @@

     ivwAssert((tokens.size() == 1) || (tokens.size() == 3) || (tokens.size() == 4),
               "Invalid number of color components");
-    ivwAssert((tokens.size() == 1) && tokens.front().startsWith("#"),
+    ivwAssert((tokens.size() > 1) || ((tokens.size() == 1) && tokens.front().startsWith("#")),
               "Invalid single component (expected hex color code starting with '#')");

     if (tokens.size() == 1) {


Update add_diag_test.cpp

Update add_diag_test.cpp

--- test/unit/math/prim/mat/fun/add_diag_test.cpp
+++ test/unit/math/prim/mat/fun/add_diag_test.cpp
@@ -1,6 +1,6 @@
 #include <gtest/gtest.h>
+#include <stan/math/prim/mat.hpp>
 #include <limits>
-#include <stan/math/prim/mat.hpp>
 #include <string>
 #include <vector>


cleanup: miscellanous clang-tidy 14 fixes (#8718)

--- google/cloud/examples/grpc_credential_types.cc
+++ google/cloud/examples/grpc_credential_types.cc
@@ -129,7 +129,7 @@
 void UseAccessTokenUntilExpired(google::cloud::iam::IAMCredentialsClient client,
                                 std::vector<std::string> const& argv) {
   auto token = UseAccessToken(std::move(client), argv);
-  auto const project_id = argv.at(1);
+  auto const& project_id = argv.at(1);
   auto const expiration =
       std::chrono::system_clock::from_time_t(token.expire_time().seconds());
   auto const deadline = expiration + 4 * kTokenValidationPeriod;


V2.2.0

V2.2.0

Signed-off-by: Rick Waldron <dd8fdbe95c7f81f312b273ef8860922803e9ef16@gmail.com>


new texture helps

new texture helps

--- plugins/molsurfmapcluster/src/ClusterRenderer.cpp
+++ plugins/molsurfmapcluster/src/ClusterRenderer.cpp
@@ -517,17 +517,17 @@
                                                 255, 0,   0,
                                                 0,   0,   255,
                                                 255, 255, 255};
-                    vislib::graphics::gl::OpenGLTexture2D mytex;
-                    mytex.Create(2, 2, loctex.data(), GL_RGB, GL_UNSIGNED_BYTE, GL_RGB);
-                    mytex.SetFilter(GL_LINEAR, GL_LINEAR);
-                    mytex.SetWrap(GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE);
+                    glowl::TextureLayout layout(GL_RGB8, 2, 2, 1, GL_RGB, GL_UNSIGNED_BYTE, 1);
+
+                    std::unique_ptr<glowl::Texture2D> mytex =
+                        std::make_unique<glowl::Texture2D>("test", layout, loctex.data());

                     glBindVertexArray(this->texVa);
                     this->textureShader.Enable();

                     glEnable(GL_TEXTURE_2D);
                     glActiveTexture(GL_TEXTURE0);
-                    mytex.Bind();
+                    mytex->bindTexture();

                     glUniform1i(this->textureShader.ParameterLocation("tex"), 0);
                     glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);


Fix wrong field access in filebrowser.cpp

--- toonz/sources/toonz/filebrowser.cpp
+++ toonz/sources/toonz/filebrowser.cpp
@@ -611,7 +611,7 @@
         if (levelItem.m_creationDate.isNull() ||
             (fileInfo.created() < levelItem.m_creationDate))
           levelItem.m_creationDate = fileInfo.created();
-        if (levelItem.m_creationDate.isNull() ||
+        if (levelItem.m_modifiedDate.isNull() ||
             (fileInfo.lastModified() > levelItem.m_modifiedDate))
           levelItem.m_modifiedDate = fileInfo.lastModified();
         levelItem.m_fileSize += fileInfo.size();


Removing EoS system from the code

Removing EoS system from the code

--- modules/thm/src/kernels/OneDMomentumFriction.C
+++ modules/thm/src/kernels/OneDMomentumFriction.C
@@ -1,5 +1,4 @@
 #include "OneDMomentumFriction.h"
-#include "EquationOfState.h"

 template<>
 InputParameters validParams<OneDMomentumFriction>()


ctor, then dtor, then others

ctor, then dtor, then others

--- arangod/RocksDBEngine/RocksDBEdgeIndex.cpp
+++ arangod/RocksDBEngine/RocksDBEdgeIndex.cpp
@@ -81,17 +81,18 @@
   _iterator.reset(rtrx->GetIterator(state->readOptions()));
 }

-void RocksDBEdgeIndexIterator::updateBounds(StringRef fromTo) {
-  _bounds = RocksDBKeyBounds::EdgeIndexVertex(_index->_objectId, fromTo);
-  _iterator->Seek(_bounds.start());
-}
-
 RocksDBEdgeIndexIterator::~RocksDBEdgeIndexIterator() {
   if (_keys != nullptr) {
     // return the VPackBuilder to the transaction context
     _trx->transactionContextPtr()->returnBuilder(_keys.release());
   }
 }
+
+void RocksDBEdgeIndexIterator::updateBounds(StringRef fromTo) {
+  _bounds = RocksDBKeyBounds::EdgeIndexVertex(_index->_objectId, fromTo);
+  _iterator->Seek(_bounds.start());
+}
+

 StringRef getFromToFromIterator(arangodb::velocypack::ArrayIterator const& it){
   VPackSlice fromTo = it.value();


COMP (#2727): removed debug message

COMP (#2727): removed debug message

--- Core/Code/Controllers/mitkRenderingManager.cpp
+++ Core/Code/Controllers/mitkRenderingManager.cpp
@@ -602,8 +602,6 @@

 void RenderingManager::InternalViewInitialization(mitk::BaseRenderer *baseRenderer, const mitk::Geometry3D *geometry, bool boundingBoxInitialized, int mapperID )
 {
-  LOG_INFO << "internal initializing views " << (int)baseRenderer;
-
   mitk::SliceNavigationController *nc = baseRenderer->GetSliceNavigationController();

   // Re-initialize view direction


collision-validation : remove redundant variable declaration

introduced by the merge

--- src/collision-validation.cc
+++ src/collision-validation.cc
@@ -80,7 +80,6 @@
         bool firstCollision(true);
         AllCollisionsValidationReportPtr_t allReport;
         for (CollisionPairs_t::const_iterator _col = collisionPairs_.begin (); _col != collisionPairs_.end (); ++_col){
-          fcl::CollisionResult collisionResult;
           if (collide (_col, collisionRequest_, collisionResult) != 0){
             hppDout(notice,"in collision :  "<<_col->first->name()<<" / "<<_col->second->name());
             CollisionValidationReportPtr_t report (new CollisionValidationReport);


fixed problems with specularities

fixed problems with specularities

--- src/vtkSbrCamera.cc
+++ src/vtkSbrCamera.cc
@@ -67,7 +67,8 @@
   float vdc_vals[6];
   fd = ren->GetFd();
   vtkMatrix4x4 matrix;
-
+  float *pos;
+
   // get the background color
   background = ren->GetBackground();
   // get size info
@@ -77,7 +78,7 @@

   // find out if we should stereo render
   stereo = cam->GetStereo();
-
+
   // set this renderer's viewport, must turn off z-buffering when changing
   // viewport
   hidden_surface(fd, FALSE, FALSE);
@@ -183,5 +184,8 @@
   // insert model transformation
   view_matrix3d(fd, (float (*)[4])(matrix[0]),REPLACE_VW);

+  pos = cam->GetPosition();
+  viewpoint(fd,POSITIONAL,pos[0],pos[1],pos[2]);
+
   clip_depth(fd,0.0,1.0);
 }


Added #if PV_USE_MPI guards so that PV can compile without MPI compiler.

git-svn-id: 602a26e73ae9f2a14e2bb95676f2e137fcc39919@8447 7c0444ca-5550-0410-9008-faecdbe78eb5

--- src/columns/buildandrun.cpp
+++ src/columns/buildandrun.cpp
@@ -505,7 +505,9 @@
          fprintf(stderr, "    Use ANNLayer with parameter triggerFlag set to true\n");
          fprintf(stderr, "    and triggerLayerName set to the triggering layer.\n");
       }
+#if PV_USE_MPI
       MPI_Barrier(hc->icCommunicator()->communicator());
+#endif
       exit(EXIT_FAILURE);
    }
    if( !strcmp(classkeyword, "ConstantLayer") ) {


Move the setPoseListenerFrames() after connect to Tango Service.

--- motion-tracking-jni-example/jni/tango_data.cpp
+++ motion-tracking-jni-example/jni/tango_data.cpp
@@ -15,7 +15,6 @@
  */

 #include "tango_data.h"
-const TangoCoordinateFramePair tango_frame_pairs_[]={{TANGO_COORDINATE_FRAME_START_OF_SERVICE,TANGO_COORDINATE_FRAME_DEVICE}};
 TangoData::TangoData()
     : config_(nullptr),
       tango_position_(glm::vec3(0.0f, 0.0f, 0.0f)),
@@ -71,18 +70,6 @@
     LOGI("TangoService_connectOnPoseAvailable(): Failed");
     return false;
   }
-
-//  std::list<TangoCoordinateFramePair> list;
-//  TangoCoordinateFramePair frame_pair;
-//  frame_pair.base = TANGO_COORDINATE_FRAME_START_OF_SERVICE;
-//  frame_pair.target = TANGO_COORDINATE_FRAME_DEVICE;
-//  list.push_back(frame_pair);
-
-  if(TangoService_setPoseListenerFrames(1, tango_frame_pairs_)!=0){
-    LOGE("TangoService_setPoseListenerFrames(): Failed");
-    return false;
-  }
-
   return true;
 }

@@ -111,6 +98,15 @@
     LOGE("TangoService_connect(): Failed");
     return false;
   }
+
+//Set the reference frame pair after connect to service.
+  TangoCoordinateFramePair pairs;
+  pairs.base = TANGO_COORDINATE_FRAME_START_OF_SERVICE;
+  pairs.target = TANGO_COORDINATE_FRAME_DEVICE;
+  if (TangoService_setPoseListenerFrames(1, &pairs) != 0) {
+    LOGE("TangoService_setPoseListenerFrames(): Failed");
+    return false;
+  }
   return true;
 }

@@ -127,7 +123,7 @@
   return tango_rotation_;
 }

-char TangoData::GetTangoPoseStatus(){
+char TangoData::GetTangoPoseStatus() {
   switch (status_) {
     case TANGO_POSE_INITIALIZING:
       return 1;


Replace QGroundControl with APM Planner in Warning/Error messages

--- src/comm/MAVLinkProtocol.cc
+++ src/comm/MAVLinkProtocol.cc
@@ -233,7 +233,7 @@
             warnedUser = true;
             // Obviously the user tries to use a 0.9 autopilot
             // with QGroundControl built for version 1.0
-            emit protocolStatusMessage("MAVLink Version or Baud Rate Mismatch", "Your MAVLink device seems to use the deprecated version 0.9, while QGroundControl only supports version 1.0+. Please upgrade the MAVLink version of your autopilot. If your autopilot is using version 1.0, check if the baud rates of QGroundControl and your autopilot are the same.");
+            emit protocolStatusMessage("MAVLink Version or Baud Rate Mismatch", "Your MAVLink device seems to use the deprecated version 0.9, while APM Planner only supports version 1.0+. Please upgrade the MAVLink version of your autopilot. If your autopilot is using version 1.0, check if the baud rates of APM Planner and your autopilot are the same.");
         }

         if (decodeState == 0 && !decodedFirstPacket)
@@ -251,7 +251,7 @@
                 else
                 {
                     warnedUserNonMavlink = true;
-                    emit protocolStatusMessage("MAVLink Baud Rate Mismatch", "Please check if the baud rates of QGroundControl and your autopilot are the same.");
+                    emit protocolStatusMessage("MAVLink Baud Rate Mismatch", "Please check if the baud rates of APM Planner and your autopilot are the same.");
                 }
             }
         }
@@ -397,8 +397,8 @@
                     // Bring up dialog to inform user
                     if (!versionMismatchIgnore)
                     {
-                        emit protocolStatusMessage(tr("The MAVLink protocol version on the MAV and QGroundControl mismatch!"),
-                                                   tr("It is unsafe to use different MAVLink versions. QGroundControl therefore refuses to connect to system %1, which sends MAVLink version %2 (QGroundControl uses version %3).").arg(message.sysid).arg(heartbeat.mavlink_version).arg(MAVLINK_VERSION));
+                        emit protocolStatusMessage(tr("The MAVLink protocol version on the MAV and APM Planner mismatch!"),
+                                                   tr("It is unsafe to use different MAVLink versions. APM Planner therefore refuses to connect to system %1, which sends MAVLink version %2 (APM Planner uses version %3).").arg(message.sysid).arg(heartbeat.mavlink_version).arg(MAVLINK_VERSION));
                         versionMismatchIgnore = true;
                     }


winlauncher: updated PATH modification order: jbr folders and then current PATH

GitOrigin-RevId: 405c7644e51a86fc0898d0a2c563075214f364e5


wl1804 - ndb - removed debug printout

wl1804 - ndb - removed debug printout

--- ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+++ ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
@@ -1906,7 +1906,6 @@
         else
 	{
           Uint32 tmp = ((argLen + 3) >> 2) + 1;
-	  ndbout_c("tmp = %d", tmp);
           TprogramCounter += tmp;
         }
 	break;


Disable LoadState net unittest: it's flakey

BUG=16881

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@20820 4ff67af0-8c30-449e-8e8b-ad334ec8d88c


Removed comment I accidentally left in

Removed comment I accidentally left in

--- soccer/MainWindow.cpp
+++ soccer/MainWindow.cpp
@@ -709,7 +709,6 @@

     for (int i = 1; i < 17; i++) {
         // This will need to change if the max number of robots changes
-        //.stdString()
         if (std::find(validIds.begin(), validIds.end(), i - 1) !=
             validIds.end()) {
             // The list starts with None so i is 1 higher than the shell id
@@ -717,7 +716,6 @@
         } else {
             _ui.goalieID->setItemData(i, false, Qt::UserRole - 1);
         }
-        // std::cout<<_ui.goalieID->itemText(i).toStdString();
     }

     if (haveExternalReferee && _autoExternalReferee) {


updating, even if it is not working... will fiddle further

git-svn-id: e76dbe14710aecee1ad27675521492cea2578c83@1813 02a645c2-efd0-11dd-984d-ab748d24aa7e

--- test_problems/statmech/statmech_transport.cpp
+++ test_problems/statmech/statmech_transport.cpp
@@ -33,14 +33,9 @@
   try
     {
       int k;
-      IdealGasMix g("test_stat_trans.xml");
+      IdealGasMix g("test_stat_trans.xml", "example");
       int nsp = g.nSpecies();
       double pres = 1.0E5;
-
-      // init pecos transport
-      int log_level = 0;
-      Transport * tran = newTransportMgr("Pecos", &g, log_level=0);
-      PecosTransport * tranMix = dynamic_cast<PecosTransport *>(tran);

       vector_fp Xset(nsp, 0.0);
       Xset[0] =  0.5 ;
@@ -48,6 +43,14 @@

       g.setState_TPX(1500.0, pres, DATA_PTR(Xset));
       equilibrate(g, "TP", -1);
+
+      // init pecos transport
+      int log_level = 0;
+      Transport * tran = newTransportMgr("Pecos", &g, log_level=0);
+      PecosTransport * tranMix = dynamic_cast<PecosTransport *>(tran);
+
+      cout << "here";
+

       vector_fp cp_R(nsp, 0.0);
       g.getCp_R(DATA_PTR(cp_R));


Only pass the object to BuildRealData() if the inspector has one.

--- core/meta/src/TClass.cxx
+++ core/meta/src/TClass.cxx
@@ -701,7 +701,11 @@
                      if (wantBuild) valcl->BuildRealData(0, isTransient);
                   }
                } else {
-                  dmclass->BuildRealData(const_cast<void*>(add ? add : 0), isTransient);
+                  void* addrForRecursion = 0;
+                  if (GetObjectValidity() == kValidObjectGiven)
+                     addrForRecursion = const_cast<void*>(add);
+
+                  dmclass->BuildRealData(addrForRecursion, isTransient);
                }
             }
          }


CrashHandler calls strsignal on linux

CrashHandler calls strsignal on linux

R=mtklein@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/349623004

--- tools/CrashHandler.cpp
+++ tools/CrashHandler.cpp
@@ -48,7 +48,7 @@
     void* stack[kMax];
     const int count = backtrace(stack, kMax);

-    SkDebugf("\nSignal %d:\n", sig);
+    SkDebugf("\nSignal %d [%s]:\n", sig, strsignal(sig));
     backtrace_symbols_fd(stack, count, 2/*stderr*/);

     // Exit NOW.  Don't notify other threads, don't call anything registered with atexit().


removed defaults HTTP ports from URL

removed defaults HTTP ports from URL

--- src/Base.hh
+++ src/Base.hh
@@ -294,7 +294,9 @@
     return sprintf('%s://%s%s%s',
       'https',
       EnvProvider::get('SERVER_NAME'),
-      EnvProvider::has('SERVER_PORT') ?
+      EnvProvider::has('SERVER_PORT') &&
+      EnvProvider::get('SERVER_PORT') != 443 &&
+      EnvProvider::get('SERVER_PORT') != 80 ?
         ':' . EnvProvider::get('SERVER_PORT') :
         '',
       idx($_SERVER, 'REQUEST_URI'));


Added hack to eliminate one false-positive collision.

--- grand_structure_visualizer/grand_structure.cpp
+++ grand_structure_visualizer/grand_structure.cpp
@@ -587,6 +587,14 @@
       const vector3<distance> end2 = approx_loc_of_triple_intersection_of_up_to_date_faces(
         e1, e2, faces_[e1.neighboring_faces_[next_neighbor_idx]].updated_to_time(t));

+      // Hack - sometimes the line can read as right in some dimensions and wrong in others.
+      // This mostly happens if a face is very nearly parallel to one of the lines.
+      // If it does, eliminate it rather than including it, because it might be wrong and isn't super important if it's right.
+      if ((((end1.x-approx_cross_location.x) * (end2.x-approx_cross_location.x)) > 0)
+        || (((end1.y-approx_cross_location.y) * (end2.y-approx_cross_location.y)) > 0)
+        || (((end1.z-approx_cross_location.z) * (end2.z-approx_cross_location.z)) > 0)) {
+        return false;
+      }
       // This edge is okay if the intersection point is between the two ends of the edge.
       // We would normally have to check only one dimension. Do it for all because sometimes
       // the edge is parallel to an axis.


Fix HeeksCNC bitmaps load

Fix HeeksCNC bitmaps load

HeeksCNC could now found more resources when HeeksCNC have been built with another prefix than /usr

--- src/HeeksCNC.cpp
+++ src/HeeksCNC.cpp
@@ -1382,12 +1382,18 @@
   #endif
 #else
   #ifdef CMAKE_UNIX
-	return (_T("/usr/share/heekscnc"));
-  #else
+	// Unix
+    #if wxCHECK_VERSION(3, 0, 0)
+	wxStandardPaths& sp = wxStandardPaths::Get();
+    #else
+	wxStandardPaths sp;
+    #endif
+	return (sp.GetInstallPrefix() + wxT("/share/heekscnc"));
+  #else // CMAKE_UNIX
+	// Windows
 	return (m_dll_path + _T("/../../share/heekscnc"));
-	//return sp.GetResourcesDir();
-  #endif
-#endif
+  #endif // CMAKE_UNIX
+#endif // defined(WIN32) || defined(RUNINPLACE)
 }

 wxString CHeeksCNCApp::GetResourceFilename(const wxString resource, const bool writableOnly) const


added rational binary funcs

added rational binary funcs

--- src/builtin_numeric.cc
+++ src/builtin_numeric.cc
@@ -151,9 +151,10 @@
   }
 }

-template<typename IFun, typename RFun, typename CFun>
+template<typename IFun, typename QFun, typename RFun, typename CFun>
 Lisp_ptr number_binary(Lisp_ptr arg1, Lisp_ptr arg2,
-                       const char* name, const IFun& ifun,
+                       const char* name,
+                       const IFun& ifun, const QFun& qfun,
                        const RFun& rfun, const CFun& cfun){
   if(!is_numeric_type(arg1)){
     throw number_type_check_failed(name, arg1);
@@ -166,6 +167,9 @@
   if(is_integer_type(arg1) && is_integer_type(arg2)){
     return wrap_number(ifun(coerce<int>(arg1),
                             coerce<int>(arg2)));
+  }else if(is_rational_type(arg1) && is_rational_type(arg2)){
+    return wrap_number(qfun(coerce<Rational>(arg1),
+                            coerce<Rational>(arg2)));
   }else if(is_real_type(arg1) && is_real_type(arg2)){
     return wrap_number(rfun(coerce<double>(arg1),
                             coerce<double>(arg2)));
@@ -177,23 +181,24 @@
   }
 }

-template<typename IFun, typename RFun, typename CFun, typename Iter>
+template<typename IFun, typename QFun, typename RFun, typename CFun, typename Iter>
 Lisp_ptr number_fold(const Iter& args_begin, const Iter& args_end,
-                     Lisp_ptr init,
-                     const char* name, const IFun& ifun,
+                     Lisp_ptr init, const char* name,
+                     const IFun& ifun, const QFun& qfun,
                      const RFun& rfun, const CFun& cfun){
   auto acc = init;

   for(auto i = args_begin, e = args_end; i != e; ++i){
-    acc = number_binary(acc, *i, name, ifun, rfun, cfun);
+    acc = number_binary(acc, *i, name, ifun, qfun, rfun, cfun);
   }

   return acc;
 }

-template<typename IFun, typename RFun, typename CFun, typename Iter>
+template<typename IFun, typename QFun, typename RFun, typename CFun, typename Iter>
 Lisp_ptr number_all_2(const Iter& args_begin, const Iter& args_end,
-                      const char* name, const IFun& ifun,
+                      const char* name,
+                      const IFun& ifun, const QFun& qfun,
                       const RFun& rfun, const CFun& cfun){
   auto i1 = args_begin;
   auto i2 = next(i1);
@@ -210,6 +215,10 @@

     if(is_integer_type(*i1) && is_integer_type(*i2)){
       if(!ifun(coerce<int>(*i1), coerce<int>(*i2))){
+        return Lisp_ptr{false};
+      }
+    }else if(is_rational_type(*i1) && is_rational_type(*i2)){
+      if(!qfun(coerce<Rational>(*i1), coerce<Rational>(*i2))){
         return Lisp_ptr{false};
       }
     }else if(is_real_type(*i1) && is_real_type(*i2)){
@@ -317,6 +326,7 @@
 Lisp_ptr number_equal(ZsArgs args){
   return number_all_2(begin(args), end(args), "=",
                       equal_to<int>(),
+                      equal_to<Rational>(),
                       equal_to<double>(),
                       equal_to<Complex>());
 }
@@ -324,6 +334,7 @@
 Lisp_ptr number_less(ZsArgs args){
   return number_all_2(begin(args), end(args), "<",
                       less<int>(),
+                      less<Rational>(),
                       less<double>(),
                       inacceptable_number_type());
 }
@@ -331,6 +342,7 @@
 Lisp_ptr number_greater(ZsArgs args){
   return number_all_2(begin(args), end(args), ">",
                       greater<int>(),
+                      greater<Rational>(),
                       greater<double>(),
                       inacceptable_number_type());
 }
@@ -338,6 +350,7 @@
 Lisp_ptr number_less_eq(ZsArgs args){
   return number_all_2(begin(args), end(args), "<=",
                       less_equal<int>(),
+                      less_equal<Rational>(),
                       less_equal<double>(),
                       inacceptable_number_type());
 }
@@ -345,6 +358,7 @@
 Lisp_ptr number_greater_eq(ZsArgs args){
   return number_all_2(begin(args), end(args), ">",
                       greater_equal<int>(),
+                      greater_equal<Rational>(),
                       greater_equal<double>(),
                       inacceptable_number_type());
 }
@@ -354,6 +368,7 @@
   return number_fold(next(args.begin()), args.end(),
                      args[0], "max",
                      [](int i1, int i2){ return max(i1, i2); },
+                     [](Rational q1, Rational q2){ return max(q1, q2); },
                      [](double d1, double d2){ return max(d1, d2); },
                      inacceptable_number_type());
 }
@@ -362,6 +377,7 @@
   return number_fold(next(args.begin()), args.end(),
                      args[0], "min",
                      [](int i1, int i2){ return min(i1, i2); },
+                     [](Rational q1, Rational q2){ return min(q1, q2); },
                      [](double d1, double d2){ return min(d1, d2); },
                      inacceptable_number_type());
 }
@@ -370,6 +386,7 @@
   return number_fold(begin(args), end(args),
                      Lisp_ptr{Ptr_tag::integer, 0}, "+",
                      integer_overflow_check_binary<std::plus>(),
+                     plus<Rational>(),
                      plus<double>(),
                      plus<Complex>());
 }
@@ -378,6 +395,7 @@
   return number_fold(begin(args), end(args),
                      Lisp_ptr{Ptr_tag::integer, 1}, "*",
                      integer_overflow_check_binary<std::multiplies>(),
+                     multiplies<Rational>(),
                      multiplies<double>(),
                      multiplies<Complex>());
 }
@@ -397,6 +415,7 @@
     return number_fold(next(args.begin()), args.end(),
                        args[0], "-",
                        integer_overflow_check_binary<std::minus>(),
+                       minus<Rational>(),
                        minus<double>(),
                        minus<Complex>());
   }
@@ -431,6 +450,7 @@
                            ? wrap_number(static_cast<double>(i1) / i2)
                            : wrap_number(i1 / i2);
                        },
+                       divides<Rational>(),
                        divides<double>(),
                        divides<Complex>());
   }
@@ -439,6 +459,7 @@
 Lisp_ptr number_quot(ZsArgs args){
   return number_binary(args[0], args[1], "quotient",
                        divides<int>(),
+                       inacceptable_number_type(),
                        inacceptable_number_type(),
                        inacceptable_number_type());
 }
@@ -450,6 +471,7 @@
                          return i1 - (q * i2);
                        },
                        inacceptable_number_type(),
+                       inacceptable_number_type(),
                        inacceptable_number_type());
 }

@@ -464,6 +486,7 @@
                            return m;
                          }
                        },
+                       inacceptable_number_type(),
                        inacceptable_number_type(),
                        inacceptable_number_type());
 }
@@ -475,6 +498,7 @@
                        return gcd(i1, i2);
                      },
                      inacceptable_number_type(),
+                     inacceptable_number_type(),
                      inacceptable_number_type());
 }

@@ -484,6 +508,7 @@
                      [](int i1, int i2){
                        return abs(i1 * i2 / gcd(i1, i2));
                      },
+                     inacceptable_number_type(),
                      inacceptable_number_type(),
                      inacceptable_number_type());
 }
@@ -618,6 +643,9 @@
                          [](int i1, int i2) -> double {
                            return std::atan2(i1, i2);
                          },
+                         [](Rational q1, Rational q2){
+                           return std::atan2(static_cast<double>(q1), static_cast<double>(q2));
+                         },
                          [](double d1, double d2){
                            return std::atan2(d1, d2);
                          },
@@ -641,6 +669,9 @@
                        [](int i1, int i2) -> double {
                          return std::pow(i1, i2);
                        },
+                       [](Rational q1, Rational q2){
+                         return std::pow(static_cast<double>(q1), static_cast<double>(q2));
+                       },
                        [](double n1, double n2){
                          return std::pow(n1, n2);
                        },
@@ -653,6 +684,9 @@
   return number_binary(args[0], args[1], "make-rectangular",
                        [](int i1, int i2){
                          return Complex(i1, i2);
+                       },
+                       [](Rational q1, Rational q2){
+                         return Complex(static_cast<double>(q1), static_cast<double>(q2));
                        },
                        [](double n1, double n2){
                          return Complex(n1, n2);
@@ -665,6 +699,9 @@
                        [](int i1, int i2){
                          return polar(static_cast<double>(i1),
                                       static_cast<double>(i2));
+                       },
+                       [](Rational q1, Rational q2){
+                         return polar(static_cast<double>(q1), static_cast<double>(q2));
                        },
                        [](double n1, double n2){
                          return polar(n1, n2);


Use Error() instead of assert()

Use Error() instead of assert()

As requested by Axel: Users might happen to call this as TClass::GetClass(""); we should be "nice" and return an error then instead of going on in release or terminating in debug.

--- core/meta/src/TClass.cxx
+++ core/meta/src/TClass.cxx
@@ -1328,8 +1328,8 @@
 {
    if (!gROOT)
       ::Fatal("TClass::TClass", "ROOT system not initialized");
-
-   assert(name != 0 && strlen(name) != 0 || 0 == "TClass::Init, the name parameter is invalid (null or empty)");
+   if (!name || !name[0])
+      ::Error("TClass::Init", "The name parameter is invalid (null or empty)");

    // Always strip the default STL template arguments (from any template argument or the class name)
    fName           = TClassEdit::ShortType(name, TClassEdit::kDropStlDefault).c_str();


prevent out() to yield to outError()

prevent out() to yield to outError()

--- src/Base.hh
+++ src/Base.hh
@@ -82,30 +82,35 @@
   }

   private function out() {
-    if ($this instanceof BasePreprocessController) {
-      $this->render();
-    } elseif ($this->isXHR() || $this->isJSONForced()) {
-      $view = $this->renderJSON();
-      $view->render();
-    } else {
-      $layout = $this->render();
-      // Pre-render layout in order to trigger widgets' CSSs and JSs
-      $layout->__toString();
-      if (method_exists($layout, 'hasSection')) {
-        if ($layout->hasSection('stylesheets')) {
-          foreach (BaseLayoutHelper::stylesheets() as $css) {
-            $layout->section('stylesheets')->appendChild($css);
+    try {
+      if ($this instanceof BasePreprocessController) {
+        $this->render();
+      } elseif ($this->isXHR() || $this->isJSONForced()) {
+        $view = $this->renderJSON();
+        $view->render();
+      } else {
+        $layout = $this->render();
+        // Pre-render layout in order to trigger widgets' CSSs and JSs
+        $layout->__toString();
+        if (method_exists($layout, 'hasSection')) {
+          if ($layout->hasSection('stylesheets')) {
+            foreach (BaseLayoutHelper::stylesheets() as $css) {
+              $layout->section('stylesheets')->appendChild($css);
+            }
+          }
+
+          if ($layout->hasSection('javascripts')) {
+            foreach (BaseLayoutHelper::javascripts() as $js) {
+              $layout->section('javascripts')->appendChild($js);
+            }
           }
         }

-        if ($layout->hasSection('javascripts')) {
-          foreach (BaseLayoutHelper::javascripts() as $js) {
-            $layout->section('javascripts')->appendChild($js);
-          }
-        }
-      }
-
-      echo $layout;
+        echo $layout;
+      }
+    } catch (Exception $e) {
+      l($e);
+      die;
     }
   }

@@ -395,9 +400,10 @@
       BaseParam::StringType('path_info')
     ];
   }
+
   public function render() {
     $this->status(404);
-    echo
Not Found: {$this->param('path_info')}
;
+    return
Not Found: {$this->param('path_info')}
;
   }
 }


Reset toolbar layout for Linux

Reset toolbar layout for Linux


Performance optimization for embree, resizing arrays once instead of per object.

--- src/bvh/bvh_embree.cpp
+++ src/bvh/bvh_embree.cpp
@@ -389,6 +389,45 @@
 	               (params.use_spatial_split ? RTC_BUILD_QUALITY_HIGH : RTC_BUILD_QUALITY_MEDIUM);
 	rtcSetSceneBuildQuality(scene, build_quality);

+	/* Count triangles and curves first, reserve arrays once. */
+	size_t prim_count = 0;
+
+	foreach(Object *ob, objects) {
+		if (params.top_level) {
+			if (!ob->is_traceable()) {
+				continue;
+			}
+			if (!ob->mesh->is_instanced()) {
+				if(params.primitive_mask & PRIMITIVE_ALL_TRIANGLE) {
+					prim_count += ob->mesh->num_triangles();
+				}
+				if (params.primitive_mask & PRIMITIVE_ALL_CURVE) {
+					for (size_t j = 0; j < ob->mesh->num_curves(); ++j) {
+						prim_count += ob->mesh->get_curve(j).num_segments();
+					}
+				}
+			}
+			else {
+				++prim_count;
+			}
+		}
+		else {
+			if (params.primitive_mask & PRIMITIVE_ALL_TRIANGLE && ob->mesh->num_triangles() > 0) {
+				prim_count += ob->mesh->num_triangles();
+			}
+			if (params.primitive_mask & PRIMITIVE_ALL_CURVE) {
+				for (size_t j = 0; j < ob->mesh->num_curves(); ++j) {
+					prim_count += ob->mesh->get_curve(j).num_segments();
+				}
+			}
+		}
+	}
+
+	pack.prim_object.reserve(prim_count);
+	pack.prim_type.reserve(prim_count);
+	pack.prim_index.reserve(prim_count);
+	pack.prim_tri_index.reserve(prim_count);
+
 	int i = 0;

 	pack.object_node.clear();
@@ -530,15 +569,20 @@

 	update_tri_vertex_buffer(geom_id, mesh);

-	pack.prim_object.reserve(pack.prim_object.size() + num_triangles);
-	pack.prim_type.reserve(pack.prim_type.size() + num_triangles);
-	pack.prim_index.reserve(pack.prim_index.size() + num_triangles);
-	pack.prim_tri_index.reserve(pack.prim_index.size() + num_triangles);
+	size_t prim_object_size = pack.prim_object.size();
+	pack.prim_object.resize(prim_object_size + num_triangles);
+	size_t prim_type_size = pack.prim_type.size();
+	pack.prim_type.resize(prim_type_size + num_triangles);
+	size_t prim_index_size = pack.prim_index.size();
+	pack.prim_index.resize(prim_index_size + num_triangles);
+	pack.prim_tri_index.resize(prim_index_size + num_triangles);
+	int prim_type = (num_motion_steps > 1 ? PRIMITIVE_MOTION_TRIANGLE : PRIMITIVE_TRIANGLE);
+
 	for(size_t j = 0; j < num_triangles; ++j) {
-		pack.prim_object.push_back_reserved(i);
-		pack.prim_type.push_back_reserved(num_motion_steps > 1 ? PRIMITIVE_MOTION_TRIANGLE : PRIMITIVE_TRIANGLE);
-		pack.prim_index.push_back_reserved(j);
-		pack.prim_tri_index.push_back_reserved(j);
+		pack.prim_object[prim_object_size + j] = i;
+		pack.prim_type[prim_type_size + j] = prim_type;
+		pack.prim_index[prim_index_size + j] = j;
+		pack.prim_tri_index[prim_index_size + j] = j;
 	}

 	rtcSetGeometryUserData(geom_id, (void*) prim_offset);
@@ -629,7 +673,7 @@
 		float4 *rtc_tangents = NULL;
 		if(use_curves) {
 			rtc_tangents = (float4*)rtcSetNewGeometryBuffer(geom_id, RTC_BUFFER_TYPE_TANGENT, t,
-																RTC_FORMAT_FLOAT4, sizeof (float) * 4, num_keys);
+			                                                RTC_FORMAT_FLOAT4, sizeof (float) * 4, num_keys);
 			assert(rtc_tangents);
 		}
 		assert(rtc_verts);
@@ -691,10 +735,14 @@
 	}

 	/* Make room for Cycles specific data. */
-	pack.prim_object.reserve(pack.prim_object.size() + num_segments);
-	pack.prim_type.reserve(pack.prim_type.size() + num_segments);
-	pack.prim_index.reserve(pack.prim_index.size() + num_segments);
-	pack.prim_tri_index.reserve(pack.prim_index.size() + num_segments);
+	size_t prim_object_size = pack.prim_object.size();
+	pack.prim_object.resize(prim_object_size + num_segments);
+	size_t prim_type_size = pack.prim_type.size();
+	pack.prim_type.resize(prim_type_size + num_segments);
+	size_t prim_index_size = pack.prim_index.size();
+	pack.prim_index.resize(prim_index_size + num_segments);
+	size_t prim_tri_index_size = pack.prim_index.size();
+	pack.prim_tri_index.resize(prim_tri_index_size + num_segments);

 	enum RTCGeometryType type = (!use_curves) ? RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE :
 	                            (use_ribbons ? RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE :
@@ -703,18 +751,18 @@
 	RTCGeometry geom_id = rtcNewGeometry(rtc_shared_device, type);
 	rtcSetGeometryTessellationRate(geom_id, curve_subdivisions);
 	unsigned *rtc_indices = (unsigned*) rtcSetNewGeometryBuffer(geom_id, RTC_BUFFER_TYPE_INDEX, 0,
-																RTC_FORMAT_UINT, sizeof (int), num_segments);
+	                                                            RTC_FORMAT_UINT, sizeof (int), num_segments);
 	size_t rtc_index = 0;
 	for(size_t j = 0; j < num_curves; ++j) {
 		Mesh::Curve c = mesh->get_curve(j);
 		for(size_t k = 0; k < c.num_segments(); ++k) {
 			rtc_indices[rtc_index] = c.first_key + k;
 			/* Cycles specific data. */
-			pack.prim_object.push_back_reserved(i);
-			pack.prim_type.push_back_reserved(PRIMITIVE_PACK_SEGMENT(num_motion_steps > 1 ?
-																	 PRIMITIVE_MOTION_CURVE : PRIMITIVE_CURVE, k));
-			pack.prim_index.push_back_reserved(j);
-			pack.prim_tri_index.push_back_reserved(rtc_index);
+			pack.prim_object[prim_object_size + rtc_index] = i;
+			pack.prim_type[prim_type_size + rtc_index] = (PRIMITIVE_PACK_SEGMENT(num_motion_steps > 1 ?
+			                                              PRIMITIVE_MOTION_CURVE : PRIMITIVE_CURVE, k));
+			pack.prim_index[prim_index_size + rtc_index] = j;
+			pack.prim_tri_index[prim_tri_index_size + rtc_index] = rtc_index;

 			++rtc_index;
 		}


S60: Swap spacers in device run config widget.

--- src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.cpp
+++ src/plugins/qt4projectmanager/qt-s60/s60devicerunconfigurationwidget.cpp
@@ -93,8 +93,8 @@
     // Serial devices control
     connect(m_serialPortsCombo, SIGNAL(activated(int)), this, SLOT(setSerialPort(int)));
     QHBoxLayout *serialPortHBoxLayout = new QHBoxLayout;
+    serialPortHBoxLayout->addWidget(m_serialPortsCombo);
     serialPortHBoxLayout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Ignored));
-    serialPortHBoxLayout->addWidget(m_serialPortsCombo);

     formLayout->addRow(tr("Device on Serial Port:"), serialPortHBoxLayout);


Do not lookup by name when unloading but by DeclId_t.

Fixes spurrious, occasional (platform-specific) failures in
roottest/cling/reload/reloadvector:
Trying to unloading the global function reloadvector(), the callback told TCling
that an unload was about to happen.
TCling called FindObject("reloadvector") which (on some platforms) created new
elements and (sometimes) deserialized decls, which in turn appended a new
transaction which then failed the assert that the transaction to be unloaded is
indeed the last one - because a new one was appended in the meantime.

--- core/meta/src/TCling.cxx
+++ core/meta/src/TCling.cxx
@@ -5434,10 +5434,9 @@
          if ( (*DI)->isFromASTFile() )
             continue;

-         // Deal with global variables and globa enum constants.
+         // Deal with global variables and global enum constants.
          if (isa<VarDecl>(*DI) || isa<EnumConstantDecl>(*DI)) {
-            clang::ValueDecl* VD = dyn_cast<ValueDecl>(*DI);
-            TObject *obj = globals->FindObject(VD->getNameAsString().c_str());
+            TObject *obj = globals->Find((TListOfDataMembers::DeclId_t)*DI);
             if (globals->GetClass()) {
                TDataMember* var = dynamic_cast<TDataMember*>(obj);
                if (var && var->IsValid()) {
@@ -5455,7 +5454,7 @@
             }
          // Deal with global functions.
          } else if (const FunctionDecl* FD = dyn_cast<FunctionDecl>(*DI)) {
-            TFunction* function = (TFunction*)functions->FindObject(FD->getNameAsString().c_str());
+            TFunction* function = (TFunction*)functions->Find((TListOfFunctions::DeclId_t)FD);
             if (function && function->IsValid()) {
                functions->Unload(function);
                function->Update(0);
@@ -5469,8 +5468,7 @@
             }
          // Deal with global enums.
          } else if (const EnumDecl* ED = dyn_cast<EnumDecl>(*DI)) {
-            TEnum* e = (TEnum*)enums->FindObject(ED->getNameAsString().c_str());
-            if (e) {
+            if (TEnum* e = (TEnum*)enums->Find((TListOfEnums::DeclId_t)ED)) {
                globals = (TListOfDataMembers*)gROOT->GetListOfGlobals();
                TIter iEnumConst(e->GetConstants());
                while (TEnumConstant* enumConst = (TEnumConstant*)iEnumConst()) {


it's a request

it's a request

git-svn-id: 67bf12f30ddf2081c31403e0b02b2123541f1680@3940 08b3d480-bf2c-0410-a26f-811ee3361c24

--- src/bzflag/playing.cxx
+++ src/bzflag/playing.cxx
@@ -5216,7 +5216,7 @@
 	break;
       }
       case MsgUDPLinkRequest:
-	printError("*** Received UDP Link Granted");
+	printError("*** Received UDP Link Request");
 	// internally
 	break;
       case MsgSetVar: {


Litecoin:  Copyright fuzzer

Litecoin:  Copyright fuzzer

--- src/util/system.cpp
+++ src/util/system.cpp
@@ -1286,9 +1286,11 @@

     // Make sure Bitcoin Core copyright is not removed by accident
     if (copyright_devs.find("Bitcoin Core") == std::string::npos) {
-        std::string strYear = strPrefix;
-        strYear.replace(strYear.find("2011"), sizeof("2011")-1, "2009");
-        strCopyrightHolders += "\n" + strYear + "The Bitcoin Core developers";
+        if (strPrefix.find("2011") != std::string::npos) {
+            std::string strYear = strPrefix;
+            strYear.replace(strYear.find("2011"), sizeof("2011")-1, "2009");
+            strCopyrightHolders += "\n" + strYear + "The Bitcoin Core developers";
+        }
     }
     return strCopyrightHolders;
 }


[aura] Stop accelerators that are not allowed on login screen from working on user image screen.

BUG=143218

Review URL: https://chromiumcodereview.appspot.com/10823394

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@152337 0039d316-1c4b-4281-b951-d872f2087c98

--- ash/accelerators/accelerator_controller.cc
+++ ash/accelerators/accelerator_controller.cc
@@ -370,7 +370,7 @@
   ash::Shell* shell = ash::Shell::GetInstance();
   bool at_login_screen = false;
 #if defined(OS_CHROMEOS)
-  at_login_screen = (shell->delegate() && !shell->delegate()->IsUserLoggedIn());
+  at_login_screen = shell->delegate() && !shell->delegate()->IsSessionStarted();
 #endif
   bool at_lock_screen = shell->IsScreenLocked();


added enum type functionality to GetJSONGeometry

--- src/nodeFinder.cpp
+++ src/nodeFinder.cpp
@@ -737,22 +737,34 @@
 NAN_METHOD(Finder::GetJSONGeometry) {
     Finder* find = Nan::ObjectWrap::Unwrap<Finder>(info.This());

-    if (info.Length() != 2)
-    return;
-    if (info[0]->IsUndefined())
-    return;
-    if (info[1]->IsUndefined())
+    if (!info.Length() != 2)
+    return;
+    if (info[0]->IsUndefined())
     return;
     if (!info[0]->IsString())
     return;
-    if(!info[1]->IsInt32())
-    return;
+
+    char * type = 0;
+    if(info[1]->IsUndefined() || !info[1]->IsString())
+        type = "";
+    else
+        v8StringToChar(info[1], type);
+
+    int typ = -1;
+    if(strcmp(type, "MESH"))
+        typ = 1;
+    else if(strcmp(type, "POLYLINE"))
+        typ = 2;
+    else if(strcmp(type, "INPROCESS"))
+        typ = 3;
+    else
+        typ = 0;

     char * uuid = 0;
     v8StringToChar(info[0], uuid);
     char * json = 0;
     Nan::Maybe<int32_t> t = Nan::To<int32_t>(info[1]);
-    if (!find->_find->geometry_as_json((const char *)uuid, t.FromJust(), (char* &)json))
+    if (!find->_find->geometry_as_json((const char *)uuid, typ, (char* &)json))
     return;

     info.GetReturnValue().Set(CharTov8String((char *)json));
@@ -767,7 +779,7 @@
     return;
     if (info[0]->IsUndefined())
     return;
-    if (!info[0]->IsInt32())
+    if (!info[0]->IsString())
     return;

     char * json = 0;


bumped version

bumped version

--- mconfig.cpp
+++ mconfig.cpp
@@ -863,7 +863,7 @@
 void MConfig::on_buttonAbout_clicked() {
   QMessageBox msgBox(QMessageBox::NoIcon, tr("About MX User Manager"),
     tr("

MX User Manager

MX14+git20140222

Simple user\
+      alt=\"logo\" />

MX User Manager

MX14+git20140224

Simple user\
       configuration for antiX MX

\
       http://www.mepiscommunity.org/mx

Copyright (c) antiX

"), 0, this);
   msgBox.addButton(tr("License"), QMessageBox::AcceptRole);


iox-#605 Fix clang-tidy warning by adding d'tor to PointerRepository

Signed-off-by: Simon Hoinkis <f0773326fce8fa552c28fe58d0e558a9f1b7687f@apex.ai>

--- iceoryx_hoofs/include/iceoryx_hoofs/internal/relocatable_pointer/pointer_repository.hpp
+++ iceoryx_hoofs/include/iceoryx_hoofs/internal/relocatable_pointer/pointer_repository.hpp
@@ -60,6 +60,7 @@

     /// @brief default constructor
     PointerRepository() noexcept;
+    ~PointerRepository() noexcept = default;

     PointerRepository(const PointerRepository&) = delete;
     PointerRepository(PointerRepository&&) = delete;


Do not waste time on empty string.

Do not waste time on empty string.

In TCling::AutoParse, we use GetSplit which now always return the type's trail
even when it is empty.

--- core/meta/src/TCling.cxx
+++ core/meta/src/TCling.cxx
@@ -4763,6 +4763,7 @@
    autoparseKeys.emplace_back(cls);

    for (const auto & apKeyStr : autoparseKeys) {
+      if (apKeyStr.empty()) continue;
       const char *apKey = apKeyStr.c_str();
       std::size_t normNameHash(fStringHashFunction(apKey));
       // If the class was not looked up


handle 1 char buffer correctly, fix debug statement

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@5755 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

--- DeviceAdapters/SerialManager/SerialManager.cpp
+++ DeviceAdapters/SerialManager/SerialManager.cpp
@@ -739,7 +739,7 @@
          if( anyRead)
          {
             buf[charsRead] = (unsigned char)theData;
-            if( bufLen <= charsRead++)
+            if( bufLen <= ++charsRead)
             {
                // buffer is full
                break;
@@ -752,7 +752,7 @@
          }
       }
       if( 0 < charsRead)
-         LogBinaryMessage(false, buf, charsRead, true);
+         LogBinaryMessage(true, buf, charsRead, true);
    }
    else
       r = ERR_BUFFER_OVERRUN;


quell warning, sending a negative to an unsigned

--- src/bzflag/playing.cxx
+++ src/bzflag/playing.cxx
@@ -1842,7 +1842,7 @@
       msg2 += " won the game";

       gameOver = true;
-      hud->setTimeLeft(~0);
+      hud->setTimeLeft((uint32_t)~0);
       myTank->explodeTank();
       controlPanel->addMessage(msg2);
       hud->setAlert(0, msg2.c_str(), 10.0f, true);
@@ -4151,7 +4151,7 @@
   updateHighScores();
   hud->setHeading(myTank->getAngle());
   hud->setAltitude(myTank->getPosition()[2]);
-  hud->setTimeLeft(~0);
+  hud->setTimeLeft((uint32_t)~0);
   fireButton = false;
   firstLife = true;


Call cpuid via inline asm on x86-64, so we can use it with Clang (no cpuid intrinsic) and older GCC (no cpuid.h before 4.3)

--- src/utils/cpuid.cpp
+++ src/utils/cpuid.cpp
@@ -24,9 +24,9 @@
 #elif defined(BOTAN_BUILD_COMPILER_IS_INTEL)

   #include <ia32intrin.h>
-  #define CALL_CPUID(type, out) do { __cpuid(out, type); } while(0);
-
-#elif (BOTAN_GCC_VERSION >= 430)
+  #define CALL_CPUID(type, out) do { __cpuid(out, type); } while(0)
+
+#elif defined(BOTAN_BUILD_COMPILER_IS_GCC) && (BOTAN_GCC_VERSION >= 430)

   // Only available starting in GCC 4.3
   #include <cpuid.h>
@@ -45,6 +45,20 @@
   #define CALL_CPUID call_gcc_cpuid

 }
+
+#elif defined(BOTAN_TARGET_ARCH_IS_X86_64) && \
+   (defined(BOTAN_BUILD_COMPILER_IS_CLANG) || defined(BOTAN_BUILD_COMPILER_IS_GCC))
+
+  /*
+  * We can't safely use this on x86-32 as some 32-bit ABIs use ebx as
+  * a PIC register, and in theory there are some x86-32s still out
+  * there that don't support cpuid at all; it requires strange
+  * contortions to detect them.
+  */
+
+  #define CALL_CPUID(type, out) \
+    asm("cpuid\n\t" : "=a" (out[0]), "=b" (out[1]), "=c" (out[2]), "=d" (out[3]) \
+        : "0" (type))

 #else
   #warning "No method of calling CPUID for this compiler"


INTEGRATION: CWS basemodelrefactoring (1.3.14); FILE MERGED 2007/05/30 15:21:39 mba 1.3.14.1: timestamp.hxx no longer used

--- sfx2/inc/pch/precompiled_sfx2.hxx
+++ sfx2/inc/pch/precompiled_sfx2.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: precompiled_sfx2.hxx,v $
  *
- *  $Revision: 1.3 $
- *
- *  last change: $Author: kz $ $Date: 2007-05-10 17:06:53 $
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: obo $ $Date: 2007-07-17 13:36:41 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -627,7 +627,6 @@
 #include "tools/string.hxx"
 #include "tools/table.hxx"
 #include "tools/tenccvt.hxx"
-#include "tools/timestamp.hxx"
 #include "tools/unqid.hxx"
 #include "tools/urlobj.hxx"
 #include "tools/wldcrd.hxx"


Reduce the amount of useless searches/lookups

--- core/meta/src/TCling.cxx
+++ core/meta/src/TCling.cxx
@@ -2875,8 +2875,9 @@
    if (cl->fBase) {
       return;
    }
-   TClingClassInfo tci(fInterpreter, cl->GetName());
-   TClingBaseClassInfo t(fInterpreter, &tci);
+   TClingClassInfo *tci = (TClingClassInfo *)cl->GetClassInfo();
+   if (!tci) return;
+   TClingBaseClassInfo t(fInterpreter, tci);
    // This is put here since TClingBaseClassInfo can trigger a
    // TClass::ResetCaches, which deallocates cl->fBase
    cl->fBase = new TList;
@@ -4883,7 +4884,8 @@
          return;
       }
       clang::QualType type( td->getTypeForDecl(), 0 );
-      ROOT::TMetaUtils::GetFullyQualifiedTypeName(name,type,*fInterpreter);
+
+      ROOT::TMetaUtils::GetNormalizedName(name, type, *fInterpreter, *fNormalizedCtxt);
    } else {
       name = ND->getNameAsString();
    }


Improved unit tests

Improved unit tests

--- client/test/message.cpp
+++ client/test/message.cpp
@@ -5,7 +5,7 @@

-
+#include <stdexcept>
 #include "../src/clientconsole.h"
 #include "../../include/catch.hpp"
 #include <QFile>
@@ -135,12 +135,14 @@
 };

 class TestDataSender3 {
+	Messages::MsgType expectedType;
 	std::function<void(qint64, qint64, const QByteArray &)> callback;
 public:
-	TestDataSender3(std::function<void(qint64, qint64, const QByteArray &)> cb) : callback(cb) {};
-	TestDataSender3(const TestDataSender3 & o) : callback(o.callback) {};
+	TestDataSender3(std::function<void(qint64, qint64, const QByteArray &)> cb, Messages::MsgType expectedType = Messages::MsgType::None) : callback(cb), expectedType(expectedType) {};
+	TestDataSender3(const TestDataSender3 & o) : callback(o.callback), expectedType(o.expectedType) {};

 	void operator()(Session & s, Messages::MsgType t, const Messages::ReceivedMessage & data) {
+		if (expectedType != Messages::MsgType::None && expectedType != t) throw std::runtime_error("Test: Invalid message type!");
 		QList<QByteArray> list = data.messageText.split(Messages::armaSeparator);

 		qint64 id = list[0].toLongLong();


[fuchsia] Write trace profiles for v2 components (#36186)

--- shell/platform/fuchsia/flutter/runner.cc
+++ shell/platform/fuchsia/flutter/runner.cc
@@ -398,17 +398,20 @@
         runner->prolonged_context_ = trace_acquire_prolonged_context();
         Dart_StartProfiling();
       } else if (trace_state() == TRACE_STOPPING) {
-        for (auto& it : runner->active_components_v1_) {
-          fml::AutoResetWaitableEvent latch;
-          fml::TaskRunner::RunNowOrPostTask(
-              it.second.platform_thread->GetTaskRunner(), [&]() {
-                it.second.component->WriteProfileToTrace();
-                latch.Signal();
-              });
-          latch.Wait();
-        }
-        // TODO(fxb/50694): Write v2 component profiles to trace once we're
-        // convinced they're stable.
+        auto write_profile_trace_for_components = [](auto& components) {
+          for (auto& it : components) {
+            fml::AutoResetWaitableEvent latch;
+            fml::TaskRunner::RunNowOrPostTask(
+                it.second.platform_thread->GetTaskRunner(), [&]() {
+                  it.second.component->WriteProfileToTrace();
+                  latch.Signal();
+                });
+            latch.Wait();
+          }
+        };
+        write_profile_trace_for_components(runner->active_components_v1_);
+        write_profile_trace_for_components(runner->active_components_v2_);
+
         Dart_StopProfiling();
         trace_release_prolonged_context(runner->prolonged_context_);
       }


Make the function returning the current index a property of then_execute_functor

--- agency/cuda/grid_executor.hpp
+++ agency/cuda/grid_executor.hpp
@@ -118,7 +118,7 @@
 // XXX should use empty base class optimization for this class because any of these members could be empty types
 // XXX should try to find a way to take an InnerParameterPointer instead of InnerFactory to make the way all the parameters are handled uniformly
 // XXX the problem is that the inner parameter needs to know who the leader is, and that info isn't easily passed through pointer dereference syntax
-template<class ContainerPointer, class Function, class PastParameterPointer, class OuterParameterPointer, class InnerFactory>
+template<class IndexFunction, class ContainerPointer, class Function, class PastParameterPointer, class OuterParameterPointer, class InnerFactory>
 struct then_execute_functor {
   ContainerPointer      container_ptr_;
   Function              f_;
@@ -138,8 +138,7 @@
     container[idx] = f(idx, outer_param, inner_param);
   }

-  template<class Index>
-  __device__ inline void operator()(const Index& idx)
+  __device__ inline void operator()()
   {
     // we need to cast each dereference below to convert proxy references to ensure that f() only sees raw references
     // XXX isn't there a more elegant way to deal with this?
@@ -147,8 +146,10 @@
     using past_param_reference  = typename std::pointer_traits<PastParameterPointer>::element_type &;
     using outer_param_reference = typename std::pointer_traits<OuterParameterPointer>::element_type &;

+    auto idx = IndexFunction{}();
+
     // XXX i don't think we're doing the leader calculation in a portable way
-    //     we need a way to get the origin index
+    //     we need a way to compare idx to the origin idex to figure out if this invocation represents the CTA leader
     inner_shared_parameter<InnerFactory> inner_param(idx[1] == 0, inner_factory);

     impl(
@@ -163,23 +164,24 @@
 };

-template<class ContainerPointer, class Function, class PastParameterPointer, class OuterParameterPointer, class InnerFactory>
+template<class IndexFunction, class ContainerPointer, class Function, class PastParameterPointer, class OuterParameterPointer, class InnerFactory>
 __host__ __device__
-then_execute_functor<ContainerPointer,Function,PastParameterPointer,OuterParameterPointer,InnerFactory>
+then_execute_functor<IndexFunction, ContainerPointer,Function,PastParameterPointer,OuterParameterPointer,InnerFactory>
   make_then_execute_functor(ContainerPointer container_ptr, Function f, PastParameterPointer past_param_ptr, OuterParameterPointer outer_param_ptr, InnerFactory inner_factory)
 {
-  return then_execute_functor<ContainerPointer,Function,PastParameterPointer,OuterParameterPointer,InnerFactory>{container_ptr, f, past_param_ptr, outer_param_ptr, inner_factory};
+  return then_execute_functor<IndexFunction, ContainerPointer,Function,PastParameterPointer,OuterParameterPointer,InnerFactory>{container_ptr, f, past_param_ptr, outer_param_ptr, inner_factory};
 }

-template<class ThisIndexFunction, class Function>
+template<class Function>
 __global__ void grid_executor_kernel(Function f)
 {
-  f(ThisIndexFunction{}());
+  f();
 }

-template<class ThisIndexFunction, class Container, class Function, class PastParameterType, class OuterFactory, class InnerFactory>
+// XXX eliminate this
+template<class IndexFunction, class Container, class Function, class PastParameterType, class OuterFactory, class InnerFactory>
 struct then_execute_with_shared_inits_returning_user_specified_container_global_function_pointer_type
 {
   // XXX these types need to agree the way then_execute() creates the then_execute_functor
@@ -191,14 +193,9 @@
   using outer_arg_type = agency::detail::result_of_factory_t<OuterFactory>;
   using outer_parameter_ptr_type = decltype(std::declval<future<outer_arg_type>>().data());

-  using functor_type = then_execute_functor<container_ptr_type, Function, past_parameter_ptr_type, outer_parameter_ptr_type, InnerFactory>;
-
-  using type = decltype(
-    &detail::grid_executor_kernel<
-      ThisIndexFunction,
-      functor_type
-    >
-  );
+  using functor_type = then_execute_functor<IndexFunction, container_ptr_type, Function, past_parameter_ptr_type, outer_parameter_ptr_type, InnerFactory>;
+
+  using type = decltype(&detail::grid_executor_kernel<functor_type>);
 };

@@ -281,7 +278,7 @@
     {
       // XXX shouldn't we use the stream associated with dependency instead of stream()?

-      return this->launch(grid_executor_kernel<ThisIndexFunction,Function>, f, shape, shared_memory_size(), stream(), dependency);
+      return this->launch(grid_executor_kernel<Function>, f, shape, shared_memory_size(), stream(), dependency);
     }

   public:
@@ -306,7 +303,7 @@
       using outer_arg_type = agency::detail::result_of_factory_t<Factory1>;
       auto outer_arg = executor_traits<basic_grid_executor>::template make_ready_future<outer_arg_type>(*this, outer_factory());

-      auto g = make_then_execute_functor(result_state.data(), f, fut.data(), outer_arg.data(), inner_factory);
+      auto g = make_then_execute_functor<ThisIndexFunction>(result_state.data(), f, fut.data(), outer_arg.data(), inner_factory);

       cudaEvent_t next_event = then_execute_impl(g, shape, fut.event());

@@ -335,12 +332,9 @@
       using outer_arg_type = agency::detail::result_of_factory_t<OuterFactory>;
       using outer_parameter_ptr_type = decltype(std::declval<future<outer_arg_type>>().data());

-      using functor_type = then_execute_functor<container_ptr_type, Function, past_parameter_ptr_type, outer_parameter_ptr_type, InnerFactory>;
-
-      return &detail::grid_executor_kernel<
-        ThisIndexFunction,
-        functor_type
-      >;
+      using functor_type = then_execute_functor<ThisIndexFunction, container_ptr_type, Function, past_parameter_ptr_type, outer_parameter_ptr_type, InnerFactory>;
+
+      return &detail::grid_executor_kernel<functor_type>;
     }


Protocol test that spins red triangle.

Protocol test that spins red triangle.

--- alice4/software/hps2fpga_test1/protocol.cpp
+++ alice4/software/hps2fpga_test1/protocol.cpp
@@ -45,6 +45,10 @@
 #define DRAW_TRIANGLE_STRIP 5
 #define DRAW_TRIANGLE_FAN 6

+#define TEST_PATTERN 0
+#define TEST_SPINNING_TRIANGLE 1
+#define TEST_TWO_TRIANGLES 0
+
 void cmd_clear(volatile uint64_t **p, uint8_t red, uint8_t green, uint8_t blue)
 {
     *(*p)++ = CMD_CLEAR
@@ -97,7 +101,7 @@

 int main()
 {
-    float speed = 0.001;
+    float speed = 0.01;

     int dev_mem = open("/dev/mem", O_RDWR);
     if(dev_mem == -1) {
@@ -125,7 +129,8 @@
     volatile uint64_t *protocol_buffer =
 	(uint64_t *) (buffers_base + PROTOCOL_BUFFER_OFFSET);

-    *gpo = 0;
+    int brightness = 1000;
+    *gpo = (brightness << 2) | (1 << 1);
     int counter = 0;
     while (1) {
 	// Start of frame.
@@ -146,25 +151,52 @@
 	} else {
 	    cmd_clear(&p, 0, 0, 0);
 	}
+#if TEST_PATTERN
 	cmd_pattern(&p,
 		0x5555aaaa5555aaaaLL,
 		0x5555aaaa5555aaaaLL,
 		0x5555aaaa5555aaaaLL,
 		0x5555aaaa5555aaaaLL);
-	int pattern_enable = (counter & 0x40) != 0;
+#endif
+	int pattern_enable = (counter & 0x40) != 0 && TEST_PATTERN;
+#if TEST_SPINNING_TRIANGLE
 	cmd_draw(&p, DRAW_TRIANGLES, 1, pattern_enable);
+	vertex(&p,
+	    800/2 + (int) (200*sin(counter*speed + M_PI*2/3)),
+	    450/2 + (int) (200*cos(counter*speed + M_PI*2/3)),
+	    0, 255, 0, 0);
 	vertex(&p,
 	    800/2 + (int) (200*sin(counter*speed)),
 	    450/2 + (int) (200*cos(counter*speed)),
-	    0, 50, 100, 150);
-	vertex(&p,
-	    800/2 + (int) (200*sin(counter*speed + M_PI*2/3)),
-	    450/2 + (int) (200*cos(counter*speed + M_PI*2/3)),
-	    0, 50, 100, 150);
+	    0, 0, 0, 0);
 	vertex(&p,
 	    800/2 + (int) (200*sin(counter*speed + M_PI*4/3)),
 	    450/2 + (int) (200*cos(counter*speed + M_PI*4/3)),
-	    0, 50, 100, 150);
+	    0, 0, 0, 0);
+#endif
+#if TEST_TWO_TRIANGLES
+	cmd_draw(&p, DRAW_TRIANGLES, 2, pattern_enable);
+
+	// vertex(&p, 416, 346, 0, 255, 255, 255);
+	// vertex(&p, 392, 346, 0, 255, 255, 255);
+	// vertex(&p, 416, 321, 0, 255, 255, 255);
+
+	int dy = ((counter / 50) % 20) - 10;
+
+	// Bottom triangle.
+	vertex(&p, 392, 346 + dy, 0, 255, 200, 255);
+	vertex(&p, 416, 321 + dy, 0, 255, 200, 255);
+	vertex(&p, 392, 321 + dy, 0, 255, 200, 255);
+
+	// Top triangle.
+	vertex(&p, 416, 321 + dy, 0, 255, 255, 200);
+	vertex(&p, 392, 321 + dy, 0, 255, 255, 200);
+	vertex(&p, 416, 296 + dy, 0, 255, 255, 200);
+
+	// vertex(&p, 392, 321, 0, 200, 255, 255);
+	// vertex(&p, 416, 296, 0, 200, 255, 255);
+	// vertex(&p, 392, 297, 0, 200, 255, 255);
+#endif
 	cmd_swap(&p);
 	cmd_end(&p);
 #ifdef DEBUG_PRINT


Added support for query defined sparse matricies

--- neighborsMinHash/computation/minHashBase.cpp
+++ neighborsMinHash/computation/minHashBase.cpp
@@ -34,7 +34,6 @@
         mFast = pFast;
         mNumberOfCores = pNumberOfCores;
         mChunkSize = pChunkSize;
-
 }

 MinHashBase::~MinHashBase(){
@@ -62,7 +61,7 @@

     umap_uniqueElement* X;
     bool doubleElementsStorageCount = false;
-    if (pRawData->size() == 0) {
+    if (pRawData == NULL) {
         // no query data given, use stored signatures
         X = mInverseIndex->getSignatureStorage();
         doubleElementsStorageCount = true;
@@ -101,10 +100,10 @@
             std::vector<sortMapFloat>* exactNeighbors;
             if (pSimilarity) {
                 exactNeighbors =
-                    mOriginalData->cosineSimilarity(neighborhood_->neighbors->operator[](i), neighborhood_->neighbors->operator[](i)[0], pNneighbors);
+                    mOriginalData->cosineSimilarity(neighborhood_->neighbors->operator[](i), neighborhood_->neighbors->operator[](i)[0], pNneighbors, pRawData);
             } else {
                 exactNeighbors =
-                    mOriginalData->euclidianDistance(neighborhood_->neighbors->operator[](i), neighborhood_->neighbors->operator[](i)[0], pNneighbors);
+                    mOriginalData->euclidianDistance(neighborhood_->neighbors->operator[](i), neighborhood_->neighbors->operator[](i)[0], pNneighbors, pRawData);
             }

     // std::cout << "101M" << std::endl;


ignore roger key when observing

ignore roger key when observing

git-svn-id: 67bf12f30ddf2081c31403e0b02b2123541f1680@5602 08b3d480-bf2c-0410-a26f-811ee3361c24

--- src/bzflag/playing.cxx
+++ src/bzflag/playing.cxx
@@ -2122,7 +2122,7 @@
   char messageBuffer[MessageLen];
   memset(messageBuffer, 0, MessageLen);

-  if (myTank != NULL) {
+  if (myTank != NULL && myTank->getTeam() != ObserverTeam) {
     if (myTank->isAutoPilot()) {
       myTank->setAutoPilot(false);
       hud->setAlert(0, "autopilot disabled", 1.0f, true);


Blacklisted Door for shadows.

Blacklisted Door for shadows.

--- hydra_graphics/src/component/meshcomponent.cpp
+++ hydra_graphics/src/component/meshcomponent.cpp
@@ -36,7 +36,7 @@
 		|| meshFile.find("HangingCable") != std::string::npos || meshFile.find("Monitor") != std::string::npos
 		|| meshFile.find("BookShelf") != std::string::npos || meshFile.find("Pillar") != std::string::npos || meshFile.find("Locker") != std::string::npos
 		|| meshFile.find("WaterContainer") != std::string::npos || meshFile.find("EnglishWordForHyllla") != std::string::npos
-		|| meshFile.find("Fridge") != std::string::npos){
+		|| meshFile.find("Fridge") != std::string::npos || meshFile.find("Door") != std::string::npos){
 		drawObject->drawObject->hasShadow = false;
 	}
 }


#94629# Read version property as sal_Int32 from file picker service

--- sfx2/source/appl/shutdownicon.cxx
+++ sfx2/source/appl/shutdownicon.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: shutdownicon.cxx,v $
  *
- *  $Revision: 1.14 $
- *
- *  last change: $Author: hro $ $Date: 2001-11-12 16:45:02 $
+ *  $Revision: 1.15 $
+ *
+ *  last change: $Author: hro $ $Date: 2001-11-19 11:03:09 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -232,14 +232,26 @@
                     if ( xPickerControls.is() )
                     {

+                        sal_Bool    bReadOnly = sal_False;
+
                         aArgs[0].Name  = OUString::createFromAscii( "ReadOnly" );
                         aArgs[0].Value = xPickerControls->getValue( ExtendedFilePickerElementIds::CHECKBOX_READONLY, 0 );
+                        aArgs[0].Value >>= bReadOnly;
+
+                        OUString    aFilterName;

                         aArgs[1].Name  = OUString::createFromAscii( "FilterName" );
                         aArgs[1].Value = xPickerControls->getValue( CommonFilePickerElementIds::LISTBOX_FILTER, ControlActions::GET_SELECTED_ITEM );
+                        aArgs[1].Value >>= aFilterName;

                         aArgs[2].Name  = OUString::createFromAscii( "Version" );
-                        aArgs[2].Value = xPickerControls->getValue( CommonFilePickerElementIds::LISTBOX_FILTER, ControlActions::GET_SELECTED_ITEM );
+
+                        sal_Int32   iVersion = -1;
+                        sal_uInt16  uVersion = (sal_uInt16)-1;
+
+                        xPickerControls->getValue( ExtendedFilePickerElementIds::LISTBOX_VERSION, ControlActions::GET_SELECTED_ITEM_INDEX ) >>= iVersion;
+                        uVersion = (sal_uInt16)iVersion;
+                        aArgs[2].Value <<= uVersion;
                     }

                     if ( 1 == nFiles )


use depreciated nm value for those who are distribution challenged.

--- src/bearer/qnmwifiengine_unix.cpp
+++ src/bearer/qnmwifiengine_unix.cpp
@@ -323,7 +323,7 @@
         QScopedPointer<QNetworkManagerSettingsConnection> settingsCon;
         settingsCon.reset(new QNetworkManagerSettingsConnection(activeCon->serviceName(), activeCon->connection().path()));

-        if(settingsCon->getType() == NM_DEVICE_TYPE_ETHERNET) {
+        if(settingsCon->getType() ==  DEVICE_TYPE_802_3_ETHERNET /*NM_DEVICE_TYPE_ETHERNET*/) { //use depreciated value for now
             emit connectionError(id, OperationNotSupported);
         } else {
             QDBusObjectPath dbpath(activeConnectionPath);


Cleanup

Cleanup

--- src/world/world.cpp
+++ src/world/world.cpp
@@ -570,7 +570,7 @@
 		if (component->type == COMPONENT_TYPE_TRANSFORM)
 		{
 			const TransformDesc* td = (const TransformDesc*)data;
-			for (u32 i = 0; i < component->num_instances; ++i, ++td)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i, ++td)
 			{
 				Matrix4x4 matrix = matrix4x4(rot, pos);
 				Matrix4x4 matrix_res = matrix4x4(td->rotation, td->position);
@@ -580,7 +580,7 @@
 		else if (component->type == COMPONENT_TYPE_CAMERA)
 		{
 			const CameraDesc* cd = (const CameraDesc*)data;
-			for (u32 i = 0; i < component->num_instances; ++i, ++cd)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i, ++cd)
 			{
 				w.camera_create(unit_lookup[unit_index[i]], *cd, MATRIX4X4_IDENTITY);
 			}
@@ -588,7 +588,7 @@
 		else if (component->type == COMPONENT_TYPE_COLLIDER)
 		{
 			const ColliderDesc* cd = (const ColliderDesc*)data;
-			for (u32 i = 0; i < component->num_instances; ++i)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i)
 			{
 				physics_world->collider_create(unit_lookup[unit_index[i]], cd);
 				cd = (ColliderDesc*)((char*)(cd + 1) + cd->size);
@@ -597,7 +597,7 @@
 		else if (component->type == COMPONENT_TYPE_ACTOR)
 		{
 			const ActorResource* ar = (const ActorResource*)data;
-			for (u32 i = 0; i < component->num_instances; ++i, ++ar)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i, ++ar)
 			{
 				Matrix4x4 tm = scene_graph->world_pose(unit_lookup[unit_index[i]]);
 				physics_world->actor_create(unit_lookup[unit_index[i]], ar, tm);
@@ -606,7 +606,7 @@
 		else if (component->type == COMPONENT_TYPE_CONTROLLER)
 		{
 			const ControllerDesc* cd = (const ControllerDesc*)data;
-			for (u32 i = 0; i < component->num_instances; ++i, ++cd)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i, ++cd)
 			{
 				Matrix4x4 tm = scene_graph->world_pose(unit_lookup[unit_index[i]]);
 				physics_world->controller_create(unit_lookup[unit_index[i]], *cd, tm);
@@ -615,7 +615,7 @@
 		else if (component->type == COMPONENT_TYPE_MESH_RENDERER)
 		{
 			const MeshRendererDesc* mrd = (const MeshRendererDesc*)data;
-			for (u32 i = 0; i < component->num_instances; ++i, ++mrd)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i, ++mrd)
 			{
 				Matrix4x4 tm = scene_graph->world_pose(unit_lookup[unit_index[i]]);
 				render_world->mesh_create(unit_lookup[unit_index[i]], *mrd, tm);
@@ -624,7 +624,7 @@
 		else if (component->type == COMPONENT_TYPE_SPRITE_RENDERER)
 		{
 			const SpriteRendererDesc* srd = (const SpriteRendererDesc*)data;
-			for (u32 i = 0; i < component->num_instances; ++i, ++srd)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i, ++srd)
 			{
 				Matrix4x4 tm = scene_graph->world_pose(unit_lookup[unit_index[i]]);
 				render_world->sprite_create(unit_lookup[unit_index[i]], *srd, tm);
@@ -633,7 +633,7 @@
 		else if (component->type == COMPONENT_TYPE_LIGHT)
 		{
 			const LightDesc* ld = (const LightDesc*)data;
-			for (u32 i = 0; i < component->num_instances; ++i, ++ld)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i, ++ld)
 			{
 				Matrix4x4 tm = scene_graph->world_pose(unit_lookup[unit_index[i]]);
 				render_world->light_create(unit_lookup[unit_index[i]], *ld, tm);
@@ -642,7 +642,7 @@
 		else if (component->type == COMPONENT_TYPE_SCRIPT)
 		{
 			const ScriptDesc* sd = (const ScriptDesc*)data;
-			for (u32 i = 0; i < component->num_instances; ++i, ++sd)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i, ++sd)
 			{
 				script_world::create(*script_world, unit_lookup[unit_index[i]], *sd);
 			}
@@ -650,7 +650,7 @@
 		else if (component->type == COMPONENT_TYPE_ANIMATION_STATE_MACHINE)
 		{
 			const AnimationStateMachineDesc* asmd = (const AnimationStateMachineDesc*)data;
-			for (u32 i = 0; i < component->num_instances; ++i, ++asmd)
+			for (u32 i = 0, n = component->num_instances; i < n; ++i, ++asmd)
 			{
 				animation_state_machine->create(unit_lookup[unit_index[i]], *asmd);
 			}


Terminado ejercicio 3.19

Terminado ejercicio 3.19

--- Ejercicios/EjerciciosRelacion3/Ejercicio19.cpp
+++ Ejercicios/EjerciciosRelacion3/Ejercicio19.cpp
@@ -33,8 +33,16 @@
     }

     //Calculamos los años que transcurriran hasta lograr el doble del capital
-    int calcularAnios(double capital){
+    int calcularAnios(){
+        double dobleCapital = capital * 2;
+        double copia = capital;
+        int anios=0;

+        while(copia < dobleCapital){
+            copia = copia + ((capital*interes)/100.0);
+            anios++;
+        }
+        return anios;
     }
 };

@@ -72,6 +80,19 @@
                 cout<<"El total de capital en "<< anios << " años es de: "<< totalCapital << endl;

             }
+            if(opcion == 2){
+                cout<<"Introduce el capital inicial: ";
+                cin>>capital;
+
+                cout<<"Introduce el interes: ";
+                cin>>interes;
+
+                DepositoSimulacion deposito (capital, interes);
+
+                anios = deposito.calcularAnios();
+
+                cout<<"Tienen que transcurrir "<< anios << " años para tener el doble de tu capital"<<endl;
+            }

     }


reducing scope of a variable

reducing scope of a variable

--- source/Navigation.cpp
+++ source/Navigation.cpp
@@ -525,11 +525,11 @@

 void Navigation::wheelEvent(QWheelEvent * event)
 {
-    static const float wheelNormalizationFactor = 1.f / 120.f;
     event->ignore();

     if (m_mode == NoInteraction)
     {
+		static const float wheelNormalizationFactor = 1.f / 120.f;
         scaleAtMouse(event->pos(),
             - event->delta() * wheelNormalizationFactor * DEFAULT_SCALE_STEP);
         event->accept();


Add ROOT_GCC_TOOLCHAIN env var, extending ROO_INCLUDE_PATH to also handle GCC location.

--- core/meta/src/TCling.cxx
+++ core/meta/src/TCling.cxx
@@ -841,78 +841,115 @@
    llvm::install_fatal_error_handler(&exceptionErrorHandler);

    fTemporaries = new std::vector<cling::StoredValueRef>();
+
    std::string interpInclude = ROOT::TMetaUtils::GetInterpreterExtraIncludePath(false);
    std::string pchFilename = interpInclude.substr(2) + "/allDict.cxx.pch";
-   const char* interpArgs[]
-      = {"cling4root", interpInclude.c_str(), "-include-pch", pchFilename.c_str()
-#ifdef R__GCC_TOOLCHAIN
-         , "-gcc-toolchain", R__GCC_TOOLCHAIN
-#endif
-#ifdef R__GCC_INC_DIR_0
-         , "-nostdinc++"
-         , "-I", R__GCC_INC_DIR_0
-#endif
-#ifdef R__GCC_INC_DIR_1
-         , "-I", R__GCC_INC_DIR_1
-#endif
-#ifdef R__GCC_INC_DIR_2
-         , "-I", R__GCC_INC_DIR_2
-#endif
-#ifdef R__GCC_INC_DIR_3
-         , "-I", R__GCC_INC_DIR_3
-#endif
-#ifdef R__GCC_INC_DIR_4
-         , "-I", R__GCC_INC_DIR_4
-#endif
-#ifdef R__GCC_INC_DIR_5
-         , "-I", R__GCC_INC_DIR_5
-#endif
-#ifdef R__GCC_INC_DIR_6
-         , "-I", R__GCC_INC_DIR_6
-#endif
-#ifdef R__GCC_INC_DIR_7
-         , "-I", R__GCC_INC_DIR_7
-#endif
-#ifdef R__GCC_INC_DIR_8
-         , "-I", R__GCC_INC_DIR_8
-#endif
-#ifdef R__GCC_INC_DIR_9
-         , "-I", R__GCC_INC_DIR_9
-#endif
-#ifdef R__GCC_INC_DIR_10
-         , "-I", R__GCC_INC_DIR_10
-#endif
-        };
-         //"-Xclang", "-fmodules"};
-
-   fInterpreter = new cling::Interpreter(sizeof(interpArgs) / sizeof(char*),
-                                         interpArgs,
-                                         ROOT::TMetaUtils::GetLLVMResourceDir(false).c_str());
-   fInterpreter->installLazyFunctionCreator(autoloadCallback);
-
-   // Add include path to etc/cling. FIXME: This is a short term solution. The
-   // llvm/clang header files shouldn't be there at all. We have to get rid of
-   // that dependency and avoid copying the header files.
-   TCling::AddIncludePath((interpInclude.substr(2) + "/cling").c_str());
-
-   // Add the current path to the include path
-   TCling::AddIncludePath(".");
-
-   // Add the root include directory and etc/ to list searched by default.
-   // Use explicit TCling::AddIncludePath() to avoid vtable: we're in the c'tor!
-   TCling::AddIncludePath(ROOT::TMetaUtils::GetROOTIncludeDir(false).c_str());
+   std::vector<std::string> clingArgsStorage;
+   clingArgsStorage.push_back("cling4root");
+   clingArgsStorage.push_back(interpInclude);
+   clingArgsStorage.push_back("-include-pch");
+   clingArgsStorage.push_back(pchFilename);

    // FIXME: enables relocatability for experiments' framework headers until PCMs
    // are available.
+   const char* gccToolchain = getenv("ROOT_GCC_TOOLCHAIN");
    const char* envInclPath = getenv("ROOT_INCLUDE_PATH");
+
+   if (gccToolchain) {
+      clingArgsStorage.push_back("-gcc-toolchain");
+      clingArgsStorage.push_back(gccToolchain);
+      clingArgsStorage.push_back("-nostdinc++");
+      if (!envInclPath) {
+         ::Error("TCling::TCling", "Must also set ROOT_INCLUDE_PATH when ROOT_GCC_TOOLCHAIN is set!");
+      }
+   }
+
    if (envInclPath) {
       TString strEnvInclPath(envInclPath);
       TString tok;
       Ssiz_t from = 0;
       while (strEnvInclPath.Tokenize(tok, from, ":")) {
-         TCling::AddIncludePath(tok);
-      }
-   }
+         clingArgsStorage.push_back("-I");
+         clingArgsStorage.push_back(tok.Data());
+      }
+   }
+
+   if (!gccToolchain) {
+#ifdef R__GCC_TOOLCHAIN
+      clingArgsStorage.push_back("-gcc-toolchain");
+      clingArgsStorage.push_back(R__GCC_TOOLCHAIN);
+#endif
+#ifdef R__GCC_INC_DIR_0
+      clingArgsStorage.push_back("-nostdinc++");
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_0);
+#endif
+#ifdef R__GCC_INC_DIR_1
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_1);
+#endif
+#ifdef R__GCC_INC_DIR_2
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_2);
+#endif
+#ifdef R__GCC_INC_DIR_3
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_3);
+#endif
+#ifdef R__GCC_INC_DIR_4
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_4);
+#endif
+#ifdef R__GCC_INC_DIR_5
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_5);
+#endif
+#ifdef R__GCC_INC_DIR_6
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_6);
+#endif
+#ifdef R__GCC_INC_DIR_7
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_7);
+#endif
+#ifdef R__GCC_INC_DIR_8
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_8);
+#endif
+#ifdef R__GCC_INC_DIR_9
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_9);
+#endif
+#ifdef R__GCC_INC_DIR_10
+      clingArgsStorage.push_back("-I");
+      clingArgsStorage.push_back(R__GCC_INC_DIR_10);
+#endif
+   } // if no ROOT_GCC_TOOLCHAIN
+
+   // clingArgsStorage.push_back("-Xclang");
+   // clingArgsStorage.push_back("-fmodules");
+
+   std::vector<const char*> interpArgs;
+   for (std::vector<std::string>::const_iterator iArg = clingArgsStorage.begin(),
+           eArg = clingArgsStorage.end(); iArg != eArg; ++iArg)
+      interpArgs.push_back(iArg->c_str());
+
+   fInterpreter = new cling::Interpreter(interpArgs.size(),
+                                         &(interpArgs[0]),
+                                         ROOT::TMetaUtils::GetLLVMResourceDir(false).c_str());
+   fInterpreter->installLazyFunctionCreator(autoloadCallback);
+
+   // Add include path to etc/cling. FIXME: This is a short term solution. The
+   // llvm/clang header files shouldn't be there at all. We have to get rid of
+   // that dependency and avoid copying the header files.
+   TCling::AddIncludePath((interpInclude.substr(2) + "/cling").c_str());
+
+   // Add the current path to the include path
+   TCling::AddIncludePath(".");
+
+   // Add the root include directory and etc/ to list searched by default.
+   // Use explicit TCling::AddIncludePath() to avoid vtable: we're in the c'tor!
+   TCling::AddIncludePath(ROOT::TMetaUtils::GetROOTIncludeDir(false).c_str());

    // Don't check whether modules' files exist.
    fInterpreter->getCI()->getPreprocessorOpts().DisablePCHValidation = true;


CWS-TOOLING: integrate CWS sw33bf06_OOO330

--- svtools/source/uno/unoimap.cxx
+++ svtools/source/uno/unoimap.cxx
@@ -210,6 +210,8 @@
 SvUnoImageMapObject::SvUnoImageMapObject( UINT16 nType, const SvEventDescription* pSupportedMacroItems )
 :   PropertySetHelper( createPropertySetInfo( nType ) ),
     mnType( nType )
+,   mbIsActive( true )
+,   mnRadius( 0 )
 {
     mpEvents = new SvMacroTableEventDescriptor( pSupportedMacroItems );
     mpEvents->acquire();
@@ -218,6 +220,8 @@
 SvUnoImageMapObject::SvUnoImageMapObject( const IMapObject& rMapObject, const SvEventDescription* pSupportedMacroItems )
 :   PropertySetHelper( createPropertySetInfo( rMapObject.GetType() ) ),
     mnType( rMapObject.GetType() )
+,   mbIsActive( true )
+,   mnRadius( 0 )
 {
     maURL = rMapObject.GetURL();
     maAltText = rMapObject.GetAltText();


addr NULL added to temp operands

addr NULL added to temp operands

--- postprocess/buildex/src/analysis/x86_analysis.cpp
+++ postprocess/buildex/src/analysis/x86_analysis.cpp
@@ -275,7 +275,7 @@
 			rinstr = new rinstr_t[3];
 			amount = 3;
 			// create an operand for the virtual register
-			operand_t virtual_reg = { REG_TYPE, 2 * cinstr->srcs[1].width, DR_REG_VIRTUAL_1 };
+			operand_t virtual_reg = { REG_TYPE, 2 * cinstr->srcs[1].width, DR_REG_VIRTUAL_1 , NULL};
 			reg_to_mem_range(&virtual_reg);

 			//virtual <= eax * src0
@@ -297,7 +297,7 @@
 			rinstr = new rinstr_t[3];
 			amount = 3;
 			// create an operand for the virtual register
-			operand_t virtual_reg = { REG_TYPE, 2 * cinstr->srcs[1].width, DR_REG_VIRTUAL_1 };
+			operand_t virtual_reg = { REG_TYPE, 2 * cinstr->srcs[1].width, DR_REG_VIRTUAL_1 , NULL};
 			reg_to_mem_range(&virtual_reg);

 			//virtual <= eax * src0
@@ -318,7 +318,7 @@
 			rinstr = new rinstr_t[3];
 			amount = 3;
 			/* create an operand for the virtual register */
-			operand_t virtual_reg = { REG_TYPE, 2 * cinstr->srcs[1].width, DR_REG_VIRTUAL_1 };
+			operand_t virtual_reg = { REG_TYPE, 2 * cinstr->srcs[1].width, DR_REG_VIRTUAL_1 , NULL};
 			reg_to_mem_range(&virtual_reg);

 			//virtual <- edx:eax
@@ -348,7 +348,7 @@
 		if_bounds(2, 2){
 			rinstr = new rinstr_t[3];
 			amount = 3;
-			operand_t virtual_reg = { REG_TYPE, cinstr->srcs[0].width, DR_REG_VIRTUAL_1 };
+			operand_t virtual_reg = { REG_TYPE, cinstr->srcs[0].width, DR_REG_VIRTUAL_1 , NULL};
 			reg_to_mem_range(&virtual_reg);

 			ASSERT_MSG(((cinstr->dsts[0].value == cinstr->srcs[0].value) && (cinstr->dsts[1].value == cinstr->srcs[1].value)), ("op_fxch the dsts and srcs should match\n"));
@@ -386,7 +386,7 @@
 			operand_t first = cinstr->srcs[0];
 			operand_t second = cinstr->srcs[1];
 			if (first.type == second.type && first.value == second.value){
-				operand_t zero = { IMM_INT_TYPE, cinstr->srcs[0].width, 0 };
+				operand_t zero = { IMM_INT_TYPE, cinstr->srcs[0].width, 0 , NULL};
 				rinstr[0] = { op_assign, cinstr->dsts[0], 1, { zero }, false };
 			}
 			else{
@@ -431,7 +431,7 @@
 		if_bounds(1, 1){
 			rinstr = new rinstr_t[1];
 			amount = 1;
-			operand_t immediate = { IMM_INT_TYPE, cinstr->srcs[0].width, 1 };
+			operand_t immediate = { IMM_INT_TYPE, cinstr->srcs[0].width, 1 , NULL};
 			rinstr[0] = { op_sub, cinstr->dsts[0], 2, { cinstr->srcs[0], immediate }, true };
 		}
 		else_bounds;
@@ -440,7 +440,7 @@
 		if_bounds(1, 1){
 			rinstr = new rinstr_t[1];
 			amount = 1;
-			operand_t immediate = { IMM_INT_TYPE, cinstr->srcs[0].width, 1 };
+			operand_t immediate = { IMM_INT_TYPE, cinstr->srcs[0].width, 1 , NULL};
 			rinstr[0] = { op_add, cinstr->dsts[0], 2, { cinstr->srcs[0], immediate }, true };
 		}
 		else_bounds;
@@ -503,7 +503,7 @@
 			else{
 				rinstr = new rinstr_t[3];
 				amount = 3;
-				operand_t virtual_reg = { REG_TYPE, cinstr->srcs[0].width, DR_REG_VIRTUAL_1 };
+				operand_t virtual_reg = { REG_TYPE, cinstr->srcs[0].width, DR_REG_VIRTUAL_1 , NULL};
 				reg_to_mem_range(&virtual_reg);

 				//virtual <= scale(src2) * index(src1)
@@ -532,7 +532,7 @@
 			}
 			//dsts[0] <- srcs[1] - srcs[0]
 			if ((cinstr->srcs[0].type == cinstr->srcs[1].type) && (cinstr->srcs[0].value == cinstr->srcs[1].value)){
-				operand_t immediate_0 = { IMM_INT_TYPE, cinstr->srcs[1].width, 0 };
+				operand_t immediate_0 = { IMM_INT_TYPE, cinstr->srcs[1].width, 0 , NULL};
 				rinstr[0] = { op_assign, cinstr->dsts[0], 1, { immediate_0 }, true };
 			}
 			else{
@@ -540,7 +540,7 @@
 			}
 			if (cf){ //substract an immediate 1
 				//dsts[0] <- dsts[0] - 1
-				operand_t immediate_1 = { IMM_INT_TYPE, cinstr->srcs[1].width, 1 };
+				operand_t immediate_1 = { IMM_INT_TYPE, cinstr->srcs[1].width, 1 , NULL};
 				rinstr[1] = { op_sub, cinstr->dsts[0], 2, { cinstr->dsts[0], immediate_1 }, true };
 			}

@@ -568,11 +568,11 @@
 			case OP_setb: flag = check_lahf_bit(Carry_lahf, cinstr->eflags); break;
 			}
 			if (flag){
-				operand_t immediate = { IMM_INT_TYPE, cinstr->dsts[0].width, 1 };
+				operand_t immediate = { IMM_INT_TYPE, cinstr->dsts[0].width, 1, NULL};
 				rinstr[0] = { op_assign, cinstr->dsts[0], 1, { immediate }, true };
 			}
 			else{
-				operand_t immediate = { IMM_INT_TYPE, cinstr->dsts[0].width, 0 };
+				operand_t immediate = { IMM_INT_TYPE, cinstr->dsts[0].width, 0, NULL};
 				rinstr[0] = { op_assign, cinstr->dsts[0], 1, { immediate }, true };
 			}
 		}
@@ -582,7 +582,7 @@

 		if_bounds(2, 2){
 			rinstr = new rinstr_t[3];
-			operand_t virtual_reg = { REG_TYPE, cinstr->srcs[0].width, DR_REG_VIRTUAL_1 };
+			operand_t virtual_reg = { REG_TYPE, cinstr->srcs[0].width, DR_REG_VIRTUAL_1, NULL};
 			reg_to_mem_range(&virtual_reg);
 			rinstr[0] = { op_add, virtual_reg, 2, { cinstr->srcs[0], cinstr->srcs[1] }, true };
 			rinstr[1] = { op_assign, cinstr->srcs[1], 1, { cinstr->srcs[0] }, true };
@@ -637,7 +637,7 @@
 		if_bounds(2, 2){
 			rinstr = new rinstr_t[3];
 			amount = 3;
-			operand_t virtual_reg = { REG_TYPE, cinstr->srcs[0].width, DR_REG_VIRTUAL_1 };
+			operand_t virtual_reg = { REG_TYPE, cinstr->srcs[0].width, DR_REG_VIRTUAL_1, NULL};
 			reg_to_mem_range(&virtual_reg);
 			ASSERT_MSG(((cinstr->dsts[0].value == cinstr->srcs[0].value) && (cinstr->dsts[1].value == cinstr->srcs[1].value)), ("op_fxch the dsts and srcs should match\n"));
 			//virtual <- src[0]


Add agency::detail::is_bounded_by()

Add agency::detail::is_bounded_by()

--- agency/detail/index_tuple.hpp
+++ agency/detail/index_tuple.hpp
@@ -96,6 +96,68 @@
 }

+// a point on the number line is bounded by another if it is strictly less than the other
+template<class Integral1, class Integral2,
+         class = typename std::enable_if<
+           std::is_integral<Integral1>::value && std::is_integral<Integral2>::value
+         >::type>
+__AGENCY_ANNOTATION
+bool is_bounded_by(const Integral1& x, const Integral2& bound)
+{
+  return x < bound;
+}
+
+
+// a multidimensional index is bounded by another if all of its elements are
+// bounded by the corresponding element of the other
+// essentially we test whether x is contained within (not lying on)
+// the axis-aligned bounding box from the origin to the bound
+template<class IndexTuple1, class IndexTuple2,
+         class = typename std::enable_if<
+           is_tuple<IndexTuple1>::value && is_tuple<IndexTuple2>::value
+         >::type,
+         class = typename std::enable_if<
+           std::tuple_size<IndexTuple1>::value == std::tuple_size<IndexTuple2>::value
+         >::type>
+__AGENCY_ANNOTATION
+bool is_bounded_by(const IndexTuple1& x, const IndexTuple2& bound);
+
+
+// terminal case: x is bounded by bound
+template<size_t i, class IndexTuple1, class IndexTuple2>
+__AGENCY_ANNOTATION
+typename std::enable_if<
+  std::tuple_size<IndexTuple1>::value <= i,
+  bool
+>::type
+  is_bounded_by_impl(const IndexTuple1& x, const IndexTuple2& bound)
+{
+  return true;
+}
+
+
+// recursive case: early out if x[i] is not bounded by bound[i]
+template<size_t i, class IndexTuple1, class IndexTuple2>
+__AGENCY_ANNOTATION
+typename std::enable_if<
+  i < std::tuple_size<IndexTuple1>::value,
+  bool
+>::type
+  is_bounded_by_impl(const IndexTuple1& x, const IndexTuple2& bound)
+{
+  return detail::is_bounded_by(detail::get<i>(x), detail::get<i>(bound)) && detail::is_bounded_by_impl<i+1>(x,bound);
+}
+
+
+template<class IndexTuple1, class IndexTuple2,
+         class EnableIf1, class EnableIf2>
+__AGENCY_ANNOTATION
+bool is_bounded_by(const IndexTuple1& x, const IndexTuple2& bound)
+{
+  return detail::is_bounded_by_impl<0>(x,bound);
+}
+
+
 } // end detail
 } // end agency