Formatting changes to format table.

Formatting changes to format table.

--- src/rhi/rhi-format.inl
+++ src/rhi/rhi-format.inl
@@ -1,45 +1,45 @@
 // #define X(FORMAT, SIZE, TYPE, VK, DX, GLI, GLF, GLT)
-X(rhi::image_format::rgba_unorm8,  4*1, rhi::attachment_type::color, VK_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,      GL_RGBA8,        GL_RGBA,         GL_UNSIGNED_BYTE)
-X(rhi::image_format::rgba_srgb8,   4*1, rhi::attachment_type::color, VK_FORMAT_R8G8B8A8_SRGB,       DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, GL_SRGB8_ALPHA8, GL_RGBA,         GL_UNSIGNED_BYTE)
-X(rhi::image_format::rgba_norm8,   4*1, rhi::attachment_type::color, VK_FORMAT_R8G8B8A8_SNORM,      DXGI_FORMAT_R8G8B8A8_SNORM,      GL_RGBA8_SNORM,  GL_RGBA,         GL_BYTE)
-X(rhi::image_format::rgba_uint8,   4*1, rhi::attachment_type::color, VK_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_R8G8B8A8_UINT,       GL_RGBA8UI,      GL_RGBA_INTEGER, GL_UNSIGNED_BYTE)
-X(rhi::image_format::rgba_int8,    4*1, rhi::attachment_type::color, VK_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_R8G8B8A8_SINT,       GL_RGBA8I,       GL_RGBA_INTEGER, GL_BYTE)
-X(rhi::image_format::rgba_unorm16, 4*2, rhi::attachment_type::color, VK_FORMAT_R16G16B16A16_UNORM,  DXGI_FORMAT_R16G16B16A16_UNORM,  GL_RGBA16,       GL_RGBA,         GL_UNSIGNED_SHORT)
-X(rhi::image_format::rgba_norm16,  4*2, rhi::attachment_type::color, VK_FORMAT_R16G16B16A16_SNORM,  DXGI_FORMAT_R16G16B16A16_SNORM,  GL_RGBA16_SNORM, GL_RGBA,         GL_SHORT)
-X(rhi::image_format::rgba_uint16,  4*2, rhi::attachment_type::color, VK_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_R16G16B16A16_UINT,   GL_RGBA16UI,     GL_RGBA_INTEGER, GL_UNSIGNED_SHORT)
-X(rhi::image_format::rgba_int16,   4*2, rhi::attachment_type::color, VK_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_R16G16B16A16_SINT,   GL_RGBA16I,      GL_RGBA_INTEGER, GL_SHORT)
-X(rhi::image_format::rgba_float16, 4*2, rhi::attachment_type::color, VK_FORMAT_R16G16B16A16_SFLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,  GL_RGBA16F,      GL_RGBA,         GL_HALF_FLOAT)
-X(rhi::image_format::rgba_uint32,  4*4, rhi::attachment_type::color, VK_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_R32G32B32A32_UINT,   GL_RGBA32UI,     GL_RGBA_INTEGER, GL_UNSIGNED_INT)
-X(rhi::image_format::rgba_int32,   4*4, rhi::attachment_type::color, VK_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_R32G32B32A32_SINT,   GL_RGBA32I,      GL_RGBA_INTEGER, GL_INT)
-X(rhi::image_format::rgba_float32, 4*4, rhi::attachment_type::color, VK_FORMAT_R32G32B32A32_SFLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,  GL_RGBA32F,      GL_RGBA,         GL_FLOAT)
-X(rhi::image_format::rgb_uint32,   3*4, rhi::attachment_type::color, VK_FORMAT_R32G32B32_UINT,      DXGI_FORMAT_R32G32B32_UINT,      GL_RGB32UI,      GL_RGB_INTEGER,  GL_UNSIGNED_INT)
-X(rhi::image_format::rgb_int32,    3*4, rhi::attachment_type::color, VK_FORMAT_R32G32B32_SINT,      DXGI_FORMAT_R32G32B32_SINT,      GL_RGB32I,       GL_RGB_INTEGER,  GL_INT)
-X(rhi::image_format::rgb_float32,  3*4, rhi::attachment_type::color, VK_FORMAT_R32G32B32_SFLOAT,    DXGI_FORMAT_R32G32B32_FLOAT,     GL_RGB32F,       GL_RGB,          GL_FLOAT)
-X(rhi::image_format::rg_unorm8,    2*1, rhi::attachment_type::color, VK_FORMAT_R8G8_UNORM,          DXGI_FORMAT_R8G8_UNORM,          GL_RG8,          GL_RG,           GL_UNSIGNED_BYTE)
-X(rhi::image_format::rg_norm8,     2*1, rhi::attachment_type::color, VK_FORMAT_R8G8_SNORM,          DXGI_FORMAT_R8G8_SNORM,          GL_RG8_SNORM,    GL_RG,           GL_BYTE)
-X(rhi::image_format::rg_uint8,     2*1, rhi::attachment_type::color, VK_FORMAT_R8G8_UINT,           DXGI_FORMAT_R8G8_UINT,           GL_RG8UI,        GL_RG_INTEGER,   GL_UNSIGNED_BYTE)
-X(rhi::image_format::rg_int8,      2*1, rhi::attachment_type::color, VK_FORMAT_R8G8_SINT,           DXGI_FORMAT_R8G8_SINT,           GL_RG8I,         GL_RG_INTEGER,   GL_BYTE)
-X(rhi::image_format::rg_unorm16,   2*2, rhi::attachment_type::color, VK_FORMAT_R16G16_UNORM,        DXGI_FORMAT_R16G16_UNORM,        GL_RG16,         GL_RG,           GL_UNSIGNED_SHORT)
-X(rhi::image_format::rg_norm16,    2*2, rhi::attachment_type::color, VK_FORMAT_R16G16_SNORM,        DXGI_FORMAT_R16G16_SNORM,        GL_RG16_SNORM,   GL_RG,           GL_SHORT)
-X(rhi::image_format::rg_uint16,    2*2, rhi::attachment_type::color, VK_FORMAT_R16G16_UINT,         DXGI_FORMAT_R16G16_UINT,         GL_RG16UI,       GL_RG_INTEGER,   GL_UNSIGNED_SHORT)
-X(rhi::image_format::rg_int16,     2*2, rhi::attachment_type::color, VK_FORMAT_R16G16_SINT,         DXGI_FORMAT_R16G16_SINT,         GL_RG16I,        GL_RG_INTEGER,   GL_SHORT)
-X(rhi::image_format::rg_float16,   2*2, rhi::attachment_type::color, VK_FORMAT_R16G16_SFLOAT,       DXGI_FORMAT_R16G16_FLOAT,        GL_RG16F,        GL_RG,           GL_HALF_FLOAT)
-X(rhi::image_format::rg_uint32,    2*4, rhi::attachment_type::color, VK_FORMAT_R32G32_UINT,         DXGI_FORMAT_R32G32_UINT,         GL_RG32UI,       GL_RG_INTEGER,   GL_UNSIGNED_INT)
-X(rhi::image_format::rg_int32,     2*4, rhi::attachment_type::color, VK_FORMAT_R32G32_SINT,         DXGI_FORMAT_R32G32_SINT,         GL_RG32I,        GL_RG_INTEGER,   GL_INT)
-X(rhi::image_format::rg_float32,   2*4, rhi::attachment_type::color, VK_FORMAT_R32G32_SFLOAT,       DXGI_FORMAT_R32G32_FLOAT,        GL_RG32F,        GL_RG,           GL_FLOAT)
-X(rhi::image_format::r_unorm8,     1*1, rhi::attachment_type::color, VK_FORMAT_R8_UNORM,            DXGI_FORMAT_R8_UNORM,            GL_R8,           GL_RED,          GL_UNSIGNED_BYTE)
-X(rhi::image_format::r_norm8,      1*1, rhi::attachment_type::color, VK_FORMAT_R8_SNORM,            DXGI_FORMAT_R8_SNORM,            GL_R8_SNORM,     GL_RED,          GL_BYTE)
-X(rhi::image_format::r_uint8,      1*1, rhi::attachment_type::color, VK_FORMAT_R8_UINT,             DXGI_FORMAT_R8_UINT,             GL_R8UI,         GL_RED_INTEGER,  GL_UNSIGNED_BYTE)
-X(rhi::image_format::r_int8,       1*1, rhi::attachment_type::color, VK_FORMAT_R8G8_SINT,           DXGI_FORMAT_R8_SINT,             GL_R8I,          GL_RED_INTEGER,  GL_BYTE)
-X(rhi::image_format::r_unorm16,    1*2, rhi::attachment_type::color, VK_FORMAT_R16_UNORM,           DXGI_FORMAT_R16_UNORM,           GL_R16,          GL_RED,          GL_UNSIGNED_SHORT)
-X(rhi::image_format::r_norm16,     1*2, rhi::attachment_type::color, VK_FORMAT_R16_SNORM,           DXGI_FORMAT_R16_SNORM,           GL_R16_SNORM,    GL_RED,          GL_SHORT)
-X(rhi::image_format::r_uint16,     1*2, rhi::attachment_type::color, VK_FORMAT_R16_UINT,            DXGI_FORMAT_R16_UINT,            GL_R16UI,        GL_RED_INTEGER,  GL_UNSIGNED_SHORT)
-X(rhi::image_format::r_int16,      1*2, rhi::attachment_type::color, VK_FORMAT_R16_SINT,            DXGI_FORMAT_R16_SINT,            GL_R16I,         GL_RED_INTEGER,  GL_SHORT)
-X(rhi::image_format::r_float16,    1*2, rhi::attachment_type::color, VK_FORMAT_R16_SFLOAT,          DXGI_FORMAT_R16_FLOAT,           GL_R16F,         GL_RED,          GL_HALF_FLOAT)
-X(rhi::image_format::r_uint32,     1*4, rhi::attachment_type::color, VK_FORMAT_R32_UINT,            DXGI_FORMAT_R32_UINT,            GL_R32UI,        GL_RED_INTEGER,  GL_UNSIGNED_INT)
-X(rhi::image_format::r_int32,      1*4, rhi::attachment_type::color, VK_FORMAT_R32_SINT,            DXGI_FORMAT_R32_SINT,            GL_R32I,         GL_RED_INTEGER,  GL_INT)
-X(rhi::image_format::r_float32,    1*4, rhi::attachment_type::color, VK_FORMAT_R32_SFLOAT,          DXGI_FORMAT_R32_FLOAT,           GL_R32F,         GL_RED,          GL_FLOAT)
-X(rhi::image_format::depth_unorm16,          2, rhi::attachment_type::depth_stencil, VK_FORMAT_D16_UNORM,          DXGI_FORMAT_D16_UNORM,            GL_DEPTH_COMPONENT16,   GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT)
-X(rhi::image_format::depth_unorm24_stencil8, 4, rhi::attachment_type::depth_stencil, VK_FORMAT_D24_UNORM_S8_UINT,  DXGI_FORMAT_D24_UNORM_S8_UINT,    GL_DEPTH24_STENCIL8,    GL_DEPTH_STENCIL,   GL_UNSIGNED_INT_24_8)
-X(rhi::image_format::depth_float32,          4, rhi::attachment_type::depth_stencil, VK_FORMAT_D32_SFLOAT,         DXGI_FORMAT_D32_FLOAT,            GL_DEPTH_COMPONENT32F,  GL_DEPTH_COMPONENT, GL_FLOAT)
-X(rhi::image_format::depth_float32_stencil8, 8, rhi::attachment_type::depth_stencil, VK_FORMAT_D32_SFLOAT_S8_UINT, DXGI_FORMAT_D32_FLOAT_S8X24_UINT, GL_DEPTH32F_STENCIL8,   GL_DEPTH_STENCIL,   GL_FLOAT_32_UNSIGNED_INT_24_8_REV)
+X(rhi::image_format::rgba_unorm8,            4*1, rhi::attachment_type::color,       VK_FORMAT_R8G8B8A8_UNORM,      DXGI_FORMAT_R8G8B8A8_UNORM,       GL_RGBA8,               GL_RGBA,            GL_UNSIGNED_BYTE)
+X(rhi::image_format::rgba_srgb8,             4*1, rhi::attachment_type::color,       VK_FORMAT_R8G8B8A8_SRGB,       DXGI_FORMAT_R8G8B8A8_UNORM_SRGB,  GL_SRGB8_ALPHA8,        GL_RGBA,            GL_UNSIGNED_BYTE)
+X(rhi::image_format::rgba_norm8,             4*1, rhi::attachment_type::color,       VK_FORMAT_R8G8B8A8_SNORM,      DXGI_FORMAT_R8G8B8A8_SNORM,       GL_RGBA8_SNORM,         GL_RGBA,            GL_BYTE)
+X(rhi::image_format::rgba_uint8,             4*1, rhi::attachment_type::color,       VK_FORMAT_R8G8B8A8_UINT,       DXGI_FORMAT_R8G8B8A8_UINT,        GL_RGBA8UI,             GL_RGBA_INTEGER,    GL_UNSIGNED_BYTE)
+X(rhi::image_format::rgba_int8,              4*1, rhi::attachment_type::color,       VK_FORMAT_R8G8B8A8_SINT,       DXGI_FORMAT_R8G8B8A8_SINT,        GL_RGBA8I,              GL_RGBA_INTEGER,    GL_BYTE)
+X(rhi::image_format::rgba_unorm16,           4*2, rhi::attachment_type::color,       VK_FORMAT_R16G16B16A16_UNORM,  DXGI_FORMAT_R16G16B16A16_UNORM,   GL_RGBA16,              GL_RGBA,            GL_UNSIGNED_SHORT)
+X(rhi::image_format::rgba_norm16,            4*2, rhi::attachment_type::color,       VK_FORMAT_R16G16B16A16_SNORM,  DXGI_FORMAT_R16G16B16A16_SNORM,   GL_RGBA16_SNORM,        GL_RGBA,            GL_SHORT)
+X(rhi::image_format::rgba_uint16,            4*2, rhi::attachment_type::color,       VK_FORMAT_R16G16B16A16_UINT,   DXGI_FORMAT_R16G16B16A16_UINT,    GL_RGBA16UI,            GL_RGBA_INTEGER,    GL_UNSIGNED_SHORT)
+X(rhi::image_format::rgba_int16,             4*2, rhi::attachment_type::color,       VK_FORMAT_R16G16B16A16_SINT,   DXGI_FORMAT_R16G16B16A16_SINT,    GL_RGBA16I,             GL_RGBA_INTEGER,    GL_SHORT)
+X(rhi::image_format::rgba_float16,           4*2, rhi::attachment_type::color,       VK_FORMAT_R16G16B16A16_SFLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT,   GL_RGBA16F,             GL_RGBA,            GL_HALF_FLOAT)
+X(rhi::image_format::rgba_uint32,            4*4, rhi::attachment_type::color,       VK_FORMAT_R32G32B32A32_UINT,   DXGI_FORMAT_R32G32B32A32_UINT,    GL_RGBA32UI,            GL_RGBA_INTEGER,    GL_UNSIGNED_INT)
+X(rhi::image_format::rgba_int32,             4*4, rhi::attachment_type::color,       VK_FORMAT_R32G32B32A32_SINT,   DXGI_FORMAT_R32G32B32A32_SINT,    GL_RGBA32I,             GL_RGBA_INTEGER,    GL_INT)
+X(rhi::image_format::rgba_float32,           4*4, rhi::attachment_type::color,       VK_FORMAT_R32G32B32A32_SFLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT,   GL_RGBA32F,             GL_RGBA,            GL_FLOAT)
+X(rhi::image_format::rgb_uint32,             3*4, rhi::attachment_type::color,       VK_FORMAT_R32G32B32_UINT,      DXGI_FORMAT_R32G32B32_UINT,       GL_RGB32UI,             GL_RGB_INTEGER,     GL_UNSIGNED_INT)
+X(rhi::image_format::rgb_int32,              3*4, rhi::attachment_type::color,       VK_FORMAT_R32G32B32_SINT,      DXGI_FORMAT_R32G32B32_SINT,       GL_RGB32I,              GL_RGB_INTEGER,     GL_INT)
+X(rhi::image_format::rgb_float32,            3*4, rhi::attachment_type::color,       VK_FORMAT_R32G32B32_SFLOAT,    DXGI_FORMAT_R32G32B32_FLOAT,      GL_RGB32F,              GL_RGB,             GL_FLOAT)
+X(rhi::image_format::rg_unorm8,              2*1, rhi::attachment_type::color,       VK_FORMAT_R8G8_UNORM,          DXGI_FORMAT_R8G8_UNORM,           GL_RG8,                 GL_RG,              GL_UNSIGNED_BYTE)
+X(rhi::image_format::rg_norm8,               2*1, rhi::attachment_type::color,       VK_FORMAT_R8G8_SNORM,          DXGI_FORMAT_R8G8_SNORM,           GL_RG8_SNORM,           GL_RG,              GL_BYTE)
+X(rhi::image_format::rg_uint8,               2*1, rhi::attachment_type::color,       VK_FORMAT_R8G8_UINT,           DXGI_FORMAT_R8G8_UINT,            GL_RG8UI,               GL_RG_INTEGER,      GL_UNSIGNED_BYTE)
+X(rhi::image_format::rg_int8,                2*1, rhi::attachment_type::color,       VK_FORMAT_R8G8_SINT,           DXGI_FORMAT_R8G8_SINT,            GL_RG8I,                GL_RG_INTEGER,      GL_BYTE)
+X(rhi::image_format::rg_unorm16,             2*2, rhi::attachment_type::color,       VK_FORMAT_R16G16_UNORM,        DXGI_FORMAT_R16G16_UNORM,         GL_RG16,                GL_RG,              GL_UNSIGNED_SHORT)
+X(rhi::image_format::rg_norm16,              2*2, rhi::attachment_type::color,       VK_FORMAT_R16G16_SNORM,        DXGI_FORMAT_R16G16_SNORM,         GL_RG16_SNORM,          GL_RG,              GL_SHORT)
+X(rhi::image_format::rg_uint16,              2*2, rhi::attachment_type::color,       VK_FORMAT_R16G16_UINT,         DXGI_FORMAT_R16G16_UINT,          GL_RG16UI,              GL_RG_INTEGER,      GL_UNSIGNED_SHORT)
+X(rhi::image_format::rg_int16,               2*2, rhi::attachment_type::color,       VK_FORMAT_R16G16_SINT,         DXGI_FORMAT_R16G16_SINT,          GL_RG16I,               GL_RG_INTEGER,      GL_SHORT)
+X(rhi::image_format::rg_float16,             2*2, rhi::attachment_type::color,       VK_FORMAT_R16G16_SFLOAT,       DXGI_FORMAT_R16G16_FLOAT,         GL_RG16F,               GL_RG,              GL_HALF_FLOAT)
+X(rhi::image_format::rg_uint32,              2*4, rhi::attachment_type::color,       VK_FORMAT_R32G32_UINT,         DXGI_FORMAT_R32G32_UINT,          GL_RG32UI,              GL_RG_INTEGER,      GL_UNSIGNED_INT)
+X(rhi::image_format::rg_int32,               2*4, rhi::attachment_type::color,       VK_FORMAT_R32G32_SINT,         DXGI_FORMAT_R32G32_SINT,          GL_RG32I,               GL_RG_INTEGER,      GL_INT)
+X(rhi::image_format::rg_float32,             2*4, rhi::attachment_type::color,       VK_FORMAT_R32G32_SFLOAT,       DXGI_FORMAT_R32G32_FLOAT,         GL_RG32F,               GL_RG,              GL_FLOAT)
+X(rhi::image_format::r_unorm8,               1*1, rhi::attachment_type::color,       VK_FORMAT_R8_UNORM,            DXGI_FORMAT_R8_UNORM,             GL_R8,                  GL_RED,             GL_UNSIGNED_BYTE)
+X(rhi::image_format::r_norm8,                1*1, rhi::attachment_type::color,       VK_FORMAT_R8_SNORM,            DXGI_FORMAT_R8_SNORM,             GL_R8_SNORM,            GL_RED,             GL_BYTE)
+X(rhi::image_format::r_uint8,                1*1, rhi::attachment_type::color,       VK_FORMAT_R8_UINT,             DXGI_FORMAT_R8_UINT,              GL_R8UI,                GL_RED_INTEGER,     GL_UNSIGNED_BYTE)
+X(rhi::image_format::r_int8,                 1*1, rhi::attachment_type::color,       VK_FORMAT_R8G8_SINT,           DXGI_FORMAT_R8_SINT,              GL_R8I,                 GL_RED_INTEGER,     GL_BYTE)
+X(rhi::image_format::r_unorm16,              1*2, rhi::attachment_type::color,       VK_FORMAT_R16_UNORM,           DXGI_FORMAT_R16_UNORM,            GL_R16,                 GL_RED,             GL_UNSIGNED_SHORT)
+X(rhi::image_format::r_norm16,               1*2, rhi::attachment_type::color,       VK_FORMAT_R16_SNORM,           DXGI_FORMAT_R16_SNORM,            GL_R16_SNORM,           GL_RED,             GL_SHORT)
+X(rhi::image_format::r_uint16,               1*2, rhi::attachment_type::color,       VK_FORMAT_R16_UINT,            DXGI_FORMAT_R16_UINT,             GL_R16UI,               GL_RED_INTEGER,     GL_UNSIGNED_SHORT)
+X(rhi::image_format::r_int16,                1*2, rhi::attachment_type::color,       VK_FORMAT_R16_SINT,            DXGI_FORMAT_R16_SINT,             GL_R16I,                GL_RED_INTEGER,     GL_SHORT)
+X(rhi::image_format::r_float16,              1*2, rhi::attachment_type::color,       VK_FORMAT_R16_SFLOAT,          DXGI_FORMAT_R16_FLOAT,            GL_R16F,                GL_RED,             GL_HALF_FLOAT)
+X(rhi::image_format::r_uint32,               1*4, rhi::attachment_type::color,       VK_FORMAT_R32_UINT,            DXGI_FORMAT_R32_UINT,             GL_R32UI,               GL_RED_INTEGER,     GL_UNSIGNED_INT)
+X(rhi::image_format::r_int32,                1*4, rhi::attachment_type::color,       VK_FORMAT_R32_SINT,            DXGI_FORMAT_R32_SINT,             GL_R32I,                GL_RED_INTEGER,     GL_INT)
+X(rhi::image_format::r_float32,              1*4, rhi::attachment_type::color,       VK_FORMAT_R32_SFLOAT,          DXGI_FORMAT_R32_FLOAT,            GL_R32F,                GL_RED,             GL_FLOAT)
+X(rhi::image_format::depth_unorm16,          2, rhi::attachment_type::depth_stencil, VK_FORMAT_D16_UNORM,           DXGI_FORMAT_D16_UNORM,            GL_DEPTH_COMPONENT16,   GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT)
+X(rhi::image_format::depth_unorm24_stencil8, 4, rhi::attachment_type::depth_stencil, VK_FORMAT_D24_UNORM_S8_UINT,   DXGI_FORMAT_D24_UNORM_S8_UINT,    GL_DEPTH24_STENCIL8,    GL_DEPTH_STENCIL,   GL_UNSIGNED_INT_24_8)
+X(rhi::image_format::depth_float32,          4, rhi::attachment_type::depth_stencil, VK_FORMAT_D32_SFLOAT,          DXGI_FORMAT_D32_FLOAT,            GL_DEPTH_COMPONENT32F,  GL_DEPTH_COMPONENT, GL_FLOAT)
+X(rhi::image_format::depth_float32_stencil8, 8, rhi::attachment_type::depth_stencil, VK_FORMAT_D32_SFLOAT_S8_UINT,  DXGI_FORMAT_D32_FLOAT_S8X24_UINT, GL_DEPTH32F_STENCIL8,   GL_DEPTH_STENCIL,   GL_FLOAT_32_UNSIGNED_INT_24_8_REV)


