ADD: Backtrace::dump() implementation for Windows

--- SofaKernel/framework/sofa/helper/BackTrace.cpp
+++ SofaKernel/framework/sofa/helper/BackTrace.cpp
@@ -24,19 +24,24 @@
 ******************************************************************************/
 #include <sofa/helper/BackTrace.h>

-#if !defined(WIN32) && !defined(_XBOX) && !defined(PS3)
+#if !defined(_XBOX) && !defined(PS3)
 #include <signal.h>
 #endif
 #if !defined(WIN32) && !defined(_XBOX) && !defined(__APPLE__) && !defined(PS3)
 #include <execinfo.h>
 #include <unistd.h>
 #endif
+#if defined(WIN32)
+#include "windows.h"
+#include "DbgHelp.h"
+#pragma comment(lib, "Dbghelp.lib")
+#endif
 #if defined(__GNUC__) && !defined(PS3)
 #include <cxxabi.h>
 #endif
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
+
+#include <iostream>
+#include <string>

 namespace sofa
 {
@@ -104,6 +109,29 @@
             backtrace_symbols_fd(array, size, STDERR_FILENO);
         }
     }
+#else #if !defined(__GNUC__) && !defined(__APPLE__) && defined(WIN32) && !defined(_XBOX) && !defined(PS3)
+	unsigned int   i;
+	void         * stack[100];
+	unsigned short frames;
+	SYMBOL_INFO  * symbol;
+	HANDLE         process;
+
+	process = GetCurrentProcess();
+
+	SymInitialize(process, NULL, TRUE);
+
+	frames = CaptureStackBackTrace(0, 100, stack, NULL);
+	symbol = (SYMBOL_INFO *)calloc(sizeof(SYMBOL_INFO) + 256 * sizeof(char), 1);
+	symbol->MaxNameLen = 255;
+	symbol->SizeOfStruct = sizeof(SYMBOL_INFO);
+
+	for (i = 0; i < frames; i++)
+	{
+		SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol);
+		std::cerr << (frames - i - 1) << ": " << symbol->Name << " - 0x" << std::hex << symbol->Address << std::dec << std::endl;
+	}
+
+	free(symbol);
 #endif
 }

@@ -112,25 +140,56 @@
 /// Currently only works on Linux. NOOP on other architectures
 void BackTrace::autodump()
 {
-#if !defined(WIN32) && !defined(_XBOX) && !defined(PS3)
+#if !defined(_XBOX) && !defined(PS3)
+	signal(SIGABRT, BackTrace::sig);
     signal(SIGSEGV, BackTrace::sig);
     signal(SIGILL, BackTrace::sig);
     signal(SIGFPE, BackTrace::sig);
-    signal(SIGPIPE, BackTrace::sig);
     signal(SIGINT, BackTrace::sig);
     signal(SIGTERM, BackTrace::sig);
+#if !defined(WIN32)
+	signal(SIGPIPE, BackTrace::sig);
 #endif
+#endif
+}
+
+static std::string SigDescription(int sig)
+{
+	switch (sig)
+	{
+	case SIGABRT:
+		return "SIGABRT: usually caused by an abort() or assert()";
+		break;
+	case SIGFPE:
+		return "SIGFPE: arithmetic exception, such as divide by zero";
+		break;
+	case SIGILL:
+		return "SIGILL: illegal instruction";
+		break;
+	case SIGINT:
+		return "SIGINT: interactive attention signal, probably a ctrl+c";
+		break;
+	case SIGSEGV:
+		return "SIGSEGV: segfault";
+		break;
+	case SIGTERM:
+	default:
+		return "SIGTERM: a termination request was sent to the program";
+		break;
+	}
+
+	return "Unknown signal";
 }

 void BackTrace::sig(int sig)
 {
-#if !defined(WIN32) && !defined(_XBOX) && !defined(PS3)
-    fprintf(stderr,"\n########## SIG %d ##########\n",sig);
+#if !defined(_XBOX) && !defined(PS3)
+	std::cerr << std::endl << "########## SIG " << sig << " - " << SigDescription(sig) << " ##########" << std::endl;
     dump();
     signal(sig,SIG_DFL);
     raise(sig);
 #else
-    fprintf(stderr,"\nERROR: BackTrace::sig(%d) not supported.\n",sig);
+	std::cerr << std::endl << "ERROR: BackTrace::sig(" << sig << " - " << SigDescription(sig) << ") not supported." << std::endl;
 #endif
 }


Without string include

Without string include

--- sw/source/core/unocore/unoidx.cxx
+++ sw/source/core/unocore/unoidx.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: unoidx.cxx,v $
  *
- *  $Revision: 1.10 $
- *
- *  last change: $Author: hjs $ $Date: 2000-11-07 14:15:49 $
+ *  $Revision: 1.11 $
+ *
+ *  last change: $Author: obo $ $Date: 2000-11-09 10:24:14 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -59,8 +59,6 @@
  *
  ************************************************************************/

-#include <string>
-#include <algorithm>

 #ifdef PRECOMPILED
 #include "core_pch.hxx"
@@ -151,6 +149,8 @@
 #ifndef _HINTS_HXX
 #include <hints.hxx>
 #endif
+
+#include <algorithm>

 using namespace ::com::sun::star;
 using namespace ::com::sun::star::lang;


#103124# PageDescName property attributes fixed

--- sw/source/core/unocore/unomap.cxx
+++ sw/source/core/unocore/unomap.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: unomap.cxx,v $
  *
- *  $Revision: 1.139 $
- *
- *  last change: $Author: tl $ $Date: 2002-10-08 14:34:48 $
+ *  $Revision: 1.140 $
+ *
+ *  last change: $Author: tl $ $Date: 2002-10-16 09:03:52 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -883,7 +883,7 @@
                     { SW_PROP_NMID(UNO_NAME_KEEP_TOGETHER), RES_KEEP,               CPPU_E2T(CPPUTYPE_BOOLEAN)  ,       PROPERTY_NONE, 0},
                     { SW_PROP_NMID(UNO_NAME_SPLIT), RES_LAYOUT_SPLIT,       CPPU_E2T(CPPUTYPE_BOOLEAN)  ,       PROPERTY_NONE, 0},
                     { SW_PROP_NMID(UNO_NAME_PAGE_NUMBER_OFFSET), RES_PAGEDESC,              CPPU_E2T(CPPUTYPE_INT16),       PropertyAttribute::MAYBEVOID, MID_PAGEDESC_PAGENUMOFFSET},
-                    { SW_PROP_NMID(UNO_NAME_PAGE_DESC_NAME), RES_PAGEDESC,           CPPU_E2T(CPPUTYPE_OUSTRING),         PROPERTY_NONE, 0xff},
+                    { SW_PROP_NMID(UNO_NAME_PAGE_DESC_NAME), RES_PAGEDESC,           CPPU_E2T(CPPUTYPE_OUSTRING),         PropertyAttribute::MAYBEVOID, 0xff},
                     { SW_PROP_NMID(UNO_NAME_RELATIVE_WIDTH), FN_TABLE_RELATIVE_WIDTH,CPPU_E2T(CPPUTYPE_INT16)  ,        PROPERTY_NONE, 0xff },
                     { SW_PROP_NMID(UNO_NAME_REPEAT_HEADLINE), FN_TABLE_HEADLINE_REPEAT,CPPU_E2T(CPPUTYPE_BOOLEAN),      PROPERTY_NONE, 0xff},
                     { SW_PROP_NMID(UNO_NAME_SHADOW_FORMAT), RES_SHADOW,             CPPU_E2T(CPPUTYPE_SHADOWFMT),   PROPERTY_NONE, 0},


clean up in engine()

clean up in engine()

--- src/Aton.cpp
+++ src/Aton.cpp
@@ -395,21 +395,54 @@

         void engine(int y, int xx, int r, ChannelMask channels, Row& out)
         {
-            // don't have a buffer yet
-            if ( m_buffer._width==0 && m_buffer._height==0 )
-            {
+            int b_index = 0;
+
+            foreach(z, channels)
+            {
+                std::string layer = getLayerName(z);

-                float *rOut = out.writable(Chan_Red) + xx;
-                float *gOut = out.writable(Chan_Green) + xx;
-                float *bOut = out.writable(Chan_Blue) + xx;
+                // get the current buffer index
+                if (layer.compare(ChannelStr::rgb) != 0)
+                {
+                    for(std::vector<std::string>::iterator it = m_aovs.begin(); it != m_aovs.end(); ++it)
+                    {
+                        if (it->compare(layer) == 0)
+                        {
+                            b_index = static_cast<int>(it - m_aovs.begin());
+                            break;
+                        }
+                        else if ( it->compare(ChannelStr::Z) == 0 && layer.compare(ChannelStr::depth) == 0 )
+                        {
+                            b_index = static_cast<int>(it - m_aovs.begin());
+                            break;
+                        }
+                    }
+                }
+
+                float *rOut = out.writable(brother (z, 0)) + xx;
+                float *gOut = out.writable(brother (z, 1)) + xx;
+                float *bOut = out.writable(brother (z, 2)) + xx;
                 float *aOut = out.writable(Chan_Alpha) + xx;
                 const float *END = rOut + (r - xx);
                 unsigned int xxx = static_cast<unsigned int> (xx);
-
+                unsigned int yyy = static_cast<unsigned int> (y);
+
                 m_mutex.lock();
                 while (rOut < END)
                 {
-                    *rOut = *gOut = *bOut = *aOut = 0.f;
+                    if (m_buffers.empty() ||
+                        xxx >= m_buffer._width || yyy >= m_buffer._height ||
+                        (m_buffer._width==0 && m_buffer._height==0))
+                    {
+                        *rOut = *gOut = *bOut = *aOut = 0.f;
+                    }
+                    else
+                    {
+                        *rOut = m_buffers[b_index].get_colour(xxx, yyy)[0];
+                        *gOut = m_buffers[b_index].get_colour(xxx, yyy)[1];
+                        *bOut = m_buffers[b_index].get_colour(xxx, yyy)[2];
+                        *aOut = m_buffers[0].get_alpha(xxx, yyy)[0];
+                    }
                     ++rOut;
                     ++gOut;
                     ++bOut;
@@ -417,65 +450,6 @@
                     ++xxx;
                 }
                 m_mutex.unlock();
-            }
-            else
-            {
-                int b_index = 0;
-
-                foreach(z, channels)
-                {
-                    std::string layer = getLayerName(z);
-
-                    if (layer.compare(ChannelStr::rgb) != 0)
-                    {
-                        for(std::vector<std::string>::iterator it = m_aovs.begin(); it != m_aovs.end(); ++it)
-                        {
-                            if (it->compare(layer) == 0)
-                            {
-                                b_index = static_cast<int>(it - m_aovs.begin());
-                                break;
-                            }
-                            else if ( it->compare(ChannelStr::Z) == 0 && layer.compare(ChannelStr::depth) == 0 )
-                            {
-                                b_index = static_cast<int>(it - m_aovs.begin());
-                                break;
-                            }
-                        }
-                    }
-
-                    float *rOut = out.writable(brother (z, 0)) + xx;
-                    float *gOut = out.writable(brother (z, 1)) + xx;
-                    float *bOut = out.writable(brother (z, 2)) + xx;
-                    float *aOut = out.writable(Chan_Alpha) + xx;
-                    const float *END = rOut + (r - xx);
-                    unsigned int xxx = static_cast<unsigned int> (xx);
-                    unsigned int yyy = static_cast<unsigned int> (y);
-
-                    if ( m_buffer._width > 0 && m_buffer._height > 0 )
-                    {
-                        m_mutex.lock();
-                        while (rOut < END)
-                        {
-                            if ( xxx >= m_buffer._width || yyy >= m_buffer._height || m_buffers.empty())
-                            {
-                                *rOut = *gOut = *bOut = *aOut = 0.f;
-                            }
-                            else
-                            {
-                                *rOut = m_buffers[b_index].get_colour(xxx, yyy)[0];
-                                *gOut = m_buffers[b_index].get_colour(xxx, yyy)[1];
-                                *bOut = m_buffers[b_index].get_colour(xxx, yyy)[2];
-                                *aOut = m_buffers[0].get_alpha(xxx, yyy)[0];
-                            }
-                            ++rOut;
-                            ++gOut;
-                            ++bOut;
-                            ++aOut;
-                            ++xxx;
-                        }
-                        m_mutex.unlock();
-                    }
-                }
             }
         }


Minor correction to typo

Minor correction to typo

--- vm/shared_state.cpp
+++ vm/shared_state.cpp
@@ -56,7 +56,7 @@
     if(!initialized_) return;

     if(config.gc_show) {
-      std::cerr << "Time spenting waiting: " << world_->time_waiting() << "\n";
+      std::cerr << "Time spent waiting: " << world_->time_waiting() << "\n";
     }

 #ifdef ENABLE_LLVM


Internal change

Internal change

PiperOrigin-RevId: 405531361

--- ecclesia/lib/redfish/transport/http_test.cc
+++ ecclesia/lib/redfish/transport/http_test.cc
@@ -846,11 +846,11 @@
   EXPECT_TRUE(get_result.ok()) << get_result.status().message();

   // Handle the delete when the update occurs.
-  bool delete_called = false;
+  int delete_count = 0;
   server_->AddHttpDeleteHandler(
       "/redfish/v1/Session/Sessions/1",
       [&](::tensorflow::serving::net_http::ServerRequestInterface *req) {
-        delete_called = true;
+        ++delete_count;
         // Construct the success message.
         ::tensorflow::serving::net_http::SetContentType(req,
                                                         "application/json");
@@ -858,8 +858,13 @@
             tensorflow::serving::net_http::HTTPStatusCode::NO_CONTENT);
       });
   transport_->UpdateToNetworkEndpoint(network_endpoint_);
-  EXPECT_TRUE(delete_called);
+  EXPECT_THAT(delete_count, Eq(1));
   EXPECT_THAT(post_called_count, Eq(2));
