Added checks for wait set entities

Added checks for wait set entities

--- rcl_action/test/rcl_action/test_action_communication.cpp
+++ rcl_action/test/rcl_action/test_action_communication.cpp
@@ -301,6 +301,10 @@
   EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
   rcl_reset_error();

+  EXPECT_TRUE(this->is_cancel_request_ready);
+  EXPECT_FALSE(this->is_goal_request_ready);
+  EXPECT_FALSE(this->is_result_request_ready);
+
   // Take cancel request with valid arguments
   rmw_request_id_t request_header;
   ret = rcl_action_take_cancel_request(
@@ -350,6 +354,12 @@
     &this->is_result_response_ready);
   EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
   rcl_reset_error();
+
+  EXPECT_TRUE(this->is_cancel_response_ready);
+  EXPECT_FALSE(this->is_feedback_ready);
+  EXPECT_FALSE(this->is_status_ready);
+  EXPECT_FALSE(this->is_goal_response_ready);
+  EXPECT_FALSE(this->is_result_response_ready);

   // Take cancel response with valid arguments
   ret = rcl_action_take_cancel_response(
@@ -411,6 +421,10 @@
   EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
   rcl_reset_error();

+  EXPECT_TRUE(this->is_result_request_ready);
+  EXPECT_FALSE(this->is_cancel_request_ready);
+  EXPECT_FALSE(this->is_goal_request_ready);
+
   // Take result request with valid arguments
   rmw_request_id_t request_header;
   ret = rcl_action_take_result_request(
@@ -454,28 +468,11 @@
   EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
   rcl_reset_error();

-  // Send result response with invalid action client
-  rcl_action_server_t invalid_action_server = rcl_action_get_zero_initialized_server();
-  ret = rcl_action_send_result_response(
-    &invalid_action_server, &request_header, &outgoing_result_response);
-  EXPECT_EQ(ret, RCL_RET_ACTION_SERVER_INVALID) << rcl_get_error_string().str;
-  rcl_reset_error();
-
-  // Send result response with null header
-  ret = rcl_action_send_result_response(&this->action_server, nullptr, &outgoing_result_response);
-  EXPECT_EQ(ret, RCL_RET_INVALID_ARGUMENT) << rcl_get_error_string().str;
-  rcl_reset_error();
-
-  // Send result response with null message
-  ret = rcl_action_send_result_response(&this->action_server, &request_header, nullptr);
-  EXPECT_EQ(ret, RCL_RET_INVALID_ARGUMENT) << rcl_get_error_string().str;
-  rcl_reset_error();
-
-  // Send result response with valid arguments
-  ret = rcl_action_send_result_response(
-    &this->action_server, &request_header, &outgoing_result_response);
-  EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
-  rcl_reset_error();
+  EXPECT_TRUE(this->is_result_response_ready);
+  EXPECT_FALSE(this->is_cancel_response_ready);
+  EXPECT_FALSE(this->is_feedback_ready);
+  EXPECT_FALSE(this->is_status_ready);
+  EXPECT_FALSE(this->is_goal_response_ready);

   // Take result response with valid arguments
   ret = rcl_action_take_result_response(
@@ -538,6 +535,12 @@
     &this->is_result_response_ready);
   EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
   rcl_reset_error();
+
+  EXPECT_TRUE(this->is_status_ready);
+  EXPECT_FALSE(this->is_result_response_ready);
+  EXPECT_FALSE(this->is_cancel_response_ready);
+  EXPECT_FALSE(this->is_feedback_ready);
+  EXPECT_FALSE(this->is_goal_response_ready);

   // Take status with valid arguments (one goal in array)
   ret = rcl_action_take_status(&this->action_client, &incoming_status_array);
@@ -598,6 +601,12 @@
   EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;
   rcl_reset_error();

+  EXPECT_TRUE(this->is_feedback_ready);
+  EXPECT_FALSE(this->is_status_ready);
+  EXPECT_FALSE(this->is_result_response_ready);
+  EXPECT_FALSE(this->is_cancel_response_ready);
+  EXPECT_FALSE(this->is_goal_response_ready);
+
   // Take feedback with valid arguments
   ret = rcl_action_take_feedback(&this->action_client, &incoming_feedback);
   EXPECT_EQ(ret, RCL_RET_OK) << rcl_get_error_string().str;


updated Variant to have a default constructor

--- inc/tetra/meta/Variant.hpp
+++ inc/tetra/meta/Variant.hpp
@@ -32,6 +32,12 @@
   void* pObj{nullptr};

 public:
+  /**
+   * Creates an empty variant that always throws a TypeCastException
+   * when getObject is called.
+   **/
+  Variant() = default;
+
   /**
    * Creates a new Variant which holds an instance of the class
    * that the provided MetaData describes.


Mark TestAboutViewChromeAccObj as FAILS.

BUG=44486
TEST=None

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

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

--- chrome/browser/views/browser_views_accessibility_browsertest.cc
+++ chrome/browser/views/browser_views_accessibility_browsertest.cc
@@ -273,8 +273,9 @@
                               ROLE_SYSTEM_TOOLBAR);
 }

-IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest,
-                       TestAboutChromeViewAccObj) {
+// Fails, http://crbug.com/44486.
+IN_PROC_BROWSER_TEST_F(BrowserViewsAccessibilityTest,
+                       FAILS_TestAboutChromeViewAccObj) {
   //  Firstly, test that the WindowDelegate got updated.
   views::Window* aboutChromeWindow = GetBrowserView()->ShowAboutChromeDialog();
   EXPECT_STREQ(aboutChromeWindow->GetDelegate()->GetWindowTitle().c_str(),


Fix typo in file name - wrong fire file.

--- src/assembler/RunGrid.cpp
+++ src/assembler/RunGrid.cpp
@@ -136,7 +136,7 @@
     return -4;
   }

-  grid.gd.g_fire_from_file(md->grdinputdir + "fire.nc", gfirerecno);
+  grid.gd.g_fire_from_file(md->grdinputdir + "firestatistics.nc", gfirerecno);

   //
   grid.reinit();          //checking grid data


Embed unicode literals the correct way

Embed unicode literals the correct way

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

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

Former-commit-id: 95c379fa8719e8a4da92484fb9289f1858f0f917

--- chrome/test/live_sync/two_client_live_autofill_sync_unittest.cc
+++ chrome/test/live_sync/two_client_live_autofill_sync_unittest.cc
@@ -9,6 +9,7 @@
 #include "base/ref_counted.h"
 #include "base/string16.h"
 #include "base/string_util.h"
+#include "base/utf_string_conversions.h"
 #include "base/waitable_event.h"
 #include "chrome/browser/browser.h"
 #include "chrome/browser/pref_service.h"
@@ -201,7 +202,8 @@
   keys.insert(AutofillKey("name1", "value1"));
   keys.insert(AutofillKey("name1", "value2"));
   keys.insert(AutofillKey("name2", "value3"));
-  keys.insert(AutofillKey("Sigur R\u00F3s", "\u00C1g\u00E6tis byrjun"));
+  keys.insert(AutofillKey(WideToUTF16(L"Sigur R\u00F3s"),
+                          WideToUTF16(L"\u00C1g\u00E6tis byrjun")));
   AddToWds(wds1_, keys);

   SetupSync();


Refactoring

Refactoring

--- include/S2LoadBalancer.hpp
+++ include/S2LoadBalancer.hpp
@@ -22,7 +22,7 @@
 public:
   S2LoadBalancer(maxint_t x, int64_t y, int64_t z, int64_t threads);
   S2LoadBalancer(maxint_t x, int64_t y, int64_t z, int64_t threads, double rsd);
-  void init(maxint_t x, int64_t y, int64_t z, int64_t threads, double rsd);
+  void init(int64_t threads);
   int64_t get_min_segment_size() const;
   double get_rsd() const;
   void update(int64_t low,
@@ -45,8 +45,8 @@
   double min_seconds_;
   double decrease_dividend_;
   int64_t min_size_;
+  int64_t count_;
   int64_t sqrtz_;
-  int64_t count_;
   int64_t smallest_hard_leaf_;
 };


Use a single UID for each _ABC_TRACE_SCOPE_IMPL()

--- include/abaclade/trace.hxx
+++ include/abaclade/trace.hxx
@@ -90,17 +90,18 @@
    Arguments or variables to trace.
 */
 #define ABC_TRACE_FUNC(...) \
-   _ABC_TRACE_SCOPE_IMPL( \
-      ABC_CPP_APPEND_UID(_scope_trace_), ABC_CPP_APPEND_UID(_scope_trace_tuple_), \
-      ABC_CPP_APPEND_UID(_scope_trace_source_location_), __VA_ARGS__ \
-   )
+   _ABC_TRACE_SCOPE_IMPL(ABC_CPP_APPEND_UID(__scope_trace_), __VA_ARGS__)

-/*! @cond
-Implementation of ABC_TRACE_FUNC() and similar macros. */
-#define _ABC_TRACE_SCOPE_IMPL(st, tuple, srcloc, ...) \
-   static ::abc::detail::scope_trace_source_location const srcloc = { \
+/*! Implementation of ABC_TRACE_FUNC() and similar macros.
+
+@param uid
+   Unique ID for this scope trace.
+@param ...
+   Arguments or variables to trace.
+*/
+#define _ABC_TRACE_SCOPE_IMPL(uid, ...) \
+   static ::abc::detail::scope_trace_source_location const ABC_CPP_CAT(uid, _srcloc) = { \
       ABC_THIS_FUNC, ABC_SL(__FILE__), __LINE__ \
    }; \
-   auto tuple(::abc::detail::scope_trace_tuple::make(__VA_ARGS__)); \
-   ::abc::detail::scope_trace st(&srcloc, &tuple)
-//! @endcond
+   auto ABC_CPP_CAT(uid, _tuple)(::abc::detail::scope_trace_tuple::make(__VA_ARGS__)); \
+   ::abc::detail::scope_trace uid(&ABC_CPP_CAT(uid, _srcloc), &ABC_CPP_CAT(uid, _tuple))


Comment class 'variable' 	modified:   include/api_info_types.hpp

--- include/api_info_types.hpp
+++ include/api_info_types.hpp
@@ -296,10 +296,14 @@
         member_variable_iterator;

 public:
+    // default constructor, constructs an empty variable of type index 0
+    // corresponding to a type of 'void'
     variable() : value_(), type_index_(0), manager_(nullptr)
     {
     }

+    // full constructor, typically invoked by reflection_manager or
+    // static_create function template
     variable(const any& value,
              std::size_t type_index,
              const reflection_manager* manager)
@@ -309,14 +313,20 @@

 public:
+    // returns the type of the value held by the variable
     type_ type() const;

+    // returns pair of iterators to all member functions of the type of value
+    // held by variable
     std::pair<member_function_iterator, member_function_iterator>
     member_functions() const;

+    // returns pair of iterators to all member variables of the type of value
+    // held by the variable
     std::pair<member_variable_iterator, member_variable_iterator>
     member_variables() const;

+    // return value of member variable represented by mv
     variable
     get_member_variable(const member_variable& mv) const
     {
@@ -325,6 +335,8 @@
         return variable(bind_point(value_), mv.info_->type_index, manager_);
     }

+    // overload returns member variable represented by mv_it, an iterator to a
+    // member_variable
     variable
     get_member_variable(member_variable_iterator mv_it) const
     {


crash bug fix

crash bug fix

--- code/spec_objs_ballot_box.cc
+++ code/spec_objs_ballot_box.cc
@@ -8,9 +8,9 @@
 int ballotBox(TBeing *ch, cmdTypeT cmd, const char *argument, TObj *o, TObj *)
 {
   TDatabase db(DB_SNEEZY);
-  sstring arg=argument;

   if(cmd==CMD_LIST){
+    sstring arg=argument;
     if(arg.empty()){
       /////////// list all polls
       ch->sendTo(COLOR_BASIC, fmt("You have a look at %s...\n\r") %
@@ -73,6 +73,7 @@
     }
     return true;
   } else if(cmd==CMD_VOTE){
+    sstring arg=argument;
     sstring usage="Usage: vote <poll_id> <option_id>";
     int poll_id, option_id;
     sstring tmp;


fixed build error in RawlogViewer caused by last commit.

--- apps/RawLogViewer/CFormRawMap.cpp
+++ apps/RawLogViewer/CFormRawMap.cpp
@@ -1050,7 +1050,7 @@
 				p.yaw(),p.pitch(),p.roll());

 			// The uncertainty, if available:
-			std::map<mrpt::system::TTimeStamp, mrpt::math::CMatrixDouble66 >::const_iterator Wit = rtk_path_info.vehicle_uncertainty.find(i->first);
+			mrpt::aligned_containers<mrpt::system::TTimeStamp, mrpt::math::CMatrixDouble66 >::map_t::const_iterator Wit = rtk_path_info.vehicle_uncertainty.find(i->first);
 			if (Wit!=rtk_path_info.vehicle_uncertainty.end())
 			{
 				const CMatrixDouble66 &C = Wit->second;


Made the setting of default glNormal and glColor values an compile
option via #ifdef USE_DEFAULT_NORMAL and USE_DEFAULT_COLOR defines respectively.

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@1513 16af8721-9629-0410-8352-f15c8da7e697

--- src/osg/Geometry.cpp
+++ src/osg/Geometry.cpp
@@ -493,9 +493,14 @@
     unsigned int secondaryColorIndex = 0;
     unsigned int fogCoordIndex = 0;

+#if USE_DEFAULT_NORMAL
     // if no values are defined for normal and color provide some defaults...
     if (_normalBinding==BIND_OFF) glNormal3f(0.0f,0.0f,1.0f);
+#endif
+
+#if ISE_DEFAULT_COLOUR
     if (_colorBinding==BIND_OFF) glColor4f(1.0f,1.0f,1.0f,1.0f);
+#endif

     if (areFastPathsUsed())
     {


Fixed bug in dispatching per primitive attributes

--- src/osg/Geometry.cpp
+++ src/osg/Geometry.cpp
@@ -993,8 +993,8 @@

     state.applyDisablingOfVertexAttributes();

-    bool bindPerPrimtiveSetActive = arrayDispatchers.active(BIND_PER_PRIMITIVE_SET);
-    bool bindPerPrimtiveActive = arrayDispatchers.active(BIND_PER_PRIMITIVE);
+    bool bindPerPrimitiveSetActive = arrayDispatchers.active(BIND_PER_PRIMITIVE_SET);
+    bool bindPerPrimitiveActive = arrayDispatchers.active(BIND_PER_PRIMITIVE);

     unsigned int primitiveNum = 0;

@@ -1006,7 +1006,7 @@
     {

         // dispatch any attributes that are bound per primitive
-        if (bindPerPrimtiveSetActive) arrayDispatchers.dispatch(BIND_PER_PRIMITIVE_SET, primitiveSetNum);
+        if (bindPerPrimitiveSetActive) arrayDispatchers.dispatch(BIND_PER_PRIMITIVE_SET, primitiveSetNum);

         const PrimitiveSet* primitiveset = _primitives[primitiveSetNum].get();

@@ -1045,9 +1045,9 @@
                         vindex<indexEnd;
                         ++vindex,++primCount)
                     {
-                        if (bindPerPrimtiveActive && (primCount%primLength)==0)
+                        if (bindPerPrimitiveActive && (primCount%primLength)==0)
                         {
-                            arrayDispatchers.dispatch(BIND_PER_PRIMITIVE,++primitiveNum);
+                            arrayDispatchers.dispatch(BIND_PER_PRIMITIVE,primitiveNum++);
                         }

                         arrayDispatchers.dispatch(BIND_PER_VERTEX, vindex);
@@ -1074,9 +1074,9 @@
                             primCount<*primItr;
                             ++vindex,++primCount)
                         {
-                            if (bindPerPrimtiveActive && (primCount%localPrimLength)==0)
+                            if (bindPerPrimitiveActive && (primCount%localPrimLength)==0)
                             {
-                                arrayDispatchers.dispatch(BIND_PER_PRIMITIVE, ++primitiveNum);
+                                arrayDispatchers.dispatch(BIND_PER_PRIMITIVE, primitiveNum++);
                             }
                             arrayDispatchers.dispatch(BIND_PER_VERTEX, vindex);
                         }
@@ -1099,9 +1099,9 @@
                         ++primCount,++primItr)
                     {

-                        if (bindPerPrimtiveActive && (primCount%primLength)==0)
+                        if (bindPerPrimitiveActive && (primCount%primLength)==0)
                         {
-                            arrayDispatchers.dispatch(BIND_PER_PRIMITIVE, ++primitiveNum);
+                            arrayDispatchers.dispatch(BIND_PER_PRIMITIVE, primitiveNum++);
                         }

                         unsigned int vindex=*primItr;
@@ -1123,9 +1123,9 @@
                         primItr!=drawElements->end();
                         ++primCount,++primItr)
                     {
-                        if (bindPerPrimtiveActive && (primCount%primLength)==0)
+                        if (bindPerPrimitiveActive && (primCount%primLength)==0)
                         {
-                            arrayDispatchers.dispatch(BIND_PER_PRIMITIVE, ++primitiveNum);
+                            arrayDispatchers.dispatch(BIND_PER_PRIMITIVE, primitiveNum++);
                         }

                         unsigned int vindex=*primItr;
@@ -1147,9 +1147,9 @@
                         primItr!=drawElements->end();
                         ++primCount,++primItr)
                     {
-                        if (bindPerPrimtiveActive && (primCount%primLength)==0)
+                        if (bindPerPrimitiveActive && (primCount%primLength)==0)
                         {
-                            arrayDispatchers.dispatch(BIND_PER_PRIMITIVE, ++primitiveNum);
+                            arrayDispatchers.dispatch(BIND_PER_PRIMITIVE, primitiveNum++);
                         }

                         unsigned int vindex=*primItr;


Handle zero byte rule files correctly.

Handle zero byte rule files correctly.

This corrects the stalling behaviour seen when trying to parse an empty
rule file.

Fixes: #1521

--- src/parser/driver.cc
+++ src/parser/driver.cc
@@ -132,6 +132,10 @@
         this->ref.push_back("<<reference missing or not informed>>");
     } else {
         this->ref.push_back(ref);
+    }
+
+    if (f.empty()) {
+        return 1;
     }

     buffer = f;


Only unwrap elements in VkDescriptorImageInfo that should be valid

* In particular for e.g. elements that don't require a sampler, the
  VkSampler may point to a random address if it's uninitialised, and we
  shouldn't try to access it at all.

--- renderdoc/driver/vulkan/wrappers/vk_descriptor_funcs.cpp
+++ renderdoc/driver/vulkan/wrappers/vk_descriptor_funcs.cpp
@@ -663,6 +663,11 @@
       VkBufferView *bufViews = (VkBufferView *)bufInfos;
       nextDescriptors += pDescriptorWrites[i].descriptorCount;

+      RDCCOMPILE_ASSERT(sizeof(VkDescriptorBufferInfo) >= sizeof(VkDescriptorImageInfo),
+                        "Structure sizes mean not enough space is allocated for write data");
+      RDCCOMPILE_ASSERT(sizeof(VkDescriptorBufferInfo) >= sizeof(VkBufferView),
+                        "Structure sizes mean not enough space is allocated for write data");
+
       // unwrap and assign the appropriate array
       if(pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER ||
          pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER)
@@ -677,11 +682,22 @@
               pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE ||
               pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT)
       {
+        bool hasSampler =
+            (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER ||
+             pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER);
+        bool hasImage =
+            (pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER ||
+             pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE ||
+             pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE ||
+             pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT);
+
         unwrappedWrites[i].pImageInfo = (VkDescriptorImageInfo *)bufInfos;
         for(uint32_t j = 0; j < pDescriptorWrites[i].descriptorCount; j++)
         {
-          imInfos[j].imageView = Unwrap(pDescriptorWrites[i].pImageInfo[j].imageView);
-          imInfos[j].sampler = Unwrap(pDescriptorWrites[i].pImageInfo[j].sampler);
+          if(hasImage)
+            imInfos[j].imageView = Unwrap(pDescriptorWrites[i].pImageInfo[j].imageView);
+          if(hasSampler)
+            imInfos[j].sampler = Unwrap(pDescriptorWrites[i].pImageInfo[j].sampler);
           imInfos[j].imageLayout = pDescriptorWrites[i].pImageInfo[j].imageLayout;
         }
       }


remove invalid assert

remove invalid assert

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

--- src/piece_picker.cpp
+++ src/piece_picker.cpp
@@ -2025,7 +2025,6 @@
 			int prio = p.priority(this);
 			TORRENT_ASSERT(prio < int(m_priority_boundries.size())
 				|| m_dirty);
-			TORRENT_ASSERT(prio >= 0);
 			p.downloading = 1;
 			if (prio >= 0 && !m_dirty) update(prio, p.index);


Create crash dump if a bad IPC message is received from a renderer.

This is a follow-up to https://crrev.com/1058423002 where the same logic was added for non-renderer child processes.

BUG=473370
TEST=revert 5922e15 then visit URL in crbug.com/472899 and check crash dump is produced.

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

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#324865}

--- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc
@@ -16,6 +16,7 @@
 #include "base/bind_helpers.h"
 #include "base/callback.h"
 #include "base/command_line.h"
+#include "base/debug/dump_without_crashing.h"
 #include "base/files/file.h"
 #include "base/lazy_instance.h"
 #include "base/logging.h"
@@ -1578,6 +1579,11 @@
   LOG(ERROR) << "bad message " << message.type() << " terminating renderer.";
   BrowserChildProcessHostImpl::HistogramBadMessageTerminated(
       PROCESS_TYPE_RENDERER);
+
+  // Create a memory dump. This will contain enough stack frames to work out
+  // what the bad message was.
+  base::debug::DumpWithoutCrashing();
+
   bad_message::ReceivedBadMessage(this,
                                   bad_message::RPH_DESERIALIZATION_FAILED);
 }


Fix pressure / tilt ranges on Linux.

Fix pressure / tilt ranges on Linux.

--- platform/x11/os_x11.cpp
+++ platform/x11/os_x11.cpp
@@ -669,14 +669,8 @@
 		int range_max_x = 0;
 		int range_max_y = 0;
 		int pressure_resolution = 0;
-		int pressure_min = 0;
-		int pressure_max = 0;
 		int tilt_resolution_x = 0;
 		int tilt_resolution_y = 0;
-		int tilt_range_min_x = 0;
-		int tilt_range_min_y = 0;
-		int tilt_range_max_x = 0;
-		int tilt_range_max_y = 0;
 		for (int j = 0; j < dev->num_classes; j++) {
 #ifdef TOUCH_ENABLED
 			if (dev->classes[j]->type == XITouchClass && ((XITouchClassInfo *)dev->classes[j])->mode == XIDirectTouch) {
@@ -697,17 +691,14 @@
 					range_max_y = class_info->max;
 					absolute_mode = true;
 				} else if (class_info->number == VALUATOR_PRESSURE && class_info->mode == XIModeAbsolute) {
-					pressure_resolution = class_info->resolution;
-					pressure_min = class_info->min;
-					pressure_max = class_info->max;
+					pressure_resolution = (class_info->max - class_info->min);
+					if (pressure_resolution == 0) pressure_resolution = 1;
 				} else if (class_info->number == VALUATOR_TILTX && class_info->mode == XIModeAbsolute) {
-					tilt_resolution_x = class_info->resolution;
-					tilt_range_min_x = class_info->min;
-					tilt_range_max_x = class_info->max;
+					tilt_resolution_x = (class_info->max - class_info->min);
+					if (tilt_resolution_x == 0) tilt_resolution_x = 1;
 				} else if (class_info->number == VALUATOR_TILTY && class_info->mode == XIModeAbsolute) {
-					tilt_resolution_y = class_info->resolution;
-					tilt_range_min_y = class_info->min;
-					tilt_range_max_y = class_info->max;
+					tilt_resolution_y = (class_info->max - class_info->min);
+					if (tilt_resolution_y == 0) tilt_resolution_y = 1;
 				}
 			}
 		}
@@ -728,15 +719,6 @@
 			print_verbose("XInput: Absolute pointing device: " + String(dev->name));
 		}

-		if (pressure_resolution <= 0) {
-			pressure_resolution = (pressure_max - pressure_min);
-		}
-		if (tilt_resolution_x <= 0) {
-			tilt_resolution_x = (tilt_range_max_x - tilt_range_min_x);
-		}
-		if (tilt_resolution_y <= 0) {
-			tilt_resolution_y = (tilt_range_max_y - tilt_range_min_y);
-		}
 		xi.pressure = 0;
 		xi.pen_devices[dev->deviceid] = Vector3(pressure_resolution, tilt_resolution_x, tilt_resolution_y);
 	}


add inline to select8

add inline to select8

--- include/cybozu/select8.hpp
+++ include/cybozu/select8.hpp
@@ -11,7 +11,7 @@

 namespace cybozu { namespace select8_util {

-uint8_t select8(uint64_t v, size_t x)
+inline uint8_t select8(uint64_t v, size_t x)
 {
 	assert(v < 256);
 	assert(x < 8);


Add note that cv::cuda::Stream class is not thread safe

--- modules/core/include/opencv2/core/cuda.hpp
+++ modules/core/include/opencv2/core/cuda.hpp
@@ -447,7 +447,26 @@
 functions use the constant GPU memory, and next call may update the memory before the previous one
 has been finished. But calling different operations asynchronously is safe because each operation
 has its own constant buffer. Memory copy/upload/download/set operations to the buffers you hold are
-also safe. :
+also safe.
+
+@note The Stream class is not thread-safe. Please use different Stream objects for different CPU threads.
+
+@code
+void thread1()
+{
+    cv::cuda::Stream stream1;
+    cv::cuda::func1(..., stream1);
+}
+
+void thread2()
+{
+    cv::cuda::Stream stream2;
+    cv::cuda::func2(..., stream2);
+}
+@endcode
+
+@note By default all CUDA routines are launched in Stream::Null() object, if the stream is not specified by user.
+In multi-threading environment the stream objects must be passed explicitly (see previous note).
  */
 class CV_EXPORTS Stream
 {


refs #104, performance related refactoring

--- include/ghc/filesystem.hpp
+++ include/ghc/filesystem.hpp
@@ -2226,12 +2226,12 @@
     if (result == 0) {
         ec.clear();
         file_status fs = detail::file_status_from_st_mode(st.st_mode);
+        if (sls) {
+            *sls = fs;
+        }
         if (fs.type() == file_type::symlink) {
             result = ::stat(p.c_str(), &st);
             if (result == 0) {
-                if (sls) {
-                    *sls = fs;
-                }
                 fs = detail::file_status_from_st_mode(st.st_mode);
             }
         }
@@ -5487,7 +5487,7 @@
                 if (_entry) {
                     _current = _base;
                     _current.append_name(_entry->d_name);
-                    _dir_entry = directory_entry(_current, ec);
+                    _dir_entry.assign(_current, ec);
                     if (ec && (ec.value() == EACCES || ec.value() == EPERM) && (_options & directory_options::skip_permission_denied) == directory_options::skip_permission_denied) {
                         ec.clear();
                         skip = true;
@@ -5730,13 +5730,7 @@

 GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::increment(std::error_code& ec) noexcept
 {
-    auto status = (*this)->status(ec);
-    if (ec)
-        return *this;
-    auto symlink_status = (*this)->symlink_status(ec);
-    if (ec)
-        return *this;
-    if (recursion_pending() && is_directory(status) && (!is_symlink(symlink_status) || (options() & directory_options::follow_directory_symlink) != directory_options::none)) {
+    if (recursion_pending() && (*this)->is_directory() && (!(*this)->is_symlink() || (options() & directory_options::follow_directory_symlink) != directory_options::none)) {
         _impl->_dir_iter_stack.push(directory_iterator((*this)->path(), _impl->_options, ec));
     }
     else {


Include sys/types.h so that this will compile on FreeBSD.

git-svn-id: 769d22dfa2d22aad706b9a451492fb87c0735f19@5333 08b38cba-cd3b-11de-854e-f91c5b6e4272

--- modules/gadgeteer/test/aMotionStarTest.cpp
+++ modules/gadgeteer/test/aMotionStarTest.cpp
@@ -32,6 +32,7 @@

 #include <iostream>
 #include <iomanip>
+#include <sys/types.h>
 #include <Input/vjPosition/aMotionStar.h>


[bicycle routing] Test on correct default bicycle speed limit.

--- routing/routing_integration_tests/bicycle_route_test.cpp
+++ routing/routing_integration_tests/bicycle_route_test.cpp
@@ -27,3 +27,10 @@
       integration::GetBicycleComponents(), MercatorBounds::FromLatLon(55.44020, 37.77409), {0., 0.},
       MercatorBounds::FromLatLon(55.43972, 37.77254), 123.0);
 }
+
+UNIT_TEST(SwedenStockholmCyclewayPriority)
+{
+  integration::CalculateRouteAndTestRouteLength(
+      integration::GetBicycleComponents(), MercatorBounds::FromLatLon(59.33151, 18.09347), {0., 0.},
+      MercatorBounds::FromLatLon(59.33052, 18.09391), 113.0);
+}


fixed typo in gnuc demangle code

fixed typo in gnuc demangle code

--- Library/Sources/Stroika/Foundation/Debug/Demangle.cpp
+++ Library/Sources/Stroika/Foundation/Debug/Demangle.cpp
@@ -3,7 +3,7 @@
  */
 #include    "../StroikaPreComp.h"

-#if     defined (__GCC__)
+#if     defined (__GNUC__)
 #include    <cxxabi.h>
 #elif   qPlatform_Windows
 #include    <Windows.h>
@@ -34,7 +34,7 @@
  */
 Characters::String    Debug::Demangle (const Characters::String& originalName)
 {
-#if     defined (__GCC__)
+#if     defined (__GNUC__)
     int     status {};
     char*   realname = abi::__cxa_demangle (originalName.AsNarrowSDKString ().c_str (), 0, 0, &status);
     auto&&  cleanup = Execution::Finally ([&realname]() { if (realname != nullptr) { ::free (realname); } });


imgproc(test): refactor test_intersection.cpp

don't use legacy test API

--- modules/imgproc/test/test_intersection.cpp
+++ modules/imgproc/test/test_intersection.cpp
@@ -49,31 +49,18 @@

 #define ACCURACY 0.00001

-class CV_RotatedRectangleIntersectionTest: public cvtest::ArrayTest
-{
-public:
-
-protected:
-    void run (int);
-
-private:
-    void test1();
-    void test2();
-    void test3();
-    void test4();
-    void test5();
-    void test6();
-    void test7();
-    void test8();
-    void test9();
-    void test10();
-    void test11();
-    void test12();
-    void test13();
-    void test14();
-    void test15();
-    void test16();
-};
+// See pics/intersection.png for the scenarios we are testing
+
+// Test the following scenarios:
+// 1 - no intersection
+// 2 - partial intersection, rectangle translated
+// 3 - partial intersection, rectangle rotated 45 degree on the corner, forms a triangle intersection
+// 4 - full intersection, rectangles of same size directly on top of each other
+// 5 - partial intersection, rectangle on top rotated 45 degrees
+// 6 - partial intersection, rectangle on top of different size
+// 7 - full intersection, rectangle fully enclosed in the other
+// 8 - partial intersection, rectangle corner just touching. point contact
+// 9 - partial intersetion. rectangle side by side, line contact

 static void compare(const std::vector<Point2f>& test, const std::vector<Point2f>& target)
 {
@@ -82,45 +69,12 @@
     ASSERT_TRUE(target.size() < 4 || isContourConvex(target));
     for( size_t i = 0; i < test.size(); i++ )
     {
-        double dx = test[i].x - target[i].x;
-        double dy = test[i].y - target[i].y;
-        double r = sqrt(dx*dx + dy*dy);
+        double r = sqrt(normL2Sqr<double>(test[i] - target[i]));
         ASSERT_LT(r, ACCURACY);
     }
 }

-void CV_RotatedRectangleIntersectionTest::run(int)
-{
-    // See pics/intersection.png for the scenarios we are testing
-
-    // Test the following scenarios:
-    // 1 - no intersection
-    // 2 - partial intersection, rectangle translated
-    // 3 - partial intersection, rectangle rotated 45 degree on the corner, forms a triangle intersection
-    // 4 - full intersection, rectangles of same size directly on top of each other
-    // 5 - partial intersection, rectangle on top rotated 45 degrees
-    // 6 - partial intersection, rectangle on top of different size
-    // 7 - full intersection, rectangle fully enclosed in the other
-    // 8 - partial intersection, rectangle corner just touching. point contact
-    // 9 - partial intersetion. rectangle side by side, line contact
-
-    test1();
-    test2();
-    test3();
-    test4();
-    test5();
-    test6();
-    test7();
-    test8();
-    test9();
-    test10();
-    test11();
-    test12();
-    test13();
-    test14();
-}
-
-void CV_RotatedRectangleIntersectionTest::test1()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_1)
 {
     // no intersection
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 12.0f);
@@ -133,7 +87,7 @@
     CV_Assert(vertices.empty());
 }

-void CV_RotatedRectangleIntersectionTest::test2()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_2)
 {
     // partial intersection, rectangles translated
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 0.0f);
@@ -152,7 +106,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test3()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_3)
 {
     // partial intersection, rectangles rotated 45 degree on the corner, forms a triangle intersection
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 0.0f);
@@ -170,7 +124,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test4()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_4)
 {
     // full intersection, rectangles of same size directly on top of each other
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 0.0f);
@@ -189,7 +143,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test5()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_5)
 {
     // partial intersection, rectangle on top rotated 45 degrees
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 0.0f);
@@ -212,7 +166,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test6()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_6)
 {
     // 6 - partial intersection, rectangle on top of different size
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 0.0f);
@@ -231,7 +185,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test7()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_7)
 {
     // full intersection, rectangle fully enclosed in the other
     RotatedRect rect1(Point2f(0, 0), Size2f(12.34f, 56.78f), 0.0f);
@@ -250,7 +204,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test8()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_8)
 {
     // intersection by a single vertex
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 0.0f);
@@ -263,7 +217,7 @@
     compare(vertices, vector<Point2f>(1, Point2f(1.0f, 1.0f)));
 }

-void CV_RotatedRectangleIntersectionTest::test9()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_9)
 {
     // full intersection, rectangle fully enclosed in the other
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 0.0f);
@@ -280,7 +234,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test10()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_10)
 {
     // three points of rect2 are inside rect1.
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 0.0f);
@@ -300,7 +254,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test11()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_11)
 {
     RotatedRect rect1(Point2f(0, 0), Size2f(4, 2), 0.0f);
     RotatedRect rect2(Point2f(0, 0), Size2f(2, 2), -45.0f);
@@ -320,7 +274,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test12()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_12)
 {
     RotatedRect rect1(Point2f(0, 0), Size2f(2, 2), 0.0f);
     RotatedRect rect2(Point2f(0, 1), Size2f(1, 1), 0.0f);
@@ -338,7 +292,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test13()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_13)
 {
     RotatedRect rect1(Point2f(0, 0), Size2f(1, 3), 0.0f);
     RotatedRect rect2(Point2f(0, 1), Size2f(3, 1), 0.0f);
@@ -356,7 +310,7 @@
     compare(vertices, targetVertices);
 }

