XRevert "conditional debugging facilities for window stacking"

This reverts commit 5c99a9c358efa262f47ea7756ddd0ef39ec1ec24.

--- src/mcompositemanager.cpp
+++ src/mcompositemanager.cpp
@@ -93,29 +93,6 @@
 static QTime overhead_measure;
 // this can be toggled with SIGUSR1
 static bool debug_mode = false;
-#endif
-
-// Enable to see the decisions of the stacker.
-#if 0
-# define STACKING(fmt, args...)                     \
-    qDebug("line:%u: " fmt, __LINE__ ,##args)
-# define STACKING_MOVE(from, to)                    \
-    STACKING("moving %d (0x%lx) -> %d in stack",    \
-           from,                                    \
-           0 <= from && from < stacking_list.size() \
-              ? stacking_list[from] : 0,            \
-           to)
-#else
-# define STACKING(...)                              /* NOP */
-# define STACKING_MOVE(...)                         /* NOP */
-#endif
-
-// Enable to see what and why getTopApplication() chooses
-// as a toplevel window.
-#if 0
-# define GTA(...)   qDebug("getTopApplication: " __VA_ARGS__)
-#else
-# define GTA(...)                                   /* NOP */
 #endif

 MCompAtoms *MCompAtoms::instance()
@@ -1000,53 +977,23 @@
 {
     for (int i = stacking_list.size() - 1; i >= 0; --i) {
         Window w = stacking_list.at(i);
-        GTA("considering 0x%lx", w);
-        if (w == ignore_window || !w) {
-            GTA("ignoring");
-            continue;
-        }
-        if (w == stack[DESKTOP_LAYER]) {
+        if (w == ignore_window || !w) continue;
+        if (w == stack[DESKTOP_LAYER])
             /* desktop is above all applications */
-            GTA("  desktop layer reached");
             return 0;
-        }
-
         MCompositeWindow *cw = COMPOSITE_WINDOW(w);
         MWindowPropertyCache *pc;
-        if (!cw) {
-            GTA("  has no MCompositeWindow");
-            continue;
-        } else if (!cw->isMapped()) {
-            GTA("  not mapped");
-            continue;
-        } else if (!(pc = cw->propertyCache())) {
-            GTA("  has no property cache");
-            continue;
-        }
-        if (!cw->isAppWindow(true)) {
-            /* Non-transient TYPE_MENU on the same stacking layer? */
-            if (getLastVisibleParent(pc)) {
-                GTA("  has last visible parent");
-                continue;
-            } else if (pc->windowTypeAtom() != ATOM(_NET_WM_WINDOW_TYPE_MENU)) {
-                GTA("  not a menu");
-                continue;
-            }
-        }
-        if (pc->windowState() != NormalState) {
-            GTA("  not in normal state");
-            continue;
-        } else if (cw->isWindowTransitioning()) {
-            GTA("  is transitioning");
-            continue;
-        }
-
-        GTA("  suitable");
-        if (index_in_stacking_list)
-            *index_in_stacking_list = i;
-        return w;
-    }
-    GTA("no suitable window found");
+        if (cw && cw->isMapped() && (pc = cw->propertyCache()) &&
+            (cw->isAppWindow(true) ||
+            /* non-transient TYPE_MENU is on the same stacking layer */
+            (!getLastVisibleParent(pc) &&
+            pc->windowTypeAtom() == ATOM(_NET_WM_WINDOW_TYPE_MENU))) &&
+            pc->windowState() == NormalState && !cw->isWindowTransitioning()) {
+            if (index_in_stacking_list)
+                *index_in_stacking_list = i;
+            return w;
+        }
+    }
     return 0;
 }