+
+  // Clean up transport_ before the test ends so that our DeleteHandler doesn't
+  // fall out of scope.
+  transport_.reset();
+  EXPECT_THAT(delete_count, Eq(2));
 }

 TEST_F(HttpRedfishTransportTest, CanDeleteTokenIfSessionAuthFails) {
@@ -1018,11 +1023,11 @@
   EXPECT_TRUE(get_result.ok()) << get_result.status().message();

   // Handle DELETE and second POST.
-  bool delete_called = false;
+  int delete_count = 0;
   server_->AddHttpDeleteHandler(
       "/redfish/v1/Session/Sessions/1",
       [&](::tensorflow::serving::net_http::ServerRequestInterface *req) {
-        delete_called = true;
+        ++delete_count;
         // Construct the success message.
         ::tensorflow::serving::net_http::SetContentType(req,
                                                         "application/json");
@@ -1051,7 +1056,7 @@
         req->Reply();
       });
   auto result2 = transport_->DoSessionAuth("test_username2", "test_password2");
-  EXPECT_TRUE(delete_called);
+  EXPECT_THAT(delete_count, Eq(1));
   EXPECT_TRUE(result2.ok()) << result2.message();

   // Send a GET and check that we are sending the new session token.
@@ -1070,6 +1075,11 @@
   get_result = transport_->Get("/redfish/v1/test/uri");
   EXPECT_TRUE(req_get_called);
   EXPECT_TRUE(get_result.ok()) << get_result.status().message();
+
+  // Clean up transport_ before the test ends so that our DeleteHandler doesn't
+  // fall out of scope.
+  transport_.reset();
+  EXPECT_THAT(delete_count, Eq(2));
 }

 }  // namespace


INTEGRATION: CWS sw30bf09 (1.211.22); FILE MERGED 2008/07/14 12:32:44 od 1.211.22.1: #i91601# Special implementation of UNO-API paragraph property <ListId>. 	 The default implementation using the <SfxItemSet> is not appropriate.

--- sw/source/core/unocore/unomap.cxx
+++ sw/source/core/unocore/unomap.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: unomap.cxx,v $
- * $Revision: 1.211 $
+ * $Revision: 1.212 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -272,6 +272,7 @@
         { SW_PROP_NMID(UNO_NAME_TEXT_SECTION), FN_UNO_TEXT_SECTION, CPPU_E2T(CPPUTYPE_REFTEXTSECTION),  PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 },                    \
         { SW_PROP_NMID(UNO_NAME_PARA_CHAPTER_NUMBERING_LEVEL), FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL,CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, 0},                                                     \
         { SW_PROP_NMID(UNO_NAME_PARA_CONDITIONAL_STYLE_NAME), FN_UNO_PARA_CONDITIONAL_STYLE_NAME, CPPU_E2T(CPPUTYPE_OUSTRING),      PropertyAttribute::READONLY, 0},                                                     \
+        { SW_PROP_NMID(UNO_NAME_LIST_ID), FN_UNO_LIST_ID, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0}, \
         { SW_PROP_NMID(UNO_NAME_PARA_IS_NUMBERING_RESTART), FN_NUMBER_NEWSTART,     CPPU_E2T(CPPUTYPE_BOOLEAN),     PropertyAttribute::MAYBEVOID, 0 },

 #define COMMON_HYPERLINK_PROPERTIES \
@@ -369,7 +370,6 @@
         { SW_PROP_NMID(UNO_NAME_CHAR_RELIEF), RES_CHRATR_RELIEF,      CPPU_E2T(CPPUTYPE_INT16),    PropertyAttribute::MAYBEVOID,      MID_RELIEF }, \
         { SW_PROP_NMID(UNO_NAME_SNAP_TO_GRID), RES_PARATR_SNAPTOGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0 }, \
         { SW_PROP_NMID(UNO_NAME_PARA_IS_CONNECT_BORDER), RES_PARATR_CONNECT_BORDER, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0}, \
-        { SW_PROP_NMID(UNO_NAME_LIST_ID), RES_PARATR_LIST_ID, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::MAYBEVOID, 0}, \
         { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },

 #define COMMON_CRSR_PARA_PROPERTIES_WITHOUT_FN \


VM: refactor the immediate_p check out of visit_pointer()

This avoids reassigning to slots that are never changed. It makes the minor-gc pass 2% faster.

--- vm/slot_visitor.hpp
+++ vm/slot_visitor.hpp
@@ -162,15 +162,14 @@

 template <typename Fixup>
 cell slot_visitor<Fixup>::visit_pointer(cell pointer) {
-  if (immediate_p(pointer))
-    return pointer;
-
   object* untagged = fixup.fixup_data(untag<object>(pointer));
   return RETAG(untagged, TAG(pointer));
 }

 template <typename Fixup> void slot_visitor<Fixup>::visit_handle(cell* handle) {
-  *handle = visit_pointer(*handle);
+  if (!immediate_p(*handle)) {
+    *handle = visit_pointer(*handle);
+  }
 }

 template <typename Fixup>
@@ -386,8 +385,10 @@

   auto update_literal_refs = [&](instruction_operand op) {
     if (op.rel.type() == RT_LITERAL) {
-      fixnum value = op.load_value(op.pointer);
-      op.store_value(visit_pointer(value));
+      cell value = op.load_value(op.pointer);
+      if (!immediate_p(value)) {
+        op.store_value(visit_pointer(value));
+      }
     }
   };
   compiled->each_instruction_operand(update_literal_refs);
@@ -505,28 +506,29 @@
                                                      cell rel_base) {
   auto visit_func = [&](instruction_operand op){
     cell old_offset = rel_base + op.rel.offset();
-    cell value = op.load_value(old_offset);
+    cell old_value = op.load_value(old_offset);
     switch (op.rel.type()) {
       case RT_LITERAL: {
-        value = visit_pointer(value);
+        if (!immediate_p(old_value)) {
+          op.store_value(visit_pointer(old_value));
+        }
         break;
       }
       case RT_ENTRY_POINT:
       case RT_ENTRY_POINT_PIC:
       case RT_ENTRY_POINT_PIC_TAIL:
       case RT_HERE: {
-        cell offset = TAG(value);
-        code_block* compiled = (code_block*)UNTAG(value);
-        value = RETAG(fixup.fixup_code(compiled), offset);
+        cell offset = TAG(old_value);
+        code_block* compiled = (code_block*)UNTAG(old_value);
+        op.store_value(RETAG(fixup.fixup_code(compiled), offset));
         break;
       }
       case RT_UNTAGGED:
         break;
       default:
-        value = parent->compute_external_address(op);
+        op.store_value(parent->compute_external_address(op));
         break;
     }
-    op.store_value(value);
   };
   block->each_instruction_operand(visit_func);
 }


fix numerical precision issue in analytical derivatives

--- SU2_CFD/src/numerics_direct_mean.cpp
+++ SU2_CFD/src/numerics_direct_mean.cpp
@@ -1165,6 +1165,9 @@
   /*--- Analytical differentiation of the face mass flux and
    pressure (in reverse mode, "?_b" denotes dmot_d?). ---*/

+  /*--- limited mean Mach number (used in division...) ---*/
+  su2double MF = max(numeric_limits<passivedouble>::epsilon(),sqrt(MFsq));
+
   for (int outVar=0; outVar<2; ++outVar) {

     su2double aF_b    = 0.0, mF_b    = 0.0, MF_b  = 0.0, rhoF_b = 0.0, fa_b   = 0.0, alpha_b = 0.0,
@@ -1189,7 +1192,7 @@
         rhoF_b -= Mp/rhoF * mF_b;
         fa_b -= Mp/fa * mF_b;
         aF_b -= 2.0*Mp/aF * mF_b;
-        MF_b += 2.0*sigma*sqrt(MFsq)*(Kp/fa)*(Pressure_j-Pressure_i)/(rhoF*aF*aF) * mF_b;
+        MF_b += 2.0*sigma*MF*(Kp/fa)*(Pressure_j-Pressure_i)/(rhoF*aF*aF) * mF_b;
         tmp = -(Kp/fa)*(1.0-sigma*MFsq)/(rhoF*aF*aF);
         p_i_b -= tmp * mF_b;
         p_j_b += tmp * mF_b;
@@ -1248,13 +1251,13 @@
     su2double Mref_b = 2.0*(1.0-sqrt(Mrefsq)) * fa_b;

     /*--- Mrefsq = ... ---*/
-    if (MFsq < 1.0 && MFsq > Minf*Minf) MF_b += Mref_b;
+    if (MF < 1.0 && MF > Minf) MF_b += Mref_b;

     /*--- MFsq = ... ---*/
-    mL_b += 0.5*mL/sqrt(MFsq) * MF_b;  mR_b += 0.5*mR/sqrt(MFsq) * MF_b;
+    mL_b += 0.5*mL/MF * MF_b;  mR_b += 0.5*mR/MF * MF_b;

     /*--- mL/R = ... ---*/
-    Vn_i_b += mL_b/aF,  Vn_j_b += mR_b/aF;
+    Vn_i_b += mL_b/aF;  Vn_j_b += mR_b/aF;
     aF_b -= (mL*mL_b+mR*mR_b)/aF;

     /*--- aF,ahat,astar = f(H_i,H_j) ---*/


Escaping single quotes to avoid too much javascript messup


#86004#: performance: create curspr item set on demand

--- sw/source/core/unocore/unoobj.cxx
+++ sw/source/core/unocore/unoobj.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: unoobj.cxx,v $
  *
- *  $Revision: 1.42 $
- *
- *  last change: $Author: mib $ $Date: 2001-06-07 08:01:20 $
+ *  $Revision: 1.43 $
+ *
+ *  last change: $Author: mib $ $Date: 2001-06-12 07:30:28 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -656,14 +656,40 @@
 /* -----------------17.09.98 09:44-------------------
  *
  * --------------------------------------------------*/
+class SwTextCursorItemSet_Impl
+{
+    SwDoc *pDoc;
+    SfxItemSet* pItemSet;
+    sal_uInt16 nWhich;
+    sal_Bool bGotAttrs;
+
+public:
+    SwTextCursorItemSet_Impl( SwDoc *pD, sal_uInt16 nW ) :
+        pDoc( pD ), nWhich( nW ), pItemSet(0), bGotAttrs( sal_False ) {}
+    ~SwTextCursorItemSet_Impl()
+        {delete pItemSet;}
+
+    SfxItemSet& GetItemSet( SwPaM *pPaM=0 )
+    {
+        if( !pItemSet )
+            pItemSet = new SfxItemSet( pDoc->GetAttrPool(), nWhich, nWhich );
+        if( pPaM && !bGotAttrs )
+        {
+            SwXTextCursor::GetCrsrAttr( *pPaM, *pItemSet );
+            bGotAttrs = TRUE;
+        }
+        return *pItemSet;
+    }
+
+    SfxItemSet *GetItemSetPtr() { return pItemSet; }
+};
+
 sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertyMap* pMap,
                                 SwPaM& rPam,
-                                SfxItemSet& rSet,
-                                const uno::Any& aValue,
-                                sal_Bool& rPut ) throw (lang::IllegalArgumentException)
+                                SwTextCursorItemSet_Impl& rSet,
+                                const uno::Any& aValue ) throw (lang::IllegalArgumentException)
 {
     sal_Bool bRet = sal_True;
-    rPut = sal_True;
     if(aValue.getValueType() == ::getCppuVoidType())
         bRet = sal_False;
     else
@@ -671,11 +697,10 @@
         switch(pMap->nWID)
         {
             case RES_TXTATR_CHARFMT:
-                lcl_setCharStyle(rPam.GetDoc(), aValue, rSet);
+                lcl_setCharStyle(rPam.GetDoc(), aValue, rSet.GetItemSet() );
             break;
             case FN_UNO_PARA_STYLE :
                 lcl_SetTxtFmtColl(aValue, rPam);
-                rPut = sal_False;
             break;
             case FN_UNO_PAGE_STYLE :
             break;
@@ -717,7 +742,6 @@
                         pTxtNd->UpdateNum( aNum );

                     }
-                    rPut = sal_False;
                 }
                 //PROPERTY_MAYBEVOID!
             }
@@ -730,7 +754,6 @@
             break;
             case FN_UNO_NUM_RULES:
                 SwUnoCursorHelper::setNumberingProperty(aValue, rPam);
-                rPut = sal_False;
             break;
             case RES_PARATR_DROP:
             {
@@ -739,9 +762,10 @@
                     OUString uStyle;
                     if(aValue >>= uStyle)
                     {
+                        SfxItemSet& rItemSet = rSet.GetItemSet( &rPam );
                         SwFmtDrop* pDrop = 0;
                         const SfxPoolItem* pItem;
-                        if(SFX_ITEM_SET == rSet.GetItemState( RES_PARATR_DROP, sal_True, &pItem ) )
+                        if(SFX_ITEM_SET == rItemSet.GetItemState( RES_PARATR_DROP, sal_True, &pItem ) )
                             pDrop = new SwFmtDrop(*((SwFmtDrop*)pItem));
                         if(!pDrop)
                             pDrop = new SwFmtDrop();
@@ -752,7 +776,7 @@
                             pDrop->SetCharFmt(pStyle->GetCharFmt());
                         else
                              throw lang::IllegalArgumentException();
-                        rSet.Put(*pDrop);
+                        rItemSet.Put(*pDrop);
                         delete pDrop;
                     }
                     else
@@ -768,9 +792,10 @@
                     OUString sTmp;
                     if(aValue >>= sTmp)
                     {
+                        SfxItemSet& rItemSet = rSet.GetItemSet( &rPam );
                         SwFmtRuby* pRuby = 0;
                         const SfxPoolItem* pItem;
-                        if(SFX_ITEM_SET == rSet.GetItemState( RES_TXTATR_CJK_RUBY, sal_True, &pItem ) )
+                        if(SFX_ITEM_SET == rItemSet.GetItemState( RES_TXTATR_CJK_RUBY, sal_True, &pItem ) )
                             pRuby = new SwFmtRuby(*((SwFmtRuby*)pItem));
                         if(!pRuby)
                             pRuby = new SwFmtRuby(aEmptyStr);
@@ -782,7 +807,7 @@
                             sal_uInt16 nId = SwDoc::GetPoolId( sStyle, GET_POOLID_CHRFMT );
                             pRuby->SetCharFmtId(nId);
                         }
-                        rSet.Put(*pRuby);
+                        rItemSet.Put(*pRuby);
                         delete pRuby;
                     }
                     else