-void CV_RotatedRectangleIntersectionTest::test14()
+TEST(Imgproc_RotatedRectangleIntersection, accuracy_14)
 {
     const int kNumTests = 100;
     const float kWidth = 5;
@@ -412,6 +366,4 @@
     EXPECT_LE(intersections.size(), (size_t)8);
 }

-TEST (Imgproc_RotatedRectangleIntersection, accuracy) { CV_RotatedRectangleIntersectionTest test; test.safe_run(); }
-
 }} // namespace


[routing] Routing integration test fix for 200920: SwedenStockholmBicyclePastFerry.

--- routing/routing_integration_tests/bicycle_route_test.cpp
+++ routing/routing_integration_tests/bicycle_route_test.cpp
@@ -131,7 +131,7 @@
   CalculateRouteAndTestRouteLength(
       GetVehicleComponents(VehicleType::Bicycle),
       mercator::FromLatLon(59.4725, 18.51355), {0.0, 0.0},
-      mercator::FromLatLon(59.32967, 18.075), 46163.7);
+      mercator::FromLatLon(59.42533, 18.35991), 14338.0);
 }

 // Test on cross mwm bicycle routing.


added http+tcp

added http+tcp

--- arangosh/Shell/ConsoleFeature.cpp
+++ arangosh/Shell/ConsoleFeature.cpp
@@ -469,11 +469,13 @@
         if (c == 'E') {
           // replace protocol
           if (ep.find("tcp://") == 0) {
-            ep = ep.substr(6);
+            ep = ep.substr(strlen("tcp://"));
+          } else if (ep.find("http+tcp://") == 0) {
+            ep = ep.substr(strlen("http+tcp://"));
           } else if (ep.find("ssl://") == 0) {
-            ep = ep.substr(6);
+            ep = ep.substr(strlen("ssl://"));
           } else if (ep.find("unix://") == 0) {
-            ep = ep.substr(7);
+            ep = ep.substr(strlen("unix://"));
           }
         }


