Add background_mask instead of using magic number

--- googletest/src/gtest.cc
+++ googletest/src/gtest.cc
@@ -2980,7 +2980,8 @@
   GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
   const WORD old_color_attrs = buffer_info.wAttributes;
   // Let's reuse the BG
-  const WORD existing_bg = old_color_attrs & 0x00F0;
+  const WORD background_mask = BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY;
+  const WORD existing_bg = old_color_attrs & background_mask;

   // We need to flush the stream buffers into the console before each
   // SetConsoleTextAttribute call lest it affect the text that is already


Updates code to disable DQS on bad nibble

If we have a bad nibble on a x4 DIMM, then we want to
disable the associated DQS to conserve power. This commit
updates the code to disable the DQS on a bad DRAM for a x4
DIMM.

Change-Id: I083d1739e431cc1229e60ab6067ac61c1b1a8ce7
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/46940
Tested-by: FSP CI Jenkins <aa9e4d9ac7cd25905e9c0dd36d4150516e73dd86@us.ibm.com>
Reviewed-by: ANDRE A. MARIN <65293609e29ccd0ac899f5f3f03aea95be1b215f@us.ibm.com>
Reviewed-by: Louis Stermole <a2bef96d502debd02962600aef4d81d949c35039@us.ibm.com>
Reviewed-by: JACOB L. HARVEY <3228c361e36065d481020c968085ab1d20e47d22@us.ibm.com>
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: HWSV CI <ae069ce3805842f4ed79e0ef7868baadb5df0a6b@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: Jennifer A. Stofer <ab93eca12e43608f33daa16a67357cd7b7e867ab@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
+++ src/import/chips/p9/procedures/hwp/memory/lib/phy/dp16.C
@@ -3196,6 +3196,67 @@
 }

 ///
+/// @brief Configures the DQS_DISABLE register based upon the bad DQ information for x4 DRAM
+/// @param[in] i_target - the DIMM target on which to operate
+/// @param[in] i_dq_disable - the DQ disable information
+/// @param[in] i_reg - the DQS disable bit register to update
+///
+fapi2::ReturnCode reset_dqs_disable(const fapi2::Target<fapi2::TARGET_TYPE_DIMM>& i_target,
+                                    const fapi2::buffer<uint64_t>& i_dq_disable,
+                                    const uint64_t i_reg)
+{
+    // Declaring the mappings from bad DQ to bad DQS
+    constexpr uint64_t BAD_DQ      = MCA_DDRPHY_DP16_DATA_BIT_DISABLE0_RP0_P0_0_01_DISABLE_15;
+    constexpr uint64_t BAD_DQ_LEN  = BITS_PER_NIBBLE;
+    constexpr uint64_t BAD_DQS     = MCA_DDRPHY_DP16_DATA_BIT_DISABLE1_RP0_P0_0_01_DISABLE_16_23;
+    constexpr uint64_t BAD_DQS_LEN = 2;
+
+    // An entire nibble is bad if all of it's bits are set, so 0xf
+    constexpr uint64_t ALL_BAD = 0xf;
+
+    // Declares variables
+    fapi2::buffer<uint64_t> l_dqs_disable;
+    const auto& l_mca = mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target);
+
+    // Checks if this DIMM is a x8 DIMM first, if so, skip it as a chip kill here is beyond our corrective capabilities
+    uint8_t l_width = 0;
+    FAPI_TRY(mss::eff_dram_width(i_target, l_width));
+
+    // Skip if the DIMIM is a x8
+    if(l_width == fapi2::ENUM_ATTR_EFF_DRAM_WIDTH_X8)
+    {
+        FAPI_INF("%s is a x8 DIMM, clearing DQS register 0x%016lx", mss::c_str(i_target), i_reg);
+        return mss::putScom(l_mca, i_reg, l_dqs_disable);
+    }
+
+    // Due to plug rules check, we should be a x4 now, so let's reset some DQS bits
+    for(uint64_t l_nibble = 0; l_nibble < NIBBLES_PER_DP; ++l_nibble)
+    {
+        // If we have a whole nibble bad, set the bad DQS bits
+        const auto DQ_START = BAD_DQ + (l_nibble * BAD_DQ_LEN);
+        const auto DQS_START = BAD_DQS + (l_nibble * BAD_DQS_LEN);
+
+        uint64_t l_nibble_disable = 0;
+
+        FAPI_TRY(i_dq_disable.extractToRight(l_nibble_disable, DQ_START, BAD_DQ_LEN));
+
+        if(l_nibble_disable == ALL_BAD)
+        {
+            FAPI_INF("%s found that nibble %lu was all bad on DQS reg 0x%016llx",
+                     mss::c_str(i_target), l_nibble, i_reg);
+            FAPI_TRY(l_dqs_disable.setBit(DQS_START, BAD_DQS_LEN));
+        }
+    }
+
+    // Sets up the DQS register
+    FAPI_INF("%s setting DQS disable register 0x%016llx to 0x%016llx", mss::c_str(i_target), i_reg, l_dqs_disable);
+    FAPI_TRY(mss::putScom(l_mca, i_reg, l_dqs_disable), "%s failed to set 0x%016llx", mss::c_str(l_mca), i_reg);
+
+fapi_try_exit:
+    return fapi2::current_err;
+}
+
+///
 /// @brief Reset the bad-bits masks for a port - helper for ease of testing
 /// @note Read the bad bits from the f/w attributes and stuff them in the
 /// appropriate registers.
@@ -3215,7 +3276,7 @@
     for (const auto& r : l_ranks)
     {
         uint64_t l_rp = 0;
-        uint64_t l_dimm_index = rank::get_dimm_from_rank(r);
+        const uint64_t l_dimm_index = rank::get_dimm_from_rank(r);
         FAPI_TRY( mss::rank::get_pair_from_rank(mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target), r, l_rp) );

         FAPI_INF("%s processing bad bits for DIMM%d rank %d (%d) rp %d", mss::c_str(i_target), l_dimm_index, mss::index(r), r,
@@ -3236,13 +3297,15 @@

             for (const auto& a : l_addrs)
             {
-                uint64_t l_register_value = (l_bad_bits[l_byte_index] << 8) | l_bad_bits[l_byte_index + 1];
-
-                FAPI_INF("%s writing 0x%0lX value 0x%0lX from 0x%X, 0x%X",
+                const uint64_t l_register_value = (l_bad_bits[l_byte_index] << 8) | l_bad_bits[l_byte_index + 1];
+
+                FAPI_INF("%s writing 0x%016lX value 0x%016lX from 0x02%X, 0x%02X",
                          mss::c_str(i_target), a.first, l_register_value,
                          l_bad_bits[l_byte_index], l_bad_bits[l_byte_index + 1]);

                 FAPI_TRY( mss::putScom(mss::find_target<fapi2::TARGET_TYPE_MCA>(i_target), a.first, l_register_value) );
+
+                FAPI_TRY(reset_dqs_disable(i_target, l_register_value, a.second));
                 l_byte_index += 2;
             }
         }


eplace the call via CINT to TFile::SaveObjectAs by a direct call
to TVirtualIO::SaveObjectAs.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@17502 27541ba8-7e3a-0410-8455-c3a389f83636

--- gpad/src/TClassTree.cxx
+++ gpad/src/TClassTree.cxx
@@ -1,4 +1,4 @@
-// @(#)root/gpad:$Name:  $:$Id: TClassTree.cxx,v 1.14 2007/01/12 16:03:16 brun Exp $
+// @(#)root/gpad:$Name:  $:$Id: TClassTree.cxx,v 1.15 2007/01/23 09:04:13 brun Exp $
 // Author: Rene Brun   01/12/98

 /*************************************************************************
@@ -27,6 +27,7 @@
 #include "TArrow.h"
 #include "TText.h"
 #include "TSystem.h"
+#include "TVirtualIO.h"
 #include "TObjString.h"
 #include "Riostream.h"

@@ -700,7 +701,7 @@
    // with no access to the original classes.
    // By default a message is printed. Specify option "Q" to remove the message

-   gROOT->ProcessLine(Form("TFile::SaveObjectAs((TClassTree*)0x%x,\"%s\",\"%s\");",this,filename,option));
+   TVirtualIO::GetIO()->SaveObjectAs(this,filename,option);
 }


Fix build error for LLVM11

Fix build error for LLVM11

--- llvm_profile_writer.cc
+++ llvm_profile_writer.cc
@@ -94,7 +94,8 @@
     inline_stack_.pop_back();
   }
   auto &caller_profile = *(inline_stack_.back());
-  auto CalleeName = GetNameRef(Symbol::Name(callsite.second));
+  auto CalleeName =
+    std::__cxx11::basic_string<char>(GetNameRef(Symbol::Name(callsite.second)).str());
   auto &callee_profile =
       caller_profile.functionSamplesAt(llvm::sampleprof::LineLocation(
           line, discriminator))[CalleeName];


Updating FboMultipleRenderTargets to reflect recent changes

--- samples/_opengl/FboMultipleRenderTargets/src/FboMultipleRenderTargetsApp.cpp
+++ samples/_opengl/FboMultipleRenderTargets/src/FboMultipleRenderTargetsApp.cpp
@@ -21,7 +21,6 @@
 	void			renderSceneToFbo();

 	gl::FboRef			mFbo;
-	gl::Texture2dRef	mTexAttachment0, mTexAttachment1;
 	gl::GlslProgRef		mGlslMultipleOuts;
 	mat4				mRotation;
 	static const int	FBO_WIDTH = 256, FBO_HEIGHT = 256;
@@ -29,12 +28,10 @@

 void FboMultipleRenderTargetsApp::setup()
 {
-	mTexAttachment0 = gl::Texture2d::create( FBO_WIDTH, FBO_HEIGHT );
-	mTexAttachment1 = gl::Texture2d::create( FBO_WIDTH, FBO_HEIGHT );
 	auto format = gl::Fbo::Format()
-//			.samples( 4 ) // uncomment this to enable 4x antialiasing // FIXME: causes drawing to be all white
-			.attachment( GL_COLOR_ATTACHMENT0, mTexAttachment0 )
-			.attachment( GL_COLOR_ATTACHMENT1, mTexAttachment1 );
+//			.samples( 4 ) // uncomment this to enable 4x antialiasing
+			.attachment( GL_COLOR_ATTACHMENT0, gl::Texture2d::create( FBO_WIDTH, FBO_HEIGHT ) )
+			.attachment( GL_COLOR_ATTACHMENT1, gl::Texture2d::create( FBO_WIDTH, FBO_HEIGHT ) );
 	mFbo = gl::Fbo::create( FBO_WIDTH, FBO_HEIGHT, format );

 	try {
@@ -76,7 +73,6 @@

 	// render the torus with our multiple-output shader
 	gl::ScopedGlslProg glslScope( mGlslMultipleOuts );
-	gl::setDefaultShaderVars();
 	gl::drawCube( vec3( 0 ), vec3( 2.2f ) );
 }

@@ -94,13 +90,13 @@
 {
 	gl::clear( Color::gray( 0.35f ) );

+	gl::setMatricesWindow( getWindowSize() );
+
 	// draw the two textures we've created side-by-side
-	gl::setMatricesWindow( getWindowSize() );
-//	gl::draw( mFbo->getTexture(0), mFbo->getTexture(0)->getBounds() );
-//	gl::draw( mFbo->getTexture(1), mFbo->getTexture(1)->getBounds() + vec2( mFbo->getTexture(0)->getWidth(), 0 ) );
-
-	gl::draw( mTexAttachment0, mTexAttachment0->getBounds() );
-	gl::draw( mTexAttachment1, mTexAttachment1->getBounds() + vec2( mTexAttachment0->getWidth(), 0 ) );
+	auto tex0 = mFbo->getTexture( GL_COLOR_ATTACHMENT0 );
+	auto tex1 = mFbo->getTexture( GL_COLOR_ATTACHMENT1 );
+	gl::draw( tex0, tex0->getBounds() );
+	gl::draw( tex1, tex1->getBounds() + vec2( tex1->getWidth(), 0 ) );
 }

 CINDER_APP( FboMultipleRenderTargetsApp, RendererGl )


fullfil promise made in  6164d4f0: change world material on config

--- src/modules/GeometryBuilderGeant4/GeometryConstructionG4.cpp
+++ src/modules/GeometryBuilderGeant4/GeometryConstructionG4.cpp
@@ -64,7 +64,7 @@
         throw InvalidValueError(config_, "world_material", "material does not exists, use 'air' or 'vacuum'");
     }

-    world_material_ = materials_["vacuum"];
+    world_material_ = materials_[world_material];
     LOG(TRACE) << "Material of world is " << world_material_->GetName();

     // Calculate world size


Add a bus saturation test for px4io.

Add a bus saturation test for px4io.

--- apps/drivers/px4io/px4io.cpp
+++ apps/drivers/px4io/px4io.cpp
@@ -1112,34 +1112,57 @@
 test(void)
 {
 	int	fd;
-
-	fd = open(PWM_OUTPUT_DEVICE_PATH, 0);
-
-	if (fd < 0) {
-		puts("open fail");
-		exit(1);
-	}
-
-	ioctl(fd, PWM_SERVO_ARM, 0);
-	ioctl(fd, PWM_SERVO_SET(0), 1000);
-	ioctl(fd, PWM_SERVO_SET(1), 1100);
-	ioctl(fd, PWM_SERVO_SET(2), 1200);
-	ioctl(fd, PWM_SERVO_SET(3), 1300);
-	ioctl(fd, PWM_SERVO_SET(4), 1400);
-	ioctl(fd, PWM_SERVO_SET(5), 1500);
-	ioctl(fd, PWM_SERVO_SET(6), 1600);
-	ioctl(fd, PWM_SERVO_SET(7), 1700);
-
-	close(fd);
-
-	actuator_armed_s aa;
-
-	aa.armed = true;
-	aa.lockdown = false;
-
-	orb_advertise(ORB_ID(actuator_armed), &aa);
-
-	exit(0);
+	unsigned	servo_count = 0;
+	unsigned	pwm_value = 1000;
+	int		direction = 1;
+	int		ret;
+
+	fd = open("/dev/px4io", O_WRONLY);
+
+	if (fd < 0)
+		err(1, "failed to open device");
+
+	if (ioctl(fd, PWM_SERVO_GET_COUNT, (unsigned long)&servo_count))
+		err(1, "failed to get servo count");
+
+	if (ioctl(fd, PWM_SERVO_ARM, 0))
+		err(1, "failed to arm servos");
+
+	for (;;) {
+
+		/* sweep all servos between 1000..2000 */
+		servo_position_t servos[servo_count];
+		for (unsigned i = 0; i < servo_count; i++)
+			servos[i] = pwm_value;
+
+		ret = write(fd, servos, sizeof(servos));
+		if (ret != sizeof(servos))
+			err(1, "error writing PWM servo data, wrote %u got %d", sizeof(servos), ret);
+
+		if (direction > 0) {
+			if (pwm_value < 2000) {
+				pwm_value++;
+			} else {
+				direction = -1;
+			}
+		} else {
+			if (pwm_value > 1000) {
+				pwm_value--;
+			} else {
+				direction = 1;
+			}
+		}
+
+		/* readback servo values */
+		for (unsigned i = 0; i < servo_count; i++) {
+			servo_position_t value;
+
+			if (ioctl(fd, PWM_SERVO_GET(i), (unsigned long)&value))
+				err(1, "error reading PWM servo %d", i);
+			if (value != servos[i])
+				errx(1, "servo %d readback error, got %u expected %u", i, value, servos[i]);
+		}
+	}
 }

 void