@@ -795,7 +820,8 @@
             case RES_PAGEDESC      :
             if(MID_PAGEDESC_PAGEDESCNAME == pMap->nMemberId )
             {
-                lcl_setPageDesc(rPam.GetDoc(), aValue, rSet);
+                SfxItemSet& rItemSet = rSet.GetItemSet( &rPam );
+                lcl_setPageDesc(rPam.GetDoc(), aValue, rItemSet);
                 break;
             }
             //hier kein break
@@ -1887,15 +1913,11 @@
                             rPropSet.getPropertyMap(), rPropertyName);
     if(pMap)
     {
-        SfxItemSet rSet(pDoc->GetAttrPool(),
-            pMap->nWID, pMap->nWID);
-        SwXTextCursor::GetCrsrAttr(rPaM, rSet);
-        BOOL bDef = FALSE;
-        BOOL bPut;
-        if(!lcl_setCrsrPropertyValue(pMap, rPaM, rSet, aValue, bPut ))
-            rPropSet.setPropertyValue(*pMap, aValue, rSet);
-        if(bPut)
-            SwXTextCursor::SetCrsrAttr(rPaM, rSet);
+        SwTextCursorItemSet_Impl aSet(pDoc, pMap->nWID );
+        if(!lcl_setCrsrPropertyValue( pMap, rPaM, aSet, aValue ))
+            rPropSet.setPropertyValue(*pMap, aValue, aSet.GetItemSet( &rPaM ) );
+        if( aSet.GetItemSetPtr() )
+            SwXTextCursor::SetCrsrAttr(rPaM, aSet.GetItemSet() );
     }
     else
         throw UnknownPropertyException();


Fix a typo.

Fix a typo.

sql/event_data_objects.cc:
  Fix typo.

--- sql/event_data_objects.cc
+++ sql/event_data_objects.cc
@@ -1914,7 +1914,7 @@
   thd->variables.time_zone= time_zone;

   /*
-    Peculiar initialization order is a clutch to avoid races in SHOW
+    Peculiar initialization order is a crutch to avoid races in SHOW
     PROCESSLIST which reads thd->{query/query_length} without a mutex.
   */
   thd->query_length= 0;