planning: disable align_prediction_time to allow rosbag replay works for planning.

--- modules/planning/common/planning_gflags.cc
+++ modules/planning/common/planning_gflags.cc
@@ -128,7 +128,7 @@

 // Prediction Part
 DEFINE_double(prediction_total_time, 5.0, "Total prediction time");
-DEFINE_bool(align_prediction_time, true,
+DEFINE_bool(align_prediction_time, false,
             "enable align prediction data based planning time");

 // Trajectory


chore(common): stub out tests to prevent build errors

--- common/core/desktop/tests/unit/rust_mock/state_api.cpp
+++ common/core/desktop/tests/unit/rust_mock/state_api.cpp
@@ -164,6 +164,11 @@

   try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_S,
                                   KM_KBP_MODIFIER_SHIFT));
+
+  //TEMP
+  action_items(test_state, {{KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('S')}}});
+  auto doc1 = get_json_doc(*test_state);
+  std::cout << doc1 << std::endl;
 #if 0
   // TODO: enable these tests once we have the data propagating to Rust
   assert(action_items(test_state, {{KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('S')}}}));


removed return on loss

removed return on loss

--- rtbkit/plugins/bidder_interface/http_bidder_interface.cc
+++ rtbkit/plugins/bidder_interface/http_bidder_interface.cc
@@ -397,7 +397,6 @@
 void HttpBidderInterface::sendWinLossMessage(
         const std::shared_ptr<const AgentConfig>& agentConfig,
         MatchedWinLoss const & event) {
-    if (event.type == MatchedWinLoss::Loss) return;

     auto callbacks = std::make_shared<HttpClientSimpleCallbacks>(
         [=](const HttpRequest &, HttpClientError errorCode,
@@ -453,7 +452,6 @@
     HttpRequest::Content reqContent { content, "application/json" };
     httpClientAdserverWins->post(adserverWinPath, callbacks, reqContent,
                          { } /* queryParams */);
-
 }


declare feature_impl and context_type for windows symbol visibility

--- include/mapnik/feature.hpp
+++ include/mapnik/feature.hpp
@@ -24,6 +24,7 @@
 #define MAPNIK_FEATURE_HPP

 // mapnik
+#include <mapnik/config.hpp>
 #include <mapnik/value.hpp>
 #include <mapnik/geometry.hpp>
 #include <mapnik/raster.hpp>
@@ -84,10 +85,10 @@
     map_type mapping_;
 };

-typedef context<std::map<std::string,std::size_t> > context_type;
-typedef boost::shared_ptr<context_type> context_ptr;
-
-class feature_impl : private boost::noncopyable
+typedef MAPNIK_DECL context<std::map<std::string,std::size_t> > context_type;
+typedef MAPNIK_DECL boost::shared_ptr<context_type> context_ptr;
+
+class MAPNIK_DECL feature_impl : private boost::noncopyable
 {
     friend class feature_kv_iterator;
 public:


change assertion on max_cluster_size, as current simulations cannot handle clusters of 1

--- simulation.cpp
+++ simulation.cpp
@@ -118,7 +118,7 @@
   assert(!(using_input_lattice && set_cell_radius));
   assert(!(using_input_lattice && set_c13_abundance));

-  assert(max_cluster_size > 0);
+  assert(max_cluster_size > 1);
   assert(ms == 1 || ms == -1);
   assert(static_B_norm_in_gauss >= 0);


fix(volume): Do not require speaker/headphone for events

Closes jaagr/lemonbuddy#96

--- include/modules/volume.hpp
+++ include/modules/volume.hpp
@@ -21,12 +21,12 @@
       auto speaker_mixer = m_conf.get<string>(name(), "speaker-mixer", "");
       auto headphone_mixer = m_conf.get<string>(name(), "headphone-mixer", "");

-      m_headphone_ctrl_numid = m_conf.get<int>(name(), "headphone-id", -1);
-
-      if (!headphone_mixer.empty() && m_headphone_ctrl_numid == -1)
+      m_headphone_id = m_conf.get<int>(name(), "headphone-id", -1);
+
+      if (!headphone_mixer.empty() && m_headphone_id == -1)
         throw module_error(
             "volume_module: Missing required property value for \"headphone-id\"...");
-      else if (headphone_mixer.empty() && m_headphone_ctrl_numid != -1)
+      else if (headphone_mixer.empty() && m_headphone_id != -1)
         throw module_error(
             "volume_module: Missing required property value for \"headphone-mixer\"...");

@@ -63,13 +63,14 @@
         m_headphone_mixer = create_mixer(m_log, headphone_mixer);

       if (!m_master_mixer && !m_speaker_mixer && !m_headphone_mixer) {
+        m_log.err("%s: No configured mixers, stopping module...", name());
         stop();
         return;
       }

-      if (m_headphone_mixer && m_headphone_ctrl_numid > -1) {
+      if (m_headphone_mixer && m_headphone_id > -1) {
         try {
-          m_headphone_ctrl = make_unique<alsa_ctl_interface>(m_headphone_ctrl_numid);
+          m_headphone_ctrl = make_unique<alsa_ctl_interface>(m_headphone_id);
         } catch (const alsa_ctl_interface_error& e) {
           m_log.err("%s: Failed to open headphone control interface => %s", name(), e.what());
           m_headphone_ctrl.reset();
@@ -228,8 +229,6 @@
         other_mixer = m_headphone_mixer.get();
       else if (m_speaker_mixer)
         other_mixer = m_speaker_mixer.get();
-      else
-        return false;

       if (cmd.compare(0, strlen(EVENT_TOGGLE_MUTE), EVENT_TOGGLE_MUTE) == 0) {
         master_mixer->set_mute(m_muted);
@@ -281,7 +280,7 @@
     unique_ptr<alsa_mixer> m_speaker_mixer;
     unique_ptr<alsa_mixer> m_headphone_mixer;
     unique_ptr<alsa_ctl_interface> m_headphone_ctrl;
-    int m_headphone_ctrl_numid = -1;
+    int m_headphone_id = -1;
     int m_volume = 0;

     stateflag m_muted{false};


added class-level documentation to state_ptr

--- include/putl/state_ptr.hpp
+++ include/putl/state_ptr.hpp
@@ -26,6 +26,20 @@
 		}
 	}

+	/// \brief A non-owning smart pointer that allows for storing an additional space-optimized
+	///        state along the pointer value that is dependend on the wrapped type's alignment.
+	///
+	/// Users can use custom state types (e.g. user-defined enums) as state type.
+	/// It is possible to further limit the representable state value, e.g. to adjust the state_ptr
+	/// to the state type dimensions. E.g. When there are just two possible states (enum Bit { set=0, unset=1, dontknow=2 };)
+	/// and the state_ptr for T allows for 3 state bits the user is still able to limit it to 2 bits.
+	///
+	/// Increasing the limit is not possible and will fail at compile-time!
+	///
+	/// The state_ptr interface is based on the interface that is provided by std::unique_ptr.
+	///
+	/// Note: It is planned to provide an implementation of an owning_state_ptr in the future.
+	///
 	template<typename T,
 	         typename S = uintptr_t,
 	         size_t req_state_bits = detail::log2(alignof(T))>


janitorial: readability

janitorial: readability

Change-Id: Iaab09826d79b0fbcd3104d33d1f159767a09921a


log http_client activity

log http_client activity

--- include/ten/http/client.hh
+++ include/ten/http/client.hh
@@ -66,6 +66,8 @@
     }

     http_response perform(http_request &r, std::chrono::milliseconds timeout = {}) {
+        VLOG(4) << "-> " << r.method << " " << _host << ":" << _port << " " << r.uri;
+
         if (r.body.size()) {
             r.set("Content-Length", r.body.size());
         }
@@ -119,6 +121,8 @@
             {
                 _sock.close();
             }
+
+            VLOG(4) << "<- " << resp.status_code << " [" << resp.body.size() << "]";
             return resp;
         } catch (errorx &e) {
             _sock.close();


fix: DCDReader reading flames

fix: DCDReader reading flames

--- includes/dcd/DCDReader.hpp
+++ includes/dcd/DCDReader.hpp
@@ -327,7 +327,7 @@
     {
         data.reserve(nset);

-        for(int i(0); i<=nset; ++i)
+        for(int i(0); i<nset; ++i)
         {
             std::vector<double> x(read_coord());
             std::vector<double> y(read_coord());


DCDWriter uses size_type

DCDWriter uses size_type

--- includes/dcd/DCDWriter.hpp
+++ includes/dcd/DCDWriter.hpp
@@ -10,14 +10,16 @@
         public:

             DCDWriter():header_written(false), header_set(false){}
+
             DCDWriter(const std::string& filename_)
                 :header_written(false), header_set(false),
-                 dcdfile(filename_, std::ios::out|std::ios::binary),
-                 filename(filename_)
+                 filename(filename_),
+                 dcdfile(filename_, std::ios::out|std::ios::binary)
             {
                 if(dcdfile.fail())
                     throw std::invalid_argument("file open error");
             }
+
             ~DCDWriter()
             {
                 dcdfile.close();
@@ -64,10 +66,10 @@
             int verCHARMM;
             int nparticle;// total number of particle
             double delta_t;
+            std::string filename;
+            std::ofstream dcdfile;
+            std::vector<std::string> header;
             std::vector<SnapShot> data;
-            std::ofstream dcdfile;
-            std::string filename;
-            std::vector<std::string> header;

         private:

@@ -106,7 +108,6 @@
         return;
     }

-
     void DCDWriter::write_SnapShot(SnapShot& snapshot)
     {
         if(!header_written)
@@ -116,12 +117,11 @@
         std::vector<double> y((snapshot).size());
         std::vector<double> z((snapshot).size());
         int counter(0);
-        for(SnapShot::iterator ssiter = (snapshot).begin();
-            ssiter != (snapshot).end(); ++ssiter)
-        {
-            x.at(counter) = (*ssiter)[0];
-            y.at(counter) = (*ssiter)[1];
-            z.at(counter) = (*ssiter)[2];
+        for(auto iter = (snapshot).begin(); iter != (snapshot).end(); ++iter)
+        {
+            x.at(counter) = (*iter)[0];
+            y.at(counter) = (*iter)[1];
+            z.at(counter) = (*iter)[2];
             ++counter;
         }
         write_coord(x);
@@ -176,55 +176,55 @@
     {
         int wrote(0);
         int bytes(84);
-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);

         char cord[5] = "CORD";
-        dcdfile.write(reinterpret_cast<char*>(&cord), sizeof(char)*4);
-        wrote += sizeof(char)*4;
-
-        dcdfile.write(reinterpret_cast<char*>(&nset), sizeof(int));
-        wrote += sizeof(int);
-
-        dcdfile.write(reinterpret_cast<char*>(&istart), sizeof(int));
-        wrote += sizeof(int);
-
-        dcdfile.write(reinterpret_cast<char*>(&nstep_save), sizeof(int));
-        wrote += sizeof(int);
-
-        dcdfile.write(reinterpret_cast<char*>(&nstep), sizeof(int));
-        wrote += sizeof(int);
-
-        dcdfile.write(reinterpret_cast<char*>(&nunit), sizeof(int));
-        wrote += sizeof(int);
+        dcdfile.write(reinterpret_cast<char*>(&cord), size_char*4);
+        wrote += size_char*4;
+
+        dcdfile.write(reinterpret_cast<char*>(&nset), size_int);
+        wrote += size_int;
+
+        dcdfile.write(reinterpret_cast<char*>(&istart), size_int);
+        wrote += size_int;
+
+        dcdfile.write(reinterpret_cast<char*>(&nstep_save), size_int);
+        wrote += size_int;
+
+        dcdfile.write(reinterpret_cast<char*>(&nstep), size_int);
+        wrote += size_int;
+
+        dcdfile.write(reinterpret_cast<char*>(&nunit), size_int);
+        wrote += size_int;

         // null data
         int fill_zero(0);
         for(int i(0); i<4; ++i)
         {
-            dcdfile.write(reinterpret_cast<char*>(&fill_zero), sizeof(int));
-            wrote += sizeof(int);
+            dcdfile.write(reinterpret_cast<char*>(&fill_zero), size_int);
+            wrote += size_int;
         }

         float dt(static_cast<float>(delta_t));
-        dcdfile.write(reinterpret_cast<char*>(&dt), sizeof(float));
-        wrote += sizeof(float);
+        dcdfile.write(reinterpret_cast<char*>(&dt), size_float);
+        wrote += size_float;

         // null data
         for(int i(0); i<9; ++i)
         {
-            dcdfile.write(reinterpret_cast<char*>(&fill_zero), sizeof(int));
-            wrote += sizeof(int);
-        }
-
-        dcdfile.write(reinterpret_cast<char*>(&verCHARMM), sizeof(int));
-        wrote += sizeof(int);
+            dcdfile.write(reinterpret_cast<char*>(&fill_zero), size_int);
+            wrote += size_int;
+        }
+
+        dcdfile.write(reinterpret_cast<char*>(&verCHARMM), size_int);
+        wrote += size_int;

         if(wrote != bytes)
         {
             throw std::invalid_argument("byte information error");
         }

-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);
         return;
     }

@@ -233,10 +233,10 @@
         int lines(4);
         int bytes(4 + 80*lines);
         int wrote(0);
-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
-
-        dcdfile.write(reinterpret_cast<char*>(&lines), sizeof(int));
-        wrote += sizeof(int);
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);
+
+        dcdfile.write(reinterpret_cast<char*>(&lines), size_int);
+        wrote += size_int;

         size_t filename_length(filename.size());
         std::string fileinfo;
@@ -265,19 +265,19 @@
         char line4[81];
         sprintf(line4, "%s", fileinfo.c_str());

-        dcdfile.write(reinterpret_cast<char*>(&line1), sizeof(char)*80);
-        wrote += sizeof(char)*80;
-        dcdfile.write(reinterpret_cast<char*>(&line2), sizeof(char)*80);
-        wrote += sizeof(char)*80;
-        dcdfile.write(reinterpret_cast<char*>(&line3), sizeof(char)*80);
-        wrote += sizeof(char)*80;
-        dcdfile.write(reinterpret_cast<char*>(&line4), sizeof(char)*80);
-        wrote += sizeof(char)*80;
+        dcdfile.write(reinterpret_cast<char*>(&line1), size_char*80);
+        wrote += size_char*80;
+        dcdfile.write(reinterpret_cast<char*>(&line2), size_char*80);
+        wrote += size_char*80;
+        dcdfile.write(reinterpret_cast<char*>(&line3), size_char*80);
+        wrote += size_char*80;
+        dcdfile.write(reinterpret_cast<char*>(&line4), size_char*80);
+        wrote += size_char*80;

         if(wrote != bytes)
             throw std::invalid_argument("byte information error");

-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);
         return;
     }

@@ -286,34 +286,32 @@
         int lines(header.size());
         int bytes(4 + 80*lines);
         int wrote(0);
-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
-
-        dcdfile.write(reinterpret_cast<char*>(&lines), sizeof(int));
-        wrote += sizeof(int);
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);
+
+        dcdfile.write(reinterpret_cast<char*>(&lines), size_int);
+        wrote += size_int;

         for(auto iter = header.begin(); iter != header.end(); ++iter)
         {
             char* line = new char[81];
             memcpy(line, (*iter).c_str(), 81);
-            dcdfile.write(reinterpret_cast<char*>(&line), sizeof(char)*80);
-            wrote += sizeof(char)*80;
+            dcdfile.write(reinterpret_cast<char*>(&line), size_char*80);
+            wrote += size_char*80;
         }

         if(wrote != bytes)
             throw std::invalid_argument("byte information error");

-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
-        return;
-    }
-
-
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);
+        return;
+    }

     void DCDWriter::write_head_block3()
     {
-        int bytes(sizeof(int));
-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
-        dcdfile.write(reinterpret_cast<char*>(&nparticle), sizeof(int));
-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
+        int bytes(size_int);
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);
+        dcdfile.write(reinterpret_cast<char*>(&nparticle), size_int);
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);
         return;
     }

