Format issues

Format issues

--- source/STRUCTURE/peptideBuilder.C
+++ source/STRUCTURE/peptideBuilder.C
@@ -14,7 +14,7 @@
 {
 	namespace Peptides
 	{
-
+
 		// Default bond lengths for divers bonds in the peptide backbone.
 		const float BOND_LENGTH_N_C  = 1.335;
 		const float BOND_LENGTH_C_CA = 1.520;
@@ -55,11 +55,11 @@

 		AminoAcidDescriptor::AminoAcidDescriptor(const AminoAcidDescriptor& aad)
-			:	type_(aad.getType()),
+			: type_(aad.getType()),
 				phi_(aad.getPhi()),
 				psi_(aad.getPsi()),
 				omega_(aad.getOmega())
-		{
+		{
 		}

@@ -111,7 +111,7 @@
 		}

 		PeptideBuilder::PeptideBuilder()
-			: sequence_(),
+			: sequence_(),
 				chainname_("Chain"),
 				proteinname_("Protein"),
 				is_proline_(false),
@@ -129,7 +129,7 @@
 		}

 		PeptideBuilder::PeptideBuilder(const String& sequence, const Angle& phi, const Angle& psi, const Angle& omega)
-			: sequence_(),
+			: sequence_(),
 				chainname_("_"),
 				proteinname_(sequence),
 				is_proline_(false),
@@ -149,7 +149,7 @@
 			 proteinname_(pc.proteinname_),
 			 is_proline_(false),
 			 fragment_db_(0)
-		{
+		{
 		}

 		PeptideBuilder::~PeptideBuilder()
@@ -191,8 +191,8 @@

 		Protein* PeptideBuilder::construct()
 		{
-			if (fragment_db_ == 0)
-			{
+			if (fragment_db_ == 0)
+			{
 				Log.warn() << "PeptideBuilder::construct(): no FragmengDB given!" << std::endl;
 				return 0;
 			}
@@ -200,19 +200,19 @@
 			{

 				Log.warn() << "PeptideBuilder::construct(): no amino acid sequence specified." << std::endl;
- 				return 0;
+				return 0;
 			}
 			int id = 1;
 			Protein *protein = new Protein(proteinname_);
 			Chain *chain = new Chain(chainname_);
-
+
 			// create the first residue
 			Residue* residue = createResidue_(sequence_[0].getType(), id);
 			chain->insert(*residue);
 			Residue* residueold = residue;
 			std::vector<AminoAcidDescriptor>::iterator i = sequence_.begin();
 			++id;
-
+
 			// consistency check for empty sequences and sequences of length < 2!!
 			// loop for the remaining residues ;
 			for (++i; i != sequence_.end(); ++i)
@@ -228,15 +228,15 @@
 				type.toUpper();

 				is_proline_ = (type == "PRO") ? true : false;
-
+
 				Residue* residue2 = createResidue_(i->getType(), id);
-
+
 				insert_(*residue2,*residueold);
 				chain->insert(*residue2);
-
+
 				//set the torsion angle
 				// TODO: angle of the peptide bond (omega)
-
+
 				transform_(i->getPhi(),(i-1)->getPsi(),*residueold,*residue2);
 				peptide_(*residueold,*residue2);

@@ -247,22 +247,22 @@
 				++id;
 			}

-			protein->insert(*chain);
-
+			protein->insert(*chain);
+
 			// read the names for a unique nomenclature
 			protein->apply(fragment_db_->normalize_names);
-
+
 			// Add missing bonds and atoms (including side chains!)
 			ReconstructFragmentProcessor rfp(*fragment_db_);
 			protein->apply(rfp);
 			protein->apply(fragment_db_->build_bonds);
-
+
 			return protein;
 		}

 		Residue* PeptideBuilder::createResidue_(const String& type, const int id)
 		{
-			Residue* res = new Residue(type, String(id));
+			Residue* res = new Residue(type, String(id));
 			PDBAtom* nitrogen = new PDBAtom(PTE[Element::N], "N");
 			PDBAtom* carbona = new PDBAtom(PTE[Element::C], "CA");
 			PDBAtom* carbon = new PDBAtom(PTE[Element::C], "C");
@@ -299,36 +299,36 @@
 			PDBAtom* pnitrogen_n = getAtomByName_(resnew, "N");
 			PDBAtom* pcarbona_n  = getAtomByName_(resnew, "CA");
 			PDBAtom* pcarbon_n   = getAtomByName_(resnew, "C");
-
+
 			Vector3 rot_axis;    // axis  for the torsion angle

 			//set C-N-bond
 			pcarbon->createBond(*pnitrogen_n)->setOrder(Bond::ORDER__SINGLE);;
-
-
+
+
 			//  --------------  move N into  0|0|0
 			TranslationProcessor translation(Vector3(BOND_LENGTH_N_CA, 0., 0.));
 			resnew.apply(translation);
-
+
 			// --------------- calculate the coordinates for N
-			Vector3 CA_C_axis = (pcarbon->getPosition() - pcarbona->getPosition()).normalize();
+			Vector3 CA_C_axis = (pcarbon->getPosition() - pcarbona->getPosition()).normalize();
 			Vector3 N_CA_axis = (pcarbona->getPosition() - pnitrogen->getPosition()).normalize();
 			Vector3 CA_N_axis = ((float)-1.) * N_CA_axis;
-			Vector3 newpos = (CA_N_axis - (CA_C_axis * CA_N_axis) * CA_C_axis).normalize();
-			Vector3 normaxis = (CA_C_axis % newpos).normalize();
-
+			Vector3 newpos = (CA_N_axis - (CA_C_axis * CA_N_axis) * CA_C_axis).normalize();
+			Vector3 normaxis = (CA_C_axis % newpos).normalize();
+
 			Matrix4x4 mat;
-			mat.setRotation(Angle(-1. * 30.* Constants::PI/180.), normaxis);
+			mat.setRotation(Angle(-1. * 30.* Constants::PI/180.), normaxis);

 			newpos = mat * newpos;          // rotation
 			newpos = newpos *  BOND_LENGTH_N_C; // scaling of the bond length
 			newpos = newpos + pcarbon->getPosition();

 			// positioning of the nitrogen
-			translation.setTranslation(newpos);
-			resnew.apply(translation);
-
-
+			translation.setTranslation(newpos);
+			resnew.apply(translation);
+
+
 			 //---------------set the angle in NN to 120 degrees
 			Vector3 NN_C_axis   = pcarbon->getPosition() - pnitrogen_n->getPosition();
 			Vector3 NN_NCA_axis = pcarbona_n->getPosition() - pnitrogen_n->getPosition();
@@ -336,12 +336,12 @@

 			//current angle for C
 			Angle current(acos(NN_C_axis * NN_NCA_axis /
-										 (NN_C_axis.getLength() * NN_NCA_axis.getLength() )));
+										 (NN_C_axis.getLength() * NN_NCA_axis.getLength() )));

 			Matrix4x4 transmat;
 			Vector3 rotaxis;

-			if (current < (float)(Constants::PI - 1e-2))
+			if (current < (float)(Constants::PI - 1e-2))
 			{
 				current = Angle(120.*Constants::PI/180.) - current;
 				rotaxis = (NN_C_axis%NN_NCA_axis).normalize();
@@ -353,7 +353,7 @@
 				  // is this line really correct???
 					current = Angle(-120. * 120. * Constants::PI / 180.) - current;
 					rotaxis = (NN_C_axis % NN_NCA_axis).normalize();
-				}
+				}
 				else
 				{
 					current = Angle(-120. * Constants::PI / 180.) - current;
@@ -361,8 +361,8 @@
 				}
 			}

-			transmat.rotate(current,rotaxis);
-
+			transmat.rotate(current, rotaxis);
+
 			TransformationProcessor transformation(transmat);

 			// translate to 0|0|0 (needed for the rotation)
@@ -374,7 +374,7 @@
 			// translate back to the correct position
 			translation.setTranslation(toOrigin);
 			resnew.apply(translation);
-
+
 			//---------------- set torsion angle to 0
 			Vector3 v_pca  = pcarbona->getPosition();
 			Vector3 v_pc   = pcarbon->getPosition();
@@ -382,17 +382,17 @@
 			Vector3 v_pca_n = pcarbona_n->getPosition();
 			Vector3 v_pc_n  = pcarbon_n->getPosition();
 			Vector3 v_pn   =pnitrogen->getPosition();
-			current = getTorsionAngle( v_pca.x,   v_pca.y,   v_pca.z,
+			current = getTorsionAngle( v_pca.x,   v_pca.y,   v_pca.z,
 					 v_pc.x,    v_pc.y,    v_pc.z,
 					 v_pn_n.x,  v_pn_n.y,  v_pn_n.z,
 					 v_pca_n.x, v_pca_n.y, v_pca_n.z );
-
+

 			rot_axis =  (pnitrogen_n->getPosition() - pcarbon->getPosition()).normalize();
 			transmat.getZero();/// is this necessary???
 			transmat.rotate(Angle(-1. * current), rot_axis);
 			transformation.setTransformation(transmat);
-
+
 			//translate to 0|0|0
 			toOrigin = pnitrogen_n->getPosition();
 			translation.setTranslation(((float)(-1.))*toOrigin);
@@ -403,14 +403,14 @@
 			 //translate back
 			translation.setTranslation(toOrigin);
 			resnew.apply(translation);
-
+
 			// ---------------------set the peptide bond angle omega  to 180 degrees
 			v_pca  = pcarbona->getPosition();
 			v_pc   = pcarbon->getPosition();
 			v_pn_n = pnitrogen_n->getPosition();
 			v_pca_n = pcarbona_n->getPosition();
 			v_pc_n  = pcarbon_n->getPosition();
-			current = getTorsionAngle( v_pca.x,   v_pca.y,   v_pca.z,
+			current = getTorsionAngle( v_pca.x,   v_pca.y,   v_pca.z,
 					 v_pc.x,    v_pc.y,    v_pc.z,
 					 v_pn_n.x,  v_pn_n.y,  v_pn_n.z,
 					 v_pca_n.x, v_pca_n.y, v_pca_n.z );
@@ -422,13 +422,13 @@
 			// translate to 0|0|0 (needed for the rotation)
 			toOrigin = pnitrogen_n->getPosition();
 			translation.setTranslation(((float)(-1.))*toOrigin);
-			resnew.apply(translation);
+			resnew.apply(translation);
 			//rotate in 0|0|0  about 180 degrees
 			resnew.apply(transformation);
 			//translate back
 			translation.setTranslation(toOrigin);
 			 resnew.apply(translation);
-
+
 			//------------- angle psi
 			v_pca  = pcarbona->getPosition();
 			v_pc   = pcarbon->getPosition();
@@ -438,13 +438,13 @@
 			current = getTorsionAngle( v_pc.x,    v_pc.y,    v_pc.z,
 					 v_pn_n.x,  v_pn_n.y,  v_pn_n.z,
 					 v_pca_n.x, v_pca_n.y, v_pca_n.z,
-					 v_pc_n.x,  v_pc_n.y,  v_pc_n.z  );
+					 v_pc_n.x,  v_pc_n.y,  v_pc_n.z  );

 			rot_axis = (pcarbona_n->getPosition()-pnitrogen_n->getPosition()).normalize();
-
-			transmat.rotate(Angle(-1. * current), rot_axis);
-			transformation.setTransformation(transmat);
-
+
+			transmat.rotate(Angle(-1. * current), rot_axis);
+			transformation.setTransformation(transmat);
+
 			//translate to 0|0|0 (needed for the rotation)
 			toOrigin = pcarbona_n->getPosition();
 			translation.setTranslation(((float)(-1.))*toOrigin);
@@ -454,7 +454,7 @@
 			// translate back to the correct position
 			translation.setTranslation(toOrigin);
 			resnew.apply(translation);
-
+
 			return;
 		}

@@ -484,21 +484,20 @@
 			Vector3 v_pn_n   = pnitrogen_n->getPosition();
 			Vector3 v_pca_n  = pcarbona_n->getPosition();
 			Vector3 v_pc_n   = pcarbon_n->getPosition();