@@ -1974,7 +1974,7 @@
     else
     {
       /*
-        Peculiar initialization order is a clutch to avoid races in SHOW
+        Peculiar initialization order is a crutch to avoid races in SHOW
         PROCESSLIST which reads thd->{query/query_length} without a mutex.
       */
       thd->query_length= 0;


add regions to KinematicSystem

add regions to KinematicSystem

--- systems/KinematicSystem.cpp
+++ systems/KinematicSystem.cpp
@@ -10,9 +10,9 @@
 #include "angle.hpp"

 namespace kengine {
-	// declarations
+#pragma region declarations
 	static void execute(EntityManager & em, float deltaTime);
-	//
+#pragma endregion
 	EntityCreatorFunctor<64> KinematicSystem(EntityManager & em) {
 		return [&](Entity & e) {
 			e += functions::Execute{ [&](float deltaTime) { execute(em, deltaTime); } };


Added endianness output to app example

Added endianness output to app example

--- examples/application.cpp
+++ examples/application.cpp
@@ -43,9 +43,9 @@

         int someParam = 0;

-        return CommandlineParser("Solace framework example", {
+        return CommandlineParser("Solace app-framework example", {
                     CommandlineParser::printHelp(),
-                    CommandlineParser::printVersion("sol_example", getVersion()),
+                    CommandlineParser::printVersion("application", getVersion()),
                     {0, "some-param", "Some useless parameter for the demo", &someParam},
                     {'u', "name", "Name to call", &_name}
                 })
@@ -54,7 +54,12 @@
     }

     Solace::Result<int, Solace::Error> run() {
-        std::cout << "Hello ";
+        std::cout << "Hello";
+
+        if (Solace::isBigendian())
+            std::cout << ", big-endian ";
+        else
+            std::cout << ", little-endian ";

         if (_name.empty())
             std::cout << "world";


#84846# Return an empty Any for Skip hidden/protected text as they are 'direct' values

--- sw/source/core/unocore/unoobj.cxx
+++ sw/source/core/unocore/unoobj.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: unoobj.cxx,v $
  *
- *  $Revision: 1.43 $
- *
- *  last change: $Author: mib $ $Date: 2001-06-12 07:30:28 $
+ *  $Revision: 1.44 $
+ *
+ *  last change: $Author: mtg $ $Date: 2001-06-12 16:09:07 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -2262,7 +2262,9 @@
     SwUnoCrsr* pUnoCrsr = GetCrsr();
     if(pUnoCrsr)
     {
-        aRet = GetPropertyDefault(*pUnoCrsr, aPropSet, rPropertyName);
+        if( !rPropertyName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( UNO_NAME_IS_SKIP_HIDDEN_TEXT.pName ) ) &&
+            !rPropertyName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( UNO_NAME_IS_SKIP_PROTECTED_TEXT.pName ) ) )
+            aRet = GetPropertyDefault(*pUnoCrsr, aPropSet, rPropertyName);
     }
     else
         throw uno::RuntimeException();


CLI2: Tightened selection of MODIFICATION Lexer::Type::number upgrade to ID

- When a write command contains no ID/UUID, looking for Lexer::Type::number
  arguments that are tagged as MODIFICATIONS is now limited to only positive
  integers that are found.

--- src/CLI2.cpp
+++ src/CLI2.cpp
@@ -1307,12 +1307,18 @@
     {
       if (a.hasTag ("MODIFICATION"))
       {
-        if (a._lextype == Lexer::Type::number)
+        std::string raw = a.attribute ("raw");
+
+        // For a number to be an ID, it must not contain any sign or floating
+        // point elements.
+        if (a._lextype == Lexer::Type::number   &&
+            raw.find ('.') == std::string::npos &&
+            raw.find ('e') == std::string::npos &&
+            raw.find ('-') == std::string::npos)
         {
           a.unTag ("MODIFICATION");
           a.tag ("FILTER");
-          std::string number = a.attribute ("raw");
-          _id_ranges.push_back (std::pair <std::string, std::string> (number, number));
+          _id_ranges.push_back (std::pair <std::string, std::string> (raw, raw));
         }
         else if (a._lextype == Lexer::Type::set)
         {
@@ -1321,7 +1327,7 @@

           // Split the ID list into elements.
           std::vector <std::string> elements;
-          split (elements, a.attribute ("raw"), ',');
+          split (elements, raw, ',');

           for (auto& element : elements)
           {


update factory classes

update factory classes

--- _FactoryClasses.cpp
+++ _FactoryClasses.cpp
@@ -174,7 +174,7 @@
 		TOOLKIT_REGISTER_CLASS_EXPLICIT(LybidServiceMetaInfo);
 		TOOLKIT_REGISTER_CLASS_EXPLICIT(TerrestrialServiceMetaInfo);
 		TOOLKIT_REGISTER_CLASS_EXPLICIT(TricolorServiceMetaInfo);
-		TOOLKIT_REGISTER_CLASS_EXPLICIT(::stingray::Detail::any::ObjectHolder<stingray::ChannelViewingEventInfo>);
+		TOOLKIT_REGISTER_CLASS_EXPLICIT(Detail::any::ObjectHolder<stingray::ChannelViewingEventInfo>);
 		TOOLKIT_REGISTER_CLASS_EXPLICIT(PlaybackStreamContent);
 		TOOLKIT_REGISTER_CLASS_EXPLICIT(RecordStreamContent);
 		TOOLKIT_REGISTER_CLASS_EXPLICIT(RecordStreamMetaInfo);


flatten indent levels

flatten indent levels

Change-Id: I14bae5d1bf3202d38b4e81e4ad6e0084a1293956

--- sw/source/core/unocore/unotbl.cxx
+++ sw/source/core/unocore/unotbl.cxx
@@ -1246,35 +1246,24 @@

 SwXCell* SwXCell::CreateXCell(SwFrmFmt* pTblFmt, SwTableBox* pBox, SwTable *pTable )
 {
-    SwXCell* pRet = 0;
-    if(pTblFmt && pBox)
-    {
-        if( !pTable )
-            pTable = SwTable::FindTable( pTblFmt );
-        SwTableSortBoxes::const_iterator it = pTable->GetTabSortBoxes().find( pBox );
-
-        // if the box exists, then return a cell
-        if( it != pTable->GetTabSortBoxes().end() )
-        {
-            size_t const nPos = it - pTable->GetTabSortBoxes().begin();
-            SwIterator<SwXCell,SwFmt> aIter( *pTblFmt );
-            SwXCell* pXCell = aIter.First();
-            while( pXCell )
-            {
-                // is there already a proper cell?
-                if(pXCell->GetTblBox() == pBox)
-                    break;
-                pXCell = aIter.Next();
-            }
-            // otherwise create it
-            if(!pXCell)
-            {
-                pXCell = new SwXCell(pTblFmt, pBox, nPos);
-            }
-            pRet = pXCell;
-        }
-    }
-    return pRet;
+    if(!pTblFmt || !pBox)
+        return nullptr;
+    if( !pTable )
+        pTable = SwTable::FindTable( pTblFmt );
+    SwTableSortBoxes::const_iterator it = pTable->GetTabSortBoxes().find( pBox );
+    if( it == pTable->GetTabSortBoxes().end() )
+        return nullptr;
+    // if the box exists, then return a cell
+    SwIterator<SwXCell,SwFmt> aIter( *pTblFmt );
+    for(SwXCell* pXCell = aIter.First(); pXCell; pXCell = aIter.Next())
+    {
+        // is there already a proper cell?
+        if(pXCell->GetTblBox() == pBox)
+            return pXCell;
+    }
+    // otherwise create it
+    size_t const nPos = it - pTable->GetTabSortBoxes().begin();
+    return new SwXCell(pTblFmt, pBox, nPos);
 }

 /** search if a box exists in a table


Define initial window dimensions

Define initial window dimensions

--- GUI/main.cpp
+++ GUI/main.cpp
@@ -1,7 +1,10 @@
 #include <SFML/Graphics.hpp>

+#define WINDOW_WIDTH 400
+#define WINDOW_HEIGHT 400
+
 int main() {
-	sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
+	sf::RenderWindow window(sf::VideoMode(WINDOW_WIDTH, WINDOW_HEIGHT), "Ninja Chess");
 	sf::CircleShape shape(100.f);
 	shape.setFillColor(sf::Color::Green);


Complete use of DefaultNumbering component

--- sw/source/filter/html/htmlftn.cxx
+++ sw/source/filter/html/htmlftn.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: htmlftn.cxx,v $
  *
- *  $Revision: 1.1.1.1 $
- *
- *  last change: $Author: hr $ $Date: 2000-09-18 17:14:55 $
+ *  $Revision: 1.2 $
+ *
+ *  last change: $Author: os $ $Date: 2001-02-26 07:35:34 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -169,10 +169,10 @@
         switch( nPart )
         {
         case 0:
-            rInfo.aFmt.eType = bEndNote ? SVX_NUM_ROMAN_LOWER : SVX_NUM_ARABIC;
+            rInfo.aFmt.SetNumberingType(bEndNote ? SVX_NUM_ROMAN_LOWER : SVX_NUM_ARABIC);
             if( aPart.Len() )
-                rInfo.aFmt.eType = (SvxExtNumType)SwHTMLParser::GetNumType( aPart,
-                                                             rInfo.aFmt.eType );
+                rInfo.aFmt.SetNumberingType(SwHTMLParser::GetNumType( aPart,
+                                                             rInfo.aFmt.GetNumberingType() ));
             break;

         case 1:
@@ -547,7 +547,7 @@
                                  BOOL bEndNote  )
 {
     USHORT nParts = 0;
-    SvxExtNumType eFmt = rInfo.aFmt.eType;
+    sal_Int16 eFmt = rInfo.aFmt.GetNumberingType();
     if( (bEndNote ? SVX_NUM_ROMAN_LOWER : SVX_NUM_ARABIC) != eFmt )
     {
         const sal_Char *pStr = SwHTMLWriter::GetNumFormat( eFmt );
@@ -660,30 +660,3 @@
     }
 }

-/*************************************************************************
-
-      $Log: not supported by cvs2svn $
-      Revision 1.6  2000/09/18 16:04:45  willem.vandorp
-      OpenOffice header added.
-
-      Revision 1.5  2000/04/10 12:20:56  mib
-      unicode
-
-      Revision 1.4  1999/09/21 09:49:49  mib
-      multiple text encodings
-
-      Revision 1.3  1999/09/17 12:13:24  mib
-      support of multiple and non system text encodings
-
-      Revision 1.2  1998/11/17 09:44:36  OS
-      #58263# NumType durch SvxExtNumType ersetzt
-
-
-      Rev 1.1   17 Nov 1998 10:44:36   OS
-   #58263# NumType durch SvxExtNumType ersetzt
-
-      Rev 1.0   02 Nov 1998 17:21:20   MIB
-   #58480#: Fuss-/Endnoten
-
-*************************************************************************/
-


delete include

delete include

--- HtmlFile2/htmlfile2.cpp
+++ HtmlFile2/htmlfile2.cpp
@@ -1,5 +1,4 @@
 #include "htmlfile2.h"
-#include "htmlfile_private.h"

 #include <string>
 #include <cwctype>


INTEGRATION: CWS mullingarfilterteam18 (1.3.444); FILE MERGED 2003/11/17 13:59:26 cmc 1.3.444.1: #i9055# add dtor to SwWriteTable

--- sw/source/filter/inc/wrtswtbl.hxx
+++ sw/source/filter/inc/wrtswtbl.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: wrtswtbl.hxx,v $
  *
- *  $Revision: 1.3 $
- *
- *  last change: $Author: cmc $ $Date: 2002-11-18 15:17:35 $
+ *  $Revision: 1.4 $
+ *
+ *  last change: $Author: obo $ $Date: 2004-01-13 16:46:57 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -359,6 +359,7 @@
                     BOOL bRel, USHORT nMaxDepth = USHRT_MAX,
                     USHORT nLeftSub=0, USHORT nRightSub=0 );
     SwWriteTable( const SwHTMLTableLayout *pLayoutInfo );
+    virtual ~SwWriteTable();

     const SwWriteTableCols& GetCols() const { return aCols; }
     const SwWriteTableRows& GetRows() const { return aRows; }


[rdrawable] no need mutable specifier for weak_ptr in AttributesVisitor

--- graf2d/gpadv7/v7/inc/ROOT/RDrawingAttr.hxx
+++ graf2d/gpadv7/v7/inc/ROOT/RDrawingAttr.hxx
@@ -443,7 +443,7 @@
 /** Access to drawable attributes, never should be stored */
 class RAttributesVisitor {

-   mutable std::weak_ptr<RDrawableAttributes::Record_t> fWeak;     ///<! weak pointer on container
+   std::weak_ptr<RDrawableAttributes::Record_t> fWeak;             ///<! weak pointer on container
    mutable std::shared_ptr<RDrawableAttributes::Record_t> fCont;   ///<! by first access to container try to get shared ptr
    mutable bool fFirstTime{true};                                  ///<! only first time try to lock weak ptr
    std::string fPrefix;                                            ///<! name prefix for all attributes values


INTEGRATION: CWS carlowfilterteam27 (1.15.118); FILE MERGED 2004/08/11 13:56:08 mmaher 1.15.118.2: RESYNC: (1.15-1.17); FILE MERGED 2004/05/07 09:26:48 mmaher 1.15.118.1: #i17371# Workaround for a nested field (pageref in a hyperlink)

--- sw/source/filter/rtf/swparrtf.hxx
+++ sw/source/filter/rtf/swparrtf.hxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: swparrtf.hxx,v $
  *
- *  $Revision: 1.18 $
- *
- *  last change: $Author: obo $ $Date: 2004-08-12 12:51:08 $
+ *  $Revision: 1.19 $
+ *
+ *  last change: $Author: rt $ $Date: 2004-08-20 11:49:29 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -346,6 +346,8 @@
     SwPaM*  pPam;               // SwPosition duerfte doch reichen, oder ??
     SwRelNumRuleSpaces* pRelNumRule;    // Liste aller benannten NumRules

+    String sNestedFieldStr;
+
     USHORT nAktPageDesc, nAktFirstPageDesc;
     USHORT nAktBox;         // akt. Box
     USHORT nInsTblRow;      // beim nach \row kein \pard -> neue Line anlegen
@@ -362,6 +364,7 @@
     bool bNewNumList;       // Word 7.0 NumList gelesen, 6.0 ueberspringen
     bool bFirstContinue;    // 1.Call ins Continue
     bool bContainsPara;     // If there is no paragraph in the section
+    bool bNestedField;

     /*
      #i9243#


BUG: Fixed crash on invalid input.

BUG: Fixed crash on invalid input.

--- IO/vtkXMLDataParser.cxx
+++ IO/vtkXMLDataParser.cxx
@@ -23,7 +23,7 @@
 #include "vtkBase64InputStream.h"
 #include "vtkDataCompressor.h"

-vtkCxxRevisionMacro(vtkXMLDataParser, "1.6");
+vtkCxxRevisionMacro(vtkXMLDataParser, "1.7");
 vtkStandardNewMacro(vtkXMLDataParser);
 vtkCxxSetObjectMacro(vtkXMLDataParser, Compressor, vtkDataCompressor);

@@ -104,7 +104,7 @@
   int result = this->Superclass::Parse();

   // Check that the input is okay.
-  if(!this->CheckPrimaryAttributes())
+  if(result && !this->CheckPrimaryAttributes())
     {
     result = 0;
     }


Fixed build.

Fixed build.

--- tools/bin2c/bin2c.cpp
+++ tools/bin2c/bin2c.cpp
@@ -7,7 +7,7 @@
 #include <vector>

 #include <bx/commandline.h>
-#include <bx/crtimpl.h>
+#include <bx/file.h>
 #include <bx/string.h>

 class Bin2cWriter : public bx::WriterI


now using EscherPropertyContainer to create the ESCHER_OPT atom

--- sw/source/filter/ww8/wrtw8esh.cxx
+++ sw/source/filter/ww8/wrtw8esh.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: wrtw8esh.cxx,v $
  *
- *  $Revision: 1.4 $
+ *  $Revision: 1.5 $
  *
- *  last change: $Author: khz $ $Date: 2000-11-13 10:11:28 $
+ *  last change: $Author: sj $ $Date: 2000-12-11 14:31:03 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -959,8 +959,8 @@
     void WriteGrfFlyFrame( const SwFrmFmt& rFmt, UINT32 nShapeId );
     void WriteOLEFlyFrame( const SwFrmFmt& rFmt, UINT32 nShapeId );
     void WriteOCXControl( const SwFrmFmt& rFmt, UINT32 nShapeId );
-    void WriteFlyFrameAttr( const SwFrmFmt& rFmt );
-    void WriteGrfAttr( const SwNoTxtNode& rNd );
+    void WriteFlyFrameAttr( const SwFrmFmt& rFmt, EscherPropertyContainer& rPropOpt );
+    void WriteGrfAttr( const SwNoTxtNode& rNd, EscherPropertyContainer& rPropOpt );

     UINT32 WriteFlyFrm( const SwFrmFmt& rFmt );

@@ -1026,12 +1026,16 @@
 {
     Init();
     OpenContainer( ESCHER_DggContainer );
-        BeginCount();
-        AddColor( 0x08000004 );
-        AddColor( 0x08000001 );
-        AddColor( 0x08000002 );
-        AddColor( 0x100000f7 );
-        EndCount( ESCHER_SplitMenuColors );
+
+    sal_uInt16 nColorCount = 4;
+    *pStrm  << (sal_uInt16)( nColorCount << 4 )     // instance
+            << (sal_uInt16)ESCHER_SplitMenuColors   // record type
+            << (sal_uInt32)( nColorCount * 4 )      // size
+            << (sal_uInt32)0x08000004
+            << (sal_uInt32)0x08000001
+            << (sal_uInt32)0x08000002
+            << (sal_uInt32)0x100000f7;
+
     CloseContainer();   // ESCHER_DggContainer

     BYTE i = 2;     // for header/footer and the other
@@ -1101,25 +1105,25 @@

                     AddShape( ESCHER_ShpInst_Rectangle, 0xe00, nSecondShapeId );

-                    BeginCount();
+                    EscherPropertyContainer aPropOpt;
                     // default Fuellfarbe ist das StarOffice blau7
                     // ----> von DrawingLayer besorgen !!
-                    AddOpt( ESCHER_Prop_fillColor, 0xffb800 );
-                    AddOpt( ESCHER_Prop_fillBackColor, 0 );
-                    AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00100010 );
-                    AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
-                    AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080008 );
-                    AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
-                    AddOpt( ESCHER_Prop_lineWidth, 0 );
+                    aPropOpt.AddOpt( ESCHER_Prop_fillColor, 0xffb800 );
+                    aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0 );
+                    aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x00100010 );
+                    aPropOpt.AddOpt( ESCHER_Prop_lineColor, 0x8000001 );
+                    aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x00080008 );
+                    aPropOpt.AddOpt( ESCHER_Prop_shadowColor, 0x8000002 );
+                    aPropOpt.AddOpt( ESCHER_Prop_lineWidth, 0 );

 // winword defaults!
-//                  AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
-//                  AddOpt( ESCHER_Prop_lineWidth, 0 );
-//                  AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
-//                  AddOpt( ESCHER_Prop_bWMode, 0x9 );
-//                  AddOpt( ESCHER_Prop_fBackground, 0x10001 );
-
-                    EndCount( ESCHER_OPT, 3 );
+//                  aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
+//                  aPropOpt.AddOpt( ESCHER_Prop_lineWidth, 0 );
+//                  aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
+//                  aPropOpt.AddOpt( ESCHER_Prop_bWMode, 0x9 );
+//                  aPropOpt.AddOpt( ESCHER_Prop_fBackground, 0x10001 );
+
+                    aPropOpt.Commit( *pStrm );

                     AddAtom( 4, ESCHER_ClientData );
                     GetStream() << 1L;
@@ -1751,22 +1755,17 @@
     OpenContainer( ESCHER_SpContainer );

     AddShape( ESCHER_ShpInst_TextBox, 0xa00, nShapeId );
-
-    BeginCount();
-
-    AddOpt( ESCHER_Prop_lTxid, nTxtBox );
-
+    EscherPropertyContainer aPropOpt;
+    aPropOpt.AddOpt( ESCHER_Prop_lTxid, nTxtBox );
     const VoidPtr pNext = rFmt.GetChain().GetNext();
     if( pNext )
     {
         USHORT nPos = aSortFmts.GetPos( pNext );
         if( USHRT_MAX != nPos && aFollowShpIds[ nPos ] )
-            AddOpt( ESCHER_Prop_hspNext, aFollowShpIds[ nPos ] );
-    }
-
-    WriteFlyFrameAttr( rFmt );
-
-    EndCount( ESCHER_OPT, 3 );
+            aPropOpt.AddOpt( ESCHER_Prop_hspNext, aFollowShpIds[ nPos ] );
+    }
+    WriteFlyFrameAttr( rFmt, aPropOpt );
+    aPropOpt.Commit( GetStream() );

     // store anchor attribute
     WriteFrmExtraData( rFmt );
@@ -1784,7 +1783,7 @@

     AddShape( ESCHER_ShpInst_PictureFrame, 0xa00, nShapeId );

-    BeginCount();
+    EscherPropertyContainer aPropOpt;

     UINT32 nFlags = ESCHER_BlipFlagDefault;
     SwNodeIndex aIdx( *rFmt.GetCntnt().GetCntntIdx(), 1 );
@@ -1802,22 +1801,20 @@
         BYTE* pArr = new BYTE[ nArrLen ];
         memcpy( pArr, aBuf.GetData(), nArrLen );

-        AddOpt( ESCHER_Prop_pibName, TRUE, nArrLen, pArr, nArrLen );
+        aPropOpt.AddOpt( ESCHER_Prop_pibName, TRUE, nArrLen, pArr, nArrLen );
         nFlags = ESCHER_BlipFlagLinkToFile | ESCHER_BlipFlagURL |
                     ESCHER_BlipFlagDoNotSave;
     }
     else
     {
         rGrfNd.SwapIn( TRUE );
-        AddOpt( ESCHER_Prop_pib, AddGraphic( *QueryPicStream(),
+        aPropOpt.AddOpt( ESCHER_Prop_pib, AddGraphic( *QueryPicStream(),
                                             rGrfNd.GetGrf() ), TRUE );
     }
-    AddOpt( ESCHER_Prop_pibFlags, nFlags );
-
-    WriteFlyFrameAttr( rFmt );
-    WriteGrfAttr( rGrfNd );
-
-    EndCount( ESCHER_OPT, 3 );
+    aPropOpt.AddOpt( ESCHER_Prop_pibFlags, nFlags );
+    WriteFlyFrameAttr( rFmt, aPropOpt );
+    WriteGrfAttr( rGrfNd, aPropOpt );
+    aPropOpt.Commit( GetStream() );

     // store anchor attribute
     WriteFrmExtraData( rFmt );
@@ -1838,8 +1835,7 @@

         AddShape( ESCHER_ShpInst_PictureFrame, 0xa10, nShapeId );

-        BeginCount();
-
+        EscherPropertyContainer aPropOpt;
         Size aSz( pSdrObj->GetLogicRect().GetSize() );
         aSz.Width() = DrawModelToEmu( aSz.Width() );
         aSz.Height() = DrawModelToEmu( aSz.Height() );
@@ -1848,12 +1844,10 @@
         pTxtBxs->Append( *pSdrObj, nShapeId );
         UINT32 nPicId = pTxtBxs->Count();
         nPicId *= 0x10000;
-        AddOpt( ESCHER_Prop_pictureId, nPicId );
-        AddOpt( ESCHER_Prop_pictureActive, 0x10000 );
-
-        WriteFlyFrameAttr( rFmt );
-
-        EndCount( ESCHER_OPT, 3 );
+        aPropOpt.AddOpt( ESCHER_Prop_pictureId, nPicId );
+        aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0x10000 );
+        WriteFlyFrameAttr( rFmt, aPropOpt );
+        aPropOpt.Commit( GetStream() );

         // store anchor attribute
         WriteFrmExtraData( rFmt );
@@ -1880,9 +1874,7 @@
         OpenContainer( ESCHER_SpContainer );

         AddShape( ESCHER_ShpInst_PictureFrame, 0xa10, nShapeId );
-
-        BeginCount();
-
+        EscherPropertyContainer aPropOpt;
         {
             SvMemoryStream aGrfStrm;
             WriteWindowMetafile( aGrfStrm, *pMtf );
@@ -1892,19 +1884,17 @@
             aSz.Width() = DrawModelToEmu( aSz.Width() );
             aSz.Height() = DrawModelToEmu( aSz.Height() );
             Rectangle aRect( Point(0,0), aSz );
-            AddOpt( ESCHER_Prop_pib, AddWMF( *QueryPicStream(),
+            aPropOpt.AddOpt( ESCHER_Prop_pib, AddWMF( *QueryPicStream(),
                                     pMem + 22, nLen - 22, aRect ), TRUE );
         }
         pTxtBxs->Append( *pSdrObj, nShapeId );
         UINT32 nPicId = pTxtBxs->Count();
         nPicId *= 0x10000;
-        AddOpt( ESCHER_Prop_pictureId, nPicId );
-        AddOpt( ESCHER_Prop_pictureActive, 0x10000 );
-
-        WriteFlyFrameAttr( rFmt );
-        WriteGrfAttr( rOLENd );
-
-        EndCount( ESCHER_OPT, 3 );
+        aPropOpt.AddOpt( ESCHER_Prop_pictureId, nPicId );
+        aPropOpt.AddOpt( ESCHER_Prop_pictureActive, 0x10000 );
+        WriteFlyFrameAttr( rFmt, aPropOpt );
+        WriteGrfAttr( rOLENd, aPropOpt );
+        aPropOpt.Commit( GetStream() );

         // store anchor attribute
         WriteFrmExtraData( rFmt );
@@ -1917,7 +1907,7 @@
 }

-void SwEscherEx::WriteGrfAttr( const SwNoTxtNode& rNd )
+void SwEscherEx::WriteGrfAttr( const SwNoTxtNode& rNd, EscherPropertyContainer& rPropOpt )
 {
     const SfxPoolItem* pItem;
     if( SFX_ITEM_SET == rNd.GetSwAttrSet().GetItemState( RES_GRFATR_CROPGRF,
@@ -1926,18 +1916,18 @@
         const Size aSz( rNd.GetTwipSize() );
         INT32 nVal;
         if( 0 != ( nVal = ((SwCropGrf*)pItem )->GetLeft() ) )
-            AddOpt( ESCHER_Prop_cropFromLeft, ToFract16( nVal, aSz.Width()) );
+            rPropOpt.AddOpt( ESCHER_Prop_cropFromLeft, ToFract16( nVal, aSz.Width()) );
         if( 0 != ( nVal = ((SwCropGrf*)pItem )->GetRight() ) )
-            AddOpt( ESCHER_Prop_cropFromRight, ToFract16( nVal, aSz.Width()));
+            rPropOpt.AddOpt( ESCHER_Prop_cropFromRight, ToFract16( nVal, aSz.Width()));
         if( 0 != ( nVal = ((SwCropGrf*)pItem )->GetTop() ) )
-            AddOpt( ESCHER_Prop_cropFromTop, ToFract16( nVal, aSz.Height()));
+            rPropOpt.AddOpt( ESCHER_Prop_cropFromTop, ToFract16( nVal, aSz.Height()));
         if( 0 != ( nVal = ((SwCropGrf*)pItem )->GetBottom() ) )
-            AddOpt( ESCHER_Prop_cropFromBottom, ToFract16( nVal, aSz.Height()));
+            rPropOpt.AddOpt( ESCHER_Prop_cropFromBottom, ToFract16( nVal, aSz.Height()));
     }
     // mirror ??
 }

-void SwEscherEx::WriteFlyFrameAttr( const SwFrmFmt& rFmt )
+void SwEscherEx::WriteFlyFrameAttr( const SwFrmFmt& rFmt, EscherPropertyContainer& rPropOpt )
 {
     const SfxPoolItem* pItem;
     BOOL bFirstLine = TRUE;
@@ -1955,8 +1945,8 @@
                 if( bFirstLine )
                 {
                     UINT32 nLineColor = GetColor( pLine->GetColor(), FALSE );
-                    AddOpt( ESCHER_Prop_lineColor, nLineColor );
-                    AddOpt( ESCHER_Prop_lineBackColor, nLineColor ^ 0xffffff );
+                    rPropOpt.AddOpt( ESCHER_Prop_lineColor, nLineColor );
+                    rPropOpt.AddOpt( ESCHER_Prop_lineBackColor, nLineColor ^ 0xffffff );

                     UINT32 nLineWidth;
                     ESCHER_LineStyle eStyle;
@@ -1980,23 +1970,22 @@
                         nLineWidth = pLine->GetOutWidth();
                     }

-                    AddOpt( ESCHER_Prop_lineStyle, eStyle );
-                    AddOpt( ESCHER_Prop_lineWidth, DrawModelToEmu( nLineWidth ));
+                    rPropOpt.AddOpt( ESCHER_Prop_lineStyle, eStyle );
+                    rPropOpt.AddOpt( ESCHER_Prop_lineWidth, DrawModelToEmu( nLineWidth ));

                     bFirstLine = FALSE;
                 }
-
-                AddOpt( aExhperProp[ n ], DrawModelToEmu(
-                                ((SvxBoxItem*)pItem)->GetDistance( n ) ));
+                rPropOpt.AddOpt( aExhperProp[ n ], DrawModelToEmu(
+                                    ((SvxBoxItem*)pItem)->GetDistance( n ) ));
             }
     }
     if( bFirstLine )                // no valid line found
     {
-        AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
-        AddOpt( ESCHER_Prop_dyTextTop, 0 );
-        AddOpt( ESCHER_Prop_dyTextBottom, 0 );
-        AddOpt( ESCHER_Prop_dxTextLeft, 0 );
-        AddOpt( ESCHER_Prop_dxTextRight, 0 );
+        rPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
+        rPropOpt.AddOpt( ESCHER_Prop_dyTextTop, 0 );
+        rPropOpt.AddOpt( ESCHER_Prop_dyTextBottom, 0 );
+        rPropOpt.AddOpt( ESCHER_Prop_dxTextLeft, 0 );
+        rPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 );
     }

     // write shadow
@@ -2045,46 +2034,46 @@
             else
 */
             {
-                AddOpt( ESCHER_Prop_fillBlip, AddGraphic( *QueryPicStream(),
+                rPropOpt.AddOpt( ESCHER_Prop_fillBlip, AddGraphic( *QueryPicStream(),
                                     *((SvxBrushItem*)pItem)->GetGraphic() ),
                                     TRUE );
             }
-            AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
-            AddOpt( ESCHER_Prop_fNoFillHitTest, 0x140014 );
-            AddOpt( ESCHER_Prop_fillBackColor, 0 );
+            rPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
+            rPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x140014 );
+            rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, 0 );
         }
         else if( !((SvxBrushItem*)pItem)->GetColor().GetTransparency() )
         {
             UINT32 nFillColor = GetColor( ((SvxBrushItem*)pItem)->
                                                     GetColor(), FALSE );
-            AddOpt( ESCHER_Prop_fillColor, nFillColor );
-            AddOpt( ESCHER_Prop_fillBackColor, nFillColor ^ 0xffffff );
-            AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100010 );
+            rPropOpt.AddOpt( ESCHER_Prop_fillColor, nFillColor );
+            rPropOpt.AddOpt( ESCHER_Prop_fillBackColor, nFillColor ^ 0xffffff );
+            rPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100010 );
         }
         else
         {
-            AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
+            rPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x100000 );
         }
     }

     if( SFX_ITEM_SET == rFmt.GetItemState( RES_LR_SPACE, TRUE, &pItem ))
     {
-        AddOpt( ESCHER_Prop_dxWrapDistLeft,
+        rPropOpt.AddOpt( ESCHER_Prop_dxWrapDistLeft,
                 DrawModelToEmu( ((SvxLRSpaceItem*)pItem)->GetLeft() ) );
-        AddOpt( ESCHER_Prop_dxWrapDistRight,
+        rPropOpt.AddOpt( ESCHER_Prop_dxWrapDistRight,
                 DrawModelToEmu( ((SvxLRSpaceItem*)pItem)->GetRight() ) );
     }
     if( SFX_ITEM_SET == rFmt.GetItemState( RES_UL_SPACE, TRUE, &pItem ))
     {
-        AddOpt( ESCHER_Prop_dyWrapDistTop,
+        rPropOpt.AddOpt( ESCHER_Prop_dyWrapDistTop,
                 DrawModelToEmu( ((SvxULSpaceItem*)pItem)->GetUpper() ) );
-        AddOpt( ESCHER_Prop_dyWrapDistBottom,
+        rPropOpt.AddOpt( ESCHER_Prop_dyWrapDistBottom,
                 DrawModelToEmu( ((SvxULSpaceItem*)pItem)->GetLower() ) );
     }

     const SdrObject* pObj = rFmt.FindRealSdrObject();
     if( pObj && pObj->GetLayer() == GetHellLayerId() )
-        AddOpt( ESCHER_Prop_fPrint, 0x200020 );
+        rPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x200020 );
 }

 void SwEscherEx::MakeZOrderArrAndFollowIds( const SvPtrarr& rSrcArr )
@@ -2244,11 +2233,14 @@

       Source Code Control System - Header

-      $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/ww8/wrtw8esh.cxx,v 1.4 2000-11-13 10:11:28 khz Exp $
+      $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/ww8/wrtw8esh.cxx,v 1.5 2000-12-11 14:31:03 sj Exp $

       Source Code Control System - Update

       $Log: not supported by cvs2svn $
+      Revision 1.4  2000/11/13 10:11:28  khz
+      export extended WW9-Frame-Alignment (write Escher record 0xF122)
+
       Revision 1.3  2000/10/10 16:54:06  cmc
       MSOffice 97/2000 Controls {Im|Ex}port


Fixed init for some sdl_ttf versions

Fixed init for some sdl_ttf versions

git-svn-id: f4e1a40f847802203273bde8e26df4d11611876a@1207 44470bb9-56e9-0310-a0f8-c586564d3dc6

--- src/AVGSDLFontManager.cpp
+++ src/AVGSDLFontManager.cpp
@@ -19,13 +19,13 @@
 AVGSDLFontManager::AVGSDLFontManager (const string& sFontPath)
     : AVGFontManager(sFontPath)
 {
-    if (!TTF_WasInit()) {
+//    if (!TTF_WasInit()) {
         int err = TTF_Init();
         if (err == -1) {
             AVG_TRACE(AVGPlayer::DEBUG_ERROR,
                     "Could not initialize SDL_ttf. Font support is broken.");
         }
-    }
+//    }
 }

 AVGSDLFontManager::~AVGSDLFontManager ()


struct mallinfo is not available on macosx

git-svn-id: 4e7379b20b57f8e3dde5a0b7363f233184647162@882 4e380d45-d1fd-0310-85a7-d18ec86df0ad

--- utils/malloc.cpp
+++ utils/malloc.cpp
@@ -1,5 +1,7 @@
 #include <iostream>
+#ifndef __APPLE__
 #include <malloc.h>
+#endif
 #include <cstdlib>
 #include "stxxl/bits/common/utils.h"

@@ -11,6 +13,7 @@

 void print_malloc_stats()
 {
+#ifndef __APPLE__
     struct mallinfo info = mallinfo();
     STXXL_MSG("MALLOC statistics BEGIN");
     STXXL_MSG("===============================================================");
@@ -25,6 +28,9 @@
     STXXL_MSG("number of bytes allocated but not in use       : " << info.fordblks);
     STXXL_MSG("top-most, releasable (via malloc_trim) space   : " << info.keepcost);
     STXXL_MSG("================================================================");
+#else
+    STXXL_MSG("MALLOC statistics are not supported on this platform");
+#endif
 }

 int main(int argc, char * argv[])


Bug fix for like sign V0s

Bug fix for like sign V0s

--- ITS/AliITStrackerMI.cxx
+++ ITS/AliITStrackerMI.cxx
@@ -4194,7 +4194,7 @@
     if (btrack0->GetSign()>0 && !AliITSReconstructor::GetRecoParam()->GetStoreLikeSignV0s()) continue;
     AliITStrackMI *trackc0 = (AliITStrackMI*)trackarrayc.At(itrack0);
     //
-    for (Int_t iesd1=0;iesd1<ntracks;iesd1++){
+    for (Int_t iesd1=iesd0+1;iesd1<ntracks;iesd1++){
       Int_t itrack1 = itsmap[iesd1];
       if (forbidden[itrack1]) continue;

@@ -5508,4 +5508,3 @@
   }
 return;
 }
-


added security checks

added security checks

--- src/EBot.cpp
+++ src/EBot.cpp
@@ -54,6 +54,7 @@
 }

 void EBot::rightWheelForward(int speed) {
+  speed = boundaries(speed, 0, 255);
   analogWrite(ENA, speed);
   digitalWrite(IN1, HIGH);
   digitalWrite(IN2, LOW);
@@ -66,6 +67,8 @@
 }

 void EBot::rightWheelBackward(int speed) {
+  speed = boundaries(speed, 0, 255);
+
   analogWrite(ENA, speed);
   digitalWrite(IN1, LOW);
   digitalWrite(IN2, HIGH);
@@ -84,6 +87,8 @@
 }

 void EBot::leftWheelForward(int speed) {
+  speed = boundaries(speed, 0, 255);
+
   analogWrite(ENB, speed);
   digitalWrite(IN3, LOW);
   digitalWrite(IN4, HIGH);
@@ -96,6 +101,8 @@
 }

 void EBot::leftWheelBackward(int speed) {
+  speed = boundaries(speed, 0, 255);
+
   analogWrite(ENB, speed);
   digitalWrite(IN3, HIGH);
   digitalWrite(IN4, LOW);
@@ -117,6 +124,8 @@
 }

 void EBot::forward(int speed) {
+  speed = boundaries(speed, 0, 255);
+
   analogWrite(ENA, speed);
   digitalWrite(IN1, HIGH);
   digitalWrite(IN2, LOW);
@@ -135,6 +144,8 @@
 }

 void EBot::backward(int speed) {
+  speed = boundaries(speed, 0, 255);
+
   analogWrite(ENA, speed);
   digitalWrite(IN1, LOW);
   digitalWrite(IN2, HIGH);
@@ -153,6 +164,8 @@
 }

 void EBot::rotateRight(int speed) {
+  speed = boundaries(speed, 0, 255);
+
   analogWrite(ENA, speed);
   digitalWrite(IN1, LOW);
   digitalWrite(IN2, HIGH);
@@ -171,6 +184,8 @@
 }

 void EBot::rotateLeft(int speed) {
+  speed = boundaries(speed, 0, 255);
+
   analogWrite(ENA, speed);
   digitalWrite(IN1, HIGH);
   digitalWrite(IN2, LOW);
@@ -180,8 +195,7 @@
 }

 void EBot::write(int angle) {
-  angle = angle < 0 ? 0 : angle;
-  angle = angle > 180 ? 180 : angle;
+  angle = boundaries(angle, 0, 180);

   servo.write(angle);
 }
@@ -210,3 +224,10 @@
 bool EBot::readLS3() {
   return digitalRead(LS3);
 }
+
+int EBot::boundaries(int value, int min, int max) {
+  value = value < min ? min : value;
+  value = value > max ? max : value;
+
+  return value;
+}


Add implementation for update.

Add implementation for update.

--- src/AngularInstrument.cpp
+++ src/AngularInstrument.cpp
@@ -45,6 +45,9 @@
 void AngularInstrument::draw() {
 }

+void AngularInstrument::update(float newVal) {
+}
+

 bool AngularInstrument::parseFromTree(boost::property_tree::ptree &) {
     return false;


fix resume saving issue in client_test. it would sometimes quit without first handling some remaining resume data alerts

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -185,6 +185,10 @@
 bool print_peer_rate = false;
 bool print_fails = false;
 bool print_send_bufs = true;
+
+// the number of times we've asked to save resume data
+// without having received a response (successful or failure)
+int num_outstanding_resume_data = 0;

 enum {
 	torrents_all,
@@ -777,7 +781,11 @@
 		h.pause();
 		// the alert handler for save_resume_data_alert
 		// will save it to disk
-		if (h.need_save_resume_data()) h.save_resume_data();
+		if (h.need_save_resume_data())
+		{
+			h.save_resume_data();
+			++num_outstanding_resume_data;
+		}

 		files.erase(i++);
 	}
@@ -847,9 +855,11 @@
 		// will save it to disk
 		torrent_handle h = p->handle;
 		h.save_resume_data();
+		++num_outstanding_resume_data;
 	}
 	else if (save_resume_data_alert* p = alert_cast<save_resume_data_alert>(a))
 	{
+		--num_outstanding_resume_data;
 		torrent_handle h = p->handle;
 		TORRENT_ASSERT(p->resume_data);
 		if (p->resume_data)
@@ -865,6 +875,7 @@
 	}
 	else if (save_resume_data_failed_alert* p = alert_cast<save_resume_data_failed_alert>(a))
 	{
+		--num_outstanding_resume_data;
 		torrent_handle h = p->handle;
 		if (non_files.find(h) == non_files.end()
 			&& std::find_if(files.begin(), files.end()
@@ -878,6 +889,7 @@
 		// will save it to disk
 		torrent_handle h = p->handle;
 		h.save_resume_data();
+		++num_outstanding_resume_data;
 	}
 }

@@ -1302,9 +1314,11 @@
 	std::vector<peer_info> peers;
 	std::vector<partial_piece_info> queue;

+	int tick = 0;
+
 	while (loop_limit > 1 || loop_limit == 0)
 	{
-
+		++tick;
 		handles.clear();
 		memset(counters, 0, sizeof(counters));
 		ses.get_torrent_status(&handles, boost::bind(&show_torrent, _1, torrent_filter, (int*)counters));
@@ -1470,7 +1484,10 @@
 					, end(handles.end()); i != end; ++i)
 				{
 					if (i->need_save_resume)
+					{
 						i->handle.save_resume_data();
+						++num_outstanding_resume_data;
+					}
 				}
 			}

@@ -1591,6 +1608,9 @@

 		session_status sess_stat = ses.status();

+		// in test mode, also quit when we loose the last peer
+		if (loop_limit > 1 && sess_stat.num_peers == 0 && tick > 30) break;
+
 		std::string out;
 		out = "[q] quit [i] toggle peers [d] toggle downloading pieces [p] toggle paused "
 			"[a] toggle piece bar [s] toggle download sequential [f] toggle files "
@@ -2073,7 +2093,6 @@

 	// keep track of the number of resume data
 	// alerts to wait for
-	int num_resume_data = 0;
 	int num_paused = 0;
 	int num_failed = 0;

@@ -2085,18 +2104,30 @@
 		i != temp.end(); ++i)
 	{
 		torrent_status& st = *i;
-		if (!st.handle.is_valid()) continue;
-		if (!st.has_metadata) continue;
-		if (!st.need_save_resume) continue;
+		if (!st.handle.is_valid())
+		{
+			printf("  skipping, invalid handle\n");
+			continue;
+		}
+		if (!st.has_metadata)
+		{
+			printf("  skipping %s, no metadata\n", st.handle.name().c_str());
+			continue;
+		}
+		if (!st.need_save_resume)
+		{
+			printf("  skipping %s, resume file up-to-date\n", st.handle.name().c_str());
+			continue;
+		}

 		// save_resume_data will generate an alert when it's done
 		st.handle.save_resume_data();
-		++num_resume_data;
-		printf("\r%d  ", num_resume_data);
-	}
-	printf("\nwaiting for resume data\n");
-
-	while (num_resume_data > 0)
+		++num_outstanding_resume_data;
+		printf("\r%d  ", num_outstanding_resume_data);
+	}
+	printf("\nwaiting for resume data [%d]\n", num_outstanding_resume_data);
+
+	while (num_outstanding_resume_data > 0)
 	{
 		alert const* a = ses.wait_for_alert(seconds(10));
 		if (a == 0) continue;
@@ -2115,24 +2146,24 @@
 			{
 				++num_paused;
 				printf("\rleft: %d failed: %d pause: %d "
-						, num_resume_data, num_failed, num_paused);
+					, num_outstanding_resume_data, num_failed, num_paused);
 				continue;
 			}

+			if (alert_cast<save_resume_data_failed_alert>(*i))
+			{
+				++num_failed;
+				--num_outstanding_resume_data;
+				printf("\rleft: %d failed: %d pause: %d "
+					, num_outstanding_resume_data, num_failed, num_paused);
+				continue;
+			}
+
 			save_resume_data_alert const* rd = alert_cast<save_resume_data_alert>(*i);
-			if (alert_cast<save_resume_data_failed_alert>(*i))
-			{
-				++num_failed;
-				--num_resume_data;
-				printf("\rleft: %d failed: %d pause: %d "
-					, num_resume_data, num_failed, num_paused);
-				continue;
-			}
-
 			if (!rd) continue;
-			--num_resume_data;
+			--num_outstanding_resume_data;
 			printf("\rleft: %d failed: %d pause: %d "
-				, num_resume_data, num_failed, num_paused);
+				, num_outstanding_resume_data, num_failed, num_paused);

 			if (!rd->resume_data) continue;


bug fix. Fix taken from rev. 1.32.2.1

bug fix. Fix taken from rev. 1.32.2.1

--- ITS/AliITStrackerSA.cxx
+++ ITS/AliITStrackerSA.cxx
@@ -1359,13 +1359,13 @@

 //_________________________________________________________________
 Int_t AliITStrackerSA::FindTrackLowChiSquare(TObjArray* tracklist, Int_t dim) const {
-  // returns track with lowes chi square
+  // returns track with lowers chi square
   if(dim==1){
     //AliITStrackV2* trk = (AliITStrackV2*)tracklist->At(0);
     //return trk;
     return 0;
   }
-  //if(dim==0) return 0;
+  if(dim==0) return 0;
   Double_t * chi2 = new Double_t[dim];
   Int_t * index = new Int_t[dim];
   for(Int_t i=0;i<dim;i++){
@@ -1389,10 +1389,10 @@
     }
     w++;
   }
-
+  Int_t tmp = index[dim-1];
   delete [] chi2;
   delete [] index;
-  return index[dim-1];
+  return tmp;
 }

 //__________________________________________________________