@@ -329,17 +327,16 @@
     void DCDWriter::write_coord(std::vector<double>& coord)
     {
         int size(coord.size());
-        int bytes(size * sizeof(float));
-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
-
-        for(std::vector<double>::iterator iter = coord.begin();
-            iter != coord.end(); ++iter)
+        int bytes(size * size_float);
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);
+
+        for(auto iter = coord.begin(); iter != coord.end(); ++iter)
         {
             float temp(static_cast<float>(*iter));
-            dcdfile.write(reinterpret_cast<char*>(&temp), sizeof(float));
-        }
-
-        dcdfile.write(reinterpret_cast<char*>(&bytes), sizeof(int));
+            dcdfile.write(reinterpret_cast<char*>(&temp), size_float);
+        }
+
+        dcdfile.write(reinterpret_cast<char*>(&bytes), size_int);
         return;
     }


remove pointless re-setting of clear color every render

--- mandala/platform_win32.cpp
+++ mandala/platform_win32.cpp
@@ -298,8 +298,6 @@

 	void platform_win32_t::app_render_start()
 	{
-		gpu.set_clear_color(rgba_type(0));
-
         gpu.clear(gpu_t::clear_flag_color | gpu_t::clear_flag_depth);
 	}

@@ -315,7 +313,7 @@

     platform_t::screen_size_type platform_win32_t::get_screen_size() const
     {
-        platform_t::screen_size_type screen_size;
+        screen_size_type screen_size;

         glfwGetWindowSize(window_ptr, &screen_size.x, &screen_size.y);


fix build issue with statistics enabled

fix build issue with statistics enabled

--- src/session_impl.cpp
+++ src/session_impl.cpp
@@ -3164,7 +3164,7 @@
 			if (p->is_interesting()) ++peers_down_interesting;
 			if (p->send_buffer_size() > 100 || !p->upload_queue().empty())
 				++peers_up_requests;
-			if (p->endgame()) ++num_endgame_peers;
+			if (p->endgame()) ++num_end_game_peers;

 			int dl_bucket = 0;
 			int dl_rate = p->statistics().download_payload_rate();


cpp: Fix tests

cpp: Fix tests

1. Remove channelUrlProxyFindsProvisionedUrl and
   channelUrlProxyGetsCapabilitiesDirUrlRemotely test because no urls are
   provisioned
2. Use a smaller ttl for test
   callRpcMethodViaHttpCommunicationManagerAndReceiveReply

Change-Id: Ia91a999fa2e34dc041095954905ce89932a9c611

--- cpp/tests/systemintegration-tests/CombinedEnd2EndTest.cpp
+++ cpp/tests/systemintegration-tests/CombinedEnd2EndTest.cpp
@@ -332,7 +332,7 @@
         discoveryQos.setArbitrationStrategy(DiscoveryQos::ArbitrationStrategy::HIGHEST_PRIORITY);
         discoveryQos.setDiscoveryTimeout(1000);

-        qlonglong qosRoundTripTTL = 10;
+        qlonglong qosRoundTripTTL = 1;
         qlonglong qosCacheDataFreshnessMs = 400000;
         QSharedPointer<tests::TestProxy> testProxy(testProxyBuilder
                                                    ->setRuntimeQos(MessagingQos(qosRoundTripTTL))
@@ -742,7 +742,7 @@
 }

-TEST_F(CombinedEnd2EndTest, channelUrlProxyFindsProvisionedUrl) {
+TEST_F(CombinedEnd2EndTest, channelUrlProxyGetsNoUrlOnNonRegisteredChannel) {
     ProxyBuilder<infrastructure::ChannelUrlDirectoryProxy>* channelUrlDirectoryProxyBuilder
             = runtime1->getProxyBuilder<infrastructure::ChannelUrlDirectoryProxy>(
                 LocalChannelUrlDirectory::CHANNEL_URL_DIRECTORY_DOMAIN());
@@ -756,41 +756,12 @@
                 ->setDiscoveryQos(discoveryQos)
                 ->build();

-
-
     RequestStatus status;
     types::ChannelUrlInformation result;
-    QString channelId = LocalChannelUrlDirectory::CHANNEL_URL_DIRECTORY_CHANNELID();
+    QString channelId("test");
     channelUrlDirectoryProxy->getUrlsForChannel(status,result,channelId);
     EXPECT_TRUE(status.successful());
-    EXPECT_TRUE(result.getUrls().size() > 0);
-}
-
-
-TEST_F(CombinedEnd2EndTest, channelUrlProxyGetsCapabilitiesDirUrlRemotely) {
-    ProxyBuilder<infrastructure::ChannelUrlDirectoryProxy>* channelUrlDirectoryProxyBuilder
-            = runtime1->getProxyBuilder<infrastructure::ChannelUrlDirectoryProxy>(
-                LocalChannelUrlDirectory::CHANNEL_URL_DIRECTORY_DOMAIN());
-
-    DiscoveryQos discoveryQos;
-    discoveryQos.setArbitrationStrategy(DiscoveryQos::ArbitrationStrategy::HIGHEST_PRIORITY);
-    infrastructure::ChannelUrlDirectoryProxy* channelUrlDirectoryProxy
-            = channelUrlDirectoryProxyBuilder
-                ->setRuntimeQos(MessagingQos(20000))
-                ->setCached(true)
-                ->setDiscoveryQos(discoveryQos)
-                ->build();
-
-    RequestStatus status;
-    types::ChannelUrlInformation result;
-    QString channelId = LocalCapabilitiesDirectory::CAPABILITIES_DIRECTORY_CHANNELID();
-    channelUrlDirectoryProxy->getUrlsForChannel(status,result,channelId);
-    EXPECT_TRUE(status.successful()) << ( QString("Status was not successfull: ")
-                                          + status.getCode().toString()
-                                          + QString(" " )
-                                          + status.toString()
-                                          ).toStdString();
-    EXPECT_TRUE(result.getUrls().size() > 0);
+    EXPECT_EQ(result.getUrls().size(), 0);
 }

 TEST_F(CombinedEnd2EndTest, channelUrlProxyRegistersUrlsCorrectly) {


fix optimistic unchoke when there is no metadata

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

--- src/session_impl.cpp
+++ src/session_impl.cpp
@@ -1528,7 +1528,8 @@
 					&& !p->is_disconnecting()
 					&& p->is_peer_interested()
 					&& t->free_upload_slots()
-					&& p->is_choked())
+					&& p->is_choked()
+					&& t->valid_metadata())
 				{
 					last_unchoke = pi->last_optimistically_unchoked;
 					optimistic_unchoke_candidate = i;


Prevent height adjustment of TextLabel

Prevent height adjustment of TextLabel

Cursor position issue occurs when the text control is editable.
isEditable flag prevents wrong resizing in TextLabel.

Change-Id: I15eb8ec37bead595caaf600f9a1f7163c3c98bcd
Signed-off-by: Bowon Ryu <81ef83b0e730bb0994892ac8894b9df89cb62eed@samsung.com>

--- dali-toolkit/internal/text/text-controller-relayouter.cpp
+++ dali-toolkit/internal/text/text-controller-relayouter.cpp
@@ -651,7 +651,9 @@
     layoutSize.height = defaultFontLineHeight;
   }

-  if (layoutSize.height != defaultFontLineHeight)
+  // Whether the text control is editable
+  const bool isEditable = NULL != impl.mEventData;
+  if (isEditable && layoutSize.height != defaultFontLineHeight)
   {
     // This code prevents the wrong positioning of cursor when the layout size is bigger/smaller than defaultFontLineHeight.
     // This situation occurs when the size of placeholder text is different from the default text.


back ported simplification of stats logging code from aio branch

git-svn-id: c39a6fcb73c71bf990fd9353909696546eb40440@5704 a83610d8-ad2a-0410-a6ab-fc0612d85776

--- src/session_impl.cpp
+++ src/session_impl.cpp
@@ -3240,129 +3240,122 @@

 			int total_job_time = cs.cumulative_job_time == 0 ? 1 : cs.cumulative_job_time;

-			fprintf(m_stats_logger
-				, "%f\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
-				  "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
-				  "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
-				  "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
-				  "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
-				  "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t"
-				  "%f\t%f\t%f\t%f\t%f\t%f\t%d\t%d\t%d\t%d\t"
-				  "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%f\t%f\t%f\t"
-				  "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%f\t%f\t"
-				  "%f\t%f\t%d\t%f\t%d\t%f\t%f\t%d\t%d\t%d\t"
-				  "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%f\t%f\n"
-				, total_milliseconds(now - m_last_log_rotation) / 1000.f
-				, int(m_stat.total_upload() - m_last_uploaded)
-				, int(m_stat.total_download() - m_last_downloaded)
-				, downloading_torrents
-				, seeding_torrents
-				, num_complete_connections
-				, num_half_open
-				, m_disk_thread.disk_allocations()
-				, num_peers
-				, logging_allocator::allocations
-				, logging_allocator::allocated_bytes
-				, checking_torrents
-				, stopped_torrents
-				, upload_only_torrents
-				, m_upload_rate.queue_size()
-				, m_download_rate.queue_size()
-				, m_disk_queues[peer_connection::upload_channel]
-				, m_disk_queues[peer_connection::download_channel]
-				, m_stat.upload_rate()
-				, m_stat.download_rate()
-				, int(m_disk_thread.queue_buffer_size())
-				, peer_dl_rate_buckets[0]
-				, peer_dl_rate_buckets[1]
-				, peer_dl_rate_buckets[2]
-				, peer_dl_rate_buckets[3]
-				, peer_dl_rate_buckets[4]
-				, peer_dl_rate_buckets[5]
-				, peer_dl_rate_buckets[6]
-				, peer_ul_rate_buckets[0]
-				, peer_ul_rate_buckets[1]
-				, peer_ul_rate_buckets[2]
-				, peer_ul_rate_buckets[3]
-				, peer_ul_rate_buckets[4]
-				, peer_ul_rate_buckets[5]
-				, peer_ul_rate_buckets[6]
-				, m_error_peers
-				, peers_down_interesting
-				, peers_down_unchoked
-				, peers_down_requests
-				, peers_up_interested
-				, peers_up_unchoked
-				, peers_up_requests
-				, m_disconnected_peers
-				, m_eof_peers
-				, m_connreset_peers
-				, outstanding_requests
-				, outstanding_end_game_requests
-				, outstanding_write_blocks
-				, m_end_game_piece_picker_blocks
-				, m_piece_picker_blocks
-				, m_piece_picks
-				, m_reject_piece_picks
-				, m_unchoke_piece_picks
-				, m_incoming_redundant_piece_picks
-				, m_incoming_piece_picks
-				, m_end_game_piece_picks
-				, m_snubbed_piece_picks
-				, m_connect_timeouts
-				, m_uninteresting_peers
-				, m_timeout_peers
-				, (float(m_total_failed_bytes) * 100.f / m_stat.total_payload_download())
-				, (float(m_total_redundant_bytes) * 100.f / m_stat.total_payload_download())
-				, (float(m_stat.total_protocol_download()) * 100.f / m_stat.total_download())
-				, float(cs.average_read_time) / 1000000.f
-				, float(cs.average_write_time) / 1000000.f
-				, float(cs.average_queue_time) / 1000000.f
-				, int(cs.job_queue_length)
-				, int(cs.queued_bytes)
-				, int(cs.blocks_read_hit - m_last_cache_status.blocks_read_hit)
-				, int(cs.blocks_read - m_last_cache_status.blocks_read)
-				, int(cs.blocks_written - m_last_cache_status.blocks_written)
-				, int(m_total_failed_bytes - m_last_failed)
-				, int(m_total_redundant_bytes - m_last_redundant)
-				, error_torrents
-				, cs.read_cache_size
-				, cs.cache_size
-				, cs.total_used_buffers
-				, float(cs.average_hash_time) / 1000000.f
-				, float(cs.average_job_time) / 1000000.f
-				, float(cs.average_sort_time) / 1000000.f
-				, m_connection_attempts
-				, m_num_banned_peers
-				, m_banned_for_hash_failure
-				, m_settings.cache_size
-				, m_settings.connections_limit
-				, connect_candidates
-				, int(m_settings.max_queued_disk_bytes)
-				, low_watermark
-				, float(cs.cumulative_read_time * 100.f / total_job_time)
-				, float(cs.cumulative_write_time * 100.f / total_job_time)
-				, float(cs.cumulative_hash_time * 100.f / total_job_time)
-				, float(cs.cumulative_sort_time * 100.f / total_job_time)
-				, int(cs.total_read_back - m_last_cache_status.total_read_back)
-				, float(cs.total_read_back * 100.f / (cs.blocks_written == 0 ? 1: cs.blocks_written))
-				, cs.read_queue_size
-				, float(tick_interval_ms) / 1000.f
-				, float(m_tick_residual) / 1000.f
-				, m_allowed_upload_slots
-				, m_settings.unchoke_slots_limit * 2
-				, m_stat.low_pass_upload_rate()
-				, m_stat.low_pass_download_rate()
-				, num_end_game_peers
-				, tcp_up_rate
-				, tcp_down_rate
-				, int(m_tcp_upload_channel.throttle())
-				, int(m_tcp_download_channel.throttle())
-				, utp_up_rate
-				, utp_down_rate
-				, float(utp_peak_send_delay) / 1000000.f
-				, float(utp_num_delay_sockets ? float(utp_send_delay_sum) / float(utp_num_delay_sockets) : 0) / 1000000.f
-			);
+#define STAT_LOG(type, val) fprintf(m_stats_logger, "%" #type "\t", val)
+
+			STAT_LOG(d, total_milliseconds(now - m_last_log_rotation) / 1000.f);
+			STAT_LOG(d, int(m_stat.total_upload() - m_last_uploaded));
+			STAT_LOG(d, int(m_stat.total_download() - m_last_downloaded));
+			STAT_LOG(d, downloading_torrents);
+			STAT_LOG(d, seeding_torrents);
+			STAT_LOG(d, num_complete_connections);
+			STAT_LOG(d, num_half_open);
+			STAT_LOG(d, m_disk_thread.disk_allocations());
+			STAT_LOG(d, num_peers);
+			STAT_LOG(d, logging_allocator::allocations);
+			STAT_LOG(d, logging_allocator::allocated_bytes);
+			STAT_LOG(d, checking_torrents);
+			STAT_LOG(d, stopped_torrents);
+			STAT_LOG(d, upload_only_torrents);
+			STAT_LOG(d, m_upload_rate.queue_size());
+			STAT_LOG(d, m_download_rate.queue_size());
+			STAT_LOG(d, m_disk_queues[peer_connection::upload_channel]);
+			STAT_LOG(d, m_disk_queues[peer_connection::download_channel]);
+			STAT_LOG(d, m_stat.upload_rate());
+			STAT_LOG(d, m_stat.download_rate());
+			STAT_LOG(d, int(m_disk_thread.queue_buffer_size()));
+			STAT_LOG(d, peer_dl_rate_buckets[0]);
+			STAT_LOG(d, peer_dl_rate_buckets[1]);
+			STAT_LOG(d, peer_dl_rate_buckets[2]);
+			STAT_LOG(d, peer_dl_rate_buckets[3]);
+			STAT_LOG(d, peer_dl_rate_buckets[4]);
+			STAT_LOG(d, peer_dl_rate_buckets[5]);
+			STAT_LOG(d, peer_dl_rate_buckets[6]);
+			STAT_LOG(d, peer_ul_rate_buckets[0]);
+			STAT_LOG(d, peer_ul_rate_buckets[1]);
+			STAT_LOG(d, peer_ul_rate_buckets[2]);
+			STAT_LOG(d, peer_ul_rate_buckets[3]);
+			STAT_LOG(d, peer_ul_rate_buckets[4]);
+			STAT_LOG(d, peer_ul_rate_buckets[5]);
+			STAT_LOG(d, peer_ul_rate_buckets[6]);
+			STAT_LOG(d, m_error_peers);
+			STAT_LOG(d, peers_down_interesting);
+			STAT_LOG(d, peers_down_unchoked);
+			STAT_LOG(d, peers_down_requests);
+			STAT_LOG(d, peers_up_interested);
+			STAT_LOG(d, peers_up_unchoked);
+			STAT_LOG(d, peers_up_requests);
+			STAT_LOG(d, m_disconnected_peers);
+			STAT_LOG(d, m_eof_peers);
+			STAT_LOG(d, m_connreset_peers);
+			STAT_LOG(d, outstanding_requests);
+			STAT_LOG(d, outstanding_end_game_requests);
+			STAT_LOG(d, outstanding_write_blocks);
+			STAT_LOG(d, m_end_game_piece_picker_blocks);
+			STAT_LOG(d, m_piece_picker_blocks);
+			STAT_LOG(d, m_piece_picks);
+			STAT_LOG(d, m_reject_piece_picks);
+			STAT_LOG(d, m_unchoke_piece_picks);
+			STAT_LOG(d, m_incoming_redundant_piece_picks);
+			STAT_LOG(d, m_incoming_piece_picks);
+			STAT_LOG(d, m_end_game_piece_picks);
+			STAT_LOG(d, m_snubbed_piece_picks);
+			STAT_LOG(d, m_connect_timeouts);
+			STAT_LOG(d, m_uninteresting_peers);
+			STAT_LOG(d, m_timeout_peers);
+			STAT_LOG(f, (float(m_total_failed_bytes) * 100.f / m_stat.total_payload_download()));
+			STAT_LOG(f, (float(m_total_redundant_bytes) * 100.f / m_stat.total_payload_download()));
+			STAT_LOG(f, (float(m_stat.total_protocol_download()) * 100.f / m_stat.total_download()));
+			STAT_LOG(f, float(cs.average_read_time) / 1000000.f);
+			STAT_LOG(f, float(cs.average_write_time) / 1000000.f);
+			STAT_LOG(f, float(cs.average_queue_time) / 1000000.f);
+			STAT_LOG(d, int(cs.job_queue_length));
+			STAT_LOG(d, int(cs.queued_bytes));
+			STAT_LOG(d, int(cs.blocks_read_hit - m_last_cache_status.blocks_read_hit));
+			STAT_LOG(d, int(cs.blocks_read - m_last_cache_status.blocks_read));
+			STAT_LOG(d, int(cs.blocks_written - m_last_cache_status.blocks_written));
+			STAT_LOG(d, int(m_total_failed_bytes - m_last_failed));
+			STAT_LOG(d, int(m_total_redundant_bytes - m_last_redundant));
+			STAT_LOG(d, error_torrents);
+			STAT_LOG(d, cs.read_cache_size);
+			STAT_LOG(d, cs.cache_size);
+			STAT_LOG(d, cs.total_used_buffers);
+			STAT_LOG(f, float(cs.average_hash_time) / 1000000.f);
+			STAT_LOG(f, float(cs.average_job_time) / 1000000.f);
+			STAT_LOG(f, float(cs.average_sort_time) / 1000000.f);
+			STAT_LOG(d, m_connection_attempts);
+			STAT_LOG(d, m_num_banned_peers);
+			STAT_LOG(d, m_banned_for_hash_failure);
+			STAT_LOG(d, m_settings.cache_size);
+			STAT_LOG(d, m_settings.connections_limit);
+			STAT_LOG(d, connect_candidates);
+			STAT_LOG(d, int(m_settings.max_queued_disk_bytes));
+			STAT_LOG(d, low_watermark);
+			STAT_LOG(f, float(cs.cumulative_read_time * 100.f / total_job_time));
+			STAT_LOG(f, float(cs.cumulative_write_time * 100.f / total_job_time));
+			STAT_LOG(f, float(cs.cumulative_hash_time * 100.f / total_job_time));
+			STAT_LOG(f, float(cs.cumulative_sort_time * 100.f / total_job_time));
+			STAT_LOG(d, int(cs.total_read_back - m_last_cache_status.total_read_back));
+			STAT_LOG(f, float(cs.total_read_back * 100.f / (cs.blocks_written == 0 ? 1: cs.blocks_written)));
+			STAT_LOG(d, cs.read_queue_size);
+			STAT_LOG(f, float(tick_interval_ms) / 1000.f);
+			STAT_LOG(f, float(m_tick_residual) / 1000.f);
+			STAT_LOG(d, m_allowed_upload_slots);
+			STAT_LOG(d, m_settings.unchoke_slots_limit * 2);
+			STAT_LOG(d, m_stat.low_pass_upload_rate());
+			STAT_LOG(d, m_stat.low_pass_download_rate());
+			STAT_LOG(d, num_end_game_peers);
+			STAT_LOG(d, tcp_up_rate);
+			STAT_LOG(d, tcp_down_rate);
+			STAT_LOG(d, int(m_tcp_upload_channel.throttle()));
+			STAT_LOG(d, int(m_tcp_download_channel.throttle()));
+			STAT_LOG(d, utp_up_rate);
+			STAT_LOG(d, utp_down_rate);
+			STAT_LOG(f, float(utp_peak_send_delay) / 1000000.f);
+			STAT_LOG(f, float(utp_num_delay_sockets ? float(utp_send_delay_sum) / float(utp_num_delay_sockets) : 0) / 1000000.f);
+			fprintf(m_stats_logger, "\n");
+
+#undef STAT_LOG
+
 			m_last_cache_status = cs;
 			m_last_failed = m_total_failed_bytes;
 			m_last_redundant = m_total_redundant_bytes;


Update DCFreeHedron.cpp

Update DCFreeHedron.cpp

Fix correction term calculation for branch molecules.

--- src/cbmc/DCFreeHedron.cpp
+++ src/cbmc/DCFreeHedron.cpp
@@ -134,7 +134,7 @@
 #ifdef _OPENMP
 #pragma omp section
 #endif
-      calcEwald->SwapCorrection(correction, newMol, positions, hed.Prev(),
+      calcEwald->SwapCorrection(correction, newMol, positions, hed.NumBond(),
 			       hed.bonded, newMol.GetBox(), nLJTrials,
 			       hed.Prev(), true);
 }


typo fix: use BitAnd instead of And in interpretation of Ternary field

--- p4_symbolic/symbolic/table.cc
+++ p4_symbolic/symbolic/table.cc
@@ -171,7 +171,7 @@
       ASSIGN_OR_RETURN(z3::expr value_expression,
                        util::IrValueToZ3Expr(match.ternary().value()));
       ASSIGN_OR_RETURN(z3::expr masked_field,
-                       operators::And(field_expression, mask_expression));
+                       operators::BitAnd(field_expression, mask_expression));
       return operators::Eq(masked_field, value_expression);
     }