[renderer] Add support for arrays

[renderer] Add support for arrays

--- src/nova_renderer.cpp
+++ src/nova_renderer.cpp
@@ -634,6 +634,11 @@
         new_binding.count = 1;
         new_binding.stages = shader_stage;

+        const spirv_cross::SPIRType& type_information = shader_compiler.get_type(resource.type_id);
+        if(!type_information.array.empty()) {
+            new_binding.count = type_information.array[0];
+        }
+
         const std::string& resource_name = resource.name;

         if(const auto itr = bindings.find(resource_name); itr != bindings.end()) {


fixed random.u64 test

fixed random.u64 test

--- src/rnd/Random_TEST.cc
+++ src/rnd/Random_TEST.cc
@@ -79,32 +79,35 @@
 TEST(Random, u64) {
   const u64 kBkts = 1000;
   const u64 kRounds = 10000000;
-  std::vector<u64> buckets(kBkts, 0);
-  rnd::Random rand(0xDEADBEEF12345678lu);
-
-  for (u64 r = 0; r < kRounds; r++) {
-    u64 value = rand.nextF64(0, kBkts);
-    buckets.at(value)++;
-  }
-
-  f64 sum = 0;
-  for (u64 b = 0; b < kBkts; b++) {
-    sum += buckets.at(b);
-    // printf("[%lu] = %lu\n", b, buckets.at(b));
-  }
-  f64 mean = sum / kBkts;
-
-  sum = 0;
-  for (u64 b = 0; b < kBkts; b++) {
-    f64 c = (static_cast<f64>(buckets.at(b)) - mean);
-    c *= c;
-    sum += c;
-  }
-  f64 stdDev = std::sqrt(sum / kBkts);
-  // printf("stdDev = %f\n", stdDev);
-  stdDev /= kRounds;
-  // printf("relStdDev = %f\n", stdDev);
-  ASSERT_LE(stdDev, 0.00009);
+  const u64 kTests = 4;
+  for (u64 test = 0; test < kTests; test++) {
+    std::vector<u64> buckets(kBkts, 0);
+    u64 seed = 0xDEADBEEF12345678lu + test;
+    rnd::Random rand(seed);
+
+    for (u64 r = 0; r < kRounds; r++) {
+      u64 value = rand.nextU64(1234, kBkts + 1234 - 1);
+      buckets.at(value - 1234)++;
+    }
+
+    f64 sum = 0;
+    for (u64 b = 0; b < kBkts; b++) {
+      sum += buckets.at(b);
+    }
+    f64 mean = sum / kBkts;
+
+    sum = 0;
+    for (u64 b = 0; b < kBkts; b++) {
+      f64 c = (static_cast<f64>(buckets.at(b)) - mean);
+      c *= c;
+      sum += c;
+    }
+    f64 stdDev = std::sqrt(sum / kBkts);
+    // printf("stdDev = %f\n", stdDev);
+    stdDev /= kRounds;
+    // printf("relStdDev = %f\n", stdDev);
+    ASSERT_LE(stdDev, 0.00009);
+  }
 }

 TEST(Random, bits_range) {


rpc: Improve scantxoutset response and help message

Former-commit-id: 3c1f44e03ae1eb62dfa856c0245621705c093aef

--- src/rpc/blockchain.cpp
+++ src/rpc/blockchain.cpp
@@ -2119,17 +2119,21 @@
                 },
                 RPCResult{
             "{\n"
+            "  \"success\": true|false,         (boolean) Whether the scan was completed\n"
+            "  \"txouts\": n,                   (numeric) The number of unspent transaction outputs scanned\n"
+            "  \"height\": n,                   (numeric) The current block height (index)\n"
+            "  \"bestblock\": \"hex\",            (string) The hash of the block at the tip of the chain\n"
             "  \"unspents\": [\n"
-            "    {\n"
-            "    \"txid\" : \"transactionid\",     (string) The transaction id\n"
-            "    \"vout\": n,                    (numeric) the vout value\n"
-            "    \"scriptPubKey\" : \"script\",    (string) the script key\n"
-            "    \"desc\" : \"descriptor\",        (string) A specialized descriptor for the matched scriptPubKey\n"
-            "    \"amount\" : x.xxx,             (numeric) The total amount in " + CURRENCY_UNIT + " of the unspent output\n"
-            "    \"height\" : n,                 (numeric) Height of the unspent transaction output\n"
+            "   {\n"
+            "    \"txid\": \"hash\",              (string) The transaction id\n"
+            "    \"vout\": n,                   (numeric) The vout value\n"
+            "    \"scriptPubKey\": \"script\",    (string) The script key\n"
+            "    \"desc\": \"descriptor\",        (string) A specialized descriptor for the matched scriptPubKey\n"
+            "    \"amount\": x.xxx,             (numeric) The total amount in " + CURRENCY_UNIT + " of the unspent output\n"
+            "    \"height\": n,                 (numeric) Height of the unspent transaction output\n"
             "   }\n"
-            "   ,...], \n"
-            " \"total_amount\" : x.xxx,          (numeric) The total amount of all found unspent outputs in " + CURRENCY_UNIT + "\n"
+            "   ,...],\n"
+            "  \"total_amount\": x.xxx,          (numeric) The total amount of all found unspent outputs in " + CURRENCY_UNIT + "\n"
             "]\n"
                 },
                 RPCExamples{""},
@@ -2183,15 +2187,20 @@
         g_scan_progress = 0;
         int64_t count = 0;
         std::unique_ptr<CCoinsViewCursor> pcursor;
+        CBlockIndex* tip;
         {
             LOCK(cs_main);
             ::ChainstateActive().ForceFlushStateToDisk();
             pcursor = std::unique_ptr<CCoinsViewCursor>(::ChainstateActive().CoinsDB().Cursor());
             assert(pcursor);
+            tip = ::ChainActive().Tip();
+            assert(tip);
         }
         bool res = FindScriptPubKey(g_scan_progress, g_should_abort_scan, count, pcursor.get(), needles, coins);
         result.pushKV("success", res);
-        result.pushKV("searched_items", count);
+        result.pushKV("txouts", count);
+        result.pushKV("height", tip->nHeight);
+        result.pushKV("bestblock", tip->GetBlockHash().GetHex());

         for (const auto& it : coins) {
             const COutPoint& outpoint = it.first;


Update messages.

Update messages.

--- src/nvtt/TexImage.cpp
+++ src/nvtt/TexImage.cpp
@@ -509,7 +509,7 @@

 	if (m->type == TextureType_Cube)
 	{
-#pragma message(NV_FILE_LINE "Output error when image is cubemap and w != h.")
+#pragma message(NV_FILE_LINE "TODO: Output error when image is cubemap and w != h.")
 		h = w;
 	}

@@ -951,7 +951,7 @@
 		const FloatImage * img = m->imageArray[i];
 		m->imageArray[i] = nv::createNormalMap(img, (FloatImage::WrapMode)m->wrapMode, filterWeights);

-#pragma messsage(NV_FILE_LINE "Pack and expand normals explicitly")
+#pragma message(NV_FILE_LINE "TODO: Pack and expand normals explicitly")
 		m->imageArray[i]->packNormals(0);

 		delete img;
@@ -968,7 +968,7 @@
 	{
 		if (m->imageArray[i] == NULL) continue;

-#pragma message(NV_FILE_LINE "Implement TexImage::toHeightMap")
+#pragma message(NV_FILE_LINE "TODO: Implement TexImage::toHeightMap")
 	}

 	m->isNormalMap = false;


Mark findserial and getserials as zerocoin commands

Keeping them in `rpc/blockchain.cpp` because they aren't strictly wallet
commands, and `findserials` relies on the `validaterange` function here,
no sense in duplicating that code elsewhere.

Both are set to be deleted after 5.0 is locked in.

--- src/rpc/blockchain.cpp
+++ src/rpc/blockchain.cpp
@@ -1616,9 +1616,7 @@
 static const CRPCCommand commands[] =
 { //  category              name                      actor (function)         okSafeMode
   //  --------------------- ------------------------  -----------------------  ----------
-    { "blockchain",         "findserial",             &findserial,             true  },
     { "blockchain",         "getblockindexstats",     &getblockindexstats,     true  },
-    { "blockchain",         "getserials",             &getserials,             true  },
     { "blockchain",         "getblockchaininfo",      &getblockchaininfo,      true  },
     { "blockchain",         "getbestblockhash",       &getbestblockhash,       true  },
     { "blockchain",         "getblockcount",          &getblockcount,          true  },
@@ -1641,6 +1639,13 @@
     { "hidden",             "waitfornewblock",        &waitfornewblock,        true  },
     { "hidden",             "waitforblock",           &waitforblock,           true  },
     { "hidden",             "waitforblockheight",     &waitforblockheight,     true  },
+
+    // TODO: Remove these two RPC commands after 5.0 is locked in
+    /* Zerocoin functions to be removed post-5.0 */
+    { "zerocoin",           "findserial",             &findserial,             true  },
+    { "zerocoin",           "getserials",             &getserials,             true  },
+
+
 };

 void RegisterBlockchainRPCCommands(CRPCTable &tableRPC)


fix incorrect error log message

fix incorrect error log message

--- src/oddlib/stream.cpp
+++ src/oddlib/stream.cpp
@@ -25,7 +25,7 @@
         s->open(fileName, std::ios::in | std::ios::binary | std::ios::ate);
         if (!*s)
         {
-            LOG_ERROR("Lvl file not found " << fileName);
+            LOG_ERROR("File not found " << fileName);
             throw Exception("File not found");
         }


Remove unsupported types/fields from "masternode list"

--- src/rpc/masternode.cpp
+++ src/rpc/masternode.cpp
@@ -136,26 +136,20 @@
             "2. \"filter\"    (string, optional) Filter results. Partial match by outpoint by default in all modes,\n"
             "                                    additional matches in some modes are also available\n"
             "\nAvailable modes:\n"
-            "  activeseconds  - Print number of seconds masternode recognized by the network as enabled\n"
-            "                   (since latest issued \"masternode start/start-many/start-alias\")\n"
             "  addr           - Print ip address associated with a masternode (can be additionally filtered, partial match)\n"
-            "  daemon         - Print daemon version of a masternode (can be additionally filtered, exact match)\n"
-            "  full           - Print info in format 'status protocol payee lastseen activeseconds lastpaidtime lastpaidblock IP'\n"
+            "  full           - Print info in format 'status payee lastpaidtime lastpaidblock IP'\n"
             "                   (can be additionally filtered, partial match)\n"
-            "  info           - Print info in format 'status protocol payee lastseen activeseconds sentinelversion sentinelstate IP'\n"
+            "  info           - Print info in format 'status payee IP'\n"
             "                   (can be additionally filtered, partial match)\n"
             "  json           - Print info in JSON format (can be additionally filtered, partial match)\n"
             "  lastpaidblock  - Print the last block height a node was paid on the network\n"
             "  lastpaidtime   - Print the last time a node was paid on the network\n"
-            "  lastseen       - Print timestamp of when a masternode was last seen on the network\n"
             "  payee          - Print Dash address associated with a masternode (can be additionally filtered,\n"
             "                   partial match)\n"
-            "  protocol       - Print protocol of a masternode (can be additionally filtered, exact match)\n"
             "  keyid          - Print the masternode (not collateral) key id\n"
             "  rank           - Print rank of a masternode based on current block\n"
-            "  sentinel       - Print sentinel version of a masternode (can be additionally filtered, exact match)\n"
-            "  status         - Print masternode status: PRE_ENABLED / ENABLED / EXPIRED / SENTINEL_PING_EXPIRED / NEW_START_REQUIRED /\n"
-            "                   UPDATE_REQUIRED / POSE_BAN / OUTPOINT_SPENT (can be additionally filtered, partial match)\n"
+            "  status         - Print masternode status: ENABED / POSE_BAN / OUTPOINT_SPENT\n"
+            "                   (can be additionally filtered, partial match)\n"
         );
 }