*** empty log message ***

*** empty log message ***

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

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -53,6 +53,7 @@
 #include "libtorrent/session.hpp"
 #include "libtorrent/http_settings.hpp"
 #include "libtorrent/identify_client.hpp"
+#include "libtorrent/alert_types.hpp"

 #ifdef WIN32


improve client_test rendering for checking and queued for checking torrents

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -311,8 +311,8 @@
 	int progress_chars = (progress * width + 500) / 1000;
 	bar = esc(code);
 	std::fill_n(std::back_inserter(bar), progress_chars, '#');
+	std::fill_n(std::back_inserter(bar), width - progress_chars, '-');
 	bar += esc("0");
-	std::fill_n(std::back_inserter(bar), width - progress_chars, '-');
 	return bar;
 }

@@ -1299,63 +1299,75 @@
 			if (s.num_incomplete >= 0) downloaders = s.num_incomplete;
 			else downloaders = s.list_peers - s.list_seeds;

-			snprintf(str, sizeof(str), "%-13s down: (%s%s%s) up: %s%s%s (%s%s%s) swarm: %4d:%4d"
-				"  bw queue: (%d|%d) all-time (Rx: %s%s%s Tx: %s%s%s) seed rank: %x%s\n"
-				, (paused && !auto_managed)?"paused":(paused && auto_managed)?"queued":state_str[s.state]
-				, esc("32"), add_suffix(s.total_download).c_str(), term
-				, esc("31"), add_suffix(s.upload_rate, "/s").c_str(), term
-				, esc("31"), add_suffix(s.total_upload).c_str(), term
-				, downloaders, seeds
-				, s.up_bandwidth_queue, s.down_bandwidth_queue
-				, esc("32"), add_suffix(s.all_time_download).c_str(), term
-				, esc("31"), add_suffix(s.all_time_upload).c_str(), term
-				, s.seed_rank, esc("0"));
-			out += str;
-
-			if (torrent_index != active_torrent && s.state == torrent_status::seeding) continue;
-			char const* progress_bar_color = "33"; // yellow
-			if (s.state == torrent_status::checking_files
-				|| s.state == torrent_status::downloading_metadata)
-			{
-				progress_bar_color = "35"; // magenta
-			}
-			else if (s.current_tracker.empty())
-			{
-				progress_bar_color = "31"; // red
-			}
-			else if (sess_stat.has_incoming_connections)
-			{
-				progress_bar_color = "32"; // green
-			}
-
-			snprintf(str, sizeof(str), "     %-10s: %s%-10"PRId64"%s Bytes %6.2f%% %s\n"
-				, sequential_download?"sequential":"progress"
-				, esc("32"), s.total_done, esc("0")
-				, s.progress_ppm / 10000.f
-				, progress_bar(s.progress_ppm / 1000, terminal_width - 42, progress_bar_color).c_str());
-			out += str;
-
-			if (print_piece_bar && s.progress_ppm < 1000000)
+			if (s.state != torrent_status::queued_for_checking && s.state != torrent_status::checking_files)
+			{
+				snprintf(str, sizeof(str), "%-13s down: (%s%s%s) up: %s%s%s (%s%s%s) swarm: %4d:%4d"
+					"  bw queue: (%d|%d) all-time (Rx: %s%s%s Tx: %s%s%s) seed rank: %x%s\n"
+					, (paused && !auto_managed)?"paused":(paused && auto_managed)?"queued":state_str[s.state]
+					, esc("32"), add_suffix(s.total_download).c_str(), term
+					, esc("31"), add_suffix(s.upload_rate, "/s").c_str(), term
+					, esc("31"), add_suffix(s.total_upload).c_str(), term
+					, downloaders, seeds
+					, s.up_bandwidth_queue, s.down_bandwidth_queue
+					, esc("32"), add_suffix(s.all_time_download).c_str(), term
+					, esc("31"), add_suffix(s.all_time_upload).c_str(), term
+					, s.seed_rank, esc("0"));
+				out += str;
+
+				if (torrent_index != active_torrent && s.state == torrent_status::seeding) continue;
+				char const* progress_bar_color = "33"; // yellow
+				if (s.state == torrent_status::downloading_metadata)
+				{
+					progress_bar_color = "35"; // magenta
+				}
+				else if (s.current_tracker.empty())
+				{
+					progress_bar_color = "31"; // red
+				}
+				else if (sess_stat.has_incoming_connections)
+				{
+					progress_bar_color = "32"; // green
+				}
+
+				snprintf(str, sizeof(str), "     %-10s: %s%-10"PRId64"%s Bytes %6.2f%% %s\n"
+					, sequential_download?"sequential":"progress"
+					, esc("32"), s.total_done, esc("0")
+					, s.progress_ppm / 10000.f
+					, progress_bar(s.progress_ppm / 1000, terminal_width - 42, progress_bar_color).c_str());
+				out += str;
+			}
+			else
+			{
+				snprintf(str, sizeof(str), "%-13s %s\n"
+					, state_str[s.state]
+					, progress_bar(s.progress_ppm / 1000, terminal_width - 42 - 20, "35").c_str());
+				out += str;
+			}
+
+			if (print_piece_bar && s.progress_ppm < 1000000 && s.progress > 0)
 			{
 				out += "     ";
 				out += piece_bar(s.pieces, terminal_width - 7);
 				out += "\n";
 			}