fix RUNTIME_ARRAY_BODY regressions in classpath-openjdk.cpp

--- src/classpath-openjdk.cpp
+++ src/classpath-openjdk.cpp
@@ -339,7 +339,7 @@
   replace('/', '.', RUNTIME_ARRAY_BODY(s),
           reinterpret_cast<char*>(&byteArrayBody(t, name, 0)));

-  return makeString(t, "%s", s);
+  return makeString(t, "%s", RUNTIME_ARRAY_BODY(s));
 }

 object
@@ -755,7 +755,8 @@
                length);
         RUNTIME_ARRAY_BODY(packageName)[length] = 0;

-        object key = vm::makeByteArray(t, "%s", packageName);
+        object key = vm::makeByteArray
+          (t, "%s", RUNTIME_ARRAY_BODY(packageName));
         PROTECT(t, key);

         hashMapRemove
@@ -775,7 +776,7 @@
                  &byteArrayBody(t, source, PrefixLength),
                  sourceNameLength);

-          source = vm::makeByteArray(t, "%s", sourceName);
+          source = vm::makeByteArray(t, "%s", RUNTIME_ARRAY_BODY(sourceName));
         } else {
           source = vm::makeByteArray(t, "avian-dummy-package-source");
         }
@@ -1528,7 +1529,8 @@
       RUNTIME_ARRAY_BODY(p)[byteArrayLength(t, path) + 1] = 0;
     }

