detail level control for expermimental condor_q -anaylze #3302

--- src/condor_q.V6/queue.cpp
+++ src/condor_q.V6/queue.cpp
@@ -3681,6 +3681,7 @@
 	int  hard_value;  // if constant, this is set to the value
 	bool dont_care;
 	int  pruned_by;   // index of entry that set dont_care
+	bool reported;
 	std::string unparsed;

 	AnalSubExpr(classad::ExprTree * expr, const char * lbl, int dep, int logic=0)
@@ -3697,6 +3698,7 @@
 		, hard_value(-1)
 		, dont_care(false)
 		, pruned_by(-1)
+		, reported(false)
 		{
 		};

@@ -4149,165 +4151,206 @@
 	bool show_work = (detail_mask & 0x100) != 0;

 	classad::ExprTree* exprReq = request->LookupExpr(ATTR_REQUIREMENTS);
-	if (exprReq) {
-
-		std::vector<AnalSubExpr> subs;
-		std::string strStep;
-		#define StepLbl(ii) subs[ii].StepLabel(strStep, ii, 3)
-
-		AnalyzeThisSubExpr(exprReq, subs, true, 0);
-
-		if (show_work) {
-			printf("\nEvaluate constants:\n");
-		}
-		// check of each sub-expression has any target references.
+	if ( ! exprReq)
+		return;
+
+	std::vector<AnalSubExpr> subs;
+	std::string strStep;
+	#define StepLbl(ii) subs[ii].StepLabel(strStep, ii, 3)
+
+	AnalyzeThisSubExpr(exprReq, subs, true, 0);
+
+	if (show_work) {
+		printf("\nEvaluate constants:\n");
+	}
+	// check of each sub-expression has any target references.
+	for (int ix = 0; ix < (int)subs.size(); ++ix) {
+		subs[ix].CheckIfConstant(*request);
+	}
+
+	AnalyzePropagateConstants(subs, show_work);
+
+	//
+	// now print out the strength-reduced expression
+	//
+	if (show_work) {
+		printf("\nReduced boolean expressions:\n");
 		for (int ix = 0; ix < (int)subs.size(); ++ix) {
-			subs[ix].CheckIfConstant(*request);
-		}
-
-		AnalyzePropagateConstants(subs, show_work);
-
+			const char * const_val = "";
+			if (subs[ix].constant)
+				const_val = subs[ix].hard_value ? "true" : "false";
+			std::string pruned = "";
+			if (subs[ix].dont_care) {
+				const_val = (subs[ix].constant) ? (subs[ix].hard_value ? "n/aT" : "n/aF") : "n/a";
+				formatstr(pruned, "\tpruned-by:%d", subs[ix].pruned_by);
+			}
+			if (subs[ix].ix_effective < 0) {
+				const char * pindent = GetIndentPrefix(subs[ix].depth);
+				printf("%s %5s\t%s%s%s\n", StepLbl(ix), const_val, pindent, subs[ix].Label(), pruned.c_str());
+			}
+		}
+	}
+
+		// propagate effectives back up the chain.
 		//
-		// now print out the strength-reduced expression
-		//
-		if (show_work) {
-			printf("\nReduced boolean expressions:\n");
-			for (int ix = 0; ix < (int)subs.size(); ++ix) {
-				const char * const_val = "";
-				if (subs[ix].constant)
-					const_val = subs[ix].hard_value ? "true" : "false";
-				std::string pruned = "";
-				if (subs[ix].dont_care) {
-					const_val = (subs[ix].constant) ? (subs[ix].hard_value ? "n/aT" : "n/aF") : "n/a";
-					formatstr(pruned, "\tpruned-by:%d", subs[ix].pruned_by);
+
+	if (show_work) {
+		printf("\nPropagate effectives:\n");
+	}
+	for (int ix = 0; ix < (int)subs.size(); ++ix) {
+		bool fchanged = false;
+		int jj = subs[ix].ix_left;
+		if ((jj >= 0) && (subs[jj].ix_effective >= 0)) {
+			subs[ix].ix_left = subs[jj].ix_effective;
+			fchanged = true;
+		}
+
+		jj = subs[ix].ix_right;
+		if ((jj >= 0) && (subs[jj].ix_effective >= 0)) {
+			subs[ix].ix_right = subs[jj].ix_effective;
+			fchanged = true;
+		}
+
+		jj = subs[ix].ix_grip;
+		if ((jj >= 0) && (subs[jj].ix_effective >= 0)) {
+			subs[ix].ix_grip = subs[jj].ix_effective;
+			fchanged = true;
+		}
+
+		if (fchanged) {
+			// force the label to be rebuilt.
+			std::string oldlbl = subs[ix].label;
+			if (oldlbl.empty()) oldlbl = "";
+			subs[ix].label.clear();
+			if (show_work) {
+				printf("%s   %s  is effectively  %s\n", StepLbl(ix), oldlbl.c_str(), subs[ix].Label());
+			}
+		}
+	}
+
+	if (show_work) {
+		printf("\nFinal expressions:\n");
+		for (int ix = 0; ix < (int)subs.size(); ++ix) {
+			const char * const_val = "";
+			if (subs[ix].constant)
+				const_val = subs[ix].hard_value ? "true" : "false";
+			if (subs[ix].ix_effective < 0 && ! subs[ix].dont_care) {
+				std::string altlbl;
+				//if ( ! subs[ix].MakeLabel(altlbl)) altlbl = "";
+				const char * pindent = GetIndentPrefix(subs[ix].depth);
+				printf("%s %5s\t%s%s\n", StepLbl(ix), const_val, pindent, subs[ix].Label() /*, altlbl.c_str()*/);
+			}
+		}
+	}
+	//////////////////////////////////////////////////////////////////////////////
+
+	//
+	//
+	// build counts of matching machines, render final output
+	//
+	if (show_work) {
+		printf("Evaluation against machine ads:\n");
+		printf(" Step  Slots   Condition\n");
+	}
+
+	return_buf = "        Slots"
+	             "\nStep   Matched  Condition"
+	             "\n-----  -------  ---------\n";
+	std::string linebuf;
+	for (int ix = 0; ix < (int)subs.size(); ++ix) {
+		if (subs[ix].ix_effective >= 0 || subs[ix].dont_care)
+			continue;
+
+		const char * pindent = GetIndentPrefix(subs[ix].depth);
+		const char * const_val = "";
+		if (subs[ix].constant) {
+			const_val = subs[ix].hard_value ? "true" : "false";
+			formatstr(linebuf, "%s %8s  %s%s\n", StepLbl(ix), const_val, pindent, subs[ix].Label());
+			return_buf += linebuf;
+			if (show_work) { printf("%s", linebuf.c_str()); }
+			continue;
+		}
+
+		subs[ix].matches = 0;
+
+		targets.Open();
+		while (ClassAd *target = targets.Next()) {
+
+			classad::Value eval_result;
+			bool bool_val;
+			if (EvalExprTree(subs[ix].tree, request, target, eval_result) &&
+				eval_result.IsBooleanValue(bool_val) &&
+				bool_val) {
+				subs[ix].matches += 1;
+			}
+		}
+		targets.Close();
+
+		formatstr(linebuf, "%s %8d  %s%s", StepLbl(ix), subs[ix].matches, pindent, subs[ix].Label());
+
+		bool append_pretty = false;
+		if (subs[ix].logic_op) {
+			append_pretty = (detail_mask & 3) == 3;
+			if (subs[ix].ix_left == ix-2 && subs[ix].ix_right == ix-1)
+				append_pretty = false;
+			if ((detail_mask & 4) != 0)
+				append_pretty = true;
+		}
+
+		if (append_pretty) {
+			std::string treebuf;
+			linebuf += " ( ";
+			PrettyPrintExprTree(subs[ix].tree, treebuf, linebuf.size(), 100);
+			linebuf += treebuf;
+			linebuf += " )";
+		}
+
+		linebuf += "\n";
+		return_buf += linebuf;
+
+		if (show_work) { printf("%s", linebuf.c_str()); }
+	}
+
+	// chase zeros back up the expression tree
+#if 0
+	show_work = (detail_mask & 8); // temporary
+	if (show_work) {
+		printf("\nCurrent Table:\nStep  -> Effec Depth Leaf D/C Matches\n");
+		for (int ix = 0; ix < (int)subs.size(); ++ix) {
+
+			int leaf = subs[ix].logic_op == 0;
+			printf("[%3d] -> [%3d] %5d %4d %3d %7d %s\n", ix, subs[ix].ix_effective, subs[ix].depth, leaf, subs[ix].dont_care, subs[ix].matches, subs[ix].Label());
+		}
+		printf("\n");
+		printf("\nChase Zeros:\nStep  -> Effec Depth Leaf Matches\n");
+	}
+	for (int ix = 0; ix < (int)subs.size(); ++ix) {
+		if (subs[ix].ix_effective >= 0 || subs[ix].dont_care)
+			continue;
+
+		int leaf = subs[ix].logic_op == 0;
+		if (leaf && subs[ix].matches == 0) {
+			if (show_work) {
+				printf("[%3d] -> [%3d] %5d %4d %7d %s\n", ix, subs[ix].ix_effective, subs[ix].depth, leaf, subs[ix].matches, subs[ix].Label());
+			}
+			for (int jj = ix+1; jj < (int)subs.size(); ++jj) {
+				if (subs[jj].matches != 0)
+					continue;
+				if (subs[jj].reported)
+					continue;
+				if ((subs[jj].ix_effective == ix) || subs[jj].ix_left == ix || subs[jj].ix_right == ix || subs[jj].ix_grip == ix) {
+					const char * pszop = "  \0 !\0||\0&&\0?:\0  \0"+subs[jj].logic_op*3;
+					printf("[%3d] -> [%3d] %5d %4s %7d %s\n", jj, subs[jj].ix_effective, subs[jj].depth, pszop, subs[jj].matches, subs[jj].Label());
+					subs[jj].reported = true;
 				}
-				if (subs[ix].ix_effective < 0) {
-					const char * pindent = GetIndentPrefix(subs[ix].depth);
-					printf("%s %5s\t%s%s%s\n", StepLbl(ix), const_val, pindent, subs[ix].Label(), pruned.c_str());
-				}
-			}
-		}
-
-			// propagate effectives back up the chain.
-			//
-
-		if (show_work) {
-			printf("\nPropagate effectives:\n");
-		}
-		for (int ix = 0; ix < (int)subs.size(); ++ix) {
-			bool fchanged = false;
-			int jj = subs[ix].ix_left;
-			if ((jj >= 0) && (subs[jj].ix_effective >= 0)) {
-				subs[ix].ix_left = subs[jj].ix_effective;
-				fchanged = true;
-			}
-
-			jj = subs[ix].ix_right;
-			if ((jj >= 0) && (subs[jj].ix_effective >= 0)) {
-				subs[ix].ix_right = subs[jj].ix_effective;
-				fchanged = true;
-			}
-
-			jj = subs[ix].ix_grip;
-			if ((jj >= 0) && (subs[jj].ix_effective >= 0)) {
-				subs[ix].ix_grip = subs[jj].ix_effective;
-				fchanged = true;
-			}
-
-			if (fchanged) {
-				// force the label to be rebuilt.
-				std::string oldlbl = subs[ix].label;
-				if (oldlbl.empty()) oldlbl = "";
-				subs[ix].label.clear();
-				if (show_work) {
-					printf("%s   %s  is effectively  %s\n", StepLbl(ix), oldlbl.c_str(), subs[ix].Label());
-				}
-			}
-		}
-
-		if (show_work) {
-			printf("\nFinal expressions:\n");
-			for (int ix = 0; ix < (int)subs.size(); ++ix) {
-				const char * const_val = "";
-				if (subs[ix].constant)
-					const_val = subs[ix].hard_value ? "true" : "false";
-				if (subs[ix].ix_effective < 0 && ! subs[ix].dont_care) {
-					std::string altlbl;
-					//if ( ! subs[ix].MakeLabel(altlbl)) altlbl = "";
-					const char * pindent = GetIndentPrefix(subs[ix].depth);
-					printf("%s %5s\t%s%s\n", StepLbl(ix), const_val, pindent, subs[ix].Label() /*, altlbl.c_str()*/);
-				}
-			}
-		}
-		//////////////////////////////////////////////////////////////////////////////
-
-		//
-		//
-		// build counts of matching machines, render final output
-		//
-		if (show_work) {
-			printf("Evaluation against machine ads:\n");
-			printf(" Step  Slots   Condition\n");
-		}
-
-		return_buf = "        Slots"
-		             "\nStep   Matched  Condition"
-		             "\n-----  -------  ---------\n";
-		std::string linebuf;
-		for (int ix = 0; ix < (int)subs.size(); ++ix) {
-			if (subs[ix].ix_effective >= 0 || subs[ix].dont_care)
-				continue;
-
-			const char * pindent = GetIndentPrefix(subs[ix].depth);
-			const char * const_val = "";
-			if (subs[ix].constant) {
-				const_val = subs[ix].hard_value ? "true" : "false";
-				formatstr(linebuf, "%s %8s  %s%s\n", StepLbl(ix), const_val, pindent, subs[ix].Label());
-				return_buf += linebuf;
-				if (show_work) { printf("%s", linebuf.c_str()); }
-				continue;
-			}
-
-			subs[ix].matches = 0;
-
-			targets.Open();
-			while (ClassAd *target = targets.Next()) {
-
-				classad::Value eval_result;
-				bool bool_val;
-				if (EvalExprTree(subs[ix].tree, request, target, eval_result) &&
-					eval_result.IsBooleanValue(bool_val) &&
-					bool_val) {
-					subs[ix].matches += 1;
-				}
-			}
-			targets.Close();
-
-			formatstr(linebuf, "%s %8d  %s%s", StepLbl(ix), subs[ix].matches, pindent, subs[ix].Label());
-
-			bool append_pretty = false;
-			if (subs[ix].logic_op) {
-				append_pretty = (detail_mask & 3) == 3;
-				if (subs[ix].ix_left == ix-2 && subs[ix].ix_right == ix-1)
-					append_pretty = false;
-				if ((detail_mask & 4) != 0)
-					append_pretty = true;
-			}
-
-			if (append_pretty) {
-				std::string treebuf;
-				linebuf += " ( ";
-				PrettyPrintExprTree(subs[ix].tree, treebuf, linebuf.size(), 100);
-				linebuf += treebuf;
-				linebuf += " )";
-			}
-
-			linebuf += "\n";
-			return_buf += linebuf;
-
-			if (show_work) { printf("%s", linebuf.c_str()); }
-		}
-	}
+			}
+		}
+	}
+	if (show_work) {
+		printf("\n");
+	}
+#endif
+
 }

 #if 0 // experimental code