-			boost::posix_time::time_duration t = s.next_announce;
-			snprintf(str, sizeof(str)
-				, "     peers: %s%d%s (%s%d%s) seeds: %s%d%s distributed copies: %s%4.2f%s "
+			if (s.state != torrent_status::queued_for_checking && s.state != torrent_status::checking_files)
+			{
+				boost::posix_time::time_duration t = s.next_announce;
+				snprintf(str, sizeof(str)
+					, "     peers: %s%d%s (%s%d%s) seeds: %s%d%s distributed copies: %s%4.2f%s "
 					"sparse regions: %d download: %s%s%s next announce: %s%02d:%02d:%02d%s "
 					"tracker: %s%s%s\n"
-				, esc("37"), s.num_peers, esc("0")
-				, esc("37"), s.connect_candidates, esc("0")
-				, esc("37"), s.num_seeds, esc("0")
-				, esc("37"), s.distributed_copies, esc("0")
-				, s.sparse_regions
-				, esc("32"), add_suffix(s.download_rate, "/s").c_str(), esc("0")
-				, esc("37"), t.hours(), t.minutes(), t.seconds(), esc("0")
-				, esc("36"), s.current_tracker.c_str(), esc("0"));
-			out += str;
+					, esc("37"), s.num_peers, esc("0")
+					, esc("37"), s.connect_candidates, esc("0")
+					, esc("37"), s.num_seeds, esc("0")
+					, esc("37"), s.distributed_copies, esc("0")
+					, s.sparse_regions
+					, esc("32"), add_suffix(s.download_rate, "/s").c_str(), esc("0")
+					, esc("37"), t.hours(), t.minutes(), t.seconds(), esc("0")
+					, esc("36"), s.current_tracker.c_str(), esc("0"));
+				out += str;
+			}

 			if (torrent_index != active_torrent) continue;
 			active_handle = h;