-			currentpsi = getTorsionAngle( v_pn.x,    v_pn.y,   v_pn.z,
+			currentpsi = getTorsionAngle( v_pn.x,    v_pn.y,   v_pn.z,
 							v_pca.x,   v_pca.y,  v_pca.z,
-							v_pc.x,  v_pc.y, v_pc.z,
+							v_pc.x,  v_pc.y, v_pc.z,
 							v_pn_n.x,  v_pn_n.y,  v_pn_n.z);

 			psiaxis = ( pcarbon->getPosition() - pcarbona->getPosition()).normalize();
 			psimat.rotate((float)-1. * currentpsi, psiaxis);
 			TransformationProcessor psitrans(psimat);

-
 			//translate  to 0|0|0 (needed for the rotation)
-			Vector3 toOrigin = pcarbon->getPosition();
+			Vector3 toOrigin = pcarbon->getPosition();
 			translation.setTranslation(((float)(-1.))*toOrigin);
 			resnew.apply(translation);
-
+
 			//rotate
 			resnew.apply(psitrans);

@@ -519,8 +518,8 @@

 			currentphi = getTorsionAngle( v_pc.x,    v_pc.y,    v_pc.z,
 					 v_pn_n.x,  v_pn_n.y,  v_pn_n.z,
-					 v_pca_n.x, v_pca_n.y, v_pca_n.z,
-					 v_pc_n.x,  v_pc_n.y,  v_pc_n.z	);
+					 v_pca_n.x, v_pca_n.y, v_pca_n.z,
+					 v_pc_n.x,  v_pc_n.y,  v_pc_n.z);

 			phiaxis = (pcarbona_n->getPosition() -  pnitrogen_n->getPosition()).normalize();
@@ -538,7 +537,7 @@
 			// translate back to the correct position
 			translation.setTranslation(toOrigin);
 			resnew.apply(translation);
-
+
 			return;
 		}

@@ -550,23 +549,23 @@
 			PDBAtom* pcarbona    = getAtomByName_(resold, "CA");
 			PDBAtom* pnitrogen_n = getAtomByName_(resnew, "N");

-			Vector3 CA_C_axis =(pcarbon->getPosition() - pcarbona->getPosition()).normalize();
+			Vector3 CA_C_axis =(pcarbon->getPosition() - pcarbona->getPosition()).normalize();
 			Vector3 C_NN_axis =(pnitrogen_n->getPosition() - pcarbon->getPosition()).normalize();

 			Matrix4x4 mat;
-			mat.setRotation(Angle(Constants::PI), CA_C_axis);
+			mat.setRotation(Angle(Constants::PI), CA_C_axis);
 			Vector3  newpos = mat * C_NN_axis;

 			// newpos = mat * newpos;
 			newpos = newpos.normalize() * BOND_LENGTH_C_O + pcarbon->getPosition();
-
+
 			//newpos= pcarbon->getPosition();
 			poxygen->setPosition(newpos);
-
+
 			//set C-O-bond
 			(pcarbon->createBond(*poxygen))->setOrder(Bond::ORDER__DOUBLE);
 			resold.insert(*poxygen);
-
+
 			//----------set hydrogen. We can't do this for proline,
 			//					since in this case, this hydrogen doesn't exist
 			if (!is_proline_)
@@ -595,7 +594,7 @@

 			// At this point, omega has been fixed to 180 degrees
 			Matrix4x4 mat;
-			mat.setRotation(Angle(omega-Angle(Constants::PI)), C_NN_axis);
+			mat.setRotation(Angle(omega-Angle(Constants::PI)), C_NN_axis);
 			TransformationProcessor omegatrans(mat);

 			// translate to 0|0|0 (needed for the rotation)
@@ -613,7 +612,7 @@

 			return;
 		}
-
+
 		PDBAtom* PeptideBuilder::getAtomByName_(Residue& res, const String& name)
 		{
 			PDBAtomIterator ai;
@@ -624,19 +623,17 @@
 					return &(*ai);
 				}
 			}
-
+
 			return 0;
 		}

 		void PeptideBuilder::setFragmentDB(const FragmentDB* db)
-
 		{
 			fragment_db_ = (FragmentDB*) db;
 		}

 		const FragmentDB* PeptideBuilder::getFragmentDB() const
-
 		{
 			return fragment_db_;
 		}


Disabling initializeAndroidGlobals when built with WEBRTC_CHROMIUM_BUILD.

webrtc::VideoEngine::SetAndroidObjects and webrtc::VoiceEngine::SetAndroidObjects
are not compatible with WEBRTC_CHROMIUM_BUILD. Since neither VoiceEngine nor VideoEngine
are needed at the time it's better to disable it completely.

BUG=https://crbug.com/412276
R=glaznev@webrtc.org

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

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

--- app/webrtc/java/jni/peerconnection_jni.cc
+++ app/webrtc/java/jni/peerconnection_jni.cc
@@ -2400,7 +2400,7 @@
   return (jlong)new PCOJava(jni, j_observer);
 }

-#ifdef ANDROID
+#if defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)
 JOW(jboolean, PeerConnectionFactory_initializeAndroidGlobals)(
     JNIEnv* jni, jclass, jobject context,
     jboolean initialize_audio, jboolean initialize_video) {
@@ -2412,7 +2412,7 @@
     failure |= webrtc::VoiceEngine::SetAndroidObjects(g_jvm, jni, context);
   return !failure;
 }
-#endif  // ANDROID
+#endif  // defined(ANDROID) && !defined(WEBRTC_CHROMIUM_BUILD)

 // Helper struct for working around the fact that CreatePeerConnectionFactory()
 // comes in two flavors: either entirely automagical (constructing its own


* Moved init position Y to 30 pixels from old 20, so it wont overlap with ControlBar on first show.

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1669 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CommunicationModule/CommunicationUI/QtGUI.cpp
+++ CommunicationModule/CommunicationUI/QtGUI.cpp
@@ -142,7 +142,7 @@
 			buttonRemoveFriend_->setIconSize(QSize(10,10));

 			canvas_chat_->SetCanvasResizeLock(true);
-            canvas_chat_->SetPosition(20,20);
+            canvas_chat_->SetPosition(20,30);
 		    canvas_chat_->SetCanvasSize(720, 350);
             canvas_chat_->AddWidget(chatWidget_);
             canvas_login_->Hide();
@@ -167,7 +167,7 @@
 			    QObject::connect(loginWidget_, SIGNAL( UserdataSet(QString, int, QString, QString) ), this, SLOT( ConnectToServer(QString, int, QString, QString) ));

     			canvas_login_->SetCanvasResizeLock(true);
-                canvas_login_->SetPosition(20,20);
+                canvas_login_->SetPosition(20,30);
 			    canvas_login_->SetCanvasSize(400, 185);
                 canvas_login_->AddWidget(loginWidget_);
                 // Add widget to layout


Fix typo

Fix typo

--- src/ContextGDIPlus.cpp
+++ src/ContextGDIPlus.cpp
@@ -324,5 +324,5 @@
     baseline = (ascent + descent);
   }

-  return TextMetrics(size.Width / display_scale, (descent - baseline) / dispaly_scale, (ascent - baseline) / display_scale);
-}
+  return TextMetrics(size.Width / display_scale, (descent - baseline) / display_scale, (ascent - baseline) / display_scale);
+}


Having warnings does not mean failure.

Having warnings does not mean failure.

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

