Fix fullscreen toggle, and put each window on a different monitor if available.

--- src/windowManager.cpp
+++ src/windowManager.cpp
@@ -80,8 +80,10 @@
     if (fullscreen == new_fullscreen)
         return;
     fullscreen = new_fullscreen;
-    create();
-}
+    SDL_SetWindowFullscreen(static_cast<SDL_Window*>(window), fullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0);
+    setupView();
+}
+
 void Window::setFSAA(int new_fsaa)
 {
     if (fsaa == new_fsaa)
@@ -117,28 +119,35 @@
 {
     if (window) return;

+    int display_nr = 0;
+    for(auto w : all_windows)
+    {
+        if (w == this)
+            break;
+        display_nr ++;
+    }
+
     // Create the window of the application
     auto windowWidth = static_cast<int>(minimal_virtual_size.x);
     auto windowHeight = static_cast<int>(minimal_virtual_size.y);

     SDL_Rect rect;
-    SDL_GetDisplayBounds(0, &rect);
-    if (fullscreen)
-    {
-        windowWidth = rect.w;
-        windowHeight = rect.h;
-    }else{
-        int scale = 2;
-        while(windowWidth * scale < int(rect.w) && windowHeight * scale < int(rect.h))
-            scale += 1;
-        windowWidth *= scale - 1;
-        windowHeight *= scale - 1;
-
-        while(windowWidth >= int(rect.w) || windowHeight >= int(rect.h) - 100)
-        {
-            windowWidth = static_cast<int>(std::floor(windowWidth * 0.9f));
-            windowHeight = static_cast<int>(std::floor(windowHeight * 0.9f));
-        }
+    if (SDL_GetDisplayBounds(display_nr, &rect))
+    {
+        display_nr = 0;
+        SDL_GetDisplayBounds(display_nr, &rect);
+    }
+
+    int scale = 2;
+    while(windowWidth * scale < int(rect.w) && windowHeight * scale < int(rect.h))
+        scale += 1;
+    windowWidth *= scale - 1;
+    windowHeight *= scale - 1;
+
+    while(windowWidth >= int(rect.w) || windowHeight >= int(rect.h) - 100)
+    {
+        windowWidth = static_cast<int>(std::floor(windowWidth * 0.9f));
+        windowHeight = static_cast<int>(std::floor(windowHeight * 0.9f));
     }

 #if defined(ANDROID)
@@ -163,7 +172,7 @@
     int flags = SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI;
     if (fullscreen)
         flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
-    window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowWidth, windowHeight, flags);
+    window = SDL_CreateWindow("", SDL_WINDOWPOS_CENTERED_DISPLAY(display_nr), SDL_WINDOWPOS_CENTERED_DISPLAY(display_nr), windowWidth, windowHeight, flags);
     if (!gl_context)
         gl_context = SDL_GL_CreateContext(static_cast<SDL_Window*>(window));
     if (SDL_GL_SetSwapInterval(-1))


Reverse the batch processing, to make sure the messages are in chronological order with oldest at the bottom.

--- mailer.cpp
+++ mailer.cpp
@@ -248,7 +248,7 @@
             return;
         }

-        for ( it=MessagesList.begin() ; it != MessagesList.end(); it++ ){
+        for ( it=MessagesList.end() ; it != MessagesList.begin(); it-- ){
             message = message + *it;
         }


Added support for input from std::cin.

Added support for input from std::cin.

--- apps/plasp-app/main.cpp
+++ apps/plasp-app/main.cpp
@@ -57,16 +57,12 @@
 		return EXIT_SUCCESS;
 	}

-	if (!variablesMap.count("input"))
-	{
-		std::cerr << "Error: No input file specified" << std::endl << std::endl;
-		printHelp();
-		return EXIT_FAILURE;
-	}
-
 	try
 	{
-		const auto sasDescription = plasp::sas::Description::fromFile(variablesMap["input"].as<std::string>());
+		const auto sasDescription = variablesMap.count("input")
+			? plasp::sas::Description::fromFile(variablesMap["input"].as<std::string>())
+			: plasp::sas::Description::fromStream(std::cin);
+
 		const auto sasTranslator = plasp::sas::TranslatorASP(sasDescription);
 		sasTranslator.translate(std::cout);
 	}


Upper and lower bounds are set on completed alignment. Better Multi-aligner destructor.

--- malign.cpp
+++ malign.cpp
@@ -21,6 +21,12 @@
 }

 MAligner::~MAligner(){
+    list<MAlignerEntry*>::iterator entry_itr;
+
+    for( entry_itr = this->entries->begin() ; entry_itr != this->entries->end(); entry_itr++ ){
+        delete (*entry_itr);
+    }
+
     if( global_matrix->matrix != NULL ){
         free(global_matrix->matrix);
     }
@@ -110,7 +116,8 @@
  * MAlignerEntry
  */
 MAlignerEntry::MAlignerEntry(const char *nm, const char *seq, dp_matrix *dp){
-
+
+    // copy the reference into place
     this->name = (char*) malloc(strlen(nm) + 1);
     this->refSequence = (char*) malloc(strlen(seq) + 1);
     this->testSequence = NULL;
@@ -139,6 +146,7 @@
 MAlignerEntry::~MAlignerEntry(){
     free(this->name);
     free(this->refSequence);
+    if( this->testSequence ){ free(this->testSequence); }
 }

 bool MAlignerEntry::isAligned() {
@@ -357,6 +365,8 @@
     if( !boundary ){
         this->aligned = true;
         this->score = s;
+        this->uBound = s;
+        this->lBound = s;
         return s;
     }

@@ -410,9 +420,9 @@

     MAlignerEntry *aligner = new MAlignerEntry(string("Sample").c_str(), string("ABCDEFGHIJKL").c_str(), dpm);

-    aligner->initialize(string("ABCDEFGHIJKLMNOP").c_str());
+    aligner->initialize(string("XXXXXXXXXXXXXXXXXXX").c_str());
     aligner->align();
-    printf("%d\n", aligner->getScore());
+    printf("%d (%d,%d)\n", aligner->getScore(), aligner->lowerBound(), aligner->upperBound());
     //aligner->initialize(string("XXXXXXXXXXXX").c_str());
     //aligner->align();
     //aligner->initialize(string("XXXXXXX").c_str());


Changed component_mask to component_scale.

git-svn-id: e88a1e38e13faf406e05cc89eca8dd613216f6c4@1199 434f946d-2f3d-0410-ba4c-cb9f52fb0dbf

--- trunk/libmesh/src/numerics/fourth_error_estimators.C
+++ trunk/libmesh/src/numerics/fourth_error_estimators.C
@@ -1,4 +1,4 @@
-// $Id: fourth_error_estimators.C,v 1.5 2005-06-11 03:59:18 jwpeterson Exp $
+// $Id: fourth_error_estimators.C,v 1.6 2005-06-14 00:14:56 jwpeterson Exp $

 // The libMesh Finite Element Library.
 // Copyright (C) 2002-2004  Benjamin S. Kirk, John W. Peterson
@@ -108,26 +108,32 @@

   // Check for a valid component_mask
-  if (!component_mask.empty())
-    if (component_mask.size() != n_vars)
-      {
-	std::cerr << "ERROR: component_mask is the wrong size:"
-		  << std::endl
-		  << " component_mask.size()=" << component_mask.size()
-		  << std::endl
-		  << " n_vars=" << n_vars
-		  << std::endl;
-	error();
-      }
-
-
+  if (!component_scale.empty())
+    {
+      if (component_scale.size() != n_vars)
+	{
+	  std::cerr << "ERROR: component_scale is the wrong size:"
+		    << std::endl
+		    << " component_scale.size()=" << component_scale.size()
+		    << std::endl
+		    << " n_vars=" << n_vars
+		    << std::endl;
+	  error();
+	}
+    }
+  else
+    {
+      // No specified scaling.  Scale all variables by one.
+      component_scale.resize (n_vars);
+      std::fill (component_scale.begin(), component_scale.end(), 1.0);
+    }

   // Loop over all the variables in the system
   for (unsigned int var=0; var<n_vars; var++)
     {
       // Possibly skip this variable
-      if (!component_mask.empty())
-	if (component_mask[var] == false) continue;
+      if (!component_scale.empty())
+	if (component_scale[var] == false) continue;

       // The type of finite element to use for this variable
       const FEType& fe_type = dof_map.variable_type (var);


Replace some xprintf with debug

Replace some xprintf with debug

--- malloc.cpp
+++ malloc.cpp
@@ -411,7 +411,7 @@
 {
 	if (pairing_ptr_heap* ret = g_free_pages)
 	{
-		xprintf("Unlinking %p from free-list\n", ret);
+		debug("Unlinking %p from free-list\n", ret);
 		g_free_pages = delete_min(ret);
 		g_n_free_pages--;
 		return ret;
@@ -431,7 +431,7 @@
 	memset(page, 0, sizeof(pairing_ptr_heap));
 	if (g_n_free_pages && page == (u8*)sbrk(0) - PAGE_SIZE)
 	{
-		xprintf("Freed last page, shrinking heap\n");
+		debug("Freed last page (%p info %p), shrinking heap\n", page, get_pageinfo(page));
 		uintptr_t offset = ((uintptr_t)page - g_first_page) >> PAGE_SHIFT;
 		size_t free_pages = 0;
 		while (offset && !g_pages[offset])
@@ -439,13 +439,13 @@
 			free_pages++;
 			offset--;
 		}
-		xprintf("Freeing %ld last pages (%p..%p)\n", free_pages, (u8*)sbrk(0) - free_pages * PAGE_SIZE, sbrk(0));
+		debug("Freeing %ld last pages (%p..%p)\n", free_pages, (u8*)cur_break - free_pages * PAGE_SIZE, cur_break);
 		sbrk(-free_pages * PAGE_SIZE);
-		xprintf("Break now %p\n", sbrk(0));
+		debug("Break now %p (was %p)\n", sbrk(0), cur_break);
 	}
 	else
 	{
-		xprintf("Adding %p to page free-list\n", page);
+		debug("Adding %p to page free-list\n", page);
 		g_free_pages = insert(g_free_pages, (pairing_ptr_heap*)page);
 		g_n_free_pages++;
 		set_pageinfo(page, MAGIC_PAGE_FREE);


XPM.h separated frmo LineMarker.h. Typo fixed in registration.

--- win32/ScintillaWin.cxx
+++ win32/ScintillaWin.cxx
@@ -2,7 +2,7 @@
 /** @file ScintillaWin.cxx
  ** Windows specific subclass of ScintillaBase.
  **/
-// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
+// Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
 // The License.txt file describes the conditions under which this software may be distributed.

 #include <stdlib.h>
@@ -34,6 +34,7 @@
 #include "CallTip.h"
 #include "KeyMap.h"
 #include "Indicator.h"
+#include "XPM.h"
 #include "LineMarker.h"
 #include "Style.h"
 #include "AutoComplete.h"
@@ -1863,7 +1864,7 @@
 	if (result) {
 		// Register the CallTip class
 		WNDCLASSEX wndclassc;
-		wndclassc.cbSize = sizeof(wndclass);
+		wndclassc.cbSize = sizeof(wndclassc);
 		wndclassc.style = CS_GLOBALCLASS | CS_HREDRAW | CS_VREDRAW;
 		wndclassc.cbClsExtra = 0;
 		wndclassc.cbWndExtra = sizeof(ScintillaWin *);


Patch from Philippe to make respond to WM_SETTEXT.

--- win32/ScintillaWin.cxx
+++ win32/ScintillaWin.cxx
@@ -491,6 +491,7 @@
 	case WM_COPY: return SCI_COPY;
 	case WM_CUT: return SCI_CUT;
 	case WM_GETTEXT: return SCI_GETTEXT;
+	case WM_SETTEXT: return SCI_SETTEXT;
 	case WM_GETTEXTLENGTH: return SCI_GETTEXTLENGTH;
 	case WM_PASTE: return SCI_PASTE;
 	case WM_UNDO: return SCI_UNDO;


Add a unit test to verify that an invalid status code (-1)
won't cause the HttpResponseHeaders constructor to crash.

R=eroman@chromium.org
BUG=none
TEST=net_unittests --gtest_filter=
HttpResponseHeadersTest.NormalizeHeadersInvalidStatusCode

Review URL: http://codereview.chromium.org/7107001

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

--- net/http/http_response_headers_unittest.cc
+++ net/http/http_response_headers_unittest.cc
@@ -184,6 +184,19 @@
     200,
     net::HttpVersion(0,0), // Parse error
     net::HttpVersion(1,0)
+  };
+  TestCommon(test);
+}
+
+TEST(HttpResponseHeadersTest, NormalizeHeadersInvalidStatusCode) {
+  TestData test = {
+    "HTTP/1.1 -1  Unknown\n",
+
+    "HTTP/1.1 200 OK\n",
+
+    200,
+    net::HttpVersion(1,1),
+    net::HttpVersion(1,1)
   };
   TestCommon(test);
 }


fix build bustage due to missing header

fix build bustage due to missing header

git-svn-id: http://src.chromium.org/svn/trunk/src@2675 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 1315dfadd954b200104bbcce9e4a0a35d4c40f2d

--- net/url_request/url_request_job_manager.cc
+++ net/url_request/url_request_job_manager.cc
@@ -3,6 +3,8 @@
 // found in the LICENSE file.

 #include "net/url_request/url_request_job_manager.h"
+
+#include <algorithm>

 #include "build/build_config.h"
 #include "base/string_util.h"


Remove return parens

Remove return parens

--- prosoft/core/modules/u8string/u8string.hpp
+++ prosoft/core/modules/u8string/u8string.hpp
@@ -568,7 +568,7 @@
     typedef prosoft::u8string second_argument_type;
     typedef bool result_type;
     result_type operator()(const first_argument_type& s1, const second_argument_type& s2) const {
-        return (s1 == s2);
+        return s1 == s2;
     }
 };
 }


planner_modules_pr2: removed debug messages from module param cache

--- planner_modules_pr2/src/module_param_cache.cpp
+++ planner_modules_pr2/src/module_param_cache.cpp
@@ -37,13 +37,13 @@

 void ModuleParamCache::set(const std::string& key, double value)
 {
-    ROS_INFO("[cache]: writing to cache: %s -> %f", key.c_str(), value);
+//    ROS_INFO("[cache]: writing to cache: %s -> %f", key.c_str(), value);
     node->setParam(keyPrefix + key, value);
 }

 bool ModuleParamCache::get(const std::string& key, double& value) const
 {
-    ROS_INFO("[cache]: lookup in cache: %s -> %f", key.c_str(), value);
+//    ROS_INFO("[cache]: lookup in cache: %s -> %f", key.c_str(), value);
     return node->getParamCached(keyPrefix + key, value);
 }


added new event for handling dom injection. Now supporting local css, css, local js and remote js

--- platform/wm/rhodes/browser/CEBrowserEngine.cpp
+++ platform/wm/rhodes/browser/CEBrowserEngine.cpp
@@ -680,13 +680,23 @@
         retVal = S_OK;

 		break;
+    case DISPID_PROGRESSCHANGE:
+        {
+            LOG(INFO) + "progress change";
+            if (pdparams && pdparams->rgvarg[1].vt == VT_I4)
+            {
+                if(0 == pdparams->rgvarg[1].iVal)//if progress completed
+                {
+                    LOG(INFO) + "before calling dominjector ";
+                    RHODESAPP().getExtManager().getEngineEventMngr().injectDOMElements();
+                }
+            }
+            break;
+        }

 	case DISPID_DOCUMENTCOMPLETE:
 		//Validate that there is an event handler
-		LOG(INFO) + "DISPID_DOCUMENTCOMPLETE";
-		LOG(INFO) + "before calling dominjector after document complete";
-		RHODESAPP().getExtManager().getEngineEventMngr().injectDOMElements();
-
+		LOG(INFO) + "DISPID_DOCUMENTCOMPLETE";
         SetEvent(m_hDocComp);
         CloseHandle(m_hDocComp);
         m_hDocComp = NULL;


Update CEBrowserEngine.cpp

Update CEBrowserEngine.cpp

Added MK3100 ,MK3000

--- platform/wm/rhodes/browser/CEBrowserEngine.cpp
+++ platform/wm/rhodes/browser/CEBrowserEngine.cpp
@@ -95,7 +95,7 @@
 	ZeroMemory(szSIPValue,100);

-		if((_tcsstr(szPlatform,TEXT("MK4000")) != NULL) || (_tcsstr(szPlatform,TEXT("BigBoardMPA3")) != NULL) || (_tcsstr(szPlatform,TEXT("MC18")) != NULL))
+		if((_tcsstr(szPlatform,TEXT("MK4000")) != NULL) || (_tcsstr(szPlatform,TEXT("MK3100")) != NULL) || (_tcsstr(szPlatform,TEXT("MC18")) != NULL)|| (_tcsstr(szPlatform,TEXT("MK3000")) != NULL))
 		{
 			HKEY hRegKey= NULL;
 			DWORD Type;


Reuse AST nodes when possible.

Reuse AST nodes when possible.

--- copier.hpp
+++ copier.hpp
@@ -23,26 +23,39 @@
     std::shared_ptr<ctype::type_t> get_ctype_ptr(const Ctype &n) {
         return std::const_pointer_cast<ctype::type_t>(n.shared_from_this());
     }
+    bool m_match;
+    void start_match() {
+        m_match = true;
+    }
+    template<typename T, typename U>
+    inline void update_match(const T& t, const U& u) {
+        m_match = m_match && (t == get_node_ptr(u));
+    }
+    bool is_match() {
+        return m_match;
+    }
+
 public:
     using backend::no_op_visitor<std::shared_ptr<node> >::operator();

     virtual result_type operator()(const literal& n) {
-        std::shared_ptr<type_t> t = get_type_ptr(n.type());
-        std::shared_ptr<ctype::type_t> ct = get_ctype_ptr(n.ctype());
-        return result_type(new literal(n.id(), t, ct));
+        return get_node_ptr(n);
     }
     virtual result_type operator()(const name &n) {
-        std::shared_ptr<type_t> t = get_type_ptr(n.type());
-        std::shared_ptr<ctype::type_t> ct = get_ctype_ptr(n.ctype());
-        return result_type(new name(n.id(), t, ct));
+        return get_node_ptr(n);
     }
     virtual result_type operator()(const tuple &n) {
+        start_match();
         std::vector<std::shared_ptr<expression> > n_values;
         for(auto i = n.begin(); i != n.end(); i++) {
             auto n_i = std::static_pointer_cast<expression>(boost::apply_visitor(*this, *i));
+            update_match(n_i, *i);
             n_values.push_back(n_i);
         }
+        if (is_match())
+            return get_node_ptr(n);
+
         std::shared_ptr<type_t> t = get_type_ptr(n.type());
         std::shared_ptr<ctype::type_t> ct = get_ctype_ptr(n.ctype());

@@ -51,11 +64,19 @@
     virtual result_type operator()(const apply &n) {
         auto n_fn = std::static_pointer_cast<name>(boost::apply_visitor(*this, n.fn()));
         auto n_args = std::static_pointer_cast<tuple>((*this)(n.args()));
+        start_match();
+        update_match(n_fn, n.fn());
+        update_match(n_args, n.args());
+        if (is_match())
+            return get_node_ptr(n);
         return result_type(new apply(n_fn, n_args));
     }
     virtual result_type operator()(const lambda &n) {
         auto n_args = std::static_pointer_cast<tuple>((*this)(n.args()));
         auto n_body = std::static_pointer_cast<expression>(boost::apply_visitor(*this, n.body()));
+        start_match();
+        update_match(n_args, n.args());
+        update_match(n_body, n.body());
         std::shared_ptr<type_t> t = get_type_ptr(n.type());
         std::shared_ptr<ctype::type_t> ct = get_ctype_ptr(n.ctype());
         return result_type(new lambda(n_args, n_body, t, ct));
@@ -68,50 +89,72 @@
     }
     virtual result_type operator()(const ret &n) {
         auto n_val = std::static_pointer_cast<expression>(boost::apply_visitor(*this, n.val()));
+        start_match();
+        update_match(n_val, n.val());
+        if (is_match())
+            return get_node_ptr(n);
         return result_type(new ret(n_val));
     }
     virtual result_type operator()(const bind &n) {
         auto n_lhs = std::static_pointer_cast<expression>(boost::apply_visitor(*this, n.lhs()));
         auto n_rhs = std::static_pointer_cast<expression>(boost::apply_visitor(*this, n.rhs()));
+        start_match();
+        update_match(n_lhs, n.lhs());
+        update_match(n_rhs, n.rhs());
+        if (is_match())
+            return get_node_ptr(n);
         return result_type(new bind(n_lhs, n_rhs));
     }
     virtual result_type operator()(const call &n) {
         auto n_sub = std::static_pointer_cast<apply>(boost::apply_visitor(*this, n.sub()));
+        start_match();
+        update_match(n_sub, n.sub());
+        if (is_match())
+            return get_node_ptr(n);
         return result_type(new call(n_sub));
     }
     virtual result_type operator()(const procedure &n) {
         auto n_id = std::static_pointer_cast<name>((*this)(n.id()));
         auto n_args = std::static_pointer_cast<tuple>((*this)(n.args()));
         auto n_stmts = std::static_pointer_cast<suite>((*this)(n.stmts()));
+        start_match();
+        update_match(n_id, n.id());
+        update_match(n_args, n.args());
+        update_match(n_stmts, n.stmts());
+        if (is_match())
+            return get_node_ptr(n);
         std::shared_ptr<type_t> t = get_type_ptr(n.type());
         std::shared_ptr<ctype::type_t> ct = get_ctype_ptr(n.ctype());

         return result_type(new procedure(n_id, n_args, n_stmts, t, ct));
     }
     virtual result_type operator()(const suite &n) {
+        start_match();
         std::vector<std::shared_ptr<statement> > n_stmts;
         for(auto i = n.begin(); i != n.end(); i++) {
             auto n_stmt = std::static_pointer_cast<statement>(boost::apply_visitor(*this, *i));
+            update_match(n_stmt, *i);
             n_stmts.push_back(n_stmt);
         }
+        if (is_match())
+            return get_node_ptr(n);
         return result_type(new suite(std::move(n_stmts)));
     }
     virtual result_type operator()(const structure &n) {
         auto n_id = std::static_pointer_cast<name>((*this)(n.id()));
         auto n_stmts = std::static_pointer_cast<suite>((*this)(n.stmts()));
+        start_match();
+        update_match(n_id, n.id());
+        update_match(n_stmts, n.stmts());
+        if (is_match())
+            return get_node_ptr(n);
         return result_type(new structure(n_id, n_stmts));
     }
     virtual result_type operator()(const templated_name &n) {
-        std::shared_ptr<type_t> t = get_type_ptr(n.type());
-        std::shared_ptr<ctype::type_t> ct = get_ctype_ptr(n.ctype());
-        auto n_args = std::static_pointer_cast<ctype::tuple_t>(
-            get_ctype_ptr(n.template_types()));
-        return result_type(new templated_name(n.id(), n_args, t, ct));
+        return get_node_ptr(n);
     }
     virtual result_type operator()(const include &n) {
-        std::shared_ptr<name> id = std::static_pointer_cast<name>(
-            boost::apply_visitor(*this, n.id()));
-        return result_type(new include(id));
+        return get_node_ptr(n);
     }
 };


- FIXME

- FIXME

--- core/vm.cc
+++ core/vm.cc
@@ -799,6 +799,7 @@
 		const Type* type = callee->getType();
 		const Function* func;

+		// TODO(Felipe): FIXME
 		if (type->isPrimitive() || callee->isStr() || callee->isThread()) {
 			func = type->getMethod(method->getStr());
 		} else {


- Added runtime typemismatch checking

- Added runtime typemismatch checking

--- core/vm.cc
+++ core/vm.cc
@@ -95,7 +95,10 @@
 	Value* op1 = getValue(opcode->get_op1());
 	Value* op2 = getValue(opcode->get_op2());

-	if (op1->isConst() && op1->hasSameKind(op2) && op1->hasSameType(op2)) {
+	if (op1->isConst() && op1->hasSameKind(op2)) {
+		if (!op1->hasSameType(op2)) {
+			error("Type mismatch!");
+		}
 		switch (op1->get_type()) {
 			case Value::STRING:
 				opcode->get_result()->set_value(new ConstantValue(CSTRING(op1->getString() + op2->getString())));
@@ -117,7 +120,10 @@
 	Value* op1 = getValue(opcode->get_op1());
 	Value* op2 = getValue(opcode->get_op2());

-	if (op1->isConst() && op1->hasSameKind(op2) && op1->hasSameType(op2)) {
+	if (op1->isConst() && op1->hasSameKind(op2)) {
+		if (!op1->hasSameType(op2)) {
+			error("Type mismatch!");
+		}
 		switch (op1->get_type()) {
 			case Value::STRING:
 				error("Operation not allow in strings!");
@@ -139,7 +145,10 @@
 	Value* op1 = getValue(opcode->get_op1());
 	Value* op2 = getValue(opcode->get_op2());

-	if (op1->isConst() && op1->hasSameKind(op2) && op1->hasSameType(op2)) {
+	if (op1->isConst() && op1->hasSameKind(op2)) {
+		if (!op1->hasSameType(op2)) {
+			error("Type mismatch!");
+		}
 		switch (op1->get_type()) {
 			case Value::STRING:
 				error("Operation not allow in strings!");
@@ -161,7 +170,10 @@
 	Value* op1 = getValue(opcode->get_op1());
 	Value* op2 = getValue(opcode->get_op2());

-	if (op1->isConst() && op1->hasSameKind(op2) && op1->hasSameType(op2)) {
+	if (op1->isConst() && op1->hasSameKind(op2)) {
+		if (!op1->hasSameType(op2)) {
+			error("Type mismatch!");
+		}
 		switch (op1->get_type()) {
 			case Value::STRING:
 				error("Operation not allow in strings!");


Assert in turnport doesn't take into account permission refresh for OnChannelBindSuccess

--- talk/p2p/base/turnport.cc
+++ talk/p2p/base/turnport.cc
@@ -768,7 +768,7 @@
 void TurnEntry::OnChannelBindSuccess() {
   LOG_J(LS_INFO, port_) << "Channel bind for " << ext_addr_.ToString()
                         << " succeeded";
-  ASSERT(state_ == STATE_BINDING);
+  ASSERT(state_ == STATE_BINDING || state_ == STATE_BOUND);
   state_ = STATE_BOUND;
 }


Right-clicking will not close popup

Right-clicking will not close popup

--- platform/windows/display_server_windows.cpp
+++ platform/windows/display_server_windows.cpp
@@ -2120,7 +2120,6 @@
 			case WM_NCRBUTTONDOWN:
 			case WM_NCMBUTTONDOWN:
 			case WM_LBUTTONDOWN:
-			case WM_RBUTTONDOWN:
 			case WM_MBUTTONDOWN: {
 				MOUSEHOOKSTRUCT *ms = (MOUSEHOOKSTRUCT *)lParam;
 				Point2i pos = Point2i(ms->pt.x, ms->pt.y);


Really turn off all the ObjC runtime ISA expression logs if not verbose.

We apparently only turned off one of them.

--- source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -1450,6 +1450,8 @@
   //    } __attribute__((__packed__));

   Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES));
+  bool should_log = log && log->GetVerbose();
+
   uint32_t num_parsed = 0;

   // Iterate through all ClassInfo structures
@@ -1458,7 +1460,7 @@
     ObjCISA isa = data.GetPointer(&offset);

     if (isa == 0) {
-      if (log && log->GetVerbose())
+      if (should_log)
         log->Printf(
             "AppleObjCRuntimeV2 found NULL isa, ignoring this class info");
       continue;
@@ -1466,7 +1468,7 @@
     // Check if we already know about this ISA, if we do, the info will
     // never change, so we can just skip it.
     if (ISAIsCached(isa)) {
-      if (log)
+      if (should_log)
         log->Printf("AppleObjCRuntimeV2 found cached isa=0x%" PRIx64
                     ", ignoring this class info",
                     isa);
@@ -1477,14 +1479,14 @@
       ClassDescriptorSP descriptor_sp(new ClassDescriptorV2(*this, isa, NULL));
       AddClass(isa, descriptor_sp, name_hash);
       num_parsed++;
-      if (log)
+      if (should_log)
         log->Printf("AppleObjCRuntimeV2 added isa=0x%" PRIx64
                     ", hash=0x%8.8x, name=%s",
                     isa, name_hash,
                     descriptor_sp->GetClassName().AsCString("<unknown>"));
     }
   }
-  if (log)
+  if (should_log)
     log->Printf("AppleObjCRuntimeV2 parsed %" PRIu32 " class infos",
                 num_parsed);
   return num_parsed;


matrix: getRow, getColumnの仕様変更

matrix: getRow, getColumnの仕様変更

--- matrix.hpp
+++ matrix.hpp
@@ -560,25 +560,29 @@
 			return wrap_t::Diagonal(1);
 		}

-		const auto& getRow(const int at) const {
-			D_Expect(at < dim_m, "invalid position")
-			return this->m[at];
-		}
-		auto& getRow(const int at) {
-			D_Expect(at < dim_m, "invalid position")
-			return this->m[at];
-		}
-		column_t getColumn(const int at) const {
-			D_Expect(at < dim_n, "invalid position")
+		template <int At>
+		const auto& getRow() const {
+			static_assert(At < dim_m, "invalid position");
+			return this->m[At];
+		}
+		template <int At>
+		auto& getRow() {
+			static_assert(At < dim_m, "invalid position");
+			return this->m[At];
+		}
+		template <int At>
+		column_t getColumn() const {
+			static_assert(At < dim_n, "invalid position");
 			column_t ret;
 			for(int i=0 ; i<dim_m ; i++)
-				ret[i] = this->m[i][at];
+				ret[i] = this->m[i][At];
 			return ret;
 		}
-		void setColumn(const int at, const column_t& c) {
-			D_Expect(at < dim_n, "invalid position")
+		template <int At>
+		void setColumn(const column_t& c) {
+			static_assert(At < dim_n, "invalid position");
 			for(int i=0 ; i<dim_m ; i++)
-				this->m[i][at] = c[i];
+				this->m[i][At] = c[i];
 		}

 		constexpr operator wrap_t() const {


Fixing get_tx_state/connection dest mac command.

Was reading from the wrong structure.

--- controller/lib/src/stream_output_descriptor_imp.cpp
+++ controller/lib/src/stream_output_descriptor_imp.cpp
@@ -289,7 +289,7 @@
     uint64_t STDCALL stream_output_descriptor_imp::get_tx_state_stream_dest_mac()
     {
         uint64_t stream_dest_mac;
-        utility->convert_eui48_to_uint64(aem_cmd_get_stream_info_resp.stream_dest_mac.value, stream_dest_mac);
+        utility->convert_eui48_to_uint64(acmp_cmd_get_tx_state_resp.stream_dest_mac.value, stream_dest_mac);

         return stream_dest_mac;
     }
@@ -322,7 +322,7 @@
     uint64_t STDCALL stream_output_descriptor_imp::get_tx_connection_stream_dest_mac()
     {
         uint64_t stream_dest_mac;
-        utility->convert_eui48_to_uint64(aem_cmd_get_stream_info_resp.stream_dest_mac.value, stream_dest_mac);
+        utility->convert_eui48_to_uint64(acmp_cmd_get_tx_connection_resp.stream_dest_mac.value, stream_dest_mac);

         return stream_dest_mac;
     }


INTEGRATION: CWS vcl10 (1.36.4); FILE MERGED 2003/05/14 16:47:23 pl 1.36.4.1: #i12936# use afm file next to font if available

--- psprint/source/fontmanager/fontmanager.cxx
+++ psprint/source/fontmanager/fontmanager.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: fontmanager.cxx,v $
  *
- *  $Revision: 1.36 $
+ *  $Revision: 1.37 $
  *
- *  last change: $Author: rt $ $Date: 2003-04-17 15:12:32 $
+ *  last change: $Author: vg $ $Date: 2003-06-04 11:33:10 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -963,6 +963,8 @@
                 aAfmFile += aName;
             }
         }
+        else
+            aAfmFile = aName;

         if( aAfmFile.Len() )
         {


INTEGRATION: CWS jscpp1 (1.10.24); FILE MERGED 2005/08/09 11:47:09 jsc 1.10.24.1: #i52596# improve reading command line option

--- idlc/source/options.cxx
+++ idlc/source/options.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: options.cxx,v $
  *
- *  $Revision: 1.11 $
- *
- *  last change: $Author: rt $ $Date: 2005-09-07 18:12:45 $
+ *  $Revision: 1.12 $
+ *
+ *  last change: $Author: rt $ $Date: 2005-10-17 13:20:57 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -244,8 +244,31 @@
                     char* rargv[512];
                     char  buffer[512];

-                    while ( fscanf(cmdFile, "%s", buffer) != EOF )
-                    {
+                    int i=0;
+                    int found = 0;
+                    char c;
+                    while ( fscanf(cmdFile, "%c", &c) != EOF )
+                    {
+                        if (c=='\"') {
+                            if (found) {
+                                found=0;
+                            } else {
+                                found=1;
+                                continue;
+                            }
+                        } else {
+                            if (c!=13 && c!=10) {
+                                if (found || c!=' ') {
+                                    buffer[i++]=c;
+                                    continue;
+                                }
+                            }
+                            if (i==0)
+                                continue;
+                        }
+                        buffer[i]='\0';
+                        found=0;
+                        i=0;
                         rargv[rargc]= strdup(buffer);
                         rargc++;
                     }


fixed linkage bug

fixed linkage bug

--- platform/shared/qt/rhodes/impl/MapViewImpl.cpp
+++ platform/shared/qt/rhodes/impl/MapViewImpl.cpp
@@ -57,4 +57,8 @@
     return 0.;
 }

+void mapview_set_file_caching_enable(int enable)
+{
+}
+
 } //extern "C"


Support for new log file extension. (#5355)

--- src/modules/mavlink/mavlink_log_handler.cpp
+++ src/modules/mavlink/mavlink_log_handler.cpp
@@ -456,7 +456,7 @@
 		}
 		if (entry.d_type == PX4LOG_DIRECTORY)
 		{
-			time_t tt;
+			time_t tt = 0;
 			char log_path[128];
 			snprintf(log_path, sizeof(log_path), "%s/%s", kLogRoot, entry.d_name);
 			if (_get_session_date(log_path, entry.d_name, tt)) {
@@ -533,28 +533,30 @@
 bool
 LogListHelper::_get_log_time_size(const char* path, const char* file, time_t& date, uint32_t& size)
 {
-	if(file && file[0] && strstr(file, ".px4log")) {
-		// Convert "log000" to 00:00 (minute per flight in session)
-		if (strncmp(file, "log", 3) == 0) {
-			unsigned u;
-			if(sscanf(&file[3], "%u", &u) == 1) {
-				date += (u * 60);
-				if (stat_file(path, 0, &size)) {
+	if(file && file[0]) {
+		if(strstr(file, ".px4log") || strstr(file, ".ulg")) {
+			// Convert "log000" to 00:00 (minute per flight in session)
+			if (strncmp(file, "log", 3) == 0) {
+				unsigned u;
+				if(sscanf(&file[3], "%u", &u) == 1) {
+					date += (u * 60);
+					if (stat_file(path, 0, &size)) {
+						return true;
+					}
+				}
+			} else {
+				if (stat_file(path, &date, &size)) {
 					return true;
 				}
-			}
-		} else {
-			if (stat_file(path, &date, &size)) {
-				return true;
-			}
-			/* strptime not available for some reason
-			// Get time from file name
-			struct tm tt;
-			if(strptime(file, "%H_%M_%S", &tt)) {
-				date += mktime(&tt);
-				return true;
-			}
-			*/
+				/* strptime not available for some reason
+				// Get time from file name
+				struct tm tt;
+				if(strptime(file, "%H_%M_%S", &tt)) {
+					date += mktime(&tt);
+					return true;
+				}
+				*/
+			}
 		}
 	}
 	return false;


Typo.

Typo.

--- src/ompl/base/src/OptimizationObjective.cpp
+++ src/ompl/base/src/OptimizationObjective.cpp
@@ -75,6 +75,7 @@
 {
     //If c1 is not better than c2, and c2 is not better than c1, then they are equal
     return !isCostBetterThan(c1,c2) && !isCostBetterThan(c2,c1);
+}

 bool ompl::base::OptimizationObjective::isFinite(Cost cost) const
 {


remove magic number; add column name helper function

--- src/optimizer/cost_and_stats_calculator.cpp
+++ src/optimizer/cost_and_stats_calculator.cpp
@@ -24,6 +24,9 @@

 static constexpr int LEFT_CHILD_INDEX = 0;
 static constexpr int RIGHT_CHILD_INDEX = 1;
+static constexpr int JOIN_CHILD_NUM = 2;
+static constexpr int DEFAULT_HASH_JOIN_COST = 0;
+static constexpr int DEFAULT_NL_JOIN_COST = 1;
 //===----------------------------------------------------------------------===//
 // Helper functions
 //===----------------------------------------------------------------------===//
@@ -137,6 +140,13 @@
   return output_table_stats;
 }

+// Helper function to return column name from abstract expression
+std::string getColumnName(std::shared_ptr<expression::AbstractExpression> column) {
+  auto tv_expr =
+    std::dynamic_pointer_cast<expression::TupleValueExpression>(column);
+  return tv_expr->GetTableName() + "." + tv_expr->GetColumnName();
+}
+
 // Update output stats num_rows for conjunctions based on predicate
 double updateMultipleConjuctionStats(
     const std::shared_ptr<TableStats> &input_stats,
@@ -455,14 +465,14 @@

 void CostAndStatsCalculator::JoinVisitHelper(std::shared_ptr<expression::AbstractExpression> predicate,
   JoinType join_type, bool is_hash_join) {
-  PL_ASSERT(child_stats_.size() == 2);
+  PL_ASSERT(child_stats_.size() == JOIN_CHILD_NUM);

   auto left_table_stats =
     std::dynamic_pointer_cast<TableStats>(child_stats_.at(LEFT_CHILD_INDEX));
   auto right_table_stats =
     std::dynamic_pointer_cast<TableStats>(child_stats_.at(RIGHT_CHILD_INDEX));
   if (left_table_stats == nullptr || right_table_stats == nullptr) {
-    output_cost_ = 1;
+    output_cost_ = is_hash_join? DEFAULT_HASH_JOIN_COST : DEFAULT_NL_JOIN_COST;
     return;
   }
   output_cost_ = getCostOfChildren(child_costs_);
@@ -511,11 +521,7 @@
   for (auto column : op->columns) {
     // TODO: Deal with complex expressions like a+b
     if (column->GetExpressionType() == ExpressionType::VALUE_TUPLE) {
-      auto tv_expr =
-          std::dynamic_pointer_cast<expression::TupleValueExpression>(column);
-      std::string column_name =
-          tv_expr->GetTableName() + "." + tv_expr->GetColumnName();
-      column_names.push_back(column_name);
+      column_names.push_back(getColumnName(column));
     }
   }
   output_cost_ +=
@@ -541,11 +547,7 @@
   for (auto column : op->columns) {
     // TODO: Deal with complex expressions like a+b
     if (column->GetExpressionType() == ExpressionType::VALUE_TUPLE) {
-      auto tv_expr =
-          std::dynamic_pointer_cast<expression::TupleValueExpression>(column);
-      std::string column_name =
-          tv_expr->GetTableName() + "." + tv_expr->GetColumnName();
-      column_names.push_back(column_name);
+      column_names.push_back(getColumnName(column));
     }
   }
   output_cost_ +=
@@ -588,10 +590,7 @@
   if (distinct_prop->GetSize() == 1 &&
       distinct_prop->GetDistinctColumn(0)->GetExpressionType() ==
           ExpressionType::VALUE_TUPLE) {
-    auto tv_expr = std::dynamic_pointer_cast<expression::TupleValueExpression>(
-        distinct_prop->GetDistinctColumn(0));
-    std::string column_name =
-        tv_expr->GetTableName() + "." + tv_expr->GetColumnName();
+    auto column_name = getColumnName(distinct_prop->GetDistinctColumn(0));
     output_cost_ +=
         Cost::DistinctCost(table_stats_ptr, column_name, output_stats);
   }


Compile fix.

Compile fix.

--- src/plugins/debugger/cdb/cdbdebugengine.cpp
+++ src/plugins/debugger/cdb/cdbdebugengine.cpp
@@ -40,6 +40,8 @@
 #include "cdboptions.h"
 #include "cdbexceptionutils.h"
 #include "debuggeragents.h"
+#include "debuggeruiswitcher.h"
+#include "debuggermainwindow.h"

 #include "debuggeractions.h"
 #include "debuggermanager.h"
@@ -1211,13 +1213,13 @@
         m_d->startWatchTimer();
         manager()->notifyInferiorPidChanged(appPid);
     } else {
-        QMessageBox::critical(manager()->mainWindow(), tr("Debugger Error"), errorMessage);
+        QMessageBox::critical(DebuggerUISwitcher::instance()->mainWindow(), tr("Debugger Error"), errorMessage);
     }
 }

 void CdbDebugEngine::slotConsoleStubError(const QString &msg)
 {
-    QMessageBox::critical(manager()->mainWindow(), tr("Debugger Error"), msg);
+    QMessageBox::critical(DebuggerUISwitcher::instance()->mainWindow(), tr("Debugger Error"), msg);
 }

 void CdbDebugEngine::slotConsoleStubTerminated()


Fix crash for long properties in outline model

Make sure the outline model only shows the first line
of a long property value.

Change-Id: Iac8059e927b10c400afec285a6dc6485cbbf49b4
Reviewed-by: Fawzi Mohamed <7388270c57edd0fabd71d8eb0322d66e3c40e57e@digia.com>

--- src/plugins/qmljseditor/qmloutlinemodel.cpp
+++ src/plugins/qmljseditor/qmloutlinemodel.cpp
@@ -963,8 +963,11 @@
     if (!expression)
         return QString();
     QString source = m_semanticInfo.document->source();
-    return source.mid(expression->firstSourceLocation().begin(),
-                      expression->lastSourceLocation().end() - expression->firstSourceLocation().begin());
+    QString str = source.mid(expression->firstSourceLocation().begin(),
+                             expression->lastSourceLocation().end()
+                             - expression->firstSourceLocation().begin());
+    // only show first line
+    return str.left(str.indexOf(QLatin1Char('\n')));
 }

 QHash<QString,QString> QmlOutlineModel::getScriptBindings(AST::UiObjectInitializer *objectInitializer) {


Removed dead assignment

Removed dead assignment

Change-Id: I4fd52e155a2252b4e66b419eb7d14b24a439ab96
Reviewed-by: Leandro T. C. Melo <8f144cd741810d8c7b648cacf5b9b2f4e2ebcc1b@nokia.com>
Reviewed-by: Friedemann Kleint <1b9f2592239daaec4856ccc1cfb4d2d55b35fb71@nokia.com>

--- src/plugins/texteditor/basetextdocument.cpp
+++ src/plugins/texteditor/basetextdocument.cpp
@@ -484,7 +484,8 @@
         emit titleChanged(title);
         emit changed();
     }
-    return true;
+    return readResult == Utils::TextFileFormat::ReadSuccess
+           || readResult == Utils::TextFileFormat::ReadEncodingError;
 }

 bool BaseTextDocument::reload(QString *errorString, QTextCodec *codec)


zoom the search results as well (regression fix)

--- src/plugins/texteditor/texteditorplugin.cpp
+++ src/plugins/texteditor/texteditorplugin.cpp
@@ -187,7 +187,8 @@
 void TextEditorPlugin::updateSearchResultsFont(const FontSettings &settings)
 {
     if (m_searchResultWindow)
-        m_searchResultWindow->setTextEditorFont(QFont(settings.family(), settings.fontSize()));
+        m_searchResultWindow->setTextEditorFont(QFont(settings.family(),
+                                                      settings.fontSize() * settings.fontZoom() / 100));
 }

 Q_EXPORT_PLUGIN(TextEditorPlugin)


Pass vehicle rank by value in clustering lambda functions.

--- src/problems/cvrp/heuristics/clustering.cpp
+++ src/problems/cvrp/heuristics/clustering.cpp
@@ -150,8 +150,9 @@
   };
   // Initialize cluster with the nearest job.
   auto nearest_init_lambda = [&](auto v) {
-    return
-      [&](index_t lhs, index_t rhs) { return costs[v][lhs] < costs[v][rhs]; };
+    return [&, v](index_t lhs, index_t rhs) {
+      return costs[v][lhs] < costs[v][rhs];
+    };
   };

   if (init != INIT_T::NONE) {
@@ -216,7 +217,7 @@
   }

   auto eval_lambda = [&](auto v) {
-    return [&](auto i, auto j) {
+    return [&, v](auto i, auto j) {
       return regret_coeff * static_cast<double>(regrets[v][i]) -
                static_cast<double>(costs[v][i]) <
              regret_coeff * static_cast<double>(regrets[v][j]) -
@@ -398,7 +399,7 @@
   };
   // Initialize cluster with the nearest job.
   auto nearest_init_lambda = [&](auto v) {
-    return [&](index_t lhs, index_t rhs) {
+    return [&, v](index_t lhs, index_t rhs) {
       return vehicles_to_job_costs[v][lhs] < vehicles_to_job_costs[v][rhs];
     };
   };


Remove obsolete TODO

Remove obsolete TODO

See discussion in crbug.com/631101 for details.

Comment-only change

PiperOrigin-RevId: 321808896
Change-Id: I2672ce5cbbaa9c3091a40a3d541960cd39e3adfa

--- quic/core/quic_crypto_client_handshaker.cc
+++ quic/core/quic_crypto_client_handshaker.cc
@@ -492,7 +492,6 @@
     if (!one_rtt_keys_available()) {
       next_state_ = STATE_SEND_CHLO;
     } else {
-      // TODO: Enable Expect-Staple. https://crbug.com/631101
       next_state_ = STATE_NONE;
     }
   }


Add debug config option to do verbose logging of shader debugging

--- renderdoc/driver/vulkan/vk_shaderdebug.cpp
+++ renderdoc/driver/vulkan/vk_shaderdebug.cpp
@@ -38,6 +38,8 @@
                   "Path to dump pixel shader debugging generated SPIR-V files.");
 RDOC_DEBUG_CONFIG(bool, Vulkan_Debug_DisableBufferDeviceAddress, false,
                   "Disable use of buffer device address for PS Input fetch.");
+RDOC_DEBUG_CONFIG(bool, Vulkan_Debug_ShaderDebugLogging, false,
+                  "Output verbose debug logging messages when debugging shaders.");

 struct DescSetBindingSnapshot
 {
@@ -2849,8 +2851,13 @@
   const VulkanRenderState &state = m_pDriver->GetRenderState();
   VulkanCreationInfo &c = m_pDriver->m_CreationInfo;

-  VkMarkerRegion region(
-      StringFormat::Fmt("DebugVertex @ %u of (%u,%u,%u)", eventId, vertid, instid, idx));
+  rdcstr regionName =
+      StringFormat::Fmt("DebugVertex @ %u of (%u,%u,%u)", eventId, vertid, instid, idx);
+
+  VkMarkerRegion region(regionName);
+
+  if(Vulkan_Debug_ShaderDebugLogging)
+    RDCLOG("%s", regionName.c_str());

   const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId);

@@ -2884,6 +2891,9 @@
   {
     if(attr.location >= locations.size())
       locations.resize(attr.location + 1);
+
+    if(Vulkan_Debug_ShaderDebugLogging)
+      RDCLOG("Populating location %u", attr.location);

     ShaderValue &val = locations[attr.location].value;

@@ -2913,9 +2923,25 @@
           vertexOffset = idx * bind.bytestride;
         }

+        if(Vulkan_Debug_ShaderDebugLogging)
+        {
+          RDCLOG("Fetching from %s at %llu offset %zu bytes", ToStr(vb.buf).c_str(),
+                 vb.offs + attr.byteoffset + vertexOffset, size);
+        }
+
         GetDebugManager()->GetBufferData(vb.buf, vb.offs + attr.byteoffset + vertexOffset, size,
                                          data);
       }
+      else if(Vulkan_Debug_ShaderDebugLogging)
+      {
+        RDCLOG("Vertex binding %u out of bounds from %zu vertex buffers", bind.vbufferBinding,
+               state.vbuffers.size());
+      }
+    }
+    else if(Vulkan_Debug_ShaderDebugLogging)
+    {
+      RDCLOG("Attribute binding %u out of bounds from %zu bindings", attr.binding,
+             pipe.vertexBindings.size());
     }

     if(size > data.size())
@@ -2973,8 +2999,13 @@
   const VulkanRenderState &state = m_pDriver->GetRenderState();
   VulkanCreationInfo &c = m_pDriver->m_CreationInfo;

-  VkMarkerRegion region(StringFormat::Fmt("DebugPixel @ %u of (%u,%u) sample %u primitive %u",
-                                          eventId, x, y, sample, primitive));
+  rdcstr regionName = StringFormat::Fmt("DebugPixel @ %u of (%u,%u) sample %u primitive %u",
+                                        eventId, x, y, sample, primitive);
+
+  VkMarkerRegion region(regionName);
+
+  if(Vulkan_Debug_ShaderDebugLogging)
+    RDCLOG("%s", regionName.c_str());

   const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId);

@@ -3012,27 +3043,65 @@
     {
       if(e.systemValue == ShaderBuiltin::PrimitiveIndex)
       {
+        if(Vulkan_Debug_ShaderDebugLogging)
+        {
+          RDCLOG("Geometry shader exports primitive ID, can use");
+        }
+
         usePrimitiveID = true;
         break;
       }
     }
+
+    if(Vulkan_Debug_ShaderDebugLogging && !usePrimitiveID)
+    {
+      RDCLOG("Geometry shader doesn't export primitive ID, can't use");
+    }
   }
   else
   {
     // no geometry shader - safe to use as long as the geometry shader capability is available
     usePrimitiveID = m_pDriver->GetDeviceFeatures().geometryShader != VK_FALSE;
+
+    if(Vulkan_Debug_ShaderDebugLogging)
+    {
+      RDCLOG("usePrimitiveID is %u because of bare capability", usePrimitiveID);
+    }
   }

   bool useSampleID = m_pDriver->GetDeviceFeatures().sampleRateShading != VK_FALSE;

+  if(Vulkan_Debug_ShaderDebugLogging)
+  {
+    RDCLOG("useSampleID is %u because of bare capability", useSampleID);
+  }
+
   StorageMode storageMode = Binding;

   if(m_pDriver->GetDeviceFeatures().shaderInt64)
   {
     if(m_pDriver->GetExtensions(NULL).ext_KHR_buffer_device_address)
+    {
       storageMode = KHR_bda;
+
+      if(Vulkan_Debug_ShaderDebugLogging)
+      {
+        RDCLOG("Using KHR_buffer_Device_address");
+      }
+    }
     else if(m_pDriver->GetExtensions(NULL).ext_EXT_buffer_device_address)
+    {
       storageMode = EXT_bda;
+
+      if(Vulkan_Debug_ShaderDebugLogging)
+      {
+        RDCLOG("Using EXT_buffer_Device_address");
+      }
+    }
+  }
+  else if(Vulkan_Debug_ShaderDebugLogging)
+  {
+    RDCLOG("shaderInt64 isn't available, falling back to binding storage mode");
   }

   if(Vulkan_Debug_DisableBufferDeviceAddress)
@@ -3059,6 +3128,12 @@
   uint32_t structSize = sizeof(PSHit) + structStride * 5;

   VkDeviceSize feedbackStorageSize = overdrawLevels * structSize + sizeof(Vec4f) + 1024;
+
+  if(Vulkan_Debug_ShaderDebugLogging)
+  {
+    RDCLOG("Output structure is %u sized, output buffer is %llu bytes", structStride,
+           feedbackStorageSize);
+  }

   if(feedbackStorageSize > m_BindlessFeedback.FeedbackBuffer.sz)
   {
@@ -3101,6 +3176,11 @@
       specData.bufferAddress = m_pDriver->vkGetBufferDeviceAddress(dev, &getAddressInfo);
     else
       specData.bufferAddress = m_pDriver->vkGetBufferDeviceAddressEXT(dev, &getAddressInfo);
+
+    if(Vulkan_Debug_ShaderDebugLogging)
+    {
+      RDCLOG("Got buffer address of %llu", specData.bufferAddress);
+    }
   }
   else
   {
@@ -3528,9 +3608,14 @@
   const VulkanRenderState &state = m_pDriver->GetRenderState();
   VulkanCreationInfo &c = m_pDriver->m_CreationInfo;

-  VkMarkerRegion region(StringFormat::Fmt("DebugThread @ %u of (%u,%u,%u) (%u,%u,%u)", eventId,
-                                          groupid[0], groupid[1], groupid[2], threadid[0],
-                                          threadid[1], threadid[2]));
+  rdcstr regionName =
+      StringFormat::Fmt("DebugThread @ %u of (%u,%u,%u) (%u,%u,%u)", eventId, groupid[0],
+                        groupid[1], groupid[2], threadid[0], threadid[1], threadid[2]);
+
+  VkMarkerRegion region(regionName);
+
+  if(Vulkan_Debug_ShaderDebugLogging)
+    RDCLOG("%s", regionName.c_str());

   const DrawcallDescription *draw = m_pDriver->GetDrawcall(eventId);


Desktop integration: escaping \' inside executable path

--- src/slic3r/GUI/DesktopIntegrationDialog.cpp
+++ src/slic3r/GUI/DesktopIntegrationDialog.cpp
@@ -13,6 +13,7 @@
 #include <boost/filesystem.hpp>
 #include <boost/log/trivial.hpp>
 #include <boost/dll/runtime_symbol_info.hpp>
+#include <boost/algorithm/string/replace.hpp>

 #include <wx/filename.h>
 #include <wx/stattext.h>
@@ -133,10 +134,10 @@

     // Path to appimage
     const char *appimage_env = std::getenv("APPIMAGE");
-    std::string appimage_path;
+    std::string excutable_path;
     if (appimage_env) {
         try {
-            appimage_path = boost::filesystem::canonical(boost::filesystem::path(appimage_env)).string();
+            excutable_path = boost::filesystem::canonical(boost::filesystem::path(appimage_env)).string();
         } catch (std::exception &) {
             BOOST_LOG_TRIVIAL(error) << "Performing desktop integration failed - boost::filesystem::canonical did not return appimage path.";
             show_error(nullptr, _L("Performing desktop integration failed - boost::filesystem::canonical did not return appimage path."));
@@ -144,10 +145,10 @@
         }
     } else {
         // not appimage - find executable
-        appimage_path = boost::dll::program_location().string();
-        //appimage_path = wxStandardPaths::Get().GetExecutablePath().string();
-        BOOST_LOG_TRIVIAL(debug) << "non-appimage path to executable: " << appimage_path;
-        if (appimage_path.empty())
+        excutable_path = boost::dll::program_location().string();
+        //excutable_path = wxStandardPaths::Get().GetExecutablePath().string();
+        BOOST_LOG_TRIVIAL(debug) << "non-appimage path to executable: " << excutable_path;
+        if (excutable_path.empty())
         {
             BOOST_LOG_TRIVIAL(error) << "Performing desktop integration failed - no executable found.";
             show_error(nullptr, _L("Performing desktop integration failed - Could not find executable."));
@@ -155,8 +156,8 @@
         }
     }

-    // Escape ' characters in appimage, other special symbols will be esacaped in desktop file by 'appimage_path'
-    //appimage_path = std::regex_replace(appimage_path, std::regex("\'"), "\\\'");
+    // Escape ' characters in appimage, other special symbols will be esacaped in desktop file by 'excutable_path'
+    boost::replace_all(excutable_path, "'", "'\\''");

     // Find directories icons and applications
     // $XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored.
@@ -249,7 +250,7 @@
                 "Categories=Graphics;3DGraphics;Engineering;\n"
                 "Keywords=3D;Printing;Slicer;slice;3D;printer;convert;gcode;stl;obj;amf;SLA\n"
                 "StartupNotify=false\n"
-                "StartupWMClass=prusa-slicer", name_suffix, version_suffix, appimage_path);
+                "StartupWMClass=prusa-slicer", name_suffix, version_suffix, excutable_path);

             std::string path = GUI::format("%1%/applications/PrusaSlicer%2%.desktop", target_dir_desktop, version_suffix);
             if (create_desktop_file(path, desktop_file)){
@@ -315,7 +316,7 @@
         "MimeType=text/x.gcode;\n"
         "Categories=Graphics;3DGraphics;\n"
         "Keywords=3D;Printing;Slicer;\n"
-        "StartupNotify=false", name_suffix, version_suffix, appimage_path);
+        "StartupNotify=false", name_suffix, version_suffix, excutable_path);

     std::string desktop_path = GUI::format("%1%/applications/PrusaSlicerGcodeViewer%2%.desktop", target_dir_desktop, version_suffix);
     if (create_desktop_file(desktop_path, desktop_file))


needs a TEST_SRCDIR

needs a TEST_SRCDIR

--- src/vw/Cartography/tests/TestCameraBBox.cxx
+++ src/vw/Cartography/tests/TestCameraBBox.cxx
@@ -23,7 +23,7 @@
 class CameraBBoxTest :  public ::testing::Test {
 protected:
   virtual void SetUp() {
-    apollo = boost::shared_ptr<CameraModel>(new PinholeModel("apollo.pinhole"));
+    apollo = boost::shared_ptr<CameraModel>(new PinholeModel(TEST_SRCDIR"/apollo.pinhole"));
     moon.set_well_known_geogcs("D_MOON");
   }


[Bug 15160] TrueCoverage build fails in Window.   Patch from Pranav.

git-svn-id: 3ec853389310512053d525963cab269c063bb453@174555 13f79535-47bb-0310-9956-ffa450edef68

--- src/xercesc/util/regx/RegularExpression.hpp
+++ src/xercesc/util/regx/RegularExpression.hpp
@@ -142,33 +142,33 @@
     //  Tokenize methods
     // -----------------------------------------------------------------------
     // Note: The caller owns the string vector that is returned, and is responsible
-    //       for deleting it.
+    //       for deleting it.
     RefArrayVectorOf<XMLCh> *tokenize(const char* const matchString);
     RefArrayVectorOf<XMLCh> *tokenize(const char* const matchString, const int start,
                                       const int end);

     RefArrayVectorOf<XMLCh> *tokenize(const XMLCh* const matchString);
-    RefArrayVectorOf<XMLCh> *tokenize(const XMLCh* const matchString,
+    RefArrayVectorOf<XMLCh> *tokenize(const XMLCh* const matchString,
                                       const int start, const int end);

     // -----------------------------------------------------------------------
     //  Replace methods
     // -----------------------------------------------------------------------
-    // Note: The caller owns the XMLCh* that is returned, and is responsible for
-    //       deleting it.
+    // Note: The caller owns the XMLCh* that is returned, and is responsible for
+    //       deleting it.
     XMLCh *replace(const char* const matchString, const char* const replaceString);
     XMLCh *replace(const char* const matchString, const char* const replaceString,
                    const int start, const int end);

     XMLCh *replace(const XMLCh* const matchString, const XMLCh* const replaceString);
-    XMLCh *replace(const XMLCh* const matchString, const XMLCh* const replaceString,
+    XMLCh *replace(const XMLCh* const matchString, const XMLCh* const replaceString,
                    const int start, const int end);

 private:
     // -----------------------------------------------------------------------
     //  Private data types
     // -----------------------------------------------------------------------
-    class Context
+    class XMLUTIL_EXPORT Context
     {
         public :
             Context();
@@ -254,16 +254,16 @@

     /**
      *    Tokenize helper
-     *
+     *
      *    This overloaded tokenize is for internal use only. It provides a way to
      *    keep track of the sub-expressions in each match of the pattern.
-     *
+     *
      *    It is called by the other tokenize methods, and by the replace method.
-     *    The caller is responsible for the deletion of the returned
+     *    The caller is responsible for the deletion of the returned
      *    RefArrayVectorOf<XMLCh*>
      */
-    RefArrayVectorOf<XMLCh> *tokenize(const XMLCh* const matchString,
-                                      const int start, const int end,
+    RefArrayVectorOf<XMLCh> *tokenize(const XMLCh* const matchString,
+                                      const int start, const int end,
                                       RefVectorOf<Match> *subEx);
     /**
      *    Replace helpers
@@ -271,7 +271,7 @@
      *    Note: the caller owns the XMLCh* that is returned
      */
     const XMLCh *subInExp(const XMLCh* const repString,
-                          const XMLCh* const origString,
+                          const XMLCh* const origString,
                           const Match* subEx);
     /**
      *    Converts a token tree into an operation tree


Namespace Validity:  if namespace is on and validation is on, attribute values declared to be of types ID, IDREF(S), ENTITY(IES), and NOTATION are also Names, and thus should be colon-free.

git-svn-id: 3ec853389310512053d525963cab269c063bb453@174417 13f79535-47bb-0310-9956-ffa450edef68

--- src/xercesc/validators/DTD/DTDValidator.cpp
+++ src/xercesc/validators/DTD/DTDValidator.cpp
@@ -236,6 +236,8 @@
     if (type == XMLAttDef::CData)
         return;

+
+
     // An empty string cannot be valid for any of the other types
     if (!attrValue[0])
     {
@@ -335,6 +337,14 @@
                 }
                 break;
             }
+
+            // Now this attribute can be of type
+            //     ID, IDREF, IDREFS, ENTITY, ENTITIES, NOTATION, NMTOKEN, NMTOKENS, ENUMERATION
+            //  All these must be valid XMLName
+            // If namespace is enabled, colon is not allowed in the first 6
+
+            if (getScanner()->getDoNamespaces() && *valPtr == chColon && firstNameChar)
+                getScanner()->emitError(XMLErrs::ColonNotLegalWithNS);

             if (!XMLReader::isNameChar(*valPtr))
             {


add C++11 compilation flags and minor bug fixes

--- tests/src/deviceLib/hip_threadfence_system.cpp
+++ tests/src/deviceLib/hip_threadfence_system.cpp
@@ -21,11 +21,13 @@
 */

 /* HIT_START
- * BUILD: %t %s ../test_common.cpp EXCLUDE_HIP_PLATFORM nvcc
+ * BUILD: %t %s ../test_common.cpp -std=c++11
  * RUN: %t
  * HIT_END
  */

+#include <vector>
+#include <atomic>
 #include <thread>
 #include <cassert>
 #include <cstdio>
@@ -33,15 +35,14 @@
 #include "hip/device_functions.h"
 #include "test_common.h"

-
 #define HIP_ASSERT(x) (assert((x)==hipSuccess))

-__host__ void fence_system() {
+__host__ __device__ void fence_system() {
+#ifdef __HIP_DEVICE_COMPILE__
+  __threadfence_system();
+#else
   std::atomic_thread_fence(std::memory_order_seq_cst);
-}
-
-__device__ void fence_system() {
-  __threadfence_system();
+#endif
 }

 __host__ __device__ void round_robin(const int id, const int num_dev, const int num_iter, volatile int* data, volatile int* flag) {


This fixes some float/double warnings and converts everything to floats.
Review URL: http://codereview.chromium.org/155953

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

--- o3d/core/cross/bitmap.cc
+++ o3d/core/cross/bitmap.cc
@@ -53,16 +53,16 @@
 using file_util::GetFileSize;

 namespace {
-static const double kEpsilon = 0.0001;
-static const double kPi = 3.14159265358979;
+static const float kEpsilon = 0.0001f;
+static const float kPi = 3.14159265358979f;
 static const int kFilterSize = 3;

-// utility function, round double numbers into 0 to 255 integers.
-uint8 Safe8Round(double f) {
-  f += 0.5;
-  if (f < 0.0) {
+// utility function, round float numbers into 0 to 255 integers.
+uint8 Safe8Round(float f) {
+  f += 0.5f;
+  if (f < 0.0f) {
     return 0;
-  } else if (!(f < 255.0)) {
+  } else if (!(f < 255.0f)) {
     return 255;
   }
   return static_cast<uint8>(f);
@@ -404,7 +404,7 @@
   // the same.
   for (int i = 0; i < abs(nwidth); ++i) {
     // center is the corresponding coordinate of i in original img.
-    float center = (i + 0.5) * scale;
+    float center = (i + 0.5f) * scale;
     // boundary of weight array in original img.
     int xmin = static_cast<int>(floor(center - support));
     if (xmin < 0) xmin = 0;
@@ -415,14 +415,14 @@
     float wsum = 0.0;
     for (int ox = xmin; ox <= xmax; ++ox) {
       float wtemp;
-      float dx = ox + 0.5 - center;
+      float dx = ox + 0.5f - center;
       // lanczos filter
       if (dx <= -kFilterSize || dx >= kFilterSize) {
         wtemp = 0.0;
       } else if (dx == 0.0) {
-        wtemp = 1.0;
+        wtemp = 1.0f;
       } else {
-        wtemp = kFilterSize * sin(kPi * dx) * sin(kPi / kFilterSize * dx) /
+        wtemp = kFilterSize * sinf(kPi * dx) * sinf(kPi / kFilterSize * dx) /
                 (kPi * kPi * dx * dx);
       }


Fixed typo

Fixed typo

--- Lesson1/src/main.cpp
+++ Lesson1/src/main.cpp
@@ -24,7 +24,7 @@
 	//video driver supports the flags we're passing
 	//Flags: SDL_RENDERER_ACCELERATED: We want to use hardware accelerated rendering
 	//SDL_RENDERER_PRESENTVSYNC: We want the renderer's present function (update screen) to be
-	//synchornized with the monitor's refresh rate
+	//synchronized with the monitor's refresh rate
 	SDL_Renderer *ren = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
 	if (ren == nullptr){
 		SDL_DestroyWindow(win);


Use a better method for computing the clip positions

--- Lesson5/src/main.cpp
+++ Lesson5/src/main.cpp
@@ -109,12 +109,8 @@
 	SDL_Rect clips[4];
 	//Since our clips our uniform in size we can generate a list of their
 	//positions using some math (the specifics of this are covered in the lesson)
-	int column = 0;
 	for (int i = 0; i < 4; ++i){
-		if (i != 0 && i % 2 == 0)
-			++column;
-
-		clips[i].x = column * iW;
+		clips[i].x = i / 2 * iW;
 		clips[i].y = i % 2 * iH;
 		clips[i].w = iW;
 		clips[i].h = iH;


Volume Rendering: micro cleanup

Volume Rendering: micro cleanup

--- Components/Volume/src/OgreVolumeMeshBuilder.cpp
+++ Components/Volume/src/OgreVolumeMeshBuilder.cpp
@@ -50,7 +50,7 @@

     bool operator<(const Vertex& a, const Vertex& b)
     {
-         return memcmp(&a, &b, sizeof(Ogre::Volume::Vertex)) < 0;
+         return memcmp(&a, &b, sizeof(Vertex)) < 0;
     }

     //-----------------------------------------------------------------------


made pointsetmapper2d indepedent from slicenavigationcontroller geometry

--- Core/Code/Rendering/mitkPointSetVtkMapper2D.cpp
+++ Core/Code/Rendering/mitkPointSetVtkMapper2D.cpp
@@ -273,7 +273,7 @@
   mitk::Point2D preLastPt2d = pt2d ;     // projected_p in display coordinates before lastPt2

   mitk::DisplayGeometry::Pointer displayGeometry = renderer->GetDisplayGeometry();
-  mitk::PlaneGeometry::ConstPointer planeGeometry = renderer->GetSliceNavigationController()->GetCurrentPlaneGeometry();
+  const mitk::Geometry2D* geo2D = renderer->GetCurrentWorldGeometry2D();

   vtkLinearTransform* dataNodeTransform = input->GetGeometry()->GetVtkTransform();

@@ -311,7 +311,7 @@
     vec = p-lastP;    // valid only for counter > 0

     // compute distance to current plane
-    float diff = planeGeometry->DistanceFromPlane(point);
+    float diff = geo2D->Distance(point);
     diff = diff * diff;

     // draw markers on slices a certain distance away from the points true location according to the tolerance threshold (m_DistanceToPlane)
@@ -492,7 +492,7 @@
   vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
   vtkSmartPointer<vtkMatrix4x4> a,b = vtkSmartPointer<vtkMatrix4x4>::New();

-  a = planeGeometry->GetVtkTransform()->GetMatrix();
+  a = geo2D->GetVtkTransform()->GetMatrix();
   b->DeepCopy( a );

   // delete transformation from matrix, only take orientation


Fix normal commands not being executed

Fix normal commands not being executed

--- godot_vim/godot_vim.cpp
+++ godot_vim/godot_vim.cpp
@@ -4,7 +4,7 @@
 #include "os/input_event.h"
 #include "editor/plugins/script_editor_plugin.h"

-// Some utility functions copied over from text_edit.cpp
+// Some utility functions copied from text_edit.cpp

 static const int a = 0;

@@ -78,7 +78,7 @@
     return 0;
 }

-// End of copi_find_command
+// End of copied functions

 static bool _is_space(CharType c) {
     return (c == ' ' || c == '\t');
@@ -167,7 +167,7 @@

             cmdFunction op_func = op_cmd->function;

-        _update_visual_selection();
+            (this->*op_func)();

             text_edit->deselect();
         }
@@ -866,73 +866,73 @@
     _create_command("b", &GodotVim::_move_word_beginning);
     _create_command("B", &GodotVim::_move_word_beginning_big);
     _create_command("}", &GodotVim::_move_paragraph_down);
-   _create_command("{", &GodotVim::_move_paragraph_up);
-   _create_command("%", &GodotVim::_move_to_matching_pair);
-   _create_command("o", &GodotVim::_open_line_below);
-   _create_command("O", &GodotVim::_open_line_above);
-   _create_command("i", &GodotVim::_enter_insert_mode, ACTION, NORMAL);
-   _create_command("a", &GodotVim::_enter_insert_mode_append, ACTION, NORMAL);
-   //_create_command("A", &GodotVim::_enter_insert_mode_after_eol, ACTION);
-   //_create_command("A", &GodotVim::_enter_insert_mode_after_selection, ACTION, VISUAL);
-   //_create_command("I", &GodotVim::_enter_insert_mode_first_non_blank, ACTION);
-   //_create_command("I", &GodotVim::_enter_insert_mode_before_selection, ACTION, VISUAL);
-   _create_command("v", &GodotVim::_toggle_visual_mode, ACTION);
-   _create_command("V", &GodotVim::_toggle_visual_mode_line, ACTION);
-   //_create_command("<C-v>", &GodotVim::_toggle_visual_mode_block, ACTION);
-
-   _create_command("d", &GodotVim::_delete_text, OPERATOR);
-   //_create_command("y", &GodotVim::_yank_text, OPERATOR);
-   _create_command("c", &GodotVim::_change_text, OPERATOR);
-   _create_command(">", &GodotVim::_indent_text, OPERATOR);
-   _create_command("<", &GodotVim::_unindent_text, OPERATOR);
-   _create_command("g~", &GodotVim::_change_case, OPERATOR);
-   _create_command("gu", &GodotVim::_change_to_lower_case, OPERATOR);
-   _create_command("gU", &GodotVim::_change_to_upper_case, OPERATOR);
-   //_create_command("=", &GodotVim::_indent_text, OPERATOR);
-   //_create_command("n", &GodotVim::_find_next, ACTION);
-   //_create_command("N", &GodotVim::_find_previous, ACTION);
-   //_create_command("x", &GodotVim::_delete_char, ACTION);
-   //_create_command("X", &GodotVim::_delete_previous_char, ACTION);
-   //_create_command("D", &GodotVim::_delete_to_eol, ACTION, COMMAND);
-   //_create_command("D", &GodotVim::_delete_text, ACTION, VISUAL);
-   // ~
-   // ~
-   //_create_command("gt", &GodotVim::_goto_next_tab, ACTION);
-   //_create_command("gT", &GodotVim::_goto_previous_tab, ACTION);
-
-   //_create_command("J", &GodotVim::_join_lines, ACTION);
-   //_create_command("p", &GodotVim::_paste, ACTION);
-   //_create_command("P", &GodotVim::_paste_before, ACTION);
-   //_create_command("r", &GodotVim::_replace_char, ACTION);
-
-   _create_command("u", &GodotVim::_undo, ACTION);
-   _create_command("u", &GodotVim::_change_to_lower_case, OPERATOR, VISUAL);
-   //_create_command("<C-r>", &GodotVim::_redo, ACTION);
-   _create_command("U", &GodotVim::_change_to_upper_case, OPERATOR, VISUAL);
-
-   //_create_command("zz", &GodotVim::_scroll_to_center, ACTION);
-   //_create_command("z.", &GodotVim::_scroll_to_center_first_non_blank, ACTION);
-   //_create_command("zt", &GodotVim::_scroll_to_top, ACTION);
-   //_create_command("z<CR>", &GodotVim::_scroll_to_top_fist_non_blank, ACTION);
-   //_create_command("z-", &GodotVim::_scroll_to_bottom_, ACTION);
-   //_create_command("zb", &GodotVim::_scroll_to_bottom_first_non_blank, ACTION);
-   //_create_command(".", &GodotVim::_repeat_last_edit, ACTION);
-   // <C-a>
-   // <C-x>
-   // <C-x>
-
-   //_create_command("a<char>", &GodotVim::_text_object, MOTION);
-   //_create_command("i<char>", &GodotVim::_text_object_inner, MOTION);
-
-   //
-   //_create_command("/", &GodotVim::_start_search, SEARCH);
-   //_create_command("?", &GodotVim::_start_search_backward, SEARCH);
-   //_create_command("*", &GodotVim::_search_word_under_cursor, SEARCH);
-   //_create_command("#", &GodotVim::_search_word_under_cursor_backward, SEARCH);
-   // g*
-   // g#
-
-   //_create_command(":", &GodotVim::_enter_ex, EX);
+    _create_command("{", &GodotVim::_move_paragraph_up);
+    _create_command("%", &GodotVim::_move_to_matching_pair);
+    _create_command("o", &GodotVim::_open_line_below);
+    _create_command("O", &GodotVim::_open_line_above);
+    _create_command("i", &GodotVim::_enter_insert_mode, ACTION, NORMAL);
+    _create_command("a", &GodotVim::_enter_insert_mode_append, ACTION, NORMAL);
+    //_create_command("A", &GodotVim::_enter_insert_mode_after_eol, ACTION);
+    //_create_command("A", &GodotVim::_enter_insert_mode_after_selection, ACTION, VISUAL);
+    //_create_command("I", &GodotVim::_enter_insert_mode_first_non_blank, ACTION);
+    //_create_command("I", &GodotVim::_enter_insert_mode_before_selection, ACTION, VISUAL);
+    _create_command("v", &GodotVim::_toggle_visual_mode, ACTION);
+    _create_command("V", &GodotVim::_toggle_visual_mode_line, ACTION);
+    //_create_command("<C-v>", &GodotVim::_toggle_visual_mode_block, ACTION);
+
+    _create_command("d", &GodotVim::_delete_text, OPERATOR);
+    //_create_command("y", &GodotVim::_yank_text, OPERATOR);
+    _create_command("c", &GodotVim::_change_text, OPERATOR);
+    _create_command(">", &GodotVim::_indent_text, OPERATOR);
+    _create_command("<", &GodotVim::_unindent_text, OPERATOR);
+    _create_command("g~", &GodotVim::_change_case, OPERATOR);
+    _create_command("gu", &GodotVim::_change_to_lower_case, OPERATOR);
+    _create_command("gU", &GodotVim::_change_to_upper_case, OPERATOR);
+    //_create_command("=", &GodotVim::_indent_text, OPERATOR);
+    //_create_command("n", &GodotVim::_find_next, ACTION);
+    //_create_command("N", &GodotVim::_find_previous, ACTION);
+    //_create_command("x", &GodotVim::_delete_char, ACTION);
+    //_create_command("X", &GodotVim::_delete_previous_char, ACTION);
+    //_create_command("D", &GodotVim::_delete_to_eol, ACTION, COMMAND);
+    //_create_command("D", &GodotVim::_delete_text, ACTION, VISUAL);
+    // ~
+    // ~
+    //_create_command("gt", &GodotVim::_goto_next_tab, ACTION);
+    //_create_command("gT", &GodotVim::_goto_previous_tab, ACTION);
+
+    //_create_command("J", &GodotVim::_join_lines, ACTION);
+    //_create_command("p", &GodotVim::_paste, ACTION);
+    //_create_command("P", &GodotVim::_paste_before, ACTION);
+    //_create_command("r", &GodotVim::_replace_char, ACTION);
+
+    _create_command("u", &GodotVim::_undo, ACTION);
+    _create_command("u", &GodotVim::_change_to_lower_case, OPERATOR, VISUAL);
+    //_create_command("<C-r>", &GodotVim::_redo, ACTION);
+    _create_command("U", &GodotVim::_change_to_upper_case, OPERATOR, VISUAL);
+
+    //_create_command("zz", &GodotVim::_scroll_to_center, ACTION);
+    //_create_command("z.", &GodotVim::_scroll_to_center_first_non_blank, ACTION);
+    //_create_command("zt", &GodotVim::_scroll_to_top, ACTION);
+    //_create_command("z<CR>", &GodotVim::_scroll_to_top_fist_non_blank, ACTION);
+    //_create_command("z-", &GodotVim::_scroll_to_bottom_, ACTION);
+    //_create_command("zb", &GodotVim::_scroll_to_bottom_first_non_blank, ACTION);
+    //_create_command(".", &GodotVim::_repeat_last_edit, ACTION);
+    // <C-a>
+    // <C-x>
+    // <C-x>
+
+    //_create_command("a<char>", &GodotVim::_text_object, MOTION);
+    //_create_command("i<char>", &GodotVim::_text_object_inner, MOTION);
+
+    //
+    //_create_command("/", &GodotVim::_start_search, SEARCH);
+    //_create_command("?", &GodotVim::_start_search_backward, SEARCH);
+    //_create_command("*", &GodotVim::_search_word_under_cursor, SEARCH);
+    //_create_command("#", &GodotVim::_search_word_under_cursor_backward, SEARCH);
+    // g*
+    // g#
+
+    //_create_command(":", &GodotVim::_enter_ex, EX);

 }


[http]: make more use of sd_notify[f]()

[http]: make more use of sd_notify[f]()

--- lib/http/HttpServer.cpp
+++ lib/http/HttpServer.cpp
@@ -125,6 +125,8 @@
 	logger_.reset(new FileLogger<decltype(nowfn)>("/dev/stderr", nowfn));

 	registerPlugin(core_ = new HttpCore(*this));
+
+	sd_notify(0, "STATUS=Initialized");
 }

 HttpServer::~HttpServer()
@@ -153,21 +155,25 @@

 bool HttpServer::setup(std::istream *settings, const std::string& filename)
 {
+	sd_notify(0, "STATUS=Setting up");
+
+	Flow::Function *setupFn;
 	Flow::Parser parser;
+
 	parser.setErrorHandler(std::bind(&wrap_log_error, this, "parser", std::placeholders::_1));
 	if (!parser.initialize(settings, filename)) {
-		perror("open");
-		return false;
+		sd_notifyf(0, "ERRNO=%d", errno);
+		goto err;
 	}

 	unit_ = parser.parse();
 	if (!unit_)
-		return false;
-
-	Flow::Function *setupFn = unit_->lookup<Flow::Function>("setup");
+		goto err;
+
+	setupFn = unit_->lookup<Flow::Function>("setup");
 	if (!setupFn) {
 		log(Severity::error, "no setup handler defined in config file.\n");
-		return false;
+		goto err;
 	}

 	// compile module
@@ -175,12 +181,12 @@

 	// run setup
 	if (runner_->run(setupFn))
-		return false;
+		goto err;

 	// grap the request handler
 	onHandleRequest_ = runner_->compile(unit_->lookup<Flow::Function>("main"));
 	if (!onHandleRequest_)
-		return false;
+		goto err;

 	// {{{ setup server-tag
 	{
@@ -239,28 +245,33 @@
 	// {{{ run post-config hooks
 	for (auto i = plugins_.begin(), e = plugins_.end(); i != e; ++i)
 		if (!(*i)->post_config())
-			return false;
+			goto err;
 	// }}}

 	// {{{ run post-check hooks
 	for (auto i = plugins_.begin(), e = plugins_.end(); i != e; ++i)
 		if (!(*i)->post_check())
-			return false;
+			goto err;
 	// }}}

 	// {{{ check for available TCP listeners
 	if (listeners_.empty())
 	{
 		log(Severity::error, "No HTTP listeners defined");
-		return false;
+		goto err;
 	}

 	for (auto i = listeners_.begin(), e = listeners_.end(); i != e; ++i)
 		if (!(*i)->prepare())
-			return false;
+			goto err;
 	// }}}

+	sd_notify(0, "STATUS=Setup done");
 	return true;
+
+err:
+	sd_notify(0, "STATUS=Setup failed");
+	return false;
 }

 // {{{ worker mgnt


using std::...

using std::...

--- EMCAL/EMCALbase/AliEMCALTriggerSTURawStream.cxx
+++ EMCAL/EMCALbase/AliEMCALTriggerSTURawStream.cxx
@@ -30,6 +30,7 @@
 using std::cout;
 using std::setw;
 using std::endl;
+using std::dec;
 ClassImp(AliEMCALTriggerSTURawStream)

 //_____________________________________________________________________________


cast to pointer to pointer, not just pointer. (confused yet?)


that property is server or client side

that property is server or client side

--- lib/kerberos_context.cc
+++ lib/kerberos_context.cc
@@ -41,7 +41,7 @@
   // Getter for the response
   proto->SetAccessor(NanNew<String>("response"), KerberosContext::ResponseGetter);

-  // Getter for the username - server side only
+  // Getter for the username
   proto->SetAccessor(NanNew<String>("username"), KerberosContext::UsernameGetter);

   // Getter for the targetname - server side only


log: Adds a utility function to help construct `ExceptionLogError`.

Change-Id: I782b51486483a057baf355a593cc6bc3164e27d2
Reviewed-on: http://gerrit.aldebaran.lan/92066
Reviewed-by: vincent.palancher <f8ff75e1c61314c499fafa8de0d9e004e87e66b0@external.softbankrobotics.com>
Tested-by: vincent.palancher <f8ff75e1c61314c499fafa8de0d9e004e87e66b0@external.softbankrobotics.com>
Reviewed-by: matthieu.paindavoine <46a7002186f24481bf9e6367b89846efa23259bf@softbankrobotics.com>

--- qi/log.hpp
+++ qi/log.hpp
@@ -583,6 +583,46 @@
       qiLogError(category) << prefix << ": unknown exception";
     }
   };
+
+  /// Helper-function to deduce types for `ExceptionLogError`.
+  ///
+  /// Example: Using catch-clauses.
+  /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  /// const auto logError = qi::exceptionLogError("myapp", "The function that could throw threw");
+  /// try
+  /// {
+  ///   functionThatMightThrow();
+  /// }
+  /// catch (const std::exception& ex)
+  /// {
+  ///   logError(ex);
+  /// }
+  /// catch (const boost::exception& ex)
+  /// {
+  ///   logError(ex);
+  /// }
+  /// catch (...)
+  /// {
+  ///   logError();
+  /// }
+  /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ///
+  /// Example: Using ka::invoke_catch.
+  /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  /// ka::invoke_catch(
+  ///   qi::exceptionLogError("myapp", "The function that could throw threw"),
+  ///   functionThatMightThrow
+  /// );
+  /// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ///
+  /// OStreamable O, ConvertibleTo<const char*> S
+  template<typename O, typename S>
+  ExceptionLogError<ka::Decay<O>, ka::Decay<S>> exceptionLogError(S&& category, O&& prefix)
+  {
+    return ExceptionLogError<ka::Decay<O>, ka::Decay<S>>{ ka::fwd<S>(category),
+                                                          ka::fwd<O>(prefix) };
+  }
+
 } // namespace qi

 #endif  // _QI_LOG_HPP_


v1.06 	-main1.cpp 주석 일관성 강화 및 불필요한 스페인어 주석 제거


gui: Try to un-break android retracer.

gui: Try to un-break android retracer.

Which must have gotten with the UBJSON transition.

Untested, but at least it has a non-zero chance of working.

Ideally, this code should have been shared with gui/retracer.cpp instead
of duplicated.

--- gui/androidretracer.cpp
+++ gui/androidretracer.cpp
@@ -8,9 +8,11 @@
 #include "trace_profiler.hpp"

 #include <QHostAddress>
-#include <QJsonDocument>
 #include <QSettings>
 #include <QTime>
+#include <QBuffer>
+
+#include "qubjson.h"

 typedef QLatin1String _;

@@ -120,7 +122,7 @@
     QRegExp regexp("(^\\d+): +(\\b\\w+\\b): ([^\\r\\n]+)[\\r\\n]*$");

     QString msg = QLatin1String("Replay finished!");
-    QByteArray jsonBuffer;
+    QByteArray ubjsonBuffer;
     QByteArray outputBuffer;
     bool keepGoing = true;
     while(keepGoing) {
@@ -182,7 +184,7 @@
         // read stdout channel
         if (stdoutSocket.waitForReadyRead(100)) {
             if (captureState())
-                jsonBuffer.append(stdoutSocket.readAll());
+                ubjsonBuffer.append(stdoutSocket.readAll());
             else if (captureThumbnails()) {
                 // read one image
                 image::PNMInfo info;
@@ -268,14 +270,10 @@
         msg = outputBuffer;

     if (captureState()) {
-        QJsonParseError error;
-        QJsonDocument jsonDoc =
-            QJsonDocument::fromJson(jsonBuffer, &error);
-
-        if (error.error != QJsonParseError::NoError)
-            msg = error.errorString();
-
-        parsedJson = jsonDoc.toVariant().toMap();
+        QBuffer io(&ubjsonBuffer);
+        io.open(QIODevice::ReadOnly);
+
+        parsedJson = decodeUBJSONObject(&io).toMap();
         ApiTraceState *state = new ApiTraceState(parsedJson);
         emit foundState(state);
     }


Prevent sending fast update picture commands if there is no sink stream

--- Source/Framework/XMReceiverMediaPatch.cpp
+++ Source/Framework/XMReceiverMediaPatch.cpp
@@ -1,5 +1,5 @@
 /*
- * $Id: XMReceiverMediaPatch.cpp,v 1.30 2007/02/13 12:57:52 hfriederich Exp $
+ * $Id: XMReceiverMediaPatch.cpp,v 1.31 2007/02/16 14:13:51 hfriederich Exp $
  *
  * Copyright (c) 2005-2007 XMeeting Project ("http://xmeeting.sf.net").
  * All rights reserved.
@@ -426,6 +426,10 @@

 void XMReceiverMediaPatch::IssueVideoUpdatePictureCommand()
 {
+    if(sinks.GetSize() == 0) {
+        return;
+    }
+
 	OpalVideoUpdatePicture command = OpalVideoUpdatePicture(-1, -1, -1);

     sinks[0].stream->ExecuteCommand(command);


trace_processor_shell: add .read command

Adds a new .read command that behaves the same way as if a query script
is passed via -q (e.g. can only have non-suppressed SELECT).

Change-Id: I01bddb2a70e5c245ed66209b824ddb6d0b56775b

--- src/trace_processor/trace_processor_shell.cc
+++ src/trace_processor/trace_processor_shell.cc
@@ -476,52 +476,6 @@
   }
   printf("\nQuery executed in %.3f ms\n\n",
          static_cast<double>((t_end - t_start).count()) / 1E6);
-}
-
-void PrintShellUsage() {
-  PERFETTO_ELOG(
-      "Available commands:\n"
-      ".quit, .q    Exit the shell.\n"
-      ".help        This text.\n"
-      ".dump FILE   Export the trace as a sqlite database.\n"
-      ".reset       Destroys all tables/view created by the user.\n");
-}
-
-util::Status StartInteractiveShell(uint32_t column_width) {
-  SetupLineEditor();
-
-  for (;;) {
-    ScopedLine line = GetLine("> ");
-    if (!line)
-      break;
-    if (strcmp(line.get(), "") == 0) {
-      printf("If you want to quit either type .q or press CTRL-D (EOF)\n");
-      continue;
-    }
-    if (line.get()[0] == '.') {
-      char command[32] = {};
-      char arg[1024] = {};
-      sscanf(line.get() + 1, "%31s %1023s", command, arg);
-      if (strcmp(command, "quit") == 0 || strcmp(command, "q") == 0) {
-        break;
-      } else if (strcmp(command, "help") == 0) {
-        PrintShellUsage();
-      } else if (strcmp(command, "dump") == 0 && strlen(arg)) {
-        if (!ExportTraceToDatabase(arg).ok())
-          PERFETTO_ELOG("Database export failed");
-      } else if (strcmp(command, "reset") == 0) {
-        g_tp->RestoreInitialTables();
-      } else {
-        PrintShellUsage();
-      }
-      continue;
-    }
-
-    base::TimeNanos t_start = base::GetWallTimeNs();
-    auto it = g_tp->ExecuteQuery(line.get());
-    PrintQueryResultInteractively(&it, t_start, column_width);
-  }
-  return util::OkStatus();
 }

 util::Status PrintQueryResultAsCsv(Iterator* it, FILE* output) {
@@ -1074,6 +1028,58 @@
   return RunMetrics(std::move(metrics), format, pool);
 }

+void PrintShellUsage() {
+  PERFETTO_ELOG(
+      "Available commands:\n"
+      ".quit, .q    Exit the shell.\n"
+      ".help        This text.\n"
+      ".dump FILE   Export the trace as a sqlite database.\n"
+      ".read FILE   Executes the queries in the FILE.\n"
+      ".reset       Destroys all tables/view created by the user.\n");
+}
+
+util::Status StartInteractiveShell(uint32_t column_width) {
+  SetupLineEditor();
+
+  for (;;) {
+    ScopedLine line = GetLine("> ");
+    if (!line)
+      break;
+    if (strcmp(line.get(), "") == 0) {
+      printf("If you want to quit either type .q or press CTRL-D (EOF)\n");
+      continue;
+    }
+    if (line.get()[0] == '.') {
+      char command[32] = {};
+      char arg[1024] = {};
+      sscanf(line.get() + 1, "%31s %1023s", command, arg);
+      if (strcmp(command, "quit") == 0 || strcmp(command, "q") == 0) {
+        break;
+      } else if (strcmp(command, "help") == 0) {
+        PrintShellUsage();
+      } else if (strcmp(command, "dump") == 0 && strlen(arg)) {
+        if (!ExportTraceToDatabase(arg).ok())
+          PERFETTO_ELOG("Database export failed");
+      } else if (strcmp(command, "reset") == 0) {
+        g_tp->RestoreInitialTables();
+      } else if (strcmp(command, "read") == 0 && strlen(arg)) {
+        util::Status status = RunQueries(arg, true);
+        if (!status.ok()) {
+          PERFETTO_ELOG("%s", status.c_message());
+        }
+      } else {
+        PrintShellUsage();
+      }
+      continue;
+    }
+
+    base::TimeNanos t_start = base::GetWallTimeNs();
+    auto it = g_tp->ExecuteQuery(line.get());
+    PrintQueryResultInteractively(&it, t_start, column_width);
+  }
+  return util::OkStatus();
+}
+
 util::Status TraceProcessorMain(int argc, char** argv) {
   CommandLineOptions options = ParseCommandLineOptions(argc, argv);


fixed race condition in fast_scan that only occured with > 1M char values

--- thrust/detail/device/cuda/detail/fast_scan.inl
+++ thrust/detail/device/cuda/detail/fast_scan.inl
@@ -138,11 +138,11 @@
             sdata[offset % K][offset / K] = thrust::detail::device::dereference(temp);
         }

-        __syncthreads();
-
         // carry in
         if (threadIdx.x == 0 && base != interval_begin)
-            sdata[0][threadIdx.x] = binary_op(sdata[K][blockDim.x - 1], sdata[0][threadIdx.x]);
+            sdata[0][0] = binary_op(sdata[K][CTA_SIZE - 1], sdata[0][0]);
+
+        __syncthreads();

         // scan local values
         OutputType sum = sdata[0][threadIdx.x];


Update reverse-vowels-of-a-string.cpp

Update reverse-vowels-of-a-string.cpp

--- C++/reverse-vowels-of-a-string.cpp
+++ C++/reverse-vowels-of-a-string.cpp
@@ -5,13 +5,12 @@
 public:
     string reverseVowels(string s) {
         for (int i = 0, j = s.length() - 1; i < j;) {
-            if (is_vowel(tolower(s[i])) &&
-                is_vowel(tolower(s[j]))) {
+            if (!is_vowel(tolower(s[i]))) {
+                ++i;
+            } else if (!is_vowel(tolower(s[j]))) {
+                --j;
+            } else {
                 swap(s[i++], s[j--]);
-            } else if (!is_vowel(tolower(s[i]))) {
-                ++i;
-            } else {
-                --j;
             }
         }
         return s;


sorting counts as job time in disk I/O thread timing

git-svn-id: 4f0141143c3c635d33f1b9f02fcb2b6c73e45c89@5391 a83610d8-ad2a-0410-a6ab-fc0612d85776

--- src/disk_io_thread.cpp
+++ src/disk_io_thread.cpp
@@ -1696,6 +1696,7 @@
 					ptime now = time_now_hires();
 					m_sort_time.add_sample(total_microseconds(now - sort_start));
 					m_cache_stats.cumulative_sort_time += total_milliseconds(now - sort_start);
+					m_cache_stats.cumulative_job_time += total_milliseconds(done - operation_start);
 					continue;
 				}
 			}


Minor fix for Release build for qt 5.5

Minor fix for Release build for qt 5.5

--- src/xpiks-qt/main.cpp
+++ src/xpiks-qt/main.cpp
@@ -90,6 +90,9 @@
     case QtFatalMsg:
         txt = QString("Fatal: %1").arg(msg);
         break;
+    case QtInfoMsg:
+        txt = QString("Info: %1").arg(msg);
+        break;
     }

     QString logLine = QString("%1 - %2")


Add new failing test

Add new failing test

git-svn-id: fc35eccb03ccef1c432fd0fcf5295fcceaca86a6@32170 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6

--- viterbi/vitest.cc
+++ viterbi/vitest.cc
@@ -349,6 +349,14 @@
 	);
 }

+bool test_first_opt_lefty()
+{
+	return test_simple_state("first state, left-going optional",
+		"LEFT-WALL: Wd+ or Wi+ or Wq+;"
+		"this: Ss*b+ and {Xi-};"
+	);
+}
+
 // ==================================================================

 int
@@ -359,6 +367,7 @@
 	num_failures += ntest_simple();
 	num_failures += ntest_two();
 	if (!test_first_state()) num_failures++;
+	if (!test_first_opt_lefty()) num_failures++;

 	if (num_failures)
 	{


Fixes the VOLTS_PER_AMP param not being set on older APM FW builds

--- src/ui/configuration/BatteryMonitorConfig.cc
+++ src/ui/configuration/BatteryMonitorConfig.cc
@@ -156,7 +156,7 @@
         QMessageBox::information(0,"Error","Invalid number entered for amps per volts. Please try again");
         return;
     }
-    m_uas->getParamManager()->setParameter(1,"AMPS_PER_VOLT",newval);
+    m_uas->getParamManager()->setParameter(1,m_ampPerVoltParam,newval);
 }
 void BatteryMonitorConfig::batteryCapacitySet()
 {


fixed bug in disk IO thread which would make it sometimes0 exit the thread if an error occurred

git-svn-id: 6ed3528c1be4534134272ad6dd050eeaa1f628d3@2993 f43f7eb3-cfe1-5f9d-1b5f-e45aa6702bda

--- src/disk_io_thread.cpp
+++ src/disk_io_thread.cpp
@@ -858,7 +858,7 @@
 					if (test_error(j))
 					{
 						ret = -1;
-						return;
+						break;
 					}
 #ifdef TORRENT_DISK_STATS
 					m_log << log_time() << " read " << j.buffer_size << std::endl;


left a debug statement in

left a debug statement in

--- gninasrc/main/main.cpp
+++ gninasrc/main/main.cpp
@@ -359,7 +359,6 @@
       non_cache_cnn* nc_cnn = dynamic_cast<non_cache_cnn*>(&nc);
       if (!nc_cnn)
       {
-        std::cerr << "NOT CNN\n";
         non_cache nc_base = *(dynamic_cast<non_cache*>(&nc));
         const fl best_mode_intramolecular_energy = m.eval_intramolecular(prec,
             authentic_v, out_cont[0].c);


expire read cache as well (same time out as write cache)

--- src/disk_io_thread.cpp
+++ src/disk_io_thread.cpp
@@ -231,16 +231,31 @@
 		mutex_t::scoped_lock l(m_piece_mutex);

 		INVARIANT_CHECK;
+		// flush write cache
 		for (;;)
 		{
 			cache_t::iterator i = std::min_element(
 				m_pieces.begin(), m_pieces.end()
 				, bind(&cached_piece_entry::last_use, _1)
 				< bind(&cached_piece_entry::last_use, _2));
-			if (i == m_pieces.end()) return;
+			if (i == m_pieces.end()) break;
 			int age = total_seconds(now - i->last_use);
-			if (age < m_cache_expiry) return;
+			if (age < m_cache_expiry) break;
 			flush_and_remove(i, l);
+		}
+
+		// flush read cache
+		for (;;)
+		{
+			cache_t::iterator i = std::min_element(
+				m_read_pieces.begin(), m_read_pieces.end()
+				, bind(&cached_piece_entry::last_use, _1)
+				< bind(&cached_piece_entry::last_use, _2));
+			if (i == m_read_pieces.end()) break;
+			int age = total_seconds(now - i->last_use);
+			if (age < m_cache_expiry) break;
+			free_piece(*i, l);
+			m_read_pieces.erase(i);
 		}
 	}


COMP: fixed compiler error with Qt 4.5

COMP: fixed compiler error with Qt 4.5

--- GUISupport/Qt/Chart/vtkQtChartSeriesOptions.cxx
+++ GUISupport/Qt/Chart/vtkQtChartSeriesOptions.cxx
@@ -129,7 +129,7 @@
   this->Defaults[VISIBLE] = true;
   this->Defaults[PEN] = QPen(Qt::red);
   this->Defaults[BRUSH] = QBrush(Qt::red);
-  this->Defaults[COLORS]= (vtkQtChartSeriesColors*)NULL;
+  this->Defaults[COLORS]= 0;
   this->Defaults[AXES_CORNER] = vtkQtChartLayer::BottomLeft;
   this->Defaults[MARKER_STYLE] = vtkQtPointMarker::NoMarker;
   this->Defaults[MARKER_SIZE] = QSizeF(5, 5);


add copyright

add copyright

--- rabbit.hpp
+++ rabbit.hpp
@@ -1,3 +1,23 @@
+// The MIT License (MIT)
+//
+// Copyright (c) 2013-2014 mashiro
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of
+// this software and associated documentation files (the "Software"), to deal in
+// the Software without restriction, including without limitation the rights to
+// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+// the Software, and to permit persons to whom the Software is furnished to do so,
+// subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #ifndef RABBIT_HPP_INCLUDED
 #define RABBIT_HPP_INCLUDED


either fizes or circumvents Krazy issue 16 on kdesdk.

svn path=/trunk/KDE/kdesdk/kate/; revision=700641

--- kate/plugins/xmltools/plugin_katexmltools.cpp
+++ kate/plugins/xmltools/plugin_katexmltools.cpp
@@ -262,7 +262,7 @@

 void PluginKateXMLTools::emptyKeyEvent()
 {
-  keyEvent( 0, 0, QString::null );
+  keyEvent( 0, 0, QString::null );	//krazy:exclude=nullstrassign for old broken gcc
 }

 void PluginKateXMLTools::keyEvent( int, int, const QString &/*s*/ )
@@ -953,7 +953,7 @@
     {
       do
       {
-        if( !line-- ) return QString::null; // reached start of document
+        if( !line-- ) return QString(); // reached start of document
         str = kv.document()->line(line );
         col = str.length();
       } while( !col );
@@ -973,7 +973,7 @@
         {
           case '<':
             // hmm... we were actually inside an element
-            return QString::null;
+            return QString();

           case '>':
             // we just hit an element boundary
@@ -1161,7 +1161,7 @@
   if( exec() )
     return combo->currentText();

-  return QString::null;
+  return QString();
 }
 //END InsertElement dialog
 // kate: space-indent on; indent-width 2; replace-tabs on; mixed-indent off;


Random: デフォルトの値範囲を1種類に固定

Random: デフォルトの値範囲を1種類に固定

--- random.hpp
+++ random.hpp
@@ -17,14 +17,12 @@
 			template <class T>
 			struct Dist_Int {
 				using uniform_t = std::uniform_int_distribution<T>;
-				constexpr static Range<T> DefaultRange{Lim<T>::lowest(), Lim<T>::max()},
-												NumericRange = DefaultRange;
+				constexpr static Range<T> NumericRange{Lim<T>::lowest(), Lim<T>::max()};
 			};
 			template <class T>
 			struct Dist_Float  {
 				using uniform_t = std::uniform_real_distribution<T>;
-				constexpr static Range<T> DefaultRange{T(0), T(1)},
-												NumericRange{Lim<T>::lowest()/2, Lim<T>::max()/2};
+				constexpr static Range<T> NumericRange{Lim<T>::lowest()/2, Lim<T>::max()/2};
 			};
 			template <class T, ENABLE_IF((std::is_integral<T>{}))>
 			static Dist_Int<T> DetectDist();
@@ -70,17 +68,9 @@
 				return _mt;
 			}
 			//! 一様分布
-			/*! floating-pointの場合は0から1の乱数
-				integerの場合は範囲指定なしnumeric_limits<T>::min() -> max()の乱数 */
+			/*! 範囲がnumeric_limits<T>::lowest() -> max()の乱数 */
 			template <class T>
 			T getUniform() {
-				constexpr auto R = Dist_t<T>::DefaultRange;
-				return getUniform<T>(R);
-			}
-			//! 一様分布
-			/*! 数値として取り得る値の範囲 */
-			template <class T>
-			T getUniformNR() {
 				constexpr auto R = Dist_t<T>::NumericRange;
 				return getUniform<T>(R);
 			}
@@ -97,7 +87,7 @@
 			//! 一様分布を返すファンクタを作成
 			template <class T>
 			auto getUniformF() noexcept {
-				constexpr auto R = Dist_t<T>::DefaultRange;
+				constexpr auto R = Dist_t<T>::NumericRange;
 				return RObj<T>(*this, R);
 			}
 			//! 指定範囲の一様分布(vmax)