added download rate limit per torrent

added download rate limit per torrent

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

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -423,7 +423,8 @@
 	, bool compact_mode
 	, path const& save_path
 	, bool monitored_dir
-	, int torrent_upload_limit) try
+	, int torrent_upload_limit
+	, int torrent_download_limit) try
 {
 	using namespace libtorrent;

@@ -458,6 +459,7 @@
 	h.set_ratio(preferred_ratio);
 	h.set_sequenced_download_threshold(15);
 	h.set_upload_limit(torrent_upload_limit);
+	h.set_download_limit(torrent_download_limit);
 #ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
 	h.resolve_countries(true);
 #endif
@@ -470,7 +472,8 @@
 	, float preferred_ratio
 	, bool compact_mode
 	, path const& save_path
-	, int torrent_upload_limit)
+	, int torrent_upload_limit
+	, int torrent_download_limit)
 {
 	std::set<std::string> valid;

@@ -491,7 +494,7 @@
 		// the file has been added to the dir, start
 		// downloading it.
 		add_torrent(ses, handles, file, preferred_ratio, compact_mode
-			, save_path, true, torrent_upload_limit);
+			, save_path, true, torrent_upload_limit, torrent_download_limit);
 		valid.insert(file);
 	}

@@ -539,6 +542,7 @@
 	int download_limit;
 	int upload_limit;
 	int torrent_upload_limit;
+	int torrent_download_limit;
 	int upload_slots_limit;
 	int half_open_limit;
 	std::string save_path_str;
@@ -571,6 +575,8 @@
 			, "the maximum upload rate given in kB/s. 0 means infinite.")
 		("max-torrent-upload-rate", po::value<int>(&torrent_upload_limit)->default_value(20)
 			, "the maximum upload rate for an individual torrent, given in kB/s. 0 means infinite.")
+		("max-torrent-download-rate", po::value<int>(&torrent_download_limit)->default_value(20)
+			, "the maximum download rate for an individual torrent, given in kB/s. 0 means infinite.")
 		("max-upload-slots", po::value<int>(&upload_slots_limit)->default_value(8)
 			, "the maximum number of upload slots. 0 means infinite.")
 		("save-path,s", po::value<std::string>(&save_path_str)->default_value("./")
@@ -627,10 +633,12 @@
 		if (preferred_ratio != 0 && preferred_ratio < 1.f) preferred_ratio = 1.f;
 		upload_limit *= 1000;
 		torrent_upload_limit *= 1000;
+		torrent_download_limit *= 1000;
 		download_limit *= 1000;
 		if (download_limit <= 0) download_limit = -1;
 		if (upload_limit <= 0) upload_limit = -1;
 		if (torrent_upload_limit <= 0) torrent_upload_limit = -1;
+		if (torrent_download_limit <= 0) torrent_download_limit = -1;
 		if (poll_interval < 2) poll_interval = 2;
 		if (wait_retry < 0) wait_retry = 0;
 		if (half_open_limit < 1) half_open_limit = -1;
@@ -835,6 +843,7 @@
 					h.set_ratio(preferred_ratio);
 					h.set_sequenced_download_threshold(15);
 					h.set_upload_limit(torrent_upload_limit);
+					h.set_download_limit(torrent_download_limit);
 					continue;
 				}
 				boost::cmatch what;
@@ -852,12 +861,13 @@
 					h.set_ratio(preferred_ratio);
 					h.set_sequenced_download_threshold(15);
 					h.set_upload_limit(torrent_upload_limit);
+					h.set_download_limit(torrent_download_limit);
 					continue;
 				}
 				// if it's a torrent file, open it as usual
 				add_torrent(ses, handles, i->c_str(), preferred_ratio
 					, compact_allocation_mode ? storage_mode_compact : storage_mode_sparse
-					, save_path, false, torrent_upload_limit);
+					, save_path, false, torrent_upload_limit, torrent_download_limit);
 			}
 			catch (std::exception& e)
 			{
@@ -1195,7 +1205,8 @@
 				&& next_dir_scan < time_now())
 			{
 				scan_dir(monitor_dir, ses, handles, preferred_ratio
-					, compact_allocation_mode, save_path, torrent_upload_limit);
+					, compact_allocation_mode, save_path, torrent_upload_limit
+					, torrent_download_limit);
 				next_dir_scan = time_now() + seconds(poll_interval);
 			}
 		}


documentation

documentation

--- IslandMUD/utilities.cpp
+++ IslandMUD/utilities.cpp
@@ -73,9 +73,13 @@
 }
 std::string U::get_singular_for(const std::string & noun)
 {
+	// We're doing a reverse-lookup here. Not very efficient, but oh well.
+
+	// for each singular/plural pair
 	for (const auto & pair : C::articles)
 	{
-		if (pair.second == noun) return pair.first;
+		// if the plural matches the passed noun
+		if (pair.second == noun) return pair.first; // return the singular form of the passed plural
 	}

 	return noun; // return the original word if the singular form could not be found


create directory for resume files

create directory for resume files

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -1061,6 +1061,11 @@
 		++i; // skip the argument
 	}

+	// create directory for resume files
+	create_directory(combine_path(save_path, ".resume/"), ec);
+	if (ec)
+		fprintf(stderr, "failed to create resume file directory: %s\n", ec.message().c_str());
+
 	ses.start_lsd();
 	if (start_upnp)
 	{


Eval

Eval

- Protection against array overrun.
- Typo in diagnostic output.

--- src/Eval.cpp
+++ src/Eval.cpp
@@ -711,7 +711,8 @@
         std::cout << "#                     " << infix[i].first << "\n";

       ++i;
-      if (parseLogical (infix, i))
+      if (i < infix.size () &&
+          parseLogical (infix, i))
       {
         if (i < infix.size () &&
             infix[i].first == ")")
@@ -734,7 +735,7 @@
         if ((*source) (infix[i].first, v))
         {
           if (_debug)
-            std::cout << "#                     " << infix[i].first << "' --> '" << (std::string) v << "'\n";
+            std::cout << "#                     '" << infix[i].first << "' --> '" << (std::string) v << "'\n";
           found = true;
           break;
         }


fix client_test build on windows

fix client_test build on windows

git-svn-id: 0f340b5413dfe41c73e779333638e6920713caeb@10540 a83610d8-ad2a-0410-a6ab-fc0612d85776

--- examples/client_test.cpp
+++ examples/client_test.cpp
@@ -38,6 +38,8 @@

 #ifdef TORRENT_WINDOWS
 #include <direct.h> // for _mkdir
+#include <sys/types.h> // for _stat
+#include <sys/stat.h>
 #endif

 #ifdef _MSC_VER


Add security checks

Add security checks

--- src/CaptureDeviceImpl.cpp
+++ src/CaptureDeviceImpl.cpp
@@ -199,9 +199,14 @@
     resetError();
     if (!isDeviceOpen())
     {
-        return false;
-    }
-    pipeline->setSink(sink);
+        tcam_log(TCAM_LOG_ERROR, "Device is not open");
+        return false;
+    }
+
+    if (!pipeline->setSink(sink))
+    {
+        return false;
+    }

     return pipeline->set_status(TCAM_PIPELINE_PLAYING);
 }


Gfdi: Cleanup and c++11-ify

Gfdi: Cleanup and c++11-ify


add keep-alive http header on all requests

--- src/Http.cpp
+++ src/Http.cpp
@@ -271,6 +271,7 @@
 	req->method(method);
 	req->target("/api/v6" + url);
 	req->version(11);
+	req->insert("Connection", "keep-alive");
 	req->insert("Host", "discordapp.com");
 	req->insert("User-Agent", "DiscordBot (github.com/maddinat0r/samp-discord-connector, " PLUGIN_VERSION ")");
 	if (!content.empty())


fix HTTP request retry logic

fix HTTP request retry logic

fixes #29

--- src/Http.cpp
+++ src/Http.cpp
@@ -59,10 +59,13 @@
 			}

 			boost::system::error_code error_code;