@@ -1348,13 +1295,10 @@
         if (e->value_mask & CWSibling) {
             int above_i = stacking_list.indexOf(e->above);
             if (above_i >= 0) {
-                if (above_i > win_i) {
-                    STACKING_MOVE(win_i, above_i);
+                if (above_i > win_i)
                     safe_move(stacking_list, win_i, above_i);
-                } else {
-                    STACKING_MOVE(win_i, above_i+1);
+                else
                     safe_move(stacking_list, win_i, above_i + 1);
-                }
                 dirtyStacking(false);
             }
         } else {
@@ -1369,13 +1313,10 @@
         if (e->value_mask & CWSibling) {
             int above_i = stacking_list.indexOf(e->above);
             if (above_i >= 0) {
-                if (above_i > win_i) {
-                    STACKING_MOVE(win_i, above_i-1);
+                if (above_i > win_i)
                     safe_move(stacking_list, win_i, above_i - 1);
-                } else {
-                    STACKING_MOVE(win_i, above_i);
+                else
                     safe_move(stacking_list, win_i, above_i);
-                }
                 dirtyStacking(false);
             }
         } else {
@@ -1618,7 +1559,6 @@
          it != pc->transientWindows().end(); ++it) {
         int i = stacking_list.indexOf(*it);
         if (i != -1) {
-            STACKING_MOVE(i, last_i);
             stacking_list.move(i, last_i);
             MWindowPropertyCache *p = prop_caches.value(*it, 0);
             if (p == orig_pc && orig_pc) {
@@ -1851,7 +1791,6 @@
                 if (cw && cw->propertyCache() && cw->isMapped() && (X)) \
                     break; \
             } \
-            STACKING_MOVE(i, last_i); \
             stacking_list.move(i, last_i); \
 	    raiseTransientsOf(orig_cw->propertyCache(), last_i); \
             if (!first_moved) first_moved = w; \
@@ -1903,8 +1842,6 @@

     /* raise active app with its transients, or duihome if
      * there is no active application */
-    STACKING("checkStacking: desktop_up: %d, active_app: 0x%lx, app_i: %d",
-             desktop_up, active_app, app_i);
     if (!desktop_up && active_app && app_i >= 0 && aw) {
 	/* raise application windows belonging to the same group */
 	XID group;
@@ -1914,7 +1851,6 @@
             if (cw->propertyCache()->windowState() == NormalState
                 && cw->isAppWindow()
                 && cw->propertyCache()->windowGroup() == group) {
-                STACKING_MOVE(i, last_i);
                 safe_move(stacking_list, i, last_i);
 	             /* active_app was moved, update the index */
 	             app_i = stacking_list.indexOf(active_app);
@@ -1923,14 +1859,12 @@
 	    }
 	}

-        STACKING_MOVE(app_i, last_i);
 	safe_move(stacking_list, app_i, last_i);
 	/* raise transients recursively */
         if (aw->propertyCache())
 	    raiseTransientsOf(aw->propertyCache(), last_i);
     } else if (duihome) {
         //qDebug() << "raising home window" << duihome;
-        STACKING_MOVE(stacking_list.indexOf(duihome), last_i);
         safe_move(stacking_list, stacking_list.indexOf(duihome), last_i);
     }

@@ -2004,13 +1938,10 @@
         Window deco_w = deco->decoratorItem()->window();
         int deco_i = stacking_list.indexOf(deco_w);
         if (deco_i >= 0) {
-            if (deco_i < top_i) {
-                STACKING_MOVE(deco_i, top_i);
+            if (deco_i < top_i)
                 safe_move(stacking_list, deco_i, top_i);
-            } else {
-                STACKING_MOVE(deco_i, top_i+1);
+            else
                 safe_move(stacking_list, deco_i, top_i + 1);
-            }
             if (!compositing)
                 // decor requires compositing
                 enableCompositing(true);
@@ -2486,8 +2417,6 @@
                         setWindowState(cw->window(), IconicState);
                 }
                 Q_ASSERT(lower_i > 0);
-                STACKING_MOVE(stacking_list.indexOf(stack[DESKTOP_LAYER]),
-                              lower_i-1);
                 safe_move(stacking_list, stacking_list.indexOf(stack[DESKTOP_LAYER]),
                                    lower_i - 1);

@@ -3014,7 +2943,6 @@
     // Item is already removed from scene when it is deleted
     int removed = 0;

-    STACKING("remove 0x%lx from stack", w);
     removed += windows_as_mapped.removeAll(w);
     removed += windows.remove(w);
     removed += stacking_list.removeAll(w);
@@ -3105,7 +3033,6 @@

 void MCompositeManagerPrivate::roughSort()
 {
-    STACKING("sorting stack");
     orig_list = stacking_list;
     qSort(stacking_list.begin(), stacking_list.end(), compareWindows);
 }
@@ -3170,13 +3097,10 @@
     item->updateWindowPixmap();

     int i = stacking_list.indexOf(window);
-    if (i == -1) {
-        STACKING("adding 0x%lx to stack", window);
+    if (i == -1)
         stacking_list.append(window);
-    } else {
-        STACKING_MOVE(i, stacking_list.size()-1);
+    else
         safe_move(stacking_list, i, stacking_list.size() - 1);
-    }
     roughSort();

     addItem(item);
@@ -3263,13 +3187,11 @@
     if (on_top) {
         //qDebug() << __func__ << "to top:" << w;
         setWindowState(w, NormalState);
-        STACKING_MOVE(wp, stacking_list.size()-1);
         safe_move(stacking_list, wp, stacking_list.size() - 1);
         // needed so that checkStacking() finds the current application
         roughSort();
     } else {
         //qDebug() << __func__ << "to bottom:" << w;
-        STACKING_MOVE(wp, 0);
         safe_move(stacking_list, wp, 0);
     }
     updateWinList();


Fix static assertion on xcode 9 (#379)

Fix static assertion on xcode 9 (#379)

* Change allocator type to match map key

--- rclcpp/include/rclcpp/intra_process_manager_impl.hpp
+++ rclcpp/include/rclcpp/intra_process_manager_impl.hpp
@@ -269,7 +269,7 @@
       const char *,
       AllocSet,
       strcmp_wrapper,
-      RebindAlloc<std::pair<const std::string, AllocSet>>>;
+      RebindAlloc<std::pair<const char * const, AllocSet>>>;

   SubscriptionMap subscriptions_;


Improved SimpleMath interop with DirectXMath constants

--- SimpleMathTest/SimpleMathTest.cpp
+++ SimpleMathTest/SimpleMathTest.cpp
@@ -11,6 +11,8 @@

 #include <d3d11.h>
 #include "SimpleMath.h"
+
+#include <DirectXColors.h>

 #include <stdio.h>

@@ -1033,6 +1035,27 @@
     }

     {
+        Vector2 vc = Colors::CornflowerBlue;
+
+        if (!XMScalarNearEqual(vc.x, Colors::CornflowerBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vc.y, Colors::CornflowerBlue.f[1], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 ctor\n");
+            success = false;
+        }
+
+        Vector2 vt;
+        vt = Colors::MidnightBlue;
+
+        if (!XMScalarNearEqual(vt.x, Colors::MidnightBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vt.y, Colors::MidnightBlue.f[1], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 =\n");
+            success = false;
+        }
+    }
+
+    {
         XMFLOAT2 xm(6.f, -2.f);
         Vector2 vi;
         vi = xm;
@@ -1961,6 +1984,29 @@
         success = false;
     }

+    {
+        Vector3 vc = Colors::CornflowerBlue;
+
+        if (!XMScalarNearEqual(vc.x, Colors::CornflowerBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vc.y, Colors::CornflowerBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vc.z, Colors::CornflowerBlue.f[2], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 ctor\n");
+            success = false;
+        }
+
+        Vector3 vt;
+        vt = Colors::MidnightBlue;
+
+        if (!XMScalarNearEqual(vt.x, Colors::MidnightBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vt.y, Colors::MidnightBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vt.z, Colors::MidnightBlue.f[2], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 =\n");
+            success = false;
+        }
+    }
+
     v += v2;
     if ( v != Vector3(5,7,9) )
     {
@@ -2873,6 +2919,31 @@
     {
         printf("ERROR: =\n");
         success = false;
+    }
+
+    {
+        Vector4 vc = Colors::CornflowerBlue;
+
+        if (!XMScalarNearEqual(vc.x, Colors::CornflowerBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vc.y, Colors::CornflowerBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vc.z, Colors::CornflowerBlue.f[2], EPSILON)
+            || !XMScalarNearEqual(vc.w, Colors::CornflowerBlue.f[3], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 ctor\n");
+            success = false;
+        }
+
+        Vector4 vt;
+        vt = Colors::MidnightBlue;
+
+        if (!XMScalarNearEqual(vt.x, Colors::MidnightBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vt.y, Colors::MidnightBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vt.z, Colors::MidnightBlue.f[2], EPSILON)
+            || !XMScalarNearEqual(vt.w, Colors::MidnightBlue.f[3], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 =\n");
+            success = false;
+        }
     }

     v += v2;
@@ -4395,6 +4466,31 @@
         }
     }

+    {
+        Plane vc = Colors::CornflowerBlue;
+
+        if (!XMScalarNearEqual(vc.x, Colors::CornflowerBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vc.y, Colors::CornflowerBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vc.z, Colors::CornflowerBlue.f[2], EPSILON)
+            || !XMScalarNearEqual(vc.w, Colors::CornflowerBlue.f[3], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 ctor\n");
+            success = false;
+        }
+
+        Plane vt;
+        vt = Colors::MidnightBlue;
+
+        if (!XMScalarNearEqual(vt.x, Colors::MidnightBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vt.y, Colors::MidnightBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vt.z, Colors::MidnightBlue.f[2], EPSILON)
+            || !XMScalarNearEqual(vt.w, Colors::MidnightBlue.f[3], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 =\n");
+            success = false;
+        }
+    }
+
     VerifyEqual(c.Normal(), Vector3(5, 6, 7));
     c.Normal(Vector3(0, 1, 2));
     VerifyEqual(c.Normal(), Vector3(0, 1, 2));
@@ -4505,6 +4601,31 @@
         }
     }

+    {
+        Quaternion vc = Colors::CornflowerBlue;
+
+        if (!XMScalarNearEqual(vc.x, Colors::CornflowerBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vc.y, Colors::CornflowerBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vc.z, Colors::CornflowerBlue.f[2], EPSILON)
+            || !XMScalarNearEqual(vc.w, Colors::CornflowerBlue.f[3], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 ctor\n");
+            success = false;
+        }
+
+        Quaternion vt;
+        vt = Colors::MidnightBlue;
+
+        if (!XMScalarNearEqual(vt.x, Colors::MidnightBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vt.y, Colors::MidnightBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vt.z, Colors::MidnightBlue.f[2], EPSILON)
+            || !XMScalarNearEqual(vt.w, Colors::MidnightBlue.f[3], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 =\n");
+            success = false;
+        }
+    }
+
     c += a;
     VerifyEqual(c, Quaternion(6, 8, 10, 12));

@@ -4663,6 +4784,31 @@
             || !XMScalarNearEqual(xm.w, vi.w, EPSILON))
         {
             printf("ERROR: XMFLOAT4 =\n");
+            success = false;
+        }
+    }
+
+    {
+        Color vc = Colors::CornflowerBlue;
+
+        if (!XMScalarNearEqual(vc.x, Colors::CornflowerBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vc.y, Colors::CornflowerBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vc.z, Colors::CornflowerBlue.f[2], EPSILON)
+            || !XMScalarNearEqual(vc.w, Colors::CornflowerBlue.f[3], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 ctor\n");
+            success = false;
+        }
+
+        Color vt;
+        vt = Colors::MidnightBlue;
+
+        if (!XMScalarNearEqual(vt.x, Colors::MidnightBlue.f[0], EPSILON)
+            || !XMScalarNearEqual(vt.y, Colors::MidnightBlue.f[1], EPSILON)
+            || !XMScalarNearEqual(vt.z, Colors::MidnightBlue.f[2], EPSILON)
+            || !XMScalarNearEqual(vt.w, Colors::MidnightBlue.f[3], EPSILON))
+        {
+            printf("ERROR: XMVECTORF32 =\n");
             success = false;
         }
     }


Fix for international(non-Latin) build environment

--- gameplay/src/Bundle.cpp
+++ gameplay/src/Bundle.cpp
@@ -182,7 +182,7 @@

     // Read the GPB header info.
     char sig[9];
-    if (fread(sig, 1, 9, fp) != 9 || memcmp(sig, "GPB\r\n\x1A\n", 9) != 0)
+    if (fread(sig, 1, 9, fp) != 9 || memcmp(sig, "\xABGPB\xBB\r\n\x1A\n", 9) != 0)
     {
         GP_ERROR("Invalid GPB header for bundle '%s'.", path);
         if (fclose(fp) != 0)


- Do not start the timer when starting the thread

--- host/desktop_session.cc
+++ host/desktop_session.cc
@@ -35,9 +35,6 @@
 {
     runner_ = ui_thread_.message_loop_proxy();
     DCHECK(runner_);
-
-    timer_.Start(kAttachTimeout,
-                 std::bind(&DesktopSession::OnSessionAttachTimeout, this));

     OnSessionAttached(WTSGetActiveConsoleSessionId());


pch fix

pch fix

--- src/world/Server/WorldConfig.cpp
+++ src/world/Server/WorldConfig.cpp
@@ -12,7 +12,7 @@
 #include "Config/Config.h"
 #include "Map/MapCell.h"
 //#include "Server/WorldSocket.h"
-#include "Units/Players/PlayerDefines.hpp"
+#include "Macros/PlayerMacros.hpp"
 #include "shared/Log.hpp"


Made settings better behave better

Made settings better behave better

Signed-off-by: Dan Printzell <69f25cbe4b2608181d39803083cb5ee0c30f2794@gmail.com>

--- src/world/system/imguisystem.cpp
+++ src/world/system/imguisystem.cpp
@@ -5,6 +5,11 @@
 #include "../../lib/imgui.h"

 void ImGuiSystem::update(World& world, float delta) {
+	ImGui::SetNextWindowPos(ImVec2(8, 48), ImGuiSetCond_Once);
+	ImGui::SetNextWindowSize(ImVec2(384, 512), ImGuiSetCond_Once);
+	ImGui::SetNextWindowCollapsed(true, ImGuiSetCond_Once);
+	ImGui::Begin("Settings Window");
+
 	ImGui::Text("Entities:");
 	for (std::shared_ptr<Entity> entity : world.getEntities()) {
 		if (ImGui::TreeNode(entity->getName().c_str())) {
@@ -31,6 +36,8 @@
 			ImGui::TreePop();
 		}
 	}
+
+	ImGui::End();
 }

 void ImGuiSystem::registerImGui() {}


Properly set packet length when rewriting commands

--- gateway/src/gateway.cpp
+++ gateway/src/gateway.cpp
@@ -159,7 +159,7 @@
     memset(&cassandra_addr, 0, sizeof(cassandra_addr));
     cassandra_addr.sin_family = AF_INET;
     cassandra_addr.sin_addr.s_addr = inet_addr(CASSANDRA_IP);
-    cassandra_addr.sin_port = htons(CASSANDRA_PORT + 1 );
+    cassandra_addr.sin_port = htons(CASSANDRA_PORT + 1);

     // Bind the socket and port to the name
     if (connect(cassandrafd, (struct sockaddr*)&cassandra_addr, sizeof(cassandra_addr)) < 0) {
@@ -440,7 +440,7 @@
                         else {
                             char *userToken = (char *)malloc(TOKEN_LENGTH + 1);
                             memset(userToken, 0, TOKEN_LENGTH + 1);
-
+//FIXME need to switch prefix token with the internal one
                             strncpy(userToken, sm->value, TOKEN_LENGTH); //Copy the token into the variable for user later on
                             char *username = (char *)malloc(strlen(sm->value) - TOKEN_LENGTH + 1); //Allocate temp storage incase username > TOKEN_LENGTH
                             memset(username, 0, strlen(sm->value) - TOKEN_LENGTH + 1);
@@ -533,6 +533,8 @@

                 cql_packet_t *new_packet = (cql_packet_t *)malloc(14 + strlen(new_query)); // 8 byte header, 4 byte int, new_query, 2 byte consistency
                 memcpy((char *)new_packet, packet, 8); // Copy header
+                new_packet->length = 6 + strlen(new_query); // Fix the length field
+                new_packet->length = htonl(new_packet->length);
                 memcpy((char *)new_packet + 8, &query_len, 4);
                 memcpy((char *)new_packet + 12, new_query, strlen(new_query));
                 memcpy((char *)new_packet + 12 + strlen(new_query), &consistency, 2);
@@ -576,6 +578,8 @@

                 cql_packet_t *new_packet = (cql_packet_t *)malloc(12 + strlen(new_query)); // 8 byte header, 4 byte int, new_query
                 memcpy((char *)new_packet, packet, 8); // Copy header
+                new_packet->length = 4 + strlen(new_query); // Fix the length field
+                new_packet->length = htonl(new_packet->length);
                 memcpy((char *)new_packet + 8, &query_len, 4);
                 memcpy((char *)new_packet + 12, new_query, strlen(new_query));


FIX - Case insensitivity for table names --kkd

--- gateway/src/helpers.cpp
+++ gateway/src/helpers.cpp
@@ -654,17 +654,17 @@
 }

 bool isImportantTable(char *keyspace, char *tableName){
-    if (strcmp(keyspace, "system") == 0) {
-        if(strcmp(tableName,"schema_keyspaces") == 0){
+    if (strcasecmp(keyspace, "system") == 0) {
+        if(strcasecmp(tableName,"schema_keyspaces") == 0){
             return true;
-        }else if(strcmp(tableName,"schema_columnfamilies") == 0){
+        }else if(strcasecmp(tableName,"schema_columnfamilies") == 0){
             return true;
-        }else if(strcmp(tableName,"schema_columns") == 0){
+        }else if(strcasecmp(tableName,"schema_columns") == 0){
             return true;
         }
     }
-    else if (strcmp(keyspace, "system_auth") == 0) {
-        if(strcmp(tableName,"users") == 0){
+    else if (strcasecmp(keyspace, "system_auth") == 0) {
+        if(strcasecmp(tableName,"users") == 0){
             return true;
         }
     }
@@ -679,4 +679,4 @@
     }else{
         return false;
     }
-}+}


(split) p4i integration Integrate 304288 from 4.4 to main: Warn if we're about to qRegisterMetaType on a class that has no public default constructor. Detecting copy constructors requires too many complicated changes to the generator to be worth it, see note in task 199219.

[git-p4: depot-paths = "//depot/qtjambi/main/": change = 304289]

--- src/metainfogenerator.cpp
+++ src/metainfogenerator.cpp
@@ -696,6 +696,25 @@
           << constructorName
           << "));" << endl;
     } else {
+        // Look for default constructor and copy constructor since both
+        // of these are required for registerMetaType()
+        if (cls != 0) {
+            AbstractMetaFunctionList functions = cls->queryFunctions(AbstractMetaClass::WasPublic | AbstractMetaClass::Constructors);
+
+            bool hasDefaultConstructor = false;
+            foreach (AbstractMetaFunction *function, functions) {
+                // Default constructor has to be present
+                if (function->wasPublic() && function->actualMinimumArgumentCount() == 0)
+                    hasDefaultConstructor = true;
+            }
+
+            if (!hasDefaultConstructor) {
+                ReportHandler::warning(QString("Value type '%1' is missing a default constructor. "
+                                       "The resulting C++ code will not compile. If necessary, use <custom-constructor> and "
+                                       "<custom-destructor> tags to provide the constructors.").arg(cls->fullName()));
+            }
+
+        }
         s << "    qRegisterMetaType<" << entry->qualifiedCppName() << ">(\"" << entry->qualifiedCppName() << "\");" << endl;
     }


fix map metric

fix map metric

--- src/metric/map_metric.hpp
+++ src/metric/map_metric.hpp
@@ -56,6 +56,15 @@
         sum_query_weights_ += query_weights_[i];
       }
     }
+
+    npos_per_query_.resize(num_queries_, 0);
+    for (data_size_t i = 0; i < num_queries_; ++i) {
+      for (data_size_t j = query_boundaries_[i]; j < query_boundaries_[i + 1]; ++j) {
+        if (label_[j] > 0.5f) {
+          ++npos_per_query_[i];
+        }
+      }
+    }
   }

   const std::vector<std::string>& GetName() const override {
@@ -66,7 +75,7 @@
     return 1.0f;
   }

-  void CalMapAtK(std::vector<int> ks, const float* label,
+  void CalMapAtK(std::vector<int> ks, data_size_t npos, const float* label,
                  const double* score, data_size_t num_data, std::vector<double>* out) const {
     // get sorted indices by score
     std::vector<data_size_t> sorted_idx;
@@ -80,7 +89,7 @@
     double sum_ap = 0.0f;
     data_size_t cur_left = 0;
     for (size_t i = 0; i < ks.size(); ++i) {
-      data_size_t cur_k = ks[i];
+      data_size_t cur_k = static_cast<data_size_t>(ks[i]);
       if (cur_k > num_data) { cur_k = num_data; }
       for (data_size_t j = cur_left; j < cur_k; ++j) {
         data_size_t idx = sorted_idx[j];
@@ -89,7 +98,11 @@
           sum_ap += static_cast<double>(num_hit) / (j + 1.0f);
         }
       }
-      (*out)[i] = sum_ap / cur_k;
+      if (npos > 0) {
+        (*out)[i] = sum_ap / std::min(npos, cur_k);
+      } else {
+        (*out)[i] = 1.0f;
+      }
       cur_left = cur_k;
     }
   }
@@ -104,7 +117,7 @@
       #pragma omp parallel for schedule(guided) firstprivate(tmp_map)
       for (data_size_t i = 0; i < num_queries_; ++i) {
         const int tid = omp_get_thread_num();
-        CalMapAtK(eval_at_, label_ + query_boundaries_[i],
+        CalMapAtK(eval_at_, npos_per_query_[i], label_ + query_boundaries_[i],
                   score + query_boundaries_[i], query_boundaries_[i + 1] - query_boundaries_[i], &tmp_map);
         for (size_t j = 0; j < eval_at_.size(); ++j) {
           result_buffer_[tid][j] += tmp_map[j];
@@ -114,7 +127,7 @@
       #pragma omp parallel for schedule(guided) firstprivate(tmp_map)
       for (data_size_t i = 0; i < num_queries_; ++i) {
         const int tid = omp_get_thread_num();
-        CalMapAtK(eval_at_, label_ + query_boundaries_[i],
+        CalMapAtK(eval_at_, npos_per_query_[i], label_ + query_boundaries_[i],
                   score + query_boundaries_[i], query_boundaries_[i + 1] - query_boundaries_[i], &tmp_map);
         for (size_t j = 0; j < eval_at_.size(); ++j) {
           result_buffer_[tid][j] += tmp_map[j] * query_weights_[i];
@@ -150,6 +163,7 @@
   /*! \brief Number of threads */
   int num_threads_;
   std::vector<std::string> name_;
+  std::vector<data_size_t> npos_per_query_;
 };

 }  // namespace LightGBM


stupid typo

stupid typo

git-svn-id: 5ed41f1a829e67f361a910660d50e80273fdbdd4@310 f34a0644-6cda-11de-9313-dd366511c2ff

--- src/models/dwarfmodel.cpp
+++ src/models/dwarfmodel.cpp
@@ -26,7 +26,7 @@
 #include "dfinstance.h"
 #include "dwarfmodel.h"
 #include "dwarf.h"
-#include "skill.h"wh
+#include "skill.h"
 #include "labor.h"
 #include "profession.h"
 #include "statetableview.h"


AdminPanelConnector: send lve_min_uid

AdminPanelConnector: send lve_min_uid

--- src/agent/Core/ApplicationPool/Group/StateInspection.cpp
+++ src/agent/Core/ApplicationPool/Group/StateInspection.cpp
@@ -233,6 +233,7 @@
 	result["default_user"] = NON_EMPTY_SVAL(options.defaultUser);
 	result["default_group"] = NON_EMPTY_SVAL(options.defaultGroup);
 	result["enabled"] = VAL(true, false);
+	result["lve_min_uid"] = VAL(options.lveMinUid, DEFAULT_LVE_MIN_UID);

 	result["type"] = NON_EMPTY_SVAL(options.appType);
 	result["startup_file"] = NON_EMPTY_SVAL(options.startupFile);


lvls added

lvls added

--- game/BreakOut.cpp
+++ game/BreakOut.cpp
@@ -3,6 +3,7 @@
 #include "libgame.h"
 #include "sprite.h"
 #include "binary.h"
+#include "string"
 #include <stdlib.h>

 /* Встроенные цвета:
@@ -110,7 +111,7 @@

 struct BreakOutData
 {
-	int Board1X,Board2X, flag, k, ballX, ballY,speedy,speedx;
+	int Board1Y, Board2Y, flag, k, ballX, ballY, speedy, speedx, lvlcount;
 	bool ft;
     /* Объявляйте ваши переменные здесь */
     /* Чтобы потом обращаться к ним, пишите data->ПЕРЕМЕННАЯ */
@@ -119,14 +120,17 @@

 static void BreakOut_prepare()
 {
-	//game_set_ups(30);
+	game_set_ups(10);
+	data->lvlcount = 0;
     data->ballX = 30;
 	data->ballY = 30;
     data->speedy = 1;
 	data->speedx = 1;
-	data->Board1X = 26;
-	data->Board2X = 26;
+	data->Board1Y = 26;
+	data->Board2Y = 26;
 	data->ft = true;
+
+	//while(!game_is_button_pressed(BUTTON_DOWN));
     /* Здесь код, который будет исполнятся один раз */
     /* Здесь нужно инициализировать переменные */
 }
@@ -135,9 +139,35 @@
 {
     /* Здесь код, который будет вывзваться для отрисовки кадра */
     /* Он не должен менять состояние игры, для этого есть функция update */
-    game_draw_sprite(&YourSprite,0,data->Board2X,GREEN);
+    game_draw_sprite(&YourSprite,0,data->Board2Y,GREEN);
     game_draw_sprite(&Ball,data->ballX,data->ballY,RED);
-	game_draw_sprite(&YourSprite,61,data->Board1X,BLUE);
+	game_draw_sprite(&YourSprite,61,data->Board1Y,BLUE);
+	switch(data->lvlcount)
+	{
+	case 2:
+		game_draw_text((uint8_t*)"GO GO", 18, 26, WHITE);
+		game_set_ups(25);
+		break;
+	case 4: //10
+		game_draw_text((uint8_t*)"NORMA", 18, 26, GREEN);
+		game_set_ups(35);
+		break;
+	case 6: //20
+		game_draw_text((uint8_t*)"HARD", 18, 26, BROWN);
+		game_set_ups(45);
+		break;
+	case 8:
+		game_draw_text((uint8_t*)"HARDCORE", 12, 26, RED);
+		game_set_ups(55);
+		break;
+	case 10:
+		for(int i = 0; i < 1000; i++)
+		game_draw_text((uint8_t*)"SUICIDE", 12, 26, RED);
+		for(int i = 0; i < 1000; i++)
+		game_draw_text((uint8_t*)"SUICIDE", 12, 26, BROWN);
+		game_set_ups(65);
+		break;
+	}
     /* Здесь (и только здесь) нужно вызывать функции game_draw_??? */
 }

@@ -145,39 +175,38 @@
 {
     /* Здесь код, который будет выполняться в цикле */
     /* Переменная delta содержит количество миллисекунд с последнего вызова */
-
-    if(game_is_button_pressed(BUTTON_DOWN) && data->Board1X < 51)
-    {
-      data->Board1X = (data->Board1X + 1);
-      }
-      if(game_is_button_pressed(BUTTON_UP) && data->Board1X > 0)
-    {
-      data->Board1X = (data->Board1X - 1);
+    if(game_is_button_pressed(BUTTON_DOWN) && data->Board1Y < 52)
+    {
+      data->Board1Y = (data->Board1Y + 1);
+      }
+      if(game_is_button_pressed(BUTTON_UP) && data->Board1Y > 0)
+    {
+      data->Board1Y = (data->Board1Y - 1);

       }

-	  if(game_is_button_pressed(BUTTON_A) && data->Board2X < 51)
-    {
-      data->Board2X = (data->Board2X + 1);
-      }
-      if(game_is_button_pressed(BUTTON_B) && data->Board2X > 0)
-    {
-      data->Board2X = (data->Board2X - 1);
+	  if(game_is_button_pressed(BUTTON_SW) && data->Board2Y < 52)
+    {
+      data->Board2Y = (data->Board2Y + 1);
+      }
+      if(game_is_button_pressed(BUTTON_NW) && data->Board2Y > 0)
+    {
+      data->Board2Y = (data->Board2Y - 1);

       }

-	  if((data->ballX >= (data->Board1X - 4)) && (data->ballX <= (data->Board1X + 16)) &&
-		  ( (data->ballX == 57) || (data->ballX == 3) )) {
+	  if((data->ballY >= (data->Board1Y - 4)) && (data->ballY <= (data->Board1Y + 16)) &&
+		  ( (data->ballX == 57) )) {

 		  data->speedx = -data->speedx;
-
+			data->lvlcount++;
 	  }

-	  if((data->ballX >= (data->Board2X - 4)) && (data->ballX <= (data->Board2X + 16)) &&
-		  ( (data->ballX == 57) || (data->ballX == 3) ) ) {
+	  if((data->ballY >= (data->Board2Y - 6)) &&
+		  (data->ballY <= (data->Board2Y + 16)) &&
+		  ( (data->ballX == 3) ) ) {

 		  data->speedx = -data->speedx;
-
 	  }

 	  if( (data->ballY == 0) || (data->ballY == 60) ) data->speedy = -data->speedy;


Fix run.cxx output filename

Fix run.cxx output filename

--- bin/run.cxx
+++ bin/run.cxx
@@ -100,14 +100,24 @@
             continue;
         }

+
         // -- Output file -- //
+        // CMS doesn't use something like 'mcChannelNumber', need to keep the same file names
+        // therefore, make new directories for the different selections
+        struct stat dirBuffer;
+        std::string outpath = outpathBase+"/"+selection+customFileEnding;
+        if ( !(stat((outpath).c_str(),&dirBuffer)==0 && S_ISDIR(dirBuffer.st_mode)) ){
+            cma::DEBUG("RUN : Creating directory for storing output: "+outpath);
+            system( ("mkdir "+outpath).c_str() );  // make the directory so the files are grouped together
+        }
+
         std::size_t pos   = filename.find_last_of(".");     // the last ".", i.e., ".root"
         std::size_t found = filename.find_last_of("/");     // the last "/"
         std::string outputFilename = filename.substr(found+1,pos-1-found); // betwee "/" and "."
         // hopefully this returns: "diboson_WW_361082" given something like:
         // "/some/path/to/file/diboson_WW_361082.root"

-        std::string fullOutputFilename = outpath+"/"+outputFilename+"_"+selection+customFileEnding+".root";
+        std::string fullOutputFilename = outpath+"/"+outputFilename+".root";
         std::unique_ptr<TFile> outputFile(TFile::Open( fullOutputFilename.c_str(), "RECREATE"));
         cma::INFO("RUN :   >> Saving to "+fullOutputFilename);

@@ -252,4 +262,4 @@
     cma::INFO("RUN : *** End of file loop *** ");
 }

-// THE END+// THE END


Fix a bug:   #elif MFEM_USE_HIP  -->  #elif defined(MFEM_USE_HIP)

--- general/mem_manager.cpp
+++ general/mem_manager.cpp
@@ -1654,9 +1654,9 @@
                  mm.GetAliasDevicePtr(h_ptr, size, false) :
                  mm.GetDevicePtr(h_ptr, size, false);
    char *h_buf = new char[size];
-#ifdef MFEM_USE_CUDA
+#if defined(MFEM_USE_CUDA)
    CuMemcpyDtoH(h_buf, d_ptr, size);
-#elif MFEM_USE_HIP
+#elif defined(MFEM_USE_HIP)
    HipMemcpyDtoH(h_buf, d_ptr, size);
 #else
    std::memcpy(h_buf, d_ptr, size);


Bring together several more 'function'-like operations

--- renderdoc/driver/shaders/spirv/spirv_disassemble.cpp
+++ renderdoc/driver/shaders/spirv/spirv_disassemble.cpp
@@ -1146,7 +1146,9 @@

 				return ret;
 			}
-			// texture samples almost identical to function call
+			// Most of the following are just of the form OpcodeName(arg1, arg2, arg3..)
+			// like a function call. Operations can very by return type (e.g. image
+			// vs imagesparse opcodes) without changing their disassembly
 			case spv::OpImageSampleImplicitLod:
 			case spv::OpImageSampleExplicitLod:
 			case spv::OpImageSampleDrefImplicitLod:
@@ -1155,7 +1157,22 @@
 			case spv::OpImageSampleProjExplicitLod:
 			case spv::OpImageSampleProjDrefImplicitLod:
 			case spv::OpImageSampleProjDrefExplicitLod:
-			// conversions and unary operations taking one ID can be treated the same way
+			case spv::OpImageSparseSampleImplicitLod:
+			case spv::OpImageSparseSampleExplicitLod:
+			case spv::OpImageSparseSampleDrefImplicitLod:
+			case spv::OpImageSparseSampleDrefExplicitLod:
+			case spv::OpImageSparseSampleProjImplicitLod:
+			case spv::OpImageSparseSampleProjExplicitLod:
+			case spv::OpImageSparseSampleProjDrefImplicitLod:
+			case spv::OpImageSparseSampleProjDrefExplicitLod:
+			case spv::OpImageFetch:
+			case spv::OpImageGather:
+			case spv::OpImageDrefGather:
+			case spv::OpImageRead:
+			case spv::OpImageWrite:
+			case spv::OpImageSparseFetch:
+			case spv::OpImageSparseGather:
+			case spv::OpImageSparseDrefGather:
 			case spv::OpConvertFToS:
 			case spv::OpConvertFToU:
 			case spv::OpConvertUToF:
@@ -1165,10 +1182,36 @@
 			case spv::OpUConvert:
 			case spv::OpSConvert:
 			case spv::OpBitcast:
+			case spv::OpBitReverse:
+			case spv::OpBitCount:
 			case spv::OpAny:
 			case spv::OpAll:
 			case spv::OpIsNan:
 			case spv::OpIsInf:
+			case spv::OpOuterProduct:
+			case spv::OpTranspose:
+			case spv::OpCopyObject:
+			case spv::OpDPdx:
+			case spv::OpDPdy:
+			case spv::OpFwidth:
+			case spv::OpDPdxFine:
+			case spv::OpDPdyFine:
+			case spv::OpFwidthFine:
+			case spv::OpDPdxCoarse:
+			case spv::OpDPdyCoarse:
+			case spv::OpFwidthCoarse:
+			case spv::OpEmitVertex:
+			case spv::OpEmitStreamVertex:
+			case spv::OpEndPrimitive:
+			case spv::OpEndStreamPrimitive:
+			case spv::OpImageSparseTexelsResident:
+			case spv::OpImage:
+			case spv::OpSampledImage:
+			case spv::OpImageQuerySizeLod:
+			case spv::OpImageQuerySize:
+			case spv::OpImageQueryLod:
+			case spv::OpImageQueryLevels:
+			case spv::OpImageQuerySamples:
 			case spv::OpFunctionCall:
 			{
 				RDCASSERT(op);
@@ -1178,14 +1221,33 @@
 				if(!inlineOp && op->type->type != SPVTypeData::eVoid)
 					ret = StringFormat::Fmt("%s %s = ", op->type->GetName().c_str(), GetIDName().c_str());

+				size_t numArgs = op->arguments.size();
+
 				if(opcode == spv::OpFunctionCall)
+				{
 					ret += ids[op->funcCall]->GetIDName() + "(";
+				}
 				else if(opcode == spv::OpBitcast)
+				{
 					ret += "Bitcast<" + op->type->GetName() + ">(";
+				}
+				else if(opcode == spv::OpImageGather)
+				{
+					// last argument is the component, reads better to have this
+					// as part of the operation (if it was a constant instead of
+					// an ID
+					string arg;
+					op->GetArg(ids, numArgs-1, arg);
+					ret += "ImageGather[" + arg + "](";
+
+					numArgs--;
+				}
 				else
+				{
 					ret += ToStr::Get(opcode) + "(";
-
-				for(size_t i=0; i < op->arguments.size(); i++)
+				}
+
+				for(size_t i=0; i < numArgs; i++)
 				{
 					string arg;
 					op->GetArg(ids, i, arg);
@@ -3991,11 +4053,80 @@
 			case spv::OpImageSampleProjExplicitLod:
 			case spv::OpImageSampleProjDrefImplicitLod:
 			case spv::OpImageSampleProjDrefExplicitLod:
+			// these only vary from the above by return type, which doesn't change
+			// their disassembly
+			case spv::OpImageSparseSampleImplicitLod:
+			case spv::OpImageSparseSampleExplicitLod:
+			case spv::OpImageSparseSampleDrefImplicitLod:
+			case spv::OpImageSparseSampleDrefExplicitLod:
+			case spv::OpImageSparseSampleProjImplicitLod:
+			case spv::OpImageSparseSampleProjExplicitLod:
+			case spv::OpImageSparseSampleProjDrefImplicitLod:
+			case spv::OpImageSparseSampleProjDrefExplicitLod:
+			// similarly the image operations are very close
+			case spv::OpImageFetch:
+			case spv::OpImageGather:
+			case spv::OpImageDrefGather:
+			case spv::OpImageRead:
+			case spv::OpImageWrite:
+			case spv::OpImageSparseFetch:
+			case spv::OpImageSparseGather:
+			case spv::OpImageSparseDrefGather:
 			{
 				uint32_t idx = 1;

 				SPVInstruction *typeInst = module.GetByID(spirv[it+idx]); idx++;
 				RDCASSERT(typeInst && typeInst->type);
+
+				// bucket the different opcodes
+				bool implicit = false, dref = false, image = false;
+				switch(op.opcode)
+				{
+					case spv::OpImageSampleImplicitLod:
+					case spv::OpImageSampleDrefImplicitLod:
+					case spv::OpImageSampleProjImplicitLod:
+					case spv::OpImageSampleProjDrefImplicitLod:
+					case spv::OpImageSparseSampleImplicitLod:
+					case spv::OpImageSparseSampleDrefImplicitLod:
+					case spv::OpImageSparseSampleProjImplicitLod:
+					case spv::OpImageSparseSampleProjDrefImplicitLod:
+						implicit = true;
+						break;
+					default:
+						break;
+				}
+				switch(op.opcode)
+				{
+					case spv::OpImageFetch:
+					case spv::OpImageGather:
+					case spv::OpImageDrefGather:
+					case spv::OpImageRead:
+					case spv::OpImageWrite:
+					case spv::OpImageSparseFetch:
+					case spv::OpImageSparseGather:
+					case spv::OpImageSparseDrefGather:
+						image = true;
+						break;
+					default:
+						break;
+				}
+				switch(op.opcode)
+				{
+					case spv::OpImageSampleDrefImplicitLod:
+					case spv::OpImageSampleDrefExplicitLod:
+					case spv::OpImageSampleProjDrefImplicitLod:
+					case spv::OpImageSampleProjDrefExplicitLod:
+					case spv::OpImageDrefGather:
+					case spv::OpImageSparseSampleDrefImplicitLod:
+					case spv::OpImageSparseSampleDrefExplicitLod:
+					case spv::OpImageSparseSampleProjDrefImplicitLod:
+					case spv::OpImageSparseSampleProjDrefExplicitLod:
+					case spv::OpImageSparseDrefGather:
+						dref = true;
+						break;
+					default:
+						break;
+				}

 				op.op = new SPVOperation();
 				op.op->type = typeInst->type;
@@ -4019,11 +4150,9 @@
 					op.op->arguments.push_back(argInst);
 				}

-				// Dref (depth reference)
-				if(op.opcode == spv::OpImageSampleDrefImplicitLod ||
-					op.opcode == spv::OpImageSampleDrefExplicitLod ||
-					op.opcode == spv::OpImageSampleProjDrefImplicitLod ||
-					op.opcode == spv::OpImageSampleProjDrefExplicitLod)
+				// Dref (depth reference), gather (component) and write (written value)
+				// have an extra value
+				if(dref || op.opcode == spv::OpImageGather || op.opcode == spv::OpImageWrite)
 				{
 					SPVInstruction *argInst = module.GetByID(spirv[it+idx]); idx++;
 					RDCASSERT(argInst);
@@ -4039,11 +4168,8 @@
 					idx++;
 				}

-				// explicit lod instructions must pass a lod or grad argument
-				if(op.opcode == spv::OpImageSampleExplicitLod ||
-					op.opcode == spv::OpImageSampleDrefExplicitLod ||
-					op.opcode == spv::OpImageSampleProjExplicitLod ||
-					op.opcode == spv::OpImageSampleProjDrefExplicitLod)
+				// explicit lod sample instructions must pass a lod or grad argument
+				if(!implicit && !image)
 					RDCASSERT(imMask & (spv::ImageOperandsLodMask|spv::ImageOperandsGradMask));

 				// optional arguments
@@ -4051,10 +4177,7 @@
 				if(imMask & spv::ImageOperandsBiasMask)
 				{
 					RDCASSERT(WordCount > idx);
-					RDCASSERT(op.opcode != spv::OpImageSampleExplicitLod &&
-						op.opcode != spv::OpImageSampleDrefExplicitLod &&
-						op.opcode != spv::OpImageSampleProjExplicitLod &&
-						op.opcode != spv::OpImageSampleProjDrefExplicitLod);
+					RDCASSERT(implicit);
 					op.op->im.bias = module.GetByID(spirv[it+idx]); idx++;
 					RDCASSERT(op.op->im.bias);
 					op.op->arguments.push_back(op.op->im.bias);
@@ -4063,10 +4186,7 @@
 				if(imMask & spv::ImageOperandsLodMask)
 				{
 					RDCASSERT(WordCount > idx);
-					RDCASSERT(op.opcode == spv::OpImageSampleExplicitLod ||
-						op.opcode == spv::OpImageSampleDrefExplicitLod ||
-						op.opcode == spv::OpImageSampleProjExplicitLod ||
-						op.opcode == spv::OpImageSampleProjDrefExplicitLod);
+					RDCASSERT(!implicit);
 					op.op->im.lod = module.GetByID(spirv[it+idx]); idx++;
 					RDCASSERT(op.op->im.lod);
 					op.op->arguments.push_back(op.op->im.lod);
@@ -4075,10 +4195,7 @@
 				if(imMask & spv::ImageOperandsGradMask)
 				{
 					RDCASSERT(WordCount > idx+1);
-					RDCASSERT(op.opcode == spv::OpImageSampleExplicitLod ||
-						op.opcode == spv::OpImageSampleDrefExplicitLod ||
-						op.opcode == spv::OpImageSampleProjExplicitLod ||
-						op.opcode == spv::OpImageSampleProjDrefExplicitLod);
+					RDCASSERT(!implicit);
 					op.op->im.dx = module.GetByID(spirv[it+idx]); idx++;
 					op.op->im.dy = module.GetByID(spirv[it+idx]); idx++;
 					RDCASSERT(op.op->im.dx && op.op->im.dy);
@@ -4134,124 +4251,7 @@
 				curBlock->instructions.push_back(&op);
 				break;
 			}
-			// conversions and unary operations taking one ID can be treated the same way
-			case spv::OpConvertFToS:
-			case spv::OpConvertFToU:
-			case spv::OpConvertUToF:
-			case spv::OpConvertSToF:
-			case spv::OpQuantizeToF16:
-			case spv::OpFConvert:
-			case spv::OpUConvert:
-			case spv::OpSConvert:
-			case spv::OpBitcast:
-			case spv::OpAny:
-			case spv::OpAll:
-			case spv::OpIsNan:
-			case spv::OpIsInf:
-			case spv::OpFunctionCall:
-			{
-				int word = 1;
-
-				SPVInstruction *typeInst = module.GetByID(spirv[it+word]);
-				RDCASSERT(typeInst && typeInst->type);
-
-				word++;
-
-				op.op = new SPVOperation();
-				op.op->type = typeInst->type;
-
-				op.id = spirv[it+word];
-				module.ids[spirv[it+word]] = &op;
-
-				word++;
-
-				if(op.opcode == spv::OpFunctionCall)
-				{
-					// never combine function calls. It can sometimes be nice, but since
-					// we can combine multiple times and function calls have side-effects,
-					// it can appear to change the meaning of the code.
-					op.op->complexity = 100;
-
-					op.op->funcCall = spirv[it+word];
-
-					word++;
-				}
-
-				for(; word < WordCount; word++)
-				{
-					SPVInstruction *argInst = module.GetByID(spirv[it+word]);
-					RDCASSERT(argInst);
-
-					op.op->arguments.push_back(argInst);
-				}
-
-				curBlock->instructions.push_back(&op);
-				break;
-			}
-			case spv::OpVectorShuffle:
-			{
-				SPVInstruction *typeInst = module.GetByID(spirv[it+1]);
-				RDCASSERT(typeInst && typeInst->type);
-
-				op.op = new SPVOperation();
-				op.op->type = typeInst->type;
-
-				{
-					SPVInstruction *argInst = module.GetByID(spirv[it+3]);
-					RDCASSERT(argInst);
-
-					op.op->arguments.push_back(argInst);
-				}
-
-				{
-					SPVInstruction *argInst = module.GetByID(spirv[it+4]);
-					RDCASSERT(argInst);
-
-					op.op->arguments.push_back(argInst);
-				}
-
-				for(int i=5; i < WordCount; i++)
-					op.op->literals.push_back(spirv[it+i]);
-
-				op.id = spirv[it+2];
-				module.ids[spirv[it+2]] = &op;
-
-				curBlock->instructions.push_back(&op);
-				break;
-			}
-			case spv::OpExtInst:
-			{
-				SPVInstruction *typeInst = module.GetByID(spirv[it+1]);
-				RDCASSERT(typeInst && typeInst->type);
-
-				op.op = new SPVOperation();
-				op.op->type = typeInst->type;
-
-				{
-					SPVInstruction *setInst = module.GetByID(spirv[it+3]);
-					RDCASSERT(setInst);
-
-					op.op->arguments.push_back(setInst);
-				}
-
-				op.op->literals.push_back(spirv[it+4]);
-
-				for(int i=5; i < WordCount; i++)
-				{
-					SPVInstruction *argInst = module.GetByID(spirv[it+i]);
-					RDCASSERT(argInst);
-
-					op.op->arguments.push_back(argInst);
-				}
-
-				op.id = spirv[it+2];
-				module.ids[spirv[it+2]] = &op;
-
-				curBlock->instructions.push_back(&op);
-				break;
-			}
-			//////////////////////////////////////////////////////////////////////
-			// Easy to handle opcodes with just some number of ID parameters
+			// any operations that just take N IDs as parameters can be treated the same way
 			case spv::OpIAdd:
 			case spv::OpFAdd:
 			case spv::OpISub:
@@ -4315,25 +4315,145 @@
 			case spv::OpInBoundsAccessChain:
 			case spv::OpDot:
 			case spv::OpSelect:
-			{
-				SPVInstruction *typeInst = module.GetByID(spirv[it+1]);
+			case spv::OpConvertFToS:
+			case spv::OpConvertFToU:
+			case spv::OpConvertUToF:
+			case spv::OpConvertSToF:
+			case spv::OpQuantizeToF16:
+			case spv::OpFConvert:
+			case spv::OpUConvert:
+			case spv::OpSConvert:
+			case spv::OpBitcast:
+			case spv::OpBitReverse:
+			case spv::OpBitCount:
+			case spv::OpAny:
+			case spv::OpAll:
+			case spv::OpIsNan:
+			case spv::OpIsInf:
+			case spv::OpOuterProduct:
+			case spv::OpTranspose:
+			case spv::OpCopyObject:
+			case spv::OpDPdx:
+			case spv::OpDPdy:
+			case spv::OpFwidth:
+			case spv::OpDPdxFine:
+			case spv::OpDPdyFine:
+			case spv::OpFwidthFine:
+			case spv::OpDPdxCoarse:
+			case spv::OpDPdyCoarse:
+			case spv::OpFwidthCoarse:
+			case spv::OpEmitVertex:
+			case spv::OpEmitStreamVertex:
+			case spv::OpEndPrimitive:
+			case spv::OpEndStreamPrimitive:
+			case spv::OpImageSparseTexelsResident:
+			case spv::OpImage:
+			case spv::OpSampledImage:
+			case spv::OpImageQuerySizeLod:
+			case spv::OpImageQuerySize:
+			case spv::OpImageQueryLod:
+			case spv::OpImageQueryLevels:
+			case spv::OpImageQuerySamples:
+			case spv::OpFunctionCall:
+			{
+				int word = 1;
+
+				SPVInstruction *typeInst = module.GetByID(spirv[it+word]);
 				RDCASSERT(typeInst && typeInst->type);
+
+				word++;

 				op.op = new SPVOperation();
 				op.op->type = typeInst->type;
 				op.op->mathop = mathop;
-
-				for(int i=3; i < WordCount; i++)
+
+				op.id = spirv[it+word];
+				module.ids[spirv[it+word]] = &op;
+
+				word++;
+
+				if(op.opcode == spv::OpFunctionCall)
+				{
+					// never combine function calls. It can sometimes be nice, but since
+					// we can combine multiple times and function calls have side-effects,
+					// it can appear to change the meaning of the code.
+					op.op->complexity = 100;
+
+					op.op->funcCall = spirv[it+word];
+
+					word++;
+				}
+
+				for(; word < WordCount; word++)
+				{
+					SPVInstruction *argInst = module.GetByID(spirv[it+word]);
+					RDCASSERT(argInst);
+
+					op.op->arguments.push_back(argInst);
+				}
+
+				curBlock->instructions.push_back(&op);
+				break;
+			}
+			case spv::OpVectorShuffle:
+			{
+				SPVInstruction *typeInst = module.GetByID(spirv[it+1]);
+				RDCASSERT(typeInst && typeInst->type);
+
+				op.op = new SPVOperation();
+				op.op->type = typeInst->type;
+
+				{
+					SPVInstruction *argInst = module.GetByID(spirv[it+3]);
+					RDCASSERT(argInst);
+
+					op.op->arguments.push_back(argInst);
+				}
+
+				{
+					SPVInstruction *argInst = module.GetByID(spirv[it+4]);
+					RDCASSERT(argInst);
+
+					op.op->arguments.push_back(argInst);
+				}
+
+				for(int i=5; i < WordCount; i++)
+					op.op->literals.push_back(spirv[it+i]);
+
+				op.id = spirv[it+2];
+				module.ids[spirv[it+2]] = &op;
+
+				curBlock->instructions.push_back(&op);
+				break;
+			}
+			case spv::OpExtInst:
+			{
+				SPVInstruction *typeInst = module.GetByID(spirv[it+1]);
+				RDCASSERT(typeInst && typeInst->type);
+
+				op.op = new SPVOperation();
+				op.op->type = typeInst->type;
+
+				{
+					SPVInstruction *setInst = module.GetByID(spirv[it+3]);
+					RDCASSERT(setInst);
+
+					op.op->arguments.push_back(setInst);
+				}
+
+				op.op->literals.push_back(spirv[it+4]);
+
+				for(int i=5; i < WordCount; i++)
 				{
 					SPVInstruction *argInst = module.GetByID(spirv[it+i]);
 					RDCASSERT(argInst);

 					op.op->arguments.push_back(argInst);
 				}
-
+
 				op.id = spirv[it+2];
 				module.ids[spirv[it+2]] = &op;
-
+
 				curBlock->instructions.push_back(&op);
 				break;
 			}


ekf2: EKF2.cpp using matrix Eulerf, Quatf, Vector3f

--- src/modules/ekf2/EKF2.cpp
+++ src/modules/ekf2/EKF2.cpp
@@ -34,8 +34,10 @@
 #include "EKF2.hpp"

 using namespace time_literals;
-
 using math::constrain;
+using matrix::Eulerf;
+using matrix::Quatf;
+using matrix::Vector3f;

 pthread_mutex_t ekf2_module_mutex = PTHREAD_MUTEX_INITIALIZER;
 static px4::atomic<EKF2 *> _objects[EKF2_MAX_INSTANCES] {};
@@ -611,7 +613,7 @@

 			// check for valid orientation data
 			if (PX4_ISFINITE(ev_odom.q[0])) {
-				ev_data.quat = matrix::Quatf(ev_odom.q);
+				ev_data.quat = Quatf(ev_odom.q);

 				// orientation measurement error from ev_data or parameters
 				float param_eva_noise_var = sq(_param_ekf2_eva_noise.get());
@@ -653,8 +655,8 @@
 				if (landing_target_pose.is_static && landing_target_pose.rel_vel_valid) {
 					// velocity of vehicle relative to target has opposite sign to target relative to vehicle
 					auxVelSample auxvel_sample {};
-					auxvel_sample.vel = matrix::Vector3f{-landing_target_pose.vx_rel, -landing_target_pose.vy_rel, 0.0f};
-					auxvel_sample.velVar = matrix::Vector3f{landing_target_pose.cov_vx_rel, landing_target_pose.cov_vy_rel, 0.0f};
+					auxvel_sample.vel = Vector3f{-landing_target_pose.vx_rel, -landing_target_pose.vy_rel, 0.0f};
+					auxvel_sample.velVar = Vector3f{landing_target_pose.cov_vx_rel, landing_target_pose.cov_vy_rel, 0.0f};
 					auxvel_sample.time_us = landing_target_pose.timestamp;
 					_ekf.setAuxVelData(auxvel_sample);
 				}
@@ -732,13 +734,13 @@
 				}

 				// The rotation of the tangent plane vs. geographical north
-				const matrix::Quatf q = _ekf.getQuaternion();
-
-				matrix::Quatf delta_q_reset;
+				const Quatf q = _ekf.getQuaternion();
+
+				Quatf delta_q_reset;
 				_ekf.get_quat_reset(&delta_q_reset(0), &lpos.heading_reset_counter);

-				lpos.heading = matrix::Eulerf(q).psi();
-				lpos.delta_heading = matrix::Eulerf(delta_q_reset).psi();
+				lpos.heading = Eulerf(q).psi();
+				lpos.delta_heading = Eulerf(delta_q_reset).psi();

 				lpos.dist_bottom_valid = _ekf.get_terrain_valid();

@@ -1137,7 +1139,7 @@
 			aligned_ev_odom.velocity_frame = vehicle_odometry_s::LOCAL_FRAME_NED;

 			// Compute orientation in EKF navigation frame
-			Quatf ev_quat_aligned = quat_ev2ekf * matrix::Quatf(ev_odom.q) ;
+			Quatf ev_quat_aligned = quat_ev2ekf * Quatf(ev_odom.q) ;
 			ev_quat_aligned.normalize();

 			ev_quat_aligned.copyTo(aligned_ev_odom.q);


touchscreen: don't process data if no data has been received

otherwise data gets reset all the time

--- src/application/io/touchscreen/model/nextion/Nextion.cpp
+++ src/application/io/touchscreen/model/nextion/Nextion.cpp
@@ -20,6 +20,8 @@

     if (hwa.read(data))
         rxBuffer.insert(data);
+    else
+        return false;

     if (data == 0xFF)
     {


Strip VK_KHR_win32_keyed_mutex extension on replay

* This is an external memory extension, effectively, so we remove it as we don't
  replay external memory.

--- renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp
+++ renderdoc/driver/vulkan/wrappers/vk_device_funcs.cpp
@@ -172,7 +172,8 @@
     // feature structs.
     if(ext == "VK_KHR_external_fence_fd" || ext == "VK_KHR_external_fence_win32" ||
        ext == "VK_KHR_external_memory_fd" || ext == "VK_KHR_external_memory_win32" ||
-       ext == "VK_KHR_external_semaphore_fd" || ext == "VK_KHR_external_semaphore_win32")
+       ext == "VK_KHR_external_semaphore_fd" || ext == "VK_KHR_external_semaphore_win32" ||
+       ext == "VK_KHR_win32_keyed_mutex")
     {
       return true;
     }


[CommCoreModule] Create index on `thread` and `time` columns of messages table

Summary:
Query plan before: https://blob.sh/atul/ffc6.png
Query plan after: https://blob.sh/atul/fb1c.png

Test Plan: Logged path of sqlite db and used `EXPLAIN QUERY PLAN` to make sure index was being used

Reviewers: ashoat

Reviewed By: ashoat

Subscribers: palys-swm, Adrian, karol-bisztyga

Differential Revision: https://phabricator.ashoat.com/D1941

--- native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -118,6 +118,29 @@
   return create_table(db, query, "messages");
 }

+bool create_messages_idx_thread_time(sqlite3 *db) {
+  char *error;
+  sqlite3_exec(
+      db,
+      "CREATE INDEX messages_idx_thread_time "
+      "ON messages (thread, time);",
+      nullptr,
+      nullptr,
+      &error);
+
+  if (!error) {
+    return true;
+  }
+
+  std::ostringstream stringStream;
+  stringStream << "Error creating (thread, time) index on messages table: "
+               << error;
+  Logger::log(stringStream.str());
+
+  sqlite3_free(error);
+  return false;
+}
+
 typedef std::function<bool(sqlite3 *)> MigrationFunction;
 std::vector<std::pair<uint, MigrationFunction>> migrations{{
     {1, create_drafts_table},
@@ -126,6 +149,7 @@
     {5, create_persist_sessions_table},
     {6, drop_messages_table},
     {7, recreate_messages_table},
+    {8, create_messages_idx_thread_time},
 }};

 void SQLiteQueryExecutor::migrate() {


woops, adjusted trigger rate to normal

woops, adjusted trigger rate to normal

--- code/spec_objs_black_sun.cc
+++ code/spec_objs_black_sun.cc
@@ -11,7 +11,7 @@
   if (!(ch = dynamic_cast<TBeing *>(o->equippedBy)))
     return FALSE;

-  if(::number(0,0))
+  if(::number(0,99))
     return FALSE;

   aff.type = SPELL_PLASMA_MIRROR;


set iEchoFreq = iMixerFreq

set iEchoFreq = iMixerFreq

--- src/mumble/AudioInput.cpp
+++ src/mumble/AudioInput.cpp
@@ -134,7 +134,7 @@
 		speex_encoder_ctl(esSpeex,SPEEX_SET_COMPLEXITY, &iArg);
 		qWarning("AudioInput: %d bits/s, %d hz, %d sample Speex-UWB", iAudioQuality, iSampleRate, iFrameSize);
 	}
-	iEchoFreq = iMicFreq = iSampleRate;
+	iMicFreq = iSampleRate;

 	iFrameCounter = 0;
 	iSilentFrames = 0;
@@ -159,6 +159,7 @@
 	AudioOutputPtr ao = g.ao;
 	if (ao) {
 		iEchoChannels = ao->getChannels();
+		iEchoFreq = ao->getMixerFreq();
 	} else {
 		fprintf(stderr, "AudioOutput has not been initialized\n");
 		std::exit(1);
@@ -207,9 +208,9 @@
 	if (srsEcho)
 		speex_resampler_destroy(srsEcho);

-	appendWavHeader("psMic", iEchoChannels, iSampleRate);
-	appendWavHeader("psSpeaker", iEchoChannels, iSampleRate);
-	appendWavHeader("psClean", iEchoChannels, iSampleRate);
+	appendWavHeader("psMic", 1, iSampleRate);
+	appendWavHeader("psSpeaker", 1, iEchoFreq);
+	appendWavHeader("psClean", 1, iSampleRate);
 	delete [] psMic;
 	delete [] psClean;
 	delete [] psSpeaker;


Reset buffered frames count on encoding failure.

Previously we didn't do so but still discarded the buffer
the count belonged to. This means the encoder would
assume invalid buffered frame count when a previous
encoding run failed.

--- src/mumble/AudioInput.cpp
+++ src/mumble/AudioInput.cpp
@@ -884,6 +884,7 @@
 			if (len <= 0) {
 				iBitrate = 0;
 				qWarning() << "encodeOpusFrame failed" << iBufferedFrames << iFrameSize << len;
+				iBufferedFrames = 0; // These are lost. Make sure not to mess up our sequence counter next flushCheck.
 				return;
 			}
 			encoded = true;


libav compatible implementation

libav compatible implementation

--- src/images.cpp
+++ src/images.cpp
@@ -407,6 +407,9 @@
         return true;
     }

+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+
     /**
      * Resize image.
      */
@@ -419,6 +422,8 @@
             return;
         }

+        assert(imgData != NULL);
+
         //new size
         int newW = maxWH;
         int newH = imgH * maxWH /imgW;
@@ -432,8 +437,6 @@

         //initialize SWS context for software scaling
         AVPixelFormat format;
-        uint8_t *srcSlice[4], *dstSlice[4];
-        int srcSlide[4], dstSlide[4];

         switch (imgBPP) {
             case 1:
@@ -456,14 +459,16 @@
                 return;
         }

+        //debug
+        //printf("new size: %ix%i\n", newW, newH);
+
+        //Note: FFmpeg version
+        /*
         const int dstAlign = 32;
         int dstDataLen = av_image_get_buffer_size(format, newW, newH, dstAlign);
-        char *dstData = (char *)malloc(dstDataLen);
-
-        //debug
-        //printf("new size: %ix%i\n", newW, newH);
-
         struct SwsContext *sws_ctx = sws_getContext(imgW, imgH, format, newW, newH, format, SWS_BILINEAR, NULL, NULL, NULL);
+        uint8_t *srcSlice[4], *dstSlice[4];
+        int srcSlide[4], dstSlide[4];

         av_image_alloc(srcSlice, srcSlide, imgW, imgH, format, 1);
         av_image_fill_pointers(srcSlice, format, imgH, (uint8_t *)imgData, srcSlide);
@@ -475,16 +480,38 @@

         av_image_copy_to_buffer((uint8_t *)data, dataLen, dstSlice, dstSlide, format, newW, newH, 1);

-        sws_freeContext(sws_ctx);
         av_freep(&srcSlice[0]);
         av_freep(&dstSlice[0]);
-        free(dstData);
+        */
+
+        /*
+         * Note: using libav compatible code (deprecated on FFmpeg)
+         *
+         * Seeing some alignment warnings on macOS.
+         */
+        int dataLen = avpicture_get_size(format, newW, newH);
+        char *data = (char *)malloc(dataLen);
+        AVPicture srcPic, dstPic;
+        struct SwsContext *sws_ctx = sws_getContext(imgW, imgH, format, newW, newH, format, SWS_BILINEAR, NULL, NULL, NULL);
+
+        assert(data != NULL);
+
+        avpicture_fill(&srcPic, (uint8_t *)imgData, format, imgW, imgH);
+        avpicture_alloc(&dstPic, format, newW, newH);
+        sws_scale(sws_ctx, srcPic.data, srcPic.linesize, 0, imgH, dstPic.data, dstPic.linesize);
+        avpicture_layout(&dstPic, format, newW, newH, (unsigned char *)data, dataLen);
+        avpicture_free(&dstPic);
+
+        sws_freeContext(sws_ctx);
+        free(imgData);

         imgW = newW;
         imgH = newH;
         imgData = data;
         imgDataLen = dataLen;
     }
+
+#pragma GCC diagnostic pop

     /**
      * Back in main thread with JS access.


teminate NTCP session on close completely

--- Transports.cpp
+++ Transports.cpp
@@ -460,7 +460,7 @@
 		auto ntcpSession = m_NTCPServer ? m_NTCPServer->FindNTCPSession(router->GetIdentHash()) : nullptr;
 		if (ntcpSession) // try deleting ntcp session too
 		{
-			m_NTCPServer->RemoveNTCPSession(ntcpSession);
+			ntcpSession->Terminate ();
 			LogPrint(eLogDebug, "Transports: NTCP session closed");
 		}
 	}


[Dev] The sample batch now supports program options.

--- stdair/stdair/batches/stdair.cpp
+++ stdair/stdair/batches/stdair.cpp
@@ -4,42 +4,155 @@
 #include <sstream>
 #include <fstream>
 #include <string>
+// Boost (Extended STL)
+#include <boost/date_time/posix_time/posix_time.hpp>
+#include <boost/date_time/gregorian/gregorian.hpp>
+#include <boost/program_options.hpp>
+#include <boost/tokenizer.hpp>
+#include <boost/lexical_cast.hpp>
 // StdAir
 #include <stdair/STDAIR_Types.hpp>
+#include <stdair/STDAIR_Service.hpp>
+#include <stdair/bom/BomSource.hpp>
 #include <stdair/bom/BomList.hpp>
-#include <stdair/bom/BomSource.hpp>
 #include <stdair/factory/FacBomContent.hpp>
 #include <stdair/service/Logger.hpp>
-#include <stdair/STDAIR_Service.hpp>
-
-
-// ///////// M A I N ////////////
-int main (int argc, char* argv[]) {
+#include <stdair/config/stdair-paths.hpp>
+
+// //////// Type definitions ///////
+typedef std::vector<std::string> WordList_T;
+
+
+// //////// Constants //////
+/** Default name and location for the log file. */
+const std::string K_STDAIR_DEFAULT_LOG_FILENAME ("stdair.log");
+
+/** Default name and location for the (CSV) input file. */
+const std::string K_STDAIR_DEFAULT_INPUT_FILENAME ("../../test/samples/stdair01.csv");
+
+/** Default for the input type. It can be either built-in or provided by an
+    input file. That latter must then be given with the -i option. */
+const bool K_STDAIR_DEFAULT_BUILT_IN_INPUT = false;
+
+/** Early return status (so that it can be differentiated from an error). */
+const int K_STDAIR_EARLY_RETURN_STATUS = 99;
+
+
+// ///////// Parsing of Options & Configuration /////////
+// A helper function to simplify the main part.
+template<class T> std::ostream& operator<< (std::ostream& os,
+                                            const std::vector<T>& v) {
+  std::copy (v.begin(), v.end(), std::ostream_iterator<T> (std::cout, " "));
+  return os;
+}
+
+/** Read and parse the command line options. */
+int readConfiguration (int argc, char* argv[], bool& ioIsBuiltin,
+                       stdair::Filename_T& ioInputFilename,
+                       std::string& ioLogFilename) {
+  // Default for the built-in input
+  ioIsBuiltin = K_STDAIR_DEFAULT_BUILT_IN_INPUT;

+  // Declare a group of options that will be allowed only on command line
+  boost::program_options::options_description generic ("Generic options");
+  generic.add_options()
+    ("prefix", "print installation prefix")
+    ("version,v", "print version string")
+    ("help,h", "produce help message");
+
+  // Declare a group of options that will be allowed both on command
+  // line and in config file
+  boost::program_options::options_description config ("Configuration");
+  config.add_options()
+    ("builtin,b",
+     "The sample BOM tree can be either built-in or parsed from an input file. That latter must then be given with the -i/--input option")
+    ("input,i",
+     boost::program_options::value< std::string >(&ioInputFilename)->default_value(K_STDAIR_DEFAULT_INPUT_FILENAME),
+     "(CVS) input file for the demand distributions")
+    ("log,l",
+     boost::program_options::value< std::string >(&ioLogFilename)->default_value(K_STDAIR_DEFAULT_LOG_FILENAME),
+     "Filename for the logs")
+    ;
+
+  // Hidden options, will be allowed both on command line and
+  // in config file, but will not be shown to the user.
+  boost::program_options::options_description hidden ("Hidden options");
+  hidden.add_options()
+    ("copyright",
+     boost::program_options::value< std::vector<std::string> >(),
+     "Show the copyright (license)");
+
+  boost::program_options::options_description cmdline_options;
+  cmdline_options.add(generic).add(config).add(hidden);
+
+  boost::program_options::options_description config_file_options;
+  config_file_options.add(config).add(hidden);
+
+  boost::program_options::options_description visible ("Allowed options");
+  visible.add(generic).add(config);
+
+  boost::program_options::positional_options_description p;
+  p.add ("copyright", -1);
+
+  boost::program_options::variables_map vm;
+  boost::program_options::
+    store (boost::program_options::command_line_parser (argc, argv).
+           options (cmdline_options).positional(p).run(), vm);
+
+  std::ifstream ifs ("stdair.cfg");
+  boost::program_options::store (parse_config_file (ifs, config_file_options),
+                                 vm);
+  boost::program_options::notify (vm);
+
+  if (vm.count ("help")) {
+    std::cout << visible << std::endl;
+    return K_STDAIR_EARLY_RETURN_STATUS;
+  }
+
+  if (vm.count ("version")) {
+    std::cout << PACKAGE_NAME << ", version " << PACKAGE_VERSION << std::endl;
+    return K_STDAIR_EARLY_RETURN_STATUS;
+  }
+
+  if (vm.count ("prefix")) {
+    std::cout << "Installation prefix: " << PREFIXDIR << std::endl;
+    return K_STDAIR_EARLY_RETURN_STATUS;
+  }
+
+  if (vm.count ("builtin")) {
+    ioIsBuiltin = true;
+  }
+  const std::string isBuiltinStr = (ioIsBuiltin == true)?"yes":"no";
+  std::cout << "The BOM should be built-in? " << isBuiltinStr << std::endl;
+
+  if (ioIsBuiltin == false) {
+    if (vm.count ("input")) {
+      ioInputFilename = vm["input"].as< std::string >();
+      std::cout << "Input filename is: " << ioInputFilename << std::endl;
+    }
+  }
+
+  if (vm.count ("log")) {
+    ioLogFilename = vm["log"].as< std::string >();
+    std::cout << "Log filename is: " << ioLogFilename << std::endl;
+  }
+
+  return 0;
+}
+
+
+// //////////////////////////////////////////////////////////////////////
+void buildSampleBom() {
+
   try {

-    // Test create objects.
-
-    // Output log File
-    std::string lLogFilename ("stdair.log");
-
-    // Set the log parameters
-    std::ofstream logOutputFile;
-    // open and clean the log outputfile
-    logOutputFile.open (lLogFilename.c_str());
-    logOutputFile.clear();
-
-    const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile);
-    stdair::STDAIR_Service stdairService (lLogParams);
-
     // DEBUG
-    STDAIR_LOG_DEBUG ("Welcome to stdair");
-
+    STDAIR_LOG_DEBUG ("StdAir will build the BOM tree from built-in specifications.");
+
     // Step 0.0: initialisation
     // Create the root of the Bom tree (i.e., a BomRoot object)
     stdair::BomRoot& lBomRoot =
       stdair::FacBomContent::instance().create<stdair::BomRoot>();
-

     // Step 0.1: Inventory level
     // Create an Inventory (BA)
@@ -214,6 +327,60 @@
         STDAIR_LOG_DEBUG ("FlightDate: " << lCurrentFlightDate->describeKey());
       }
     }
+
+  } catch (const std::exception& stde) {
+    STDAIR_LOG_ERROR ("Standard exception: " << stde.what());
+  }
+}
+
+
+// ///////// M A I N ////////////
+int main (int argc, char* argv[]) {
+
+  try {
+
+    // Built-in
+    bool isBuiltin;
+
+    // Input file name
+    stdair::Filename_T lInputFilename;
+
+    // Output log File
+    std::string lLogFilename;
+
+    // Call the command-line option parser
+    const int lOptionParserStatus =
+      readConfiguration (argc, argv, isBuiltin, lInputFilename, lLogFilename);
+
+    if (lOptionParserStatus == K_STDAIR_EARLY_RETURN_STATUS) {
+      return 0;
+    }
+
+    // Set the log parameters
+    std::ofstream logOutputFile;
+    // Open and clean the log outputfile
+    logOutputFile.open (lLogFilename.c_str());
+    logOutputFile.clear();
+
+    const stdair::BasLogParams lLogParams (stdair::LOG::DEBUG, logOutputFile);
+    stdair::STDAIR_Service stdairService (lLogParams);
+
+    // DEBUG
+    STDAIR_LOG_DEBUG ("Welcome to stdair");
+
+    // Check wether or not a (CSV) input file should be read
+    if (isBuiltin == true) {
+      // Build a sample BOM tree
+      buildSampleBom();
+
+    } else {
+      // Read the input file
+      //stdairService.readFromInputFile (lInputFilename);
+
+      // DEBUG
+      STDAIR_LOG_DEBUG ("StdAir will parse " << lInputFilename
+                        << " and build the corresponding BOM tree.");
+    }

     // Close the Log outputFile
     logOutputFile.close();


Cleaning up UPB for hasher and comparator revisions

--- runtime/cpp/include/collections/UniquePolyBuffer.hpp
+++ runtime/cpp/include/collections/UniquePolyBuffer.hpp
@@ -28,7 +28,7 @@

 struct UPBValueProxy {
   UPBValueProxy(size_t o) : asOffset(true), offset(o) {}
-  UPBValueProxy(const void* p) : asOffset(false), elem(p) {}
+  UPBValueProxy(void* p) : asOffset(false), elem(p) {}

   bool asOffset;
   union {
@@ -49,8 +49,8 @@
   UPBEqual(Buf* b) : buffer(b) {}

   bool operator()(const UPBKey<Tag>& left, const UPBKey<Tag>& right) const {
-    void* lp = left.asOffset? buffer_data(buf) + left.second.offset : left.second.elem;
-    void* rp = right.asOffset? buffer_data(buf) + right.second.offset : right.second.elem;
+    void* lp = left.asOffset? buffer_data(buffer) + left.second.offset : left.second.elem;
+    void* rp = right.asOffset? buffer_data(buffer) + right.second.offset : right.second.elem;
     return T::equalelem(left.first, left.second, right.first, right.second);
   }
 };
@@ -66,7 +66,7 @@
   std::size_t operator()(const UPBKey<Tag>& k) const {
     std::hash<Tag> hash;
     size_t h1 = hash(k.first);
-    void* p = k.asOffset? buffer_data(buf) + k.second.offset : k.second.elem;
+    void* p = k.asOffset? buffer_data(buffer) + k.second.offset : k.second.elem;
     boost::hash_combine(h1, T::hashelem(k.first, p));
     return h1;
   }
@@ -89,17 +89,14 @@

   UniquePolyBuffer() : Super(), comparator(fixed()), hasher(fixed()), keys(10, comparator, hasher)  {}

-  UniquePolyBuffer(const UniquePolyBuffer& other) : Super(other) {
-    comparator = other.comparator;
-    hasher = other.hasher;
-    keys = other.keys;
-  }
-
-  UniquePolyBuffer(UniquePolyBuffer&& other) : Super(std::move(other)) {
-    comparator = std::move(other.comparator);
-    hasher = std::move(other.hasher);
-    keys.swap(other.keys);
-  }
+  UniquePolyBuffer(const UniquePolyBuffer& other)
+    : Super(other), comparator(other.comparator), hasher(other.hasher), keys(other.keys)
+  {}
+
+  UniquePolyBuffer(UniquePolyBuffer&& other)
+    : Super(std::move(other)),
+      comparator(std::move(other.comparator)), hasher(std::move(other.hasher)), keys(std::move(other.keys))
+  {}

   UniquePolyBuffer& operator=(const UniquePolyBuffer& other) {
     Super::operator=(other);
@@ -139,7 +136,7 @@
       FContainer* ncf = const_cast<FContainer*>(Super::fixedc());
       size_t offset = buffer_size(ncf);
       Super::append(tg, t);
-      keys.insert(std::make_pair(tg, std::move(UPBValueProxy proxy { offset })));
+      keys.insert(std::make_pair(tg, std::move(UPBValueProxy { offset })));
     }
     return unit_t{};
   }


[core_manager] Don't delete cores during outputSummary.

--- common/core/core_manager.cc
+++ common/core/core_manager.cc
@@ -216,9 +216,6 @@
       if (g_config->getEnableDCacheModeling() || g_config->getEnableICacheModeling())
          m_cores[i]->getOCache()->outputSummary(out);

-      delete m_cores[i];
-      m_cores[i] = NULL;
-
       out << endl;
    }


Better error checking during copy.

Better error checking during copy.

--- common/vtkAttributeData.cxx
+++ common/vtkAttributeData.cxx
@@ -185,6 +185,10 @@
 // makes sense.
 void vtkAttributeData::DeepCopy(vtkAttributeData *da)
 {
+  if (da == NULL)
+    {
+    return;
+    }
   if ( da->Data != this->Data && da->Data != NULL )
     {
     if (da->Data->GetNumberOfComponents() != this->Data->GetNumberOfComponents() )


Using static_cast instead of a const reference

--- linalg/blockmatrix.cpp
+++ linalg/blockmatrix.cpp
@@ -159,8 +159,7 @@
    {
       mfem_error("BlockMatrix::Elem");
    }
-   const SparseMatrix& AijSM = *Aij(iblock, jblock);
-   return AijSM.Elem(iloc, jloc);
+   return static_cast<const SparseMatrix *>(Aij(iblock, jblock))->Elem(iloc, jloc);
 }

 int BlockMatrix::RowSize(const int i) const


Repair zigzag infill lines

Repair zigzag infill lines

The main infill lines weren't being drawn, only the connections.

Contributes to issue CURA-4017.

--- src/infill.cpp
+++ src/infill.cpp
@@ -98,11 +98,7 @@
     //TODO: The connected lines algorithm is only available for linear-based infill, for now.
     //We skip ZigZag, Cross and Cross3D because they have their own algorithms. Eventually we want to replace all that with the new algorithm.
     //Cubic Subdivision ends lines in the center of the infill so it won't be effective.
-    if (pattern != EFillMethod::TRIANGLES && pattern != EFillMethod::GRID && pattern != EFillMethod::CUBIC && pattern != EFillMethod::TETRAHEDRAL && pattern != EFillMethod::QUARTER_CUBIC && pattern != EFillMethod::TRIHEXAGON)
-    {
-        zig_zaggify = false;
-    }
-    if (zig_zaggify)
+    if (zig_zaggify && (pattern == EFillMethod::TRIANGLES || pattern == EFillMethod::GRID || pattern == EFillMethod::CUBIC || pattern == EFillMethod::TETRAHEDRAL || pattern == EFillMethod::QUARTER_CUBIC || pattern == EFillMethod::TRIHEXAGON))
     {
         connectLines(result_lines);
     }
@@ -283,7 +279,7 @@
                 continue;
             }
             //We have to create our own lines when they are not created by the method connectLines.
-            if (!zig_zaggify)
+            if (!zig_zaggify || pattern == EFillMethod::ZIG_ZAG)
             {
                 result.addLine(rotation_matrix.unapply(Point(x, crossings[crossing_idx])), rotation_matrix.unapply(Point(x, crossings[crossing_idx + 1])));
             }


INTEGRATION: CWS ooo19126 (1.43.452); FILE MERGED 2005/09/05 15:03:55 rt 1.43.452.1: #i54170# Change license header: remove SISSL

--- sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -1,61 +1,35 @@
 /*************************************************************************
  *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
  *  $RCSfile: AccessibleSpreadsheet.cxx,v $
  *
- *  $Revision: 1.43 $
- *
- *  last change: $Author: obo $ $Date: 2004-06-04 11:16:33 $
- *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
- *
- *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
- *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
- *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
- *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *  $Revision: 1.44 $
+ *
+ *  last change: $Author: rt $ $Date: 2005-09-08 20:20:02 $
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
+ *
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
+ *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/


added int for max result records

added int for max result records

--- connectivity/source/inc/mozaddressbook/MABConnection.hxx
+++ connectivity/source/inc/mozaddressbook/MABConnection.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: MABConnection.hxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.6 $
  *
- *  last change: $Author: fs $ $Date: 2001-06-25 09:51:16 $
+ *  last change: $Author: fs $ $Date: 2001-06-27 14:56:47 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -79,8 +79,9 @@
         class OMozabConnection : public file::OConnection
         {

+            rtl::OUString   m_sMozillaURI;
             sal_Int32       m_nAnonABCount;
-            rtl::OUString   m_sMozillaURI;
+            sal_Int32       m_nMaxResultRecords;
             sal_Bool        m_UsesFactory ;
             sal_Bool        m_IsLDAP ;

@@ -112,8 +113,8 @@
             sal_Bool usesFactory(void) const { return m_UsesFactory ; }
             sal_Bool isLDAP(void) const { return m_IsLDAP ; }

-            sal_Int32 getNextAnonymousAB()
-                { return (++m_nAnonABCount); }
+            sal_Int32   getNextAnonymousAB()    { return (++m_nAnonABCount); }
+            sal_Int32   getMaxResultRecords()   { return m_nMaxResultRecords; }
         };
     }
 }


Another fix

Another fix

--- ghost++/ghost/ghost.cpp
+++ ghost++/ghost/ghost.cpp
@@ -2077,7 +2077,7 @@
     uint32_t m_StatsAlias = 0;
     uint32_t c = 1;
     transform( alias.begin( ), alias.end( ), alias.begin( ), ::tolower );
-    for( vector<string> :: iterator i = m_GHost->m_Aliases.begin( ); i != m_GHost->m_Aliases.end( ); ++i ) {
+    for( vector<string> :: iterator i = m_Aliases.begin( ); i != m_Aliases.end( ); ++i ) {
         string Alias = *i;
         transform( Alias.begin( ), Alias.end( ), Alias.begin( ), ::tolower );
         if( Alias.size( ) > alias.size ? Alias.substr(0, alias.size( ) ) == alias : Alias == alias ) {


prefetch losing hypo for reuse

prefetch losing hypo for reuse

--- contrib/other-builds/moses2/Search/CubePruning/Stack.cpp
+++ contrib/other-builds/moses2/Search/CubePruning/Stack.cpp
@@ -26,7 +26,7 @@

 StackAdd MiniStack::Add(const Hypothesis *hypo)
 {
-  std::pair<MiniStack::_HCType::iterator, bool> addRet = m_coll.insert(hypo);
+  std::pair<_HCType::iterator, bool> addRet = m_coll.insert(hypo);

   // CHECK RECOMBINATION
   if (addRet.second) {
@@ -128,6 +128,8 @@
   HypoCoverage key(&hypo->GetBitmap(), hypo->GetInputPath().range.GetEndPos());
   StackAdd added = GetMiniStack(key).Add(hypo);

+  __builtin_prefetch(added.toBeDeleted);
+
   if (added.toBeDeleted) {
 	hypoRecycle.Add(added.toBeDeleted);
   }


Allow multiple views to be opened in one session

--- configmgr/workben/apitest/cfgapi.cxx
+++ configmgr/workben/apitest/cfgapi.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: cfgapi.cxx,v $
  *
- *  $Revision: 1.15 $
- *
- *  last change: $Author: jb $ $Date: 2001-09-28 13:32:56 $
+ *  $Revision: 1.16 $
+ *
+ *  last change: $Author: jb $ $Date: 2001-12-06 16:27:11 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -174,7 +174,7 @@
 }

 //=============================================================================
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF);
+bool test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF);
 //=============================================================================
 struct prompt_and_wait
 {
@@ -205,8 +205,8 @@
 // -----------------------------------------------------------------------------
 static sal_Bool             s_bInitialized  =   sal_False;

-static const sal_Char*      s_pSourcePath   =   "../share";
-static const sal_Char*      s_pUpdatePath   =   "../user";
+static const sal_Char*      s_pSourcePath   =   "../share/config/registry";
+static const sal_Char*      s_pUpdatePath   =   "../user/config/registry";
 static const sal_Char*      s_pRootNode     =   "org.openoffice.Office.Common";
 static const sal_Char*      s_pServerType   =   "local";
 static const sal_Char*      s_pLocale       =   "en-US";
@@ -502,45 +502,38 @@
         char aPath[300] =           "/";
         int nStart = sizeof(    "/" ) - 1;

-        cout << "---------------------------------------------------------------\n Configuration Provider created !\n---------------------------------------------------------------" << endl;
-
-        Sequence< Any > aArgs;
-        aArgs = createSequence(sUser, ASCII(""));
-
-        OUString sPath =    enterValue("nodepath: ", s_pRootNode, false);
-        cout << endl;
-
-        aArgs.realloc(aArgs.getLength() + 1);
-        aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("nodepath"), sPath);
-
-        if (!bLocal)
-        {
+        cout << "---------------------------------------------------------------\n Configuration Provider created !";
+
+        bool bQuit = true;
+        do
+        {
+            cout << "\n---------------------------------------------------------------" << endl;
+
+            Sequence< Any > aArgs(2);
+
+            OUString sPath =    enterValue("nodepath: ", s_pRootNode, false);
+            cout << endl;
+
+            aArgs[0] <<= configmgr::createPropertyValue(ASCII("nodepath"), sPath);
+
             OUString sLocale =  enterValue("locale  : ", s_pLocale, false);
             cout << endl;
-            aArgs.realloc(aArgs.getLength() + 1);
-            aArgs[aArgs.getLength() - 1] <<= configmgr::createPropertyValue(ASCII("locale"), sLocale);
-        }
-/*
-#else
-        OUString aStr = ASCII("String");
-        sal_Int32 nDepth = 10;
-        Sequence< Any > aArgs(2);
-
-        aArgs[0] <<= aStr;
-        aArgs[1] <<= nDepth;
-#endif
-*/
-        Reference< XInterface > xIFace = xCfgProvider->createInstanceWithArguments(
-            OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
-            aArgs);
-        cout << "---------------------------------------------------------------\n Configuration Read/Write Access created !\n---------------------------------------------------------------" << endl;
-
-        xChangesBatch = Reference< XChangesBatch >(xIFace, UNO_QUERY);
-
-        Sequence<OUString> aSeq = xCfgProvider->getAvailableServiceNames();
-        showSequence(aSeq);
-
-        test_read_access(xIFace, xCfgProvider);
+
+            aArgs[1] <<= configmgr::createPropertyValue(ASCII("locale"), sLocale);
+
+            Reference< XInterface > xIFace = xCfgProvider->createInstanceWithArguments(
+                OUString::createFromAscii("com.sun.star.configuration.ConfigurationUpdateAccess"),
+                aArgs);
+            cout << "---------------------------------------------------------------\n Configuration Read/Write Access created !\n---------------------------------------------------------------" << endl;
+
+            xChangesBatch = Reference< XChangesBatch >(xIFace, UNO_QUERY);
+
+            Sequence<OUString> aSeq = xCfgProvider->getAvailableServiceNames();
+            showSequence(aSeq);
+
+            bQuit = test_read_access(xIFace, xCfgProvider);
+        }
+        while (!bQuit);
     }
     catch (Exception& e)
     {
@@ -596,15 +589,17 @@
         if (xChild.is())
             cout << "\n[ P ] -\tParent";
         else
-            cout << "BUG: Parent not available (no XChild)";
+            cout << "\n ROOT -\tParent not available ";
         cout << endl;
 }
 ///////////////////////////////////////////////////////////////////////////////////////////

-bool ask(Reference< XInterface >& xIface, Reference<XMultiServiceFactory> &);
-
-void test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF)
-{
+bool ask(Reference< XInterface >& xIface, Reference<XMultiServiceFactory> &, bool&);
+
+bool test_read_access(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF)
+{
+    bool bQuit = true;
+
     using com::sun::star::uno::UNO_QUERY;
     do
     {
@@ -620,14 +615,17 @@
         write(xAccess);
         write(xChild);
     }
-    while (ask(xIface, xMSF));
-}
-
-bool ask(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF)
-{
-    cout << "\n[ Q ] -> <Quit>";
+    while (ask(xIface, xMSF, bQuit));
+
+    return bQuit;
+}
+
+bool ask(Reference< XInterface >& xIface, Reference< XMultiServiceFactory > &xMSF, bool& rbQuit)
+{
     cout << "\n[ S ] -> <SetValue> ";
     cout << "\n[ D ] -> <SetToDefault> ";
+    cout << "\n[ N ] -> <New Access>";
+    cout << "\n[ Q ] -> <Quit>";
     cout << endl;

     cout << "\n:> " << flush;
@@ -643,6 +641,12 @@
             Reference< XInterface > xNext;
             if ((buf[0] == 'q' || buf[0] == 'Q') && (0 == buf[1]))
             {
+                rbQuit = true;
+                return false;
+            }
+            else if ((buf[0] == 'n' || buf[0] == 'N') && (0 == buf[1]))
+            {
+                rbQuit = false;
                 return false;
             }
             else if (buf[0] == 0)


Build active event list in constructor.

Build active event list in constructor.

	* src/object/event-class.cc (Event): Do not use an empty events
	list.

--- src/object/event-class.cc
+++ src/object/event-class.cc
@@ -21,6 +21,7 @@
   Event::Event()
     : value_(new List)
     , active_(false)
+    , live_(new List)
   {
     proto_add(event_class);
   }
@@ -28,6 +29,7 @@
   Event::Event(const value_type& value)
     : value_(value)
     , active_(false)
+    , live_(new List)
   {
     proto_add(event_class);
   }
@@ -35,6 +37,7 @@
   Event::Event(rEvent model)
     : value_(model->value_)
     , active_(false)
+    , live_(model->live_)
   {
     proto_add(event_class);
   }


format-info: style changes.

format-info: style changes.

	* src/object/format-info.cc: Use RAISE.
	Reorder some ifs.

--- src/object/format-info.cc
+++ src/object/format-info.cc
@@ -44,18 +44,17 @@
     bool piped;

     if (pattern.empty())
-      runner::raise_primitive_error("pattern is empty");
+      RAISE("format: pattern is empty");
     if (pattern[0] != '%')
-      runner::raise_primitive_error("format: Pattern \"" + pattern
-                                    + "\" doesn't begin with %");
+      RAISE("format: pattern \"" + pattern + "\" doesn't begin with %");
     if (pattern.size() == 1)
-      runner::raise_primitive_error("format: Trailing `%'");
+      RAISE("format: trailing `%'");
     if ((piped = pattern[1] == '|'))
     {
       size_t pos = pattern.find_first_of('|', 2);
       if (pos == pattern.npos)
-        runner::raise_primitive_error("format begins with '|' but "
-                                     "doesn't end with '|'");
+        RAISE("format: format begins with '|' but "
+              "does not end with '|'");
       pattern_ = pattern.substr(0, pos + 1);
       cursor++;
     }
@@ -128,15 +127,12 @@
     }

     int overflow;
-    if (piped)
-    {
-      if ((overflow = pattern_.size() - 1 - ++cursor) > 0)
-        runner::raise_primitive_error("format is between pipes and \""
-                                      + pattern_.substr(cursor, overflow)
-                                      + "\" are too many characters");
-    }
-    else
+    if (!piped)
       pattern_ = pattern.substr(0, ++cursor);
+    else if (0 < (overflow = pattern_.size() - 1 - ++cursor))
+      RAISE("format: format is between pipes and \""
+            + pattern_.substr(cursor, overflow)
+            + "\" are too many characters");
   }

   std::string


passable for mesh faces

passable for mesh faces

--- src/obstacle/MeshFace.cxx
+++ src/obstacle/MeshFace.cxx
@@ -755,11 +755,16 @@
   if (smoothBounce && !mesh->useSmoothBounce()) {
     out << indent << "    smoothBounce" << std::endl;
   }
-  if (driveThrough && !mesh->isDriveThrough()) {
-    out << indent << "    driveThrough" << std::endl;
-  }
-  if (shootThrough && !mesh->isShootThrough()) {
-    out << indent << "    shootThrough" << std::endl;
+  if ((driveThrough && shootThrough) &&
+      !(mesh->isDriveThrough() && mesh->isShootThrough())) {
+    out << indent << "    passable" << std::endl;
+  } else {
+    if (driveThrough && !mesh->isDriveThrough()) {
+      out << indent << "    driveThrough" << std::endl;
+    }
+    if (shootThrough && !mesh->isShootThrough()) {
+      out << indent << "    shootThrough" << std::endl;
+    }
   }

   out << indent << "  endface" << std::endl;


avoid the segv

avoid the segv

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

--- src/obstacle/MeshFace.cxx
+++ src/obstacle/MeshFace.cxx
@@ -104,7 +104,7 @@
   if (maxCrossSqr < +1.0e-20f) {

     DEBUG1("invalid mesh face");
-    if (debugLevel >= 3) {
+    if ((debugLevel >= 3) && (mesh != NULL)) {
       printf(":");
       for (i = 0; i < vertexCount; i++) {
         printf(" %i", (fvec3*)vertices[i] - mesh->getVertices());
@@ -136,7 +136,7 @@
     if (d <= 0.0f) {

       DEBUG1("non-convex mesh face");
-      if (debugLevel >= 3) {
+      if ((debugLevel >= 3) && (mesh != NULL)) {
         printf(":");
         for (i = 0; i < vertexCount; i++) {
           printf(" %i", (fvec3*)vertices[i] - mesh->getVertices());


fixed mac build error

fixed mac build error

--- src/ocl/gcn_asm_utils.cpp
+++ src/ocl/gcn_asm_utils.cpp
@@ -7,16 +7,16 @@
 #include <cstdio>
 #include  <cctype>

-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__APPLE__)
 #include <ext/stdio_filebuf.h>
 #include <unistd.h>
 #include <sys/wait.h>
-#endif // !WIN32
+#endif // !defined(_WIN32) && !defined(__APPLE__)

 static std::string CleanupPath(const char * p);
 static int ExecuteGcnAssembler(const std::string& p, std::vector<std::string>& args, std::istream* in, std::ostream* out);

-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__APPLE__)
 class Pipe
 {
 public:
@@ -71,7 +71,7 @@
         closed = true;
     }
 };
-#endif // !WIN32
+#endif // !defined(_WIN32) && !defined(__APPLE__)

 std::string GetGcnAssemblerPath()
 {
@@ -88,7 +88,7 @@

 bool ValidateGcnAssembler()
 {
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__APPLE__)
     const auto path = GetGcnAssemblerPath();
     if (path.empty()) { return false; }
     if (!std::ifstream(path).good()) { return false; }
@@ -110,14 +110,14 @@
             return clang_result_line.find("amdgcn") != std::string::npos;
         }
     }
-#endif // !WIN32
+#endif // !defined(_WIN32) && !defined(__APPLE__)
     return false;
 }

 static
 int ExecuteGcnAssembler(const std::string& p, std::vector<std::string>& args, std::istream* in, std::ostream* out)
 {
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__APPLE__)
     Pipe clang_stdin;
     Pipe clang_stdout;

@@ -190,7 +190,7 @@
     (void)in;
     (void)out;
     return -1;
-#endif // !WIN32
+#endif // !defined(_WIN32) && !defined(__APPLE__)
 }

 int ExecuteGcnAssembler(std::vector<std::string>& args, std::istream* clang_stdin_content, std::ostream* clang_stdout_content)


Added get_null_FILE() function to generate an unassigned FILE* when FCGI is defined.

--- src/istdio.hpp
+++ src/istdio.hpp
@@ -38,7 +38,6 @@
 #include <stdio.h>

 #ifdef FASTCGI
-#define GFILE FILE

 #include <fcgi_stdio.h>
 inline int  ifgetc(FCGI_FILE* f)                { return FCGI_fgetc(f); }
@@ -54,6 +53,17 @@
 // Functions to access global FILE functions after FASTCGI defines
 #pragma push_macro("FILE")
 #undef FILE
+
+/**
+ * @brief Returns a stdio.h FILE*, even if fcgi_stdio.h has redefined it.
+ *
+ * This function is sometimes necessary in order to use stdio.h functions that
+ * have not been converted to FCGI_FILE.  It was added to work with dup2().
+ *
+ * usage:
+ * `auto* f = get_null_FILE();`
+ */
+inline FILE* get_null_FILE(void) { return static_cast<FILE*>(nullptr); }

 #pragma push_macro("fopen")
 #undef fopen


oiiotool --pixelaspect : fix setting of attributes (#3340)

We weren't doing quite the right calls to set the attributes correctly
after performing the scale.

--- src/oiiotool/oiiotool.cpp
+++ src/oiiotool/oiiotool.cpp
@@ -4395,6 +4395,7 @@
     bool highlightcomp     = options.get_int("highlightcomp");

     if (ot.debug) {
+        std::cout << "Performing '" << command << "'\n";
         std::cout << "  Scaling "
                   << format_resolution(Aspec->full_width, Aspec->full_height,
                                        Aspec->full_x, Aspec->full_y)
@@ -4419,11 +4420,12 @@
             = scale_full_width;
         A->spec(0, 0)->full_height = (*A)(0, 0).specmod().full_height
             = scale_full_height;
-        A->spec(0, 0)->attribute("PixelAspectRatio", new_paspect);
+        (*A)(0, 0).specmod().attribute("PixelAspectRatio", new_paspect);
         if (xres)
-            A->spec(0, 0)->attribute("XResolution", scale_xres);
+            (*A)(0, 0).specmod().attribute("XResolution", scale_xres);
         if (yres)
-            A->spec(0, 0)->attribute("YResolution", scale_yres);
+            (*A)(0, 0).specmod().attribute("YResolution", scale_yres);
+        A->update_spec_from_imagebuf(0, 0);
         // Now A,Aspec are for the NEW resized top of stack
     }


Use 0 as the default value for all enums, rather than finding the actual enum value name

This will make it easier to change the enum value names, as it reduces the number of places they're used.

--- src/google/protobuf/compiler/csharp/csharp_field_base.cc
+++ src/google/protobuf/compiler/csharp/csharp_field_base.cc
@@ -306,7 +306,9 @@
 std::string FieldGeneratorBase::default_value(const FieldDescriptor* descriptor) {
   switch (descriptor->type()) {
     case FieldDescriptor::TYPE_ENUM:
-      return type_name() + "." + descriptor->default_value_enum()->name();
+      // All proto3 enums have a default value of 0, and there's an implicit conversion from the constant 0 to
+      // any C# enum. This means we don't need to work out what we actually mapped the enum value name to.
+     return "0";
     case FieldDescriptor::TYPE_MESSAGE:
     case FieldDescriptor::TYPE_GROUP:
       if (IsWrapperType(descriptor)) {


#101111# added the buildserver friendly error-tag in the output, when registering fails

--- cpputools/source/registercomponent/registercomponent.cxx
+++ cpputools/source/registercomponent/registercomponent.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: registercomponent.cxx,v $
  *
- *  $Revision: 1.7 $
- *
- *  last change: $Author: jbu $ $Date: 2002-05-22 12:54:28 $
+ *  $Revision: 1.8 $
+ *
+ *  last change: $Author: jbu $ $Date: 2002-07-17 07:28:51 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -512,7 +512,7 @@
         catch(CannotRegisterImplementationException & cannotRegisterImplementationException) {
             OString aMessage(OUStringToOString(cannotRegisterImplementationException.Message, RTL_TEXTENCODING_ASCII_US));
             fprintf(stderr, "register component '%s' in registry '%s' failed!\n", sUrl.getStr(), _sRegName.getStr());
-            fprintf(stderr, "CannotRegisterImplementationException: %s\n", aMessage.getStr());
+            fprintf(stderr, "error (CannotRegisterImplementationException): %s\n", aMessage.getStr());

             ++ (*_exitCode);
         }
@@ -520,7 +520,7 @@
         {
             OString aMessage(OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US));
             fprintf(stderr, "register component '%s' in registry '%s' failed!\n", sUrl.getStr(), _sRegName.getStr());
-            fprintf(stderr, "RuntimeException: %s\n", aMessage.getStr());
+            fprintf(stderr, "error (RuntimeException): %s\n", aMessage.getStr());

             ++ (*_exitCode);
         }


better error for all continuous WLS with means, but != marginals

--- src/omxWLSFitFunction.cpp
+++ src/omxWLSFitFunction.cpp
@@ -241,8 +241,7 @@
 		if(newObj->expectedMeans != NULL) {
 			if (eThresh.size() == 0) {
 				omxRaiseError("Observed means not detected, but expected means specified.\n"
-					      "The model has no continuous variables. "
-					      "Do you did forget allContinuousMethod='marginals'?");
+				   "To model means with all continuous data, you need to set allContinuousMethod='marginals'");
 			} else {
 				omxRaiseError("Means are required when the data include ordinal measurements");
 			}


Fixed mistake in linear helix checks.

Fixed mistake in linear helix checks.

--- src/origami_potential.cpp
+++ src/origami_potential.cpp
@@ -44,8 +44,13 @@
     bool doubly_contiguous_helix(Domain* cd_1,
             Domain* cd_2) {

-        // Given that d1 and d2 exist and are bound and contiguous
-
+        if (not check_domains_exist_and_bound({cd_1, cd_2})) {
+            return false;
+        }
+
+        if (cd_1->m_c != cd_2->m_c or cd_2->m_d != cd_1->m_d + 1) {
+            return false;
+        }
         Domain* cd_bound_1 {cd_1->m_bound_domain};
         Domain* cd_bound_2 {cd_2->m_bound_domain};
         if (cd_bound_1->m_c != cd_bound_2->m_c) {
@@ -550,7 +555,9 @@
                 if (check_pair_stacked(cd_h1, cd_h2) and
                         check_pair_stacked(cd_h2, cd_h3->m_bound_domain)) {

-                    if (not doubly_contiguous_helix(cd_h1, cd_h2)) {
+                    if (not doubly_contiguous_helix(cd_h1, cd_h2) and
+                           not doubly_contiguous_helix(
+                               cd_h2, (*cd_h2 + 1))) {
                         check_linear_helix(cd_h1, cd_h2, cd_h3);
                     }
                 }
@@ -565,7 +572,9 @@
                 if (check_pair_stacked(cd_h1->m_bound_domain, cd_h2) and
                         check_pair_stacked(cd_h2, cd_h3)) {

-                    if (not doubly_contiguous_helix(cd_h2, cd_h3)) {
+                    if (not doubly_contiguous_helix(cd_h2, cd_h3) and
+                           not doubly_contiguous_helix(
+                               (*cd_h2 + -1), cd_h2)) {
                         check_linear_helix(cd_h1, cd_h2, cd_h3);
                     }
                 }
@@ -707,7 +716,9 @@
                 cd_h1 = *(cd_1->m_bound_domain) + j;
                 if (check_domains_exist_and_bound({cd_h1})) {
                     if (check_pair_stacked(cd_h1->m_bound_domain, cd_h2)) {
-                        if (not doubly_contiguous_helix(cd_h2, cd_h3)) {
+                        if (not doubly_contiguous_helix(cd_h2, cd_h3) and
+                               not doubly_contiguous_helix(
+                                   (*cd_h2 + -1), cd_h2)) {
                             check_linear_helix(cd_h1, cd_h2, cd_h3);
                         }
                     }
@@ -732,7 +743,9 @@
                 cd_h3 = *(cd_2->m_bound_domain) + j;
                 if (check_domains_exist_and_bound({cd_h3})) {
                     if (check_pair_stacked(cd_h2, cd_h3->m_bound_domain)) {
-                        if (not doubly_contiguous_helix(cd_h1, cd_h2)) {
+                        if (not doubly_contiguous_helix(cd_h1, cd_h2) and
+                               not doubly_contiguous_helix(
+                                   cd_h2, (*cd_h2 + 1))) {
                             check_linear_helix(cd_h1, cd_h2, cd_h3);
                         }
                     }