-    return reinterpret_cast<int64_t>(find(file, p, byteArrayLength(t, path)));
+    return reinterpret_cast<int64_t>
+      (find(file, RUNTIME_ARRAY_BODY(p), byteArrayLength(t, path)));
   } else {
     int64_t entry = longValue
       (t, t->m->processor->invoke
@@ -2194,14 +2196,14 @@
     THREAD_RUNTIME_ARRAY(t, char, s, specLength - 1);
     memcpy(RUNTIME_ARRAY_BODY(s), spec + 1, specLength - 2);
     RUNTIME_ARRAY_BODY(s)[specLength - 2] = 0;
-    return resolveClass(t, loader, s);
+    return resolveClass(t, loader, RUNTIME_ARRAY_BODY(s));
   }

   case '[': {
     THREAD_RUNTIME_ARRAY(t, char, s, specLength + 1);
     memcpy(RUNTIME_ARRAY_BODY(s), spec, specLength);
     RUNTIME_ARRAY_BODY(s)[specLength] = 0;
-    return resolveClass(t, loader, s);
+    return resolveClass(t, loader, RUNTIME_ARRAY_BODY(s));
   }

   default:
@@ -3429,8 +3431,8 @@

     if (*p == '=') {
       THREAD_RUNTIME_ARRAY(t, char, name, (p - start) + 1);
-      memcpy(name, start, p - start);
-      name[p - start] = 0;
+      memcpy(RUNTIME_ARRAY_BODY(name), start, p - start);
+      RUNTIME_ARRAY_BODY(name)[p - start] = 0;
       local::setProperty
         (t, method, *properties, RUNTIME_ARRAY_BODY(name), p + 1);
     }
@@ -4829,9 +4831,10 @@

     unsigned specLength = byteArrayLength(t, methodSpec(t, vmMethod));
     THREAD_RUNTIME_ARRAY(t, char, spec, specLength);
-    memcpy(spec, &byteArrayBody(t, methodSpec(t, vmMethod), 0), specLength);
+    memcpy(RUNTIME_ARRAY_BODY(spec),
+           &byteArrayBody(t, methodSpec(t, vmMethod), 0), specLength);
     unsigned i = 0;
-    for (MethodSpecIterator it(t, spec); it.hasNext();) {
+    for (MethodSpecIterator it(t, RUNTIME_ARRAY_BODY(spec)); it.hasNext();) {
       object type;
       bool objectType = false;
       const char* p = it.next();
@@ -4850,10 +4853,11 @@
         objectType = true;
         unsigned nameLength = it.s - p;
         THREAD_RUNTIME_ARRAY(t, char, name, nameLength);
-        memcpy(name, p, nameLength - 1);
-        name[nameLength - 1] = 0;
+        memcpy(RUNTIME_ARRAY_BODY(name), p, nameLength - 1);
+        RUNTIME_ARRAY_BODY(name)[nameLength - 1] = 0;
         type = resolveClass
-          (t, classLoader(t, methodClass(t, vmMethod)), name);
+          (t, classLoader(t, methodClass(t, vmMethod)),
+           RUNTIME_ARRAY_BODY(name));
       } break;

       default:


Fix potential integer overflow in fpdf_render_loadimage.cpp

BUG=391929
R=tsepez@chromium.org

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

--- core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -11,7 +11,8 @@
 #include "../../../include/fpdfapi/fpdf_pageobj.h"
 #include "../fpdf_page/pageint.h"
 #include "render_int.h"
-#include <limits.h>
+#include "../../../../third_party/numerics/safe_math.h"
+
 static unsigned int _GetBits8(FX_LPCBYTE pData, int bitpos, int nbits)
 {
     unsigned int byte = pData[bitpos / 8];
@@ -175,27 +176,23 @@
     if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, pPageResources)) {
         return FALSE;
     }
-    FX_DWORD src_pitch = m_bpc;
-    if (m_bpc != 0 && m_nComponents != 0) {
-        if (src_pitch > 0 && m_nComponents > (unsigned)INT_MAX / src_pitch) {
-            return FALSE;
-        }
-        src_pitch *= m_nComponents;
-        if (src_pitch > 0 && (FX_DWORD)m_Width > (unsigned)INT_MAX / src_pitch) {
-            return FALSE;
-        }
-        src_pitch *= m_Width;
-        if (src_pitch + 7 < src_pitch) {
-            return FALSE;
-        }
-        src_pitch += 7;
-        src_pitch /= 8;
-        if (src_pitch > 0 && (FX_DWORD)m_Height > (unsigned)INT_MAX / src_pitch) {
-            return FALSE;
-        }
-    }
+
+    if (m_bpc == 0 || m_nComponents == 0) {
+        return FALSE;
+    }
+
+    FX_SAFE_DWORD src_pitch = m_bpc;
+    src_pitch *= m_nComponents;
+    src_pitch *= m_Width;
+    src_pitch += 7;
+    src_pitch /= 8;
+    src_pitch *= m_Height;
+    if (!src_pitch.IsValid()) {
+        return FALSE;
+    }
+
     m_pStreamAcc = FX_NEW CPDF_StreamAcc;
-    m_pStreamAcc->LoadAllData(pStream, FALSE, m_Height * src_pitch, TRUE);
+    m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE);
     if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) {
         return FALSE;
     }