--- interpreter/cling/lib/Interpreter/Interpreter.cpp
+++ interpreter/cling/lib/Interpreter/Interpreter.cpp
@@ -514,7 +514,7 @@
                                const clang::Decl** D /* = 0 */) {

     const Transaction* lastT = m_IncrParser->Compile(input, CO);
-    if (lastT->getIssuedDiags() == Transaction::kNone) {
+    if (lastT->getIssuedDiags() != Transaction::kErrors) {
       if (D)
         *D = lastT->getFirstDecl().getSingleDecl();
       return Interpreter::kSuccess;


diagnostic

diagnostic

--- src/fa.cpp
+++ src/fa.cpp
@@ -178,18 +178,19 @@
         }
          */
         //update target information for interval i
-    }
-    /*
+
         for (int jj=starter; jj<update_intervals[i+1]; jj++) {

             // Update corrects all future occurrences of wrong QSOs etc and tries to observe something else
             if (0<=jj-F.Analysis) update_plan_from_one_obs(jj,Secret,M,P,pp,F,A); else printf("\n no update\n");
         }
+    }
+    /*
         redistribute_tf(M,P,pp,F,A,starter);
         improve(M,P,pp,F,A,starter);
         redistribute_tf(M,P,pp,F,A,starter);
         //}
-
+
         if(F.diagnose)diagnostic(M,Secret,F,A);

     // check on SS and SF


Fix test for homogeneity in case of aggregate consisting of containerized vector types

Details can be found here:

Differential revision: http://reviews.llvm.org/D17501

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@261734 91177308-0d34-0410-b5e6-96231b3b80d8

--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -3100,9 +3100,11 @@
                         bool is_hva = false;
                         bool is_hfa = false;
                         clang::QualType base_qual_type;
+                        uint64_t base_bitwidth = 0;
                         for (field_pos = record_decl->field_begin(); field_pos != field_end; ++field_pos)
                         {
                             clang::QualType field_qual_type = field_pos->getType();
+                            uint64_t field_bitwidth = getASTContext()->getTypeSize (qual_type);
                             if (field_qual_type->isFloatingType())
                             {
                                 if (field_qual_type->isComplexType())
@@ -3123,22 +3125,21 @@
                             }
                             else if (field_qual_type->isVectorType() || field_qual_type->isExtVectorType())
                             {
-                                const clang::VectorType *array = field_qual_type.getTypePtr()->getAs<clang::VectorType>();
-                                if (array && array->getNumElements() <= 4)
+                                if (num_fields == 0)
                                 {
-                                    if (num_fields == 0)
-                                        base_qual_type = array->getElementType();
-                                    else
-                                    {
-                                        if (is_hfa)
-                                            return 0;
-                                        is_hva = true;
-                                        if (field_qual_type.getTypePtr() != base_qual_type.getTypePtr())
-                                            return 0;
-                                    }
+                                    base_qual_type = field_qual_type;
+                                    base_bitwidth = field_bitwidth;
                                 }
                                 else
-                                    return 0;
+                                {
+                                    if (is_hfa)
+                                        return 0;
+                                    is_hva = true;
+                                    if (base_bitwidth != field_bitwidth)
+                                        return 0;
+                                    if (field_qual_type.getTypePtr() != base_qual_type.getTypePtr())
+                                        return 0;
+                                }
                             }
                             else
                                 return 0;


Increase buffer size for Java Heap Prof CTS. am: e8990636e0 am: d17b6a1b16 am: a7be53d5a2

Original change: https://googleplex-android-review.googlesource.com/c/platform/external/perfetto/+/12459203

Change-Id: Iaa70a5cadb731e354b695e6117f43442e7f7be08

--- test/cts/heapprofd_java_test_cts.cc
+++ test/cts/heapprofd_java_test_cts.cc
@@ -66,7 +66,7 @@
   helper.WaitForConsumerConnect();

   TraceConfig trace_config;
-  trace_config.add_buffers()->set_size_kb(20 * 1024);
+  trace_config.add_buffers()->set_size_kb(40 * 1024);
   trace_config.set_duration_ms(6000);
   trace_config.set_unique_session_name(RandomSessionName().c_str());


cc: Remove some more unneeded asserts for methods that the UI compositor is using temporarily during transition to the new debug borders.

BUG=159769
TBR=jamesr

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

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

--- webkit/compositor_bindings/web_layer_impl.cc
+++ webkit/compositor_bindings/web_layer_impl.cc
@@ -278,12 +278,10 @@

 void WebLayerImpl::setDebugBorderColor(const WebColor& color)
 {
-    NOTREACHED();
 }

 void WebLayerImpl::setDebugBorderWidth(float width)
 {
-    NOTREACHED();
 }

 void WebLayerImpl::setDebugName(WebString name)


emit warning on unexpected reference base, do not print status unless verbose is set

--- src/nanopolish_phase_reads.cpp
+++ src/nanopolish_phase_reads.cpp
@@ -209,7 +209,9 @@
     upper_search.ref_position = alignment_end_pos;
     auto upper_iter = std::upper_bound(variants.begin(), variants.end(), upper_search, sortByPosition);

-    fprintf(stderr, "Phasing read %s %s:%u-%u %zu\n", read_name.c_str(), ref_name.c_str(), alignment_start_pos, alignment_end_pos, upper_iter - lower_iter);
+    if(opt::verbose >= 1) {
+        fprintf(stderr, "Phasing read %s %s:%u-%u %zu\n", read_name.c_str(), ref_name.c_str(), alignment_start_pos, alignment_end_pos, upper_iter - lower_iter);
+    }

     // no variants to phase?
     if(lower_iter == variants.end()) {
@@ -302,7 +304,10 @@
                 //fprintf(stderr, "\t%s score: %.2lf %.2lf %c p_wrong: %.3lf Q: %d QC: %c\n", v.key().c_str(), ref_score, alt_score, call, log_p_wrong, (int)q_score, q_char);

                 int out_position = v.ref_position - alignment_start_pos;
-                assert(read_outseq[out_position] == v.ref_seq[0]);
+                if(read_outseq[out_position] != v.ref_seq[0]) {
+                    fprintf(stderr, "warning: reference base at position %d does not match variant record (%c != %c)\n",
+                        v.ref_position, v.ref_seq[0], read_outseq[out_position]);
+                }
                 read_outseq[out_position] = call;
                 read_outqual[out_position] = q_char;
             }


Unify the two copies of compile_assert.h

This patch basically deletes webrtc/base/compile_assert.h (which is
the more outdated copy) and moves
webrtc/system_wrappers/source/compile_assert.h to take its place.

R=aluebs@webrtc.org, andrew@webrtc.org, tommi@webrtc.org

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

git-svn-id: a556c8bde68cedbc0208a1ffc78b06e9cd07f676@8048 4adac7df-926f-26a2-2b94-8c16560cd09d

--- app/webrtc/java/jni/peerconnection_jni.cc
+++ app/webrtc/java/jni/peerconnection_jni.cc
@@ -78,12 +78,12 @@
 #include "third_party/libyuv/include/libyuv/video_common.h"
 #include "webrtc/base/bind.h"
 #include "webrtc/base/checks.h"
+#include "webrtc/base/compile_assert.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/messagequeue.h"
 #include "webrtc/base/ssladapter.h"
 #include "webrtc/common_video/interface/texture_video_frame.h"
 #include "webrtc/modules/video_coding/codecs/interface/video_codec_interface.h"
-#include "webrtc/system_wrappers/interface/compile_assert.h"
 #include "webrtc/system_wrappers/interface/trace.h"
 #include "webrtc/video_engine/include/vie_base.h"
 #include "webrtc/voice_engine/include/voe_base.h"


focus diroperator after chaing url in navigator

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

--- kate/plugins/filebrowser/katefilebrowser.cpp
+++ kate/plugins/filebrowser/katefilebrowser.cpp
@@ -269,6 +269,7 @@

 void KateFileBrowser::updateDirOperator(const KUrl& u)
 {
+  m_dirOperator->setFocus();
   m_dirOperator->setUrl(u, true);
 }


take the minimum of base quality and mapping quality

Only applies when --use-mapping-quality is set.

--- src/DataLikelihood.cpp
+++ src/DataLikelihood.cpp
@@ -22,7 +22,8 @@
             vector<Allele*>& alleles = s->second;
             if (useMapQ) {
                 for (vector<Allele*>::iterator a = alleles.begin(); a != alleles.end(); ++a) {
-                    prodQout += (*a)->lnquality + (*a)->lnmapQuality;
+                    // take the lesser of mapping quality and base quality (in log space)
+                    prodQout += max((*a)->lnquality, (*a)->lnmapQuality);
                 }
             } else {
                 for (vector<Allele*>::iterator a = alleles.begin(); a != alleles.end(); ++a) {


Fix a misuse of iterators when iterating through block's
parameters list for encoding.

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

--- lib/AST/ASTContext.cpp
+++ lib/AST/ASTContext.cpp
@@ -3192,7 +3192,7 @@
   return llvm::itostr(CU.getQuantity());
 }

-/// getObjCEncodingForBlockDecl - Return the encoded type for this method
+/// getObjCEncodingForBlockDecl - Return the encoded type for this block
 /// declaration.
 void ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr,
                                              std::string& S) {
@@ -3207,7 +3207,7 @@
   SourceLocation Loc;
   CharUnits PtrSize = getTypeSizeInChars(VoidPtrTy);
   CharUnits ParmOffset = PtrSize;
-  for (ObjCMethodDecl::param_iterator PI = Decl->param_begin(),
+  for (BlockDecl::param_const_iterator PI = Decl->param_begin(),
        E = Decl->param_end(); PI != E; ++PI) {
     QualType PType = (*PI)->getType();
     CharUnits sz = getObjCEncodingTypeSize(PType);


Added an advisory message reminding the user to initialize the log.

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

--- src/log/recover.cpp
+++ src/log/recover.cpp
@@ -220,6 +220,13 @@

       return result;
     }
+
+    // TODO(jieyu): Currently, we simply calculate the size of the
+    // cluster from the quorum size. In the future, we may want to
+    // allow users to specify the cluster size in case they want to
+    // use a non-standard quorum size (e.g., cluster size = 5, quorum
+    // size = 4).
+    size_t clusterSize = (2 * quorum) - 1;

     if (autoInitialize) {
       // The following code handles the auto-initialization. Our idea
@@ -249,14 +256,6 @@
       // way, in our previous example, all replicas will be in
       // STARTING status before any of them can transit to VOTING
       // status.
-
-      // TODO(jieyu): Currently, we simply calculate the size of the
-      // cluster from the quorum size. In the future, we may wanna
-      // allow users to specify the cluster size in case they want to
-      // use a non-standard quorum size (e.g., cluster size = 5,
-      // quorum size = 4).
-      size_t clusterSize = (2 * quorum) - 1;
-
       switch (status) {
         case Metadata::EMPTY:
           if ((responsesReceived[Metadata::EMPTY] +
@@ -283,6 +282,19 @@
         default:
           // Ignore all other cases.
           break;
+      }
+    } else {
+      // Since auto initialization is disabled, we print an advisory
+      // message to remind the user to initialize the log manually.
+      if (responsesReceived[Metadata::EMPTY] >= clusterSize) {
+        LOG(WARNING) << "\n"
+                     << "----------------------------------------------------\n"
+                     << "Replicated log has not been initialized. Did you\n"
+                     << "forget to manually initialize the log (i.e.,\n"
+                     << "mesos-log initialize <PATH>)? Note that all replicas\n"
+                     << "are not initialized and the above command needs to\n"
+                     << "be run on each host!\n";
+                     << "----------------------------------------------------";
       }
     }


qmljs: fix import search paths collecting

Change-Id: I0b977d3186d8a0ab8f48e1d689e0ab9d045b46e3
Reviewed-by: Marco Bubke <5254e489b34ec8bbce36789100e3fc0f41fa62ef@digia.com>
Reviewed-by: Tim Jenssen <6a21f175c697b4129e1bafb6e9b52078bb1a6738@digia.com>

--- src/libs/qmljs/qmljsmodelmanagerinterface.cpp
+++ src/libs/qmljs/qmljsmodelmanagerinterface.cpp
@@ -604,7 +604,7 @@
         if (res.qtQmlPath.isEmpty())
             res.qtQmlPath = pInfo.qtQmlPath;
         foreach (const QString &path, pInfo.importPaths)
-            if (res.importPaths.contains(path))
+            if (!res.importPaths.contains(path))
                 res.importPaths.append(path);
     }
     return res;
@@ -1105,28 +1105,24 @@
     while (pInfoIter.hasNext()) {
         pInfoIter.next();
         QString pathAtt = pInfoIter.value().qtQmlPath;
-        if (!pathAtt.isEmpty() && allImportPaths.size() > 0
-                && allImportPaths.value(allImportPaths.size()) != pathAtt)
+        if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
             allImportPaths.append(pathAtt);
     }
     {
         QString pathAtt = defaultProjectInfo().qtQmlPath;
-        if (!pathAtt.isEmpty() && allImportPaths.size() > 0
-                && allImportPaths.value(allImportPaths.size()) != pathAtt)
+        if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
             allImportPaths.append(pathAtt);
     }
     pInfoIter.toFront();
     while (pInfoIter.hasNext()) {
         pInfoIter.next();
         QString pathAtt = pInfoIter.value().qtImportsPath;
-        if (!pathAtt.isEmpty() && allImportPaths.size() > 0
-                && allImportPaths.value(allImportPaths.size()) != pathAtt)
+        if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
             allImportPaths.append(pathAtt);
     }
     {
         QString pathAtt = defaultProjectInfo().qtImportsPath;
-        if (!pathAtt.isEmpty() && allImportPaths.size() > 0
-                && allImportPaths.value(allImportPaths.size()) != pathAtt)
+        if (!pathAtt.isEmpty() && (allImportPaths.isEmpty() || allImportPaths.last() != pathAtt))
             allImportPaths.append(pathAtt);
     }
     allImportPaths += m_defaultImportPaths;


локализация и шрифты под мак

локализация и шрифты под мак

git-svn-id: bd6e61130530ab01186c33a20f55445ba6f1e843@67009 954022d7-b5bf-4e40-9824-e11837661b57

--- DesktopEditor/fontengine/ApplicationFonts.cpp
+++ DesktopEditor/fontengine/ApplicationFonts.cpp
@@ -1510,8 +1510,16 @@

 			std::wstring wsFamilyName = NSFile::CUtf8Converter::GetUnicodeFromCharPtr(sFamilyName);
 			std::wstring wsStyleName = NSFile::CUtf8Converter::GetUnicodeFromCharPtr(sStyleName);
-
-			CFontInfo* pFontInfo = new CFontInfo( wsFamilyName,
+
+#ifdef _MAC
+            if (wsFamilyName.find(L".") == 0)
+            {
+                FT_Done_Face( pFace );
+                continue;
+            }
+#endif
+
+			CFontInfo* pFontInfo = new CFontInfo( wsFamilyName,
 				wsStyleName,
 				oArray[nIndex],
 				nIndexFace,


clone() already clones properties, no need to do it again

--- engine/prefabprivate.cpp
+++ engine/prefabprivate.cpp
@@ -151,8 +151,6 @@
                 {
                     // Otherwise, just clone it verbatim
                     GluonCore::GluonObject* newInstanceChild = clone->clone(linkedInstance);
-                    // Reclone properties
-                    Prefab::cloneObjectProperties(newInstanceChild, clone);
                 }
             }
         }


Cleanup: upstream differences from local branch

--- source/Symbol/SwiftASTContext.cpp
+++ source/Symbol/SwiftASTContext.cpp
@@ -1382,6 +1382,7 @@
     PlatformSP platform_sp(target.GetPlatform());
     uint32_t major, minor, update;
     if (platform_sp &&
+        !target.GetArchitecture().GetTriple().hasEnvironment() &&
         platform_sp->GetOSVersion(major, minor, update,
                                   target.GetProcessSP().get())) {
       StreamString full_triple_name;


Maintain lastIncommingTime in NetworkConnection.

--- src/net/network_connection.cxx
+++ src/net/network_connection.cxx
@@ -85,6 +85,9 @@
         recentlyReceivedQueue.pop_front();
       }

+      //Update time of most recent receive
+      lastIncommingTime = SDL_GetTicks();
+
       //Accept packet; does the channel exist?
       chanmap_t::const_iterator it = locchan.find(chan);
       if (it != locchan.end()) {


Bailing out if pc factory fails to get created.

This prevents us from continuing if we fail initialization.
The failure will happen closer to its source, rather than
when we try to create the first peer connection.

BUG=None
R=glaznev@webrtc.org

Review URL: https://codereview.webrtc.org/1339923004 .

Cr-Original-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#9948}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 6eb75d9e67f02c256436eb96f3c77026486561a1

--- app/webrtc/java/jni/peerconnection_jni.cc
+++ app/webrtc/java/jni/peerconnection_jni.cc
@@ -1103,6 +1103,8 @@
                                           NULL,
                                           encoder_factory,
                                           decoder_factory));
+  CHECK(factory) << "Failed to create the peer connection factory; "
+                 << "WebRTC/libjingle init likely failed on this device";
   OwnedFactoryAndThreads* owned_factory = new OwnedFactoryAndThreads(
       worker_thread, signaling_thread,
       encoder_factory, decoder_factory,


uses mats in concentration updating.

uses mats in concentration updating.

--- src/DegRateNuclide.cpp
+++ src/DegRateNuclide.cpp
@@ -249,7 +249,7 @@
   IsoConcMap to_ret;

   pair<IsoVector, double> sum_pair;
-  sum_pair = vec_hist_[the_time];
+  sum_pair = MatTools::sum_mats(mats);

   if(sum_pair.second != 0 && geom_->volume() != numeric_limits<double>::infinity()) {
     double scale = sum_pair.second/geom_->volume();


Prune "return" after llvm_unreachable(). It was redundant.

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

--- lib/AST/ASTContext.cpp
+++ lib/AST/ASTContext.cpp
@@ -706,7 +706,6 @@
     return false;
   }
   llvm_unreachable("getAddressSpaceMapMangling() doesn't cover anything.");
-  return false;
 }

 ASTContext::ASTContext(LangOptions& LOpts, SourceManager &SM,


fix some free issues

fix some free issues

--- src/lumpy/lumpy.cpp
+++ src/lumpy/lumpy.cpp
@@ -889,15 +889,16 @@
         free(e_it->second.first);
         free(e_it->second.second);
     }
+#if 0
     for ( i_er = evidence_readers.begin();
             i_er != evidence_readers.end();
             ++i_er) {
         SV_EvidenceReader *er = *i_er;
         delete(er);
     }
+#endif
     evidence_readers.clear();
     bam_evidence_readers.clear();
     //}}}
-
     return 0;
 }


Fixed bug introduced by interpreter::emptyRoot() by not setting the status variable right

--- source/core/interpreter.cpp
+++ source/core/interpreter.cpp
@@ -83,7 +83,8 @@
         {
             root.deleteSubNodes();
             root.data->destroy();
-            root.data=0;
+            root.data=nullptr;
+            rootEmpty=true;
         }
 	}
 	void interpreter::destroyTokens()


Add some collision notes and prevent object from falling through the top of another object.

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@7056 662fdd30-d327-0410-a531-f549c87e1e9e

--- src/mugen/stage.cpp
+++ src/mugen/stage.cpp
@@ -1014,7 +1014,9 @@
                 // He collides with another push him away
                 Mugen::Object * mplayer = (Mugen::Object *) mugen;
                 Mugen::Object * menemy = (Mugen::Object *) enemy;
-                /* TODO: make this cleaner */
+                /* TODO: make this cleaner
+                   FIXME: we need to check collisions in the air and push as well */
+                // NOTE: if Push Check is disabled do not do this
                 while (anyCollisions(mplayer->getDefenseBoxes(), (int) mplayer->getX(), (int) mplayer->getY(),
                                      menemy->getDefenseBoxes(), (int) menemy->getX(), (int) menemy->getY()) &&
                        centerCollision(mplayer, menemy) &&
@@ -1025,8 +1027,14 @@
                        enemy->getX() != maximumRight() &&
                        menemy->getMoveType() == Mugen::Move::Idle){

+                    /* NOTE: player should not be able to fall through the other player */
+                    if (mplayer->getY() < 0){
+                        if (mplayer->getY() >= enemy->getHeight()){
+                            mplayer->setY(enemy->getHeight()-mplayer->getHeight());
+                        }
+                    }
+
                     /* use move*Force to override pos freeze */
-
                     if (enemy->getX() < mugen->getX()){
                         if (enemy->getX() <= maximumLeft()){
                             /* FIXME */


Refactored if statement and removed comments

--- soccer/Robot.cpp
+++ soccer/Robot.cpp
@@ -309,16 +309,8 @@
 }

 bool OurRobot::isFacing() {
-    if (_rotationCommand && _rotationCommand->getCommandType() == Planning::RotationCommand::CommandType::None) {
-        return false;
-    } else {
-        return true;
-    }
-    //if (_rotationCommand && *_rotationCommand == Planning::EmptyAngleCommand{}) {
-    //    return false;
-    //} else {
-    //    return true;
-    //}
+    return _rotationCommand &&
+           _rotationCommand->getCommandType() == Planning::RotationCommand::CommandType::None;
 }


BUGFIX: Error decoding 16 bit instructions. It was using a wrong bit-mask (0x3FF instead of 0x3FFF)

--- microVM.cpp
+++ microVM.cpp
@@ -216,7 +216,7 @@
  */
 void execInstruction16 (const int opCode, ExecutionContext* ec)
 {
-    const int decoded = opCode & 0x3FF;
+    const int decoded = opCode & 0x3FFF;

     if (decoded >= OC16_PUSHC)
         execPushC16 (decoded, ec);


added: splitting of helix tubes

added: splitting of helix tubes

--- source/VIEW/MODELS/cartoonModel.C
+++ source/VIEW/MODELS/cartoonModel.C
@@ -1,7 +1,7 @@
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
-// $Id: cartoonModel.C,v 1.7 2003/10/18 11:08:26 amoll Exp $
+// $Id: cartoonModel.C,v 1.8 2003/11/09 22:38:04 amoll Exp $

 #include <BALL/VIEW/MODELS/cartoonModel.h>
 #include <BALL/VIEW/PRIMITIVES/tube.h>
@@ -14,6 +14,11 @@
 #include <BALL/KERNEL/forEach.h>
 #include <BALL/KERNEL/atom.h>
 #include <BALL/KERNEL/bond.h>
+
+/*
+#include <BALL/DATATYPE/hashGrid.h>
+#include <BALL/STRUCTURE/geometricProperties.h>
+*/

 using namespace std;

@@ -365,6 +370,7 @@
 		{
 			Atom* first = 0;
 			Atom* last = 0;
+			List<const Atom*> catoms;
 			AtomIterator it;
 			BALL_FOREACH_ATOM(ss, it)
 			{
@@ -372,34 +378,70 @@
 				{
 					if (!first) first = &*it;
 					last = &*it;
-				}
-			}
-
-			// build tube connection to the last point
-			Tube* tube = new Tube;
-			if (!tube) throw Exception::OutOfMemory (__FILE__, __LINE__, sizeof(Tube));
-
-			tube->setRadius(2.4);
-			tube->setVertex1(first->getPosition());
-			tube->setVertex2(last->getPosition());
-			tube->setComposite(&ss);
-			geometric_objects_.push_back(tube);
-
+					catoms.push_back(&*it);
+				}
+			}
+
+			if (catoms.size() == 0)
+			{
+				return;
+			}
+
+			List<const Atom*>::ConstIterator lit = catoms.begin();
+
+			/*
+			BoundingBoxProcessor boxp;
+			boxp.start();
+			for(;lit != catoms.end(); lit++)
+			{
+				boxp.operator() (*(Atom*)*lit);
+			}
+			boxp.finish();
+
+			Vector3 diagonal = boxp.getUpper() - boxp.getLower();
+			HashGrid3<const Atom*> grid(boxp.getLower() - Vector3(3.0, 3.0, 3.0),
+																	diagonal + Vector3(6.0, 6.0, 6.0),
+																	2.0);
+
+			for (lit = catoms.begin(); lit != catoms.end(); lit++)
+			{
+				grid.insert((*lit)->getPosition(), *lit);
+			}
+			*/
+			lit = catoms.begin();
+			lit++;
+			Vector3 normal = last->getPosition() - first->getPosition();
+			Vector3 last_pos = first->getPosition();
+			Tube* tube = 0;
+			for (Position p = 1; lit != catoms.end(); p++)
+			{
+				tube = new Tube;
+				tube->setRadius(2.4);
+				tube->setVertex1(last_pos);
+				last_pos += (normal / (catoms.size() -1));
+				tube->setVertex2(last_pos);
+				tube->setComposite(*lit);
+				geometric_objects_.push_back(tube);
+				lit++;
+			}
+
 			Disc* disc = new Disc( Circle3(first->getPosition(), Vector3(first->getPosition() - last->getPosition()), 2.4));
 			if (!disc) throw Exception::OutOfMemory (__FILE__, __LINE__, sizeof(Disc));
-			disc->setComposite(&ss);
+			disc->setComposite(first);
 			geometric_objects_.push_back(disc);

 			disc = new Disc(Circle3(last->getPosition(), Vector3(last->getPosition() - first->getPosition() ), 2.4));
 			if (!disc) throw Exception::OutOfMemory (__FILE__, __LINE__, sizeof(Disc));
-			disc->setComposite(&ss);
+			disc->setComposite(last);
 			geometric_objects_.push_back(disc);

 			Position p1=0, p2=0;
 			for (Position i=0; i<spline_vector_.size(); i++)
 			{
 				if (spline_vector_[i].getVector() == first->getPosition())
+				{
 					p1 = i;
+				}

 				if (spline_vector_[i].getVector() == last->getPosition())
 				{


Fix export to XML of integer filter

Fix export to XML of integer filter

git-svn-id: 7e36d3665aeca4d4e1f6df8911a80efc6ef565e7@2870 1f79f812-37fb-46fe-a122-30589dd2bf55

--- pwsafe/pwsafe/src/corelib/PWSFilters.cpp
+++ pwsafe/pwsafe/src/corelib/PWSFilters.cpp
@@ -99,9 +99,9 @@
                                               << "</warn>" << szendl;
       break;
     case PWSMatch::MT_INTEGER:
-      oss << sztab5 << "<num1>" << st_fldata.fcase
+      oss << sztab5 << "<num1>" << st_fldata.fnum1
                                               << "</num1>" << endl;
-      oss << sztab5 << "<num2>" << st_fldata.fcase
+      oss << sztab5 << "<num2>" << st_fldata.fnum2
                                               << "</num2>" << endl;
       break;
     case PWSMatch::MT_DATE:


Fixed timer

Fixed timer

--- src/DollhousePanel.cpp
+++ src/DollhousePanel.cpp
@@ -88,7 +88,7 @@
 int currentMode = OFF_MODE;

 int debounceDelay = 150;
-long timeDebounce = 0;
+long timerDebounce = 0;

 void setup() {
   // Fire up the LCD display
@@ -358,7 +358,7 @@
     return false;
   }

-  if (timerIsExpired(timerDebounce, debounceDelay)) {
+  if (isTimerExpired(timerDebounce, debounceDelay)) {
     clearTimer(timerDebounce);
     startTimer(timerDebounce);
     return false;


When AST-dumping the ObjCBoxedExpr node, also print out what selector it chose.

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

--- lib/AST/StmtDumper.cpp
+++ lib/AST/StmtDumper.cpp
@@ -166,6 +166,7 @@
     void VisitObjCAtCatchStmt(ObjCAtCatchStmt *Node);
     void VisitObjCEncodeExpr(ObjCEncodeExpr *Node);
     void VisitObjCMessageExpr(ObjCMessageExpr* Node);
+    void VisitObjCBoxedExpr(ObjCBoxedExpr* Node);
     void VisitObjCSelectorExpr(ObjCSelectorExpr *Node);
     void VisitObjCProtocolExpr(ObjCProtocolExpr *Node);
     void VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *Node);
@@ -637,6 +638,11 @@
   }
 }

+void StmtDumper::VisitObjCBoxedExpr(ObjCBoxedExpr* Node) {
+  DumpExpr(Node);
+  OS << " selector=" << Node->getBoxingMethod()->getSelector().getAsString();
+}
+
 void StmtDumper::VisitObjCAtCatchStmt(ObjCAtCatchStmt *Node) {
   DumpStmt(Node);
   if (VarDecl *CatchParam = Node->getCatchParamDecl()) {


Zero-initialize image buffers.

Zero-initialize image buffers.

--- source/detail/ImageImpl.cpp
+++ source/detail/ImageImpl.cpp
@@ -46,9 +46,11 @@
         PixelFormatDescriptor pfd = GetPixelFormatDescriptor(pf);

         _pixels = new u8[width * height * pfd.bytesPerPixel];
+        std::memset(_pixels, 0x00, width * height * pfd.bytesPerPixel);

         if (!pfd.isDirectColor) {
             _palette = new RGB[256];
+            std::memset(_palette, 0x00, 256 * sizeof(RGB));
         }
     }


removed old robot status text - its now in the status list

#242

--- soccer/Robot.cpp
+++ soccer/Robot.cpp
@@ -102,8 +102,6 @@

 void OurRobot::addStatusText()
 {
-	static const char *motorNames[] = {"BL", "FL", "FR", "BR", "DR"};
-
 	const QColor statusColor(255, 32, 32);

 	if (!rxIsFresh())
@@ -112,56 +110,6 @@

 		// No more status is available
 		return;
-	}
-
-	// Motor status
-	if (_radioRx.motor_status().size() == 5)
-	{
-		for (int i = 0; i < 5; ++i)
-		{
-			QString error;
-			switch (_radioRx.motor_status(i))
-			{
-				case Packet::Hall_Failure:
-					error = "Hall fault";
-					break;
-
-				case Packet::Stalled:
-					error = "Stall";
-					break;
-
-				case Packet::Encoder_Failure:
-					error = "Encoder fault";
-					break;
-
-				default:
-					break;
-			}
-
-			if (!error.isNull())
-			{
-				addText(QString("%1: %2").arg(error, QString(motorNames[i])), statusColor, "Status");
-			}
-		}
-	}
-
-	if (!ballSenseWorks())
-	{
-		addText("Ball sense fault", statusColor, "Status");
-	}
-
-	if (!kickerWorks() && false)
-	{
-		addText("Kicker fault", statusColor, "Status");
-	}
-
-	if (_radioRx.has_battery())
-	{
-		float battery = _radioRx.battery();
-		if (battery <= 14.3f)
-		{
-			addText(QString("Low battery: %1V").arg(battery, 0, 'f', 1), statusColor, "Status");
-		}
 	}
 }


casting to xs:untypedAtomic bug fix

casting to xs:untypedAtomic bug fix

darcs-hash:20060913133248-10a17-5df4c94fffba46908351d7c1403b297f38a3d652.gz

--- kernel/tr/executor/fo/casting_operations.cpp
+++ kernel/tr/executor/fo/casting_operations.cpp
@@ -75,46 +75,46 @@

 /******************************************************************************/

-inline tuple_cell cast_xs_float_to_string_type(const tuple_cell &c)
+inline tuple_cell cast_xs_float_to_string_type(const tuple_cell &c, xmlscm_type res_type)
 {
     get_xs_double_lexical_representation(tr_globals::mem_str_buf, (double)c.get_xs_float());
-    return tuple_cell::atomic_deep(xs_string, tr_globals::mem_str_buf);
-}
-
-inline tuple_cell cast_xs_double_to_string_type(const tuple_cell &c)
+    return tuple_cell::atomic_deep(res_type, tr_globals::mem_str_buf);
+}
+
+inline tuple_cell cast_xs_double_to_string_type(const tuple_cell &c, xmlscm_type res_type)
 {
     get_xs_double_lexical_representation(tr_globals::mem_str_buf, c.get_xs_double());
-    return tuple_cell::atomic_deep(xs_string, tr_globals::mem_str_buf);
-}
-
-inline tuple_cell cast_xs_decimal_to_string_type(const tuple_cell &c)
+    return tuple_cell::atomic_deep(res_type, tr_globals::mem_str_buf);
+}
+
+inline tuple_cell cast_xs_decimal_to_string_type(const tuple_cell &c, xmlscm_type res_type)
 {
     c.get_xs_decimal().get_c_str(tr_globals::mem_str_buf);
-    return tuple_cell::atomic_deep(xs_string, tr_globals::mem_str_buf);
-}
-
-inline tuple_cell cast_xs_integer_to_string_type(const tuple_cell &c)
+    return tuple_cell::atomic_deep(res_type, tr_globals::mem_str_buf);
+}
+
+inline tuple_cell cast_xs_integer_to_string_type(const tuple_cell &c, xmlscm_type res_type)
 {
     get_xs_integer_lexical_representation(tr_globals::mem_str_buf, c.get_xs_integer());
-    return tuple_cell::atomic_deep(xs_string, tr_globals::mem_str_buf);
-}
-
-inline tuple_cell cast_xs_dateTime_to_string_type(const tuple_cell &c, xmlscm_type xtype)
+    return tuple_cell::atomic_deep(res_type, tr_globals::mem_str_buf);
+}
+
+inline tuple_cell cast_xs_dateTime_to_string_type(const tuple_cell &c, xmlscm_type xtype, xmlscm_type res_type)
 {
     get_xs_dateTime_lexical_representation(tr_globals::mem_str_buf, c.get_xs_dateTime(), xtype);
-    return tuple_cell::atomic_deep(xs_string, tr_globals::mem_str_buf);
-}
-
-inline tuple_cell cast_xs_boolean_to_string_type(const tuple_cell &c)
+    return tuple_cell::atomic_deep(res_type, tr_globals::mem_str_buf);
+}
+
+inline tuple_cell cast_xs_boolean_to_string_type(const tuple_cell &c, xmlscm_type res_type)
 {
     get_xs_boolean_lexical_representation(tr_globals::mem_str_buf, c.get_xs_boolean());
-    return tuple_cell::atomic_deep(xs_string, tr_globals::mem_str_buf);
-}
-
-inline tuple_cell cast_xs_anyURI_to_string_type(const tuple_cell &c)
+    return tuple_cell::atomic_deep(res_type, tr_globals::mem_str_buf);
+}
+
+inline tuple_cell cast_xs_anyURI_to_string_type(const tuple_cell &c, xmlscm_type res_type)
 { // !!! FIX ME: some conversion needed
     tuple_cell res(c);
-    res.set_xtype(xs_string);
+    res.set_xtype(res_type);
     return res;
 }