[AT-SPI] Remove Role check in AcceptObject

Removed AcceptObjectCheckRole() method and its call in AcceptObject().

Checking the AT-SPI Role of the Component to decide whether it should be
highlighted or not is not needed, as by default all Components are
non-highlightable and highlightability is decided individually
in dali-toolkit by setting the ACCESSIBILITY_HIGHLIGHTABLE property.

From now on if we want to turn on highlightability for certain
Components, we can do this in dali-toolkit on a class level
or in runtime per individual instance of a Component.

Change-Id: I4777594550765b0b8335e47cd322d7d96590fe55

--- dali/internal/accessibility/bridge/bridge-accessible.cpp
+++ dali/internal/accessibility/bridge/bridge-accessible.cpp
@@ -58,46 +58,6 @@
   dbusServer.addInterface("/", desc, true);
 }

-static bool AcceptObjectCheckRole(Component* obj)
-{
-  if(!obj)
-    return false;
-  switch(obj->GetRole())
-  {
-    case Role::APPLICATION:
-    case Role::FILLER:
-    case Role::SCROLL_PANE:
-    case Role::SPLIT_PANE:
-    case Role::WINDOW:
-    case Role::IMAGE:
-    case Role::IMAGE_MAP:
-    case Role::LIST:
-    case Role::ICON:
-    case Role::TOOL_BAR:
-    case Role::REDUNDANT_OBJECT:
-    case Role::COLOR_CHOOSER:
-    case Role::TREE_TABLE:
-    case Role::PAGE_TAB_LIST:
-    case Role::PAGE_TAB:
-    case Role::SPIN_BUTTON:
-    case Role::INPUT_METHOD_WINDOW:
-    case Role::EMBEDDED:
-    case Role::INVALID:
-    case Role::NOTIFICATION:
-    case Role::DATE_EDITOR:
-    case Role::TABLE:
-    {
-      return false;
-    }
-    default:
-    {
-      break;
-    }
-  }
-
-  return true;
-}
-
 static bool AcceptObjectCheckRelations(Component* obj)
 {
   auto r = obj->GetRelationSet();
@@ -151,8 +111,6 @@
     return false;
   const auto states = obj->GetStates();
   if(!states[State::VISIBLE])
-    return false;
-  if(!AcceptObjectCheckRole(obj))
     return false;
   if(!AcceptObjectCheckRelations(obj))
     return false;


INTEGRATION: CWS warnings01 (1.42.74); FILE MERGED 2006/03/24 15:36:29 fs 1.42.74.1: #i57457# warning-free code (unxlngi6/.pro + unxsoli4.pro)

--- dbaccess/source/ui/relationdesign/RelationController.cxx
+++ dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RelationController.cxx,v $
  *
- *  $Revision: 1.42 $
- *
- *  last change: $Author: hr $ $Date: 2005-09-23 12:45:06 $
+ *  $Revision: 1.43 $
+ *
+ *  last change: $Author: hr $ $Date: 2006-06-20 03:31:07 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -290,7 +290,6 @@
         default:
             OJoinController::Execute(_nId,aArgs);
             return;
-            break;
     }
     InvalidateFeature(_nId);
 }


INTEGRATION: CWS odbmacros2 (1.50.10); FILE MERGED 2008/02/20 13:28:04 fs 1.50.10.1.2.1: some DBG_UNHANDLED_EXCEPTIONs 2008/02/06 21:45:28 fs 1.50.10.1: #i49133# some initialization-related re-factoring

--- dbaccess/source/ui/relationdesign/RelationController.cxx
+++ dbaccess/source/ui/relationdesign/RelationController.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: RelationController.cxx,v $
  *
- *  $Revision: 1.50 $
- *
- *  last change: $Author: rt $ $Date: 2008-01-30 08:54:49 $
+ *  $Revision: 1.51 $
+ *
+ *  last change: $Author: kz $ $Date: 2008-03-06 18:30:24 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -293,21 +293,9 @@
 // -----------------------------------------------------------------------------
 void ORelationController::impl_initialize()
 {
-    const NamedValueCollection& rArguments( getInitParams() );
-
-    Reference< XConnection > xConnection;
-    xConnection = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection );
-    if ( xConnection.is() )
-        initializeConnection( xConnection );
-
-    if ( !ensureConnected( sal_False ) )
-    {
-        setEditable(sal_False);
-        m_bRelationsPossible    = sal_False;
-        connectionLostMessage();
-        throw SQLException();
-    }
-    else if( !getSdbMetaData().supportsRelations() )
+    OJoinController::impl_initialize();
+
+    if( !getSdbMetaData().supportsRelations() )
     {// check if this database supports relations

         setEditable(sal_False);
@@ -321,8 +309,6 @@
         disconnect();
         throw SQLException();
     }
-
-    OJoinController::impl_initialize();

     if(!m_bRelationsPossible)
         InvalidateAll();


Detect pagetitle change

Detect pagetitle change

--- browser.cpp
+++ browser.cpp
@@ -18,11 +18,15 @@
     connect(command_bar, SIGNAL(returnPressed()), SLOT(changeLocation()));
     connect(view, SIGNAL(loadFinished(bool)), this, SLOT(finishLoading(bool)));

-    connect(view,SIGNAL(loadProgress(int)),this,SLOT(showProgress(int)));
-
     QShortcut *shortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_L), this);
     connect(shortcut, SIGNAL(activated()), this, SLOT(showLocation()));
     command_bar->setVisible(false);
+
+    /* Show loading progress */
+    connect(view,SIGNAL(loadProgress(int)),this,SLOT(showProgress(int)));
+
+    /* Update title */
+    connect(view,SIGNAL(titleChanged(QString)),this,SLOT(setWindowTitle(QString)));

     //Layout
     QVBoxLayout *mainLayout = new QVBoxLayout;


Fixed missing initializer for _color and assignment of color to ShapeDrawable

--- src/osg/ShapeDrawable.cpp
+++ src/osg/ShapeDrawable.cpp
@@ -16,11 +16,13 @@

 using namespace osg;

-ShapeDrawable::ShapeDrawable()
+ShapeDrawable::ShapeDrawable():
+    _color(1.0f, 1.0f, 1.0f, 1.0f)
 {
 }

 ShapeDrawable::ShapeDrawable(Shape* shape,TessellationHints* hints):
+    _color(1.0f, 1.0f, 1.0f, 1.0f),
     _tessellationHints(hints)
 {
     setShape(shape);
@@ -49,8 +51,6 @@

 void ShapeDrawable::setColor(const Vec4& color)
 {
-    if (color==_color) return;
-
     _color = color;

     Vec4Array* colors = dynamic_cast<Vec4Array*>(_colorArray.get());
@@ -91,4 +91,6 @@
         BuildShapeGeometryVisitor dsv(this, _tessellationHints.get());
         _shape->accept(dsv);
     }
+
+    setColor(_color);
 }


Better db-zero handling

Better db-zero handling


Fixed typo in comment

Fixed typo in comment

git-svn-id: aa838dfc23441284dd616281de4245daec5d2135@14477 16af8721-9629-0410-8352-f15c8da7e697

--- src/osgDB/ObjectCache.cpp
+++ src/osgDB/ObjectCache.cpp
@@ -22,12 +22,12 @@
 ObjectCache::ObjectCache():
     osg::Referenced(true)
 {
-//    OSG_NOTICE<<"Constructed ObjectCach"<<std::endl;
+//    OSG_NOTICE<<"Constructed ObjectCache"<<std::endl;
 }

 ObjectCache::~ObjectCache()
 {
-//    OSG_NOTICE<<"Destructed ObjectCach"<<std::endl;
+//    OSG_NOTICE<<"Destructed ObjectCache"<<std::endl;
 }

 void ObjectCache::addObjectCache(ObjectCache* objectCache)


From Tassilo Glander, "I want to submit a fix for the plugin to load .x model files (Direct X).

The current version crashes when encountering global materials, as also reported in the forum by the author of the plugin.

The problem in mesh.cpp (app. ln 247) is, that references to global materials that are given in curly brackets {} are not supported by the reader. However, curly brackets seem to be common, according to Bourke. Unfortunately, I found no specification. However, also the DirectX model viewer that comes with the DirectX-SDK (August 2009) expects curly brackets and refuses models without them.

My fix checks 2 more cases ("{ aMaterial }" -> 3 tokens and "{aMaterial}" -> 1 token), and extracts the material name for the lookup. I don't know if this is the most elegant solution, but the tokenizer seems to split based on white spaces.

You can reproduce the bug with the attached model (box.x), which loads fine in other tools, such as 3DSmax, DeepExploration or the DirectX model viewer. When I remove the curly brackets at the reference of "myGlobalMaterial", it loads in osgviewer, but is not standard conform.
"

--- src/osgPlugins/x/mesh.cpp
+++ src/osgPlugins/x/mesh.cpp
@@ -244,7 +244,20 @@

         // check for "{ <material name> }" for a
         // material which was declared globally