@@ -218,20 +215,16 @@
     } else {
         m_bpp = 24;
     }
-    if (!m_bpc || !m_nComponents) {
+
+    FX_SAFE_DWORD pitch = m_Width;
+    pitch *= m_bpp;
+    pitch += 31;
+    pitch /= 8;
+    if (!pitch.IsValid()) {
         return FALSE;
     }
-    m_Pitch = m_Width;
-    if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
-        return FALSE;
-    }
-    m_Pitch *= m_bpp;
-    if (m_Pitch + 31 < m_Pitch) {
-        return FALSE;
-    }
-    m_Pitch += 31;
-    m_Pitch = m_Pitch / 32 * 4;
-    m_pLineBuf = FX_Alloc(FX_BYTE, m_Pitch);
+
+    m_pLineBuf = FX_Alloc(FX_BYTE, pitch.ValueOrDie());
     if (m_pColorSpace && bStdCS) {
         m_pColorSpace->EnableStdConversion(TRUE);
     }
@@ -239,18 +232,17 @@
     if (m_bColorKey) {
         m_bpp = 32;
         m_AlphaFlag = 2;
-        m_Pitch = m_Width;
-        if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
+        pitch = m_Width;
+        pitch *= m_bpp;
+        pitch += 31;
+        pitch /= 8;
+        if (!pitch.IsValid()) {
             return FALSE;
         }
-        m_Pitch *= m_bpp;
-        if (m_Pitch + 31 < m_Pitch) {
-            return FALSE;
-        }
-        m_Pitch += 31;
-        m_Pitch = m_Pitch / 32 * 4;
-        m_pMaskedLine = FX_Alloc(FX_BYTE, m_Pitch);
-    }
+
+        m_pMaskedLine = FX_Alloc(FX_BYTE, pitch.ValueOrDie());
+    }
+    m_Pitch = pitch.ValueOrDie();
     if (ppMask) {
         *ppMask = LoadMask(*pMatteColor);
     }