@@ -161,29 +161,29 @@
                                       res.set_xtype(xs_untypedAtomic);
                                       return res;
                                   }
-        case xs_float			: return cast_xs_float_to_string_type(c);
-        case xs_double			: return cast_xs_double_to_string_type(c);
-        case xs_decimal			: return cast_xs_decimal_to_string_type(c);
-        case xs_integer 		: return cast_xs_integer_to_string_type(c);
-        case xs_duration		: return cast_xs_dateTime_to_string_type(c, xs_duration);
-        case xs_yearMonthDuration:return cast_xs_dateTime_to_string_type(c, xs_yearMonthDuration);
-        case xs_dayTimeDuration	: return cast_xs_dateTime_to_string_type(c, xs_dayTimeDuration);
-        case xs_dateTime		: return cast_xs_dateTime_to_string_type(c, xs_dateTime);
-        case xs_time			: return cast_xs_dateTime_to_string_type(c, xs_time);
-        case xs_date			: return cast_xs_dateTime_to_string_type(c, xs_date);
-        case xs_gYearMonth		: return cast_xs_dateTime_to_string_type(c, xs_gYearMonth);
-        case xs_gYear			: return cast_xs_dateTime_to_string_type(c, xs_gYear);
-        case xs_gMonthDay		: return cast_xs_dateTime_to_string_type(c, xs_gMonthDay);
-        case xs_gDay			: return cast_xs_dateTime_to_string_type(c, xs_gDay);
-        case xs_gMonth			: return cast_xs_dateTime_to_string_type(c, xs_gMonth);
-        case xs_boolean			: return cast_xs_boolean_to_string_type(c);
+        case xs_float			: return cast_xs_float_to_string_type(c, xs_untypedAtomic);
+        case xs_double			: return cast_xs_double_to_string_type(c, xs_untypedAtomic);
+        case xs_decimal			: return cast_xs_decimal_to_string_type(c, xs_untypedAtomic);
+        case xs_integer 		: return cast_xs_integer_to_string_type(c, xs_untypedAtomic);
+        case xs_duration		: return cast_xs_dateTime_to_string_type(c, xs_duration, xs_untypedAtomic);
+        case xs_yearMonthDuration:return cast_xs_dateTime_to_string_type(c, xs_yearMonthDuration, xs_untypedAtomic);
+        case xs_dayTimeDuration	: return cast_xs_dateTime_to_string_type(c, xs_dayTimeDuration, xs_untypedAtomic);
+        case xs_dateTime		: return cast_xs_dateTime_to_string_type(c, xs_dateTime, xs_untypedAtomic);
+        case xs_time			: return cast_xs_dateTime_to_string_type(c, xs_time, xs_untypedAtomic);
+        case xs_date			: return cast_xs_dateTime_to_string_type(c, xs_date, xs_untypedAtomic);
+        case xs_gYearMonth		: return cast_xs_dateTime_to_string_type(c, xs_gYearMonth, xs_untypedAtomic);
+        case xs_gYear			: return cast_xs_dateTime_to_string_type(c, xs_gYear, xs_untypedAtomic);
+        case xs_gMonthDay		: return cast_xs_dateTime_to_string_type(c, xs_gMonthDay, xs_untypedAtomic);
+        case xs_gDay			: return cast_xs_dateTime_to_string_type(c, xs_gDay, xs_untypedAtomic);
+        case xs_gMonth			: return cast_xs_dateTime_to_string_type(c, xs_gMonth, xs_untypedAtomic);
+        case xs_boolean			: return cast_xs_boolean_to_string_type(c, xs_untypedAtomic);
         case xs_base64Binary	:
         case xs_hexBinary		: {
                                       tuple_cell res(c);
                                       res.set_xtype(xs_untypedAtomic);
                                       return res;
                                   }