-        Material * material = _obj->findMaterial(token[0]);
+        string materialName = token[0];
+        // could be given as "{ someName }" which more than 1 tokens
+        if (materialName == "{" && token.size()>1)
+        {
+            materialName = token[1];
+        }
+        // or could be given as "{someName}" which would be in token[0]
+        else if (materialName.size() > 2 && materialName[0] == '{' && materialName[materialName.size()-1] == '}')
+        {
+            // remove curly brackets
+            materialName = materialName.substr(1, materialName.size()-2);
+        }
+        Material * material = _obj->findMaterial(materialName);
+
         if (material)
         {
             _materialList->material.push_back(*material);


back to testnet version

back to testnet version

--- src/kernel.cpp
+++ src/kernel.cpp
@@ -248,8 +248,7 @@
     const CBlockIndex* pindexFrom = mapBlockIndex[hashBlockFrom];
     nStakeModifierHeight = pindexFrom->nHeight;
     nStakeModifierTime = pindexFrom->GetBlockTime();
-    // DEBUG TEST int64_t nStakeModifierSelectionInterval = (fTestNet ? nModifierInterval : GetStakeModifierSelectionInterval());
-    int64_t nStakeModifierSelectionInterval = GetStakeModifierSelectionInterval();
+    int64_t nStakeModifierSelectionInterval = (fTestNet ? nModifierInterval : GetStakeModifierSelectionInterval()); // DEBUG
     int64_t nStakeModifierTargetTime = nStakeModifierTime + nStakeModifierSelectionInterval;
     const CBlockIndex* pindex = pindexFrom;


Update kernel.cpp

Update kernel.cpp

New checkpoint stake modifier v1.3


use hash-table (unordered-map) to cache conversions functions

--- src/kernel.cpp
+++ src/kernel.cpp
@@ -1,5 +1,10 @@
 #include "kernel.h"
 #include "types.h"
+
+#include <unordered_map>
+#include <functional>
+#include <utility>
+#include <tuple>

 namespace opencl {

@@ -82,12 +87,148 @@
   NanReturnValue(JS_INT(CL_SUCCESS));
 }

+// caches OpenCL type name to conversion function mapping in a hash table
+// (unordered_map) for fast retrieval. This is much faster than the previous
+// approach of checking each possible type with strcmp in a huge if-else
+class PrimitiveTypeMapCache {
+private:
+  /// Type of the conversion function
+  typedef std::function<std::tuple<size_t, void*, cl_int>(const Local<Value>&)> func_t;
+  // map of conversion functions
+  std::unordered_map<std::string, func_t> m_converters;
+public:
+  PrimitiveTypeMapCache() {
+    // if we create the TypeMap as a static function member, the constructor
+    // is guarantueed to be called by only one thread (see C++11 standard sec 6.7)
+    // while all other threads wait for completion. Thus no manual synchronization
+    // is needed for the initialization.
+
+    // create all type mappers
+
+    /* convert primitive types */
+
+    #define CONVERT_NUMBER(NAME, TYPE, PRED, CONV)                              \
+     {                                                                          \
+      func_t f = [](const Local<Value>& val)                                    \
+        -> std::tuple<size_t, void*, cl_int> {                                  \
+        if (!val->PRED()){                                                      \
+         return std::tuple<size_t, void*,cl_int>(0, NULL, CL_INVALID_ARG_VALUE);\
+        }                                                                       \
+        void* ptr_data = new TYPE;                                              \
+        size_t ptr_size = sizeof(TYPE);                                         \
+        *((TYPE *)ptr_data) = val->CONV();                                      \
+        return std::tuple<size_t, void*,cl_int>(ptr_size, ptr_data, 0);         \
+      };                                                                        \
+      m_converters[NAME] = f;                                                   \
+     }
+
+    CONVERT_NUMBER("char", cl_char, IsInt32, ToInt32()->Value);
+    CONVERT_NUMBER("uchar", cl_uchar, IsInt32, ToUint32()->Value);
+    CONVERT_NUMBER("short", cl_short, IsInt32, ToInt32()->Value);
+    CONVERT_NUMBER("ushort", cl_ushort, IsInt32, ToUint32()->Value);
+    CONVERT_NUMBER("int", cl_int , IsInt32, ToInt32()->Value);
+    CONVERT_NUMBER("uint", cl_uint, IsInt32, ToUint32()->Value);
+    CONVERT_NUMBER("long", cl_long, IsNumber, ToInteger()->Value);
+    CONVERT_NUMBER("ulong", cl_ulong, IsNumber, ToInteger()->Value);
+    CONVERT_NUMBER("float", cl_float, IsNumber, NumberValue);
+    CONVERT_NUMBER("double", cl_double, IsNumber, NumberValue);
+    CONVERT_NUMBER("half", cl_half, IsNumber, NumberValue);
+
+    #undef CONVERT_NUMBER
+
+
+    /* convert vector types (e.g. float4, int16, etc) */
+
+    #define CONVERT_VECT(NAME, TYPE, I, PRED, COND)                             \
+      {                                                                         \
+       func_t f = [](const Local<Value>& val)                                   \
+          -> std::tuple<size_t, void*, cl_int> {                                \
+        if (!val->IsArray()) {                                                  \
+          /*THROW_ERR(CL_INVALID_ARG_VALUE);  */                                \
+          return std::tuple<size_t,void*,cl_int>(0, NULL, CL_INVALID_ARG_VALUE);\
+        }                                                                       \
+        Local<Array> arr = Local<Array>::Cast(val);                             \
+        if (arr->Length() != I) {                                               \
+          /*THROW_ERR(CL_INVALID_ARG_SIZE);*/                                   \
+          return std::tuple<size_t,void*,cl_int>(0, NULL, CL_INVALID_ARG_SIZE); \
+        }                                                                       \
+        TYPE * vvc = new TYPE[I];                                               \
+        size_t ptr_size = sizeof(TYPE) * I;                                     \
+        void* ptr_data = vvc;                                                   \
+        for (unsigned int i = 0; i < I; ++ i) {                                 \
+          if (!arr->Get(i)->PRED()) {                                           \
+            /*THROW_ERR(CL_INVALID_ARG_VALUE);*/                                \
+            /*THROW_ERR(CL_INVALID_ARG_VALUE);*/                                \
+          return std::tuple<size_t,void*,cl_int>(0, NULL, CL_INVALID_ARG_VALUE);\
+          }                                                                     \
+          vvc[i] = arr->Get(i)->COND();                                         \
+        }                                                                       \
+        return std::tuple<size_t,void*,cl_int>(ptr_size, ptr_data, 0);          \
+      };                                                                        \
+      m_converters["NAME ## I"] = f;                                            \
+      }
+
+    #define CONVERT_VECTS(NAME, TYPE, PRED, COND) \
+      CONVERT_VECT(NAME, TYPE, 2, PRED, COND);\
+      CONVERT_VECT(NAME, TYPE, 3, PRED, COND);\
+      CONVERT_VECT(NAME, TYPE, 4, PRED, COND);\
+      CONVERT_VECT(NAME, TYPE, 8, PRED, COND);\
+      CONVERT_VECT(MAME, TYPE, 16, PRED, COND);
+
+    CONVERT_VECTS("char", cl_char, IsInt32, ToInt32()->Value);
+    CONVERT_VECTS("uchar", cl_uchar, IsInt32, ToUint32()->Value);
+    CONVERT_VECTS("short", cl_short, IsInt32, ToInt32()->Value);
+    CONVERT_VECTS("ushort", cl_ushort, IsInt32, ToUint32()->Value);
+    CONVERT_VECTS("int", cl_int, IsInt32, ToInt32()->Value);
+    CONVERT_VECTS("uint", cl_uint, IsInt32, ToUint32()->Value);
+    CONVERT_VECTS("long", cl_long, IsNumber, ToInteger()->Value);
+    CONVERT_VECTS("ulong", cl_ulong, IsNumber, ToInteger()->Value);
+    CONVERT_VECTS("float", cl_float, IsNumber, NumberValue);
+    CONVERT_VECTS("double", cl_double, IsNumber, NumberValue);
+    CONVERT_VECTS("half", cl_half, IsNumber, NumberValue);
+
+    #undef CONVERT_VECT
+    #undef CONVERT_VECTS
+
+    // add boolean conversion
+    m_converters["bool"] = [](const Local<Value>& val) {
+        size_t ptr_size = sizeof(cl_bool);
+        void* ptr_data = new cl_bool;
+        *((cl_bool *)ptr_data) = val->BooleanValue() ? 1 : 0;
+        return std::tuple<size_t,void*,cl_int>(ptr_size, ptr_data, 0);
+    };
+  }
+
+  /// Returns wheather the type given is in the map, i.e. if it is a
+  /// primitive type
+  bool hasType(const std::string& name){
+      return m_converters.find(name) != m_converters.end();
+  }
+
+  // Converts the given JS value to the OpenCL type given by the `name`
+  // parameter and returns the result as a pair of the size of the converted
+  // value and the pointer as `void*`. The caller is responsible
+  // for deleting the pointer after use.
+  std::tuple<size_t, void*, cl_int> convert(const std::string& name, const Local<Value>& val) {
+      assert(this->hasType(name));
+      // call conversion function and return size of argument and pointer
+      return std::move(m_converters[name](val));
+  }
+
+};
+
 // extern CL_API_ENTRY cl_int CL_API_CALL
 // clSetKernelArg(cl_kernel    /* kernel */,
 //                cl_uint      /* arg_index */,
 //                size_t       /* arg_size */,
 //                const void * /* arg_value */) CL_API_SUFFIX__VERSION_1_0;
 NAN_METHOD(SetKernelArg) {
+  // static member of the function gets initialzed by the first thread
+  // which calls this function. This is thread-safe due to the C++11 standard.
+  // All other threads arriving wait till the constructor initialization is
+  // complete before executing the code below.
+  static PrimitiveTypeMapCache type_converter;
+
   NanScope();
   REQ_ARGS(3);

@@ -117,18 +258,13 @@

   // now map the JS parameter `args[2]` to the expected kernel parameter type `typename`

-
   // Arg 2
   size_t ptr_size = 0;
   void * ptr_data = NULL;
   bool dont_delete = false;
   char * name = type_name.get();

-  // TODO: more efficient version for type mapping (e.g. consider
-  // std::map/unordered_map and std::function members (lambdas) for
-  // much quicker matching of types to their conversion function
-
-  // first check for pointers (require either either local size or cl_mem)
+  // first check for pointers (require either local size or cl_mem)
   if ('*' == name[(strlen(name) - 1)]){
     // check if type is local or global
     switch (adrqual) {
@@ -153,99 +289,24 @@
           dont_delete = true;
         } break;
     }
+  } else if (type_converter.hasType(name)) {
+    // convert primitive types using the conversion
+    // function map (indexed by OpenCL type name)
+    cl_int err;
+    std::tie(ptr_size, ptr_data, err) = type_converter.convert(name, args[2]);
+    CHECK_ERR(err);
   }

   // TODO: check for image_t types
   // TODO: support queue_t and clk_event_t, and others?

-  // Boolean
-  if (strcmp(name, "bool") == 0) {
-    ptr_size = sizeof(cl_bool);
-    ptr_data = new cl_bool;
-    *((cl_bool *)ptr_data) = args[3]->BooleanValue() ? 1 : 0;
-  }
-
-
-  /* convert primitive types */
-
-  #define CONVERT_NUMBER(NAME, TYPE, PRED, CONV) \
-    if (strcmp(name, NAME) == 0) { \
-      if (!args[2]->PRED()){\
-        THROW_ERR(CL_INVALID_ARG_VALUE) \
-      }\
-      ptr_data = new TYPE;\
-      ptr_size = sizeof(TYPE); \
-      *((TYPE *)ptr_data) = args[2]->CONV();\
-    }
-
-  CONVERT_NUMBER("char", cl_char, IsInt32, ToInt32()->Value);
-  CONVERT_NUMBER("uchar", cl_uchar, IsInt32, ToUint32()->Value);
-  CONVERT_NUMBER("short", cl_short, IsInt32, ToInt32()->Value);
-  CONVERT_NUMBER("ushort", cl_ushort, IsInt32, ToUint32()->Value);
-  CONVERT_NUMBER("int", cl_int , IsInt32, ToInt32()->Value);
-  CONVERT_NUMBER("uint", cl_uint, IsInt32, ToUint32()->Value);
-  CONVERT_NUMBER("long", cl_long, IsNumber, ToInteger()->Value);
-  CONVERT_NUMBER("ulong", cl_ulong, IsNumber, ToInteger()->Value);
-  CONVERT_NUMBER("float", cl_float, IsNumber, NumberValue);
-  CONVERT_NUMBER("double", cl_double, IsNumber, NumberValue);
-  CONVERT_NUMBER("half", cl_half, IsNumber, NumberValue);
-
-  #undef CONVERT_NUMBER
-
-
-  /* convert vector types (e.g. float4, int16, etc) */
-
-  #define CONVERT_VECT(NAME, TYPE, I, PRED, COND)           \
-    if (strcmp(name, "NAME ## I") == 0) {                  \
-      if (!args[2]->IsArray()) {                            \
-        THROW_ERR(CL_INVALID_ARG_VALUE);                    \
-      }                                                     \
-      Local<Array> arr = Local<Array>::Cast(args[2]);       \
-      if (arr->Length() != I) {                             \
-        THROW_ERR(CL_INVALID_ARG_SIZE);                     \
-      }                                                     \
-      TYPE * vvc = new TYPE[I];                             \
-      ptr_size = sizeof(TYPE) * I;                          \
-      ptr_data = vvc;                                       \
-      for (unsigned int i = 0; i < I; ++ i) {               \
-        if (!arr->Get(i)->PRED()) {                         \
-          THROW_ERR(CL_INVALID_ARG_VALUE);                  \
-        }                                                   \
-        vvc[i] = arr->Get(i)->COND();                       \
-      }                                                     \
-    }
-
-  #define CONVERT_VECTS(NAME, TYPE, PRED, COND) \
-    CONVERT_VECT(NAME, TYPE, 2, PRED, COND);\
-    CONVERT_VECT(NAME, TYPE, 3, PRED, COND);\
-    CONVERT_VECT(NAME, TYPE, 4, PRED, COND);\
-    CONVERT_VECT(NAME, TYPE, 8, PRED, COND);\
-    CONVERT_VECT(MAME, TYPE, 16, PRED, COND);
-
-  CONVERT_VECTS("char", cl_char, IsInt32, ToInt32()->Value);
-  CONVERT_VECTS("uchar", cl_uchar, IsInt32, ToUint32()->Value);
-  CONVERT_VECTS("short", cl_short, IsInt32, ToInt32()->Value);
-  CONVERT_VECTS("ushort", cl_ushort, IsInt32, ToUint32()->Value);
-  CONVERT_VECTS("int", cl_int, IsInt32, ToInt32()->Value);
-  CONVERT_VECTS("uint", cl_uint, IsInt32, ToUint32()->Value);
-  CONVERT_VECTS("long", cl_long, IsInt32, ToInteger()->Value);
-  CONVERT_VECTS("ulong", cl_ulong, IsInt32, ToInteger()->Value);
-  CONVERT_VECTS("float", cl_float, IsNumber, NumberValue);
-  CONVERT_VECTS("double", cl_double, IsNumber, NumberValue);
-  CONVERT_VECTS("half", cl_half, IsNumber, NumberValue);
-
-  #undef CONVERT_VECT
-  #undef CONVERT_VECTS
-
-
   // Otherwise it should be a native type
-  if (strcmp(name, "sampler_t") == 0) {
-    NOCL_UNWRAP(sw , NoCLSampler, args[3]);
+  else if (strcmp(name, "sampler_t") == 0) {
+    NOCL_UNWRAP(sw , NoCLSampler, args[2]);
     ptr_data = sw->getRaw();
     ptr_size = sizeof(cl_sampler);
     dont_delete = true;
   }
-  // TODO: image types

   cl_int err = ::clSetKernelArg(k->getRaw(), arg_idx, ptr_size, &ptr_data);


Misplaced parenthesis (#45)

Misplaced parenthesis (#45)

--- src/keygen.cpp
+++ src/keygen.cpp
@@ -133,7 +133,7 @@

         // encrypt private key value
         primary -> set_s2k(s2k3);
-        primary -> set_IV(RNG::RNG().rand_bytes(Sym::BLOCK_LENGTH.at(config.sym >> 3)));
+        primary -> set_IV(RNG::RNG().rand_bytes(Sym::BLOCK_LENGTH.at(config.sym) >> 3));
         secret = use_normal_CFB_encrypt(config.sym, secret, session_key, primary -> get_IV());
     }
     else{


Andreas Krennmair: 	list all keys that are assigned to one function in help screen (fixes issue #82).

--- src/keymap.cpp
+++ src/keymap.cpp
@@ -91,25 +91,21 @@
 	 * Here we return the keymap descriptions for the specified application (handed to us via flags)
 	 * This is used for the help screen.
 	 */
-	for (std::map<std::string,operation>::iterator it=keymap_.begin();it!=keymap_.end();++it) {
-		operation op = it->second;
-		if (op != OP_NIL) {
-			std::string helptext;
-			std::string opname;
-			bool add = false;
-			for (int i=0;opdescs[i].help_text;++i) {
+	for (int i=0;opdescs[i].help_text;++i) {
+		bool already_added = false;
+		for (std::map<std::string,operation>::iterator it=keymap_.begin();it!=keymap_.end();++it) {
+			operation op = it->second;
+			if (op != OP_NIL) {
 				if (opdescs[i].op == op && opdescs[i].flags & flags) {
-					helptext = gettext(opdescs[i].help_text);
-					opname = opdescs[i].opstr;
-					add = true;
+					keymap_desc desc;
+					desc.key = it->first;
+					if (!already_added) {
+						desc.cmd = opdescs[i].opstr;
+						desc.desc = gettext(opdescs[i].help_text);
+						already_added = true;
+					}
+					descs.push_back(desc);
 				}
-			}
-			if (add) {
-				keymap_desc desc;
-				desc.key = it->first;
-				desc.cmd = opname;
-				desc.desc = helptext;
-				descs.push_back(desc);
 			}
 		}
 	}


add function to draw all ancestor of one node

--- src/output/create_dot.cpp
+++ src/output/create_dot.cpp
@@ -126,20 +126,6 @@
     std::string shape = "record";
     std::string colorscheme = "spectral9";
 public:
-    void print(){
-        for( const auto& region : data ){
-            if(params.node_min_ratio == 0 || params.node_min_ratio == 100){
-                print_node(region);
-            }
-            else
-            {
-                if(region->sum_excl_time > params.node_min_ratio)
-                    print_node(region);
-                else if( filter_min_ratio(region) )
-                    print_node_partial(region);
-            }
-        }
-    }

     bool open(std::string filename = "result.dot"){
         result_file.open(filename);
@@ -177,16 +163,33 @@
         timerange = max_time - min_time;
     }

-    // go through all nodes, returns true when filter apply to any descendent
-    bool filter_min_ratio(const Node* node){
-        for(const auto& child : node->children){
-            if(filter_min_ratio(child) == true)
-                return true;
-        }
-        if(node->sum_excl_time > params.node_min_ratio)
-            return true;
-
-        return false;
+    void print(){
+
+        for( const auto& region : data ){
+            if(params.node_min_ratio == 0 || params.node_min_ratio == 100){
+                print_node(*region);
+            }
+            else {
+                if(region->sum_excl_time > params.node_min_ratio){
+                    print_node(*region);
+                    print_predecessor(*region);
+                }
+            }
+        }
+    }
+
+
+    // draw all predessor
+    void print_predecessor( Node& region){
+        Node* curr = &region;
+        while( curr->parent != nullptr){
+            curr = region.parent;
+            // draw if parent node hasn't been drawn yet else break
+            if(printed_nodes.find(curr->call_id) == printed_nodes.end())
+                print_node_partial(*curr);
+            else
+                break;
+        }
     }

     void print_node_partial(Node* region){
@@ -217,6 +220,8 @@
                 << ";"
             << std::endl;
         }
+
+        printed_nodes[region.call_id] = &region;
     }

     void print_node(Node* region){


fix bug in diagonal override, more prints

the old flag was not being cleared,
leaving the quad with both diagonals
flagged.
this has been fixed, and more prints
added to the code path to detail
what decisions are made at unsafe pyramids.

--- ma/maTetrahedronize.cc
+++ ma/maTetrahedronize.cc
@@ -210,6 +210,7 @@
       std::stringstream ss;
       ss << "pyramid at " << apf::getLinearCentroid(mesh, pyramid)
          << " has no good rotation!\n";
+      ss << "a negative tet WILL get produced here.\n";
       std::string s = ss.str();
       fprintf(stderr,"%s",s.c_str());
       return SKIP;
@@ -236,21 +237,33 @@
     int diagonal = dvi % 2;
     int old_diagonal = getDiagonalFromFlag(a, quad);
     setFlag(a, pyramid, CHECKED);
-    if ((old_diagonal != diagonal) && getFlag(a, quad, CHECKED)) {
+    if (old_diagonal != diagonal) {
+      if (getFlag(a, quad, CHECKED)) {
+        std::stringstream ss;
+        ss << "quad at " << apf::getLinearCentroid(mesh, quad)
+           << " has conflicting overrides on its diagonal.\n";
+        ss << "a negative tet WILL get produced here.\n";
+        std::string s = ss.str();
+        fprintf(stderr,"%s",s.c_str());
+      } else {
+        std::stringstream ss;
+        ss << "overriding diagonal at " << apf::getLinearCentroid(mesh, quad) << '\n';
+        std::string s = ss.str();
+        fprintf(stderr,"%s",s.c_str());
+        int flag = getFlagFromDiagonal(diagonal);
+        int old_flag = getFlagFromDiagonal(old_diagonal);
+        clearFlag(a, quad, old_flag);
+        setFlag(a, quad, flag);
+        setFlag(a, quad, CHECKED);
+        assert(getFlag(a, quad, flag));
+        assert(!getFlag(a, quad, old_flag));
+      }
+    } else {
       std::stringstream ss;
-      ss << "quad at " << apf::getLinearCentroid(mesh, quad)
-         << "has conflicting overrides on its diagonal.\n";
-      ss << "a negative tet WILL get produced here.\n";
+      ss << "diagonal at " << apf::getLinearCentroid(mesh, quad)
+         << " was already good for pyramid\n";
       std::string s = ss.str();
       fprintf(stderr,"%s",s.c_str());
-      return;
-    } else {
-      std::stringstream ss;
-      ss << "overriding diagonal at " << apf::getLinearCentroid(mesh, quad) << '\n';
-      std::string s = ss.str();
-      fprintf(stderr,"%s",s.c_str());
-      setFlag(a, quad, getFlagFromDiagonal(diagonal));
-      setFlag(a, quad, CHECKED);
     }
   }
   Adapt* a;


Explicitly tag fxjs native objects.

Explicitly tag fxjs native objects.

Native object callbacks have to distinguish whether the object
they have been given is actually a native object and not some
ordinary JS object.  For method/property calls, this happens
via v8's signature mechanism, but signature checks aren't applied
to method arguments themselves.

Currently, we do this by treating any object with an internal field
count of 2 as being such, but this is fragile, and it has been pointed
out that other objects with two internal fields are present.

Additionally, that the first field points to a structure with a
small zero-based object definition ID doesn't really have enough
entropy to trust that it isn't some other entity.  So add a pointer
to an internal address in the second slot to make this safer.

Note that we'll also get the same release_assert in the majority
of cases as described in the bug. This is great from a security
standpoint, but not great from a functional standpoint, except this
likely only occurs in the wild if they are trying to mess with us.
This just guards the theoretical cases that might pass the
existing release_assert.

BUG=695830

Change-Id: I42db27d6ed1143269a852805e4e4d862a8ab8773
Reviewed-on: https://pdfium-review.googlesource.com/2847
Commit-Queue: Tom Sepez <47f022c5217a84c904816c5375403e20a45c37f6@chromium.org>
Reviewed-by: dsinclair <f70dc21b1b6a10340b65b6dcc0bde33e44f9236b@chromium.org>

--- fxjs/fxjs_v8.cpp
+++ fxjs/fxjs_v8.cpp
@@ -20,11 +20,31 @@
 static size_t g_isolate_ref_count = 0;
 static FXJS_ArrayBufferAllocator* g_arrayBufferAllocator = nullptr;
 static v8::Global<v8::ObjectTemplate>* g_DefaultGlobalObjectTemplate = nullptr;
+static wchar_t kPerObjectDataTag[] = L"CFXJS_PerObjectData";

 class CFXJS_PerObjectData {
  public:
   explicit CFXJS_PerObjectData(int nObjDefID)
       : m_ObjDefID(nObjDefID), m_pPrivate(nullptr) {}
+
+  static void SetInObject(CFXJS_PerObjectData* pData,
+                          v8::Local<v8::Object> pObj) {
+    if (pObj->InternalFieldCount() == 2) {
+      pObj->SetAlignedPointerInInternalField(0, pData);
+      pObj->SetAlignedPointerInInternalField(
+          1, static_cast<void*>(kPerObjectDataTag));
+    }
+  }
+
+  static CFXJS_PerObjectData* GetFromObject(v8::Local<v8::Object> pObj) {
+    if (pObj.IsEmpty() || pObj->InternalFieldCount() != 2 ||
+        pObj->GetAlignedPointerFromInternalField(1) !=
+            static_cast<void*>(kPerObjectDataTag)) {
+      return nullptr;
+    }
+    return static_cast<CFXJS_PerObjectData*>(
+        pObj->GetAlignedPointerFromInternalField(0));
+  }

   const int m_ObjDefID;
   void* m_pPrivate;
@@ -241,13 +261,8 @@

 // static
 int CFXJS_Engine::GetObjDefnID(v8::Local<v8::Object> pObj) {
-  if (pObj.IsEmpty() || !pObj->InternalFieldCount())
-    return -1;
-  CFXJS_PerObjectData* pPerObjectData = static_cast<CFXJS_PerObjectData*>(
-      pObj->GetAlignedPointerFromInternalField(0));
-  if (!pPerObjectData)
-    return -1;
-  return pPerObjectData->m_ObjDefID;
+  CFXJS_PerObjectData* pData = CFXJS_PerObjectData::GetFromObject(pObj);
+  return pData ? pData->m_ObjDefID : -1;
 }

 // static
@@ -257,10 +272,10 @@

 // static
 void CFXJS_Engine::FreeObjectPrivate(v8::Local<v8::Object> pObj) {
-  if (pObj.IsEmpty() || !pObj->InternalFieldCount())
-    return;
-  FreeObjectPrivate(pObj->GetAlignedPointerFromInternalField(0));
+  CFXJS_PerObjectData* pData = CFXJS_PerObjectData::GetFromObject(pObj);
   pObj->SetAlignedPointerInInternalField(0, nullptr);
+  pObj->SetAlignedPointerInInternalField(1, nullptr);
+  delete pData;
 }

 int CFXJS_Engine::DefineObj(const char* sObjName,
@@ -381,17 +396,17 @@
   for (int i = 0; i < maxID; ++i) {
     CFXJS_ObjDefinition* pObjDef = CFXJS_ObjDefinition::ForID(m_isolate, i);
     if (pObjDef->m_ObjType == FXJSOBJTYPE_GLOBAL) {
-      v8Context->Global()
-          ->GetPrototype()
-          ->ToObject(v8Context)
-          .ToLocalChecked()
-          ->SetAlignedPointerInInternalField(0, new CFXJS_PerObjectData(i));
-
-      if (pObjDef->m_pConstructor)
+      CFXJS_PerObjectData::SetInObject(new CFXJS_PerObjectData(i),
+                                       v8Context->Global()
+                                           ->GetPrototype()
+                                           ->ToObject(v8Context)
+                                           .ToLocalChecked());
+      if (pObjDef->m_pConstructor) {
         pObjDef->m_pConstructor(this, v8Context->Global()
                                           ->GetPrototype()
                                           ->ToObject(v8Context)
                                           .ToLocalChecked());
+      }
     } else if (pObjDef->m_ObjType == FXJSOBJTYPE_STATIC) {
       v8::Local<v8::String> pObjName =
           v8::String::NewFromUtf8(m_isolate, pObjDef->m_ObjName,
@@ -500,15 +515,14 @@
   if (!pObjDef->GetInstanceTemplate()->NewInstance(context).ToLocal(&obj))
     return v8::Local<v8::Object>();

-  CFXJS_PerObjectData* pPerObjData = new CFXJS_PerObjectData(nObjDefnID);
-  obj->SetAlignedPointerInInternalField(0, pPerObjData);
+  CFXJS_PerObjectData* pObjData = new CFXJS_PerObjectData(nObjDefnID);
+  CFXJS_PerObjectData::SetInObject(pObjData, obj);
   if (pObjDef->m_pConstructor)
     pObjDef->m_pConstructor(this, obj);

-  if (!bStatic && FXJS_PerIsolateData::Get(m_isolate)->m_pDynamicObjsMap) {
-    FXJS_PerIsolateData::Get(m_isolate)->m_pDynamicObjsMap->set(pPerObjData,
-                                                                obj);
-  }
+  if (!bStatic && FXJS_PerIsolateData::Get(m_isolate)->m_pDynamicObjsMap)
+    FXJS_PerIsolateData::Get(m_isolate)->m_pDynamicObjsMap->set(pObjData, obj);
+
   return obj;
 }

@@ -534,34 +548,25 @@
 }

 void CFXJS_Engine::SetObjectPrivate(v8::Local<v8::Object> pObj, void* p) {
-  if (pObj.IsEmpty() || !pObj->InternalFieldCount())
-    return;
-  CFXJS_PerObjectData* pPerObjectData = static_cast<CFXJS_PerObjectData*>(
-      pObj->GetAlignedPointerFromInternalField(0));
+  CFXJS_PerObjectData* pPerObjectData =
+      CFXJS_PerObjectData::GetFromObject(pObj);
   if (!pPerObjectData)
     return;
   pPerObjectData->m_pPrivate = p;
 }

 void* CFXJS_Engine::GetObjectPrivate(v8::Local<v8::Object> pObj) {
-  if (pObj.IsEmpty())
-    return nullptr;
-  CFXJS_PerObjectData* pPerObjectData = nullptr;
-  if (pObj->InternalFieldCount()) {
-    pPerObjectData = static_cast<CFXJS_PerObjectData*>(
-        pObj->GetAlignedPointerFromInternalField(0));
-  } else {
+  CFXJS_PerObjectData* pData = CFXJS_PerObjectData::GetFromObject(pObj);
+  if (!pData && !pObj.IsEmpty()) {
     // It could be a global proxy object.
     v8::Local<v8::Value> v = pObj->GetPrototype();
     v8::Local<v8::Context> context = m_isolate->GetCurrentContext();
     if (v->IsObject()) {
-      pPerObjectData = static_cast<CFXJS_PerObjectData*>(
-          v->ToObject(context)
-              .ToLocalChecked()
-              ->GetAlignedPointerFromInternalField(0));
+      pData = CFXJS_PerObjectData::GetFromObject(
+          v->ToObject(context).ToLocalChecked());
     }
   }
-  return pPerObjectData ? pPerObjectData->m_pPrivate : nullptr;
+  return pData ? pData->m_pPrivate : nullptr;
 }

 v8::Local<v8::Value> CFXJS_Engine::GetObjectProperty(


git-svn-id: http://svn.seqan.de/seqan/trunk@11555 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/core/demos/tutorial/store/store_diplay_aligned_reads.cpp
+++ seqan/core/demos/tutorial/store/store_diplay_aligned_reads.cpp
@@ -15,13 +15,11 @@
 // FRAGMENT(ascii)
     AlignedReadLayout layout;
     layoutAlignment(layout, store);
-    for (unsigned i = 0; i < length(store.contigStore); ++i)
-        printAlignment(std::cout, Raw(), layout, store, i, 50, 150, 0, 30);
+    printAlignment(std::cout, Raw(), layout, store, 1, 0, 150, 0, 36);

 // FRAGMENT(svg)
     SVGFile svg("layout.svg");
-    for (unsigned i = 0; i < length(store.contigStore); ++i)
-        printAlignment(svg, Raw(), layout, store, i, 50, 150, 0, 30);
+    printAlignment(svg, Raw(), layout, store, 1, 0, 150, 0, 36);

 	return 0;
 }


Update array_from_py.cpp

Update array_from_py.cpp

--- dynd/src/array_from_py.cpp
+++ dynd/src/array_from_py.cpp
@@ -323,7 +323,7 @@
     }
     else {
       if (access_flags != 0) {
-        uint32_t raf = result.get_flags();
+        uint64_t raf = result.get_flags();
         if ((access_flags & nd::immutable_access_flag) && !(raf & nd::immutable_access_flag)) {
           throw runtime_error("cannot view a non-immutable dynd array as immutable");
         }


EBEAST: v8bse/nodemodule: convert Any <-> JS for INT64 and RECORD types

Signed-off-by: Tim Janik <6ec6ff229c4e1c5bbd5933ee92e6c5832ff023bb@gnu.org>

--- ebeast/v8bse/nodemodule.cc
+++ ebeast/v8bse/nodemodule.cc
@@ -196,57 +196,117 @@
   }
 };

+static v8::Local<v8::Value>     any_to_v8   (v8::Isolate*, const Aida::Any&);
+static Aida::Any                any_from_v8 (v8::Isolate*, v8::Local<v8::Value>&);
+
 struct convert_AidaAny {
   using to_type = v8::Local<v8::Value>; // Javascript type
   using from_type = Aida::Any;          // native C++ type
   static bool
-  is_valid (v8::Isolate *const isolate, v8::Local<v8::Value> v)
+  is_valid (v8::Isolate *const iso, v8::Local<v8::Value> v)
   {
     if (v.IsEmpty())
       return false;
-    /* IsNull IsNullOrUndefined IsTrue IsFalse IsName IsSymbol IsFunction IsArray IsObject
+    /* IsUndefined IsNull IsNullOrUndefined IsTrue IsFalse IsName IsSymbol IsFunction IsArray
      * IsExternal IsDate IsArgumentsObject IseanObject IsNumberObject IsStringObject IsSymbolObject
      * IsNativeError IsRegExp IsAsyncFunction IsGeneratorFunction IsGeneratorObject IsPromise IsMap
      * IsSet IsMapIterator IsSetIterator IsWeakMap IsWeakSet IsArrayBuffer IsArrayBufferView
      * IsTypedArray IsUint8Array IsUint8ClampedArray IsInt8Array IsUint16Array IsInt16Array
      * IsUint32Array IsInt32Array IsFloat32Array IsFloat64Array IsDataView IsSharedArrayBuffer
-     * IsProxy IsWebAssemblyCompiledModule IsUndefined
+     * IsProxy IsWebAssemblyCompiledModule
      */
     if (v->IsBoolean())         return true; // Aida::BOOL
     if (v->IsInt32())           return true; // Aida::INT32
     if (v->IsUint32())          return true; // Aida::INT64
     if (v->IsNumber())          return true; // Aida::FLOAT64
     if (v->IsString())          return true; // Aida::STRING
+    if (v->IsObject())          return true; // Aida::RECORD
     return false;
   }
   static from_type
-  from_v8 (v8::Isolate *const isolate, v8::Local<v8::Value> v)
+  from_v8 (v8::Isolate *const iso, v8::Local<v8::Value> v)
   {
     Aida::Any a;
     if      (v->IsBoolean())    a.set<bool> (v->BooleanValue());
     else if (v->IsInt32())      a.set<int32_t> (v->Int32Value());
     else if (v->IsUint32())     a.set<int64_t> (v->Uint32Value());
     else if (v->IsNumber())     a.set<double> (v->NumberValue());
-    else if (v->IsString())     a.set<std::string> (v8pp::from_v8<std::string> (isolate, v));
+    else if (v->IsString())     a.set<std::string> (v8pp::from_v8<std::string> (iso, v));
+    else if (v->IsObject())     any_from_v8object (iso, a, v.As<v8::Object>());
     return a;
   }
   static to_type
-  to_v8 (v8::Isolate *const isolate, const from_type &a)
+  to_v8 (v8::Isolate *const iso, const from_type &a)
   {
     switch (int (a.kind()))
       {
-      case Aida::BOOL:          return v8::Boolean::New (isolate, a.get<bool>());
-      case Aida::INT32:         return v8::Integer::New (isolate, a.get<int32_t>());
-      case Aida::FLOAT64:       return v8::Number::New (isolate, a.get<double>());
-      case Aida::STRING:        return v8pp::to_v8 (isolate, a.get<std::string>());
+        int64_t big;
+      case Aida::BOOL:          return v8::Boolean::New (iso, a.get<bool>());
+      case Aida::INT32:         return v8::Integer::New (iso, a.get<int32_t>());
+      case Aida::FLOAT64:       return v8::Number::New (iso, a.get<double>());
+      case Aida::STRING:        return v8pp::to_v8 (iso, a.get<std::string>());
+      case Aida::RECORD:        return any_to_v8object (iso, a);
+      case Aida::INT64:
+        big = a.get<int64_t>();
+        if (big >= -2147483648 && big <= +2147483647)
+          return v8::Integer::New (iso, big);
+        if (big >= 0 && big <= +4294967295)
+          return v8::Integer::NewFromUnsigned (iso, big);
+        if (big >= -9007199254740992 && big <= +9007199254740992)
+          return v8::Number::New (iso, big);
+        Bse::warning ("converting Aida::Any exceeds v8::Number precision: %d", big);
+        return v8::Number::New (iso, big);
       }
-    return v8::Undefined (isolate);
+    return v8::Undefined (iso);
+  }
+  static void
+  any_from_v8object (v8::Isolate *const iso, Aida::Any &a, v8::Local<v8::Object> object)
+  {
+    v8::Local<v8::Array> prop_names = object->GetPropertyNames();
+    Aida::AnyRec r;
+    const size_t l = prop_names->Length();
+    for (size_t i = 0; i < l; i++)
+      {
+        v8::Local<v8::Value> v8key = prop_names->Get (i);
+        v8::Local<v8::Value> v8val = object->Get (v8key);
+        const std::string key = v8pp::from_v8<std::string> (iso, v8key);
+        if (key.empty())
+          continue;
+        r[key] = any_from_v8 (iso, v8val);
+      }
+    a.set (r);
+  }
+  static to_type
+  any_to_v8object (v8::Isolate *const iso, const from_type &a)
+  {
+    v8::EscapableHandleScope v8scope (iso);
+    v8::Local<v8::Object> o = v8::Object::New (iso);
+    const Aida::AnyRec *r = a.get<const Aida::AnyRec*>();
+    if (r)
+      for (auto const &field : *r)
+        {
+          v8::Local<v8::Value> v = any_to_v8 (iso, field);
+          o->Set (v8pp::to_v8 (iso, field.name), v);
+        }
+    return v8scope.Escape (o);
   }
 };

 namespace v8pp {
 template<> struct convert<Aida::Any> : convert_AidaAny {};
 } // v8pp
+
+static v8::Local<v8::Value>
+any_to_v8 (v8::Isolate *iso, const Aida::Any &a)
+{
+  return v8pp::to_v8<Aida::Any> (iso, a);
+}
+
+static Aida::Any
+any_from_v8 (v8::Isolate *iso, v8::Local<v8::Value> &v)
+{
+  return v8pp::from_v8<Aida::Any> (iso, v);
+}

 typedef v8pp::class_<Aida::Event>                V8ppType_AidaEvent;
 typedef v8pp::class_<Aida::RemoteHandle>         V8ppType_AidaRemoteHandle;


VisualScript: Fix crash with get_node().

--- editor/property_editor.cpp
+++ editor/property_editor.cpp
@@ -861,7 +861,7 @@
 			names.push_back(TTR("Assign"));
 			names.push_back(TTR("Clear"));

-			if (owner->is_class("Node") && (v.get_type() == Variant::NODE_PATH) && Object::cast_to<Node>(owner)->has_node(v))
+			if (owner && owner->is_class("Node") && (v.get_type() == Variant::NODE_PATH) && Object::cast_to<Node>(owner)->has_node(v))
 				names.push_back(TTR("Select Node"));

 			config_action_buttons(names);


Fixed cut/copy/paste visibility

Fixed cut/copy/paste visibility

Fixes #48514 by moving the visibility of these buttons into their own if statement that depends on if scene tree editing is allowed. Previously it was under the script editing setting which is unexpected as it works with nodes and the scene tree.

(cherry picked from commit 10d5d4d3cd95a30d7196d07cac7dedeeda37a2db)

--- editor/scene_tree_dock.cpp
+++ editor/scene_tree_dock.cpp
@@ -2586,14 +2586,16 @@
 		}
 	}

-	if (profile_allow_script_editing) {
+	if (profile_allow_editing) {
 		menu->add_shortcut(ED_GET_SHORTCUT("scene_tree/cut_node"), TOOL_CUT);
 		menu->add_shortcut(ED_GET_SHORTCUT("scene_tree/copy_node"), TOOL_COPY);
 		if (selection.size() == 1 && !node_clipboard.empty()) {
 			menu->add_shortcut(ED_GET_SHORTCUT("scene_tree/paste_node"), TOOL_PASTE);
 		}
 		menu->add_separator();
-
+	}
+
+	if (profile_allow_script_editing) {
 		bool add_separator = false;

 		if (full_selection.size() == 1) {


Consistently use Chromium style for identifiers.


add colorflag param

add colorflag param

--- apps/common/commandline/SceneParser/streamlines/StreamLineSceneParser.cpp
+++ apps/common/commandline/SceneParser/streamlines/StreamLineSceneParser.cpp
@@ -562,19 +562,20 @@
           loadedScene = true;
         }
       }else if(arg == "--colorflag"){
-        std::cout << av[++i] << std::endl;
-        streamLines -> colorflag = atof(av[++i]);
+        //std::cout << av[++i] << std::endl;
+	float temp = atof(av[++i]);
+        streamLines -> colorflag = temp;
         std::cout << "colorflag: " << streamLines -> colorflag << std::endl;
       }
-       else if (arg == "--streamline-radius") {
-            streamLines->radius = atof(av[++i]);}
+      else if (arg == "--streamline-radius") {
+	     streamLines->radius = atof(av[++i]);}
 // #if 0
 //       } else if (arg == "--streamline-export") {
 //         exportOSX(av[++i], streamLines, triangles);
 // #endif
       // }

-    }
+          }

     if (loadedScene) {
       sceneModel = make_unique<cpp::Model>();


INTEGRATION: CWS titles02 (1.44.8); FILE MERGED 2008/02/29 11:01:08 as 1.44.8.3: RESYNC: (1.45-1.46); FILE MERGED 2008/02/12 13:24:44 as 1.44.8.2: RESYNC: (1.44-1.45); FILE MERGED 2007/12/10 11:38:43 oj 1.44.8.1: #i45909# #i45617# #i71469# change title handling

--- dbaccess/source/shared/stringconstants.cxx
+++ dbaccess/source/shared/stringconstants.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: stringconstants.cxx,v $
  *
- *  $Revision: 1.47 $
- *
- *  last change: $Author: kz $ $Date: 2008-03-06 18:08:29 $
+ *  $Revision: 1.48 $
+ *
+ *  last change: $Author: kz $ $Date: 2008-04-04 13:59:02 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -39,7 +39,6 @@
 //============================================================
 //= property names
 //============================================================
-IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TITLE, "Title");
 IMPLEMENT_CONSTASCII_USTRING(PROPERTY_URL, "URL");
 IMPLEMENT_CONSTASCII_USTRING(PROPERTY_INFO, "Info");
 IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SETTINGS, "Settings");


Fix coverity report ##34545 (Dereference after null check)

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@41257 27541ba8-7e3a-0410-8455-c3a389f83636

--- gui/gui/src/TGLabel.cxx
+++ gui/gui/src/TGLabel.cxx
@@ -327,6 +327,10 @@

    TGFont *oldfont = fFont;
    fFont = fClient->GetFont(font);  // increase usage count
+   if (!fFont) {
+      fFont = oldfont;
+      return;
+   }

    TGGCPool *pool = fClient->GetResourcePool()->GetGCPool();
    TGGC *gc = pool->FindGC(fNormGC);
@@ -341,7 +345,7 @@
       fClient->FreeFont(oldfont);
    }
    if (gc) {
-      if (fFont) gc->SetFont(fFont->GetFontHandle());
+      gc->SetFont(fFont->GetFontHandle());
       fNormGC = gc->GetGC();
    }
    fTextChanged = kTRUE;


from Bertrand:
- do not remove temporary pdf file when printing on windows

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@15677 27541ba8-7e3a-0410-8455-c3a389f83636


__CUDA_ARCH__ to __NVCC__

__CUDA_ARCH__ to __NVCC__

--- general/cuda.hpp
+++ general/cuda.hpp
@@ -55,13 +55,13 @@
 typedef void* CUstream;
 #endif // MFEM_USE_CUDA

-#ifdef __CUDA_ARCH__
+#ifdef __NVCC__
 template<typename T> MFEM_DEVICE
 inline T AtomicAdd(T* address, T val)
 {
    return atomicAdd(address, val);
 }
-#else
+#else // __NVCC__
 template<typename T> inline T AtomicAdd(T* address, T val)
 {
 #if defined(_OPENMP)
@@ -70,7 +70,7 @@
    *address += val;
    return *address;
 }
-#endif
+#endif // __NVCC__

 /// Allocates device memory
 void* CuMemAlloc(void **d_ptr, size_t bytes);


revert win32 change

revert win32 change

--- general/zstr.hpp
+++ general/zstr.hpp
@@ -77,8 +77,7 @@
 {
    std::string buff(80, '\0');
 #ifdef _WIN32
-   int err = strerror_s(&buff[0], buff.size(), errno);
-   if (err != 0) { sprintf_s(&buff[0], "unknown error: %d", err); }
+   buff = "unknown error";
 #else
    char* p = check_strerror_r(strerror_r(errno, &buff[0], buff.size()), &buff[0],
                               buff.size());


Warning fixes

Warning fixes

--- src/prodbg/ui/ui_dock.cpp
+++ src/prodbg/ui/ui_dock.cpp
@@ -186,10 +186,10 @@
 {
 	UIDockSizerDir dir = sizer->dir;

-	float x = sizer->rect.x;
-	float y = sizer->rect.y;
-	float w = x + sizer->rect.width;
-	float h = y + sizer->rect.height;
+	float x = (float)sizer->rect.x;
+	float y = (float)sizer->rect.y;
+	float w = x + (float)sizer->rect.width;
+	float h = y + (float)sizer->rect.height;

 	// resize the sizes with the snap area


Compile fix. I hope I went the right way.

CCMAIL:delta-affinix.com@lists.affinix.com

svn path=/trunk/kdesupport/qca/; revision=379008

--- src/qca_securemessage.cpp
+++ src/qca_securemessage.cpp
@@ -210,9 +210,9 @@
 {
 }

-void SecureMessage::startSign(bool detachedSignature)
-{
-	Q_UNUSED(detachedSignature);
+void SecureMessage::startSign(SignMode m = Message);
+{
+	Q_UNUSED(m);
 }

 void SecureMessage::startVerify(const QSecureArray &sig)


incrementer

incrementer

--- cc/range.hh
+++ cc/range.hh
@@ -38,60 +38,60 @@

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

-template <typename T> class Range
-{
- private:
-    class increment
-    {
-     public:
-        inline increment() {}
-        inline increment(T aStep, T aLast) : step(aStep), last(aLast) { if (step == T{0}) THROW_OR_VOID(std::runtime_error("Invalid range with step 0")); }
-        inline void operator()(T& current)
-            {
-                if (current != _acmacs_base_internal::input_iterator<T, increment>::End) {
-                    current += step;
-                    if (step > 0) {
-                        if (current >= last)
-                            current = _acmacs_base_internal::input_iterator<T, increment>::End;
-                    }
-                    else {
-                        if (current <= last)
-                            current = _acmacs_base_internal::input_iterator<T, increment>::End;
-                    }
-                }
-            }
-
-        inline void find_valid(T&) {}
-
-     private:
-        T step;
-        T last;
-    };
-
-    class iterator : public _acmacs_base_internal::input_iterator<T, increment>
-    {
-     public:
-        inline iterator() : _acmacs_base_internal::input_iterator<T, increment>() {}
-        inline iterator(T aFirst, T aLast, T aStep) : _acmacs_base_internal::input_iterator<T, increment>(aFirst, {aStep, aLast}) {}
-    };
-
- public:
-    static inline iterator begin(T first, T last, T step = T{1})
-        {
-            return {first, last, step};
-        }
-
-    static inline iterator begin(T last)
-        {
-            return {T{0}, last, T{1}};
-        }
-
-    static inline iterator end()
-        {
-            return {};
-        }
-
-}; // class Range
+// template <typename T> class Range
+// {
+//  private:
+//     class increment
+//     {
+//      public:
+//         inline increment() {}
+//         inline increment(T aStep, T aLast) : step(aStep), last(aLast) { if (step == T{0}) THROW_OR_VOID(std::runtime_error("Invalid range with step 0")); }
+//         inline void operator()(T& current)
+//             {
+//                 if (current != _acmacs_base_internal::input_iterator<T, increment>::End) {
+//                     current += step;
+//                     if (step > 0) {
+//                         if (current >= last)
+//                             current = _acmacs_base_internal::input_iterator<T, increment>::End;
+//                     }
+//                     else {
+//                         if (current <= last)
+//                             current = _acmacs_base_internal::input_iterator<T, increment>::End;
+//                     }
+//                 }
+//             }
+
+//         inline void find_valid(T&) {}
+
+//      private:
+//         T step;
+//         T last;
+//     };
+
+//     class iterator : public _acmacs_base_internal::input_iterator<T, increment>
+//     {
+//      public:
+//         inline iterator() : _acmacs_base_internal::input_iterator<T, increment>() {}
+//         inline iterator(T aFirst, T aLast, T aStep) : _acmacs_base_internal::input_iterator<T, increment>(aFirst, {aStep, aLast}) {}
+//     };
+
+//  public:
+//     static inline iterator begin(T first, T last, T step = T{1})
+//         {
+//             return {first, last, step};
+//         }
+
+//     static inline iterator begin(T last)
+//         {
+//             return {T{0}, last, T{1}};
+//         }
+
+//     static inline iterator end()
+//         {
+//             return {};
+//         }
+
+// }; // class Range

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

@@ -153,6 +153,59 @@
 #endif

 // ----------------------------------------------------------------------
+
+template <typename Index> class incrementer
+{
+ public:
+    class iterator
+    {
+     public:
+        using difference_type = long;
+        using value_type = Index;
+        using pointer = Index*;
+        using reference = Index&;
+        using iterator_category = std::random_access_iterator_tag;
+
+        inline iterator& operator++() { ++value; return *this;}
+        inline iterator operator++(int) { iterator retval = *this; ++(*this); return retval;}
+        inline bool operator==(iterator other) const { return value == other.value; }
+        inline bool operator!=(iterator other) const { return !(*this == other); }
+        inline value_type operator*() { return value; }
+        inline difference_type operator-(iterator other) const { return static_cast<difference_type>(value) - static_cast<difference_type>(other.value); }
+
+     private:
+        value_type value;
+        inline iterator(value_type aValue) : value(aValue) {}
+
+        friend class incrementer<Index>;
+    };
+
+    inline incrementer(Index aBegin, Index aEnd) : mBegin{aBegin}, mEnd{aEnd} {}
+
+    static inline iterator begin(Index aValue = 0) { return iterator(aValue); }
+    static inline iterator end(Index aValue) { return iterator(aValue); }
+
+    inline iterator begin() { return begin(mBegin); }
+    inline iterator end() { return end(mBegin); }
+
+ private:
+    Index mBegin, mEnd;
+
+}; // class incrementer<>
+
+template <typename Index> inline void fill_with_indexes(std::vector<Index>& aToFill, Index aBegin, Index aEnd)
+{
+    aToFill.resize(aEnd - aBegin);
+    std::copy(incrementer<Index>::begin(aBegin), incrementer<Index>::end(aEnd), aToFill.begin());
+}
+
+template <typename Index> inline void fill_with_indexes(std::vector<Index>& aToFill, Index aSize)
+{
+    aToFill.resize(aSize);
+    std::copy(incrementer<Index>::begin(0), incrementer<Index>::end(aSize), aToFill.begin());
+}
+
+// ----------------------------------------------------------------------
 /// Local Variables:
 /// eval: (if (fboundp 'eu-rename-buffer) (eu-rename-buffer))
 /// End:


rjson::object::exists(name)

rjson::object::exists(name)

--- cc/rjson.hh
+++ cc/rjson.hh
@@ -209,6 +209,7 @@
             }

         template <typename R> std::pair<bool, const R&> get_R_if(std::string aFieldName) const;
+        bool exists(std::string aFieldName) const;
         std::pair<bool, const value&> get_value_if(std::string aFieldName) const;
         std::pair<bool, const object&> get_object_if(std::string aFieldName) const;
         std::pair<bool, const array&> get_array_if(std::string aFieldName) const;
@@ -370,6 +371,17 @@
         const object& get_or_empty_object(std::string aFieldName) const;
         const array& get_or_empty_array(std::string aFieldName) const;

+        bool exists(std::string aFieldName) const
+            {
+                try {
+                    operator[](aFieldName);
+                    return true;
+                }
+                catch (field_not_found&) {
+                    return false;
+                }
+            }
+
         template <typename R> inline std::pair<bool, const R&> get_R_if(std::string aFieldName) const
             {
                 try {
@@ -614,6 +626,17 @@
         }
     }

+    inline bool object::exists(std::string aFieldName) const
+    {
+        try {
+            operator[](aFieldName);
+            return true;
+        }
+        catch (field_not_found&) {
+            return false;
+        }
+    }
+
     template <typename R> inline std::pair<bool, const R&> object::get_R_if(std::string aFieldName) const
     {
         try {


Fiddling with multilistreference

Fiddling with multilistreference

--- parsecdxml.cxx
+++ parsecdxml.cxx
@@ -110,7 +110,7 @@
 template <class whatabout> class multilistreference : basicmultilistreference
 {
 	public:
-	multilist<whatabout> * instances;
+	basicmultilist * instances;
 	intl start_in_it;
 	intl count_in_it;
 	intl mynumber;
@@ -147,7 +147,12 @@
 	basic_xml_element_set * content;
 };

-class basic_instance
+struct superconstellation
+{
+	char name[10];
+	char * ref;
+};
+struct basic_instance
 {
 	public:
 	basic_instance * master;
@@ -224,28 +229,24 @@
 	~xml_element_set(){};
 };

-struct superconstellation
-{
-	char name[10];
-	char * ref;
-};
 //This is a hack:
 //1. Objects dependent on variables initalized out of code area
 //2. Object stringlist which all depend on during initialization initialized out of code area
 //3. Offsetof with inherited objects.
 //4. Initialization of a static list members in order to obtain self-reflecting code.
+//#include "filestructure.hxx"
+
+struct cdxml_instance:basic_instance
+{
+	static superconstellation contents[];
+	basicmultilistreference page;
+};
+superconstellation cdxml_instance::contents[]={{"page",(char*)offsetof(cdxml_instance,page)}};
+
 struct page_instance:basic_instance
 {
 };
 xml_element_set<page_instance> page_xml_element_set("fragment","group",NULL);
-
-struct cdxml_instance:basic_instance
-{
-	multilistreference<page_instance> page;
-	static superconstellation contents[];
-};
-superconstellation cdxml_instance::contents[]={{"name",(char*)offsetof(cdxml_instance,page)}};
-

 xml_element_set<cdxml_instance> cdxml_xml_element_set("page",NULL);


Properly escape " in strings when exporting CSV

--- src/qt/csvmodelwriter.cpp
+++ src/qt/csvmodelwriter.cpp
@@ -27,8 +27,9 @@

 static void writeValue(QTextStream &f, const QString &value)
 {
-    // TODO: quoting if " or \n in string
-    f << "\"" << value << "\"";
+    QString escaped = value;
+    escaped.replace('"', "\"\"");
+    f << "\"" << escaped << "\"";
 }

 static void writeSep(QTextStream &f)


Fixed std::isfinite compilation error on OS X.

--- src/rdb_protocol/datum.cc
+++ src/rdb_protocol/datum.cc
@@ -33,7 +33,9 @@
 datum_t::datum_t(construct_boolean_t, bool _bool) : type(R_BOOL), r_bool(_bool) { }

 datum_t::datum_t(double _num) : type(R_NUM), r_num(_num) {
-    rcheck(std::isfinite(r_num), base_exc_t::GENERIC,
+    // isfinite is a macro on OS X in math.h, so we can't just say std::isfinite.
+    using namespace std;
+    rcheck(isfinite(r_num), base_exc_t::GENERIC,
            strprintf("Non-finite number: %" PR_RECONSTRUCTABLE_DOUBLE, r_num));
 }


perforation parameter is now log(factor)

--- pass/enerc.cpp
+++ pass/enerc.cpp
@@ -337,10 +337,10 @@
       if (cElidable == cTotal) {
         errs() << "can perforate.\n";
         if (optRelax) {
-          int factor = relaxConfig[std::pair<int, int>(rkPerforate, loopId)];
-          if (factor) {
-            errs() << "perforating with factor " << factor << "\n";
-            perforateLoop(loop);
+          int param = relaxConfig[std::pair<int, int>(rkPerforate, loopId)];
+          if (param) {
+            errs() << "perforating with factor 2^" << param << "\n";
+            perforateLoop(loop, param);
             ++perforatedLoops;
           }
         } else {
@@ -352,7 +352,7 @@
     return perforatedLoops > 0;
   }

-  void perforateLoop(Loop *loop, int mask=1) {
+  void perforateLoop(Loop *loop, int logfactor=1) {
     // Check whether this loop is perforatable.
     // First, check for required blocks.
     if (!loop->getHeader() || !loop->getLoopLatch()
@@ -424,10 +424,11 @@
         counterAlloca,
         "accept_tmp"
     );
-    result = builder.CreateAnd(
+    // Check whether the low n bits of the counter are zero.
+    result = builder.CreateTrunc(
         result,
-        builder.getInt32(mask),
-        "accept_and"
+        Type::getIntNTy(module->getContext(), logfactor),
+        "accept_trunc"
     );
     result = builder.CreateIsNull(
         result,


Allow constructing a StringData from a temporary std::string

This is important for the primary use case of being a universal receiver argument type:

```cpp
std::string make_string();
void take_string(StringData input);
take_string(make_string()); // <--- should compile!
```

See https://quuxplusone.github.io/blog/2019/03/11/value-category-is-not-lifetime/ for more details about why this should be considered an anti-pattern.

--- src/realm/string_data.hpp
+++ src/realm/string_data.hpp
@@ -97,10 +97,6 @@
     template <class T, class A>
     operator std::basic_string<char, T, A>() const;

-    // StringData does not store data, callers must manage their own strings.
-    template <class T, class A>
-    StringData(const std::basic_string<char, T, A>&&) = delete;
-
     template <class T, class A>
     StringData(const util::Optional<std::basic_string<char, T, A>>&);


Include alignment as a parameter for loads and stores injections

--- pass/error.cpp
+++ pass/error.cpp
@@ -197,6 +197,8 @@
   Type* int64ty = Type::getInt64Ty(module->getContext());
   Value* param_addr = builder.CreatePtrToInt(load_inst->getPointerOperand(),
       int64ty);
+  Value* param_align = builder.CreateZExtOrBitCast(
+      ConstantInt::get(int64ty, load_inst->getAlignment(), false), int64ty);

   Type* dst_type = NULL;
   if (orig_type_str == "Half")
@@ -218,14 +220,13 @@
       Type::getInt8PtrTy(module->getContext()));

   Value* param_knob = ConstantInt::get(int64ty, param, false);
-  Value* param_op2_dummy = ConstantInt::get(int64ty, 0, false);

   SmallVector<Value *, 6> Args;
   Args.push_back(param_opcode);
   Args.push_back(param_knob);
   Args.push_back(param_ret);
   Args.push_back(param_addr);
-  Args.push_back(param_op2_dummy);
+  Args.push_back(param_align);
   Args.push_back(param_orig_type);
   CallInst* call = builder.CreateCall(injectFn, Args);

@@ -275,6 +276,8 @@
   Value* param_val = builder.CreateZExtOrBitCast(opValue_to_be_casted, int64ty);
   Value* param_addr = builder.CreatePtrToInt(store_inst->getPointerOperand(),
       int64ty);
+  Value* param_align = builder.CreateZExtOrBitCast(
+      ConstantInt::get(int64ty, store_inst->getAlignment(), false), int64ty);

   Value* opcode_global_str = builder.CreateGlobalString(inst->getOpcodeName());
   Value* param_opcode = builder.CreateBitCast(opcode_global_str,
@@ -284,12 +287,11 @@
       Type::getInt8PtrTy(module->getContext()));

   Value* param_knob = ConstantInt::get(int64ty, param, false);
-  Value* param_ret_dummy = ConstantInt::get(int64ty, 0, false);

   SmallVector<Value *, 6> Args;
   Args.push_back(param_opcode);
   Args.push_back(param_knob);
-  Args.push_back(param_ret_dummy);
+  Args.push_back(param_align);
   Args.push_back(param_addr);
   Args.push_back(param_val);
   Args.push_back(param_orig_type);


Added timing of tests and test suites.

Added timing of tests and test suites.

--- src/litest.hpp
+++ src/litest.hpp
@@ -43,6 +43,7 @@
 #include <type_traits>
 #include <iomanip>
 #include <numeric>
+#include <chrono>

 /**@{*/
 /** @name Internal-use macros */
@@ -281,6 +282,12 @@
 	 */
 	using TestFunc = std::function<void(TestSuite &)>;

+	/** Type used for time points. */
+	using TimeType = std::chrono::time_point<std::chrono::system_clock>;
+
+	/** Type used for calculating test running times. */
+	using TimeTypeHiRes = std::chrono::time_point<std::chrono::high_resolution_clock>;
+
 	/**
 	 A test.
 	 */
@@ -310,6 +317,12 @@

 		/** Whether this test was aborted. */
 		bool aborted = false;
+
+		/**
+		 Time taken to run this test, in seconds.
+		 Invalid if aborted is true.
+		 */
+		double duration;
 	};

 	// --------------------------
@@ -605,6 +618,7 @@
 			this->output = new TestResultFormatterType(out);
 			this->totalStats_ = TestStats();

+			auto startTime = TimeType::clock::now();
 			this->output->formatTestSuiteStart(*this);

 			// Run each test in turn
@@ -619,7 +633,10 @@
 				try
 				{
 					// Run the test
+					auto testStartTime = TimeTypeHiRes::clock::now();
 					test.func(*this);
+					auto endTime = TimeTypeHiRes::clock::now();
+					test.duration = std::chrono::duration_cast<std::chrono::microseconds>(endTime - testStartTime).count() / 1e6;
 				}
 				catch (TestAbortException &e)
 				{
@@ -640,6 +657,8 @@
 				this->output->formatTestFooter(test, this->currentTestStats());
 			}

+			this->endTime = TimeType::clock::now();
+			this->duration = std::chrono::duration_cast<std::chrono::microseconds>(this->endTime - startTime).count() / 1e6;
 			this->output->formatTestSuiteEnd(*this);
 			delete output;
 		}
@@ -721,6 +740,12 @@

 		/** Ordered list of the tests to run. */
 		std::vector<Test> tests;
+
+		/** Time point when this test suite completed. */
+		TimeType endTime;
+
+		/** Time taken to run this test suite, in seconds. */
+		double duration;

 	private:


[CommCoreModule] Handle unsupported `op_type` in `processMessageStoreOperations`

Summary: Reject promise (and don't process any ops) if unsupported operation is passed in to `processMessageStoreOperations`

Test Plan:
1. Passed in nonsense op_type
2. Observed expected behavior: https://blob.sh/atul/a0be.png

Reviewers: ashoat, palys-swm

Reviewed By: ashoat, palys-swm

Subscribers: palys-swm, Adrian, karol-bisztyga

Differential Revision: https://phabricator.ashoat.com/D1986

--- native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
+++ native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
@@ -281,6 +281,16 @@
       auto to = rekey_payload.getProperty(rt, "to").asString(rt).utf8(rt);
       messageStoreOps.push_back(std::make_shared<RekeyMessageOperation>(
           std::move(from), std::move(to)));
+    } else {
+      return createPromiseAsJSIValue(
+          rt,
+          [this,
+           op_type](jsi::Runtime &innerRt, std::shared_ptr<Promise> promise) {
+            this->jsInvoker_->invokeAsync([promise, &innerRt, op_type]() {
+              promise->reject(
+                  std::string{"unsupported operation: "}.append(op_type));
+            });
+          });
     }
   }


Compile error

Compile error

--- Source/Kernel/iSCSIVirtualHBA.cpp
+++ Source/Kernel/iSCSIVirtualHBA.cpp
@@ -467,7 +467,7 @@
     iSCSIHBAUserClient * client = (iSCSIHBAUserClient*)getClient();

     if(client)
-        client->sendTimeoutMessageNotification(sessionId,connectionId)
+        client->sendTimeoutMessageNotification(sessionId,connectionId);
     else
     {
         if(connectionCount > 1)


Fix Mac compile of api_integrationtest.cc

Change-Id: Iac448650784238b5e3374dc5facb2b3946ed1ba0

--- src/tracing/test/api_integrationtest.cc
+++ src/tracing/test/api_integrationtest.cc
@@ -131,7 +131,9 @@
     return false;
   if (!thread.pid) {
     // Thread in current process.
-    *track_uuid_out = perfetto::ThreadTrack::ForThread(thread.tid).uuid;
+    *track_uuid_out = perfetto::ThreadTrack::ForThread(
+                          static_cast<base::PlatformThreadId>(thread.tid))
+                          .uuid;
   } else {
     // Thread in another process.
     *pid_override_out = thread.pid;


Thread-safety fix for BlockChain.

Thread-safety fix for BlockChain.

--- libethereum/BlockChain.cpp
+++ libethereum/BlockChain.cpp
@@ -428,6 +428,7 @@

 void BlockChain::checkConsistency()
 {
+	WriteGuard l(x_details);
 	m_details.clear();
 	ldb::Iterator* it = m_db->NewIterator(m_readOptions);
 	for (it->SeekToFirst(); it->Valid(); it->Next())


DebugHud.cpp: fix warning

DebugHud.cpp: fix warning

--- Source/Urho3D/Engine/DebugHud.cpp
+++ Source/Urho3D/Engine/DebugHud.cpp
@@ -147,7 +147,7 @@
         String mode;
         mode.AppendWithFormat("Tex:%s Mat:%s Spec:%s Shadows:%s Size:%i Quality:%s Occlusion:%s Instancing:%s API:%s",
             qualityTexts[renderer->GetTextureQuality()],
-            qualityTexts[Min((unsigned)renderer->GetMaterialQuality(), 3)],
+            qualityTexts[Min((i32)renderer->GetMaterialQuality(), 3)],
             renderer->GetSpecularLighting() ? "On" : "Off",
             renderer->GetDrawShadows() ? "On" : "Off",
             renderer->GetShadowMapSize(),


Rename programSize to bytecodeSize.

Rename programSize to bytecodeSize.

--- libevmasm/AssemblyItem.cpp
+++ libevmasm/AssemblyItem.cpp
@@ -171,7 +171,7 @@
 		text = string("dataSize(sub_") + to_string(size_t(data())) + ")";
 		break;
 	case PushProgramSize:
-		text = string("programSize");
+		text = string("bytecodeSize");
 		break;
 	case PushLibraryAddress:
 		text = string("linkerSymbol(\"") + toHex(data()) + string("\")");


Check for null renderer when outputting linked destinations.

R=schenney@chromium.org
BUG=239517

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

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@150243 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/core/page/PrintContext.cpp
+++ Source/core/page/PrintContext.cpp
@@ -295,11 +295,14 @@

     HashMap<String, Element*>::const_iterator end = m_linkedDestinations.end();
     for (HashMap<String, Element*>::const_iterator it = m_linkedDestinations.begin(); it != end; ++it) {
-        IntRect boundingBox = it->value->renderer()->absoluteBoundingBoxRect();
-        if (pageRect.intersects(boundingBox)) {
-            IntPoint point = boundingBox.minXMinYCorner();
-            point.clampNegativeToZero();
-            graphicsContext.addURLTargetAtPoint(it->key, point);
+        RenderObject* renderer = it->value->renderer();
+        if (renderer) {
+            IntRect boundingBox = renderer->absoluteBoundingBoxRect();
+            if (pageRect.intersects(boundingBox)) {
+                IntPoint point = boundingBox.minXMinYCorner();
+                point.clampNegativeToZero();
+                graphicsContext.addURLTargetAtPoint(it->key, point);
+            }
         }
     }
 }


fix for #7142, garbage at end of Exception code: line in Windows core files ===VersionHistory:Pending===

--- src/condor_daemon_core.V6/exception_handling.WINDOWS.cpp
+++ src/condor_daemon_core.V6/exception_handling.WINDOWS.cpp
@@ -236,15 +236,17 @@

 	// If not one of the "known" exceptions, try to get the string
 	// from NTDLL.DLL's message table.
-	FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE,
+	DWORD cch = FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE,
 		GetModuleHandle(_T("NTDLL.DLL")),
 		dwCode, 0, szBuf, (DWORD)cchBuf, 0);
+	if ( ! cch) szBuf[0] = 0;
 	return szBuf;
 }

 LPCTSTR ExceptionHandler::GetExceptionInfo(PEXCEPTION_RECORD per, LPTSTR szBuf, size_t cchBuf)
 {
 	DWORD dwCode = per->ExceptionCode;
+	szBuf[0] = 0; // return "" if we have nothing to say

 	// two of the most common exceptions have useful information in the ExceptionInformation
 	if ((EXCEPTION_ACCESS_VIOLATION == dwCode) || (EXCEPTION_IN_PAGE_ERROR == dwCode)) {


Fix name in StringBuilder

Fix name in StringBuilder

We merged a slightly out-of-date version of
http://trac.webkit.org/changeset/152306 that missed a last-minute name change.

R=esprehn
NOTRY=true

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

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@154151 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/wtf/text/StringBuilder.cpp
+++ Source/wtf/text/StringBuilder.cpp
@@ -32,7 +32,7 @@

 namespace WTF {

-static size_t expandCapacity(size_t capacity, size_t newLength)
+static size_t expandedCapacity(size_t capacity, size_t newLength)
 {
     static const size_t minimumCapacity = 16;
     return std::max(capacity, std::max(minimumCapacity, newLength * 2));
@@ -227,10 +227,10 @@
         // If the buffer is valid it must be at least as long as the current builder contents!
         ASSERT(m_buffer->length() >= m_length);

-        reallocateBuffer<CharType>(expandCapacity(capacity(), requiredLength));
+        reallocateBuffer<CharType>(expandedCapacity(capacity(), requiredLength));
     } else {
         ASSERT(m_string.length() == m_length);
-        allocateBuffer(m_length ? m_string.getCharacters<CharType>() : 0, expandCapacity(capacity(), requiredLength));
+        allocateBuffer(m_length ? m_string.getCharacters<CharType>() : 0, expandedCapacity(capacity(), requiredLength));
     }

     CharType* result = getBufferCharacters<CharType>() + m_length;
@@ -261,10 +261,10 @@
             // If the buffer is valid it must be at least as long as the current builder contents!
             ASSERT(m_buffer->length() >= m_length);

-            allocateBufferUpConvert(m_buffer->characters8(), expandCapacity(capacity(), requiredLength));
+            allocateBufferUpConvert(m_buffer->characters8(), expandedCapacity(capacity(), requiredLength));
         } else {
             ASSERT(m_string.length() == m_length);
-            allocateBufferUpConvert(m_string.isNull() ? 0 : m_string.characters8(), expandCapacity(capacity(), requiredLength));
+            allocateBufferUpConvert(m_string.isNull() ? 0 : m_string.characters8(), expandedCapacity(capacity(), requiredLength));
         }

         memcpy(m_bufferCharacters16 + m_length, characters, static_cast<size_t>(length) * sizeof(UChar));


fix llcp 1 signal emit issue

fix llcp 1 signal emit issue

--- src/connectivity/nfc/symbian/llcpsockettype1_symbian.cpp
+++ src/connectivity/nfc/symbian/llcpsockettype1_symbian.cpp
@@ -690,11 +690,8 @@
         iSendObserver.WriteComplete(error, iCurrentSendBufPos - iCurrentSendBufPtr.Length());
         return;
         }
-    else
-        {
-        // Sent signal for each successful sending
-        iSendObserver.WriteComplete(error, iCurrentSendBufPtr.Length());
-        }
+
+    TInt bytesWritten =  iCurrentSendBufPtr.Length();

     // Still have some buffer need send, don't stop
     if (iCurrentSendBufPos < iTransmitBuf.Length())
@@ -725,6 +722,8 @@
         iConnection.Transmit(iStatus, iTempSendBuf);
         SetActive();
         }
+    // Sent signal for each successful sending
+    iSendObserver.WriteComplete(error, bytesWritten);
     END
     }


fix connection create and receive llcp

fix connection create and receive llcp

--- src/connectivity/nfc/symbian/llcpsockettype1_symbian.cpp
+++ src/connectivity/nfc/symbian/llcpsockettype1_symbian.cpp
@@ -327,11 +327,7 @@
         {
           iRemotePort = portNum;
           qDebug() << "CreateConnection " << iRemotePort;
-          if ( !iConnection )
-              {
-              // Creating wrapper for connection.
-              TRAP( error, iConnection = COwnLlcpConnectionWrapper::NewL(llcpConnection ) );
-              }
+          error = StartTransportedAndReceive(llcpConnection);
         }
     END
     return error;
@@ -351,7 +347,7 @@

      if ( error == KErrNone && iConnection != NULL)
          {
-         iConnection->Receive(*this);
+         error = iConnection->Receive(*this);
          }
      END
      return error;


Added a method for removing servers and updated the add server method.

--- libmemcached/memcached.hpp
+++ libmemcached/memcached.hpp
@@ -164,6 +164,7 @@
   {
     servers_list.assign(in_servers_list);
     servers= memcached_servers_parse(in_servers_list.c_str());
+    memcached_server_push(&memc, servers);
     return (servers == NULL);
   }

@@ -171,7 +172,7 @@
    * Add a server to the list of memcached servers to use.
    *
    * @param[in] server_name name of the server to add
-   * @param[in[ port port number of server to add
+   * @param[in] port port number of server to add
    * @return true on success; false otherwise
    */
   bool addServer(const std::string &server_name, unsigned int port)
@@ -187,6 +188,28 @@
                                           server_name.c_str(),
                                           port,
                                           &rc);
+    memcached_server_push(&memc, servers);
+    return (rc == MEMCACHED_SUCCESS);
+  }
+
+  /**
+   * Remove a server from the list of memcached servers to use.
+   *
+   * @param[in] server_name name of the server to remove
+   * @param[in] port port number of server to remove
+   * @return true on success; false otherwise
+   */
+  bool removeServer(const std::string &server_name, size_t port)
+  {
+    std::string tmp_str;
+    std::ostringstream strstm;
+    tmp_str.append(",");
+    tmp_str.append(server_name);
+    tmp_str.append(":");
+    strstm << port;
+    tmp_str.append(strstm.str());
+    memcached_server_st *server= memcached_servers_parse(tmp_str.c_str());
+    memcached_return rc= memcached_server_remove(server);
     return (rc == MEMCACHED_SUCCESS);
   }


Fix build by modifying a file I forgot

Fix build by modifying a file I forgot

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/251086

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

Former-commit-id: 4823007ed4c12f21635cd26e168a8c8f6fb57175

--- app/win_util.cc
+++ app/win_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

@@ -12,13 +12,13 @@

 #include <algorithm>

+#include "app/gfx/codec/png_codec.h"
 #include "app/l10n_util.h"
 #include "app/l10n_util_win.h"
 #include "base/base_switches.h"
 #include "base/command_line.h"
 #include "base/file_util.h"
 #include "base/gfx/gdi_util.h"
-#include "base/gfx/png_encoder.h"
 #include "base/logging.h"
 #include "base/native_library.h"
 #include "base/registry.h"
@@ -745,9 +745,9 @@
   // We now have a copy of the window contents in a DIB, so
   // encode it into a useful format for posting to the bug report
   // server.
-  PNGEncoder::Encode(bit_ptr, PNGEncoder::FORMAT_BGRA,
-                     width, height, width * 4, true,
-                     png_representation);
+  gfx::PNGCodec::Encode(bit_ptr, gfx::PNGCodec::FORMAT_BGRA,
+                        width, height, width * 4, true,
+                        png_representation);

   ReleaseDC(window_handle, window_hdc);
 }


INTEGRATION: CWS visibility03 (1.4.318); FILE MERGED 2005/04/01 13:03:43 mhu 1.4.318.1: #i45006# Removed unused include(s).

--- svtools/source/items/rngitem.cxx
+++ svtools/source/items/rngitem.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: rngitem.cxx,v $
  *
- *  $Revision: 1.4 $
- *
- *  last change: $Author: rt $ $Date: 2004-06-16 10:22:31 $
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: obo $ $Date: 2005-04-13 11:11:05 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -63,14 +63,8 @@
 #include <tools/stream.hxx>
 #endif

-#ifndef GCC
-#pragma hdrstop
-#endif

 #ifndef NUMTYPE
-
-#include "sbx.hxx"
-#include "args.hxx"

 #if SUPD<355
 DBG_NAME(SfxRangeItem);


INTEGRATION: CWS rt16 (1.14.86); FILE MERGED 2006/08/07 12:14:31 rt 1.14.86.1: #i68214# Remove empty file

--- svx/source/engine3d/sphere3d.cxx
+++ svx/source/engine3d/sphere3d.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sphere3d.cxx,v $
  *
- *  $Revision: 1.14 $
- *
- *  last change: $Author: hr $ $Date: 2006-06-19 15:47:38 $
+ *  $Revision: 1.15 $
+ *
+ *  last change: $Author: ihi $ $Date: 2006-08-29 14:34:41 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -35,10 +35,6 @@

 #include "svdstr.hrc"
 #include "svdglob.hxx"
-
-#ifndef _SVDIO_HXX
-#include "svdio.hxx"
-#endif

 #ifndef _SVDITER_HXX
 #include "svditer.hxx"


Failed to change camera to component, reverted all the changes

--- StartingEngine/ModuleCamera3D.cpp
+++ StartingEngine/ModuleCamera3D.cpp
@@ -108,7 +108,7 @@

 	// Recalculate matrix -------------
-	//CalculateViewMatrix();
+	CalculateViewMatrix();

 	return UPDATE_CONTINUE;
 }