@@ -4867,7 +4910,7 @@
         }
 	}

-	if (better_analyze && (fReqConstraint > 0)) {
+	if (better_analyze && ((fReqConstraint > 0) || analyze_detail_level > 0)) {

 		// first analyze the Requirements expression against the startd ads.
 		//


Remove obsolete debug info

Remove obsolete debug info

--- creator/plugins/docks/propertiesdock/propertiesdockplugin.cpp
+++ creator/plugins/docks/propertiesdock/propertiesdockplugin.cpp
@@ -35,7 +35,6 @@

 Gluon::Creator::Dock* PropertiesDockPlugin::createDock(KXmlGuiWindow* parent)
 {
-    DEBUG_FUNC_NAME
     return new PropertiesDock(i18n("Properties"), parent);
 }


Fixing the if then else structure

Fixing the if then else structure

--- lib/print.cpp
+++ lib/print.cpp
@@ -707,18 +707,30 @@
 		return dl;
 	}
 	ret mapITE(const ITE& ite) {
-		std::ostringstream oss;
-		DocumentList* dl = new DocumentList(" ", " else ", " endif");
+
+		DocumentList* dl = new DocumentList("", "", "");
 		for (unsigned int i = 0; i < ite._e_if->size(); i++) {
 			std::string beg = (i == 0 ? "if " : " elseif ");
-			DocumentList* ifelseif = new DocumentList(beg, " then ", "");
-			ifelseif->addDocumentToList(
-					expressionToDocument((*ite._e_if)[i].first));
-			ifelseif->addDocumentToList(
+			dl->addStringToList(beg);
+			dl->addDocumentToList(expressionToDocument((*ite._e_if)[i].first));
+			dl->addStringToList(" then ");
+
+			DocumentList* ifdoc = new DocumentList("", "", "", false);
+			ifdoc->addBreakPoint();
+			ifdoc->addDocumentToList(
 					expressionToDocument((*ite._e_if)[i].second));
-			dl->addDocumentToList(ifelseif);
-		}
-		dl->addDocumentToList(expressionToDocument(ite._e_else));
+			dl->addDocumentToList(ifdoc);
+		}
+		dl->addBreakPoint();
+		dl->addStringToList("else ");
+
+		DocumentList* elsedoc = new DocumentList("", "", "", false);
+		elsedoc->addBreakPoint();
+		elsedoc->addDocumentToList(expressionToDocument(ite._e_else));
+		dl->addDocumentToList(elsedoc);
+		dl->addBreakPoint();
+		dl->addStringToList("endif");
+
 		return dl;
 	}
 	ret mapBinOp(const BinOp& bo) {
@@ -893,10 +905,11 @@
 						generators->addDocumentToList(gen);
 					}
 					args->addDocumentToList(generators);
-          args->addStringToList("(");
-          args->addBreakPoint();
-          args->addDocumentToList(expressionToDocument(com->_e));
-          args->addStringToList(")");
+					args->addStringToList("(");
+					args->addBreakPoint();
+					args->addDocumentToList(expressionToDocument(com->_e));
+					args->addBreakPoint();
+					args->addStringToList(")");
 					dl->addDocumentToList(args);

 					return dl;
@@ -926,11 +939,12 @@
 	}
 	ret mapLet(const Let& l) {
 		DocumentList* letin = new DocumentList("", "", "", false);
-		DocumentList* lets = new DocumentList("", " ", "");
+		DocumentList* lets = new DocumentList("", " ", "", true);
 		DocumentList* inexpr = new DocumentList("", "", "");

 		for (unsigned int i = 0; i < l._let->size(); i++) {
-			lets->addBreakPoint();
+			if (i != 0)
+				lets->addBreakPoint();
 			DocumentList* exp = new DocumentList("", " ", ";");
 			Expression* li = (*l._let)[i];
 			if (!li->isa<VarDecl>())
@@ -938,14 +952,14 @@
 			exp->addDocumentToList(expressionToDocument(li));
 			lets->addDocumentToList(exp);
 			/*if(i != l._let->size()-1)
-				lets->addBreakPoint();*/
+			 lets->addBreakPoint();*/
 		}

 		inexpr->addDocumentToList(expressionToDocument(l._in));
-
+		letin->addBreakPoint();
 		letin->addDocumentToList(lets);

-		DocumentList* letin2 = new DocumentList("", "", "", true);
+		DocumentList* letin2 = new DocumentList("", "", "", false);

 		letin2->addBreakPoint();
 		letin2->addDocumentToList(inexpr);
@@ -1055,8 +1069,8 @@
 	}
 	ret mapPredicateI(const PredicateI& pi) {
 		DocumentList* dl;
-		dl = new DocumentList((pi._test ? "test " : "predicate "), " ", ";",
-		                      false);
+		dl = new DocumentList((pi._test ? "test " : "predicate "), " ", ";",
+				false);
 		dl->addStringToList(pi._id);
 		if (!pi._params->empty()) {
 			DocumentList* params = new DocumentList("(", ", ", ")");
@@ -1082,9 +1096,9 @@
 			dl = new DocumentList("annotation ", " ", ";", false);
 			dl->addStringToList(fi._id);
 		} else {
-			dl = new DocumentList("function ", " ", ";", false);
+			dl = new DocumentList("function ", "", ";", false);
 			dl->addDocumentToList(expressionToDocument(fi._ti));
-			dl->addStringToList(" : ");
+			dl->addStringToList(": ");
 			dl->addStringToList(fi._id);
 		}
 		if (!fi._params->empty()) {
@@ -1095,11 +1109,13 @@
 			}
 			dl->addDocumentToList(params);
 		}
-		if (fi._ann)
+		if (fi._ann){
+			dl->addStringToList(" ");
 			dl->addDocumentToList(expressionToDocument(fi._ann));
+		}
 		if (fi._e) {
-			dl->addStringToList("=");
-      dl->addBreakPoint();
+			dl->addStringToList(" =");
+			dl->addBreakPoint();
 			dl->addDocumentToList(expressionToDocument(fi._e));
 		}


Verbose mode off

Verbose mode off

--- PWGCF/FEMTOSCOPY/macros/Train/pPbKaonFemto/exp/configs/ConfigFemtoAnalysis.C
+++ PWGCF/FEMTOSCOPY/macros/Train/pPbKaonFemto/exp/configs/ConfigFemtoAnalysis.C
@@ -148,9 +148,9 @@
           aniter = ichg*3+imult;

           anetaphitpc[aniter] = new AliFemtoVertexMultAnalysis(10, -10.0, 10.0, 4, multbins[imult], multbins[imult+1]);
-          anetaphitpc[aniter]->SetNumEventsToMix(3);
+          anetaphitpc[aniter]->SetNumEventsToMix(5);
           anetaphitpc[aniter]->SetMinSizePartCollection(1);
-          //anetaphitpc[aniter]->SetVerboseMode(kTRUE); //why?
+          anetaphitpc[aniter]->SetVerboseMode(kFALSE); //why?

           mecetaphitpc[aniter] = new AliFemtoBasicEventCut();
           mecetaphitpc[aniter]->SetEventMult(0,10000);


gst/bin: Add rgb24 passthrough

gst/bin: Add rgb24 passthrough

--- src/gstreamer-1.0/tcambinconversion.cpp
+++ src/gstreamer-1.0/tcambinconversion.cpp
@@ -75,6 +75,7 @@
     {CAPS_TYPE::JPEG, CAPS_TYPE::JPEG, {false, false, false, false, false},},
     {CAPS_TYPE::JPEG, CAPS_TYPE::RGB_32, {false, false, false, true, false},},

+    {CAPS_TYPE::RGB_24, CAPS_TYPE::RGB_24, {false, false, false, false, false},},
     {CAPS_TYPE::RGB_24, CAPS_TYPE::RGB_32, {false, false, true, false, false},},
     {CAPS_TYPE::YUV, CAPS_TYPE::RGB_32, {false, false, true, false, false},},


layers: Refactor AcquireNextImageKHR for pre/post

Change-Id: I408a1b84a16dd302a8b8ef01d04672b4c37a3fc2

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -9587,13 +9587,9 @@
     return result;
 }

-VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout,
-                                                   VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) {
-    layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
-    bool skip = false;
-
-    unique_lock_t lock(global_lock);
-
+static bool PreCallValidateAcquireNextImageKHR(layer_data *dev_data, VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout,
+                                               VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) {
+    bool skip = false;
     if (fence == VK_NULL_HANDLE && semaphore == VK_NULL_HANDLE) {
         skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
                         HandleToUint64(device), __LINE__, DRAWSTATE_SWAPCHAIN_NO_SYNC_FOR_ACQUIRE, "DS",
@@ -9615,7 +9611,6 @@
     }

     auto swapchain_data = GetSwapchainNode(dev_data, swapchain);
-
     if (swapchain_data->replaced) {
         skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT,
                         HandleToUint64(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_REPLACED, "DS",
@@ -9642,7 +9637,38 @@
                         "vkAcquireNextImageKHR: No images found to acquire from. Application probably did not call "
                         "vkGetSwapchainImagesKHR after swapchain creation.");
     }
-
+    return skip;
+}
+
+static void PostCallRecordAcquireNextImageKHR(layer_data *dev_data, VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout,
+                                              VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) {
+    auto pFence = GetFenceNode(dev_data, fence);
+    if (pFence) {
+        pFence->state = FENCE_INFLIGHT;
+        pFence->signaler.first = VK_NULL_HANDLE;  // ANI isn't on a queue, so this can't participate in a completion proof.
+    }
+
+    // A successful call to AcquireNextImageKHR counts as a signal operation on semaphore
+    auto pSemaphore = GetSemaphoreNode(dev_data, semaphore);
+    if (pSemaphore) {
+        pSemaphore->signaled = true;
+        pSemaphore->signaler.first = VK_NULL_HANDLE;
+    }
+
+    // Mark the image as acquired.
+    auto swapchain_data = GetSwapchainNode(dev_data, swapchain);
+    auto image = swapchain_data->images[*pImageIndex];
+    auto image_state = GetImageState(dev_data, image);
+    image_state->acquired = true;
+    image_state->shared_presentable = swapchain_data->shared_presentable;
+}
+
+VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout,
+                                                   VkSemaphore semaphore, VkFence fence, uint32_t *pImageIndex) {
+    layer_data *dev_data = GetLayerDataPtr(get_dispatch_key(device), layer_data_map);
+
+    unique_lock_t lock(global_lock);
+    bool skip = PreCallValidateAcquireNextImageKHR(dev_data, device, swapchain, timeout, semaphore, fence, pImageIndex);
     lock.unlock();

     if (skip) return VK_ERROR_VALIDATION_FAILED_EXT;
@@ -9651,22 +9677,7 @@

     lock.lock();
     if (result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR) {
-        if (pFence) {
-            pFence->state = FENCE_INFLIGHT;
-            pFence->signaler.first = VK_NULL_HANDLE;  // ANI isn't on a queue, so this can't participate in a completion proof.
-        }
-
-        // A successful call to AcquireNextImageKHR counts as a signal operation on semaphore
-        if (pSemaphore) {
-            pSemaphore->signaled = true;
-            pSemaphore->signaler.first = VK_NULL_HANDLE;
-        }
-
-        // Mark the image as acquired.
-        auto image = swapchain_data->images[*pImageIndex];
-        auto image_state = GetImageState(dev_data, image);
-        image_state->acquired = true;
-        image_state->shared_presentable = swapchain_data->shared_presentable;
+        PostCallRecordAcquireNextImageKHR(dev_data, device, swapchain, timeout, semaphore, fence, pImageIndex);
     }
     lock.unlock();


storage-service: Open-code simple config getters

There are two db::config getters in storage_service.cc that
are used only once. Both call for global storage service, but
since they are called from storage service it's simpler to break
this loop and make storage service get needed config options
directly.

Signed-off-by: Pavel Emelyanov <c9a32589e048e044184536f7ac71ef92fe82df3e@scylladb.com>

--- service/storage_service.cc
+++ service/storage_service.cc
@@ -216,14 +216,6 @@
     }
 }

