fix a bug in CopyStringOut. dprintk appears to work again.

--HG--
extra : convert_revision : cd0d13a85ddc7599308db8604a8f63a48679cc05

--- src/arch/alpha/vtophys.cc
+++ src/arch/alpha/vtophys.cc
@@ -141,12 +141,12 @@
 AlphaISA::CopyStringOut(ThreadContext *tc, char *dst, Addr vaddr, size_t maxlen)
 {
     int len = 0;
+    char *start = dst;
     VirtualPort *vp = tc->getVirtPort(tc);

     do {
         vp->readBlob(vaddr++, (uint8_t*)dst++, 1);
-        len++;
-    } while (len < maxlen && dst[len] != 0 );
+    } while (len < maxlen && start[len++] != 0 );

     tc->delVirtPort(vp);
     dst[len] = 0;


[test] TestSource: add some more checks for findSources

--- test/src/TestSource.hpp
+++ test/src/TestSource.hpp
@@ -94,13 +94,34 @@
     Source s4 = s1.createSource("S4","test");
     Source s5 = s2.createSource("S5","test");

+    //sanity check
     vector<Source> res = s1.findSources([&](const Source &source) {
+      return false;
+    });
+
+    CPPUNIT_ASSERT_EQUAL(static_cast<vector<Source>::size_type>(0), res.size());
+
+
+    //now some actual work
+    res = s1.findSources([&](const Source &source) {
       bool found = source.id() == s4.id();
       return found;
     });

     CPPUNIT_ASSERT_EQUAL(static_cast<vector<Source>::size_type>(1), res.size());
     CPPUNIT_ASSERT_EQUAL(s4.id(), res[0].id());
+
+    res = s1.findSources([&](const Source &source) {
+      return true;
+    }, true, 1);
+
+    CPPUNIT_ASSERT_EQUAL(res.size(), s1.sourceCount());
+    vector<Source> children = s1.sources();
+
+    for (int i = 0; i < res.size(); i++) {
+      CPPUNIT_ASSERT_EQUAL(res[i].id(), children[i].id());
+    }
+

 //    CPPUNIT_ASSERT_EQUAL(b1.hasSource("invalid_id"),false);
 //    CPPUNIT_ASSERT_EQUAL(b1.hasSource(s3.id()),true);


crash fixes

crash fixes

git-svn-id: 0a6e3066f5d503b24e8e377b6d170815393887e2@3662 8ad44209-8f18-4ceb-bdfa-99d0be514da2