-        case xs_anyURI			: return cast_xs_anyURI_to_string_type(c);
+        case xs_anyURI			: return cast_xs_anyURI_to_string_type(c, xs_untypedAtomic);
         default                 : return _cast_is_not_supported(c.get_atomic_type(), xs_untypedAtomic);
     }
 }
@@ -200,29 +200,29 @@
                                       return res;
                                   }
         case xs_string			: return c;
-        case xs_float			: return cast_xs_float_to_string_type(c);
-        case xs_double			: return cast_xs_double_to_string_type(c);
-        case xs_decimal			: return cast_xs_decimal_to_string_type(c);
-        case xs_integer 		: return cast_xs_integer_to_string_type(c);
-        case xs_duration		: return cast_xs_dateTime_to_string_type(c, xs_duration);
-        case xs_yearMonthDuration:return cast_xs_dateTime_to_string_type(c, xs_yearMonthDuration);
-        case xs_dayTimeDuration	: return cast_xs_dateTime_to_string_type(c, xs_dayTimeDuration);
-        case xs_dateTime		: return cast_xs_dateTime_to_string_type(c, xs_dateTime);
-        case xs_time			: return cast_xs_dateTime_to_string_type(c, xs_time);
-        case xs_date			: return cast_xs_dateTime_to_string_type(c, xs_date);
-        case xs_gYearMonth		: return cast_xs_dateTime_to_string_type(c, xs_gYearMonth);
-        case xs_gYear			: return cast_xs_dateTime_to_string_type(c, xs_gYear);
-        case xs_gMonthDay		: return cast_xs_dateTime_to_string_type(c, xs_gMonthDay);
-        case xs_gDay			: return cast_xs_dateTime_to_string_type(c, xs_gDay);
-        case xs_gMonth			: return cast_xs_dateTime_to_string_type(c, xs_gMonth);
-        case xs_boolean			: return cast_xs_boolean_to_string_type(c);
+        case xs_float			: return cast_xs_float_to_string_type(c, xs_string);
+        case xs_double			: return cast_xs_double_to_string_type(c, xs_string);
+        case xs_decimal			: return cast_xs_decimal_to_string_type(c, xs_string);
+        case xs_integer 		: return cast_xs_integer_to_string_type(c, xs_string);
+        case xs_duration		: return cast_xs_dateTime_to_string_type(c, xs_duration, xs_string);
+        case xs_yearMonthDuration:return cast_xs_dateTime_to_string_type(c, xs_yearMonthDuration, xs_string);
+        case xs_dayTimeDuration	: return cast_xs_dateTime_to_string_type(c, xs_dayTimeDuration, xs_string);
+        case xs_dateTime		: return cast_xs_dateTime_to_string_type(c, xs_dateTime, xs_string);
+        case xs_time			: return cast_xs_dateTime_to_string_type(c, xs_time, xs_string);
+        case xs_date			: return cast_xs_dateTime_to_string_type(c, xs_date, xs_string);
+        case xs_gYearMonth		: return cast_xs_dateTime_to_string_type(c, xs_gYearMonth, xs_string);
+        case xs_gYear			: return cast_xs_dateTime_to_string_type(c, xs_gYear, xs_string);
+        case xs_gMonthDay		: return cast_xs_dateTime_to_string_type(c, xs_gMonthDay, xs_string);
+        case xs_gDay			: return cast_xs_dateTime_to_string_type(c, xs_gDay, xs_string);
+        case xs_gMonth			: return cast_xs_dateTime_to_string_type(c, xs_gMonth, xs_string);
+        case xs_boolean			: return cast_xs_boolean_to_string_type(c, xs_string);
         case xs_base64Binary	:
         case xs_hexBinary		: {
                                       tuple_cell res(c);
                                       res.set_xtype(xs_string);
                                       return res;
                                   }