@@ -276,17 +268,14 @@
     if (!m_bpc || !m_nComponents) {
         return 0;
     }
-    m_Pitch = m_Width;
-    if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
+    FX_SAFE_DWORD pitch = m_Width;
+    pitch *= m_bpp;
+    pitch += 31;
+    pitch /= 8;
+    if (!pitch.IsValid()) {
         return 0;
     }
-    m_Pitch *= m_bpp;
-    if (m_Pitch + 31 < m_Pitch) {
-        return 0;
-    }
-    m_Pitch += 31;
-    m_Pitch = m_Pitch / 32 * 4;
-    m_pLineBuf = FX_Alloc(FX_BYTE, m_Pitch);
+    m_pLineBuf = FX_Alloc(FX_BYTE, pitch.ValueOrDie());
     if (m_pColorSpace && m_bStdCS) {
         m_pColorSpace->EnableStdConversion(TRUE);
     }
@@ -294,18 +283,16 @@
     if (m_bColorKey) {
         m_bpp = 32;
         m_AlphaFlag = 2;
-        m_Pitch = m_Width;
-        if ((FX_DWORD)m_bpp > (unsigned)INT_MAX / m_Pitch) {
+        pitch = m_Width;
+        pitch *= m_bpp;
+        pitch += 31;
+        pitch /= 8;
+        if (!pitch.IsValid()) {
             return 0;
         }
-        m_Pitch *= m_bpp;
-        if (m_Pitch + 31 < m_Pitch) {
-            return 0;
-        }
-        m_Pitch += 31;
-        m_Pitch = m_Pitch / 32 * 4;
-        m_pMaskedLine = FX_Alloc(FX_BYTE, m_Pitch);
-    }
+        m_pMaskedLine = FX_Alloc(FX_BYTE, pitch.ValueOrDie());
+    }
+    m_Pitch = pitch.ValueOrDie();
     return 1;
 }
 int	CPDF_DIBSource::StartLoadDIBSource(CPDF_Document* pDoc, const CPDF_Stream* pStream, FX_BOOL bHasMask,
@@ -330,27 +317,23 @@
     if (!LoadColorInfo(m_pStream->GetObjNum() != 0 ? NULL : pFormResources, pPageResources)) {
         return 0;
     }
-    FX_DWORD src_pitch = m_bpc;
-    if (m_bpc != 0 && m_nComponents != 0) {
-        if (src_pitch > 0 && m_nComponents > (unsigned)INT_MAX / src_pitch) {
-            return 0;
-        }
-        src_pitch *= m_nComponents;
-        if (src_pitch > 0 && (FX_DWORD)m_Width > (unsigned)INT_MAX / src_pitch) {
-            return 0;
-        }
-        src_pitch *= m_Width;
-        if (src_pitch + 7 < src_pitch) {
-            return 0;
-        }
-        src_pitch += 7;
-        src_pitch /= 8;
-        if (src_pitch > 0 && (FX_DWORD)m_Height > (unsigned)INT_MAX / src_pitch) {
-            return 0;
-        }
-    }
+
+    if (m_bpc == 0 || m_nComponents == 0) {
+        return 0;
+    }
+
+    FX_SAFE_DWORD src_pitch = m_bpc;
+    src_pitch *= m_nComponents;
+    src_pitch *= m_Width;
+    src_pitch += 7;
+    src_pitch /= 8;
+    src_pitch *= m_Height;
+    if (!src_pitch.IsValid()) {
+        return 0;
+    }
+
     m_pStreamAcc = FX_NEW CPDF_StreamAcc;
-    m_pStreamAcc->LoadAllData(pStream, FALSE, m_Height * src_pitch, TRUE);
+    m_pStreamAcc->LoadAllData(pStream, FALSE, src_pitch.ValueOrDie(), TRUE);
     if (m_pStreamAcc->GetSize() == 0 || m_pStreamAcc->GetData() == NULL) {
         return 0;
     }
@@ -1182,16 +1165,35 @@
 void CPDF_DIBSource::DownSampleScanline(int line, FX_LPBYTE dest_scan, int dest_bpp,
                                         int dest_width, FX_BOOL bFlipX, int clip_left, int clip_width) const
 {
+    if (line < 0 || dest_scan == NULL || dest_bpp <= 0 ||
+        dest_width <= 0 || clip_left < 0 || clip_width <= 0) {
+        return;
+    }
+
     FX_DWORD bpc = GetValidBpc();
     FX_DWORD src_width = m_Width;
-    FX_DWORD src_pitch = (src_width * bpc * m_nComponents + 7) / 8;
+    FX_SAFE_DWORD pitch = src_width;
+    pitch *= bpc;
+    pitch *= m_nComponents;
+    pitch += 7;
+    pitch /= 8;
+    if (!pitch.IsValid()) {
+        return;
+    }
+
     FX_LPCBYTE pSrcLine = NULL;
     if (m_pCachedBitmap) {
         pSrcLine = m_pCachedBitmap->GetScanline(line);
     } else if (m_pDecoder) {
         pSrcLine = m_pDecoder->GetScanline(line);
     } else {
-        if (m_pStreamAcc->GetSize() >= (line + 1) * src_pitch) {
+        FX_DWORD src_pitch = pitch.ValueOrDie();
+        pitch *= (line+1);
+        if (!pitch.IsValid()) {
+            return;
+        }
+
+        if (m_pStreamAcc->GetSize() >= pitch.ValueOrDie()) {
             pSrcLine = m_pStreamAcc->GetData() + line * src_pitch;
         }
     }
@@ -1201,6 +1203,15 @@
         FXSYS_memset32(dest_scan, 0xff, dest_Bpp * clip_width);
         return;
     }
+
+    FX_SAFE_INT max_src_x = clip_left;
+    max_src_x += clip_width - 1;
+    max_src_x *= src_width;
+    max_src_x /= dest_width;
+    if (!max_src_x.IsValid()) {
+        return;
+    }
+
     CFX_FixedBufGrow<FX_BYTE, 128> temp(orig_Bpp);
     if (bpc * m_nComponents == 1) {
         FX_DWORD set_argb = (FX_DWORD) - 1, reset_argb = 0;


media:AudioBuffer : Add missing break statement

BUG=

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

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#315349}

--- media/base/audio_buffer.cc
+++ media/base/audio_buffer.cc
@@ -337,6 +337,7 @@
                              trim_start_,
                              dest_data,
                              ConvertS32ToS32);
+      break;
     case kUnknownSampleFormat:
       NOTREACHED();
       break;


Drop the assertion for wron intervals

Drop the assertion for wron intervals

Signed-off-by: Jan Losinski <577c4104c61edf9f052c616c0c23e67bef4a9955@wh2.tu-dresden.de>

--- messages/reply_message.cpp
+++ messages/reply_message.cpp
@@ -1,4 +1,4 @@
-#include <boost/assert.hpp>
+#include <iostream>

 #include "replies.pb.h"
 #include "reply_message.h"
@@ -48,9 +48,10 @@
 void
 traffic::StatisticReply::available_interval(TimeRange const &range)
 {
-	BOOST_ASSERT(range.valid() && "Given range not valid");
-	if (! range.valid())
+	if (! range.valid()) {
+		std::cerr << "Invalid TimeRange - ignore it." << std::endl;
 		return;
+	}

 	common::TimeRange * range_msg(
 			_statistic_msg->mutable_available_range());


Restore mistakenly deleted 'else' block

Restore mistakenly deleted 'else' block

--- src/common/FileSystem.cpp
+++ src/common/FileSystem.cpp
@@ -1358,9 +1358,9 @@

 		// Close file and check for CRC errors
 		zipFile.CloseFile(err);
-	}
-
-	ASSERT_UNREACHABLE();
+	} else {
+		ASSERT_UNREACHABLE();
+	}
 }

 bool FileExists(Str::StringRef path)


- reset the CURL's HEAD->GET state two differents ways   (7.11.2 likes CURLOPT_NOBODY, 7.12.3 likes CURLOPT_HTTPGET)

--- src/common/URLManager.cxx
+++ src/common/URLManager.cxx
@@ -143,6 +143,12 @@
     retcode = false;
   }

+  result = curl_easy_setopt((CURL*)easyHandle, CURLOPT_HTTPGET, 1);
+  if (result) {
+    DEBUG1("Something wrong with CURL; Error: %d\n", result);
+    retcode = false;
+  }
+
   return retcode;
 }


Added new scopes to get structure

Added new scopes to get structure

--- src/components/BScope.cpp
+++ src/components/BScope.cpp
@@ -117,6 +117,8 @@
         auto castGlobal = std::dynamic_pointer_cast<BGlobal>(top);
         auto castClass = std::dynamic_pointer_cast<BClass>(top);
         auto castFunction = std::dynamic_pointer_cast<BFunction>(top);
+        auto castWhile = std::dynamic_pointer_cast<BWhile>(top);
+        auto castIf = std::dynamic_pointer_cast<BIf>(top);

         // Get corresponding information
         if(castClass) {
@@ -126,6 +128,10 @@
             ". Label: " << castFunction->getLabel().str() << std::endl;
         } else if(castGlobal) {
             structure << "global" << std::endl;
+        } else if(castWhile) {
+            structure << "while. Label: " << castWhile->getLabel().str() << std::endl;
+        } else if(castIf) {
+            structure << "if. Label: " << castIf->getLabel().str() << std::endl;
         }

         // Get all variables
@@ -134,7 +140,7 @@
             << " : " << variable->getType() << ". Label: " << variable->getLabel().str() << std::endl;
         }

-        if(castGlobal || castClass || castFunction) {
+        if(castGlobal || castClass || castFunction || castWhile || castIf) {
             // Push all the children scopes
             for(auto scope : top->m_scopes) {
                 structureStack.push(scope.second);