--- src/ascent-world/Unit.cpp
+++ src/ascent-world/Unit.cpp
@@ -4834,8 +4834,8 @@
 	// look for spells with same namehash
 	for(uint32 x=0;x<MAX_AURAS;x++)
 	{
-//		if(m_auras[x] && m_auras[x]->GetSpellProto()->NameHash == name_hash && m_auras[x]->GetCaster()==caster)
-		if(m_auras[x] && m_auras[x]->GetSpellProto()->NameHash == name_hash)
+		//if(m_auras[x] && m_auras[x]->GetSpellProto()->NameHash == name_hash && m_auras[x]->GetCaster()==caster)
+		if( m_auras[x] != NULL && m_auras[x]->GetSpellProto() != NULL && m_auras[x]->GetSpellProto()->NameHash == name_hash )
 		{
 			// we've got an aura with the same name as the one we're trying to apply
 			resp.Misc = m_auras[x]->GetSpellProto()->Id;
@@ -4863,15 +4863,18 @@
 	resp.Error = AURA_CHECK_RESULT_NONE;
 	resp.Misc  = 0;

+	if( aur == NULL )
+		return resp;
+
 	// look for spells with same namehash
-//	if(aur->GetSpellProto()->NameHash == name_hash && aur->GetCaster()==caster)
-	if(aur->GetSpellProto()->NameHash == name_hash)
+	//if(aur->GetSpellProto()->NameHash == name_hash && aur->GetCaster()==caster)
+	if( aur->GetSpellProto() != NULL && aur->GetSpellProto()->NameHash == name_hash )
 	{
 		// we've got an aura with the same name as the one we're trying to apply
 		resp.Misc = aur->GetSpellProto()->Id;

 		// compare the rank to our applying spell
-		if(aur->GetSpellProto()->RankNumber > rank)
+		if( aur->GetSpellProto()->RankNumber > rank )
 			resp.Error = AURA_CHECK_RESULT_HIGHER_BUFF_PRESENT;
 		else
 			resp.Error = AURA_CHECK_RESULT_LOWER_BUFF_PRESENT;
@@ -4975,9 +4978,9 @@

 bool Unit::HasNegativeAuraWithNameHash(uint32 name_hash)
 {
-	for(uint32 x = MAX_POSITIVE_AURAS; x < MAX_AURAS; ++x)
-	{
-		if(m_auras[x] && m_auras[x]->GetSpellProto()->NameHash == name_hash)
+	for( uint32 x = MAX_POSITIVE_AURAS; x < MAX_AURAS; ++x )
+	{
+		if( m_auras[x] && m_auras[x]->GetSpellProto() != NULL && m_auras[x]->GetSpellProto()->NameHash == name_hash )
 			return true;
 	}


More tests

More tests


Fix recursion

Fix recursion

--- src/ast/StringChecker.cpp
+++ src/ast/StringChecker.cpp
@@ -38,6 +38,7 @@
         AUTO_RECURSE_RETURN_VALUES()
         AUTO_RECURSE_ARRAY_VALUES()
         AUTO_RECURSE_VARIABLE_OPERATIONS()
+        AUTO_RECURSE_STRUCT_DECLARATION()
         AUTO_RECURSE_TERNARY()
         AUTO_RECURSE_SWITCH()
         AUTO_RECURSE_SWITCH_CASE()


adapted test to Qt5, escape is gone in Qt5

git-svn-id: b5ee07fbca8bbf97ce45226d41fb0b67210e25b6@267 ea8d5007-eb21-0410-b261-ccb3ea6e24a9

--- tests/PythonQtTests.cpp
+++ tests/PythonQtTests.cpp
@@ -489,7 +489,7 @@
 {
   QVERIFY(_main.getVariable("PythonQt.QtCore.Qt.red").toInt()==Qt::red);
   QVERIFY(_main.getVariable("PythonQt.QtCore.Qt.FlatCap").toInt()==Qt::FlatCap);
-  QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.escape")));
+  QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.mightBeRichText")));
   // check for an enum type wrapper
   QVERIFY(PythonQtObjectPtr(_main.getVariable("PythonQt.QtCore.Qt.AlignmentFlag")));
   // check for a flags type wrapper


Disable test-explorer.cpp

Disable test-explorer.cpp


Disable RampUpTest.UpDownUpTransportSequenceNumberRtx on Mac.

Due to flakiness. See bug.

TBR=stefan@webrtc.org

Bug: webrtc:8878
Change-Id: Iece487ad9883fbe6209d25291fb70bb52c8afbd3
Reviewed-on: https://webrtc-review.googlesource.com/54601
Reviewed-by: Taylor Brandstetter <f49cf6381e322b147053b74e4500af8533ac1e4c@webrtc.org>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#22059}

--- call/rampup_tests.cc
+++ call/rampup_tests.cc
@@ -578,7 +578,15 @@
   RunBaseTest(&test);
 }

-TEST_F(RampUpTest, UpDownUpTransportSequenceNumberRtx) {
+// TODO(bugs.webrtc.org/8878)
+#if defined(WEBRTC_MAC)
+#define MAYBE_UpDownUpTransportSequenceNumberRtx \
+  DISABLED_UpDownUpTransportSequenceNumberRtx
+#else
+#define MAYBE_UpDownUpTransportSequenceNumberRtx \
+  UpDownUpTransportSequenceNumberRtx
+#endif
+TEST_F(RampUpTest, MAYBE_UpDownUpTransportSequenceNumberRtx) {
   std::vector<int> loss_rates = {0, 0, 0, 0};
   RampUpDownUpTester test(3, 0, 0, kStartBitrateBps,
                           RtpExtension::kTransportSequenceNumberUri, true,


INTEGRATION: CWS macosxquicktime01 (1.4.52); FILE MERGED 2007/10/15 11:11:26 pl 1.4.52.1: #i82621# initial implementation of SalObject for MacOSX aqua

--- vcl/inc/vcl/sysdata.hxx
+++ vcl/inc/vcl/sysdata.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sysdata.hxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.6 $
  *
- *  last change: $Author: hr $ $Date: 2007-11-02 12:43:30 $
+ *  last change: $Author: vg $ $Date: 2007-12-07 11:50:12 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -36,12 +36,6 @@
 #ifndef _SV_SYSDATA_HXX
 #define _SV_SYSDATA_HXX

-#if defined( QUARTZ )
-#include <premac.h>
-#include <Carbon/Carbon.h>
-#include <postmac.h>
-#endif
-
 // -----------------
 // - SystemEnvData -
 // -----------------
@@ -52,7 +46,7 @@
 #if defined( WNT ) || defined( OS2 )
     HWND                hWnd;           // the window hwnd
 #elif defined( QUARTZ )
-    WindowRef           rWindow;        // Window reference
+    NSView*             pView;          // the cocoa view ptr implementing this object
 #endif

 #if defined( UNX )
@@ -81,7 +75,7 @@
 #if defined( WNT ) || defined( OS2 )
     HWND            hWnd;             // the window hwnd
 #elif defined( QUARTZ )
-    WindowRef       rWindow;        // Window reference
+    NSView*         pView;            // the cocoa view ptr implementing this object
 #elif defined( UNX )
     long            aWindow;          // the window of the object
     bool            bXEmbedSupport:1; // decides whether the object in question


bamToBed assumes stdin.

bamToBed assumes stdin.

--- src/bamToBed/bamToBed.cpp
+++ src/bamToBed/bamToBed.cpp
@@ -55,11 +55,11 @@
 	bool showHelp = false;

 	// input files
-	string bamFile;
-	string color = "255,0,0";
-    string tag   = "";
-
-	bool haveBam           = false;
+	string bamFile = "stdin";
+	string color   = "255,0,0";
+    string tag     = "";
+
+	bool haveBam           = true;
 	bool haveColor         = false;
     bool haveOtherTag      = false;
 	bool writeBedPE        = false;
@@ -69,7 +69,6 @@
 	bool obeySplits        = false;

 	// check to see if we should print out some help
-	if(argc <= 1) showHelp = true;

 	for(int i = 1; i < argc; i++) {
 		int parameterLength = (int)strlen(argv[i]);
@@ -89,7 +88,6 @@

 		if(PARAMETER_CHECK("-i", 2, parameterLength)) {
 			if ((i+1) < argc) {
-				haveBam = true;
 				bamFile = argv[i + 1];
 				i++;
 			}


acmacs:incrementer renamed to acmacs::range

--- cc/geographic-map.cc
+++ cc/geographic-map.cc
@@ -118,7 +118,7 @@
                 const size_t circle_capacity = static_cast<size_t>(M_PI * 2.0 * distance * circle_no / (point_scaled * mDensity));
                 const size_t points_on_circle = std::min(circle_capacity, iter.left());
                 const double step = 2.0 * M_PI / points_on_circle;
-                for (auto index: acmacs::incrementer(0UL, points_on_circle)) {
+                for (auto index: acmacs::range(0UL, points_on_circle)) {
                     std::tie(coloring_data, priority) = *iter;
                     add_point(priority, center_lat + distance * std::cos(index * step), center_long + distance * std::sin(index * step), coloring_data.fill, mPointSize, coloring_data.outline, coloring_data.outline_width);
                     ++iter;


compile on msvc7.1; thanks to Marc Mutz

compile on msvc7.1; thanks to Marc Mutz

CCMAIL:kde-pim@kde.org

svn path=/trunk/KDE/kdepimlibs/; revision=717576

--- context.cpp
+++ context.cpp
@@ -480,7 +480,8 @@

   std::vector<Key> Context::signingKeys() const {
     std::vector<Key> result;
-    for ( unsigned int i = 0 ; gpgme_key_t key = gpgme_signers_enum( d->ctx, i ) ; ++i )
+    gpgme_key_t key;
+    for ( unsigned int i = 0 ; key = gpgme_signers_enum( d->ctx, i ) ; ++i )
       result.push_back( Key( key, false ) );
     return result;
   }


Soft error for blank bindings in config

Soft error for blank bindings in config

--- control.cpp
+++ control.cpp
@@ -188,6 +188,10 @@
 		{
 			// YAML conversion already prints errors
 		}
+		catch (YAML::TypedBadConversion<std::string>)
+		{
+			cerr << "Empty binding: " << binding.first.as<string>() << endl;
+		}
 	}

 	return true;


convert --expand-ncs: needs testing

convert --expand-ncs: needs testing

--- convert.cpp
+++ convert.cpp
@@ -54,7 +54,7 @@
 };

 enum OptionIndex { Unknown, Help, Verbose, FormatIn, FormatOut,
-                   Bare, Numb, QMark };
+                   Bare, Numb, QMark, ExpandNcs };
 static const option::Descriptor usage[] = {
   { Unknown, 0, "", "", Arg::None,
     "Usage:"
@@ -79,7 +79,7 @@
     "  --unknown=STRING  \tJSON representation of CIF's '?' (default: null)." },
   { Unknown, 0, "", "", Arg::None, "\nMacromolecular options:" },
   { ExpandNcs, 0, "", "expand-ncs", Arg::None,
-    "  --expand-ncs  \tExpand NCS mates specified in MTRIXn or equivalent." },
+    "  --expand-ncs  \tExpand strict NCS specified in MTRIXn or equivalent." },
   { Unknown, 0, "", "", Arg::None,
     "\nWhen output file is -, write to standard output." },
   { 0, 0, 0, 0, 0, 0 }
@@ -102,44 +102,55 @@
 [[noreturn]]
 inline void fail(const std::string& msg) { throw std::runtime_error(msg); }

-static std::string get_chain_letter(const std::vector<Chain>& chains,
-                                    bool short_chain_names) {
-  if (short_chain_names) {
-    char symbols[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-                     "abcdefghijklmnopqrstuvwxyz01234567890";
-    for (char symbol : symbols)
-      if (find_if(chains.begin(), chains.end(),
-                  [&](const Chain& ch) { return ch.name == symbol; })
-          == std::end(symbols))
-        return std::string(1, symbol);
-  }
-}
-
-static void expand_ncs(Structure& st, bool short_chain_names) {
+static char symbols[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                        "abcdefghijklmnopqrstuvwxyz01234567890";
+
+static void expand_ncs(gemmi::mol::Structure& st, bool short_chain_names) {
+  namespace mol = gemmi::mol;
   int n_ops = std::count_if(st.ncs.begin(), st.ncs.end(),
-                            [](NcsOp& op){ return !op.given; });
+                            [](mol::NcsOp& op){ return !op.given; });
   if (n_ops == 0)
     return;
-  for (Model& model : st.models) {
+  for (mol::Model& model : st.models) {
     size_t new_length = model.chains.size() * (n_ops + 1);
     if (new_length >= 63)
       short_chain_names = false;
-    std::string next_name;
     model.chains.reserve(new_length);
-    for (const NcsOp& op : st.ncs)
-      if (!op.given)
-        for (chain : model.chains) {
+    for (const mol::Chain& chain : model.chains) {
+      int op_num = 0;
+      for (const mol::NcsOp& op : st.ncs)
+        if (!op.given) {
+          op_num++;
+          // the most difficult part - choosing names for new chains
+          std::string name;
+          if (short_chain_names) {
+            for (char symbol : symbols) {
+              name = std::string(1, symbol);
+              if (!model.find_chain(name))
+                break;
+            }
+          }
+          else {
+            name = chain.name + std::to_string(op_num+1);
+            while (model.find_chain(name))
+              name += "a";
+          }
+
           model.chains.push_back(chain);
-          Chain& new_chain = model.chains.back();
-          new_chain.name = next_chain_letter(model.chains, short_chain_names)
-                                             : "2";
+          mol::Chain& new_chain = model.chains.back();
+          new_chain.name = name;
           new_chain.auth_name = "";
-          for (Residue& res : new_chain.residues)
-            for (Atom& a : res.atoms) {
-              //TODO
+
+          for (mol::Residue& res : new_chain.residues)
+            for (mol::Atom& a : res.atoms) {
+              linalg::vec<double,4> pos = {a.pos.x, a.pos.y, a.pos.z,  1.0};
+              pos = linalg::mul(op.transform, pos);
+              a.pos = {pos.x, pos.y, pos.z};
             }
         }
-  for (NcsOp& op : st.ncs)
+    }
+  }
+  for (mol::NcsOp& op : st.ncs)
     op.given = true;
 }

@@ -165,7 +176,7 @@
   }

   if (options[ExpandNcs])
-    expand_ncs(st);
+    expand_ncs(st, output_type == FileType::Pdb);

   std::ostream* os;
   std::unique_ptr<std::ostream> os_deleter;


position_range: Introduce contains() check for ranges

--- position_in_partition.hh
+++ position_in_partition.hh
@@ -593,6 +593,8 @@
     position_in_partition&& end() && { return std::move(_end); }
     bool contains(const schema& s, position_in_partition_view pos) const;
     bool overlaps(const schema& s, position_in_partition_view start, position_in_partition_view end) const;
+    // Returns true iff this range contains all keys contained by position_range(start, end).
+    bool contains(const schema& s, position_in_partition_view start, position_in_partition_view end) const;
     bool is_all_clustered_rows(const schema&) const;

     friend std::ostream& operator<<(std::ostream&, const position_range&);
@@ -607,6 +609,12 @@
 }

 inline
+bool position_range::contains(const schema& s, position_in_partition_view start, position_in_partition_view end) const {
+    position_in_partition::less_compare less(s);
+    return !less(start, _start) && !less(_end, end);
+}
+
+inline
 bool position_range::overlaps(const schema& s, position_in_partition_view start, position_in_partition_view end) const {
     position_in_partition::less_compare less(s);
     return !less(end, _start) && less(start, _end);


Timer signal functionality

Timer signal functionality

--- src/PuckManagement/PuckManager/PuckManager.cpp
+++ src/PuckManagement/PuckManager/PuckManager.cpp
@@ -28,6 +28,7 @@
 	prioReturnVal.slideFullFlag = false;
 	prioReturnVal.puck = nullptr;

+	// Pass the timer signal to the given puckID
 	if(signal.signalType == PuckSignal::SignalType::TIMER_SIGNAL) {
 		std::list<PuckContext*>::iterator it = puckList.begin();
 		do {
@@ -35,46 +36,16 @@
 				prioReturnVal.puckSpeed = (*it)->getCurrentSpeed();
 			}

+			// check for puckID
 			uint16_t currentPuckID = (*it)->getPuckID();
 			if(currentPuckID == signal.timerSignal.puckID) {
+				// pass the timer signal
 				PuckSignal::Return returnVal = (*it)->process(signal);

-				switch(returnVal.puckReturn) {
-					case PuckSignal::PuckReturn::ACCEPT:
-						break;
-					case PuckSignal::PuckReturn::DELETE:
-						delete *it;					// delete the puck from memory
-						it = puckList.erase(it);	// delete the puck from list
-						break;
-					case PuckSignal::PuckReturn::SEND:
-						prioReturnVal.puck = (*it);
-						prioReturnVal.actorFlag = true;
-						prioReturnVal.actorSignal = ActorSignal::SEND_PUCK;
-						break;
-					case PuckSignal::PuckReturn::EVALUATE:
-						// todo: sort
-						break;
-					case PuckSignal::PuckReturn::HEIGHT:
-						prioReturnVal.actorFlag = true;
-						prioReturnVal.actorSignal = ActorSignal::START_MEASUREMENT;
-						break;
-					case PuckSignal::PuckReturn::SLIDE_FULL:
-						prioReturnVal.slideFullFlag = true;
-						break;
-					//
-					case PuckSignal::PuckReturn::WARNING:
-						prioReturnVal.errorFlag = true;
-						prioReturnVal.errorSignal = ErrorSignal::UNEXPECTED_SIGNAL;
-						break;
-					case PuckSignal::PuckReturn::DENY:
-						prioReturnVal.errorFlag = true;
-						prioReturnVal.errorSignal = ErrorSignal::UNEXPECTED_SIGNAL;
-						break;
-					case PuckSignal::PuckReturn::ERROR:
-						prioReturnVal.errorFlag = true;
-						prioReturnVal.errorSignal = ErrorSignal::PUCK_LOST;
-						break;
-					default:
+				// check return value
+				if(	returnVal.puckReturn != PuckSignal::PuckReturn::ACCEPT &&
+					returnVal.puckReturn != PuckSignal::PuckReturn::ERROR) {
+						// puck should be triggered on accept or error -> unexpected otherwise
 						prioReturnVal.errorFlag = true;
 						prioReturnVal.errorSignal = ErrorSignal::UNEXPECTED_SIGNAL;
 				}


Stout: Added parse() for JSON::Array.

Stout: Added parse() for JSON::Array.

Review: https://reviews.apache.org/r/48680/

--- 3rdparty/stout/include/stout/flags/parse.hpp
+++ 3rdparty/stout/include/stout/flags/parse.hpp
@@ -103,6 +103,32 @@

 template <>
+inline Try<JSON::Array> parse(const std::string& value)
+{
+  // A value that already starts with 'file://' will properly be
+  // loaded from the file and put into 'value' but if it starts with
+  // '/' we need to explicitly handle it for backwards compatibility
+  // reasons (because we used to handle it before we introduced the
+  // 'fetch' mechanism for flags that first fetches the data from URIs
+  // such as 'file://').
+  if (strings::startsWith(value, "/")) {
+    LOG(WARNING) << "Specifying an absolute filename to read a command line "
+                    "option out of without using 'file:// is deprecated and "
+                    "will be removed in a future release. Simply adding "
+                    "'file://' to the beginning of the path should eliminate "
+                    "this warning.";
+
+    Try<std::string> read = os::read(value);
+    if (read.isError()) {
+      return Error("Error reading file '" + value + "': " + read.error());
+    }
+    return JSON::parse<JSON::Array>(read.get());
+  }
+  return JSON::parse<JSON::Array>(value);
+}
+
+
+template <>
 inline Try<Path> parse(const std::string& value)
 {
   return Path(value);


Add InputScope support into InputMethodIMM32

RWHVW has directly used InputScope APIs that are available
for IMM32 applications.
In order to migrate from RWHVW to RWHVA as Aura transition,
InputMethodIMM32 should also have InputScope support since
RWHVA delegates all the IME activities into InputMethodIMM32.

BUG=296505, 244688
TEST=manually done with Aura build on Windows 8.1

Review URL: https://chromiumcodereview.appspot.com/23537064

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

--- ui/base/ime/input_method_imm32.cc
+++ ui/base/ime/input_method_imm32.cc
@@ -7,6 +7,7 @@
 #include "base/basictypes.h"
 #include "ui/base/ime/composition_text.h"
 #include "ui/base/ime/text_input_client.h"
+#include "ui/base/ime/win/tsf_input_scope.h"

 namespace ui {
@@ -265,7 +266,9 @@
   // Use switch here in case we are going to add more text input types.
   // We disable input method in password field.
   const HWND window_handle = GetAttachedWindowHandle(GetTextInputClient());
-  switch (GetTextInputType()) {
+  const TextInputType text_input_type = GetTextInputType();
+  const TextInputMode text_input_mode = GetTextInputMode();
+  switch (text_input_type) {
     case ui::TEXT_INPUT_TYPE_NONE:
     case ui::TEXT_INPUT_TYPE_PASSWORD:
       imm32_manager_.DisableIME(window_handle);
@@ -277,7 +280,9 @@
       break;
   }

-  imm32_manager_.SetTextInputMode(window_handle, GetTextInputMode());
+  imm32_manager_.SetTextInputMode(window_handle, text_input_mode);
+  tsf_inputscope::SetInputScopeForTsfUnawareWindow(
+      window_handle, text_input_type, text_input_mode);
 }

 }  // namespace ui


wl2025 - bug fixes
1) Release _all_ attr bufs
2) Handle out of attr bufs

ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Release _all_ attr bufs
  Handle out of attr bufs

--- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -7283,6 +7283,7 @@
 {
   Uint32 i;
   Uint32 attr_buf_recs= (batch_size + 30) / 32;
+
   if (batch_size > 1) {
     if (c_no_attrinbuf_recs < attr_buf_recs) {
       jam();
@@ -7302,7 +7303,8 @@
 {
   Uint32 i, attr_buf_recs;
   attr_buf_recs= scanP->scan_acc_attr_recs;
-  for (i= 1; i < attr_buf_recs; i++) {
+
+  for (i= 1; i <= attr_buf_recs; i++) {
     release_attrinbuf(scanP->scan_acc_op_ptr[i]);
   }
   scanP->scan_acc_attr_recs= 0;
@@ -7570,9 +7572,9 @@

 void Dblqh::scanAttrinfoLab(Signal* signal, Uint32* dataPtr, Uint32 length)
 {
+  scanptr.i = tcConnectptr.p->tcScanRec;
+  c_scanRecordPool.getPtr(scanptr);
   if (saveTupattrbuf(signal, dataPtr, length) == ZOK) {
-    scanptr.i = tcConnectptr.p->tcScanRec;
-    c_scanRecordPool.getPtr(scanptr);
     if (tcConnectptr.p->currTupAiLen < scanptr.p->scanAiLength) {
       jam();
     } else {
@@ -8394,7 +8396,6 @@
     scanptr.p->m_curr_batch_size_bytes= 0;
     sendScanFragConf(signal, ZSCAN_FRAG_CLOSED);
   }//if
-  release_acc_ptr_list(scanptr.p);
   finishScanrec(signal);
   releaseScanrec(signal);
   tcConnectptr.p->tcScanRec = RNIL;
@@ -8554,10 +8555,12 @@
  * ========================================================================= */
 void Dblqh::finishScanrec(Signal* signal)
 {
+  release_acc_ptr_list(scanptr.p);
+
   FragrecordPtr tFragPtr;
   tFragPtr.i = scanptr.p->fragPtrI;
   ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord);
-
+
   LocalDLFifoList<ScanRecord> queue(c_scanRecordPool,
 				    tFragPtr.p->m_queuedScans);


Removes SPD version checkings

Removes SPD version checkings

CQ:SW521162
Zen:MST-933
Change-Id: I1b0a6abf9513980b692e43e67e9ca0bc76657660
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/114030
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Dev-Ready: STEPHEN GLANCY <7301c4b00f53e5772c2576cd0c5f485155c2ece1@us.ibm.com>
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: Sneha Kadam <815590b4758df91a46c65f2e611b009647339656@ibm.com>
Reviewed-by: Louis Stermole <a2bef96d502debd02962600aef4d81d949c35039@us.ibm.com>
Reviewed-by: Mark Pizzutillo <e025966b648907ad559ec0f11afd8614ca18d62d@ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Edgar R Cordero <5d58db94b672b353c4d1fd75b5b35c7e02ea3071@us.ibm.com>
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/114031
Tested-by: Jenkins OP Build CI <e610bd72261d3c0a48f1e8ae36832ab00774d426@us.ibm.com>
Tested-by: Jenkins OP HW <0eb0fff262f74a65a832afbcc7b153e391c9a3fd@us.ibm.com>
Tested-by: Jenkins Combined Simics CI <8312af3886dfc9bb930f549023677220805b137e@us.ibm.com>
Reviewed-by: Daniel M Crowell <912029ca9254ac7b5854e56910561d682e1fa2d0@us.ibm.com>

--- src/import/chips/p10/procedures/hwp/memory/lib/plug_rules/p10_plug_rules.C
+++ src/import/chips/p10/procedures/hwp/memory/lib/plug_rules/p10_plug_rules.C
@@ -192,9 +192,6 @@
         FAPI_INF("%s Attribute set to ignore plug rule checking", mss::c_str(i_target));
         return fapi2::FAPI2_RC_SUCCESS;
     }
-
-    // Check SPD revision limits
-    FAPI_TRY( ddimm_spd_revision(i_target) );

 fapi_try_exit:
     return fapi2::current_err;


BUG: Increase of bin size

BUG: Increase of bin size

Increasing the bin size for each iteration

--- src/lib/itkTextureFilter/itkScalarImageToIntensitySizeListSampleFilter.hxx
+++ src/lib/itkTextureFilter/itkScalarImageToIntensitySizeListSampleFilter.hxx
@@ -166,7 +166,7 @@
       cerr<<"MinIntesity: "<<this->GetMinIntensity()<<endl;
       cerr<<"NumberOfIntensityBins: "<<this->GetNumberOfIntensityBins()<<endl;
       cerr<<"Binsize = (maxIntensity - minIntensity)/numberOfBins"<<endl;
-      itkExceptionMacro("ERROR: Intensity bin size is 0. Please reduce the number of intensity bins.")
+      itkExceptionMacro("ERROR: Intensity bin size is 0.")
   }

   InputImagePixelType minintensity = this->GetMinIntensity();
@@ -175,11 +175,7 @@
   for(int i = 0; i < this->GetNumberOfIntensityBins() && maxintensity < this->GetMaxIntensity(); i++){

       minintensity = maxintensity;
-      maxintensity = minintensity + (i+1)*binsize;
-
-      if(minintensity == this->GetBackgroundValue()){
-          minintensity = maxintensity;
-      }
+      maxintensity = minintensity + binsize;

       //Threshold the image using the threshold values
       ThresholdImageFilterPointerType thresholdfilter = ThresholdImageFilterType::New();


Fix RTT calculations for send-only channels.

As we don't know the SSRC of the other end in a send-only channel since we haven't received packets from that end, we are required to assume that the SSRC of the first report block is the correct SSRC to use for RTT calculations.

BUG=3781
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/14349004

Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: fe161675077a561ec53ca78806cc9dbc812b1ce9

--- video_engine/vie_channel.cc
+++ video_engine/vie_channel.cc
@@ -1012,14 +1012,32 @@
   // Aggregate the report blocks associated with streams sent on this channel.
   std::vector<RTCPReportBlock> report_blocks;
   rtp_rtcp_->RemoteRTCPStat(&report_blocks);
-  for (std::list<RtpRtcp*>::iterator it = simulcast_rtp_rtcp_.begin();
-       it != simulcast_rtp_rtcp_.end();
-       ++it) {
-    (*it)->RemoteRTCPStat(&report_blocks);
+  {
+    CriticalSectionScoped lock(rtp_rtcp_cs_.get());
+    for (std::list<RtpRtcp*>::iterator it = simulcast_rtp_rtcp_.begin();
+        it != simulcast_rtp_rtcp_.end();
+        ++it) {
+      (*it)->RemoteRTCPStat(&report_blocks);
+    }
   }

   if (report_blocks.empty())
     return -1;
+
+  uint32_t remote_ssrc = vie_receiver_.GetRemoteSsrc();
+  std::vector<RTCPReportBlock>::const_iterator it = report_blocks.begin();
+  for (; it != report_blocks.end(); ++it) {
+    if (it->remoteSSRC == remote_ssrc)
+      break;
+  }
+  if (it == report_blocks.end()) {
+    // We have not received packets with an SSRC matching the report blocks. To
+    // have a chance of calculating an RTT we will try with the SSRC of the
+    // first report block received.
+    // This is very important for send-only channels where we don't know the
+    // SSRC of the other end.
+    remote_ssrc = report_blocks[0].remoteSSRC;
+  }

   RTCPReportBlock report;
   if (report_blocks.size() > 1)
@@ -1034,8 +1052,7 @@

   uint16_t dummy;
   uint16_t rtt = 0;
-  if (rtp_rtcp_->RTT(
-          vie_receiver_.GetRemoteSsrc(), &rtt, &dummy, &dummy, &dummy) != 0) {
+  if (rtp_rtcp_->RTT(remote_ssrc, &rtt, &dummy, &dummy, &dummy) != 0) {
     return -1;
   }
   *rtt_ms = rtt;


Avoid crash in ViEEncoder::DeRegisterExternalEncoder().

BUG=chromium:348222
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/9519004

git-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@5660 4adac7df-926f-26a2-2b94-8c16560cd09d

--- video_engine/vie_encoder.cc
+++ video_engine/vie_encoder.cc
@@ -385,6 +385,11 @@
       CriticalSectionScoped cs(data_cs_.get());
       send_padding_ = current_send_codec.numberOfSimulcastStreams > 1;
     }
+    // TODO(mflodman): Unfortunately the VideoCodec that VCM has cached a
+    // raw pointer to an |extra_options| that's long gone.  Clearing it here is
+    // a hack to prevent the following code from crashing.  This should be fixed
+    // for realz.  https://code.google.com/p/chromium/issues/detail?id=348222
+    current_send_codec.extra_options = NULL;
     if (vcm_.RegisterSendCodec(&current_send_codec, number_of_cores_,
                                max_data_payload_length) != VCM_OK) {
       WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideo,


Changed assert to log.

Changed assert to log.

Review URL: https://webrtc-codereview.appspot.com/1010004

Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: d73527ccabbca315817f548c0bf2f9c7d08d17a5

--- video_engine/vie_encoder.cc
+++ video_engine/vie_encoder.cc
@@ -20,6 +20,7 @@
 #include "modules/video_coding/main/interface/video_coding.h"
 #include "modules/video_coding/main/interface/video_coding_defines.h"
 #include "system_wrappers/interface/critical_section_wrapper.h"
+#include "system_wrappers/interface/logging.h"
 #include "system_wrappers/interface/tick_util.h"
 #include "system_wrappers/interface/trace.h"
 #include "video_engine/include/vie_codec.h"
@@ -830,7 +831,8 @@
     CriticalSectionScoped cs(data_cs_.get());
     std::map<unsigned int, int>::iterator stream_it = ssrc_streams_.find(ssrc);
     if (stream_it == ssrc_streams_.end()) {
-      assert(false);
+      LOG_F(LS_WARNING) << "ssrc not found: " << ssrc << ", map size "
+                        << ssrc_streams_.size();
       return;
     }
     std::map<unsigned int, WebRtc_Word64>::iterator time_it =


addons/imguipanelmanager/imguipanelmanager.cpp: Mirrowed 'Minor shuffle to ease merging branches' from upstream repository.

--- addons/imguipanelmanager/imguipanelmanager.cpp
+++ addons/imguipanelmanager/imguipanelmanager.cpp
@@ -654,10 +654,9 @@
         window->DC.AllowKeyboardFocus = true;
         window->DC.ButtonRepeat = false;
         window->DC.ItemWidthStack.resize(0);
-        window->DC.TextWrapPosStack.resize(0);
         window->DC.AllowKeyboardFocusStack.resize(0);
         window->DC.ButtonRepeatStack.resize(0);
-        window->DC.ColorEditMode = ImGuiColorEditMode_UserSelect;
+        window->DC.TextWrapPosStack.resize(0);
         window->DC.ColumnsCurrent = 0;
         window->DC.ColumnsCount = 1;
         window->DC.ColumnsStartPosY = window->DC.CursorPos.y;
@@ -665,6 +664,7 @@
         window->DC.TreeDepth = 0;
         window->DC.StateStorage = &window->StateStorage;
         window->DC.GroupStack.resize(0);
+        window->DC.ColorEditMode = ImGuiColorEditMode_UserSelect;
         window->MenuColumns.Update(3, style.ItemSpacing.x, !window_was_visible);

         if (window->AutoFitFramesX > 0)


file medium/04-ReadWrite2

file medium/04-ReadWrite2

--- medium/04-ReadWrite2.cpp
+++ medium/04-ReadWrite2.cpp
@@ -2,4 +2,35 @@
 	Al parecer, también se puede hacer gestión de lectura/escritura
 	mediante otras funciones propias de C++ y sus librerias.
 	El ejemplo anterior sería válido tanto para C y C++ (las funciones).
-*/+
+	ofstream: para escribir
+	ifstream: para leer
+	fstream: para leer/escribir
+*/
+
+#include <iostream>
+#include <fstream>
+#include <string>
+
+int main() {
+	//fichero para leer/escribir
+	std::fstream fd;
+	fd.open("readWrite2", std::ios::in | std::ios::out | std::ios::trunc);
+	//Todo ok
+	if (fd.is_open()) {
+		//Write in file
+		fd << "Linea 1\n";
+		fd << "Linea 2\n";
+		//Para que se escriba, por que se guarda en buffer hasta que se cierra
+		fd.close();
+		fd.open("readWrite2");
+		//Read from file
+		std::string line;
+		while (std::getline(fd,line)) {
+			std::cout << line << "\n";
+		}
+		return 0;
+	} else {
+		return 1;
+	}
+}


x11: Use _exit rather then exit on X errors (rhbz#680763)

This avoids us trying to restore the original resolution when we're fullscreen
and an X error happens. As restoring fullscreen is a bad idea then as this
involves making more X calls, which can get us stuck (in side an XLockDisplay
call for example).

--- client/x11/platform.cpp
+++ client/x11/platform.cpp
@@ -3024,14 +3024,14 @@
               error_str,
               (uint32_t)error_event->minor_code,
               request_str);
-    exit(-1);
+    _exit(-1);
     return 0;
 }

 static int x_io_error_handler(Display* display)
 {
     LOG_ERROR("x io error on %s", XDisplayString(display));
-    exit(-1);
+    _exit(-1);
     return 0;
 }


add sample anmes

add sample anmes

--- split/GetSampleName.C
+++ split/GetSampleName.C
@@ -93,6 +93,13 @@
   }
   if (inputFile.Contains("HbbHbb") ) ret = "hbbhbb";
   if (inputFile.Contains("TChihh") ) ret = "TChihh";
+
+  if (inputFile.Contains("MET_Run2012A"))  ret = "META";
+  if (inputFile.Contains("MET_Run2012B"))  ret = "METB";
+  if (inputFile.Contains("MET_Run2012C"))  ret = "METC";
+  if (inputFile.Contains("MET_Run2012D"))  ret = "METD";
+
+
   //Otherwise not found--be careful..

   cout << ret << endl;


Added plugin size to error logging and a logging statement when the plugin size changes.
I found these changes useful while debugging issues when modifying the plugin.

BUG=none
TEST=none

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

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

--- ppapi/example/example.cc
+++ ppapi/example/example.cc
@@ -203,7 +203,7 @@
     pp::ImageData image(this, PP_IMAGEDATAFORMAT_BGRA_PREMUL,
                         pp::Size(width, height), false);
     if (image.is_null()) {
-      printf("Couldn't allocate the image data\n");
+      printf("Couldn't allocate the image data: %d, %d\n", width, height);
       return image;
     }

@@ -218,6 +218,7 @@
       }
     }

+    // Draw the orbiting box.
     float radians = static_cast<float>(animation_counter_) / kStepsPerCircle *
         2 * 3.14159265358979F;

@@ -225,7 +226,8 @@
     int x = static_cast<int>(cos(radians) * radius + radius + 2);
     int y = static_cast<int>(sin(radians) * radius + radius + 2);

-    FillRect(&image, x - 3, y - 3, 7, 7, 0x80000000);
+    const uint32_t box_bgra = 0x80000000;  // Alpha 50%.
+    FillRect(&image, x - 3, y - 3, 7, 7, box_bgra);
     return image;
   }

@@ -234,6 +236,8 @@
     if (!image.is_null()) {
       device_context_.ReplaceContents(&image);
       device_context_.Flush(pp::CompletionCallback(&FlushCallback, this));
+    } else {
+      printf("NullImage: %d, %d\n", width_, height_);
     }
   }

@@ -244,6 +248,8 @@

     width_ = position.size().width();
     height_ = position.size().height();
+    printf("DidChangeView relevant change: width=%d height:%d\n",
+           width_, height_);

     device_context_ = pp::Graphics2D(this, pp::Size(width_, height_), false);
     if (!BindGraphics(device_context_)) {


FOGL-2467: added handling of user_ts aggregate min/max using arrays

--- C/plugins/storage/postgres/connection.cpp
+++ C/plugins/storage/postgres/connection.cpp
@@ -1799,9 +1799,22 @@
 			sql.append('(');
 			if (itr->HasMember("column"))
 			{
-				sql.append("\"");
-				sql.append((*itr)["column"].GetString());
-				sql.append("\"");
+
+				string column_name= (*itr)["column"].GetString();
+				// FIXME:
+				if (column_name == "user_ts")
+				{
+					// FIXME:
+					Logger::getLogger()->debug("DBG PG jsonAggregates - user_ts :%s: ", column_name.c_str());
+
+					sql.append("to_char(user_ts, '" F_DATEH24_US "')");
+				}
+				else
+				{
+					sql.append("\"");
+					sql.append(column_name);
+					sql.append("\"");
+				}
 			}
 			else if (itr->HasMember("json"))
 			{


silly #defines for people who don't have winsoc

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

--- src/bzflag/ServerLink.cxx
+++ src/bzflag/ServerLink.cxx
@@ -135,16 +135,12 @@
   int nfound;

 #if !defined(_WIN32)
-  const bool okay = true;
-  int fdMax = query;
+  okay = true;
+  fdMax = query;
   if (BzfNetwork::setNonBlocking(query) < 0) {
     close(query);
     return;
   }
-  struct timeval timeout;
-  fd_set write_set;
-  fd_set read_set;
-  int nfound;
   if (connect(query, (CNCTType*)&addr, sizeof(addr)) < 0) {
     if (getErrno() != EINPROGRESS) {
       close(query);


names names names

names names names

--- src/bzfs/CustomWeapon.cxx
+++ src/bzfs/CustomWeapon.cxx
@@ -82,21 +82,21 @@
   }
   else if (strcmp(cmd, "trigger") == 0)
   {
-	  std::string triggerType;
-	  input >> triggerType;
+	  std::string triggerName;
+	  input >> triggerName;

 	  triggerType = eNullEvent;

-	  TextUtils::tolower(triggerType);
-	  if ( triggerType == "oncap")
+	  TextUtils::tolower(triggerName);
+	  if ( triggerName == "oncap")
 		  triggerType = eCaptureEvent;
-	  else if ( triggerType == "onspawn")
+	  else if ( triggerName == "onspawn")
 		  triggerType = ePlayerSpawnEvent;
-	  else if ( triggerType == "ondie")
+	  else if ( triggerName == "ondie")
 		  triggerType = ePlayerDieEvent;
 	  else
 	  {
-		  std::cout << "weapon trigger type:" << triggerType << " unknown" << std::endl;
+		  std::cout << "weapon trigger type:" << triggerName << " unknown" << std::endl;
 	  }
   }
   else if (strcmp(cmd, "eventteam") == 0)


mp3, wav 재생 함수 에러 수정

mp3, wav 재생 함수 에러 수정

--- CSMGameProject/CSMGameProject/NNSound.cpp
+++ CSMGameProject/CSMGameProject/NNSound.cpp
@@ -3,12 +3,13 @@
 #include "NNApplication.h"
 wchar_t* GetFileExtenstion (const wchar_t * file_name)
 {
-	wchar_t* _file_name;
-	wcscpy_s(_file_name, wcslen(file_name), file_name);
+	wchar_t* _file_name = nullptr;
+	_file_name = (wchar_t*)malloc(1024);
+	wcscpy_s(_file_name, 256, file_name);
 	int file_name_len = wcslen (_file_name);
 	_file_name +=file_name_len ;

-	wchar_t *file_ext ;
+	wchar_t *file_ext = nullptr;
 	for(int i =0 ; i <file_name_len ; i ++)
 	{
 		if(* _file_name == '.' )


kill stray printf

kill stray printf

git-svn-id: febc42a3fd39fb08e5ae2b2182bc5ab0a583559c@206544 07c76cb3-cb09-0410-85de-c24d39f1912e

--- src/cal3d/coresubmesh.cpp
+++ src/cal3d/coresubmesh.cpp
@@ -1343,7 +1343,6 @@
         lastError = error = (100.0f-quality ) * 0.00001f;

         if (ComputeAllEdgeCollapseCosts()) { // cache all edge collapse costs
-            printf("isolated fraction: %.3f\n", m_isolateds / static_cast<float>(m_faces.size()));
             if(m_isolateds / static_cast<float>(m_faces.size()) < 0.4f) {
                 if(m_isolateds / static_cast<float>(m_faces.size()) > 0.21f) { // boost poly count if isolateds are high
                     target_tri_count += ( m_faces.size() - target_tri_count) /2;


Format code with clang-format

Format code with clang-format

Signed-off-by: Stefan Weil <8d4c780fcfdc41841e5070f4c43da8958ba6aec0@weilnetz.de>

--- src/ccstruct/polyaprx.cpp
+++ src/ccstruct/polyaprx.cpp
@@ -1,5 +1,5 @@
 /**********************************************************************
- * File:        polyaprx.cpp  (Formerly polygon.c)
+ * File:        polyaprx.cpp
  * Description: Code for polygonal approximation from old edgeprog.
  * Author:      Ray Smith
  *
@@ -34,7 +34,8 @@
 #define FASTEDGELENGTH 256

 static BOOL_VAR(poly_debug, false, "Debug old poly");
-static BOOL_VAR(poly_wide_objects_better, true, "More accurate approx on wide things");
+static BOOL_VAR(poly_wide_objects_better, true,
+                "More accurate approx on wide things");

 #define fixed_dist 20  // really an int_variable
 #define approx_dist 15 // really an int_variable
@@ -126,8 +127,9 @@
   }

   if (poly_debug) {
-    tprintf("Cutline:A=%d, max=%.2f(%.2f%%), msd=%.2f(%.2f%%)\n", area, maxperp / 256.0,
-            maxperp * 200.0 / area, perp / 256.0, perp * 300.0 / area);
+    tprintf("Cutline:A=%d, max=%.2f(%.2f%%), msd=%.2f(%.2f%%)\n", area,
+            maxperp / 256.0, maxperp * 200.0 / area, perp / 256.0,
+            perp * 300.0 / area);
   }
   if (maxperp * par1 >= 10 * area || perp * par2 >= 10 * area || vlen >= 126) {
     maxpoint->fixed = true;
@@ -144,8 +146,8 @@
  **********************************************************************/

 static EDGEPT *edgesteps_to_edgepts( // convert outline
-    C_OUTLINE *c_outline,     // input
-    EDGEPT edgepts[]          // output is array
+    C_OUTLINE *c_outline,            // input
+    EDGEPT edgepts[]                 // output is array
 ) {
   int32_t length;    // steps in path
   ICOORD pos;        // current coords
@@ -169,7 +171,8 @@
   do {
     dir = c_outline->step_dir(stepindex);
     vec = c_outline->step(stepindex);
-    if (stepindex < length - 1 && c_outline->step_dir(stepindex + 1) - dir == -32) {
+    if (stepindex < length - 1 &&
+        c_outline->step_dir(stepindex + 1) - dir == -32) {
       dir += 128 - 16;
       vec += c_outline->step(stepindex + 1);
       stepinc = 2;
@@ -230,7 +233,8 @@
   epdir &= 7;
   edgepts[epindex].dir = epdir;
   edgepts[0].prev = &edgepts[epindex];
-  ASSERT_HOST(pos.x() == c_outline->start_pos().x() && pos.y() == c_outline->start_pos().y());
+  ASSERT_HOST(pos.x() == c_outline->start_pos().x() &&
+              pos.y() == c_outline->start_pos().y());
   return &edgepts[0];
 }

@@ -238,8 +242,8 @@
  *fix2(start,area) fixes points on the outline according to a trial method*
  **********************************************************************/

-static void fix2(         // polygonal approx
-    EDGEPT *start, // loop to approimate
+static void fix2(  // polygonal approx
+    EDGEPT *start, // loop to approximate
     int area) {
   EDGEPT *edgept; // current point
   EDGEPT *edgept1;
@@ -258,18 +262,18 @@
          (dir = (edgept->prev->dir - edgept->next->dir) & 7) != 2 && dir != 6) {
     edgept = edgept->next; // find suitable start
   }
-  loopstart = edgept;      // remember start
-
-  stopped = 0;                   // not finished yet
-  edgept->fixed = true; //fix it
-  do {
-    linestart = edgept;        // possible start of line
-    auto dir1 = edgept->dir; //first direction
-    //length of dir1
+  loopstart = edgept; // remember start
+
+  stopped = 0;          // not finished yet
+  edgept->fixed = true; // fix it
+  do {
+    linestart = edgept;      // possible start of line
+    auto dir1 = edgept->dir; // first direction
+    // length of dir1
     auto sum1 = edgept->runlength;
     edgept = edgept->next;
-    auto dir2 = edgept->dir; //2nd direction
-    //length in dir2
+    auto dir2 = edgept->dir; // 2nd direction
+    // length in dir2
     auto sum2 = edgept->runlength;
     if (((dir1 - dir2 + 1) & 7) < 3) {
       while (edgept->prev->dir == edgept->next->dir) {
@@ -425,9 +429,9 @@
  *using the points which have been fixed by the first approximation*
  **********************************************************************/

-static EDGEPT *poly2(       // second poly
-    EDGEPT *startpt, // start of loop
-    int area         // area of blob box
+static EDGEPT *poly2( // second poly
+    EDGEPT *startpt,  // start of loop
+    int area          // area of blob box
 ) {
   EDGEPT *edgept;    // current outline point
   EDGEPT *loopstart; // starting point
@@ -467,9 +471,10 @@
           edgept = edgept->next; // move on
         } while (!edgept->fixed && edgept != loopstart && edgesum < 126);
         if (poly_debug) {
-          tprintf("Poly2:starting at (%d,%d)+%d=(%d,%d),%d to (%d,%d)\n", linestart->pos.x,
-                  linestart->pos.y, linestart->dir, linestart->vec.x, linestart->vec.y,
-                  edgesum, edgept->pos.x, edgept->pos.y);
+          tprintf("Poly2:starting at (%d,%d)+%d=(%d,%d),%d to (%d,%d)\n",
+                  linestart->pos.x, linestart->pos.y, linestart->dir,
+                  linestart->vec.x, linestart->vec.y, edgesum, edgept->pos.x,
+                  edgept->pos.y);
         }
         // reapproximate
         cutline(linestart, edgept, area);


Create target directory recursively if it doesn't exist

--- src/cert_provider/main.cc
+++ src/cert_provider/main.cc
@@ -331,7 +331,7 @@
   if (boost::filesystem::exists(dest_dir)) {
     boost::filesystem::remove(dest);
   } else {
-    boost::filesystem::create_directory(dest_dir);
+    boost::filesystem::create_directories(dest_dir);
   }
   boost::filesystem::copy_file(src, dest);
 }


Clear the bopomofo buffer when switching language mode. (partially fixed)

--- ChewingTextService/ChewingTextService.cpp
+++ ChewingTextService/ChewingTextService.cpp
@@ -733,6 +733,13 @@
 	// switch between Chinses and English modes
 	if(chewingContext_) {
 		::chewing_set_ChiEngMode(chewingContext_, !::chewing_get_ChiEngMode(chewingContext_));
+		if(::chewing_zuin_Check(chewingContext_) == 0) {
+			// if there is bopomofo in the buffer, send a fake Esc key to clear it.
+			::chewing_handle_Esc(chewingContext_);
+			// FIXME: We should reset the composition string here, but a new edit session
+			// is required for this task. We need to make the TextService API better to
+			// avoid touching TSF directly too much.
+		}
 		updateLangButtons();
 	}
 }


ignore instance variable for static method invocations

--- src/classpath-openjdk.cpp
+++ src/classpath-openjdk.cpp
@@ -4706,6 +4706,10 @@
      (t, jclassVmClass(t, jmethodClazz(t, *method))),
       jmethodSlot(t, *method));

+  if (methodFlags(t, vmMethod) & ACC_STATIC) {
+    instance = 0;
+  }
+
   if (instance and not instanceOf(t, methodClass(t, vmMethod), *instance)) {
     throwNew(t, Machine::IllegalArgumentExceptionType);
   }


splitted terminating message based on fPoolManager existance

--- coast/wdbase/Server.cpp
+++ coast/wdbase/Server.cpp
@@ -364,13 +364,15 @@
 	}

 	m.Trim(0);
-	m << "Cleaning up Server: " << GetName() << "\n\tTerminating running requests";
+	m << "Cleaning up Server: " << GetName() << "\n";
 	SysLog::WriteToStderr(m);
 	if (fPoolManager) {
+		SysLog::WriteToStderr("\tTerminating running requests");
 		delete fPoolManager;
 		fPoolManager = 0;
-	}
-	SysLog::WriteToStderr(" done\nServer Cleanup completed\nLeaving shutdown\n");
+		SysLog::WriteToStderr(" done\n");
+	}
+	SysLog::WriteToStderr("Server Cleanup completed\nLeaving shutdown\n");
 	return fRetVal;
 }


Handle FindStruct and FindRStruct correctly.

--- Caprica/papyrus/PapyrusResolutionContext.cpp
+++ Caprica/papyrus/PapyrusResolutionContext.cpp
@@ -512,15 +512,13 @@
   } else if (baseType.type == PapyrusType::Kind::Array) {
     auto fk = PapyrusBuiltinArrayFunctionKind::Unknown;
     if (!_stricmp(ident.name.c_str(), "find")) {
-      if (baseType.getElementType().type == PapyrusType::Kind::ResolvedStruct)
-        fk = PapyrusBuiltinArrayFunctionKind::FindStruct;
-      else
-        fk = PapyrusBuiltinArrayFunctionKind::Find;
+      fk = PapyrusBuiltinArrayFunctionKind::Find;
+    } else if(!_stricmp(ident.name.c_str(), "findstruct")) {
+      fk = PapyrusBuiltinArrayFunctionKind::FindStruct;
     } else if (!_stricmp(ident.name.c_str(), "rfind")) {
-      if (baseType.getElementType().type == PapyrusType::Kind::ResolvedStruct)
-        fk = PapyrusBuiltinArrayFunctionKind::RFindStruct;
-      else
-        fk = PapyrusBuiltinArrayFunctionKind::RFind;
+      fk = PapyrusBuiltinArrayFunctionKind::RFind;
+    } else if (!_stricmp(ident.name.c_str(), "rfindstruct")) {
+      fk = PapyrusBuiltinArrayFunctionKind::RFindStruct;
     } else if (!_stricmp(ident.name.c_str(), "add")) {
       fk = PapyrusBuiltinArrayFunctionKind::Add;
     } else if (!_stricmp(ident.name.c_str(), "clear")) {


fix bug, init the counter in tcp monitor

--- voyager/core/tcp_monitor.cc
+++ voyager/core/tcp_monitor.cc
@@ -9,7 +9,8 @@

 TcpMonitor::TcpMonitor(int max_all_connections, int max_ip_connections)
     : kMaxAllConnections(max_all_connections),
-      kMaxIpConnections(max_ip_connections) {}
+      kMaxIpConnections(max_ip_connections),
+      counter_(0) {}

 TcpMonitor::~TcpMonitor() {}


INTEGRATION: CWS changefileheader (1.8.66); FILE MERGED 2008/04/01 12:32:14 thb 1.8.66.2: #i85898# Stripping all external header guards 2008/03/31 16:19:09 rt 1.8.66.1: #i87441# Change license header to LPGL v3.

--- package/source/zippackage/ContentInfo.hxx
+++ package/source/zippackage/ContentInfo.hxx
@@ -1,52 +1,41 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: ContentInfo.hxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.8 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: hr $ $Date: 2006-06-20 06:14:03 $
+ * $RCSfile: ContentInfo.hxx,v $
+ * $Revision: 1.9 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * This file is part of OpenOffice.org.
  *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
  *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/
 #ifndef _CONTENT_INFO_HXX_
 #define _CONTENT_INFO_HXX_

-#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
 #include <com/sun/star/container/XNameContainer.hpp>
-#endif
 #ifndef _COM_SUN_STAR_LANG_XUNOTUNNEl_HPP_
 #include <com/sun/star/lang/XUnoTunnel.hpp>
 #endif
-#ifndef _ZIP_PACKAGE_FOLDER_HXX
 #include <ZipPackageFolder.hxx>
-#endif
-#ifndef _ZIP_PACKAGE_STREAM_HXX
 #include <ZipPackageStream.hxx>
-#endif

 namespace com { namespace sun { namespace star { namespace packages {
 class ContentInfo : public cppu::OWeakObject


(Arnaud) after SL - BlockShortcut: add error recovery - FindInterpCoords: change 0.01 to 0.001 - looks weird - InterpChannel: add more error recovery                  fix flow edge reconnection - AddChanBorder: add more error recovery

--- Child/Code/tStreamMeander/tStreamMeander.cpp
+++ Child/Code/tStreamMeander/tStreamMeander.cpp
@@ -3,7 +3,7 @@
 **  @file tStreamMeander.cpp
 **  @brief Functions for class tStreamMeander.
 **
-**  $Id: tStreamMeander.cpp,v 1.100 2004-01-13 16:23:51 childcvs Exp $
+**  $Id: tStreamMeander.cpp,v 1.101 2004-02-18 17:49:34 childcvs Exp $
 */
 /**************************************************************************/

@@ -193,6 +193,10 @@
 tLNode* tStreamMeander::BlockShortcut( tLNode* crn, tLNode* bpn, tLNode& nn,
                                        const tArray<double>& ic, double time )
 {
+   // record a pointer to the present downstream neighbor
+   // (don't use flowedge!):
+   tLNode* dn = crn->getDownstrmNbr();
+
    // already assertained that bpn flows to nPtr;
    // called from InterpChannel, so crn doesn't flow to bpn
    // and it needs to be changed
@@ -230,6 +234,13 @@
    nn.setMeanderStatus( kNonMeanderNode );
    nn.setDrArea( 0.0 );
    tLNode* newnodeP = meshPtr->AddNode( nn, kNoUpdateMesh, time );
+   // if addition should fail, unmeanderize bpn
+   if( newnodeP == NULL ){
+      bpn->setMeanderStatus( kNonMeanderNode );
+      bpn->setNew2DCoords( 0.0, 0.0 );
+      bpn->AddDrArea( -crn->getDrArea() );
+      crn->setDownstrmNbr( dn );
+   }
    return newnodeP;
 }

@@ -276,7 +287,7 @@
       const double phi = atan2( ydif, xdif );
       const double val1 = rand->ran3() - 0.5;
       const double x = x0 + curseglen * cos(phi) /
-          2.0 + 0.01 * val1 * defseglen;//pow(defseglen, 2.0);
+          2.0 + 0.001 * val1 * defseglen;//pow(defseglen, 2.0);
       const double val2 = rand->ran3() - 0.5;
       const double y = y0 + curseglen * sin(phi) /
           2.0 + 0.01 * val2 * defseglen;//pow(defseglen, 2.0);
@@ -308,7 +319,7 @@
       {
          xp[i] = static_cast<double>(i) * defseglen;
          const double val = rand->ran3() - 0.5;
-         yp[i] = yp[i-1] + 0.01 * val * exp(-yp[i-1] * val)
+         yp[i] = yp[i-1] + 0.001 * val * exp(-yp[i-1] * val)
              * defseglen;//pow(defseglen, 2.0);
          zp[i] = xp[i] * slope;
          const double dd = sqrt(xp[i] * xp[i] + yp[i] * yp[i]);
@@ -410,6 +421,14 @@
                   if (0) //DEBUG
                       cout<<"IC BS pt "<<newnodeP->getID()<<" added at "
                           << newnodeP->getX() << "," << newnodeP->getY() << endl;
+               } else {
+		 if (1) //DEBUG
+		   cout<<"IC BS pt NOT added at "
+		       << ic[0] << "," << ic[1] << endl;
+		 // Process of aborting point addition may have left node(s)
+		 // without valid flowedges:
+		 netPtr->ReInitFlowDirs();
+		 change = true;
                }
             }
             else{
@@ -421,15 +440,15 @@
                   // set flow edge temporarily to zero, so that it is flippable
                   prevNode->setFlowEdgToZero();
                   newnodeP = meshPtr->AddNode( nn, kNoUpdateMesh, time );
-                  if (0) //DEBUG
-                      cout<<"IC pt "<<newnodeP->getID()<<" added at "
-                          << ic[k*3+0] << "," << ic[k*3+1] << endl;
                   // did a node get added?
                   // need to reset flow directions here
                   if( newnodeP != NULL )
                   {
                      change = true;
-                     // previous node (prevNode) flows to new node (newnodeP)
+                      if (0) //DEBUG
+			cout<<"IC pt "<<newnodeP->getID()<<" added at "
+			    << ic[k*3+0] << "," << ic[k*3+1] << endl;
+                    // previous node (prevNode) flows to new node (newnodeP)
                      prevNode->setDownstrmNbr( newnodeP );
                      // (check for rare case when nodes not connected)
                      if( prevNode->getFlowEdg() == NULL )
@@ -437,14 +456,24 @@
                      // Paranoia
                      assert( prevNode->getFlowEdg()->getDestinationPtr() == newnodeP );
                      prevNode = newnodeP;
+                  } else {
+		    if (1) //DEBUG
+		      cout<<"IC pt NOT added at "
+			  << ic[k*3+0] << "," << ic[k*3+1] << endl;
+		    // Process of aborting point addition may have left node(s)
+		    // without valid flowedges:
+		    netPtr->ReInitFlowDirs();
+		    change = true;
                   }
                }
                // after adding all new nodes, make last new node (newnodeP) flow to
                // the next meander node downstream (nPtr)
-               newnodeP->setDownstrmNbr( nPtr );
+               prevNode->setDownstrmNbr( nPtr );
                // (check for rare case when nodes not connected)
-               if( newnodeP->getFlowEdg() == NULL )
-                   meshPtr->ForceFlow( newnodeP, nPtr, time );
+               if ( prevNode->getFlowEdg() == NULL ) {
+		 change = true;
+		 meshPtr->ForceFlow( prevNode, nPtr, time );
+	       }
                // Paranoia
                assert( newnodeP->getFlowEdg()->getDestinationPtr() == nPtr );
             }
@@ -1217,8 +1246,12 @@
                //xyz[2]-cn->getZ() if this depth is positive
                //The texture of this deposit would be
                //the surface texture of cn.  Use erodep.
-               meshPtr->AddNode( channode, kNoUpdateMesh, time );
-               change = true;//flag to update mesh
+               tLNode* nnPtr = meshPtr->AddNode( channode, kNoUpdateMesh, time );
+               if( nnPtr != NULL ){
+		 if(1)//DEBUG
+		   cout<<"ACB pt "<<nnPtr->getID()<<" added at "<<xyz[0]<<", "<<xyz[1]<<endl;
+		 change = true; //flag to update mesh
+               }
                cn->setXYZD( zeroArr );
             }
          }


i#112411: Fixed Gnome filepicker filter selection

--- fpicker/source/unx/gnome/SalGtkFilePicker.cxx
+++ fpicker/source/unx/gnome/SalGtkFilePicker.cxx
@@ -909,6 +909,9 @@
                     {
                         static const OUString aStarDot = OUString::createFromAscii( "*." );

+                        ::rtl::OUString aNewFilter;
+                        ::rtl::OUString aOldFilter = getCurrentFilter();
+                        sal_Bool bChangeFilter = sal_True;
                         for ( FilterList::iterator aListIter = m_pFilterList->begin();
                               aListIter != m_pFilterList->end();
                               ++aListIter
@@ -916,11 +919,17 @@
                         {
                             if( aListIter->getFilter().indexOf( aStarDot+sExtension ) >= 0 )
                             {
-                                setCurrentFilter( aListIter->getTitle() );
+                                if( !aNewFilter.getLength() )
+                                    aNewFilter = aListIter->getTitle();
+
+                                if( aOldFilter == aListIter->getTitle() )
+                                    bChangeFilter = sal_False;
+
                                 bExtensionTypedIn = true;
-                                break;
                             }
                         }
+                        if( bChangeFilter && bExtensionTypedIn )
+                            setCurrentFilter( aNewFilter );
                     }
                 }


Significantly reduce stack size needed for calibration in commander

--- src/modules/commander/calibration_routines.cpp
+++ src/modules/commander/calibration_routines.cpp
@@ -447,13 +447,13 @@
 		}

 		/* inform user which orientations are still needed */
-		char pendingStr[256];
+		char pendingStr[80];
 		pendingStr[0] = 0;

 		for (unsigned int cur_orientation=0; cur_orientation<detect_orientation_side_count; cur_orientation++) {
 			if (!side_data_collected[cur_orientation]) {
-				strcat(pendingStr, " ");
-				strcat(pendingStr, detect_orientation_str((enum detect_orientation_return)cur_orientation));
+				strncat(pendingStr, " ", sizeof(pendingStr));
+				strncat(pendingStr, detect_orientation_str((enum detect_orientation_return)cur_orientation), sizeof(pendingStr));
 			}
 		}
 		calibration_log_info(mavlink_log_pub, "[cal] pending:%s", pendingStr);


*** empty log message ***

*** empty log message ***


commander: Remove unused error variable

commander: Remove unused error variable

--- src/modules/commander/state_machine_helper.cpp
+++ src/modules/commander/state_machine_helper.cpp
@@ -64,12 +64,6 @@
 #include "commander_helper.h"
 #include "PreflightCheck.h"

-/* oddly, ERROR is not defined for c++ */
-#ifdef ERROR
-# undef ERROR
-#endif
-static const int ERROR = -1;
-
 // This array defines the arming state transitions. The rows are the new state, and the columns
 // are the current state. Using new state and current  state you can index into the array which
 // will be true for a valid transition or false for a invalid transition. In some cases even


#ifdef out a broken test on win32

#ifdef out a broken test on win32

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@157819 91177308-0d34-0410-b5e6-96231b3b80d8

--- unittests/Tooling/ToolingTest.cpp
+++ unittests/Tooling/ToolingTest.cpp
@@ -110,6 +110,9 @@
   EXPECT_TRUE(Action.get() != NULL);
 }

+#ifndef LLVM_ON_WIN32
+// This test breaks on Windows.
+
 TEST(ToolInvocation, TestMapVirtualFile) {
   clang::FileManager Files((clang::FileSystemOptions()));
   std::vector<std::string> Args;
@@ -123,5 +126,7 @@
   EXPECT_TRUE(Invocation.run());
 }

+#endif
+
 } // end namespace tooling
 } // end namespace clang