+			Response_t response;
+			Streambuf_t sb;
 			retry_counter = 0;
 			skip_entry = false;
 			do
 			{
+				bool do_reconnect = false;
 				beast::http::write(m_SslStream, *entry->Request, error_code);
 				if (error_code)
 				{
@@ -71,7 +74,24 @@
 						entry->Request->target().to_string(),
 						error_code.message());

-					// try reconnecting
+					do_reconnect = true;
+				}
+				else
+				{
+					beast::http::read(m_SslStream, sb, response, error_code);
+					if (error_code)
+					{
+						CLog::Get()->Log(LogLevel::ERROR, "Error while retrieving HTTP {} response from '{}': {}",
+							entry->Request->method_string().to_string(),
+							entry->Request->target().to_string(),
+							error_code.message());
+
+						do_reconnect = true;
+					}
+				}
+
+				if (do_reconnect)
+				{
 					if (retry_counter++ >= MaxRetries || !ReconnectRetry())
 					{
 						// we failed to reconnect, discard this request
@@ -85,33 +105,7 @@
 			if (skip_entry)
 				continue; // continue queue loop

-			Streambuf_t sb;
-			Response_t response;
-			retry_counter = 0;
-			skip_entry = false;
-			do
-			{
-				beast::http::read(m_SslStream, sb, response, error_code);
-				if (error_code)
-				{
-					CLog::Get()->Log(LogLevel::ERROR, "Error while retrieving HTTP {} response from '{}': {}",
-						entry->Request->method_string().to_string(),
-						entry->Request->target().to_string(),
-						error_code.message());
-
-					// try reconnecting
-					if (retry_counter++ >= MaxRetries || !ReconnectRetry())
-					{
-						// we failed to reconnect, discard this request
-						CLog::Get()->Log(LogLevel::WARNING, "Failed to read response, discarding");
-						it = m_Queue.erase(it);
-						skip_entry = true;
-						break; // break out of do-while loop
-					}
-				}
-			} while (error_code);
-			if (skip_entry)
-				continue; // continue queue loop
+

 			auto it_r = response.find("X-RateLimit-Remaining");
 			if (it_r != response.end())


Corrections to info text coordinate calculation.

--- src/Info.cpp
+++ src/Info.cpp
@@ -32,7 +32,7 @@
 #define INFO_TEXT_COLOR_B 1.00f
 #define INFO_TEXT_COLOR_A 0.50f

-#define SPACING_COEF 1.13f
+#define SPACING_COEF 1.15f
 #define LINES_AFTER_NAME 1.00f

@@ -184,6 +184,7 @@
 	float tw;
 	nametext.GetTextSize(text,&tw,NULL);
 	int th=(int)NAME_FONT_SIZE;
+
 	if (x) *x=(int)(WINDOW_POS_X1+(WINDOW_WIDTH-tw)*0.5f);
 	if (y) *y=(int)(WINDOW_POS_Y2-MARGIN_HEIGHT)-th;
 }
@@ -194,19 +195,23 @@

 void CInfo::GetInfoCoords(int linenum, int *x, int *y)
 {
-	int namey;
-	GetNameCoords(" ",NULL,&namey);
+	int ymargin=(int)(WINDOW_POS_Y2-MARGIN_HEIGHT);
+
+	float nameheight;
+	nametext.GetTextSize("",NULL,&nameheight);
+
 	float nameadd;
-	nametext.GetTextSize(" ",NULL,&nameadd);
-	nameadd*=(SPACING_COEF*LINES_AFTER_NAME);
+	nameadd=nameheight*SPACING_COEF*LINES_AFTER_NAME;
+
+	int ioffset=(int)INFO_FONT_SIZE;

 	float th;
-	infotext.GetTextSize(" ",NULL,&th);
+	infotext.GetTextSize("",NULL,&th);
 	th*=SPACING_COEF;
 	int thi=(int)th*(linenum-1);

 	if (x) *x=(int)(WINDOW_POS_X1+MARGIN_WIDTH);
-	if (y) *y=namey-(int)nameadd-thi;
+	if (y) *y=ymargin-(int)nameadd-ioffset-thi;
 }


Fix crash when m_enabledAccounts is still null.

--- KTp/global-presence.cpp
+++ KTp/global-presence.cpp
@@ -323,7 +323,7 @@

 bool GlobalPresence::hasEnabledAccounts() const
 {
-    if (m_enabledAccounts->accounts().isEmpty()) {
+    if (m_enabledAccounts.isNull() || m_enabledAccounts->accounts().isEmpty()) {
         return false;
     }


Updated a dependency name.

Updated a dependency name.

--- src/Main.cpp
+++ src/Main.cpp
@@ -1,4 +1,4 @@
-#include <Utilities/Common.h>
+#include <ArkeIndustries.CPPUtilities/Common.h>

 #include <string>
 #include <iostream>


increase number of iterations to push runtime towards paper runtimes

Signed-off-by: Till Kolditz <7b85ceac831024ffa0d5e713226b8993369853f4@gmail.com>

--- src/Main.cpp
+++ src/Main.cpp
@@ -108,7 +108,7 @@
         int argc,
         char* argv[]) {
     const constexpr size_t numElements = 1000001ull;
-    const constexpr size_t iterations = 256ull;
+    const constexpr size_t iterations = 10000ull;
     const constexpr size_t UNROLL_LO = 1ull;
     const constexpr size_t UNROLL_HI = 1024ull;


HARMONY-1918

HARMONY-1918

Throw verifyError when class extends a final class

Ubuntu 6 - smoke, c-unit, ~kernel

svn path=/incubator/harmony/enhanced/drlvm/trunk/; revision=471500

--- vm/vmcore/src/class_support/classloader.cpp
+++ vm/vmcore/src/class_support/classloader.cpp
@@ -473,8 +473,16 @@
             }
             return false;
         }
-        if(class_is_interface(superClass) || class_is_final(superClass)) {
-            REPORT_FAILED_CLASS_CLASS(this, clss, "java/lang/IncompatibleClassChangeError", clss->name->bytes);
+        if(class_is_interface(superClass)) {
+            REPORT_FAILED_CLASS_CLASS(this, clss, "java/lang/IncompatibleClassChangeError",
+                "class " << clss->name->bytes << " has interface "
+                << superClass->name->bytes << " as super class");
+            return false;
+        }
+        if(class_is_final(superClass)) {
+            REPORT_FAILED_CLASS_CLASS(this, clss, "java/lang/VerifyError",
+                clss->name->bytes << " : try to inherit final class "
+                << superClass->name->bytes);
             return false;
         }
         if(!class_verify(env, superClass)) return false;


Properly initialize Ruby

Properly initialize Ruby

--- src/Ruby.cpp
+++ src/Ruby.cpp
@@ -13,14 +13,11 @@

 void Ruby::Init(Handle<Object> module)
 {
-  int argc = 0;
-  char** argv = NULL;
-
-  // TODO: Do we need to call this?
-  ruby_sysinit(&argc, &argv);
+  static char* argv[] = { (char*)"norby", (char*)"-e", (char*)"" };
+
   RUBY_INIT_STACK;
   ruby_init();
-  ruby_init_loadpath();
+  ruby_options(3, argv);

   BLOCK_WRAPPER_CLASS = rb_define_class("BlockWrapper", rb_cObject);


Expand driver options, add mode to print preprocessed output

--- tools/driver/main.cpp
+++ tools/driver/main.cpp
@@ -13,12 +13,68 @@

 using namespace slang;

+bool runPreprocessor(SourceManager& sourceManager, const Bag& options,
+                    const std::vector<SourceBuffer>& buffers) {
+    BumpAllocator alloc;
+    DiagnosticWriter writer(sourceManager);
+
+    bool success = true;
+    for (const SourceBuffer& buffer : buffers) {
+        Diagnostics diagnostics;
+        Preprocessor preprocessor(sourceManager, alloc, diagnostics, options);
+        preprocessor.pushSource(buffer);
+
+        SmallVectorSized<char, 32> output;
+        while (true) {
+            Token token = preprocessor.next();
+            token.writeTo(output, SyntaxToStringFlags::IncludePreprocessed | SyntaxToStringFlags::IncludeTrivia);
+            if (token.kind == TokenKind::EndOfFile)
+                break;
+        }
+
+        if (diagnostics.empty())
+            printf("%s:\n", std::string(sourceManager.getRawFileName(buffer.id)).c_str());
+        else {
+            printf("%s", writer.report(diagnostics).c_str());
+            success = false;
+        }
+
+        printf("==============================\n%s\n", std::string(output.begin(), output.size()).c_str());
+    }
+    return success;
+}
+
+bool runCompiler(SourceManager& sourceManager, const Bag& options,
+                 const std::vector<SourceBuffer>& buffers) {
+
+    Compilation compilation;
+    for (const SourceBuffer& buffer : buffers)
+        compilation.addSyntaxTree(SyntaxTree::fromBuffer(buffer, sourceManager, options));
+
+    Diagnostics diagnostics = compilation.getAllDiagnostics();
+    DiagnosticWriter writer(sourceManager);
+    printf("%s\n", writer.report(diagnostics).c_str());
+
+    return diagnostics.empty();
+}
+
 int main(int argc, char** argv)
 try {
     std::vector<std::string> sourceFiles;
+    std::vector<std::string> includeDirs;
+    std::vector<std::string> includeSystemDirs;
+    std::vector<std::string> defines;
+    std::vector<std::string> undefines;
+
+    bool onlyPreprocess;

     CLI::App cmd("SystemVerilog compiler");
     cmd.add_option("files", sourceFiles, "Source files to compile");
+    cmd.add_option("-I,--include-directory", includeDirs, "Additional include search paths");
+    cmd.add_option("--include-system-directory", includeSystemDirs, "Additional system include search paths");
+    cmd.add_option("-D,--define-macro", defines, "Define <macro>=<value> (or 1 if <value> ommitted) in all source files");
+    cmd.add_option("-U,--undefine-macro", undefines, "Undefine macro name at the start of all source files");
+    cmd.add_flag("-E,--preprocess", onlyPreprocess, "Only run the preprocessor (and print preprocessed files to stdout)");

     try {
         cmd.parse(argc, argv);
@@ -27,34 +83,45 @@
         return cmd.exit(e);
     }

-    // Initialize the source manager.
     SourceManager sourceManager;
+    for (const std::string& dir : includeDirs)
+        sourceManager.addUserDirectory(string_view(dir));

-    // Build the compilation out of each source file.
-    Compilation compilation;
+    for (const std::string& dir : includeSystemDirs)
+        sourceManager.addSystemDirectory(string_view(dir));
+
+    PreprocessorOptions ppoptions;
+    ppoptions.predefines = defines;
+    ppoptions.undefines = undefines;
+    ppoptions.predefineSource = "<command-line>";
+
+    Bag options;
+    options.add(ppoptions);
+
     bool anyErrors = false;
+    std::vector<SourceBuffer> buffers;
     for (const std::string& file : sourceFiles) {
-        std::shared_ptr<SyntaxTree> tree = SyntaxTree::fromFile(file, sourceManager);
-        if (!tree) {
+        SourceBuffer buffer = sourceManager.readSource(file);
+        if (!buffer) {
             printf("error: no such file or directory: '%s'\n", file.c_str());
             anyErrors = true;
             continue;
         }

-        compilation.addSyntaxTree(std::move(tree));
+        buffers.push_back(buffer);
     }

-    if (compilation.getSyntaxTrees().empty()) {
+    if (buffers.empty()) {
         printf("error: no input files\n");
         return 1;
     }

-    // Report diagnostics.
-    Diagnostics diagnostics = compilation.getAllDiagnostics();
-    DiagnosticWriter writer(sourceManager);
-    printf("%s\n", writer.report(diagnostics).c_str());
+    if (onlyPreprocess)
+        anyErrors |= !runPreprocessor(sourceManager, options, buffers);
+    else
+        anyErrors |= !runCompiler(sourceManager, options, buffers);

-    return !anyErrors && diagnostics.empty() ? 0 : 1;
+    return anyErrors ? 1 : 0;
 }
 catch (const std::exception& e) {
     printf("internal compiler error (exception): %s\n", e.what());


Removes code that is not needed.

Removes code that is not needed.

--- examples/AdjustableRenderingDelayOpenGL.cpp
+++ examples/AdjustableRenderingDelayOpenGL.cpp
@@ -292,12 +292,6 @@
         glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA,
                      GL_UNSIGNED_BYTE, 0);

-        // Bilinear filtering
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
-        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
-
         // The depth buffer
         GLuint depthrenderbuffer;
         glGenRenderbuffers(1, &depthrenderbuffer);


TDB2 - Timing

TDB2 - Timing

- Added timing information to TDB2 for performance measuring.

--- src/TDB2.cpp
+++ src/TDB2.cpp
@@ -27,6 +27,7 @@

 //#include <iostream> // TODO Remove.
 #include <Context.h>
+#include <Timer.h>
 #include <text.h>
 #include <TDB2.h>

@@ -61,6 +62,7 @@
 const std::vector <Task>& TF2::get_tasks ()
 {
 //  std::cout << "# TF2::get_tasks " << _file.data << "\n";
+  Timer timer ("TF2::get_tasks " + _file.data);

   if (! _loaded_tasks)
     load_tasks ();
@@ -411,7 +413,7 @@
 void TDB2::commit ()
 {
   dump ();
-//  std::cout << "# TDB2::commit\n";
+  Timer timer ("TDB2::commit");
   pending.commit ();
   completed.commit ();
   undo.commit ();
@@ -427,7 +429,7 @@
 // Now cleans up dangling dependencies.
 int TDB2::gc ()
 {
-//  std::cout << "# TDB2::gc\n";
+  Timer timer ("TDB2::gc");
 /*
   pending.load_tasks
   completed.load_tasks


Task: Do not include recurring tasks into OVERDUE virtual tag

--- src/Task.cpp
+++ src/Task.cpp
@@ -503,7 +503,8 @@
     Task::status status = getStatus ();

     if (status != Task::completed &&
-        status != Task::deleted)
+        status != Task::deleted &&
+        status != Task::recurring)
     {
       Task::dateState state = getDateState ("due");
       if (state == dateEarlierToday ||


Assistant: Check namespace and virtual folder syntax of help projects.

Task-number: QTBUG-4519
Reviewed-by: kh1

--- tools/assistant/lib/qhelpprojectdata.cpp
+++ tools/assistant/lib/qhelpprojectdata.cpp
@@ -47,6 +47,7 @@
 #include <QtCore/QStack>
 #include <QtCore/QMap>
 #include <QtCore/QRegExp>
+#include <QtCore/QUrl>
 #include <QtCore/QVariant>
 #include <QtXml/QXmlStreamReader>

@@ -77,6 +78,7 @@
     void readFiles();
     void raiseUnknownTokenError();
     void addMatchingFiles(const QString &pattern);
+    bool hasValidSyntax(const QString &nameSpace, const QString &vFolder) const;

     QMap<QString, QStringList> dirEntriesCache;
 };
@@ -115,16 +117,14 @@
         if (isStartElement()) {
             if (name() == QLatin1String("virtualFolder")) {
                 virtualFolder = readElementText();
-                if (virtualFolder.contains(QLatin1String("/")))
+                if (!hasValidSyntax(QLatin1String("test"), virtualFolder))
                     raiseError(QCoreApplication::translate("QHelpProject",
-                                   "A virtual folder must not contain "
-                                   "a \'/\' character!"));
+                                   "Virtual folder has invalid syntax."));
             } else if (name() == QLatin1String("namespace")) {
                 namespaceName = readElementText();
-                if (namespaceName.contains(QLatin1String("/")))
+                if (!hasValidSyntax(namespaceName, QLatin1String("test")))
                     raiseError(QCoreApplication::translate("QHelpProject",
-                                   "A namespace must not contain a "
-                                   "\'/\' character!"));
+                                   "Namespace has invalid syntax."));
             } else if (name() == QLatin1String("customFilter")) {
                 readCustomFilter();
             } else if (name() == QLatin1String("filterSection")) {
@@ -318,6 +318,22 @@
         filterSectionList.last().addFile(pattern);
 }

+bool QHelpProjectDataPrivate::hasValidSyntax(const QString &nameSpace,
+                                             const QString &vFolder) const
+{
+    const QLatin1Char slash('/');
+    if (nameSpace.contains(slash) || vFolder.contains(slash))
+        return false;
+    QUrl url;
+    const QLatin1String scheme("qthelp");
+    url.setScheme(scheme);
+    url.setHost(nameSpace);
+    url.setPath(vFolder);
+
+    const QString expectedUrl(scheme + QLatin1String("://") + nameSpace + slash + vFolder);
+    return url.isValid() && url.toString() == expectedUrl;
+}
+
 /*!
     \internal
     \class QHelpProjectData


#86096# pcr_createRegistryInfo_OControlFontDialog (new service in this module)

--- extensions/source/propctrlr/pcrservices.cxx
+++ extensions/source/propctrlr/pcrservices.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: pcrservices.cxx,v $
  *
- *  $Revision: 1.1 $
+ *  $Revision: 1.2 $
  *
- *  last change: $Author: fs $ $Date: 2001-01-12 11:30:30 $
+ *  last change: $Author: fs $ $Date: 2001-06-11 11:33:45 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -73,15 +73,18 @@
 //---------------------------------------------------------------------------------------

 extern "C" void SAL_CALL createRegistryInfo_OPropertyBrowserController();
+extern "C" void SAL_CALL createRegistryInfo_OControlFontDialog();

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

-extern "C" void SAL_CALL pcr_createRegistryInfo()
+extern "C" void SAL_CALL dbi_initializeModule()
 {
     static sal_Bool s_bInit = sal_False;
     if (!s_bInit)
     {
         createRegistryInfo_OPropertyBrowserController();
+        createRegistryInfo_OControlFontDialog();
+        ::pcr::OModule::setResourceFilePrefix("pcr");
         s_bInit = sal_True;
     }
 }
@@ -93,7 +96,7 @@
                 uno_Environment **ppEnv
             )
 {
-    pcr_createRegistryInfo();
+    dbi_initializeModule();
     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
 }

@@ -140,6 +143,9 @@
 /*************************************************************************
  * history:
  *  $Log: not supported by cvs2svn $
+ *  Revision 1.1  2001/01/12 11:30:30  fs
+ *  initial checkin - outsourced the form property browser
+ *
  *
  *  Revision 1.0 11.01.01 09:14:45  fs
  ************************************************************************/