@@ -819,10 +813,10 @@
     if (request.params.size() == 2) strFilter = request.params[1].get_str();

     if (request.fHelp || (
-                strMode != "activeseconds" && strMode != "addr" && strMode != "daemon" && strMode != "full" && strMode != "info" && strMode != "json" &&
-                strMode != "lastseen" && strMode != "lastpaidtime" && strMode != "lastpaidblock" &&
-                strMode != "protocol" && strMode != "payee" && strMode != "pubkey" &&
-                strMode != "rank" && strMode != "sentinel" && strMode != "status"))
+                strMode != "addr" && strMode != "full" && strMode != "info" && strMode != "json" &&
+                strMode != "lastpaidtime" && strMode != "lastpaidblock" &&
+                strMode != "payee" && strMode != "pubkey" &&
+                strMode != "rank" && strMode != "status"))
     {
         masternode_list_help();
     }
@@ -867,32 +861,16 @@
                 payeeStr = CBitcoinAddress(payeeDest).ToString();
             }

-            if (strMode == "activeseconds") {
-                if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
-                obj.push_back(Pair(strOutpoint, (int64_t)(mn.lastPing.sigTime - mn.sigTime)));
-            } else if (strMode == "addr") {
+            if (strMode == "addr") {
                 std::string strAddress = mn.addr.ToString();
                 if (strFilter !="" && strAddress.find(strFilter) == std::string::npos &&
                     strOutpoint.find(strFilter) == std::string::npos) continue;
                 obj.push_back(Pair(strOutpoint, strAddress));
-            } else if (strMode == "daemon") {
-                std::string strDaemon = mn.lastPing.GetDaemonString();
-                if (strFilter !="" && strDaemon.find(strFilter) == std::string::npos &&
-                    strOutpoint.find(strFilter) == std::string::npos) continue;
-                obj.push_back(Pair(strOutpoint, strDaemon));
-            } else if (strMode == "sentinel") {
-                std::string strSentinel = mn.lastPing.GetSentinelString();
-                if (strFilter !="" && strSentinel.find(strFilter) == std::string::npos &&
-                    strOutpoint.find(strFilter) == std::string::npos) continue;
-                obj.push_back(Pair(strOutpoint, strSentinel));
             } else if (strMode == "full") {
                 std::ostringstream streamFull;
                 streamFull << std::setw(18) <<
                                mn.GetStatus() << " " <<
-                               mn.nProtocolVersion << " " <<
                                payeeStr << " " <<
-                               (int64_t)mn.lastPing.sigTime << " " << std::setw(8) <<
-                               (int64_t)(mn.lastPing.sigTime - mn.sigTime) << " " << std::setw(10) <<
                                mn.GetLastPaidTime() << " "  << std::setw(6) <<
                                mn.GetLastPaidBlock() << " " <<
                                mn.addr.ToString();
@@ -904,12 +882,7 @@
                 std::ostringstream streamInfo;
                 streamInfo << std::setw(18) <<
                                mn.GetStatus() << " " <<
-                               mn.nProtocolVersion << " " <<
                                payeeStr << " " <<
-                               (int64_t)mn.lastPing.sigTime << " " << std::setw(8) <<
-                               (int64_t)(mn.lastPing.sigTime - mn.sigTime) << " " <<
-                               mn.lastPing.GetSentinelString() << " "  <<
-                               (mn.lastPing.fSentinelIsCurrent ? "current" : "expired") << " " <<
                                mn.addr.ToString();
                 std::string strInfo = streamInfo.str();
                 if (strFilter !="" && strInfo.find(strFilter) == std::string::npos &&
@@ -920,12 +893,6 @@
                 streamInfo <<  mn.addr.ToString() << " " <<
                                CBitcoinAddress(mn.pubKeyCollateralAddress.GetID()).ToString() << " " <<
                                mn.GetStatus() << " " <<
-                               mn.nProtocolVersion << " " <<
-                               mn.lastPing.nDaemonVersion << " " <<
-                               mn.lastPing.GetSentinelString() << " " <<
-                               (mn.lastPing.fSentinelIsCurrent ? "current" : "expired") << " " <<
-                               (int64_t)mn.lastPing.sigTime << " " <<
-                               (int64_t)(mn.lastPing.sigTime - mn.sigTime) << " " <<
                                mn.GetLastPaidTime() << " " <<
                                mn.GetLastPaidBlock();
                 std::string strInfo = streamInfo.str();
@@ -935,12 +902,6 @@
                 objMN.push_back(Pair("address", mn.addr.ToString()));
                 objMN.push_back(Pair("payee", CBitcoinAddress(mn.pubKeyCollateralAddress.GetID()).ToString()));
                 objMN.push_back(Pair("status", mn.GetStatus()));
-                objMN.push_back(Pair("protocol", mn.nProtocolVersion));
-                objMN.push_back(Pair("daemonversion", mn.lastPing.GetDaemonString()));
-                objMN.push_back(Pair("sentinelversion", mn.lastPing.GetSentinelString()));
-                objMN.push_back(Pair("sentinelstate", (mn.lastPing.fSentinelIsCurrent ? "current" : "expired")));
-                objMN.push_back(Pair("lastseen", (int64_t)mn.lastPing.sigTime));
-                objMN.push_back(Pair("activeseconds", (int64_t)(mn.lastPing.sigTime - mn.sigTime)));
                 objMN.push_back(Pair("lastpaidtime", mn.GetLastPaidTime()));
                 objMN.push_back(Pair("lastpaidblock", mn.GetLastPaidBlock()));
                 obj.push_back(Pair(strOutpoint, objMN));
@@ -950,17 +911,10 @@
             } else if (strMode == "lastpaidtime") {
                 if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
                 obj.push_back(Pair(strOutpoint, mn.GetLastPaidTime()));
-            } else if (strMode == "lastseen") {
-                if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
-                obj.push_back(Pair(strOutpoint, (int64_t)mn.lastPing.sigTime));
             } else if (strMode == "payee") {
                 if (strFilter !="" && payeeStr.find(strFilter) == std::string::npos &&
                     strOutpoint.find(strFilter) == std::string::npos) continue;
                 obj.push_back(Pair(strOutpoint, payeeStr));
-            } else if (strMode == "protocol") {
-                if (strFilter !="" && strFilter != strprintf("%d", mn.nProtocolVersion) &&
-                    strOutpoint.find(strFilter) == std::string::npos) continue;
-                obj.push_back(Pair(strOutpoint, mn.nProtocolVersion));
             } else if (strMode == "keyIDOwner") {
                 if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
                 obj.push_back(Pair(strOutpoint, HexStr(mn.keyIDOwner)));


Fixed skipahead playback timing

Fixed skipahead playback timing

--- src/output/output.cpp
+++ src/output/output.cpp
@@ -1171,9 +1171,9 @@
             // slow down processing, if real time speed is wanted
             if (realTime){
               uint8_t i = 6;
-              while (--i && thisPacket.getTime() > ((((Util::bootMS() - firstTime) * 1000) + maxSkipAhead) / realTime) &&
+              while (--i && thisPacket.getTime() > (((Util::bootMS() - firstTime) * 1000) / realTime + maxSkipAhead) &&
                      keepGoing()){
-                uint64_t amount = thisPacket.getTime() - ((((Util::bootMS() - firstTime) * 1000) + maxSkipAhead) / realTime);
+                uint64_t amount = thisPacket.getTime() - (((Util::bootMS() - firstTime) * 1000) / realTime + maxSkipAhead);
                 if (amount > 1000){amount = 1000;}
                 Util::sleep(amount);
                 //Make sure we stay responsive to requests and stats while waiting


fix crash in TRD reconstruction

fix crash in TRD reconstruction

--- TRD/AliTRDtrackingSector.cxx
+++ TRD/AliTRDtrackingSector.cxx
@@ -43,7 +43,7 @@
   // Default constructor

   memset(fChamber, 0, AliTRDgeometry::kNdets*sizeof(AliTRDtrackingChamber*));
-  memset(fIndex, 1, AliTRDgeometry::kNdets*sizeof(Char_t));
+  memset(fIndex, -1, AliTRDgeometry::kNdets*sizeof(Char_t));
   memset(fX0, 0, AliTRDgeometry::kNlayer*sizeof(Float_t));
 }

@@ -58,7 +58,7 @@
   //

   memset(fChamber, 0, AliTRDgeometry::kNdets*sizeof(AliTRDtrackingChamber*));
-  memset(fIndex, 1, AliTRDgeometry::kNdets*sizeof(Char_t));
+  memset(fIndex, -1, AliTRDgeometry::kNdets*sizeof(Char_t));
   memset(fX0, 0, AliTRDgeometry::kNlayer*sizeof(Float_t));
 }

@@ -109,7 +109,7 @@
     (*tc)->Clear(opt);
     delete (*tc); (*tc) = 0x0;   // I would avoid
   }
-  memset(fIndex, 1, AliTRDgeometry::kNdets*sizeof(Char_t));
+  memset(fIndex, -1, AliTRDgeometry::kNdets*sizeof(Char_t));
   fN = 0;
 }


Add SchedRW as an Instruction field.

Add SchedRW as an Instruction field.

Don't require instructions to inherit Sched<...>. Sometimes it is more
convenient to say:

  let SchedRW = ... in {
    ...
  }

Which is now possible.

git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@177199 91177308-0d34-0410-b5e6-96231b3b80d8

--- TableGen/CodeGenSchedule.cpp
+++ TableGen/CodeGenSchedule.cpp
@@ -217,7 +217,7 @@
   for (CodeGenTarget::inst_iterator I = Target.inst_begin(),
          E = Target.inst_end(); I != E; ++I) {
     Record *SchedDef = (*I)->TheDef;
-    if (!SchedDef->isSubClassOf("Sched"))
+    if (SchedDef->isValueUnset("SchedRW"))
       continue;
     RecVec RWs = SchedDef->getValueAsListOfDefs("SchedRW");
     for (RecIter RWI = RWs.begin(), RWE = RWs.end(); RWI != RWE; ++RWI) {
@@ -529,7 +529,7 @@
   // instruction definition that inherits from class Sched.
   for (CodeGenTarget::inst_iterator I = Target.inst_begin(),
          E = Target.inst_end(); I != E; ++I) {
-    if (!(*I)->TheDef->isSubClassOf("Sched"))
+    if ((*I)->TheDef->isValueUnset("SchedRW"))
       continue;
     IdxVec Writes, Reads;
     findRWs((*I)->TheDef->getValueAsListOfDefs("SchedRW"), Writes, Reads);
@@ -553,7 +553,7 @@
          E = Target.inst_end(); I != E; ++I) {
     Record *SchedDef = (*I)->TheDef;
     std::string InstName = (*I)->TheDef->getName();
-    if (SchedDef->isSubClassOf("Sched")) {
+    if (!SchedDef->isValueUnset("SchedRW")) {
       IdxVec Writes;
       IdxVec Reads;
       findRWs((*I)->TheDef->getValueAsListOfDefs("SchedRW"), Writes, Reads);
@@ -584,7 +584,7 @@
       }
       continue;
     }
-    if (!SchedDef->isSubClassOf("Sched")
+    if (SchedDef->isValueUnset("SchedRW")
         && (SchedDef->getValueAsDef("Itinerary")->getName() == "NoItinerary")) {
       dbgs() << "No machine model for " << (*I)->TheDef->getName() << '\n';
     }
@@ -627,7 +627,7 @@

   // If this opcode isn't mapped by the subtarget fallback to the instruction
   // definition's SchedRW or ItinDef values.
-  if (Inst.TheDef->isSubClassOf("Sched")) {
+  if (!Inst.TheDef->isValueUnset("SchedRW")) {
     RecVec RWs = Inst.TheDef->getValueAsListOfDefs("SchedRW");
     return getSchedClassIdx(RWs);
   }
@@ -719,7 +719,7 @@
       // class because that is the fall-back class for other processors.
       Record *ItinDef = (*I)->getValueAsDef("Itinerary");
       SCIdx = SchedClassIdxMap.lookup(ItinDef->getName());
-      if (!SCIdx && (*I)->isSubClassOf("Sched"))
+      if (!SCIdx && !(*I)->isValueUnset("SchedRW"))
         SCIdx = getSchedClassIdx((*I)->getValueAsListOfDefs("SchedRW"));
     }
     unsigned CIdx = 0, CEnd = ClassInstrs.size();


Fixed to that component_number is set correctly in Variable_input_nodal_values::size()

--- source/computed_variable/variable_finite_element.cpp
+++ source/computed_variable/variable_finite_element.cpp
@@ -1,7 +1,7 @@
 //******************************************************************************
 // FILE : variable_finite_element.cpp
 //
-// LAST MODIFIED : 26 November 2003
+// LAST MODIFIED : 28 November 2003
 //
 // DESCRIPTION :
 // Finite element types - element/xi and finite element field.
@@ -283,7 +283,7 @@

 class Variable_input_nodal_values : public Variable_input
 //******************************************************************************
-// LAST MODIFIED : 26 November 2003
+// LAST MODIFIED : 28 November 2003
 //
 // DESCRIPTION :
 //==============================================================================
@@ -343,8 +343,7 @@
 				(fe_region=FE_field_get_FE_region(fe_field))&&
 				(0<(number_of_components=get_FE_field_number_of_components(fe_field))))
 			{
-				//???DB.  Have component_number in variable_finite_element?
-				component_number= -1;
+				component_number=variable_finite_element->component_number;
 				count_nodal_values_data.number_of_values=0;
 				count_nodal_values_data.value_type=value_type;
 				count_nodal_values_data.version=version;


Fixed keyword symbol literals.

Fixed keyword symbol literals.

--- src/parser/parser.cpp
+++ src/parser/parser.cpp
@@ -646,7 +646,11 @@
 			{
 				Range range = lexer.lexeme;

-				lexer.step();
+				lexer.lexeme.allow_keywords = false;
+
+				lexer.step();
+
+				lexer.lexeme.allow_keywords = true;

 				switch(lexeme())
 				{


Add DirectValue.h include in QmlEngine.cpp.

--- source/gloperate-qtquick/source/viewer/QmlEngine.cpp
+++ source/gloperate-qtquick/source/viewer/QmlEngine.cpp
@@ -6,6 +6,7 @@
 #include <QJSValueIterator>

 #include <cppexpose/reflection/Property.h>
+#include <cppexpose/typed/DirectValue.h>

 #include <cppassist/io/FilePath.h>


Space changes.

Space changes.

git-svn-id: 47ecf0eee40ae8baa1bb5e98a22c0bda2f631ce9@1526 1e37f2df-8004-0410-ba96-adcf012cb36e

--- src/parser/uparser.cc
+++ src/parser/uparser.cc
@@ -114,7 +114,7 @@
 {
   /// Helper to format error and warning messages.
   std::string errorFormat(const yy::parser::location_type& l,
-                          const std::string& msg)
+			  const std::string& msg)
   {
     std::ostringstream o;
     o << "!!! " << l << ": " << msg << '\n' << std::ends;


rapidjson always have json parse error given subdoc property using JsonReader instead

--- source/process/renderers/SubDocPropValueRenderer.cpp
+++ source/process/renderers/SubDocPropValueRenderer.cpp
@@ -1,6 +1,7 @@
 #include "SubDocPropValueRenderer.h"
 #include <rapidjson/document.h>
 #include <glog/logging.h>
+#include <util/driver/readers/JsonReader.h>

 namespace sf1r
 {
@@ -11,10 +12,13 @@
 {
     if (origText.empty())
         return;
+    izenelib::driver::JsonReader reader;
+    reader.read(origText, resourceValue);
+    /*
     rapidjson::Document doc;
-    if (doc.Parse<0>(origText.c_str()).HasParseError());
+    if (doc.Parse<0>(origText.c_str()).HasParseError())
     {
-        return;
+        //return;
     }
     const rapidjson::Value& subDocs = doc;
     assert(subDocs.IsArray());
@@ -27,6 +31,6 @@
         {
             subDoc[mit->name.GetString()]=mit->value.GetString();
         }
-    }
+    }*/
 }
 }


Fix pool allocator memory persistence across allocs


Slam: removeBadLandmaks: calculate maxRange with Point

--- src/slam/Landmarks.cpp
+++ src/slam/Landmarks.cpp
@@ -661,14 +661,20 @@
 int Landmarks::removeBadLandmarks(pcl::PointCloud<pcl::PointXYZ> const &cloud, Agent const &agent)
 {
   double maxrange = 0;
+  double rangeBefore = this->distance(cloud.points[0].x, cloud.points[0].y, agent.getPos().x, agent.getPos().y);
+  double range = this->distance(cloud.points[1].x, cloud.points[1].y, agent.getPos().x, agent.getPos().y);

   for(unsigned int i = 1; i < cloud.points.size() - 1; ++i)
     {
+      double rangeAfter = this->distance(cloud.points[i + 1].x, cloud.points[i + 1].y, agent.getPos().x, agent.getPos().y);
+      // @TODO: check real camera max
       // we get the camera data with max range
-      if (cloud.points[i - 1].z < agent.cameraProblem
-	  && cloud.points[i + 1].z < agent.cameraProblem
-	  && cloud.points[i].z > maxrange)
-	maxrange = cloud.points[i].z;
+      if (rangeBefore < agent.cameraProblem
+	  && rangeAfter < agent.cameraProblem
+	  && range > maxrange)
+	maxrange = range;
+      rangeBefore = range;
+      range = rangeAfter;
     }

   double *Xbounds = new double[4];


scale the grid based on the distance of the camera to the world origin. (rather than distance to the camera rotational center.)

--- src/planetswidget.cpp
+++ src/planetswidget.cpp
@@ -230,7 +230,7 @@
         }

         QMatrix4x4 matrix;
-        matrix.scale(pow(4, floor(log10(camera.distance))));
+        matrix.scale(pow(4.0f, floor(log10(camera.camera.column(3).length()))));
         shaderColor.setUniformValue("modelMatrix", matrix);
         shaderColor.setUniformValue("color", gridColor);


check for valid selection on switching from OrbitalPlane to OrbitalPlanet placing step. don't use "this->" for accessing members.

--- src/planetswidget.cpp
+++ src/planetswidget.cpp
@@ -12,7 +12,7 @@

     placing.velocity.setY(velocityfac);

-    this->setMouseTracking(true);
+    setMouseTracking(true);

     timer.setSingleShot(true);
     connect(&timer, SIGNAL(timeout()), this, SLOT(updateGL()));
@@ -214,8 +214,8 @@
         glDrawArrays(GL_LINES, 0, gridPoints.size());
     }

-    if(this->doScreenshot){
-        this->doScreenshot = false;
+    if(doScreenshot){
+        doScreenshot = false;

         QDir dir = QDir::homePath() + "/Pictures/Planets3D Screenshots/";
         if(!dir.exists()){
@@ -226,7 +226,7 @@
         while(QFile::exists(filename.arg(++i, 4, 10, QChar('0'))));
         filename = filename.arg(i, 4, 10, QChar('0'));

-        QImage img = this->grabFrameBuffer();
+        QImage img = grabFrameBuffer();
         if(!img.isNull() && img.save(filename)){
             qDebug() << "Screenshot saved to:" << filename;
         }
@@ -268,13 +268,13 @@
         placingRotation.rotate((lastmousepos.x() - e->x()) * 0.05f, 1.0f, 0.0f, 0.0f);
         placingRotation.rotate((lastmousepos.y() - e->y()) * 0.05f, 0.0f, 1.0f, 0.0f);
         placing.velocity = placingRotation.column(2).toVector3D() * placing.velocity.length();
-        QCursor::setPos(this->mapToGlobal(this->lastmousepos));
+        QCursor::setPos(mapToGlobal(lastmousepos));
         return;
     case OrbitalPlane:
         if(universe.isValid(universe.selected)){
             placingRotation.rotate((lastmousepos.x() - e->x()) * 0.05f, 1.0f, 0.0f, 0.0f);
             placingRotation.rotate((lastmousepos.y() - e->y()) * 0.05f, 0.0f, 1.0f, 0.0f);
-            QCursor::setPos(this->mapToGlobal(this->lastmousepos));
+            QCursor::setPos(mapToGlobal(lastmousepos));
             return;
         }
         break;
@@ -282,7 +282,7 @@
         if(universe.isValid(universe.selected)){
             placingRotation.rotate((lastmousepos.y() - e->y()) * 0.05f, 0.0f, 0.0f, 1.0f);
             placing.position = universe[universe.selected].position + placingRotation.column(0).toVector3D() * universe[universe.selected].radius() * placingOrbitalRadius;
-            QCursor::setPos(this->mapToGlobal(this->lastmousepos));
+            QCursor::setPos(mapToGlobal(lastmousepos));
             return;
         }
         break;
@@ -294,12 +294,12 @@
             camera.xrotation = qBound(-90.0f, camera.xrotation, 90.0f);
             camera.zrotation = fmod(camera.zrotation, 360.0f);

-            QCursor::setPos(this->mapToGlobal(this->lastmousepos));
-            this->setCursor(Qt::SizeAllCursor);
+            QCursor::setPos(mapToGlobal(lastmousepos));
+            setCursor(Qt::SizeAllCursor);
             return;
         }
     }
-    this->lastmousepos = e->pos();
+    lastmousepos = e->pos();
 }

 void PlanetsWidget::mouseDoubleClickEvent(QMouseEvent* e){
@@ -313,7 +313,7 @@
         switch(placingStep){
         case FreePositionXY:
             placingStep = FreePositionZ;
-            this->setCursor(Qt::BlankCursor);
+            setCursor(Qt::BlankCursor);
             break;
         case FreePositionZ:
             placingStep = FreeVelocity;
@@ -322,7 +322,7 @@
             placingStep = None;
             placing.velocity = placingRotation * QVector3D(0.0f, 0.0f, placing.velocity.length());
             universe.selected = universe.addPlanet(placing);
-            this->setCursor(Qt::ArrowCursor);
+            setCursor(Qt::ArrowCursor);
             break;
         case Firing:{
             QVector3D windowCoord((2.0f * e->x())  / width()  - 1.0f,
@@ -341,8 +341,12 @@
             break;
         }
         case OrbitalPlane:
-            placingStep = OrbitalPlanet;
-            placing.position = universe[universe.selected].position + placingRotation.column(0).toVector3D() * universe[universe.selected].radius() * placingOrbitalRadius;
+            if(universe.isValid(universe.selected)){
+                placingStep = OrbitalPlanet;
+                placing.position = universe[universe.selected].position + placingRotation.column(0).toVector3D() * universe[universe.selected].radius() * placingOrbitalRadius;
+                break;
+            }
+            placingStep = None;
             break;
         case OrbitalPlanet:
             if(universe.isValid(universe.selected)){
@@ -375,7 +379,7 @@

 void PlanetsWidget::mouseReleaseEvent(QMouseEvent *e){
     if(e->button() == Qt::MiddleButton){
-        this->setCursor(Qt::ArrowCursor);
+        setCursor(Qt::ArrowCursor);
     }
 }


Fix presubmit error

Fix presubmit error

TBR=ricow@chromium.org
Review URL: http://codereview.chromium.org/6093006

git-svn-id: b158db1e4b4ab85d4c9e510fdef4b1e8c614b15b@6148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

--- src/platform-macos.cc
+++ src/platform-macos.cc
@@ -437,7 +437,7 @@
   // Mac OS X does not expose the length limit of the name, so hardcode it.
   static const int kMaxNameLength = 63;
   USE(kMaxNameLength);
-  ASSERT(kMaxThreadNameLength <= kMaxNameLength);
+  ASSERT(kMaxThreadNameLength <= kMaxNameLength);
   dynamic_pthread_setname_np(name);
 }


improved code readability

improved code readability

--- src/soe/EratMedium.cpp
+++ src/soe/EratMedium.cpp
@@ -52,9 +52,8 @@
   static_assert(config::FACTOR_ERATMEDIUM <= 6, "config::FACTOR_ERATMEDIUM must not be > 6");
   if (soe.getSieveSize() > (1u << 22))
     throw std::overflow_error("EratMedium: sieveSize must be <= 2^22, 4096 kilobytes.");
-  uint_t sqrtStop = soe.getSqrtStop();
-  uint_t max      = soe.getSieveSize() * config::FACTOR_ERATMEDIUM;
-  limit_          = std::min(sqrtStop, max);
+  uint_t max = soe.getSieveSize() * config::FACTOR_ERATMEDIUM;
+  limit_     = std::min(soe.getSqrtStop(), max);
 }

 /// Add a new sieving prime


Use RtlCaptureContext instead of inline assembly to capture execution context on Windows

Inline assembly is not available in Visual C++ 64-bit version so use RtlCaptureContext to capture execution context. RtlCaptureContext is not available on Windows 2000 so this change removes Windows 2000 support. If this turns up causing trouble we can revert to only use RtlCaptureContext in 64-bit and inline assembly in 32-bit.
Review URL: http://codereview.chromium.org/335008

git-svn-id: b158db1e4b4ab85d4c9e510fdef4b1e8c614b15b@3122 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

--- src/platform-win32.cc
+++ src/platform-win32.cc
@@ -48,10 +48,10 @@
 #ifndef NOMCX
 #define NOMCX
 #endif
-// Require Windows 2000 or higher (this is required for the IsDebuggerPresent
+// Require Windows XP or higher (this is required for the RtlCaptureContext
 // function to be present).
 #ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x500
+#define _WIN32_WINNT 0x501
 #endif

 #include <windows.h>
@@ -1208,22 +1208,7 @@

   // Capture current context.
   CONTEXT context;
-  memset(&context, 0, sizeof(context));
-  context.ContextFlags = CONTEXT_CONTROL;
-  context.ContextFlags = CONTEXT_CONTROL;
-#ifdef  _WIN64
-  // TODO(X64): Implement context capture.
-#else
-  __asm    call x
-  __asm x: pop eax
-  __asm    mov context.Eip, eax
-  __asm    mov context.Ebp, ebp
-  __asm    mov context.Esp, esp
-  // NOTE: At some point, we could use RtlCaptureContext(&context) to
-  // capture the context instead of inline assembler. However it is
-  // only available on XP, Vista, Server 2003 and Server 2008 which
-  // might not be sufficient.
-#endif
+  RtlCaptureContext(&context);

   // Initialize the stack walking
   STACKFRAME64 stack_frame;


Make module property in manifest an array instead of object

--- src/plugin/Plugin.cpp
+++ src/plugin/Plugin.cpp
@@ -74,9 +74,14 @@

 	json_t *modulesJ = json_object_get(rootJ, "modules");
 	if (modulesJ) {
-		const char *slug;
+		size_t moduleId;
 		json_t *moduleJ;
-		json_object_foreach(modulesJ, slug, moduleJ) {
+		json_array_foreach(modulesJ, moduleId, moduleJ) {
+			json_t *slugJ = json_object_get(rootJ, "slug");
+			if (!slugJ)
+				continue;
+			std::string slug = json_string_value(slugJ);
+
 			Model *model = getModel(slug);
 			if (!model) {
 				WARN("plugin.json contains module \"%s\" but it is not defined in the plugin", slug);


i965: Do not render primitives in non-zero streams then TF is disabled

Haswell hardware seems to ignore Render Stream Select bits from
3DSTATE_STREAMOUT packet when the SOL stage is disabled even if
the PRM says otherwise. Because of this, all primitives are sent
down the pipeline for rasterization, which is wrong. If SOL is
enabled, Render Stream Select is honored and primitives bound to
non-zero streams are discarded after stream output.

Since the only purpose of primives sent to non-zero streams is to
be recorded by transform feedback, we can simply discard all geometry
bound to non-zero streams then transform feedback is disabled
to prevent it from ever reaching the rasterization stage.

Notice that this patch introduces a small change in the behavior we
get when a geometry shader emits more vertices than the maximum declared:
before, a vertex that was emitted to a non-zero stream when TF was
disabled would still count for the purposes of checking that we don't
exceed the maximum number of output vertices declared by the shader. With
this change, these vertices are completely ignored and won't increase
the output vertex count, making more room for other (hopefully more
useful) vertices.

Fixes piglit test arb_gpu_shader5-emitstreamvertex_nodraw on Haswell
and Broadwell.

v2 (Ken): Drop is_haswell check in favor of doing this unconditionally.
Broadwell needs the workaround as well, and it doesn't hurt to do it in
general.  Also tweak comments - the Haswell PRM does actually mention
this ("Command Reference: Instructions" page 797).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83962
Reviewed-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Cc: 59f39c0db42d4479a46b02d4d2bc11120e37bb44@lists.freedesktop.org

--- src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
+++ src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
@@ -475,6 +475,19 @@
 vec4_gs_visitor::visit(ir_emit_vertex *ir)
 {
    this->current_annotation = "emit vertex: safety check";
+
+   /* Haswell and later hardware ignores the "Render Stream Select" bits
+    * from the 3DSTATE_STREAMOUT packet when the SOL stage is disabled,
+    * and instead sends all primitives down the pipeline for rasterization.
+    * If the SOL stage is enabled, "Render Stream Select" is honored and
+    * primitives bound to non-zero streams are discarded after stream output.
+    *
+    * Since the only purpose of primives sent to non-zero streams is to
+    * be recorded by transform feedback, we can simply discard all geometry
+    * bound to these streams when transform feedback is disabled.
+    */
+   if (ir->stream_id() > 0 && shader_prog->TransformFeedback.NumVarying == 0)
+      return;

    /* To ensure that we don't output more vertices than the shader specified
     * using max_vertices, do the logic inside a conditional of the form "if


factored parser ctors into sub_ctorN

factored parser ctors into sub_ctorN

git-svn-id: e699fe4639e7715a7f788fcbdac464b34c416b62@521 9a304bd9-dce1-f7c0-8d5c-bb1642157d4e

--- src/stan/gm/parser.hpp
+++ src/stan/gm/parser.hpp
@@ -561,20 +561,11 @@
     struct expression_grammar : qi::grammar<Iterator,
                                             expression(),
                                             whitespace_grammar<Iterator> > {
-      expression_grammar(variable_map& var_map,
-                         std::stringstream& error_msgs)
-      : expression_grammar::base_type(expression_r),
-        var_map_(var_map),
-        error_msgs_(error_msgs) {
-
+      void sub_ctor1() {
         using qi::_val;
         using qi::_1;
         using qi::_pass;
-        using qi::double_;
-        using qi::int_;
         using boost::spirit::qi::eps;
-        using namespace qi::labels;
-
         expression_r.name("expression");
         expression_r
           %=  term_r                          [_val = _1]
@@ -583,8 +574,12 @@
                 )
           > qi::eps[_pass = validate_expr_type_f(_val)];
         ;
-
-       term_r.name("term");
+      }
+
+      void sub_ctor2() {
+        using qi::_val;
+        using qi::_1;
+        term_r.name("term");
         term_r
           %= ( negated_factor_r                          [_val = _1]
               >> *( (qi::lit('*') > negated_factor_r     [_val *= _1])
@@ -592,21 +587,37 @@
                     )
               )
           ;
-
+      }
+
+      void sub_ctor3() {
+        using qi::_val;
+        using qi::_1;
         negated_factor_r
           %= qi::lit('-') >> indexed_factor_r [_val = neg(_1)]
           | qi::lit('+') >> indexed_factor_r [_val = _1]
           | indexed_factor_r [_val = _1];
-
+      }
+
+      void sub_ctor4() {
+        using qi::_1;
+        using qi::_pass;
+
         // two of these to put semantic action on this one w. index_op input
         indexed_factor_r.name("(optionally) indexed factor [sub]");
         indexed_factor_r
           %= indexed_factor_2_r [_pass = set_indexed_factor_type_f(_1)];
-
+      }
+
+      void sub_ctor5() {
         indexed_factor_2_r.name("(optionally) indexed factor [sub] 2");
         indexed_factor_2_r
           %= (factor_r >> *dims_r);
-
+      }
+
+      void sub_ctor6() {
+        using qi::_val;
+        using qi::_1;
+        using qi::_pass;
         factor_r.name("factor");
         factor_r
           %=  int_literal_r      [_val = _1]
@@ -620,35 +631,50 @@
               > expression_r    [_val = _1]
               > qi::lit(')') )
           ;
-
+      }
+
+      void sub_ctor7() {
+        using qi::int_;
         int_literal_r.name("integer literal");
         int_literal_r
           %= int_
              >> !( qi::lit('.')
                    | qi::lit('e')
                    | qi::lit('E') );
-
+      }
+
+      void sub_ctor8() {
+        using qi::double_;
         double_literal_r.name("double literal");
         double_literal_r
           %= double_;
-
-
+      }
+
+      void sub_ctor9() {
         fun_r.name("function and argument expressions");
         fun_r
           %= identifier_r
           >> args_r;
-
+      }
+
+      void sub_ctor10() {
         identifier_r.name("identifier");
         identifier_r
           %= (qi::lexeme[qi::char_("a-zA-Z")
                         >> *qi::char_("a-zA-Z0-9_.")]);
-
+      }
+
+      void sub_ctor11() {
         args_r.name("function argument expressions");
         args_r
           %= qi::lit('(')
           >> (expression_r % ',')
           > qi::lit(')');
-
+      }
+
+      void sub_ctor12() {
+        using qi::_1;
+        using qi::_pass;
         dims_r.name("array dimensions");
         dims_r
           %= qi::lit('[')
@@ -657,11 +683,34 @@
              % ',')
           > qi::lit(']')
           ;
-
+      }
+
+      void sub_ctor13() {
         variable_r.name("variable expression");
         variable_r
           %= identifier_r;
-
+      }
+
+
+      expression_grammar(variable_map& var_map,
+                         std::stringstream& error_msgs)
+      : expression_grammar::base_type(expression_r),
+        var_map_(var_map),
+        error_msgs_(error_msgs) {
+
+        sub_ctor1();
+        sub_ctor2();
+        sub_ctor3();
+        sub_ctor4();
+        sub_ctor5();
+        sub_ctor6();
+        sub_ctor7();
+        sub_ctor8();
+        sub_ctor9();
+        sub_ctor10();
+        sub_ctor11();
+        sub_ctor12();
+        sub_ctor13();
       }

       variable_map& var_map_;
@@ -718,18 +767,12 @@
                                           qi::locals<bool>,
                                           var_decl(bool,var_origin),
                                           whitespace_grammar<Iterator> > {
-      var_decl_grammar(variable_map& var_map,
-                       std::stringstream& error_msgs)
-        : var_decl_grammar::base_type(var_decl_r),
-          var_map_(var_map),
-          error_msgs_(error_msgs),
-          expression_g(var_map,error_msgs) {
-
+
+
+      void sub_ctor1() {
         using qi::_val;
         using qi::_1;
         using qi::_pass;
-        using qi::double_;
-        using qi::int_;
         using boost::spirit::qi::eps;
         using namespace qi::labels;

@@ -760,7 +803,9 @@
              = validate_decl_constraints_f(_r1,_a,_val,
                                            boost::phoenix::ref(error_msgs_))]
           ;
-
+      }
+
+      void sub_ctor2() {
         int_decl_r.name("integer declaration");
         int_decl_r
           %= qi::lit("int")
@@ -768,8 +813,9 @@
           > identifier_r
           > opt_dims_r
           > qi::lit(';');
-
-
+      }
+
+      void sub_ctor3() {
         double_decl_r.name("double declaration");
         double_decl_r
           %= qi::lit("double")
@@ -777,7 +823,11 @@
           > identifier_r
           > opt_dims_r
           > qi::lit(';');
-
+      }
+
+      void sub_ctor4() {
+        using qi::_1;
+        using qi::_pass;
         vector_decl_r.name("vector declaration");
         vector_decl_r
           %= qi::lit("vector")
@@ -788,7 +838,11 @@
           > identifier_r
           > opt_dims_r
           > qi::lit(';');
-
+      }
+
+      void sub_ctor5() {
+        using qi::_1;
+        using qi::_pass;
         row_vector_decl_r.name("row vector declaration");
         row_vector_decl_r
           %= qi::lit("row_vector")
@@ -799,7 +853,11 @@
           > identifier_r
           > opt_dims_r
           > qi::lit(';');
-
+      }
+
+      void sub_ctor6() {
+        using qi::_1;
+        using qi::_pass;
         matrix_decl_r.name("matrix declaration");
         matrix_decl_r
           %= qi::lit("matrix")
@@ -813,7 +871,11 @@
           > identifier_r
           > opt_dims_r
           > qi::lit(';');
-
+      }
+
+      void sub_ctor7() {
+        using qi::_1;
+        using qi::_pass;
         simplex_decl_r.name("simplex declaration");
         simplex_decl_r
           %= qi::lit("simplex")
@@ -824,7 +886,11 @@
           > identifier_r
           > opt_dims_r
           > qi::lit(';');
-
+      }
+
+      void sub_ctor8() {
+        using qi::_1;
+        using qi::_pass;
         pos_ordered_decl_r.name("positive ordered declaration");
         pos_ordered_decl_r
           %= qi::lit("pos_ordered")
@@ -835,7 +901,11 @@
           > identifier_r
           > opt_dims_r
           > qi::lit(';');
-
+      }
+
+      void sub_ctor9() {
+        using qi::_1;
+        using qi::_pass;
         corr_matrix_decl_r.name("correlation matrix declaration");
         corr_matrix_decl_r
           %= qi::lit("corr_matrix")
@@ -846,7 +916,11 @@
           > identifier_r
           > opt_dims_r
           > qi::lit(';');
-
+      }
+
+      void sub_ctor10() {
+        using qi::_1;
+        using qi::_pass;
         cov_matrix_decl_r.name("covariance matrix declaration");
         cov_matrix_decl_r
           %= qi::lit("cov_matrix")
@@ -857,11 +931,17 @@
           > identifier_r
           > opt_dims_r
           > qi::lit(';');
-
+      }
+
+      void sub_ctor11() {
         opt_dims_r.name("array dimensions (optional)");
         opt_dims_r
           %=  - dims_r;
-
+      }
+
+      void sub_ctor12() {
+        using qi::_1;
+        using qi::_pass;
         dims_r.name("array dimensions");
         dims_r
           %= qi::lit('[')
@@ -870,7 +950,11 @@
              % ',')
           > qi::lit(']')
           ;
-
+      }
+
+      void sub_ctor13() {
+        using qi::_1;
+        using qi::_pass;
         range_brackets_int_r.name("range expression pair, brackets");
         range_brackets_int_r
           %= qi::lit('(')
@@ -880,7 +964,11 @@
           > -(expression_g
              [_pass = validate_int_expr_f(_1,boost::phoenix::ref(error_msgs_))])
           > qi::lit(')');
-
+      }
+
+      void sub_ctor14() {
+        using qi::_1;
+        using qi::_pass;
         range_brackets_double_r.name("range expression pair, brackets");
         range_brackets_double_r
           %= qi::lit('(')
@@ -891,12 +979,18 @@
               [_pass
                 = validate_double_expr_f(_1,boost::phoenix::ref(error_msgs_))])
           > qi::lit(')');
-
+      }
+
+      void sub_ctor15() {
         identifier_r.name("identifier");
         identifier_r
           %= (qi::lexeme[qi::char_("a-zA-Z")
                         >> *qi::char_("a-zA-Z0-9_.")]);
-
+      }
+
+      void sub_ctor16() {
+        using qi::_1;
+        using qi::_pass;
         range_r.name("range expression pair, colon");
         range_r
           %= expression_g
@@ -904,13 +998,35 @@
           >> qi::lit(':')
           >> expression_g
              [_pass = validate_int_expr_f(_1,boost::phoenix::ref(error_msgs_))];
-
-
-
-
+      }
+
+      var_decl_grammar(variable_map& var_map,
+                       std::stringstream& error_msgs)
+        : var_decl_grammar::base_type(var_decl_r),
+          var_map_(var_map),
+          error_msgs_(error_msgs),
+          expression_g(var_map,error_msgs) {
+
+        // windows compiler stack size hack
+        sub_ctor1();
+        sub_ctor2();
+        sub_ctor3();
+        sub_ctor4();
+        sub_ctor5();
+        sub_ctor6();
+        sub_ctor7();
+        sub_ctor8();
+        sub_ctor9();
+        sub_ctor10();
+        sub_ctor11();
+        sub_ctor12();
+        sub_ctor13();
+        sub_ctor14();
+        sub_ctor15();
+        sub_ctor16();
       }

-     // global info for parses
+      // global info for parses
       variable_map& var_map_;
       std::stringstream& error_msgs_;

@@ -976,23 +1092,11 @@
     struct statement_grammar : qi::grammar<Iterator,
                                            statement(bool,var_origin),
                                            whitespace_grammar<Iterator> > {
-      statement_grammar(variable_map& var_map,
-                        std::stringstream& error_msgs)
-        : statement_grammar::base_type(statement_r),
-          var_map_(var_map),
-          error_msgs_(error_msgs),
-          expression_g(var_map,error_msgs),
-          var_decl_g(var_map,error_msgs) {
-
-        using qi::_val;
-        using qi::_1;
-        using qi::_pass;
-        using qi::double_;
-        using qi::int_;
-        using boost::spirit::qi::eps;
+
+      void sub_ctor1() {
+        using qi::_1;
+        using qi::_pass;
         using namespace qi::labels;
-
-
         // _r1 true if sample_r allowed (inherited)
         // _r2 source of variables allowed for assignments
         // set to true if sample_r are allowed
@@ -1007,7 +1111,11 @@
           | sample_r(_r1) [_pass = validate_sample_f(_1)]
           | no_op_statement_r
           ;
-
+      }
+
+      void sub_ctor2() {
+        using qi::_1;
+        using namespace qi::labels;
         // _r1, _r2 same as statement_r
         statement_seq_r.name("sequence of statements");
         statement_seq_r
@@ -1017,10 +1125,18 @@
           > qi::lit('}')
           > qi::eps[unscope_locals_f(_a,boost::phoenix::ref(var_map_))]
           ;
-
+      }
+
+      void sub_ctor3() {
         local_var_decls_r
           %= *var_decl_g(false,local_origin); // - constants
-
+      }
+
+      void sub_ctor4() {
+        using qi::_1;
+        using qi::_pass;
+        using boost::spirit::qi::eps;
+        using namespace qi::labels;
         // _r1, _r2 same as statement_r
         for_statement_r.name("for statement");
         for_statement_r
@@ -1037,12 +1153,18 @@
           > qi::eps
             [remove_loop_identifier_f(_a,boost::phoenix::ref(var_map_))];
           ;
-
+      }
+
+      void sub_ctor5() {
         identifier_r.name("identifier");
         identifier_r
           %= (qi::lexeme[qi::char_("a-zA-Z")
                         >> *qi::char_("a-zA-Z0-9_.")]);
-
+      }
+
+      void sub_ctor6() {
+        using qi::_1;
+        using qi::_pass;
         range_r.name("range expression pair, colon");
         range_r
           %= expression_g
@@ -1050,7 +1172,9 @@
           >> qi::lit(':')
           >> expression_g
              [_pass = validate_int_expr_f(_1,boost::phoenix::ref(error_msgs_))];
-
+      }
+
+      void sub_ctor7() {
         assignment_r.name("variable assignment by expression");
         assignment_r
           %= var_lhs_r
@@ -1058,16 +1182,24 @@
           > expression_g
           > qi::lit(';')
           ;
-
+      }
+
+      void sub_ctor8() {
         var_lhs_r.name("variable and array dimensions");
         var_lhs_r
           %= identifier_r
           >> opt_dims_r;
-
+      }
+
+      void sub_ctor9() {
         opt_dims_r.name("array dimensions (optional)");
         opt_dims_r
           %=  - dims_r;
-
+      }
+
+      void sub_ctor10() {
+        using qi::_1;
+        using qi::_pass;
         dims_r.name("array dimensions");
         dims_r
           %= qi::lit('[')
@@ -1076,7 +1208,12 @@
              % ',')
           > qi::lit(']')
           ;
-
+      }
+
+      void sub_ctor11() {
+        using qi::_pass;
+        using boost::spirit::qi::eps;
+        using namespace qi::labels;
         // inherited  _r1 = true if samples allowed as statements
         sample_r.name("distribution of expression");
         sample_r
@@ -1088,14 +1225,18 @@
           > distribution_r
           > -truncation_range_r
           > qi::lit(';');
-
+      }
+
+      void sub_ctor12() {
         distribution_r.name("distribution and parameters");
         distribution_r
           %= identifier_r
           >> qi::lit('(')
           >> -(expression_g % ',')
           > qi::lit(')');
-
+      }
+
+      void sub_ctor13() {
         truncation_range_r.name("range pair");
         truncation_range_r
           %= qi::lit('T')
@@ -1104,11 +1245,40 @@
           > qi::lit(',')
           > -expression_g
           > qi::lit(')');
-
+      }
+
+      void sub_ctor14() {
+        using qi::_val;
         no_op_statement_r.name("no op statement");
         no_op_statement_r
           %= qi::lit(';') [_val = no_op_statement()];  // ok to re-use instance
       }
+
+      statement_grammar(variable_map& var_map,
+                        std::stringstream& error_msgs)
+        : statement_grammar::base_type(statement_r),
+          var_map_(var_map),
+          error_msgs_(error_msgs),
+          expression_g(var_map,error_msgs),
+          var_decl_g(var_map,error_msgs) {
+
+        sub_ctor1();
+        sub_ctor2();
+        sub_ctor3();
+        sub_ctor4();
+        sub_ctor5();
+        sub_ctor6();
+        sub_ctor7();
+        sub_ctor8();
+        sub_ctor9();
+        sub_ctor10();
+        sub_ctor11();
+        sub_ctor12();
+        sub_ctor13();
+        sub_ctor14();
+      }
+
+

      // global info for parses
       variable_map& var_map_;
@@ -1170,33 +1340,15 @@
       qi::rule<Iterator, variable_dims(), whitespace_grammar<Iterator> >
       var_lhs_r;

-
     };

-
-
-
     template <typename Iterator>
     struct program_grammar : qi::grammar<Iterator,
                                          program(),
                                          whitespace_grammar<Iterator> > {

-      program_grammar()
-        : program_grammar::base_type(program_r),
-          var_map_(),
-          error_msgs_(),
-          expression_g(var_map_,error_msgs_),
-          var_decl_g(var_map_,error_msgs_),
-          statement_g(var_map_,error_msgs_)
-      {
-        using qi::_val;
-        using qi::_1;
-        using qi::_pass;
-        using qi::double_;
-        using qi::int_;
+      void sub_ctor1() {
         using boost::spirit::qi::eps;
-        using namespace qi::labels;
-
         program_r.name("program");
         program_r
           %= -data_var_decls_r
@@ -1209,20 +1361,26 @@
           > qi::eps[remove_lp_var_f(boost::phoenix::ref(var_map_))]
           > -generated_var_decls_r
           ;
-
+      }
+
+      void sub_ctor2() {
         model_r.name("model declaration");
         model_r
           %= qi::lit("model")
           > statement_g(true,local_origin)  // assign only to locals
           ;
-
+      }
+
+      void sub_ctor3() {
         data_var_decls_r.name("data variable declarations");
         data_var_decls_r
           %= qi::lit("data")
           > qi::lit('{')
           > *var_decl_g(true,data_origin) // +constraints
           > qi::lit('}');
-
+      }
+
+      void sub_ctor4() {
         derived_data_var_decls_r.name("derived data block");
         derived_data_var_decls_r
           %= qi::lit("derived")
@@ -1231,14 +1389,18 @@
           > *var_decl_g(false,transformed_data_origin)  // -constraints
           > *statement_g(false,transformed_data_origin) // -sampling
           > qi::lit('}');
-
+      }
+
+      void sub_ctor5() {
         param_var_decls_r.name("parameter variable declarations");
         param_var_decls_r
           %= qi::lit("parameters")
           > qi::lit('{')
           > *var_decl_g(true,parameter_origin) // +constraints
           > qi::lit('}');
-
+      }
+
+      void sub_ctor6() {
         derived_var_decls_r.name("derived variable declarations");
         derived_var_decls_r
           %= qi::lit("derived")
@@ -1247,7 +1409,9 @@
           > *var_decl_g(false,transformed_parameter_origin) // -constraints
           > *statement_g(false,transformed_parameter_origin) // -sampling
           > qi::lit('}');
-
+      }
+
+      void sub_ctor7() {
         generated_var_decls_r.name("generated variable declarations");
         generated_var_decls_r
           %= qi::lit("generated")
@@ -1256,34 +1420,50 @@
           > *var_decl_g(false,derived_origin) // -constraints
           > *statement_g(false,derived_origin) // -sampling
           > qi::lit('}');
-
+      }
+
+      program_grammar()
+        : program_grammar::base_type(program_r),
+          var_map_(),
+          error_msgs_(),
+          expression_g(var_map_,error_msgs_),
+          var_decl_g(var_map_,error_msgs_),
+          statement_g(var_map_,error_msgs_) {
+
+        sub_ctor1();
+        sub_ctor2();
+        sub_ctor3();
+        sub_ctor4();
+        sub_ctor5();
+        sub_ctor6();
+        sub_ctor7();
+      }

         // hack cast to write to error_msgs_ of type stringstream
-        /*
-        qi::on_error<qi::rethrow>(var_decl_r,
-             (std::ostream&)error_msgs_
-              << boost::phoenix::val("ERROR: Ill-formed variable declaration.")
-              << std::endl);
-
-        qi::on_error<qi::rethrow>(indexed_factor_r,
-              (std::ostream&)error_msgs_
-              << boost::phoenix::val("ERROR: Ill-formed indexed factor.")
-              << std::endl);
-
-        qi::on_error<qi::rethrow>(factor_r,
-              (std::ostream&)error_msgs_
-              << boost::phoenix::val("ERROR: Ill-formed factor.")
-              << std::endl);
-
-        qi::on_error<qi::rethrow>(program_r,
-              (std::ostream&)error_msgs_
-               << boost::phoenix::val("ERROR: Expected ")
-               << _4
-               << std::endl);
-        */
-
-      }
+
+        // qi::on_error<qi::rethrow>(var_decl_r,
+        //      (std::ostream&)error_msgs_
+        //       << boost::phoenix::val("ERROR: Ill-formed variable declaration.")
+        //       << std::endl);
+
+        // qi::on_error<qi::rethrow>(indexed_factor_r,
+        //       (std::ostream&)error_msgs_
+        //       << boost::phoenix::val("ERROR: Ill-formed indexed factor.")
+        //       << std::endl);
+
+        // qi::on_error<qi::rethrow>(factor_r,
+        //       (std::ostream&)error_msgs_
+        //       << boost::phoenix::val("ERROR: Ill-formed factor.")
+        //       << std::endl);
+
+        // qi::on_error<qi::rethrow>(program_r,
+        //       (std::ostream&)error_msgs_
+        //        << boost::phoenix::val("ERROR: Expected ")
+        //        << _4
+        //        << std::endl);
+
+

       // global info for parses
       variable_map var_map_;


feat(solver/context.cc): Optimize Minimize function

To encode ∀y. (∨ᵢ ¬ϕᵢ(y)) ∨ (f(x) ≤ f(y)), instead of ψ = ∀y. (⋀ⱼ
ϕᵢ(y)) → f(x) ≤ f(y). The two are logically the same, but the former
form is expected in forall-handlers.

--- dreal/solver/context.cc
+++ dreal/solver/context.cc
@@ -158,13 +158,14 @@
   // Given e = f(x) and the current constraints ϕᵢ which
   // involves x. it constructs a universally quantified formula ψ:
   //
-  //    ψ = ∀y. (⋀ⱼ ϕᵢ(y)) → f(x) ≤ f(y).
+  //    ψ = ∀y. (⋀ᵢ ϕᵢ(y)) → (f(x) ≤ f(y))
+  //      = ∀y. ¬(⋀ᵢ ϕᵢ(y)) ∨ (f(x) ≤ f(y))
+  //      = ∀y. (∨ᵢ ¬ϕᵢ(y)) ∨ (f(x) ≤ f(y)).
   //
-
   // To construct ϕᵢ(y), we need to traverse both `box()` and
   // `stack_` because some of the asserted formulas are translated
   // and applied into `box()`.
-  set<Formula> phi_set;
+  set<Formula> set_of_negated_phi;  // Collects ¬ϕᵢ(y).
   ExpressionSubstitution subst;  // Maps xᵢ ↦ yᵢ to build f(y₁, ..., yₙ).
   Variables quantified_variables;  // {y₁, ... yₙ}
   const Variables x_vars{f.GetVariables()};
@@ -173,28 +174,28 @@
     const Variable y_i{x_i.get_name() + "_", x_i.get_type()};
     quantified_variables.insert(y_i);
     subst.emplace(x_i, y_i);
-    // If `box()[x_i]` has a finite bound, let's add that information in phi_set
-    // as a constraint on y_i.
+    // If `box()[x_i]` has a finite bound, let's add that information in
+    // set_of_negated_phi as a constraint on y_i.
     const Box::Interval& bound_on_x_i{box()[x_i]};
     const double lb_x_i{bound_on_x_i.lb()};
     const double ub_x_i{bound_on_x_i.ub()};
     if (isfinite(lb_x_i)) {
-      phi_set.insert(lb_x_i <= y_i);
+      set_of_negated_phi.insert(!(lb_x_i <= y_i));
     }
     if (isfinite(ub_x_i)) {
-      phi_set.insert(y_i <= ub_x_i);
+      set_of_negated_phi.insert(!(y_i <= ub_x_i));
     }
   }
   for (const Formula& constraint : stack_) {
     if (!intersect(x_vars, constraint.GetFreeVariables()).empty()) {
       // Case : xᵢ ∈ vars(constraint)
       // We need to collect constraint[xᵢ ↦ yᵢ].
-      phi_set.insert(constraint.Substitute(subst));
-    }
-  }
-  const Formula phi{make_conjunction(phi_set)};  // ⋀ⱼ ϕ(y)
+      set_of_negated_phi.insert(!constraint.Substitute(subst));
+    }
+  }
+  const Formula phi{make_disjunction(set_of_negated_phi)};  // ∨ᵢ ¬ϕᵢ(y)
   const Formula psi{
-      forall(quantified_variables, imply(phi, f <= f.Substitute(subst)))};
+      forall(quantified_variables, phi || (f <= f.Substitute(subst)))};
   return Assert(psi);
 }


Fix typo

Fix typo

Former-commit-id: 134df5769b2bd608d08357c132d2a5cb1763dc4f

--- src/hyperion-x11/hyperion-x11.cpp
+++ src/hyperion-x11/hyperion-x11.cpp
@@ -29,7 +29,7 @@
         OptionsParser optionParser("X11 capture application for Hyperion");
         ParameterSet & parameters = optionParser.getParameters();

-        IntParameter           & argFps             = parameters.add<IntParameter>          ('f', "framerate",        "Cpture frame rate [default=10]");
+        IntParameter           & argFps             = parameters.add<IntParameter>          ('f', "framerate",        "Capture frame rate [default=10]");
         IntParameter           & argCropWidth       = parameters.add<IntParameter>          (0x0, "crop-width",       "Number of pixels to crop from the left and right sides of the picture before decimation [default=0]");
         IntParameter           & argCropHeight      = parameters.add<IntParameter>          (0x0, "crop-height",      "Number of pixels to crop from the top and the bottom of the picture before decimation [default=0]");
         IntParameter           & argCropLeft        = parameters.add<IntParameter>          (0x0, "crop-left",        "Number of pixels to crop from the left of the picture before decimation (overrides --crop-width)");


leapfrog catches domain_error properly

leapfrog catches domain_error properly

git-svn-id: e699fe4639e7715a7f788fcbdac464b34c416b62@659 9a304bd9-dce1-f7c0-8d5c-bb1642157d4e

--- src/stan/mcmc/util.hpp
+++ src/stan/mcmc/util.hpp
@@ -15,17 +15,30 @@
   namespace mcmc {

     // Returns the new log probability of x and m
+    // Catches domain errors and sets logp as -inf.
     double leapfrog(prob_grad& model,
                     std::vector<int> z,
                     std::vector<double>& x, std::vector<double>& m,
                     std::vector<double>& g, double epsilon) {
       stan::maths::scaled_add(m, g, 0.5 * epsilon);
       stan::maths::scaled_add(x, m, epsilon);
-      double logp = -std::numeric_limits<double>::infinity();
+      double logp;
       try {
-        double logp = model.grad_log_prob(x, z, g);
+        logp = model.grad_log_prob(x, z, g);
       } catch (std::domain_error e) {
-
+        // FIXME: remove output
+        std::cerr << std::endl
+                  << "****************************************"
+                  << "****************************************"
+                  << "Error in model.grad_log_prob:"
+                  << e.what()
+                  << std::endl
+                  << "Diagnostic information: "
+                  << std::endl
+                  << boost::diagnostic_information(e)
+                  << std::endl
+                  << std::endl;
+        logp = -std::numeric_limits<double>::infinity();
       }
       stan::maths::scaled_add(m, g, 0.5 * epsilon);
       return logp;


anchor: Remove unnecessary semicolon

anchor: Remove unnecessary semicolon

--- wobbly-glib/anchor.cpp
+++ wobbly-glib/anchor.cpp
@@ -25,7 +25,7 @@

 G_DEFINE_TYPE_WITH_PRIVATE (WobblyAnchor,
                             wobbly_anchor,
-                            G_TYPE_OBJECT);
+                            G_TYPE_OBJECT)

 /**
  * wobbly_anchor_move_by:


[ProblemSolver] Initialize center of Gaussian shooter.

--- src/problem-solver.cc
+++ src/problem-solver.cc
@@ -138,10 +138,10 @@
       static const std::string center = "ConfigurationShooter/Gaussian/center";
       static const std::string useVel = "ConfigurationShooter/Gaussian/useRobotVelocity";
       static const std::string stdDev = "ConfigurationShooter/Gaussian/standardDeviation";
+      ptr->center(p->getParameter(center).vectorValue());
       if (p->getParameter(useVel).boolValue())
       {
         ptr->sigmas (p->robot()->currentVelocity());
-	ptr->center(p->getParameter(center).vectorValue());
       }
       else if (p->parameters.has(stdDev))
         ptr->sigma (p->getParameter (stdDev).floatValue());


ERR: Was not generating dependencies for vtkTkImageWindowWidget.

--- targets.cxx
+++ targets.cxx
@@ -114,6 +114,16 @@
     fprintf(fp,"\n");
     }

+  // if this is the imaging library we need to add dependencies
+  if (!strcmp(vtkLocal + strlen(vtkLocal) - 7,"imaging"))
+    {
+    fprintf(fp,"vtkTkImageWindowWidget.o : %s/vtkTkImageWindowWidget.cxx",
+	    vtkLocal);
+    sprintf(filename,"%s/vtkTkImageWindowWidget.cxx",vtkLocal);
+    OutputUNIXDepends(filename,fp, vtkHome, argv+extra_start,extra_num);
+    fprintf(fp,"\n");
+    }
+
   // generate depends for all the tcl wrappers
   for (i = concrete_start; i < argc; i++)
     {


go back to using read lock in MovieNode

go back to using read lock in MovieNode

--- src/MovieNode.cpp
+++ src/MovieNode.cpp
@@ -327,7 +327,7 @@
     }

     {
-        QWriteLocker locker(&m_openGLWorker->m_rwLock);
+        QReadLocker locker(&m_openGLWorker->m_rwLock);
         auto fboi = m_openGLWorker->m_lastFrame;
         if (fboi) {
             glClearColor(0, 0, 0, 0);


Add MP::GradMinimizer option to new workbench

--- workbench_sarajevo.cpp
+++ workbench_sarajevo.cpp
@@ -26,6 +26,7 @@
 ////////////////////////////////////////////////////////////////////////////////////////////////////

 void workbench_sarajevo(std::string workspace_filepath,
+               bool with_MPGradMinimizer=false,
                std::string workspace_name="HWWRun2GGF",
                std::string model_config_name="ModelConfig",
                std::string data_name="obsData",
@@ -158,20 +159,17 @@

   // for (int it = 0; it < N_timing_loops; ++it)
   {
-    RooAbsReal* RARnll(pdf->createNLL(*data, NumCPU(num_cpu, parallel_interleave),
-                       CPUAffinity(cpuAffinity)));//, "Extended");
-    // std::shared_ptr<RooAbsTestStatistic> nll(dynamic_cast<RooAbsTestStatistic*>(RARnll)); // shared_ptr gives odd error in ROOT cling!
-    // RooAbsTestStatistic * nll = dynamic_cast<RooAbsTestStatistic*>(RARnll);
-
-    // if (time_evaluate_partition) {
-    //   nll->setTimeEvaluatePartition(kTRUE);
-    // }
-
-    // if (callNLLfirst) {
-    //   RARnll->getVal();
-    // }
-
-    RooMinimizer m(*RARnll);
+    RooAbsReal* RARnll;
+
+    if (!with_MPGradMinimizer) {
+      RARnll = pdf->createNLL(*data, NumCPU(num_cpu, parallel_interleave),
+                       CPUAffinity(cpuAffinity));
+      RooMinimizer m(*RARnll);
+    } else {
+      RARnll = pdf->createNLL(*data);
+
+      RooFit::MultiProcess::GradMinimizer m(*RARnll, num_cpu);
+    }
     // m.setVerbose(1);
     m.setStrategy(0);
     m.setProfile(1);
@@ -224,60 +222,65 @@
         outfile_cpu << ctimer.timing_s() << "migrad" << getpid();
         ctime_migrad = ctimer.timing_s();
       }
-      if (timing_flag == 1) {
-        timer.start();
-      }
-      if (total_cpu_timing) {
-        ctimer.start();
-      }
-
-      m.hesse();
-
-      if (timing_flag == 1) {
-        timer.stop();
-      }
-      if (total_cpu_timing) {
-        ctimer.stop();
-      }
-      if (timing_flag == 1) {
-        std::cout << "TIME hesse: " << timer.timing_s() << "s" << std::endl;
-        outfile << timer.timing_s() << "hesse" << getpid();
-        time_hesse = timer.timing_s();
-      }
-      if (total_cpu_timing) {
-        std::cout << "CPUTIME hesse: " << ctimer.timing_s() << "s" << std::endl;
-        outfile_cpu << ctimer.timing_s() << "hesse" << getpid();
-        ctime_hesse = ctimer.timing_s();
-      }
-      if (timing_flag == 1) {
-        timer.start();
-      }
-      if (total_cpu_timing) {
-        ctimer.start();
-      }
-
-
-      m.minos(*mc->GetParametersOfInterest());
-
-      if (timing_flag == 1) {
-        timer.stop();
-      }
-      if (total_cpu_timing) {
-        ctimer.stop();
-      }
-      if (timing_flag == 1) {
-        std::cout << "TIME minos: " << timer.timing_s() << "s" << std::endl;
-        outfile << timer.timing_s() << "minos" << getpid();
-        time_minos = timer.timing_s();
-
-        outfile << (time_migrad + time_hesse + time_minos) << "migrad+hesse+minos" << getpid();
-      }
-      if (total_cpu_timing) {
-        std::cout << "CPUTIME minos: " << ctimer.timing_s() << "s" << std::endl;
-        outfile_cpu << ctimer.timing_s() << "minos" << getpid();
-        ctime_minos = ctimer.timing_s();
-
-        outfile_cpu << (ctime_migrad + ctime_hesse + ctime_minos) << "migrad+hesse+minos" << getpid();
+
+      if (!with_MPGradMinimizer) {
+
+        if (timing_flag == 1) {
+          timer.start();
+        }
+        if (total_cpu_timing) {
+          ctimer.start();
+        }
+
+        m.hesse();
+
+        if (timing_flag == 1) {
+          timer.stop();
+        }
+        if (total_cpu_timing) {
+          ctimer.stop();
+        }
+        if (timing_flag == 1) {
+          std::cout << "TIME hesse: " << timer.timing_s() << "s" << std::endl;
+          outfile << timer.timing_s() << "hesse" << getpid();
+          time_hesse = timer.timing_s();
+        }
+        if (total_cpu_timing) {
+          std::cout << "CPUTIME hesse: " << ctimer.timing_s() << "s" << std::endl;
+          outfile_cpu << ctimer.timing_s() << "hesse" << getpid();
+          ctime_hesse = ctimer.timing_s();
+        }
+        if (timing_flag == 1) {
+          timer.start();
+        }
+        if (total_cpu_timing) {
+          ctimer.start();
+        }
+
+
+        m.minos(*mc->GetParametersOfInterest());
+
+        if (timing_flag == 1) {
+          timer.stop();
+        }
+        if (total_cpu_timing) {
+          ctimer.stop();
+        }
+        if (timing_flag == 1) {
+          std::cout << "TIME minos: " << timer.timing_s() << "s" << std::endl;
+          outfile << timer.timing_s() << "minos" << getpid();
+          time_minos = timer.timing_s();
+
+          outfile << (time_migrad + time_hesse + time_minos) << "migrad+hesse+minos" << getpid();
+        }
+        if (total_cpu_timing) {
+          std::cout << "CPUTIME minos: " << ctimer.timing_s() << "s" << std::endl;
+          outfile_cpu << ctimer.timing_s() << "minos" << getpid();
+          ctime_minos = ctimer.timing_s();
+
+          outfile_cpu << (ctime_migrad + ctime_hesse + ctime_minos) << "migrad+hesse+minos" << getpid();
+        }
+
       }

       if (pid > 0) {


Compute table's real position relative to the robot.

--- src/publish_table.cpp
+++ src/publish_table.cpp
@@ -67,6 +67,12 @@
 void TablePublisher::ClusterCallback(const Clusters& clusters) {
   Table table = clusters.table;
   Marker marker;
+  Pose message_pose = table.pose.pose;
+  Pose pose = message_pose;
+  float depth = table.x_max - table.x_min;
+  float width = table.y_max - table.y_min;
+  pose.position.x += table.x_min + depth / 2;
+  pose.position.y += table.y_min + width / 2;
   Vector3 dimensions;
   dimensions.x = table.x_max - table.x_min;
   dimensions.y = table.y_max - table.y_min;


[dvfs] Fixed bug where the cache dvfs was not being set correctly.

--- common/tile/memory_subsystem/cache/cache.cc
+++ common/tile/memory_subsystem/cache/cache.cc
@@ -285,10 +285,6 @@
 void
 Cache::initializeDVFS()
 {
-   // Initialize frequency and voltage
-   int rc = DVFSManager::getInitialFrequencyAndVoltage(_module, _frequency, _voltage);
-   LOG_ASSERT_ERROR(rc == 0, "Error setting initial voltage for frequency(%g)", _frequency);
-
    // Initialize asynchronous boundaries
    if (_name == "L1-I"){
       _module = L1_ICACHE;
@@ -315,6 +311,10 @@
          _asynchronous_map[DIRECTORY] = Time(0);
       }
    }
+
+   // Initialize frequency and voltage
+   int rc = DVFSManager::getInitialFrequencyAndVoltage(_module, _frequency, _voltage);
+   LOG_ASSERT_ERROR(rc == 0, "Error setting initial voltage for frequency(%g)", _frequency);
 }


disable imgui's keyboard navigation for game view

--- src/renderer/editor/game_view.cpp
+++ src/renderer/editor/game_view.cpp
@@ -385,7 +385,7 @@
 	}
 	ImVec2 view_pos;
 	bool is_game_view_visible = false;
-	if (ImGui::BeginDock(window_name, &m_is_open))
+	if (ImGui::BeginDock(window_name, &m_is_open, ImGuiWindowFlags_NoNavInputs))
 	{
 		is_game_view_visible = true;
 		m_is_mouse_hovering_window = ImGui::IsWindowHovered();


THRIFT-2955 Using list of typedefs does not compile on Go
Client: Go
Patch: Johannes Martinsson <johannes@saltside.se>

Be explicit about when to use true type.

--- compiler/cpp/src/generate/t_go_generator.cc
+++ compiler/cpp/src/generate/t_go_generator.cc
@@ -167,7 +167,7 @@
                                   bool inclass = false,
                                   bool coerceData = false,
                                   bool inkey = false,
-                                  bool in_container = false
+                                  bool in_container = false,
                                   bool use_true_type = false);

   void generate_deserialize_struct(std::ofstream& out,


fixed python binding build

fixed python binding build

--- bindings/python/src/alert.cpp
+++ bindings/python/src/alert.cpp
@@ -198,8 +198,9 @@
     class_<portmap_error_alert, bases<alert>, noncopyable>(
         "portmap_error_alert", no_init)
         .def_readonly("mapping", &portmap_error_alert::mapping)
-        .def_readonly("type", &portmap_error_alert::type)
-#ifndef TORRENT_NO_DEPRECATE
+        .def_readonly("map_type", &portmap_error_alert::map_type)
+#ifndef TORRENT_NO_DEPRECATE
+        .def_readonly("type", &portmap_error_alert::map_type)
         .def_readonly("msg", &portmap_error_alert::msg)
 #endif
         ;
@@ -208,13 +209,17 @@
         "portmap_alert", no_init)
         .def_readonly("mapping", &portmap_alert::mapping)
         .def_readonly("external_port", &portmap_alert::external_port)
-        .def_readonly("type", &portmap_alert::type)
+#ifndef TORRENT_NO_DEPRECATE
+        .def_readonly("type", &portmap_alert::map_type)
+#endif
+        .def_readonly("map_type", &portmap_alert::map_type)
         ;

     class_<portmap_log_alert, bases<alert>, noncopyable>(
         "portmap_log_alert", no_init)
-        .def_readonly("type", &portmap_log_alert::type)
-#ifndef TORRENT_NO_DEPRECATE
+        .def_readonly("map_type", &portmap_log_alert::map_type)
+#ifndef TORRENT_NO_DEPRECATE
+        .def_readonly("type", &portmap_log_alert::map_type)
         .def_readonly("msg", &portmap_log_alert::msg)
 #endif
         ;


GLES2: Convert unsupported float texture types to 8-bit types

--- drivers/gles2/rasterizer_storage_gles2.cpp
+++ drivers/gles2/rasterizer_storage_gles2.cpp
@@ -120,18 +120,22 @@

 		} break;
 		case Image::FORMAT_RG8: {
-
-			ERR_EXPLAIN("RG texture not supported");
-			ERR_FAIL_V(image);
-
-		} break;
-		case Image::FORMAT_RGB8: {
-
+			ERR_PRINT("RG texture not supported, converting to RGB8.");
+			if (image.is_valid())
+				image->convert(Image::FORMAT_RGB8);
+			r_real_format = Image::FORMAT_RGB8;
 			r_gl_internal_format = GL_RGB;
 			r_gl_format = GL_RGB;
 			r_gl_type = GL_UNSIGNED_BYTE;

 		} break;
+		case Image::FORMAT_RGB8: {
+
+			r_gl_internal_format = GL_RGB;
+			r_gl_format = GL_RGB;
+			r_gl_type = GL_UNSIGNED_BYTE;
+
+		} break;
 		case Image::FORMAT_RGBA8: {

 			r_gl_format = GL_RGBA;
@@ -155,42 +159,57 @@
 		} break;
 		case Image::FORMAT_RF: {
 			if (!config.float_texture_supported) {
-				ERR_EXPLAIN("R float texture not supported");
-				ERR_FAIL_V(image);
+				ERR_PRINT("R float texture not supported, converting to RGB8.");
+				if (image.is_valid())
+					image->convert(Image::FORMAT_RGB8);
+				r_real_format = Image::FORMAT_RGB8;
+				r_gl_internal_format = GL_RGB;
+				r_gl_format = GL_RGB;
+				r_gl_type = GL_UNSIGNED_BYTE;
+			} else {
+				r_gl_internal_format = GL_ALPHA;
+				r_gl_format = GL_ALPHA;
+				r_gl_type = GL_FLOAT;
 			}
-
-			r_gl_internal_format = GL_ALPHA;
-			r_gl_format = GL_ALPHA;
-			r_gl_type = GL_FLOAT;
 		} break;
 		case Image::FORMAT_RGF: {
-			ERR_EXPLAIN("RG float texture not supported");
-			ERR_FAIL_V(image);
-
+			ERR_PRINT("RG float texture not supported, converting to RGB8.");
+			if (image.is_valid())
+				image->convert(Image::FORMAT_RGB8);
+			r_real_format = Image::FORMAT_RGB8;
+			r_gl_internal_format = GL_RGB;
+			r_gl_format = GL_RGB;
+			r_gl_type = GL_UNSIGNED_BYTE;
 		} break;
 		case Image::FORMAT_RGBF: {
 			if (!config.float_texture_supported) {
-
-				ERR_EXPLAIN("RGB float texture not supported");
-				ERR_FAIL_V(image);
+				ERR_PRINT("RGB float texture not supported, converting to RGB8.");
+				if (image.is_valid())
+					image->convert(Image::FORMAT_RGB8);
+				r_real_format = Image::FORMAT_RGB8;
+				r_gl_internal_format = GL_RGB;
+				r_gl_format = GL_RGB;
+				r_gl_type = GL_UNSIGNED_BYTE;
+			} else {
+				r_gl_internal_format = GL_RGB;
+				r_gl_format = GL_RGB;
+				r_gl_type = GL_FLOAT;
 			}
-
-			r_gl_internal_format = GL_RGB;
-			r_gl_format = GL_RGB;
-			r_gl_type = GL_FLOAT;
-
 		} break;
 		case Image::FORMAT_RGBAF: {
 			if (!config.float_texture_supported) {
-
-				ERR_EXPLAIN("RGBA float texture not supported");
-				ERR_FAIL_V(image);
+				ERR_PRINT("RGBA float texture not supported, converting to RGBA8.");
+				if (image.is_valid())
+					image->convert(Image::FORMAT_RGBA8);
+				r_real_format = Image::FORMAT_RGBA8;
+				r_gl_internal_format = GL_RGBA;
+				r_gl_format = GL_RGBA;
+				r_gl_type = GL_UNSIGNED_BYTE;
+			} else {
+				r_gl_internal_format = GL_RGBA;
+				r_gl_format = GL_RGBA;
+				r_gl_type = GL_FLOAT;
 			}
-
-			r_gl_internal_format = GL_RGBA;
-			r_gl_format = GL_RGBA;
-			r_gl_type = GL_FLOAT;
-
 		} break;
 		case Image::FORMAT_RH: {
 			need_decompress = true;


Finish making .asf readable, thanks Lukas

git-svn-id: 7928e23e4d58c5ca14aa7b47c53aeff82ee1dd0c@937985 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

--- taglib/fileref.cpp
+++ taglib/fileref.cpp
@@ -228,6 +228,8 @@
 #ifdef WITH_ASF
     if(s.substr(s.size() - 4, 4).upper() == ".WMA")
       return new ASF::File(fileName, readAudioProperties, audioPropertiesStyle);
+    if(s.substr(s.size() - 4, 4).upper() == ".ASF")
+      return new ASF::File(fileName, readAudioProperties, audioPropertiesStyle);
 #endif
     if(s.substr(s.size() - 4, 4).upper() == ".AIF")
       return new RIFF::AIFF::File(fileName, readAudioProperties, audioPropertiesStyle);


expose stats_alert data to python

expose stats_alert data to python

--- bindings/python/src/alert.cpp
+++ bindings/python/src/alert.cpp
@@ -40,6 +40,15 @@
 tuple incoming_connection_alert_ip(incoming_connection_alert const& ica)
 {
     return endpoint_to_tuple(ica.ip);
+}
+
+list stats_alert_transferred(stats_alert const& alert)
+{
+   list result;
+   for (int i = 0; i < alert.num_channels; ++i) {
+      result.append(alert.transferred[i]);
+   }
+   return result;
 }

 void bind_alert()
@@ -415,10 +424,9 @@
         .value("download_limit_too_low", performance_alert::download_limit_too_low)
     ;

-
     class_<stats_alert, bases<torrent_alert>, noncopyable>(
         "stats_alert", no_init)
-        .def_readonly("transferred", &stats_alert::transferred)
+        	.add_property("transferred", &stats_alert_transferred)
         .def_readonly("interval", &stats_alert::interval)
     ;