-bool get_property_rangemovement() {
-    return get_local_storage_service().db().local().get_config().consistent_rangemovement();
-}
-
-bool get_property_load_ring_state() {
-    return get_local_storage_service().db().local().get_config().load_ring_state();
-}
-
 bool storage_service::is_first_node() {
     if (db().local().is_replacing()) {
         return false;
@@ -472,7 +464,7 @@

         auto t = gms::gossiper::clk::now();
         auto tmptr = get_token_metadata_ptr();
-        while (get_property_rangemovement() &&
+        while (_db.local().get_config().consistent_rangemovement() &&
             (!tmptr->get_bootstrap_tokens().empty() ||
              !tmptr->get_leaving_endpoints().empty())) {
             auto elapsed = std::chrono::duration_cast<std::chrono::seconds>(gms::gossiper::clk::now() - t).count();
@@ -1375,7 +1367,7 @@
         _initialized = true;

         std::unordered_set<inet_address> loaded_endpoints;
-        if (get_property_load_ring_state()) {
+        if (_db.local().get_config().load_ring_state()) {
             slogger.info("Loading persisted ring state");
             auto loaded_tokens = db::system_keyspace::load_tokens().get0();
             auto loaded_host_ids = db::system_keyspace::load_host_ids().get0();


Add phase rotator support for cmd/adr bus

Change-Id: I5710e0477826f202a8f9a4a0086aa17a3deff50b
Original-Change-Id: I10e9fbd825f21f6533dc861197c3df5aa6f98114
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/27869
Tested-by: Jenkins Server <8e3f934e4c44875bc48d33da3ea13d93ba9a233f@us.ibm.com>
Tested-by: Hostboot CI <52521565bd8ea18a2b112942dce4f4220a97c2c8@us.ibm.com>
Reviewed-by: ANDRE A. MARIN <65293609e29ccd0ac899f5f3f03aea95be1b215f@us.ibm.com>
Reviewed-by: Louis Stermole <a2bef96d502debd02962600aef4d81d949c35039@us.ibm.com>
Reviewed-by: Brian R. Silver <af0eed78d989d9597decc8b92fa6db01ef8b58e0@us.ibm.com>

--- src/import/chips/p9/procedures/hwp/memory/lib/phy/adr.H
+++ src/import/chips/p9/procedures/hwp/memory/lib/phy/adr.H
@@ -22,3 +22,96 @@
 /* permissions and limitations under the License.                         */
 /*                                                                        */
 /* IBM_PROLOG_END_TAG                                                     */
+
+///
+/// @file adr.H
+/// @brief Subroutines for the PHY ADR registers
+///
+// *HWP HWP Owner: Brian Silver <bsilver@us.ibm.com>
+// *HWP HWP Backup: Andre Marin <aamarin@us.ibm.com>
+// *HWP Team: Memory
+// *HWP Level: 2
+// *HWP Consumed by: FSP:HB
+
+#ifndef _MSS_ADR_H_
+#define _MSS_ADR_H_
+
+#include <fapi2.H>
+#include <p9_mc_scom_addresses.H>
+#include <p9_mc_scom_addresses_fld.H>
+
+#include <lib/shared/mss_const.H>
+#include <lib/utils/scom.H>
+
+namespace mss
+{
+
+// I have a dream that the PHY code can be shared among controllers. So, I drive the
+// engine from a set of traits. This might be folly. Allow me to dream. BRS
+
+///
+/// @class adrTraits
+/// @brief a collection of traits associated with the PHY ADR interface
+/// @tparam T fapi2::TargetType representing the PHY
+///
+template< fapi2::TargetType T >
+class adrTraits;
+
+///
+/// @class adrTraits
+/// @brief a collection of traits associated with the Centaur PHY ADR interface
+///
+template<>
+class adrTraits<fapi2::TARGET_TYPE_MBA>
+{
+};
+
+///
+/// @class adrTraits
+/// @brief a collection of traits associated with the Nimbus PHY ADR
+///
+template<>
+class adrTraits<fapi2::TARGET_TYPE_MCA>
+{
+    public:
+
+        enum
+        {
+            // Each register has two fields. One for the even lane and one for the odd lane.
+            ADR_DELAY_EVEN = MCA_DDRPHY_ADR_DELAY0_P0_ADR0_01,
+            ADR_DELAY_ODD = MCA_DDRPHY_ADR_DELAY0_P0_ADR0_01_DELAY1,
+            ADR_DELAY_LEN = MCA_DDRPHY_ADR_DELAY0_P0_ADR0_01_DELAY1_LEN,
+        };
+
+};
+
+///
+/// @brief A structure to represent an adr operation
+///
+struct adr_data
+{
+    // The register
+    uint64_t iv_reg;
+
+    // One function gets the even lanes attribute, the other gets the odd lanes
+    fapi2::ReturnCode (*iv_even_func)(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&, uint8_t&);
+    fapi2::ReturnCode (*iv_odd_func)(const fapi2::Target<fapi2::TARGET_TYPE_MCA>&, uint8_t&);
+};
+
+namespace adr
+{
+
+///
+/// @brief Reset the ADR Delay Lines
+/// @param[in] i_target the fapi2 target of the MCA
+/// @return fapi2::ReturnCode FAPI2_RC_SUCCESS if ok
+/// @note reads VPD and resets the delay lines. This is very controller specific, so we have
+/// a one function for each controller (er ... but just one now)
+///
+fapi2::ReturnCode reset_delay( const fapi2::Target<fapi2::TARGET_TYPE_MCA>& i_target );
+
+} // close namespace adr
+
+} // close namespace mss
+
+#endif


Flaking out some tests that use simulate_input::SendCharA.

BUG=124244
TEST=none

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

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

--- chrome_frame/test/ui_test.cc
+++ chrome_frame/test/ui_test.cc
@@ -113,7 +113,8 @@
 }

 // Tests new window behavior with ctrl+N.
-TEST_P(FullTabUITest, CtrlN) {
+// Flaky due to DelaySendChar; see http://crbug.com/124244.
+TEST_P(FullTabUITest, FLAKY_CtrlN) {
   if (IsWorkstationLocked()) {
     LOG(ERROR) << "This test cannot be run in a locked workstation.";
     return;
@@ -154,7 +155,8 @@
 }

 // Test that Ctrl+F opens the Find dialog.
-TEST_P(FullTabUITest, CtrlF) {
+// Flaky due to DelaySendChar; see http://crbug.com/124244.
+TEST_P(FullTabUITest, FLAKY_CtrlF) {
   if (IsWorkstationLocked()) {
     LOG(ERROR) << "This test cannot be run in a locked workstation.";
     return;
@@ -187,7 +189,8 @@
 }

 // Test that ctrl+r does cause a refresh.
-TEST_P(FullTabUITest, CtrlR) {
+// Flaky due to DelaySendChar; see http://crbug.com/124244.
+TEST_P(FullTabUITest, FLAKY_CtrlR) {
   if (IsWorkstationLocked()) {
     LOG(ERROR) << "This test cannot be run in a locked workstation.";
     return;
@@ -215,7 +218,8 @@
 }

 // Test window close with ctrl+w.
-TEST_P(FullTabUITest, CtrlW) {
+// Flaky due to DelaySendChar; see http://crbug.com/124244.
+TEST_P(FullTabUITest, FLAKY_CtrlW) {
   if (IsWorkstationLocked()) {
     LOG(ERROR) << "This test cannot be run in a locked workstation.";
     return;
@@ -235,7 +239,8 @@
 }

 // Test address bar navigation with Alt+d and URL.
-TEST_P(FullTabUITest, AltD) {
+// Flaky due to TypeUrlInAddressBar; see http://crbug.com/124244.
+TEST_P(FullTabUITest, FLAKY_AltD) {
   if (IsWorkstationLocked()) {
     LOG(ERROR) << "This test cannot be run in a locked workstation.";
     return;


Allow condor_q to sort with negative clusterID

===GT=== #2726
Fix the bug below, noticed by Brian Bockelman:

Brian reports the following strange behavior using code from the current trunk:

$ condor_q -pool red-condor.unl.edu -name red-gw2.unl.edu -format '%s'
ResidentSetSize
Error: Two clusters with the same ID.
tempCPS: -1 -1 -1 -1
Comparing against: -1 -1 -1 -1

The bug was introduced in 99f1b69
===VersionHistory:None=== Never in a released version of Condor

--- src/condor_q.V6/queue.cpp
+++ src/condor_q.V6/queue.cpp
@@ -196,6 +196,8 @@
 class CompareProcMaps {
 public:
 	bool operator()(const clusterProcMapper& a, const clusterProcMapper& b) const {
+		if (a.cluster < 0 || a.proc < 0) return true;
+		if (b.cluster < 0 || b.proc < 0) return false;
 		if (a.dagman_cluster_id < b.dagman_cluster_id) { return true; }
 		if (a.dagman_cluster_id > b.dagman_cluster_id) { return false; }
 		if (a.dagman_proc_id < b.dagman_proc_id) { return true; }
@@ -211,6 +213,8 @@
 class CompareProcIDMaps {
 public:
 	bool operator()(const clusterIDProcIDMapper& a, const clusterIDProcIDMapper& b) const {
+		if (a.cluster < 0 || a.proc < 0) return true;
+		if (b.cluster < 0 || b.proc < 0) return false;
 		if (a.cluster < b.cluster ) { return true; }
 		if (a.cluster > b.cluster ) { return false; }
 		if (a.proc    < b.proc    ) { return true; }


Previous fix to template query processing for 1 parameter broke down for
multiple parameters.  Now it works for all parameter counts.

git-svn-id: 1a57124bbb9aca193a920d0ffd753d488afb922b@1446 5946f024-35f4-0310-b1b3-9a3be3380cfb

--- lib/query.cpp
+++ lib/query.cpp
@@ -108,7 +108,7 @@
 ResNSel
 Query::execute(const SQLString& str)
 {
-	if (!parse_elems_.empty() && !def.processing_) {
+	if ((parse_elems_.size() == 2) && !def.processing_) {
 		// We're a template query and we haven't gone through this path
 		// before, so take str to be a lone parameter for the query.
 		// We will come back through this function with a completed
@@ -407,7 +407,7 @@
 Result
 Query::store(const SQLString& str)
 {
-	if (!parse_elems_.empty() && !def.processing_) {
+	if ((parse_elems_.size() == 2) && !def.processing_) {
 		// We're a template query and we haven't gone through this path
 		// before, so take str to be a lone parameter for the query.
 		// We will come back through this function with a completed
@@ -578,7 +578,7 @@
 ResUse
 Query::use(const SQLString& str)
 {
-	if (!parse_elems_.empty() && !def.processing_) {
+	if ((parse_elems_.size() == 2) && !def.processing_) {
 		// We're a template query and we haven't gone through this path
 		// before, so take str to be a lone parameter for the query.
 		// We will come back through this function with a completed


Removing unnecessary double if check

Removing unnecessary double if check

--- Source/ChilliSource/Rendering/Material/ForwardRenderMaterialGroupManager.cpp
+++ Source/ChilliSource/Rendering/Material/ForwardRenderMaterialGroupManager.cpp
@@ -441,13 +441,13 @@

             if (m_shadowsSupported)
             {
-                if (m_shadowsSupported && vertexFormat == VertexFormat::k_staticMesh)
+                if (vertexFormat == VertexFormat::k_staticMesh)
                 {
                     auto shadowMapMaterial = CreateShadowMap(m_staticShadowMap);
                     renderMaterialsSlots[static_cast<u32>(ForwardRenderPasses::k_shadowMap)] = shadowMapMaterial.get();
                     renderMaterials.push_back(std::move(shadowMapMaterial));
                 }
-                else if(m_shadowsSupported && vertexFormat == VertexFormat::k_animatedMesh)
+                else if(vertexFormat == VertexFormat::k_animatedMesh)
                 {
                     auto shadowMapMaterial = CreateShadowMap(m_animatedShadowMap);
                     renderMaterialsSlots[static_cast<u32>(ForwardRenderPasses::k_shadowMap)] = shadowMapMaterial.get();


Executor: Do not try to cancel jobs more than once

Change-Id: Ia141c6c9d483a60ee2645b50367aa5f5856f6a44
Reviewed-by: Joerg Bornemann <47777b9406dbddd02a3fdca8341789a013805a11@qt.io>
Reviewed-by: Jake Petroules <2d627e1cecd5435752fa500bacbe05f7cc90c369@qt.io>

--- src/lib/corelib/buildgraph/executor.cpp
+++ src/lib/corelib/buildgraph/executor.cpp
@@ -694,6 +694,8 @@

 void Executor::cancelJobs()
 {
+    if (m_state == ExecutorCanceling)
+        return;
     m_logger.qbsTrace() << "Canceling all jobs.";
     setState(ExecutorCanceling);
     QList<ExecutorJob *> jobs = m_processingJobs.keys();


don't copy vector of pipelines everywhere

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -1178,7 +1178,7 @@
 }

 // Verify that create state for a pipeline is valid
-static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE_STATE *> pPipelines, int pipelineIndex) {
+static bool verifyPipelineCreateState(layer_data *dev_data, std::vector<PIPELINE_STATE *> const &pPipelines, int pipelineIndex) {
     bool skip = false;

     PIPELINE_STATE *pPipeline = pPipelines[pipelineIndex];


storage_service: add _sstables_format field

Signed-off-by: Piotr Jastrzebski <2c0eb4a25a7cde333ff2d0860cb06051925fd74f@scylladb.com>

--- service/storage_service.hh
+++ service/storage_service.hh
@@ -61,6 +61,7 @@
 #include "disk-error-handler.hh"
 #include "gms/feature.hh"
 #include <seastar/core/metrics_registration.hh>
+#include "sstables/version.hh"

 namespace cql_transport {
     class cql_server;
@@ -304,6 +305,8 @@
     gms::feature _row_level_repair_feature;
     gms::feature _truncation_table;
     gms::feature _correct_static_compact_in_mc;
+
+    sstables::sstable_version_types _sstables_format = sstables::sstable_version_types::ka;
 public:
     void enable_all_features();


Do not disable priv switching in a daemonCore daemon. #6817

The Python bindings want to disable priv switching in the case
they are being used in a client, but NOT in the case the bindings
are used by a daemon (ie using COLLECTOR_PLUGIN_PYTHON_MODULES).

--- src/condor_utils/uids.cpp
+++ src/condor_utils/uids.cpp
@@ -27,6 +27,7 @@
 #include "condor_distribution.h"
 #include "my_username.h"
 #include "daemon.h"
+#include "condor_daemon_core.h"
 #include "store_cred.h"
 #include "../condor_sysapi/sysapi.h"

@@ -190,7 +191,13 @@
 void
 set_priv_ignore_all_requests( void )
 {
-   SetPrivIgnoreAllRequests = TRUE;
+   // Only honor request to ignore priv changes
+   // if we are not a daemonCore daemon.
+   // This allows daemons (like the Collector) that pull
+   // in Python based plugins to continue to work.
+   if (daemonCore == NULL) {
+       SetPrivIgnoreAllRequests = TRUE;
+   }
 }

 int


*** empty log message ***

*** empty log message ***

--- src/ShrinkF.cc
+++ src/ShrinkF.cc
@@ -79,7 +79,11 @@
 //
 // Update ourselves
 //
+
+  newPts->Squeeze();
   this->SetPoints(newPts);
+
+  this->PointData.Squeeze();
 }

 void vlShrinkFilter::PrintSelf(ostream& os, vlIndent indent)


Remove un-needed printf about esel

Remove un-needed printf about esel

Fills up the journal when the host is sending down
multiple and/or large esel's

Change-Id: If74afe448d9211c798a1ffd70bfe7cd57d063f6c
Signed-off-by: Andrew Geissler <c46de238cd554860f0bd4010b1729f1323facd9c@us.ibm.com>

--- oemhandler.cpp
+++ oemhandler.cpp
@@ -48,7 +48,7 @@
 		printf("Used Reservation ID = %d\n", used_res_id);
 		rc = IPMI_CC_INVALID_RESERVATION_ID;

-		// clean g_esel_path.
+		// clean g_esel_path.
 		r = remove(g_esel_path);
 		if(r < 0)
 			fprintf(stderr, "Error deleting %s\n", g_esel_path);
@@ -64,9 +64,6 @@
 		pio = "rb+";

 	rlen = (*data_len) - (uint8_t) (sizeof(esel_request_t));
-
-	printf("IPMI PARTIAL ESEL for %s  Offset = %d Length = %d\n",
-		g_esel_path, esel_req.offset, rlen);

 	if ((fp = fopen(g_esel_path, pio)) != NULL) {
 		fseek(fp, esel_req.offset, SEEK_SET);
@@ -116,7 +113,7 @@
     rc = WEXITSTATUS(rc);
     if (rc != 0) {
         fprintf(stderr, "fw_setenv openbmconce failed with rc=%d\n", rc);
-        return IPMI_CC_UNSPECIFIED_ERROR;
+        return IPMI_CC_UNSPECIFIED_ERROR;
     }

     // Touch the image-rwfs file to perform an empty update to force the save


fix(library/tactic/inversion_tactic): bug in name generation

--- src/library/tactic/inversion_tactic.cpp
+++ src/library/tactic/inversion_tactic.cpp
@@ -191,7 +191,7 @@
             expr g_type    = g.get_type();
             for (unsigned i = 0; i < nargs; i++) {
                 expr type  = binding_domain(g_type);
-                expr new_h = mk_local(m_ngen.next(), get_unused_name(binding_name(g_type), hyps), type, binder_info());
+                expr new_h = mk_local(m_ngen.next(), get_unused_name(binding_name(g_type), new_hyps), type, binder_info());
                 new_hyps.push_back(new_h);
                 g_type     = instantiate(binding_body(g_type), new_h);
             }


SamsungV2Decompressor::prepareBaselineValues(): early return

--- src/librawspeed/decompressors/SamsungV2Decompressor.cpp
+++ src/librawspeed/decompressors/SamsungV2Decompressor.cpp
@@ -217,45 +217,44 @@
     // line If we're at the left edge we just start at the initial value
     for (int i = 0; i < 16; i++)
       out(row, col + i) = (col == 0) ? initVal : out(row, col + i - 2);
-  } else {
-    // The complex case, we now need to actually lookup one or two lines
-    // above
-    if (row < 2)
-      ThrowRDE(
-          "Got a previous line lookup on first two lines. File corrupted?");
-
-    static constexpr std::array<int32_t, 7> motionOffset = {-4, -2, -2, 0,
-                                                            0,  2,  4};
-    static constexpr std::array<int32_t, 7> motionDoAverage = {0, 0, 1, 0,
-                                                               1, 0, 0};
-
-    int32_t slideOffset = motionOffset[motion];
-    int32_t doAverage = motionDoAverage[motion];
-
-    for (int i = 0; i < 16; i++) {
-      int refRow = row;
-      int refCol = col + i + slideOffset;
-
-      if ((row + i) & 1) { // Red or blue pixels use same color two lines up
-        refRow -= 2;
-      } else { // Green pixel N uses Green pixel N from row above
-        refRow -= 1;
-        refCol += (i & 1) ? -1 : 1; // (top left or top right)
-      }
-
-      if (refCol < 0)
-        ThrowRDE("Bad motion %u at the beginning of the row", motion);
-      if ((refCol >= width) || (doAverage && (refCol + 2 >= width)))
-        ThrowRDE("Bad motion %u at the end of the row", motion);
-
-      // In some cases we use as reference interpolation of this pixel and
-      // the next
-      if (doAverage) {
-        out(row, col + i) =
-            (out(refRow, refCol) + out(refRow, refCol + 2) + 1) >> 1;
-      } else
-        out(row, col + i) = out(refRow, refCol);
+    return;
+  }
+
+  // The complex case, we now need to actually lookup one or two lines above
+  if (row < 2)
+    ThrowRDE("Got a previous line lookup on first two lines. File corrupted?");
+
+  static constexpr std::array<int32_t, 7> motionOffset = {-4, -2, -2, 0,
+                                                          0,  2,  4};
+  static constexpr std::array<int32_t, 7> motionDoAverage = {0, 0, 1, 0,
+                                                             1, 0, 0};
+
+  int32_t slideOffset = motionOffset[motion];
+  int32_t doAverage = motionDoAverage[motion];
+
+  for (int i = 0; i < 16; i++) {
+    int refRow = row;
+    int refCol = col + i + slideOffset;
+
+    if ((row + i) & 1) { // Red or blue pixels use same color two lines up
+      refRow -= 2;
+    } else { // Green pixel N uses Green pixel N from row above
+      refRow -= 1;
+      refCol += (i & 1) ? -1 : 1; // (top left or top right)
     }
+
+    if (refCol < 0)
+      ThrowRDE("Bad motion %u at the beginning of the row", motion);
+    if ((refCol >= width) || (doAverage && (refCol + 2 >= width)))
+      ThrowRDE("Bad motion %u at the end of the row", motion);
+
+    // In some cases we use as reference interpolation of this pixel and
+    // the next
+    if (doAverage) {
+      out(row, col + i) =
+          (out(refRow, refCol) + out(refRow, refCol + 2) + 1) >> 1;
+    } else
+      out(row, col + i) = out(refRow, refCol);
   }
 }


layers: Remove obsolete error check from CV

Bad shader capability check is now in the spirv validator.

Change-Id: I3d96f935d0adb7081d6693cfc004ba215391054e

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -2542,10 +2542,7 @@
                     break;

                 default:
-                    if (log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0, __LINE__,
-                                SHADER_CHECKER_BAD_CAPABILITY, "SC", "Shader declares capability %u, not supported in Vulkan.",
-                                insn.word(1)))
-                        pass = false;
+                    // Spirv-validator should catch these errors
                     break;
             }
         }


Update doc

Update doc

--- src/libtriton/bindings/python/objects/PyInstruction.cpp
+++ src/libtriton/bindings/python/objects/PyInstruction.cpp
@@ -118,7 +118,7 @@
 Returns true if the instruction modifies the control flow (i.e x86: JUMP, JCC, CALL, RET).

 - **isTainted(void)**

-Returns true if at least one of its expressions is tainted.
+Returns true if at least one of its \ref py_SymbolicExpression_page is tainted.

 - **setAddress(integer addr)**

 Sets the instruction's address.


- hltypes deprecation update

- hltypes deprecation update

--- src/Source.cpp
+++ src/Source.cpp
@@ -52,7 +52,8 @@
 		}
 		if (this->stream == NULL)
 		{
-			hresource* resource = new hresource(this->filename);
+			hresource* resource = new hresource;
+			resource->open(this->filename);
 			if (this->sourceMode == RAM || this->bufferMode == ASYNC)
 			{
 				this->stream = new hstream();


fix Duel.GetControl

fix Duel.GetControl

if the target is self destroyed, it should not count in the return value

--- operations.cpp
+++ operations.cpp
@@ -900,6 +900,7 @@
 	}
 	case 3: {
 		if(targets->it == targets->container.end()) {
+			adjust_instant();
 			core.units.begin()->step = 4;
 			return FALSE;
 		}
@@ -918,7 +919,6 @@
 		return FALSE;
 	}
 	case 5: {
-		adjust_instant();
 		for(auto cit = targets->container.begin(); cit != targets->container.end(); ) {
 			card* pcard = *cit++;
 			if(!(pcard->current.location & LOCATION_ONFIELD)) {


layers:Refactor RetireWorkOnQueue

layers:Refactor RetireWorkOnQueue

RetireWorkOnQueue() had one check that could cause a validation error.
The check makes sure that an unsignalled event does not precede a query
pool reset in a cmd buffer being retired.

This change splits out the check so that it can be hoisted prior to
calls down the chain, and the actual retirement of work on a queue then
only needs to take place after a call down the chain succeeds.

This initial commit separates these operations for fence retirement
and a follow-on commit will separate remaining operations for queue
retirement.

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -4582,26 +4582,46 @@
     return skip_call;
 }

-// Note: This function assumes that the global lock is held by the calling
-// thread.
-// TODO: untangle this.
-static bool cleanInFlightCmdBuffer(layer_data *my_data, VkCommandBuffer cmdBuffer) {
-    bool skip_call = false;
-    GLOBAL_CB_NODE *pCB = getCBNode(my_data, cmdBuffer);
-    if (pCB) {
-        for (auto queryEventsPair : pCB->waitedEventsBeforeQueryReset) {
-            for (auto event : queryEventsPair.second) {
-                if (my_data->eventMap[event].needsSignaled) {
-                    skip_call |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
-                                         VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, 0, DRAWSTATE_INVALID_QUERY, "DS",
-                                         "Cannot get query results on queryPool 0x%" PRIx64
-                                         " with index %d which was guarded by unsignaled event 0x%" PRIx64 ".",
-                                         (uint64_t)(queryEventsPair.first.pool), queryEventsPair.first.index, (uint64_t)(event));
+// Note: This function assumes that the global lock is held by the calling thread.
+// For the given queue, verify the queue state up to the given seq number.
+// Currently the only check is to make sure that if there are events to be waited on prior to
+//  a QueryReset, make sure that all such events have been signalled.
+static bool VerifyQueueStateToSeq(layer_data *my_data, QUEUE_NODE *queue, uint64_t seq) {
+    bool skip = false;
+    auto queue_seq = queue->seq;
+    // local copy of submissions as we're only simulating queue retirement
+    auto submissions = queue->submissions;
+    while (queue_seq < seq) {
+        auto &submission = submissions.front();
+        for (auto cb : submission.cbs) {
+            auto cb_node = getCBNode(my_data, cb);
+            if (cb_node) {
+                for (auto queryEventsPair : cb_node->waitedEventsBeforeQueryReset) {
+                    for (auto event : queryEventsPair.second) {
+                        if (my_data->eventMap[event].needsSignaled) {
+                            skip |= log_msg(my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT,
+                                            VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT, 0, 0, DRAWSTATE_INVALID_QUERY, "DS",
+                                            "Cannot get query results on queryPool 0x%" PRIx64
+                                            " with index %d which was guarded by unsignaled event 0x%" PRIx64 ".",
+                                            (uint64_t)(queryEventsPair.first.pool), queryEventsPair.first.index, (uint64_t)(event));
+                        }
+                    }
                 }
             }
         }
-    }
-    return skip_call;
+        submissions.pop_front();
+        queue_seq++;
+    }
+    return skip;
+}
+
+// When the given fence is retired, verify outstanding queue operations through the point of the fence
+static bool VerifyQueueStateToFence(layer_data *dev_data, VkFence fence) {
+    auto fence_state = getFenceNode(dev_data, fence);
+    if (VK_NULL_HANDLE != fence_state->signaler.first) {
+        return VerifyQueueStateToSeq(dev_data, getQueueNode(dev_data, fence_state->signaler.first), fence_state->signaler.second);
+    }
+    return false;
 }

 // TODO: nuke this completely.
@@ -4626,9 +4646,7 @@
     }
 }

-static bool RetireWorkOnQueue(layer_data *dev_data, QUEUE_NODE *pQueue, uint64_t seq)
-{
-    bool skip_call = false; // TODO: extract everything that might fail to precheck
+static void RetireWorkOnQueue(layer_data *dev_data, QUEUE_NODE *pQueue, uint64_t seq) {
     std::unordered_map<VkQueue, uint64_t> otherQueueSeqs;

     // Roll this queue forward, one submission at a time.
@@ -4679,7 +4697,6 @@
                 dev_data->eventMap[eventStagePair.first].stageMask = eventStagePair.second;
             }

-            skip_call |= cleanInFlightCmdBuffer(dev_data, cb);
             removeInFlightCmdBuffer(dev_data, cb);
         }

@@ -4694,10 +4711,8 @@

     // Roll other queues forward to the highest seq we saw a wait for
     for (auto qs : otherQueueSeqs) {
-        skip_call |= RetireWorkOnQueue(dev_data, getQueueNode(dev_data, qs.first), qs.second);
-    }
-
-    return skip_call;
+        RetireWorkOnQueue(dev_data, getQueueNode(dev_data, qs.first), qs.second);
+    }
 }

@@ -5191,22 +5206,19 @@
     return skip_call;
 }

-static bool RetireFence(layer_data *dev_data, VkFence fence) {
+static void RetireFence(layer_data *dev_data, VkFence fence) {
     auto pFence = getFenceNode(dev_data, fence);
     if (pFence->signaler.first != VK_NULL_HANDLE) {
         /* Fence signaller is a queue -- use this as proof that prior operations
          * on that queue have completed.
          */
-        return RetireWorkOnQueue(dev_data,
-                                 getQueueNode(dev_data, pFence->signaler.first),
-                                 pFence->signaler.second);
+        RetireWorkOnQueue(dev_data, getQueueNode(dev_data, pFence->signaler.first), pFence->signaler.second);
     }
     else {
         /* Fence signaller is the WSI. We're not tracking what the WSI op
          * actually /was/ in CV yet, but we need to mark the fence as retired.
          */
         pFence->state = FENCE_RETIRED;
-        return false;
     }
 }

@@ -5214,22 +5226,21 @@
     bool skip = false;
     for (uint32_t i = 0; i < fence_count; i++) {
         skip |= verifyWaitFenceState(dev_data, fences[i], "vkWaitForFences");
+        skip |= VerifyQueueStateToFence(dev_data, fences[i]);
     }
     return skip;
 }

-static bool PostCallRecordWaitForFences(layer_data *dev_data, uint32_t fence_count, const VkFence *fences, VkBool32 wait_all) {
-    bool skip = false;
-    // When we know that all fences are complete we can retire any previous work
+static void PostCallRecordWaitForFences(layer_data *dev_data, uint32_t fence_count, const VkFence *fences, VkBool32 wait_all) {
+    // When we know that all fences are complete we can clean/remove their CBs
     if ((VK_TRUE == wait_all) || (1 == fence_count)) {
         for (uint32_t i = 0; i < fence_count; i++) {
-            skip |= RetireFence(dev_data, fences[i]);
+            RetireFence(dev_data, fences[i]);
         }
     }
     // NOTE : Alternate case not handled here is when some fences have completed. In
     //  this case for app to guarantee which fences completed it will have to call
-    //  vkGetFenceStatus() at which point we'll retire their previous work.
-    return skip;
+    //  vkGetFenceStatus() at which point we'll clean/remove their CBs if complete.
 }

 VKAPI_ATTR VkResult VKAPI_CALL
@@ -5246,11 +5257,9 @@

     if (result == VK_SUCCESS) {
         lock.lock();
-        skip = PostCallRecordWaitForFences(dev_data, fenceCount, pFences, waitAll);
+        PostCallRecordWaitForFences(dev_data, fenceCount, pFences, waitAll);
         lock.unlock();
     }
-    if (skip)
-        return VK_ERROR_VALIDATION_FAILED_EXT;
     return result;
 }

@@ -5258,7 +5267,7 @@
     return verifyWaitFenceState(dev_data, fence, "vkGetFenceStatus");
 }

-static bool PostCallRecordGetFenceStatus(layer_data *dev_data, VkFence fence) { return RetireFence(dev_data, fence); }
+static void PostCallRecordGetFenceStatus(layer_data *dev_data, VkFence fence) { RetireFence(dev_data, fence); }

 VKAPI_ATTR VkResult VKAPI_CALL GetFenceStatus(VkDevice device, VkFence fence) {
     layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
@@ -5271,11 +5280,9 @@
     VkResult result = dev_data->dispatch_table.GetFenceStatus(device, fence);
     if (result == VK_SUCCESS) {
         lock.lock();
-        skip |= PostCallRecordGetFenceStatus(dev_data, fence);
+        PostCallRecordGetFenceStatus(dev_data, fence);
         lock.unlock();
     }
-    if (skip)
-        return VK_ERROR_VALIDATION_FAILED_EXT;
     return result;
 }

@@ -5300,7 +5307,8 @@
     bool skip_call = false;
     std::unique_lock<std::mutex> lock(global_lock);
     auto pQueue = getQueueNode(dev_data, queue);
-    skip_call |= RetireWorkOnQueue(dev_data, pQueue, pQueue->seq + pQueue->submissions.size());
+    skip_call |= VerifyQueueStateToSeq(dev_data, pQueue, pQueue->seq + pQueue->submissions.size());
+    RetireWorkOnQueue(dev_data, pQueue, pQueue->seq + pQueue->submissions.size());
     lock.unlock();
     if (skip_call)
         return VK_ERROR_VALIDATION_FAILED_EXT;
@@ -5313,7 +5321,8 @@
     layer_data *dev_data = get_my_data_ptr(get_dispatch_key(device), layer_data_map);
     std::unique_lock<std::mutex> lock(global_lock);
     for (auto & queue : dev_data->queueMap) {
-        skip_call |= RetireWorkOnQueue(dev_data, &queue.second, queue.second.seq + queue.second.submissions.size());
+        skip_call |= VerifyQueueStateToSeq(dev_data, &queue.second, queue.second.seq + queue.second.submissions.size());
+        RetireWorkOnQueue(dev_data, &queue.second, queue.second.seq + queue.second.submissions.size());
     }
     lock.unlock();
     if (skip_call)


delete test printf

delete test printf

--- src/Sqlite.cpp
+++ src/Sqlite.cpp
@@ -389,8 +389,6 @@
 			db_t_meminfo.c_str(), memif->discount_rate, memif->threshold,
 			memif->state_num, memif->lk_num, memif->last_st, memif->last_act);

-	printf("query string: %s\n", query_str);
-
 	sqlite3_stmt *stmt;
 	int ret = sqlite3_prepare_v2(db_con, query_str, -1, &stmt, 0);

@@ -431,7 +429,7 @@
 		if (sqlite3_step(stmt) == SQLITE_ROW)
 		{
 			memif = (struct Memory_Info *) malloc(sizeof(struct Memory_Info));
-			memif->discount_rate = sqlite3_column_double(stmt, 2);
+			memif->discount_rate = sqlite3_column_double(stmt, 2);  // row 1 is Id
 			memif->threshold = sqlite3_column_double(stmt, 3);
 			memif->state_num = sqlite3_column_int(stmt, 4);
 			memif->lk_num = sqlite3_column_int(stmt, 5);


INTEGRATION: CWS removedrafts (1.49.26); FILE MERGED 2005/02/17 14:02:12 cd 1.49.26.1: #i42557# Move UNOIDL types from drafts to com

--- sfx2/source/dialog/cfg.cxx
+++ sfx2/source/dialog/cfg.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: cfg.cxx,v $
  *
- *  $Revision: 1.49 $
+ *  $Revision: 1.50 $
  *
- *  last change: $Author: rt $ $Date: 2005-02-02 14:02:34 $
+ *  last change: $Author: kz $ $Date: 2005-03-01 19:58:59 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -156,7 +156,7 @@
 #ifndef  _COM_SUN_STAR_SCRIPT_BROWSE_BROWSENODEFACTORYVIEWTYPE_HPP_
 #include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
 #endif
-#include <drafts/com/sun/star/frame/XModuleManager.hpp>
+#include <com/sun/star/frame/XModuleManager.hpp>
 #include <com/sun/star/frame/XDesktop.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/container/XEnumeration.hpp>
@@ -180,7 +180,7 @@
 #include <rtl/ustrbuf.hxx>

 static ::rtl::OUString SERVICE_UICATEGORYDESCRIPTION = ::rtl::OUString::createFromAscii("com.sun.star.ui.UICategoryDescription"         );
-static ::rtl::OUString SERVICE_UICMDDESCRIPTION      = ::rtl::OUString::createFromAscii("drafts.com.sun.star.frame.UICommandDescription");
+static ::rtl::OUString SERVICE_UICMDDESCRIPTION      = ::rtl::OUString::createFromAscii("com.sun.star.frame.UICommandDescription");

 SfxStylesInfo_Impl::SfxStylesInfo_Impl()
 {}
@@ -1210,11 +1210,11 @@
             Reference<XInterface> xDocumentModel = getDocumentModel(xCtx, nodeName );
             if ( xDocumentModel.is() )
             {
-                Reference< ::drafts::com::sun::star::frame::XModuleManager >
+                Reference< ::com::sun::star::frame::XModuleManager >
                     xModuleManager(
                         xCtx->getServiceManager()
                             ->createInstanceWithContext(
-                                ::rtl::OUString::createFromAscii("drafts." // xxx todo
+                                ::rtl::OUString::createFromAscii("" // xxx todo
                                       "com.sun.star.frame.ModuleManager"),
                                 xCtx ),
                             UNO_QUERY_THROW );


Convert lag to [0,1].

Convert lag to [0,1].

--- src/control/midi/glue.cpp
+++ src/control/midi/glue.cpp
@@ -207,6 +207,7 @@
 		die("makeconnection (midi)", "<lag> must be between 0 and 100");
 		return NULL;
 	}
+	lag *= 0.01;

 	if (args[4].isType(DoubleType))
 		chan = (int) args[4] - 1;		// convert to zero-based channel


fix fieldid_r

fix fieldid_r

--- operations.cpp
+++ operations.cpp
@@ -3419,6 +3419,7 @@
 			pcard->previous.position = pcard->current.position;
 			pcard->current.reason &= ~REASON_TEMPORARY;
 			pcard->fieldid = infos.field_id++;
+			pcard->fieldid_r = pcard->fieldid;
 			pcard->reset(RESET_LEAVE, RESET_EVENT);
 			pcard->clear_relate_effect();
 			remove_card(pcard);


layers: Fix crash in CreateGraphicsPipelines reading from moved-from ptr

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -4463,7 +4463,7 @@
     for (i = 0; i < count; i++) {
         if (pPipelines[i] != VK_NULL_HANDLE) {
             pipe_state[i]->pipeline = pPipelines[i];
-            dev_data->pipelineMap[pipe_state[i]->pipeline] = pipe_state[i].release();
+            dev_data->pipelineMap[pPipelines[i]] = pipe_state[i].release();
         }
     }

@@ -4505,7 +4505,7 @@
     for (i = 0; i < count; i++) {
         if (pPipelines[i] != VK_NULL_HANDLE) {
             pPipeState[i]->pipeline = pPipelines[i];
-            dev_data->pipelineMap[pPipeState[i]->pipeline] = pPipeState[i].release();
+            dev_data->pipelineMap[pPipelines[i]] = pPipeState[i].release();
         }
     }


cuda compute capability 5 uses libdevice 2.0

Former-commit-id: 833f5c6d861b4a54a019985da30366a66d609a57

--- src/Target.cpp
+++ src/Target.cpp
@@ -730,11 +730,10 @@

     // This table is based on the guidance at:
     // http://docs.nvidia.com/cuda/libdevice-users-guide/basic-usage.html#linking-with-libdevice
-    if (target.features & (Target::CUDACapability50 | Target::CUDACapability35)) {
-        // the cuda 6.0 sdk only comes with libdevice up to 3.5.
+    if (target.features Target::CUDACapability35) {
         module = get_initmod_ptx_compute_35_ll(c);
-    } else if (target.features & Target::CUDACapability32) {
-        // For some reason sm_32 uses libdevice 20
+    } else if (target.features & (Target::CUDACapability32 | Target::CUDACapability50)) {
+        // For some reason sm_32 and sm_50 use libdevice 20
         module = get_initmod_ptx_compute_20_ll(c);
     } else if (target.features & Target::CUDACapability30) {
         module = get_initmod_ptx_compute_30_ll(c);


fix: #90192# #90504# don't show empty groups

--- sfx2/source/dialog/cfg.cxx
+++ sfx2/source/dialog/cfg.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: cfg.cxx,v $
  *
- *  $Revision: 1.12 $
- *
- *  last change: $Author: cd $ $Date: 2001-08-03 18:07:12 $
+ *  $Revision: 1.13 $
+ *
+ *  last change: $Author: pb $ $Date: 2001-08-10 06:11:33 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -434,11 +434,33 @@
             const SfxSlot *pSfxSlot = SFX_SLOTPOOL().FirstSlot();
             if ( pSfxSlot )
             {
-                // Wenn Gruppe nicht leer
-                SvLBoxEntry *pEntry = InsertEntry( aName, NULL );
-                SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_FUNCTION, i );
-                aArr.Insert( pInfo, aArr.Count() );
-                pEntry->SetUserData( pInfo );
+                // Check if all entries are not useable. Don't
+                // insert a group without any useable function.
+                sal_Bool bActiveEntries = sal_False;
+                while ( pSfxSlot )
+                {
+                    USHORT nId = pSfxSlot->GetSlotId();
+#ifdef UNX
+                    if ( nId != SID_DESKTOPMODE && ( pSfxSlot->GetMode() & nMode ) )
+#else
+                    if ( pSfxSlot->GetMode() & nMode )
+#endif
+                    {
+                        bActiveEntries = sal_True;
+                        break;
+                    }
+
+                    pSfxSlot = SFX_SLOTPOOL().NextSlot();
+                }
+
+                if ( bActiveEntries )
+                {
+                    // Wenn Gruppe nicht leer
+                    SvLBoxEntry *pEntry = InsertEntry( aName, NULL );
+                    SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_FUNCTION, i );
+                    aArr.Insert( pInfo, aArr.Count() );
+                    pEntry->SetUserData( pInfo );
+                }
             }
         }
     }


Sanitize parsing of color look-up table

Sanitize parsing of color look-up table

BUG=skia:5443
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2079243003

Review-Url: https://codereview.chromium.org/2079243003

--- src/core/SkColorSpace.cpp
+++ src/core/SkColorSpace.cpp
@@ -317,6 +317,17 @@
         }
     }
     return false;
+}
+
+static bool safe_mul(uint32_t arg1, uint32_t arg2, uint32_t* result) {
+    uint64_t product64 = (uint64_t) arg1 * (uint64_t) arg2;
+    uint32_t product32 = (uint32_t) product64;
+    if (product32 != product64) {
+        return false;
+    }
+
+    *result = product32;
+    return true;
 }

 struct ICCTag {
@@ -658,10 +669,14 @@

 bool load_color_lut(SkColorLookUpTable* colorLUT, uint32_t inputChannels, uint32_t outputChannels,
                     const uint8_t* src, size_t len) {
-    if (len < 20) {
+    // 16 bytes reserved for grid points, 2 for precision, 2 for padding.
+    // The color LUT data follows after this header.
+    static constexpr uint32_t kColorLUTHeaderSize = 20;
+    if (len < kColorLUTHeaderSize) {
         SkColorSpacePrintf("Color LUT tag is too small (%d bytes).", len);
         return false;
     }
+    size_t dataLen = len - kColorLUTHeaderSize;

     SkASSERT(inputChannels <= SkColorLookUpTable::kMaxChannels && 3 == outputChannels);
     colorLUT->fInputChannels = inputChannels;
@@ -669,9 +684,21 @@
     uint32_t numEntries = 1;
     for (uint32_t i = 0; i < inputChannels; i++) {
         colorLUT->fGridPoints[i] = src[i];
-        numEntries *= src[i];
-    }
-    numEntries *= outputChannels;
+        if (0 == src[i]) {
+            SkColorSpacePrintf("Each input channel must have at least one grid point.");
+            return false;
+        }
+
+        if (!safe_mul(numEntries, src[i], &numEntries)) {
+            SkColorSpacePrintf("Too many entries in Color LUT.");
+            return false;
+        }
+    }
+
+    if (!safe_mul(numEntries, outputChannels, &numEntries)) {
+        SkColorSpacePrintf("Too many entries in Color LUT.");
+        return false;
+    }

     // Space is provided for a maximum of the 16 input channels.  Now we determine the precision
     // of the table values.
@@ -681,18 +708,24 @@
         case 2: // 16-bit data
             break;
         default:
-            SkColorSpacePrintf("Color LUT precision must be 8-bit or 16-bit.\n", len);
+            SkColorSpacePrintf("Color LUT precision must be 8-bit or 16-bit.\n");
             return false;
     }

-    if (len < 20 + numEntries * precision) {
+    uint32_t clutBytes;
+    if (!safe_mul(numEntries, precision, &clutBytes)) {
+        SkColorSpacePrintf("Too many entries in Color LUT.");
+        return false;
+    }
+
+    if (dataLen < clutBytes) {
         SkColorSpacePrintf("Color LUT tag is too small (%d bytes).", len);
         return false;
     }

     // Movable struct colorLUT has ownership of fTable.
     colorLUT->fTable = std::unique_ptr<float[]>(new float[numEntries]);
-    const uint8_t* ptr = src + 20;
+    const uint8_t* ptr = src + kColorLUTHeaderSize;
     for (uint32_t i = 0; i < numEntries; i++, ptr += precision) {
         if (1 == precision) {
             colorLUT->fTable[i] = ((float) ptr[i]) / 255.0f;


Tweaks for review feedback

Tweaks for review feedback

Signed-off-by: Chris Forbes <c3279c50043e18e9442c1ae071cafa0e7a4ca967@google.com>

--- layers/core_validation.cpp
+++ layers/core_validation.cpp
@@ -8926,19 +8926,18 @@

             if (!skip_call && attachment != VK_ATTACHMENT_UNUSED) {
                 sample_count |= (unsigned)pCreateInfo->pAttachments[attachment].samples;
-            }
-
-            if (!skip_call &&
-                subpass_performs_resolve &&
-                attachment != VK_ATTACHMENT_UNUSED &&
-                pCreateInfo->pAttachments[attachment].samples == VK_SAMPLE_COUNT_1_BIT) {
-                skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0,
-                                     __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
-                                     "CreateRenderPass:  Subpass %u requests multisample resolve, but renders to "
-                                     "attachment %u which has VK_SAMPLE_COUNT_1_BIT",
-                                     i, attachment);
-            }
-        }
+
+                if (subpass_performs_resolve &&
+                    pCreateInfo->pAttachments[attachment].samples == VK_SAMPLE_COUNT_1_BIT) {
+                    skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VkDebugReportObjectTypeEXT(0), 0,
+                                         __LINE__, DRAWSTATE_INVALID_RENDERPASS, "DS",
+                                         "CreateRenderPass:  Subpass %u requests multisample resolve from attachment %u "
+                                         "which has VK_SAMPLE_COUNT_1_BIT",
+                                         i, attachment);
+                }
+            }
+        }
+
         if (subpass.pDepthStencilAttachment && subpass.pDepthStencilAttachment->attachment != VK_ATTACHMENT_UNUSED) {
             uint32_t attachment = subpass.pDepthStencilAttachment->attachment;
             skip_call |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Depth stencil");
@@ -8947,6 +8946,7 @@
                 sample_count |= (unsigned)pCreateInfo->pAttachments[attachment].samples;
             }
         }
+
         for (uint32_t j = 0; j < subpass.inputAttachmentCount; ++j) {
             uint32_t attachment = subpass.pInputAttachments[j].attachment;
             skip_call |= ValidateAttachmentIndex(dev_data, attachment, pCreateInfo->attachmentCount, "Input");


INTEGRATION: CWS warningfixes03_SRC680 (1.6.86); FILE MERGED 2006/08/18 15:03:42 mhu 1.6.86.1: #i68745# Fixed GCC 4.0.x warning(s).

--- sfx2/source/doc/iframe.cxx
+++ sfx2/source/doc/iframe.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: iframe.cxx,v $
  *
- *  $Revision: 1.6 $
- *
- *  last change: $Author: hr $ $Date: 2006-06-19 22:28:34 $
+ *  $Revision: 1.7 $
+ *
+ *  last change: $Author: ihi $ $Date: 2006-08-29 11:16:29 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -237,25 +237,25 @@
     }
     else if ( aPropertyName.equalsAscii("FrameIsAutoScroll") )
     {
-        sal_Bool bIsAutoScroll;
+        sal_Bool bIsAutoScroll = sal_Bool();
         if ( (aAny >>= bIsAutoScroll) && bIsAutoScroll )
             maFrmDescr.SetScrollingMode( ScrollingAuto );
     }
     else if ( aPropertyName.equalsAscii("FrameIsScrollingMode") )
     {
-        sal_Bool bIsScroll;
+        sal_Bool bIsScroll = sal_Bool();
         if ( aAny >>= bIsScroll )
             maFrmDescr.SetScrollingMode( bIsScroll ? ScrollingYes : ScrollingNo );
     }
     else if ( aPropertyName.equalsAscii("FrameIsBorder") )
     {
-        sal_Bool bIsBorder;
+        sal_Bool bIsBorder = sal_Bool();
         if ( aAny >>= bIsBorder )
             maFrmDescr.SetFrameBorder( bIsBorder );
     }
     else if ( aPropertyName.equalsAscii("FrameIsAutoBorder") )
     {
-        sal_Bool bIsAutoBorder;
+        sal_Bool bIsAutoBorder = sal_Bool();
         if ( (aAny >>= bIsAutoBorder) )
         {
             BOOL bBorder = maFrmDescr.IsFrameBorderOn();


Fix CopyPixels() bug

Fix CopyPixels() bug

BUG=skia:

Change-Id: I102fa9f4b16caa1c00602af1a89a0a0372e047b2
Reviewed-on: https://skia-review.googlesource.com/8303
Reviewed-by: Matt Sarett <bb43c9b8214fcf1292f134c9714ba8a0e7075913@google.com>
Reviewed-by: Mike Klein <14574f09dfa9b4e14759b88c3426a495a0e627b0@chromium.org>
Commit-Queue: Matt Sarett <bb43c9b8214fcf1292f134c9714ba8a0e7075913@google.com>

--- src/core/SkConfig8888.cpp
+++ src/core/SkConfig8888.cpp
@@ -328,7 +328,7 @@

     //  Try the pipeline
     //
-    if (copy_pipeline_pixels(dstInfo, dstPixels, dstRB, srcInfo, srcPixels, srcRB, ctable)) {
+    if (copy_pipeline_pixels(dstInfo, dstPixels, dstRB, srcInfo, srcPixels, srcRB, isColorAware)) {
         return true;
     }


Fixed #4

Fixed #4

--- src/TrisDb.cpp
+++ src/TrisDb.cpp
@@ -157,22 +157,19 @@
     // sleep
     LogManager::getSingleton()->log(LogManager::LINFO, "Database ready");
     while (!TrisDb::_terminateLoop) {
-        std::chrono::milliseconds dura(2000);
+        std::chrono::milliseconds dura(1000);
         std::this_thread::sleep_for(dura);
     }
     // SIGTERM received, stop servers
     for (auto &i : this->_servers) {
         i->stop();
     }
-    // give the other threads time to terminate
-    // TODO:    this isn't very secure because if there are queries going on it
-    //          could take longer to close TCP or Unix Socket connections.
-    //          We should wait for a message/signal from the threads
-    sleep(2);
+    // give the IO threads time to terminate
+    sleep(1);
     StorageEngine::getSingleton()->syncSave(&this->dbData, this->_config->getSetting("dbfolder"));
 }

 void TrisDb::stop(int param) {
     LogManager::getSingleton()->log(LogManager::LINFO, "Received signal SIGTERM");
     TrisDb::_terminateLoop = 1;
-}+}


Return a pointer from build_peel_index().

--- lib/writer.cc
+++ lib/writer.cc
@@ -446,18 +446,24 @@
 }

 template<class T>
-static void
+static T *
 build_peel_index(struct rgph_graph *g)
 {
-	T *order = (T *)g->order;
 	T *index = (T *)g->oedges; // Reuse oedges.

-	memset(index, 0, sizeof(T) * g->nkeys);
-
-	for (size_t i = g->nkeys; i > g->core_size; i--) {
-		assert(index[order[i-1]] == 0);
-		index[order[i-1]] = g->nkeys - i + 1;
-	}
+	if (!(g->flags & INDEXED)) {
+		T *order = (T *)g->order;
+
+		g->flags |= INDEXED;
+		memset(index, 0, sizeof(T) * g->nkeys);
+
+		for (size_t i = g->nkeys; i > g->core_size; i--) {
+			assert(index[order[i-1]] == 0);
+			index[order[i-1]] = g->nkeys - i + 1;
+		}
+	}
+
+	return index;
 }

 template<class T, int R>


Check that dlopen did not fail

Check that dlopen did not fail

--- libglfork.cpp
+++ libglfork.cpp
@@ -23,6 +23,7 @@
     assert(lib && lib[0] == '/');
     handle = dlopen(lib, RTLD_LAZY);
     primus_trace("loading %s: %p\n", lib, handle);
+    assert(handle);
 #define DEF_GLX_PROTO(ret, name, args, ...) name = (ret (*) args)dlsym(handle, #name);
 #include "glx-reimpl.def"
 #include "glx-dpyredir.def"


[dtls] simplify logging (#3660)

[dtls] simplify logging (#3660)

--- src/core/meshcop/dtls.cpp
+++ src/core/meshcop/dtls.cpp
@@ -256,6 +256,7 @@
 {
     otError error = OT_ERROR_NONE;

+    VerifyOrExit(mSocket.GetSockName().mPort == 0, error = OT_ERROR_ALREADY);
     VerifyOrExit(mTransportCallback == NULL, error = OT_ERROR_ALREADY);

     mState = kStateStopped;
@@ -1007,50 +1008,27 @@
     OT_UNUSED_VARIABLE(str);

     Dtls *pThis = static_cast<Dtls *>(ctx);
-
-    if (pThis->mCipherSuites[0] == MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8)
-    {
-        switch (level)
-        {
-        case 1:
-            otLogCritMbedTls("%s", str);
-            break;
-
-        case 2:
-            otLogWarnMbedTls("%s", str);
-            break;
-
-        case 3:
-            otLogInfoMbedTls("%s", str);
-            break;
-
-        case 4:
-        default:
-            otLogDebgMbedTls("%s", str);
-            break;
-        }
-    }
-#if OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
-    else
-    {
-        switch (level)
-        {
-        case 1:
-            otLogCritCoap("ApplicationCoapSecure Mbedtls: %s", str);
-            break;
-        case 2:
-            otLogWarnCoap("ApplicationCoapSecure Mbedtls: %s", str);
-            break;
-        case 3:
-            otLogInfoCoap("ApplicationCoapSecure Mbedtls: %s", str);
-            break;
-        case 4:
-        default:
-            otLogDebgCoap("ApplicationCoapSecure Mbedtls: %s", str);
-            break;
-        }
-    }
-#endif // OPENTHREAD_ENABLE_APPLICATION_COAP_SECURE
+    OT_UNUSED_VARIABLE(pThis);
+
+    switch (level)
+    {
+    case 1:
+        otLogCritMbedTls("[%hu] %s", pThis->mSocket.GetSockName().mPort, str);
+        break;
+
+    case 2:
+        otLogWarnMbedTls("[%hu] %s", pThis->mSocket.GetSockName().mPort, str);
+        break;
+
+    case 3:
+        otLogInfoMbedTls("[%hu] %s", pThis->mSocket.GetSockName().mPort, str);
+        break;
+
+    case 4:
+    default:
+        otLogDebgMbedTls("[%hu] %s", pThis->mSocket.GetSockName().mPort, str);
+        break;
+    }
 }

 otError Dtls::HandleDtlsSend(const uint8_t *aBuf, uint16_t aLength, uint8_t aMessageSubType)


moved over to the proper rng from doing it all wrong before

--- src/Vector.cpp
+++ src/Vector.cpp
@@ -27,17 +27,14 @@
 }

-void Vector::seed() {
-	std::srand(std::time(NULL));
-}
-

 Vector Vector::random(double r) {

-	r *= std::rand();
-
-	double t = TAU * std::rand(),
-		   p = PI * std::rand(),
+	RNG *rng = RNG::get();
+	r *= rng->next();
+
+	double t = TAU * rng->next(),
+		   p = PI * rng->next(),
 		   rcosp = r * std::sin(p);

 	return Vector(


Fix VM move, and set state in method release as well

--- src/Wren++.cpp
+++ src/Wren++.cpp
@@ -213,6 +213,7 @@
     if (refCount_) {
         *refCount_ -= 1u;
         if (*refCount_ == 0u) {
+            vm_->setState_();   // wrenReelaseValue will cause wren to free memory
             wrenReleaseValue(vm_->vm(), method_);
             wrenReleaseValue(vm_->vm(), variable_);
             delete refCount_;
@@ -306,12 +307,14 @@
 }

 VM::VM(VM&& other )
-:   vm_( other.vm_ ) {
+    : vm_{ other.vm_ },
+    allocator_{ std::move(other.allocator_) } {
     other.vm_ = nullptr;
 }

 VM& VM::operator=(VM&& rhs ) {
     vm_             = rhs.vm_;
+    allocator_      = std::move(rhs.allocator_);
     rhs.vm_         = nullptr;
     return *this;
 }


Fix node skipping adding the parent and not the actual to be locked node

--- src/core/vsthreadpool.cpp
+++ src/core/vsthreadpool.cpp
@@ -102,15 +102,14 @@
                 break;
             }

-            if (seenNodes.count(mainContext->clip))
-                continue;
-            seenNodes.insert(mainContext->clip);
-
             bool hasLeafContext = mainContext->returnedFrame || mainContext->hasError();
             if (hasLeafContext) {
                 leafContext = mainContext;
                 mainContext = mainContext->upstreamContext.get();
             }
+
+            if (!seenNodes.insert(mainContext->clip).second)
+                continue;

             VSNode *clip = mainContext->clip;
             int filterMode = clip->filterMode;
@@ -139,11 +138,8 @@
             } else if (filterMode == fmParallel) {
                 std::lock_guard<std::mutex> lock(clip->concurrentFramesMutex);
                 // is the filter already processing another call for this frame? if so move along
-                if (clip->concurrentFrames.count(mainContext->n)) {
+                if (!clip->concurrentFrames.insert(mainContext->n).second)
                     continue;
-                } else {
-                    clip->concurrentFrames.insert(mainContext->n);
-                }
             } else if (filterMode == fmParallelRequests) {
                 std::lock_guard<std::mutex> lock(clip->concurrentFramesMutex);
                 // do we need the serial lock since all frames will be ready this time?
@@ -151,10 +147,6 @@
                 if (mainContext->numFrameRequests == 1) {
                     if (!clip->serialMutex.try_lock())
                         continue;
-                    if (!clip->concurrentFrames.insert(mainContext->n).second) {
-                        clip->serialMutex.unlock();
-                        continue;
-                    }
                     parallelRequestsNeedsUnlock = true;
                 } else {
                     // is the filter already processing another call for this frame? if so move along


Add restartListening() to resume RX in "continuous mode" (not single packet) on last used channel.

--- src/ZetaRf.hpp
+++ src/ZetaRf.hpp
@@ -443,6 +443,13 @@

         return startListeningSinglePacket(m_listeningChannel, m_packetLength);
     }
+    bool restartListening()
+    {
+        if (!waitUntilOutOfTx(20))
+            return false;
+
+        return startListening(m_listeningChannel, m_packetLength);
+    }

     //! Space left in TX FIFO


simplify some code and unbreak the build by not consuming an
extra token.

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

--- lib/AsmParser/LLParser.cpp
+++ lib/AsmParser/LLParser.cpp
@@ -503,28 +503,22 @@
   return false;
 }

-///ParseNamedMetadata:
+/// ParseNamedMetadata:
 ///   !foo = !{ !1, !2 }
 bool LLParser::ParseNamedMetadata() {
   assert(Lex.getKind() == lltok::NamedOrCustomMD);
   Lex.Lex();
   std::string Name = Lex.getStrVal();

-  if (ParseToken(lltok::equal, "expected '=' here"))
+  if (ParseToken(lltok::equal, "expected '=' here") ||
+      ParseToken(lltok::Metadata, "Expected '!' here") ||
+      ParseToken(lltok::lbrace, "Expected '{' here"))
     return true;

-  if (Lex.getKind() != lltok::Metadata)
-    return TokError("Expected '!' here");
-  Lex.Lex();
-
-  if (Lex.getKind() != lltok::lbrace)
-    return TokError("Expected '{' here");
-  Lex.Lex();
   SmallVector<MetadataBase *, 8> Elts;
   do {
     if (ParseToken(lltok::Metadata, "Expected '!' here"))
       return true;
-    Lex.Lex();

     // FIXME: This rejects MDStrings.  Are they legal in an named MDNode or not?
     MDNode *N = 0;


Added deque to ctf containters

Added deque to ctf containters

--- src/ctf_generic_types.hpp
+++ src/ctf_generic_types.hpp
@@ -33,6 +33,7 @@
 using std::map;
 using std::unordered_map;
 using std::queue;
+using std::deque;
 using std::stack;

 /**


Fix a logic error. An instruction that has a live physical register def cannot be CSE'ed, but it *can* be used to replace a common subexpression.

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

--- lib/CodeGen/MachineCSE.cpp
+++ lib/CodeGen/MachineCSE.cpp
@@ -128,8 +128,6 @@
     if (TII->isMoveInstr(*MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) ||
         MI->isExtractSubreg() || MI->isInsertSubreg() || MI->isSubregToReg())
       continue;
-    if (hasLivePhysRegDefUse(MI))
-      continue;

     bool FoundCSE = VNT.count(MI);
     if (!FoundCSE) {
@@ -137,6 +135,11 @@
       if (PerformTrivialCoalescing(MI, MBB))
         FoundCSE = VNT.count(MI);
     }
+
+    // If the instruction defines a physical register and the value *may* be
+    // used, then it's not safe to replace it with a common subexpression.
+    if (FoundCSE && hasLivePhysRegDefUse(MI))
+      FoundCSE = false;

     if (!FoundCSE) {
       VNT.insert(MI, CurrVN++);


Remove special handling for opaque Neon vector types.
Clang does not wrap the vectors in structs anymore so this isn't needed.

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

--- lib/CodeGen/TargetInfo.cpp
+++ lib/CodeGen/TargetInfo.cpp
@@ -2241,15 +2241,6 @@
   if (isRecordWithNonTrivialDestructorOrCopyConstructor(Ty))
     return ABIArgInfo::getIndirect(0, /*ByVal=*/false);

-  // NEON vectors are implemented as (theoretically) opaque structures wrapping
-  // the underlying vector type. We trust the backend to pass the underlying
-  // vectors appropriately, so we can unwrap the structs which generally will
-  // lead to much cleaner IR.
-  if (const Type *SeltTy = isSingleElementStruct(Ty, getContext())) {
-    if (SeltTy->isVectorType())
-      return ABIArgInfo::getDirect(CGT.ConvertType(QualType(SeltTy, 0)));
-  }
-
   // Otherwise, pass by coercing to a structure of the appropriate size.
   //
   // FIXME: This is kind of nasty... but there isn't much choice because the ARM


Fix a comment typo.

Fix a comment typo.

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

--- lib/CodeGen/TargetInfo.cpp
+++ lib/CodeGen/TargetInfo.cpp
@@ -3464,7 +3464,7 @@
   CGF.Builder.CreateCondBr(UsingStack, OnStackBlock, MaybeRegBlock);

   // Otherwise, at least some kind of argument could go in these registers, the
-  // quesiton is whether this particular type is too big.
+  // question is whether this particular type is too big.
   CGF.EmitBlock(MaybeRegBlock);

   // Integer arguments may need to correct register alignment (for example a


被攻击状态停止不可能达成的PC

被攻击状态停止不可能达成的PC

--- src/ai_zzz.cpp
+++ src/ai_zzz.cpp
@@ -568,7 +568,7 @@
                 b2b = true;
                 break;
             }
-            if(history[i].count == 0)
+            if(history[i].count == 0 && up == 0)
             {
                 attack += 6;
             }


i965/vs: Allow copy propagation into MUL/MACH.

This is a trivial port of 1d6ead38042cc0d1e667d8ff55937c1e32d108b1 from
the FS.

No significant performance difference on trex (misplaced the data, but it
was about n=20).

Reviewed-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Reviewed-by: Matt Turner <789b315743a28dd066a4ba1459c35951c291d8a6@gmail.com>

--- src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -95,6 +95,7 @@
       inst->src[arg] = value;
       return true;

+   case BRW_OPCODE_MACH:
    case BRW_OPCODE_MUL:
    case BRW_OPCODE_ADD:
       if (arg == 1) {
@@ -102,9 +103,10 @@
 	 return true;
       } else if (arg == 0 && inst->src[1].file != IMM) {
 	 /* Fit this constant in by commuting the operands.  Exception: we
-	  * can't do this for 32-bit integer MUL because it's asymmetric.
-	  */
-	 if (inst->opcode == BRW_OPCODE_MUL &&
+	  * can't do this for 32-bit integer MUL/MACH because it's asymmetric.
+	  */
+	 if ((inst->opcode == BRW_OPCODE_MUL ||
+              inst->opcode == BRW_OPCODE_MACH) &&
 	     (inst->src[1].type == BRW_REGISTER_TYPE_D ||
 	      inst->src[1].type == BRW_REGISTER_TYPE_UD))
 	    break;


Close database and assert afterwards on the result.

rdar://55274300

--- lib/Core/SQLiteBuildDB.cpp
+++ lib/Core/SQLiteBuildDB.cpp
@@ -327,7 +327,9 @@
     sqlite3_finalize(getKeysWithResultStmt);
     getKeysWithResultStmt = nullptr;

-    assert(sqlite3_close(db) == SQLITE_OK && "The database connection could not be closed. That means there are prepared statements that are not finalized, data blobs that are not closed or backups not finished.");
+    int result;
+    result = sqlite3_close(db);
+    assert(result == SQLITE_OK && "The database connection could not be closed. That means there are prepared statements that are not finalized, data blobs that are not closed or backups not finished.");
     db = nullptr;
   }


DepositionGeant4: always activate decay physics lists (FIXME: affects non-decaying particles or speed?)

--- src/modules/DepositionGeant4/DepositionGeant4Module.cpp
+++ src/modules/DepositionGeant4/DepositionGeant4Module.cpp
@@ -14,10 +14,12 @@
 #include <string>
 #include <utility>

+#include <G4DecayPhysics.hh>
 #include <G4EmParameters.hh>
 #include <G4HadronicProcessStore.hh>
 #include <G4LogicalVolume.hh>
 #include <G4PhysListFactory.hh>
+#include <G4RadioactiveDecayPhysics.hh>
 #include <G4RunManager.hh>
 #include <G4StepLimiterPhysics.hh>
 #include <G4UImanager.hh>
@@ -143,6 +145,10 @@
     }
     // Register a step limiter (uses the user limits defined earlier)
     physicsList->RegisterPhysics(new G4StepLimiterPhysics());
+
+    // Radioactive decay
+    physicsList->RegisterPhysics(new G4DecayPhysics());
+    physicsList->RegisterPhysics(new G4RadioactiveDecayPhysics());

     // Set the range-cut off threshold for secondary production:
     double production_cut;


[Driver] Move markFinished to PerformJobsState, add logging.

--- lib/Driver/Compilation.cpp
+++ lib/Driver/Compilation.cpp
@@ -187,6 +187,28 @@
       TQ->addTask(Cmd->getExecutable(), Cmd->getArguments(), llvm::None,
                   (void *)Cmd);
     }
+
+    // When a task finishes, we need to reevaluate the other commands that
+    // might have been blocked.
+    void markFinished(const Job *Cmd) {
+      if (Comp.ShowIncrementalBuildDecisions) {
+        llvm::outs() << "Job finished: " << LogJob(Cmd) << "\n";
+      }
+      FinishedCommands.insert(Cmd);
+
+      auto BlockedIter = BlockingCommands.find(Cmd);
+      if (BlockedIter != BlockingCommands.end()) {
+        auto AllBlocked = std::move(BlockedIter->second);
+        if (Comp.ShowIncrementalBuildDecisions) {
+          llvm::outs() << "Scheduling maybe-unblocked jobs: "
+                       << LogJobArray(AllBlocked) << "\n";
+        }
+        BlockingCommands.erase(BlockedIter);
+        for (auto *Blocked : AllBlocked)
+          scheduleCommandIfNecessaryAndPossible(Blocked);
+    }
+  }
+
   };
 } // driver
 } // swift
@@ -387,21 +409,6 @@
                                  [](raw_ostream &out, const Job *base) {
       out << llvm::sys::path::filename(base->getOutput().getBaseInput(0));
     });
-  };
-
-
-  // When a task finishes, we need to reevaluate the other commands that
-  // might have been blocked.
-  auto markFinished = [&] (const Job *Cmd) {
-    State.FinishedCommands.insert(Cmd);
-
-    auto BlockedIter = State.BlockingCommands.find(Cmd);
-    if (BlockedIter != State.BlockingCommands.end()) {
-      auto AllBlocked = std::move(BlockedIter->second);
-      State.BlockingCommands.erase(BlockedIter);
-      for (auto *Blocked : AllBlocked)
-        State.scheduleCommandIfNecessaryAndPossible(Blocked);
-    }
   };

   // Schedule all jobs we can.
@@ -656,7 +663,7 @@

     // When a task finishes, we need to reevaluate the other commands that
     // might have been blocked.
-    markFinished(FinishedCmd);
+    State.markFinished(FinishedCmd);

     for (const Job *Cmd : Dependents) {
       DeferredCommands.erase(Cmd);
@@ -718,7 +725,7 @@
       }

       State.ScheduledCommands.insert(Cmd);
-      markFinished(Cmd);
+      State.markFinished(Cmd);
     }

     // ...which may allow us to go on and do later tasks.


DesktopController: Pixel buffer is no longer newed

--- src/desktopcontroller.cpp
+++ src/desktopcontroller.cpp
@@ -51,16 +51,17 @@
   screen.initialize(0); //FIXME load from settings
   //FIXME initialize() can fail(returns a boolean)
   //FIXME this works as long as the pixel format from Screen is always ARGB
-  QRgb* buffer = new QRgb[screen.getHeight() * screen.getWidth()];
+  std::vector<QRgb> buffer;
+  buffer.resize(screen.getHeight() * screen.getWidth());
   std::vector<Region> regions;
   generateRegions(regions, screen.getWidth(), screen.getHeight());

   while(active)
   {
-    screen.getScreenBitmap(buffer);
+    screen.getScreenBitmap(buffer.data());
     for(const Region& region : regions)
     {
-      const QRgb avg = getAvgOfRegion(region.rect, buffer, screen.getWidth());
+      const QRgb avg = getAvgOfRegion(region.rect, buffer.data(), screen.getWidth());
       pLight->setColor(region.ledIndex, qRed(avg), qGreen(avg), qBlue(avg));
     }
     pLight->sendColors();
@@ -74,7 +75,6 @@

     QThread::msleep(5);
   }
-  delete buffer; //FIXME use scoped destruction
 }

 QRgb DesktopController::getAvgOfRegion(const QRect& region, QRgb* pBuffer, const int screenWidth) const


Use range loops. NFC.

Use range loops. NFC.

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

--- lib/Linker/LinkModules.cpp
+++ lib/Linker/LinkModules.cpp
@@ -1153,17 +1153,16 @@
 /// referenced are in Dest.
 void ModuleLinker::linkGlobalInits() {
   // Loop over all of the globals in the src module, mapping them over as we go
-  for (Module::const_global_iterator I = SrcM->global_begin(),
-       E = SrcM->global_end(); I != E; ++I) {
-
+  for (GlobalVariable &Src : SrcM->globals()) {
     // Only process initialized GV's or ones not already in dest.
-    if (!I->hasInitializer() || DoNotLinkFromSource.count(I)) continue;
+    if (!Src.hasInitializer() || DoNotLinkFromSource.count(&Src))
+      continue;

     // Grab destination global variable.
-    GlobalVariable *DGV = cast<GlobalVariable>(ValueMap[I]);
+    GlobalVariable *Dst = cast<GlobalVariable>(ValueMap[&Src]);
     // Figure out what the initializer looks like in the dest module.
-    DGV->setInitializer(MapValue(I->getInitializer(), ValueMap,
-                                 RF_None, &TypeMap, &ValMaterializer));
+    Dst->setInitializer(MapValue(Src.getInitializer(), ValueMap, RF_None,
+                                 &TypeMap, &ValMaterializer));
   }
 }

@@ -1221,12 +1220,11 @@

 /// Insert all of the aliases in Src into the Dest module.
 void ModuleLinker::linkAliasBodies() {
-  for (Module::alias_iterator I = SrcM->alias_begin(), E = SrcM->alias_end();
-       I != E; ++I) {
-    if (DoNotLinkFromSource.count(I))
-      continue;
-    if (Constant *Aliasee = I->getAliasee()) {
-      GlobalAlias *DA = cast<GlobalAlias>(ValueMap[I]);
+  for (GlobalAlias &Src : SrcM->aliases()) {
+    if (DoNotLinkFromSource.count(&Src))
+      continue;
+    if (Constant *Aliasee = Src.getAliasee()) {
+      GlobalAlias *DA = cast<GlobalAlias>(ValueMap[&Src]);
       Constant *Val =
           MapValue(Aliasee, ValueMap, RF_None, &TypeMap, &ValMaterializer);
       DA->setAliasee(Val);


Remove dead code. We are only lazy about functions with bodies.

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

--- lib/Linker/LinkModules.cpp
+++ lib/Linker/LinkModules.cpp
@@ -1518,9 +1518,6 @@
     Function *SF = LazilyLinkFunctions.back();
     LazilyLinkFunctions.pop_back();

-    if (!SF)
-      continue;
-
     Function *DF = cast<Function>(ValueMap[SF]);
     if (SF->hasPrefixData()) {
       // Link in the prefix data.
@@ -1532,11 +1529,8 @@
     if (std::error_code EC = SF->materialize())
       return emitError(EC.message());

-    // Skip if no body (function is external).
-    if (SF->isDeclaration())
-      continue;
-
     // Link in function body.
+    assert(!SF->isDeclaration());
     linkFunctionBody(DF, SF);
     SF->Dematerialize();
   }