-        case xs_anyURI			: return cast_xs_anyURI_to_string_type(c);
+        case xs_anyURI			: return cast_xs_anyURI_to_string_type(c, xs_string);
         case xs_QName			: { // !!! FIX ME: don't know what to do
                                       tuple_cell res(c);
                                       res.set_xtype(xs_string);
@@ -578,6 +578,7 @@
     else if (base_type == xs_string)
     {
         // !!! Fix me: check constraints
+        sat = true;
     }

     if (!sat) throw USER_EXCEPTION2(FORG0001, "The value does not conform to the facets defined for the target type");


TesterDriver bugfix: src-dest in copy switched places

--- platform-wrapper/regdriver/testerdriver.hpp
+++ platform-wrapper/regdriver/testerdriver.hpp
@@ -59,7 +59,7 @@
     __TESTERDRIVER_DEBUG("accel2host(" << accelBufBase << " -> " << (uint64_t) hostBuffer << " : " << numBytes << " bytes)");

     if((numBytes % 8 == 0) && (accelBufBase % 8 == 0))
-      alignedCopyBufferAccelToHost(hostBuffer, accelBuffer, numBytes);
+      alignedCopyBufferAccelToHost(accelBuffer, hostBuffer, numBytes);
     else {
       // implement unaligned accel-to-host
       // align base and size


Fix Abuhops client not PINGing.

Fix Abuhops client not PINGing.

--- src/net/abuhops.cxx
+++ src/net/abuhops.cxx
@@ -247,7 +247,7 @@
       //Move to non-connecting state if both IP versions we support are
       //connected
       if ((!hasv4 || isConnected4) && (!hasv6 || isConnected6))
-        isConnecting = true;
+        isConnecting = false;
       //Otherwise, retransmit connect packet if necessary
       else if (timeUntilConnectXmit <= et)
         sendConnectPacket();
@@ -258,6 +258,7 @@
       if (timeUntilPing < et) {
         bool whoAmI = (hasv4 && !knowIpv4Address) ||
                       (hasv6 && !knowIpv6Address);
+        debug(">> PING " << whoAmI);
         byte pack[2] = { PING, (byte)whoAmI };
         if (hasv4)
           antenna.send(server4, pack, 2);


Do not clear host ID.

Do not clear host ID.

--- source/host/user_session.cc
+++ source/host/user_session.cc
@@ -883,7 +883,6 @@
         client->stop();

     setState(FROM_HERE, State::DETTACHED);
-    host_id_ = base::kInvalidHostId;

     delegate_->onUserSessionDettached();


Add more debug when finding token

Add more debug when finding token

--- source/m2mnsdlinterface.cpp
+++ source/m2mnsdlinterface.cpp
@@ -1147,9 +1147,11 @@
                     break;
                 }
             } else {
+                tr_debug("M2MNsdlInterface::find_resource(object level) - in token (%.*s)", token_len, token);
                 uint8_t *stored_token = 0;
                 uint32_t stored_token_length = 0;
                 (*it)->get_observation_token(stored_token, stored_token_length);
+                tr_debug("M2MNsdlInterface::find_resource(object level) - stored token (%.*s)", stored_token_length, stored_token);
                 if (stored_token) {
                     if (stored_token_length == token_len &&
                             memcmp(token, stored_token, token_len) == 0) {
@@ -1196,7 +1198,9 @@
                 } else {
                     uint8_t *stored_token = 0;
                     uint32_t stored_token_length = 0;
+                    tr_debug("M2MNsdlInterface::find_resource(object instance level) - in token (%.*s)", token_len, token);
                     (*it)->get_observation_token(stored_token, stored_token_length);
+                    tr_debug("M2MNsdlInterface::find_resource(object instance level) - stored token (%.*s)", stored_token_length, stored_token);
                     if (stored_token) {
                         if (stored_token_length == token_len &&
                                 memcmp(token, stored_token, token_len) == 0) {
@@ -1250,7 +1254,9 @@
                 } else {
                     uint8_t *stored_token = 0;
                     uint32_t stored_token_length = 0;
+                    tr_debug("M2MNsdlInterface::find_resource(resource level) - in token (%.*s)", token_len, token);
                     (*it)->get_observation_token(stored_token, stored_token_length);
+                    tr_debug("M2MNsdlInterface::find_resource(resource level) - stored token (%.*s)", stored_token_length, stored_token);
                     if (stored_token) {
                         if (stored_token_length == token_len &&
                                 memcmp(token, stored_token, token_len) == 0) {


Fix coverity issues on m2mreporthandler

Fix coverity issues on m2mreporthandler

--- source/m2mreporthandler.cpp
+++ source/m2mreporthandler.cpp
@@ -331,7 +331,7 @@
             _pmin_exceeded = true;
         } else {
             _pmin_exceeded = false;
-            time_interval = static_cast<uint64_t>(_pmin * 1000);
+            time_interval = (uint64_t) ((uint64_t)_pmin * 1000);
             tr_debug("M2MReportHandler::handle_timers() - Start PMIN interval: %d", (int)time_interval);
             if (!_pmin_timer) {
                 _pmin_timer = new M2MTimer(*this);
@@ -346,7 +346,7 @@
             if (!_pmax_timer) {
                 _pmax_timer = new M2MTimer(*this);
             }
-            time_interval = static_cast<uint64_t>(_pmax * 1000);
+            time_interval = (uint64_t) ((uint64_t)_pmax * 1000);
             tr_debug("M2MReportHandler::handle_timers() - Start PMAX interval: %d", (int)time_interval);
             _pmax_timer->start_timer(time_interval,
                                      M2MTimerObserver::PMaxTimer,


georef : Ajout des edges au ways

georef : Ajout des edges au ways

--- source/naviMake/osm2nav.cpp
+++ source/naviMake/osm2nav.cpp
@@ -154,10 +154,14 @@
                         georef::Edge e;
                         e.length = length;
                         e.way_idx = w.idx;
+
                         e.cyclable = w.properties[CYCLE_FWD];
                         boost::add_edge(source, target, e, geo_ref.graph);
+                        geo_ref.ways[w.idx].edges.push_back(std::make_pair(source, target));
+
                         e.cyclable = w.properties[CYCLE_BWD];
                         boost::add_edge(target, source, e, geo_ref.graph);
+                        geo_ref.ways[w.idx].edges.push_back(std::make_pair(target, source));
                         source = target;
                         length = 0;
                     }


[nostalgia/core/gba] Cleanup class/struct inconsistency

--- src/nostalgia/core/gba/mem.cpp
+++ src/nostalgia/core/gba/mem.cpp
@@ -23,9 +23,9 @@

 namespace nostalgia::core {

-static class HeapSegment *volatile g_heapBegin = nullptr;
-static class HeapSegment *volatile g_heapEnd = nullptr;
-static class HeapSegment *volatile heapIdx = nullptr;
+static struct HeapSegment *volatile g_heapBegin = nullptr;
+static struct HeapSegment *volatile g_heapEnd = nullptr;
+static struct HeapSegment *volatile heapIdx = nullptr;

 static constexpr std::size_t alignedSize(std::size_t sz) {
 	return sz + (sz & 7);


Generalize the conversion to unsigned int.

	* src/object/cxx-conversion.hxx: Generalize the prio_type
	conversion to unsigned int.

--- src/object/cxx-conversions.hxx
+++ src/object/cxx-conversions.hxx
@@ -50,23 +50,19 @@
     }
   };

-  // Conversion with prio_type
+  // Conversion with unsigned int
   template<>
-  struct CxxConvert<scheduler::prio_type>
+  struct CxxConvert<unsigned int>
   {
-    static scheduler::prio_type
+    static unsigned int
     to(const rObject& o, const libport::Symbol& name)
       {
 	type_check<Float>(o, name);
-	rFloat f = o->as<Float>();
-	int res = f->to_int(name);
-	if (res < 0)
-	  throw BadInteger(f->value_get(), name);
-	return res;
+	return o->as<Float>()->to_unsigned_int(name);
       }

     static rObject
-    from(const scheduler::prio_type& v, const libport::Symbol&)
+    from(const unsigned int& v, const libport::Symbol&)
       {
 	return new Float(v);
       }


random tidying

random tidying

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

--- lib/CodeGen/CGExpr.cpp
+++ lib/CodeGen/CGExpr.cpp
@@ -84,10 +84,9 @@
   if (const CXXExprWithTemporaries *TE = dyn_cast<CXXExprWithTemporaries>(E)) {
     ShouldDestroyTemporaries = TE->shouldDestroyTemporaries();

-    if (ShouldDestroyTemporaries) {
-      // Keep track of the current cleanup stack depth.
+    // Keep track of the current cleanup stack depth.
+    if (ShouldDestroyTemporaries)
       OldNumLiveTemporaries = LiveTemporaries.size();
-    }

     E = TE->getSubExpr();
   }
@@ -148,7 +147,6 @@
     // Check if need to perform the derived-to-base cast.
     if (BaseClassDecl) {
       llvm::Value *Derived = Val.getAggregateAddr();
-
       llvm::Value *Base =
         GetAddressCXXOfBaseClass(Derived, DerivedClassDecl, BaseClassDecl,
                                  /*NullCheckValue=*/false);
@@ -189,18 +187,21 @@
 //===----------------------------------------------------------------------===//

 RValue CodeGenFunction::GetUndefRValue(QualType Ty) {
-  if (Ty->isVoidType()) {
+  if (Ty->isVoidType())
     return RValue::get(0);
-  } else if (const ComplexType *CTy = Ty->getAs<ComplexType>()) {
+
+  if (const ComplexType *CTy = Ty->getAs<ComplexType>()) {
     const llvm::Type *EltTy = ConvertType(CTy->getElementType());
     llvm::Value *U = llvm::UndefValue::get(EltTy);
     return RValue::getComplex(std::make_pair(U, U));
-  } else if (hasAggregateLLVMType(Ty)) {
+  }
+
+  if (hasAggregateLLVMType(Ty)) {
     const llvm::Type *LTy = llvm::PointerType::getUnqual(ConvertType(Ty));
     return RValue::getAggregate(llvm::UndefValue::get(LTy));
-  } else {
-    return RValue::get(llvm::UndefValue::get(ConvertType(Ty)));
-  }
+  }
+
+  return RValue::get(llvm::UndefValue::get(ConvertType(Ty)));
 }

 RValue CodeGenFunction::EmitUnsupportedRValue(const Expr *E,
@@ -342,9 +343,8 @@
   if (LV.isObjCWeak()) {
     // load of a __weak object.
     llvm::Value *AddrWeakObj = LV.getAddress();
-    llvm::Value *read_weak = CGM.getObjCRuntime().EmitObjCWeakRead(*this,
-                                                                   AddrWeakObj);
-    return RValue::get(read_weak);
+    return RValue::get(CGM.getObjCRuntime().EmitObjCWeakRead(*this,
+                                                             AddrWeakObj));
   }

   if (LV.isSimple()) {
@@ -521,10 +521,8 @@
     if (Dst.isPropertyRef())
       return EmitStoreThroughPropertyRefLValue(Src, Dst, Ty);

-    if (Dst.isKVCRef())
-      return EmitStoreThroughKVCRefLValue(Src, Dst, Ty);
-
-    assert(0 && "Unknown LValue type");
+    assert(Dst.isKVCRef() && "Unknown LValue type");
+    return EmitStoreThroughKVCRefLValue(Src, Dst, Ty);
   }

   if (Dst.isObjCWeak() && !Dst.isNonGC()) {
@@ -550,8 +548,7 @@
       llvm::Value *BytesBetween = Builder.CreateSub(LHS, RHS, "ivar.offset");
       CGM.getObjCRuntime().EmitObjCIvarAssign(*this, src, dst,
                                               BytesBetween);
-    }
-    else if (Dst.isGlobalObjCRef())
+    } else if (Dst.isGlobalObjCRef())
       CGM.getObjCRuntime().EmitObjCGlobalAssign(*this, src, LvalueDst);
     else
       CGM.getObjCRuntime().EmitObjCStrongCastAssign(*this, src, LvalueDst);
@@ -701,13 +698,12 @@
       // FIXME: since we're shuffling with undef, can we just use the indices
       //        into that?  This could be simpler.
       llvm::SmallVector<llvm::Constant*, 4> ExtMask;
+      const llvm::Type *Int32Ty = llvm::Type::getInt32Ty(VMContext);
       unsigned i;
       for (i = 0; i != NumSrcElts; ++i)
-        ExtMask.push_back(llvm::ConstantInt::get(
-                                         llvm::Type::getInt32Ty(VMContext), i));
+        ExtMask.push_back(llvm::ConstantInt::get(Int32Ty, i));
       for (; i != NumDstElts; ++i)
-        ExtMask.push_back(llvm::UndefValue::get(
-                                            llvm::Type::getInt32Ty(VMContext)));
+        ExtMask.push_back(llvm::UndefValue::get(Int32Ty));
       llvm::Value *ExtMaskV = llvm::ConstantVector::get(&ExtMask[0],
                                                         ExtMask.size());
       llvm::Value *ExtSrcVal =
@@ -716,15 +712,13 @@
                                     ExtMaskV, "tmp");
       // build identity
       llvm::SmallVector<llvm::Constant*, 4> Mask;
-      for (unsigned i = 0; i != NumDstElts; ++i) {
-        Mask.push_back(llvm::ConstantInt::get(
-                                        llvm::Type::getInt32Ty(VMContext), i));
-      }
+      for (unsigned i = 0; i != NumDstElts; ++i)
+        Mask.push_back(llvm::ConstantInt::get(Int32Ty, i));
+
       // modify when what gets shuffled in
       for (unsigned i = 0; i != NumSrcElts; ++i) {
         unsigned Idx = getAccessedFieldNo(i, Elts);
-        Mask[Idx] = llvm::ConstantInt::get(
-                               llvm::Type::getInt32Ty(VMContext), i+NumDstElts);
+        Mask[Idx] = llvm::ConstantInt::get(Int32Ty, i+NumDstElts);
       }
       llvm::Value *MaskV = llvm::ConstantVector::get(&Mask[0], Mask.size());
       Vec = Builder.CreateShuffleVector(Vec, ExtSrcVal, MaskV, "tmp");
@@ -735,8 +729,8 @@
   } else {
     // If the Src is a scalar (not a vector) it must be updating one element.
     unsigned InIdx = getAccessedFieldNo(0, Elts);
-    llvm::Value *Elt = llvm::ConstantInt::get(
-                                      llvm::Type::getInt32Ty(VMContext), InIdx);
+    const llvm::Type *Int32Ty = llvm::Type::getInt32Ty(VMContext);
+    llvm::Value *Elt = llvm::ConstantInt::get(Int32Ty, InIdx);
     Vec = Builder.CreateInsertElement(Vec, SrcVal, Elt, "tmp");
   }

@@ -746,8 +740,8 @@
 // setObjCGCLValueClass - sets class of he lvalue for the purpose of
 // generating write-barries API. It is currently a global, ivar,
 // or neither.
-static
-void setObjCGCLValueClass(const ASTContext &Ctx, const Expr *E, LValue &LV) {
+static void setObjCGCLValueClass(const ASTContext &Ctx, const Expr *E,
+                                 LValue &LV) {
   if (Ctx.getLangOptions().getGCMode() == LangOptions::NonGC)
     return;

@@ -758,6 +752,7 @@
     LV.SetObjCArray(LV, E->getType()->isArrayType());
     return;
   }
+
   if (const DeclRefExpr *Exp = dyn_cast<DeclRefExpr>(E)) {
     if (const VarDecl *VD = dyn_cast<VarDecl>(Exp->getDecl())) {
       if ((VD->isBlockVarDecl() && !VD->hasLocalStorage()) ||
@@ -765,10 +760,15 @@
         LV.SetGlobalObjCRef(LV, true);
     }
     LV.SetObjCArray(LV, E->getType()->isArrayType());
-  }
-  else if (const UnaryOperator *Exp = dyn_cast<UnaryOperator>(E))
+    return;
+  }
+
+  if (const UnaryOperator *Exp = dyn_cast<UnaryOperator>(E)) {
     setObjCGCLValueClass(Ctx, Exp->getSubExpr(), LV);
-  else if (const ParenExpr *Exp = dyn_cast<ParenExpr>(E)) {
+    return;
+  }
+
+  if (const ParenExpr *Exp = dyn_cast<ParenExpr>(E)) {
     setObjCGCLValueClass(Ctx, Exp->getSubExpr(), LV);
     if (LV.isObjCIvar()) {
       // If cast is to a structure pointer, follow gcc's behavior and make it
@@ -778,13 +778,20 @@
         ExpTy = ExpTy->getAs<PointerType>()->getPointeeType();
       if (ExpTy->isRecordType())
         LV.SetObjCIvar(LV, false);
-    }
-  }
-  else if (const ImplicitCastExpr *Exp = dyn_cast<ImplicitCastExpr>(E))
+    }
+    return;
+  }
+  if (const ImplicitCastExpr *Exp = dyn_cast<ImplicitCastExpr>(E)) {
     setObjCGCLValueClass(Ctx, Exp->getSubExpr(), LV);
-  else if (const CStyleCastExpr *Exp = dyn_cast<CStyleCastExpr>(E))
+    return;
+  }
+
+  if (const CStyleCastExpr *Exp = dyn_cast<CStyleCastExpr>(E)) {
     setObjCGCLValueClass(Ctx, Exp->getSubExpr(), LV);
-  else if (const ArraySubscriptExpr *Exp = dyn_cast<ArraySubscriptExpr>(E)) {
+    return;
+  }
+
+  if (const ArraySubscriptExpr *Exp = dyn_cast<ArraySubscriptExpr>(E)) {
     setObjCGCLValueClass(Ctx, Exp->getBase(), LV);
     if (LV.isObjCIvar() && !LV.isObjCArray())
       // Using array syntax to assigning to what an ivar points to is not
@@ -794,12 +801,15 @@
       // Using array syntax to assigning to what global points to is not
       // same as assigning to the global itself. {id *G;} G[i] = 0;
       LV.SetGlobalObjCRef(LV, false);
-  }
-  else if (const MemberExpr *Exp = dyn_cast<MemberExpr>(E)) {
+    return;
+  }
+
+  if (const MemberExpr *Exp = dyn_cast<MemberExpr>(E)) {
     setObjCGCLValueClass(Ctx, Exp->getBase(), LV);
     // We don't know if member is an 'ivar', but this flag is looked at
     // only in the context of LV.isObjCIvar().
     LV.SetObjCArray(LV, E->getType()->isArrayType());
+    return;
   }
 }

@@ -838,14 +848,18 @@
     LValue::SetObjCNonGC(LV, NonGCable);
     setObjCGCLValueClass(getContext(), E, LV);
     return LV;
-  } else if (VD && VD->isFileVarDecl()) {
+  }
+
+  if (VD && VD->isFileVarDecl()) {
     llvm::Value *V = CGM.GetAddrOfGlobalVar(VD);
     if (VD->getType()->isReferenceType())
       V = Builder.CreateLoad(V, "tmp");
     LValue LV = LValue::MakeAddr(V, MakeQualifiers(E->getType()));
     setObjCGCLValueClass(getContext(), E, LV);
     return LV;
-  } else if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(E->getDecl())) {
+  }
+
+  if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(E->getDecl())) {
     llvm::Value* V = CGM.GetAddrOfFunction(FD);
     if (!FD->hasPrototype()) {
       if (const FunctionProtoType *Proto =
@@ -860,15 +874,19 @@
       }
     }
     return LValue::MakeAddr(V, MakeQualifiers(E->getType()));
-  } else if (const ImplicitParamDecl *IPD =
-      dyn_cast<ImplicitParamDecl>(E->getDecl())) {
+  }
+
+  if (const ImplicitParamDecl *IPD = dyn_cast<ImplicitParamDecl>(E->getDecl())){
     llvm::Value *V = LocalDeclMap[IPD];
     assert(V && "BlockVarDecl not entered in LocalDeclMap?");
     return LValue::MakeAddr(V, MakeQualifiers(E->getType()));
-  } else if (E->getQualifier()) {
+  }
+
+  if (E->getQualifier()) {
     // FIXME: the qualifier check does not seem sufficient here
     return EmitPointerToDataMemberLValue(E);
   }
+
   assert(0 && "Unimp declref");
   //an invalid LValue, but the assert will
   //ensure that this point is never reached.
@@ -887,25 +905,24 @@
   QualType ExprTy = getContext().getCanonicalType(E->getSubExpr()->getType());
   switch (E->getOpcode()) {
   default: assert(0 && "Unknown unary operator lvalue!");
-  case UnaryOperator::Deref:
-    {
-      QualType T = E->getSubExpr()->getType()->getPointeeType();
-      assert(!T.isNull() && "CodeGenFunction::EmitUnaryOpLValue: Illegal type");
-
-      Qualifiers Quals = MakeQualifiers(T);
-      Quals.setAddressSpace(ExprTy.getAddressSpace());
-
-      LValue LV = LValue::MakeAddr(EmitScalarExpr(E->getSubExpr()), Quals);
-     // We should not generate __weak write barrier on indirect reference
-     // of a pointer to object; as in void foo (__weak id *param); *param = 0;
-     // But, we continue to generate __strong write barrier on indirect write
-     // into a pointer to object.
-     if (getContext().getLangOptions().ObjC1 &&
-         getContext().getLangOptions().getGCMode() != LangOptions::NonGC &&
-         LV.isObjCWeak())
-       LValue::SetObjCNonGC(LV, !E->isOBJCGCCandidate(getContext()));
-     return LV;
-    }
+  case UnaryOperator::Deref: {
+    QualType T = E->getSubExpr()->getType()->getPointeeType();
+    assert(!T.isNull() && "CodeGenFunction::EmitUnaryOpLValue: Illegal type");
+
+    Qualifiers Quals = MakeQualifiers(T);
+    Quals.setAddressSpace(ExprTy.getAddressSpace());
+
+    LValue LV = LValue::MakeAddr(EmitScalarExpr(E->getSubExpr()), Quals);
+    // We should not generate __weak write barrier on indirect reference
+    // of a pointer to object; as in void foo (__weak id *param); *param = 0;
+    // But, we continue to generate __strong write barrier on indirect write
+    // into a pointer to object.
+    if (getContext().getLangOptions().ObjC1 &&
+        getContext().getLangOptions().getGCMode() != LangOptions::NonGC &&
+        LV.isObjCWeak())
+      LValue::SetObjCNonGC(LV, !E->isOBJCGCCandidate(getContext()));
+    return LV;
+  }
   case UnaryOperator::Real:
   case UnaryOperator::Imag:
     LValue LV = EmitLValue(E->getSubExpr());
@@ -931,8 +948,7 @@
   std::string GlobalVarName;

   switch (Type) {
-  default:
-    assert(0 && "Invalid type");
+  default: assert(0 && "Invalid type");
   case PredefinedExpr::Func:
     GlobalVarName = "__func__.";
     break;
@@ -1210,13 +1226,12 @@
   const Expr* InitExpr = E->getInitializer();
   LValue Result = LValue::MakeAddr(DeclPtr, MakeQualifiers(E->getType()));

-  if (E->getType()->isComplexType()) {
+  if (E->getType()->isComplexType())
     EmitComplexExprIntoAddr(InitExpr, DeclPtr, false);
-  } else if (hasAggregateLLVMType(E->getType())) {
+  else if (hasAggregateLLVMType(E->getType()))
     EmitAnyExpr(InitExpr, DeclPtr, false);
-  } else {
+  else
     EmitStoreThroughLValue(EmitAnyExpr(InitExpr), Result, E->getType());
-  }

   return Result;
 }
@@ -1237,9 +1252,7 @@
     if (!LHS.isSimple())
       return EmitUnsupportedLValue(E, "conditional operator");

-    llvm::Value *Temp = CreateTempAlloca(LHS.getAddress()->getType(),
-                                         "condtmp");
-
+    llvm::Value *Temp = CreateTempAlloca(LHS.getAddress()->getType(),"condtmp");
     Builder.CreateStore(LHS.getAddress(), Temp);
     EmitBranch(ContBlock);

@@ -1406,15 +1419,14 @@
 LValue CodeGenFunction::EmitCallExprLValue(const CallExpr *E) {
   RValue RV = EmitCallExpr(E);

-  if (RV.isScalar()) {
-    assert(E->getCallReturnType()->isReferenceType() &&
-           "Can't have a scalar return unless the return type is a "
-           "reference type!");
-
-    return LValue::MakeAddr(RV.getScalarVal(), MakeQualifiers(E->getType()));
-  }
-
-  return LValue::MakeAddr(RV.getAggregateAddr(), MakeQualifiers(E->getType()));
+  if (!RV.isScalar())
+    return LValue::MakeAddr(RV.getAggregateAddr(),MakeQualifiers(E->getType()));
+
+  assert(E->getCallReturnType()->isReferenceType() &&
+         "Can't have a scalar return unless the return type is a "
+         "reference type!");
+
+  return LValue::MakeAddr(RV.getScalarVal(), MakeQualifiers(E->getType()));
 }

 LValue CodeGenFunction::EmitVAArgExprLValue(const VAArgExpr *E) {
@@ -1439,9 +1451,7 @@
 LValue
 CodeGenFunction::EmitCXXBindTemporaryLValue(const CXXBindTemporaryExpr *E) {
   LValue LV = EmitLValue(E->getSubExpr());
-
   PushCXXTemporary(E->getTemporary(), LV.getAddress());
-
   return LV;
 }

@@ -1497,21 +1507,18 @@
   return LValue::MakePropertyRef(E, E->getType().getCVRQualifiers());
 }

-LValue
-CodeGenFunction::EmitObjCKVCRefLValue(
+LValue CodeGenFunction::EmitObjCKVCRefLValue(
                                 const ObjCImplicitSetterGetterRefExpr *E) {
   // This is a special l-value that just issues sends when we load or store
   // through it.
   return LValue::MakeKVCRef(E, E->getType().getCVRQualifiers());
 }

-LValue
-CodeGenFunction::EmitObjCSuperExprLValue(const ObjCSuperExpr *E) {
+LValue CodeGenFunction::EmitObjCSuperExprLValue(const ObjCSuperExpr *E) {
   return EmitUnsupportedLValue(E, "use of super");
 }

 LValue CodeGenFunction::EmitStmtExprLValue(const StmtExpr *E) {
-
   // Can only get l-value for message expression returning aggregate type
   RValue RV = EmitAnyExprToTemp(E);
   // FIXME: can this be volatile?
@@ -1529,12 +1536,9 @@
   llvm::Value *V = llvm::Constant::getNullValue(ConvertType(NNSpecTy));
   LValue MemExpLV = EmitLValueForField(V, const_cast<FieldDecl*>(Field),
                                        /*isUnion*/false, /*Qualifiers*/0);
-  const llvm::Type* ResultType = ConvertType(
-                                             getContext().getPointerDiffType());
-  V = Builder.CreatePtrToInt(MemExpLV.getAddress(), ResultType,
-                             "datamember");
-  LValue LV = LValue::MakeAddr(V, MakeQualifiers(E->getType()));
-  return LV;
+  const llvm::Type *ResultType = ConvertType(getContext().getPointerDiffType());
+  V = Builder.CreatePtrToInt(MemExpLV.getAddress(), ResultType, "datamember");
+  return LValue::MakeAddr(V, MakeQualifiers(E->getType()));
 }

 RValue CodeGenFunction::EmitCall(llvm::Value *Callee, QualType CalleeType,
@@ -1565,8 +1569,8 @@
                   Callee, Args, TargetDecl);
 }

-LValue CodeGenFunction::EmitPointerToDataMemberBinaryExpr(
-                                                    const BinaryOperator *E) {
+LValue CodeGenFunction::
+EmitPointerToDataMemberBinaryExpr(const BinaryOperator *E) {
   llvm::Value *BaseV = EmitLValue(E->getLHS()).getAddress();
   if (E->getOpcode() == BinaryOperator::PtrMemI)
     BaseV = Builder.CreateLoad(BaseV, "indir.ptr");
@@ -1578,13 +1582,12 @@
   const llvm::Type* ResultType = ConvertType(getContext().getPointerDiffType());
   OffsetV = Builder.CreateBitCast(OffsetV, ResultType);
   llvm::Value *AddV = Builder.CreateInBoundsGEP(BaseV, OffsetV, "add.ptr");
+
   QualType Ty = E->getRHS()->getType();
-  const MemberPointerType *MemPtrType = Ty->getAs<MemberPointerType>();
-  Ty = MemPtrType->getPointeeType();
-  const llvm::Type* PType =
-  ConvertType(getContext().getPointerType(Ty));
+  Ty = Ty->getAs<MemberPointerType>()->getPointeeType();
+
+  const llvm::Type *PType = ConvertType(getContext().getPointerType(Ty));
   AddV = Builder.CreateBitCast(AddV, PType);
-  LValue LV = LValue::MakeAddr(AddV, MakeQualifiers(Ty));
-  return LV;
-}
-
+  return LValue::MakeAddr(AddV, MakeQualifiers(Ty));
+}
+


fix: merge fix for PathOrderOptimizer in FffGcodeWriter::processSkin (CURA-1461)

--- src/FffGcodeWriter.cpp
+++ src/FffGcodeWriter.cpp
@@ -934,7 +934,8 @@
     constexpr int perimeter_gaps_extra_offset = 15; // extra offset so that the perimeter gaps aren't created everywhere due to rounding errors
     bool fill_perimeter_gaps = mesh->getSettingAsFillPerimeterGapMode("fill_perimeter_gaps") != FillPerimeterGapMode::NOWHERE;

-    PathOrderOptimizer part_order_optimizer(gcode_layer.getLastPosition(), EZSeamType::SHORTEST);
+    Point z_seam_pos(0, 0); // not used
+    PathOrderOptimizer part_order_optimizer(gcode_layer.getLastPosition(), z_seam_pos, EZSeamType::SHORTEST);
     for (unsigned int skin_part_idx = 0; skin_part_idx < part.skin_parts.size(); skin_part_idx++)
     {
         PolygonsPart& outline = part.skin_parts[skin_part_idx].outline;


Callbacks are now called in the fashion of function(err, object) instead of mutating this

--- src/node-spotify.cc
+++ src/node-spotify.cc
@@ -72,17 +72,28 @@
  **/
 void resolveCallback(uv_async_t* handle, int status) {
   HandleScope scope;
-  NodeCallback* nodeCallback = (NodeCallback*)handle->data;
-  Handle<Function>* fun = nodeCallback->function;
+  NodeCallback* callbackStruct = (NodeCallback*)handle->data;
+  Handle<Function>* callback = callbackStruct->function;

-  const unsigned int argc = 0;
-  Local<Value> argv[argc] = { };
-  if(!(*fun).IsEmpty() && (*fun)->IsCallable()) {
-    //Check if an object is attached to the struct and if, use it as the scope.
-    if(nodeCallback->object == 0 || nodeCallback->object->getV8Object().IsEmpty())
-      (*fun)->Call(Context::GetCurrent()->Global(), argc, argv);
-    else
-      (*fun)->Call(nodeCallback->object->getV8Object(), argc, argv);
+  //only execute if a callback is attached
+  if(!(*callback).IsEmpty() && (*callback)->IsCallable()) {
+    unsigned int argc;
+    Handle<Value>* argv;
+    //if the callback has a V8 object attach use it as the second argument for the callback
+    //TODO: atm error is constantly undefined.
+    if(callbackStruct->object != nullptr && !callbackStruct->object->getV8Object().IsEmpty()) {
+      argc = 2;
+      argv = new Handle<Value>[2];
+      argv[0] = Undefined();
+      argv[1] = callbackStruct->object->getV8Object();
+    } else {
+      argc = 1;
+      argv = new Handle<Value>[1];
+      argv[0] = Undefined();
+    }
+
+    (*callback)->Call(Context::GetCurrent()->Global(), argc, argv);
+    delete[] argv;
   }
   scope.Close(Undefined());
 }


Accept String param correctly in shape_write_stl.

--- _yrcad.cpp
+++ _yrcad.cpp
@@ -1,4 +1,3 @@
-#include <BRepBuilderAPI_MakeShape.hxx>
 #include <BRepPrimAPI_MakeBox.hxx>
 #include <StlAPI_Writer.hxx>
 #include <rice/Class.hpp>
@@ -6,15 +5,15 @@
 using namespace Rice;

-void shape_write_stl(Object self, const char *path)
+void shape_write_stl(Object self, String path)
 {
     Data_Object<TopoDS_Shape> shape = self.call("render");
-
+
     StlAPI_Writer writer;
     writer.ASCIIMode() = false;
     writer.RelativeMode() = false;
     writer.SetDeflection(0.05);     // TODO: deflection param
-    writer.Write(*shape, path);
+    writer.Write(*shape, path.c_str());
 }


Properly select file-descriptor field on non-Android VMs for TLS ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=122108670 am: 271dc367ef
am: 448f388951

Change-Id: I0fc33b98a88e21b3233119d2369c405011e3e808

--- src/openjdk/native/JNIHelp.cpp
+++ src/openjdk/native/JNIHelp.cpp
@@ -147,7 +147,7 @@

 int jniGetFDFromFileDescriptor(JNIEnv* env, jobject fileDescriptor) {
     scoped_local_ref<jclass> localClass(env, env->FindClass("java/io/FileDescriptor"));
-    static jfieldID fid = env->GetFieldID(localClass.get(), "descriptor", "I");
+    static jfieldID fid = env->GetFieldID(localClass.get(), "fd", "I");
     if (fileDescriptor != NULL) {
         return env->GetIntField(fileDescriptor, fid);
     } else {


Fit into 80-col.

Fit into 80-col.

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

--- lib/CodeGen/CGStmt.cpp
+++ lib/CodeGen/CGStmt.cpp
@@ -358,9 +358,9 @@
   llvm::BasicBlock *LoopHeader = createBasicBlock("while.cond");
   EmitBlock(LoopHeader);

-  // Evaluate the conditional in the while header.  C99 6.8.5.1: The evaluation
-  // of the controlling expression takes place before each execution of the loop
-  // body.
+  // Evaluate the conditional in the while header.  C99 6.8.5.1: The
+  // evaluation of the controlling expression takes place before each
+  // execution of the loop body.
   llvm::Value *BoolCondVal = EvaluateExprAsBool(S.getCond());

   // while(1) is common, avoid extra exit blocks.  Be sure


Wrap recursive function only used in assert in #ifndef NDEBUG.

Avoids unused function warnings in Release builds.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@230009 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -146,6 +146,8 @@
   // Given assumption that V dominates loc, this may be live
   return true;
 }
+
+#ifndef NDEBUG
 static bool isAggWhichContainsGCPtrType(Type *Ty) {
   if (VectorType *VT = dyn_cast<VectorType>(Ty))
     return isGCPointerType(VT->getScalarType());
@@ -155,11 +157,13 @@
   } else if (StructType *ST = dyn_cast<StructType>(Ty)) {
     bool UnsupportedType = false;
     for (Type *SubType : ST->subtypes())
-      UnsupportedType |= isGCPointerType(SubType) || isAggWhichContainsGCPtrType(SubType);
+      UnsupportedType |=
+          isGCPointerType(SubType) || isAggWhichContainsGCPtrType(SubType);
     return UnsupportedType;
   } else
     return false;
 }
+#endif

 // Conservatively identifies any definitions which might be live at the
 // given instruction. The  analysis is performed immediately before the


Fix build in release mode, four cases of -Wunused-variable.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@229976 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -389,6 +389,7 @@
   if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
     if (LI->getType()->isPointerTy()) {
       Value *Op = LI->getOperand(0);
+      (void)Op;
       // Has to be a pointer to an gc object, or possibly an array of such?
       assert(Op->getType()->isPointerTy());
       return LI; // The value loaded is an gc base itself
@@ -1104,6 +1105,7 @@
   } else {
     // This is an invoke safepoint
     InvokeInst *invoke = dyn_cast<InvokeInst>(bounds.first);
+    (void)invoke;
     assert(invoke && "only continues over invokes!");
     assert(invoke->getNormalDest() == bounds.second->getParent() &&
            "safepoint should continue into normal exit block");
@@ -1221,6 +1223,7 @@
   Function *F = BB->getParent();
   assert(F && "must be set");
   Module *M = F->getParent();
+  (void)M;
   assert(M && "must be set");

   // We're not changing the function signature of the statepoint since the gc
@@ -1887,10 +1890,12 @@
   }
   unique_unsorted(live);

+#ifndef NDEBUG
   // sanity check
   for (auto ptr : live) {
     assert(isGCPointerType(ptr->getType()) && "must be a gc pointer type");
   }
+#endif

   relocationViaAlloca(F, DT, live, records);
   return !records.empty();


Fix race in sync point.

Fix race in sync point.

Summary:
The LoadDependency function does not take a lock when it runs
and it could be modifying data structures while other threads are
accessing it.

Test Plan: Run TSAN.

Reviewers: igor, sdong

Reviewed By: igor, sdong

Subscribers: dhruba

Differential Revision: https://reviews.facebook.net/D34095

--- util/sync_point.cc
+++ util/sync_point.cc
@@ -14,6 +14,7 @@
 }

 void SyncPoint::LoadDependency(const std::vector<Dependency>& dependencies) {
+  std::unique_lock<std::mutex> lock(mutex_);
   successors_.clear();
   predecessors_.clear();
   cleared_points_.clear();
@@ -21,6 +22,7 @@
     successors_[dependency.predecessor].push_back(dependency.successor);
     predecessors_[dependency.successor].push_back(dependency.predecessor);
   }
+  cv_.notify_all();
 }

 bool SyncPoint::PredecessorsAllCleared(const std::string& point) {


Reenable window_set_vsync_mode on Windows

--- platform/windows/display_server_windows.cpp
+++ platform/windows/display_server_windows.cpp
@@ -1917,16 +1917,14 @@
 void DisplayServerWindows::window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window) {
 	_THREAD_SAFE_METHOD_
 #if defined(VULKAN_ENABLED)
-	// TODO disabling for now
-	//context_vulkan->set_vsync_mode(p_window, p_vsync_mode);
+	context_vulkan->set_vsync_mode(p_window, p_vsync_mode);
 #endif
 }

 DisplayServer::VSyncMode DisplayServerWindows::window_get_vsync_mode(WindowID p_window) const {
 	_THREAD_SAFE_METHOD_
 #if defined(VULKAN_ENABLED)
-	//TODO disabling for now
-	//return context_vulkan->get_vsync_mode(p_window);
+	return context_vulkan->get_vsync_mode(p_window);
 #endif
 	return DisplayServer::VSYNC_ENABLED;
 }


fix unioning all and removing all holes issue

popped up on the topopt bone model

--- src/mainArachne.cpp
+++ src/mainArachne.cpp
@@ -404,20 +404,20 @@
     // prevent single polygon to be two areas connected only by a zero width channel, i.e. the polygon has two points at the same location
 //     boost::polygon::polygon_90_concept::

+    polys.simplify();
+    polys = polys.processEvenOdd();
     bool boost_fixing = true;
     if (boost_fixing)
     {
-        CPolygonSet boost_polys = toBoostType(polys);
-        CPolygonSet fixed;
-        fixed = assign(fixed, boost_polys); // assigning does fixing according to documentation
-        polys = toPolygons(fixed);
+        CPolygonSet boost_polys = toBoostType(polys); // immediately automatically performs a manifoldness fix
+        polys = toPolygons(boost_polys);
         polys.simplify();
     }
     else
     {
         polys.simplify();
         polys = polys.unionPolygons();
-        polys.processEvenOdd();
+        polys = polys.processEvenOdd();
     //     polys = polys.offset(-20).offset(40).offset(-20);
     //     polys.removeSmallAreas(INT2MM(nozzle_size) * INT2MM(nozzle_size));
     //     polys = polys.offset(20);