Fix a few typos.

Fix a few typos.

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@29536 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/doc/news/changes.h
+++ deal.II/doc/news/changes.h
@@ -167,7 +167,7 @@
 MatrixTools::create_laplace_matrix take now an optional ConstraintMatrix
 argument that allows to directly apply the constraints. This also helps
 VectorTools::project. Note that not providing constraints remains the default
-and recommended way to ensure consistency when several matrices are added.
+and recommended way to ensure consistency when several matrices are combined.

 (Martin Kronbichler, 2013/05/08)

@@ -187,8 +187,8 @@

 New: The class ChunkSparseMatrix and the associated
-ChunkSparsityPattern now offer iterator classes to iterate over rows or the
-whole matrix in an STL-like way.
+ChunkSparsityPattern now offer iterator classes to iterate over rows of the
+matrix in an STL-like way.

 (Martin Kronbichler, 2013/05/07)

@@ -204,8 +204,8 @@
 iterations of the modified Gram–Schmidt algorithm for
 orthogonalization. In many situations one iteration is enough. The algorithm
 can now detect loss of orthogonality and enables re-orthogonalization only if
-necessary. The second iteration can be forced by the flag
-SolverGMRES::AdditionalData::force_re_orthogonalization, though.
+necessary. The second iteration (and, hence, old behavior) can be forced by
+the flag SolverGMRES::AdditionalData::force_re_orthogonalization.

 (Martin Kronbichler, 2013/05/06)

@@ -216,7 +216,7 @@
 (Wolfgang Bangerth, 2013/05/06)

-
 Fixed: Generate an error if the users tries to refine a cell
+
 Fixed: Generate an error if the user tries to refine a cell
 that is already on the maximum level in a distributed triangulation.

 (Timo Heister, 2013/05/01)


document bug fix

document bug fix

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@21554 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/doc/news/changes.h
+++ deal.II/doc/news/changes.h
@@ -158,9 +158,15 @@

lac

-

-
None.
-

+

Fixed: SparseMatrix::precondition_SSOR and
+  SparseMatrixEZ::precondition_SSOR had a bug, which made the SSOR
+  method inaccurate for relaxation parameters different from unity.
+

+  (GK 2010/07/20)
+

+
+

+


Create training_days.c

Create training_days.c

error: pathspec 'Code/Other/training_days.c' did not match any file(s) known to git

--- Code/Other/training_days.c
+++ Code/Other/training_days.c
@@ -0,0 +1,161 @@
+#include <stdio.h>
+
+
+int weekday(int day, int month, int year){
+	//monday - 1, tuesday - 2,etc...
+	if(day<0 || day>31) return -1; //wrong input
+	else if(month<0 || month>12) return -1; //wrong input
+	else if(year<0) return -1; //wrong input
+	else return (day += month < 3 ? year-- : year - 2, 23*month/9 + day + 4 + year/4- year/100 + year/400)%7;
+}
+
+void print_weekday_name(int day, int month,int year){
+	int result = weekday(day,month,year);
+	if(result == 1){
+	 	printf("Monday");
+	}
+	else if(result == 2){
+		 printf("Tuesday");
+	}
+	else if(result == 3){
+		 printf("Wednesday");
+	}
+	else if(result == 4){
+		 printf("Thursday");
+	}
+	else if(result == 4){
+		 printf("Friday");
+	}
+	else if(#include <stdio.h>
+
+
+int weekday(int day, int month, int year){
+	//monday - 1, tuesday - 2,etc...
+	if(day<0 || day>31) return -1; //wrong input
+	else if(month<0 || month>12) return -1; //wrong input
+	else if(year<0) return -1; //wrong input
+	else return (day += month < 3 ? year-- : year - 2, 23*month/9 + day + 4 + year/4- year/100 + year/400)%7;
+}
+
+void print_weekday_name(int day, int month,int year){
+	int result = weekday(day,month,year);
+	if(result == 1){
+	 	printf("Monday");
+	}
+	else if(result == 2){
+		 printf("Tuesday");
+	}
+	else if(result == 3){
+		 printf("Wednesday");
+	}
+	else if(result == 4){
+		 printf("Thursday");
+	}
+	else if(result == 4){
+		 printf("Friday");
+	}
+	else if(result == 6){
+		 printf("Saturday");
+	}
+	else if(result == 7){
+		 printf("Sunday");
+	}
+	if(result == 0) printf("Whut");
+}
+
+void training_days(){
+	//reads dates until EOF and counts how much for each day
+	int day,month, year;
+	int result;
+	int Mon = 0, Tues= 0, Wed = 0, Thurs = 0, Fri = 0, Sat = 0, Sun = 0;
+	while(scanf("%d:%d:%d",&day,&month,&year)!= EOF){
+		result = 0;
+		result = weekday(day,month,year);
+		if(result+1 == 1){
+	 		Mon += 1;
+		}
+		else if(result+1 == 2){
+			 Tues += 1;
+		}
+		else if(result+1 == 3){
+			 Wed += 1;
+		}
+		else if(result+1 == 4){
+			 Thurs += 1;
+		}
+		else if(result+1 == 4){
+			 Fri += 1;
+		}
+		else if(result+1 == 6){
+			 Sat += 1;
+		}
+		else if(result+1 == 7){
+			 Sun += 1;
+		}
+		else{
+			printf("Error!!! This date was not added, check it please\n");
+		}
+	}
+
+	//print how many trainings per month
+	printf("Mon: %d\nTues: %d\nWed: %d\nThur: %d\nFri: %d\nSat: %d\nSun: %d\n",Mon,Tues,Wed,Thurs,Fri,Sat,Sun);
+}
+
+
+int main(){
+	printf("Enter the dates you will be training in the dd:mm:yy format\n");
+	training_days();
+	return 0;
+}result == 6){
+		 printf("Saturday");
+	}
+	else if(result == 7){
+		 printf("Sunday");
+	}
+	if(result == 0) printf("Whut");
+}
+
+void training_days(){
+	//reads dates until EOF and counts how much for each day
+	int day,month, year;
+	int result;
+	int Mon = 0, Tues= 0, Wed = 0, Thurs = 0, Fri = 0, Sat = 0, Sun = 0;
+	while(scanf("%d:%d:%d",&day,&month,&year)!= EOF){
+		result = 0;
+		result = weekday(day,month,year);
+		if(result+1 == 1){
+	 		Mon += 1;
+		}
+		else if(result+1 == 2){
+			 Tues += 1;
+		}
+		else if(result+1 == 3){
+			 Wed += 1;
+		}
+		else if(result+1 == 4){
+			 Thurs += 1;
+		}
+		else if(result+1 == 4){
+			 Fri += 1;
+		}
+		else if(result+1 == 6){
+			 Sat += 1;
+		}
+		else if(result+1 == 7){
+			 Sun += 1;
+		}
+		else{
+			printf("Error!!! This date was not added, check it please\n");
+		}
+	}
+
+	//print how many trainings per month
+	printf("Mon: %d\nTues: %d\nWed: %d\nThur: %d\nFri: %d\nSat: %d\nSun: %d\n",Mon,Tues,Wed,Thurs,Fri,Sat,Sun);
+}
+
+
+int main(){
+	printf("Enter the dates you will be training in the dd:mm:yy format\n");
+	training_days();
+	return 0;
+}


Create UsVulkan.h

Create UsVulkan.h

error: pathspec 'Code/RHI/Vulkan/UsVulkan.h' did not match any file(s) known to git

--- Code/RHI/Vulkan/UsVulkan.h
+++ Code/RHI/Vulkan/UsVulkan.h
@@ -0,0 +1,2 @@
+#include <UsPlatform.h>
+


Fix MSVC 2008 warning about valid STL usage.

"warning C4996: 'std::copy': Function call with parameters that may be
unsafe - this call relies on the caller to check that the passed values
are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS.
See documentation on how to use Visual C++ 'Checked Iterators'".

Because the std::copy destination is a raw pointer.

Some solutions to get std::copy to work with pointers:
http://choorucode.com/2010/08/30/visual-c-c4996-warning-on-copy-with-array-parameters/

So yeah...Let's go with memcpy.

Change-Id: If0ff6277625cf1f63535bec72598587d4b934afa

--- Common/Math/vtkMatrix4x4.h
+++ Common/Math/vtkMatrix4x4.h
@@ -26,8 +26,6 @@

 #include "vtkCommonMathModule.h" // For export macro
 #include "vtkObject.h"
-
-#include <algorithm> // For std::copy

 class VTKCOMMONMATH_EXPORT vtkMatrix4x4 : public vtkObject
 {
@@ -221,7 +219,7 @@
     }

   // Copy to final dest
-  std::copy(tmp, tmp + 16, c);
+  memcpy(c, tmp, 16 * sizeof(double));
 }

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


Add override.

Add override.

--- searchlib/src/vespa/searchlib/common/lambdatask.h
+++ searchlib/src/vespa/searchlib/common/lambdatask.h
@@ -13,7 +13,7 @@
 public:
     LambdaTask(const FunctionType &func) : _func(func) {}
     LambdaTask(FunctionType &&func) : _func(std::move(func)) {}
-    virtual void run() { _func(); }
+    virtual void run() override { _func(); }
 };

 template <class FunctionType>


"fix tensor shared_ptr"

"fix tensor shared_ptr"

--- paddle/optimizer/Tensor.h
+++ paddle/optimizer/Tensor.h
@@ -5,7 +5,6 @@

 #include <string.h>
 #include <memory>
-#include "paddle/math/MemoryHandle.h"
 #include "paddle/utils/Common.h"
 #include "paddle/utils/Logging.h"

@@ -15,17 +14,16 @@
 template <class T>
 class TensorT {
 public:
-  TensorT(size_t size)
-      : TensorT(std::make_shared<CpuMemoryHandle>(size * sizeof(float)), size) {
+  TensorT(size_t size) : height_(1), width_(size) {
+    data_ptr_ = std::shared_ptr<T>(new T[size], std::default_delete<T[]>());
+    data_ = data_ptr_.get();
   }
-  TensorT(CpuMemHandlePtr handle, size_t size)
-      : height_(1),
-        width_(size),
-        data_(reinterpret_cast<T*>(handle->getBuf())) {}

-  TensorT(T* data, size_t size) : height_(1), width_(size), data_(data) {}
+  TensorT(T* data, size_t size)
+      : height_(1), width_(size), data_ptr_(nullptr), data_(data) {}

-  TensorT(T* data, size_t h, size_t w) : height_(h), width_(w), data_(data) {}
+  TensorT(T* data, size_t h, size_t w)
+      : height_(h), width_(w), data_ptr_(nullptr), data_(data) {}

   virtual ~TensorT() {}

@@ -45,6 +43,7 @@
 protected:
   size_t height_;
   size_t width_;
+  std::shared_ptr<T> data_ptr_;
   T* data_;
 };


ENH: add encoding constants

ENH: add encoding constants

--- Common/vtkSystemIncludes.h
+++ Common/vtkSystemIncludes.h
@@ -207,4 +207,28 @@
 #define VTK_THREAD_RETURN_TYPE void
 #endif

-#endif
+// For encoding
+
+#define VTK_ENCODING_NONE         0 // to specify that no encoding should occur
+#define VTK_ENCODING_US_ASCII     1
+#define VTK_ENCODING_UNICODE      2
+#define VTK_ENCODING_UTF_8        3
+#define VTK_ENCODING_ISO_8859_1   4
+#define VTK_ENCODING_ISO_8859_2   5
+#define VTK_ENCODING_ISO_8859_3   6
+#define VTK_ENCODING_ISO_8859_4   7
+#define VTK_ENCODING_ISO_8859_5   8
+#define VTK_ENCODING_ISO_8859_6   9
+#define VTK_ENCODING_ISO_8859_7   10
+#define VTK_ENCODING_ISO_8859_8   11
+#define VTK_ENCODING_ISO_8859_9   12
+#define VTK_ENCODING_ISO_8859_10  13
+#define VTK_ENCODING_ISO_8859_11  14
+#define VTK_ENCODING_ISO_8859_12  15
+#define VTK_ENCODING_ISO_8859_13  16
+#define VTK_ENCODING_ISO_8859_14  17
+#define VTK_ENCODING_ISO_8859_15  18
+#define VTK_ENCODING_ISO_8859_16  19
+#define VTK_ENCODING_UNKNOWN      20  // leave this one at the end
+
+#endif


adding stub for estimateCost for IndexRangeNode.

--- arangod/Aql/ExecutionNode.h
+++ arangod/Aql/ExecutionNode.h
@@ -909,6 +909,15 @@
 ////////////////////////////////////////////////////////////////////////////////

         double estimateCost () {
+          // the cost of the enumerate collection node we are replacing . . .
+          /* cost = static_cast<double>(_collection->count()) *
+            _dependencies.at(0)->getCost();
+
+          if (_index->_type == TRI_IDX_TYPE_HASH_INDEX) {
+
+
+          }*/
+
           return 1;
           //FIXME improve this estimate . . .
         }


Remove register specifiers, add one explicit int

--- arch/amiga/amiga/disksubr.c
+++ arch/amiga/amiga/disksubr.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: disksubr.c,v 1.14 1997/08/08 21:46:34 niklas Exp $	*/
+/*	$OpenBSD: disksubr.c,v 1.15 1998/03/26 12:38:39 niklas Exp $	*/
 /*	$NetBSD: disksubr.c,v 1.27 1996/10/13 03:06:34 christos Exp $	*/

 /*
@@ -436,12 +436,12 @@
  */
 int
 setdisklabel(olp, nlp, openmask, clp)
-	register struct disklabel *olp, *nlp;
+	struct disklabel *olp, *nlp;
 	u_long openmask;
 	struct cpu_disklabel *clp;
 {
-	register i;
-	register struct partition *opp, *npp;
+	int i;
+	struct partition *opp, *npp;

 	if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
 	    dkcksum(nlp) != 0)
@@ -482,7 +482,7 @@
 writedisklabel(dev, strat, lp, clp)
 	dev_t dev;
 	void (*strat)(struct buf *);
-	register struct disklabel *lp;
+	struct disklabel *lp;
 	struct cpu_disklabel *clp;
 {
 	struct rdbmap *bmap;


ledblink.c fix

ledblink.c fix

--- recipes-ledblink/ledblink/ledblink-0.1/ledblink.c
+++ recipes-ledblink/ledblink/ledblink-0.1/ledblink.c
@@ -6,10 +6,10 @@

 void writeToFile(char* filename, char* value){

-  // init fp
+  // variable declaration
   FILE *fp;

-    // Opens ONBOARD_LED file for writing; if it doesn't exist, then a new file is created
+    // Opens file for writing
     fp = fopen(filename, "w");

     // Check if pointer is valid
@@ -24,28 +24,24 @@

 int main(int argc, char **argv){

-  // Run program if called correctly
-  if (argc == 2){
+  // First arg is the program name; second is only valid if 0 or 1
+  if (argc == 2 && (argv[1][0] == '0' || argv[1][0] == '1')){

-    // First arg is the program name; second is only valid if 0 or 1
-    if (argc == 2 && (argv[1][0] == '0' || argv[1][0] == '1')){
+    // Remove possible trigger from led (this is needed only for onboard led0)
+    writeToFile(LED_TRIGGER, "none");

-	// Remove possible trigger from led (this is needed only for onboard led0)
-	writeToFile(LED_TRIGGER, "none");
-
-	/* Set value:
-	   1 = led on
-	   0 = led off
-	   other = error message */
-	if (argv[1][0] == '1'){
-	  writeToFile(ONBOARD_LED, "1");
-	}
-	else if (argv[1][0] == '0'){
-	  writeToFile(ONBOARD_LED, "0");
-	}
-	else {
-	  printf("Usage: %s [0|1]", argv[0]);
-	    }
+    /* Set value:
+     1 = led on
+     0 = led off
+     other = error message */
+    if (argv[1][0] == '1'){
+      writeToFile(ONBOARD_LED, "1");
+    }
+    else if (argv[1][0] == '0'){
+      writeToFile(ONBOARD_LED, "0");
+    }
+    else {
+      printf("Usage: %s [0|1]", argv[0]);
     }
   }


[ARM] i.MX: remove set_imx_fb_info() export

Remove not needed export and fix warning:

WARNING: vmlinux.o(__ksymtab+0x400): Section mismatch in reference from the variable __ksymtab_set_imx_fb_info to the function .init.text:set_imx_fb_info()
The symbol set_imx_fb_info is exported and annotated __init
Fix this by removing the __init annotation of set_imx_fb_info or drop the export.

Signed-off-by: Paulius Zaleckas <c59c332b61c0401f49d806e6931557f8bdeeaad8@teltonika.lt>
Signed-off-by: Sascha Hauer <c00cbc2b736c26791a3822db86f8796fe9efff67@pengutronix.de>

--- arch/arm/mach-imx/generic.c
+++ arch/arm/mach-imx/generic.c
@@ -251,7 +251,6 @@
 {
 	memcpy(&imx_fb_info,hard_imx_fb_info,sizeof(struct imxfb_mach_info));
 }
-EXPORT_SYMBOL(set_imx_fb_info);

 static struct resource imxfb_resources[] = {
 	[0] = {


Revert "msm: cpufreq: Remove cross-calling limitation"

This reverts commit be01a17afb6b6e85456217caa1ac11eb0b6674e1.

Re-introduce cross calling in cpufreq to prevent race conditions in the
hardware when changing PLLs.

A core could be in retention, while another core, could try and set the
frequency of the core in retention, causing a change in PLL and when the
core exits retention, the PLL mismatch could hang the SPM state machine.

Change-Id: I99b454a0f146652f2d8a369f79f6d35748160dcb
Signed-off-by: Praveen Chidambaram <91104b0007f6ff6276087673c270a144d5ff14a2@codeaurora.org>

--- arch/arm/mach-msm/cpufreq.c
+++ arch/arm/mach-msm/cpufreq.c
@@ -32,6 +32,17 @@

 #include "acpuclock.h"

+struct cpufreq_work_struct {
+	struct work_struct work;
+	struct cpufreq_policy *policy;
+	struct completion complete;
+	int frequency;
+	int status;
+};
+
+static DEFINE_PER_CPU(struct cpufreq_work_struct, cpufreq_work);
+static struct workqueue_struct *msm_cpufreq_wq;
+
 struct cpufreq_suspend_t {
 	struct mutex suspend_mutex;
 	int device_suspended;
@@ -99,6 +110,15 @@
 	return ret;
 }

+static void set_cpu_work(struct work_struct *work)
+{
+	struct cpufreq_work_struct *cpu_work =
+		container_of(work, struct cpufreq_work_struct, work);
+
+	cpu_work->status = set_cpu_freq(cpu_work->policy, cpu_work->frequency);
+	complete(&cpu_work->complete);
+}
+
 static int msm_cpufreq_target(struct cpufreq_policy *policy,
 				unsigned int target_freq,
 				unsigned int relation)
@@ -107,10 +127,16 @@
 	int index;
 	struct cpufreq_frequency_table *table;

+	struct cpufreq_work_struct *cpu_work = NULL;
+	cpumask_var_t mask;
+
 	if (!cpu_active(policy->cpu)) {
 		pr_info("cpufreq: cpu %d is not active.\n", policy->cpu);
 		return -ENODEV;
 	}
+
+	if (!alloc_cpumask_var(&mask, GFP_KERNEL))
+		return -ENOMEM;

 	mutex_lock(&per_cpu(cpufreq_suspend, policy->cpu).suspend_mutex);

@@ -133,9 +159,27 @@
 		policy->cpu, target_freq, relation,
 		policy->min, policy->max, table[index].frequency);

-	ret = set_cpu_freq(policy, table[index].frequency);
+	cpu_work = &per_cpu(cpufreq_work, policy->cpu);
+	cpu_work->policy = policy;
+	cpu_work->frequency = table[index].frequency;
+	cpu_work->status = -ENODEV;
+
+	cpumask_clear(mask);
+	cpumask_set_cpu(policy->cpu, mask);
+	if (cpumask_equal(mask, &current->cpus_allowed)) {
+		ret = set_cpu_freq(cpu_work->policy, cpu_work->frequency);
+		goto done;
+	} else {
+		cancel_work_sync(&cpu_work->work);
+		INIT_COMPLETION(cpu_work->complete);
+		queue_work_on(policy->cpu, msm_cpufreq_wq, &cpu_work->work);
+		wait_for_completion(&cpu_work->complete);
+	}
+
+	ret = cpu_work->status;

 done:
+	free_cpumask_var(mask);
 	mutex_unlock(&per_cpu(cpufreq_suspend, policy->cpu).suspend_mutex);
 	return ret;
 }
@@ -218,6 +262,7 @@
 	int cur_freq;
 	int index;
 	struct cpufreq_frequency_table *table;
+	struct cpufreq_work_struct *cpu_work = NULL;

 	table = cpufreq_frequency_get_table(policy->cpu);
 	if (table == NULL)
@@ -247,7 +292,7 @@
 	    CPUFREQ_RELATION_H, &index) &&
 	    cpufreq_frequency_table_target(policy, table, cur_freq,
 	    CPUFREQ_RELATION_L, &index)) {
-		pr_info("%s: cpu%d at invalid freq: %d\n", __func__,
+		pr_info("cpufreq: cpu%d at invalid freq: %d\n",
 				policy->cpu, cur_freq);
 		return -EINVAL;
 	}
@@ -267,6 +312,10 @@

 	policy->cpuinfo.transition_latency =
 		acpuclk_get_switch_time() * NSEC_PER_USEC;
+
+	cpu_work = &per_cpu(cpufreq_work, policy->cpu);
+	INIT_WORK(&cpu_work->work, set_cpu_work);
+	init_completion(&cpu_work->complete);

 	return 0;
 }
@@ -368,6 +417,7 @@
 		per_cpu(cpufreq_suspend, cpu).device_suspended = 0;
 	}

+	msm_cpufreq_wq = create_workqueue("msm-cpufreq");
 	register_hotcpu_notifier(&msm_cpufreq_cpu_notifier);

 	register_pm_notifier(&msm_cpufreq_pm_notifier);


fix pincount, improve readabilty.

fix pincount, improve readabilty.

--- arch/arm/xscale/pxa2x0reg.h
+++ arch/arm/xscale/pxa2x0reg.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: pxa2x0reg.h,v 1.5 2005/01/05 00:46:28 dlg Exp $ */
+/*	$OpenBSD: pxa2x0reg.h,v 1.6 2005/01/09 05:29:42 drahn Exp $ */
 /* $NetBSD: pxa2x0reg.h,v 1.4 2003/06/11 20:43:01 scw Exp $ */

 /*
@@ -318,7 +318,7 @@
 #define GPIO_GEDR3  0x148	/* edge detect PXA270 [120:96] */

 #define	GPIO_REG(r, pin)	((r) + \
-				((pin > 95) ? GPIO_GPLR3 : (((pin) / 32) * 4)))
+    ((pin > 95) ? GPIO_GPLR3 : (((pin) / 32) * 4)))
 #define	GPIO_BANK(pin)		((pin) / 32)
 #define	GPIO_BIT(pin)		(1u << ((pin) & 0x1f))
 #define	GPIO_FN_REG(pin)	(GPIO_GAFR0_L + (((pin) / 16) * 4))
@@ -343,7 +343,7 @@
 #define	GPIO_IS_GPIO_IN(n)	(((n) & (GPIO_FN_MASK|GPIO_OUT)) == GPIO_IN)
 #define	GPIO_IS_GPIO_OUT(n)	(((n) & (GPIO_FN_MASK|GPIO_OUT)) == GPIO_OUT)

-#define	GPIO_NPINS    120
+#define	GPIO_NPINS    121

 /*
  * memory controller


[BLACKFIN] minor irq handler cleanups

[BLACKFIN] minor irq handler cleanups

- use standard irq_handler_t to define irq handler function arguments

Signed-off-by: Jeff Garzik <15f615bf7d20c2937c7eb5aa759110fd6768848c@redhat.com>

--- arch/blackfin/kernel/time.c
+++ arch/blackfin/kernel/time.c
@@ -39,8 +39,7 @@
 /* This is an NTP setting */
 #define	TICK_SIZE (tick_nsec / 1000)

-static void time_sched_init(irqreturn_t(*timer_routine)
-			(int, void *));
+static void time_sched_init(irq_handler_t timer_routine);
 static unsigned long gettimeoffset(void);

 static struct irqaction bfin_timer_irq = {
@@ -64,7 +63,7 @@
 #define TIME_SCALE 1

 static void
-time_sched_init(irqreturn_t(*timer_routine) (int, void *))
+time_sched_init(irq_handler_t timer_routine)
 {
 	u32 tcount;


zero the fpu_curproc on proc exit, clarify the cpu_swapout()'s job

--- arch/hppa/hppa/vm_machdep.c
+++ arch/hppa/hppa/vm_machdep.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: vm_machdep.c,v 1.4 1999/04/20 20:45:37 mickey Exp $	*/
+/*	$OpenBSD: vm_machdep.c,v 1.5 1999/05/21 17:49:47 mickey Exp $	*/

 #include <sys/param.h>
 #include <sys/systm.h>
@@ -96,7 +96,10 @@
 cpu_swapout(p)
 	struct proc *p;
 {
-	/* FPU save state */
+	/*
+	 * explicit FPU save state, since user area might get
+	 * swapped out as well, and won't be able to save it no more
+	 */
 }

 void
@@ -152,11 +155,11 @@
 cpu_exit(p)
 	struct proc *p;
 {
-	/* FPU: save state */
-
+	extern struct proc *fpu_curproc;	/* from machdep.c */
 	uvmexp.swtch++;

 	curproc = NULL;
+	fpu_curproc = NULL;
 	uvmspace_free(p->p_vmspace);

 	/* XXX should be in the locore? */


zap a misleading comment

zap a misleading comment

--- arch/i386/i386/vm_machdep.c
+++ arch/i386/i386/vm_machdep.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: vm_machdep.c,v 1.58 2009/06/03 00:49:12 art Exp $	*/
+/*	$OpenBSD: vm_machdep.c,v 1.59 2012/07/28 19:48:54 guenther Exp $	*/
 /*	$NetBSD: vm_machdep.c,v 1.61 1996/05/03 19:42:35 christos Exp $	*/

 /*-
@@ -105,7 +105,6 @@

 	/*
 	 * Copy the trapframe, and arrange for the child to return directly
-	 * through rei().
 	 */
 	p2->p_md.md_regs = tf = (struct trapframe *)pcb->pcb_tss.tss_esp0 - 1;
 	*tf = *p1->p_md.md_regs;


keys: fix sparse warning by adding __user annotation to cast

Fix the following sparse warning:

      CC      security/keys/key.o
    security/keys/keyctl.c:1297:10: warning: incorrect type in argument 2 (different address spaces)
    security/keys/keyctl.c:1297:10:    expected char [noderef] <asn:1>*buffer
    security/keys/keyctl.c:1297:10:    got char *<noident>

which appears to be caused by lack of __user annotation to the cast of
a syscall argument.

Signed-off-by: James Morris <10d11de3abc355eabe955bb734f0f8e71da56e16@namei.org>
Acked-by: David Howells <ebac1d06c1688626821bb0e574a037a7a5354e49@redhat.com>

--- security/keys/keyctl.c
+++ security/keys/keyctl.c
@@ -1294,7 +1294,7 @@

 	case KEYCTL_GET_SECURITY:
 		return keyctl_get_security((key_serial_t) arg2,
-					   (char *) arg3,
+					   (char __user *) arg3,
 					   (size_t) arg4);

 	default:


0x0006 is not a good value for a bit flag, so change it to 0x0008.

Spotted by kettenis@

ok mickey@

--- arch/i386/include/biosvar.h
+++ arch/i386/include/biosvar.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: biosvar.h,v 1.46 2006/05/08 22:51:18 gwk Exp $	*/
+/*	$OpenBSD: biosvar.h,v 1.47 2006/05/09 15:16:58 tom Exp $	*/

 /*
  * Copyright (c) 1997-1999 Michael Shalayeff
@@ -39,7 +39,7 @@
 #define	BIOSF_BIOS32	0x0001
 #define	BIOSF_PCIBIOS	0x0002
 #define	BIOSF_PROMSCAN	0x0004
-#define BIOSF_SMBIOS	0x0006
+#define	BIOSF_SMBIOS	0x0008

 /* BIOS media ID */
 #define BIOSM_F320K	0xff	/* floppy ds/sd  8 spt */


Add a breakpoint() inline for use with KGDB. Ok'd by mickey.

--- arch/i386/include/cpufunc.h
+++ arch/i386/include/cpufunc.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: cpufunc.h,v 1.5 1999/11/20 11:18:59 matthieu Exp $	*/
+/*	$OpenBSD: cpufunc.h,v 1.6 2000/07/05 14:19:29 hugh Exp $	*/
 /*	$NetBSD: cpufunc.h,v 1.8 1994/10/27 04:15:59 cgd Exp $	*/

 /*
@@ -242,4 +242,11 @@
         return (rv);
 }

+/* Break into DDB/KGDB. */
+static __inline void
+breakpoint(void)
+{
+	__asm __volatile("int $3");
+}
+
 #endif /* !_I386_CPUFUNC_H_ */


m68k: Remove big kernel lock in cache flush code

The cache flush code doesn't need a lock, so we can remove the use of the BKL.

Signed-off-by: Geert Uytterhoeven <0da414d9d963da4039c2a0525b1844228075aa58@linux-m68k.org>
Reported-by: Arnd Bergmann <f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de>
Suggested-by: Andreas Schwab <c9df6394cb541f693236245820fbe23866f1a3fe@linux-m68k.org>

--- arch/m68k/kernel/sys_m68k.c
+++ arch/m68k/kernel/sys_m68k.c
@@ -12,7 +12,6 @@
 #include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/smp.h>
-#include <linux/smp_lock.h>
 #include <linux/sem.h>
 #include <linux/msg.h>
 #include <linux/shm.h>
@@ -377,7 +376,6 @@
 	struct vm_area_struct *vma;
 	int ret = -EINVAL;

-	lock_kernel();
 	if (scope < FLUSH_SCOPE_LINE || scope > FLUSH_SCOPE_ALL ||
 	    cache & ~FLUSH_CACHE_BOTH)
 		goto out;
@@ -446,7 +444,6 @@
 	    }
 	}
 out:
-	unlock_kernel();
 	return ret;
 }


Add back the broken swap. This needs to be checked why it has to (or not) be there. Meanwhile leave it in.

--- arch/mips64/include/types.h
+++ arch/mips64/include/types.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: types.h,v 1.2 2004/08/09 14:57:26 pefo Exp $	*/
+/*	$OpenBSD: types.h,v 1.3 2004/08/15 10:37:36 pefo Exp $	*/

 /*-
  * Copyright (c) 1992, 1993
@@ -91,4 +91,7 @@
 } label_t;
 #endif

+/* XXX check why this still has to be defined. pmap.c issue? */
+#define  __SWAP_BROKEN
+
 #endif	/* !_MIPS_TYPES_H_ */


add constants so that we can remove "m68k/m88k" directories from bugcrt.

--- arch/mvme68k/include/prom.h
+++ arch/mvme68k/include/prom.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: prom.h,v 1.4 1996/05/07 11:25:01 deraadt Exp $ */
+/*	$OpenBSD: prom.h,v 1.5 1996/05/10 03:19:34 chuck Exp $ */

 /*
  * Copyright (c) 1995 Theo de Raadt
@@ -166,3 +166,12 @@
 #define MVMEPROM_STATRET(ret) \
 	asm volatile ("movew ccr,%0": "=d" (ret)); \
 	return (!(ret & 0x4));		/* return a 'status' */
+
+#define MVMEPROM_REG_DEVLUN	"d0"
+#define MVMEPROM_REG_CTRLLUN	"d1"
+#define MVMEPROM_REG_FLAGS	"d4"
+#define MVMEPROM_REG_CTRLADDR	"a0"
+#define MVMEPROM_REG_ENTRY	"a1"
+#define MVMEPROM_REG_CONFBLK	"a2"
+#define MVMEPROM_REG_ARGSTART	"a5"
+#define MVMEPROM_REG_ARGEND	"a6"


simplify userret

simplify userret

--- arch/mvme68k/mvme68k/trap.c
+++ arch/mvme68k/mvme68k/trap.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: trap.c,v 1.34 2001/08/25 11:37:26 espie Exp $ */
+/*	$OpenBSD: trap.c,v 1.35 2001/09/14 09:15:19 art Exp $ */

 /*
  * Copyright (c) 1995 Theo de Raadt
@@ -184,7 +184,7 @@
 	u_int faultaddr;
 	int fromtrap;
 {
-	int sig, s;
+	int sig;
 #if defined(M68040) || defined(M68060)
 	int beenhere = 0;

@@ -196,18 +196,9 @@
 	p->p_priority = p->p_usrpri;
 	if (want_resched) {
 		/*
-		 * Since we are curproc, clock will normally just change
-		 * our priority without moving us from one queue to another
-		 * (since the running process is not on a queue.)
-		 * If that happened after we put ourselves on the run queue
-		 * but before we mi_switch()'ed, we might not be on the queue
-		 * indicated by our priority.
-		 */
-		s = splstatclock();
-		setrunqueue(p);
-		p->p_stats->p_ru.ru_nivcsw++;
-		mi_switch();
-		splx(s);
+		 * We're being preempted.
+		 */
+		preempt(NULL);
 		while ((sig = CURSIG(p)) != 0)
 			postsig(sig);
 	}


ARGH, fix it right...

ARGH, fix it right...

--- arch/powerpc/include/intr.h
+++ arch/powerpc/include/intr.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: intr.h,v 1.14 2002/01/21 17:18:46 drahn Exp $ */
+/*	$OpenBSD: intr.h,v 1.15 2002/01/21 17:20:22 drahn Exp $ */

 /*
  * Copyright (c) 1997 Per Fogelstrom, Opsycon AB and RTMX Inc, USA.
@@ -84,7 +84,7 @@
 	return(oldcpl);
 }

-static _volatile _inline void
+volatile static __inline void
 splx(int newcpl)
 {
 	__asm__ volatile("":::"memory");	/* reorder protect */


Remove cblas_shim.h

Remove cblas_shim.h

--- sense2vec/cblas_shim.h
+++ sense2vec/cblas_shim.h
@@ -1,47 +0,0 @@
-#ifndef USE_BLAS
-#include "third_party/Eigen/Core"
-#endif
-#ifdef __cplusplus
-extern "C"
-{
-#endif // __cplusplus
-#ifdef USE_BLAS
-#include <cblas.h>
-
-int _use_blas()
-{
-    return 1;
-}
-#else // USE_BLAS
-
-Eigen::VectorXf arr_to_vecf(const int N, const float *arr) {
-    // need non-const for vector
-    Eigen::Map<Eigen::VectorXf> v((float*)arr, N);
-    return v;
-}
-
-
-float cblas_snrm2(const int N, const float *X, const int incX)
-{
-    Eigen::VectorXf v = arr_to_vecf(N, X);
-    return v.norm();
-}
-
-float cblas_sdot(const int N, const float *X, const int incX,
-                 const float *Y, const int incY)
-{
-    Eigen::VectorXf a = arr_to_vecf(N, X);
-    Eigen::VectorXf b = arr_to_vecf(N, Y);
-    return a.dot(b);
-}
-
-int _use_blas()
-{
-    return 0;
-}
-
-#endif // USE_BLAS
-#ifdef __cplusplus
-}
-#endif // __cplusplus
-


powerpc/perf/hv-24x7: Whitespace - fix parameter alignment

Fix parameter alignment to be consistent with coding style.

Signed-off-by: Sukadev Bhattiprolu <2ac48ee9b8f6042694a5d86ef56b8e10fe5327d1@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <864f124608374e06e4da1fa5d2e47ed839b95411@ellerman.id.au>

--- arch/powerpc/perf/hv-24x7.c
+++ arch/powerpc/perf/hv-24x7.c
@@ -416,7 +416,7 @@
 }

 static struct attribute *event_to_desc_attr(struct hv_24x7_event_data *event,
-				int nonce)
+					    int nonce)
 {
 	int nl, dl;
 	char *name = event_name(event, &nl);
@@ -444,7 +444,7 @@
 }

 static ssize_t event_data_to_attrs(unsigned ix, struct attribute **attrs,
-		struct hv_24x7_event_data *event, int nonce)
+				   struct hv_24x7_event_data *event, int nonce)
 {
 	unsigned i;

@@ -512,7 +512,7 @@
 }

 static int ev_uniq_ord(const void *v1, size_t s1, unsigned d1, const void *v2,
-					size_t s2, unsigned d2)
+		       size_t s2, unsigned d2)
 {
 	int r = memord(v1, s1, v2, s2);

@@ -526,7 +526,7 @@
 }

 static int event_uniq_add(struct rb_root *root, const char *name, int nl,
-				unsigned domain)
+			  unsigned domain)
 {
 	struct rb_node **new = &(root->rb_node), *parent = NULL;
 	struct event_uniq *data;
@@ -650,8 +650,8 @@
 #define MAX_4K (SIZE_MAX / 4096)

 static int create_events_from_catalog(struct attribute ***events_,
-		struct attribute ***event_descs_,
-		struct attribute ***event_long_descs_)
+				      struct attribute ***event_descs_,
+				      struct attribute ***event_long_descs_)
 {
 	unsigned long hret;
 	size_t catalog_len, catalog_page_len, event_entry_count,
@@ -1008,8 +1008,8 @@
 };

 static void log_24x7_hcall(struct hv_24x7_request_buffer *request_buffer,
-			struct hv_24x7_data_result_buffer *result_buffer,
-			unsigned long ret)
+			   struct hv_24x7_data_result_buffer *result_buffer,
+			   unsigned long ret)
 {
 	struct hv_24x7_request *req;

@@ -1026,7 +1026,7 @@
  * Start the process for a new H_GET_24x7_DATA hcall.
  */
 static void init_24x7_request(struct hv_24x7_request_buffer *request_buffer,
-			struct hv_24x7_data_result_buffer *result_buffer)
+			      struct hv_24x7_data_result_buffer *result_buffer)
 {

 	memset(request_buffer, 0, 4096);
@@ -1041,7 +1041,7 @@
  * by 'init_24x7_request()' and 'add_event_to_24x7_request()'.
  */
 static int make_24x7_request(struct hv_24x7_request_buffer *request_buffer,
-			struct hv_24x7_data_result_buffer *result_buffer)
+			     struct hv_24x7_data_result_buffer *result_buffer)
 {
 	unsigned long ret;


sh: perf events: Kill off left over debugging cruft.

num_events should be compared > MAX_HWEVENTS and not >=. The latter was
used as a debugging test which accidentally slipped in.

Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>

--- arch/sh/kernel/perf_event.c
+++ arch/sh/kernel/perf_event.c
@@ -308,7 +308,7 @@

 	pr_info("Performance Events: %s support registered\n", pmu->name);

-	WARN_ON(pmu->num_events >= MAX_HWEVENTS);
-
-	return 0;
-}
+	WARN_ON(pmu->num_events > MAX_HWEVENTS);
+
+	return 0;
+}


Add missing system include <string.h>, if available

Purpose is to squish recently introduced warnings:

resource/c_common/oic_platform/src/oic_platform.c: In function 'HashStrToUuid':
resource/c_common/oic_platform/src/oic_platform.c:92:5: warning: implicit declaration of function 'memcpy' [-Wimplicit-function-declaration]
     memcpy(platformUuid, hash, OIC_UUID_LENGTH);
     ^~~~~~
resource/c_common/oic_platform/src/oic_platform.c:92:5: warning: incompatible implicit declaration of built-in function 'memcpy'
resource/c_common/oic_platform/src/oic_platform.c:92:5: note: include '<string.h>' or provide a declaration of 'memcpy'
In file included from resource/c_common/oic_platform/src/oic_platform.c:57:0:
resource/c_common/oic_platform/src/oic_platform.c: In function 'OICGetPlatformUuid':
resource/c_common/oic_platform/src/oic_platform.c:119:67: warning: implicit declaration of function 'strerror' [-Wimplicit-function-declaration]
         OIC_LOG_V(WARNING, TAG, "Failed gethostname() errno: %s", strerror(errno));
                                                                   ^
resource/c_common/oic_platform/src/oic_platform.c:154:42: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
     if (!HashStrToUuid(fqdnComputerName, strlen(fqdnComputerName), platformUuid))
                                          ^~~~~~
resource/c_common/oic_platform/src/oic_platform.c:154:42: warning: incompatible implicit declaration of built-in function 'strlen'
resource/c_common/oic_platform/src/oic_platform.c:154:42: note: include '<string.h>' or provide a declaration of 'strlen'

Change-Id: Ic3755bd59fd80b68011352117c09c88d27b5e4fa
Signed-off-by: Mats Wichmann <7a5e6f27299d2bbd9d04b59d9e8e4f8eab83d8cb@linux.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/18351
Tested-by: jenkins-iotivity <d95b56ce41a2e1ac4cecdd398defd7414407cc08@iotivity.org>
Reviewed-by: George Nash <acbdc39d528a4315fe0b532d55c50ae46f5c1667@intel.com>
Reviewed-by: Uze Choi <3a26c91d8a4a3c9e246e43339f4782bb2483aece@samsung.com>
Reviewed-by: Dave Thaler <8a98d0850f57b73c42d096f8f8b11e2d5522d554@microsoft.com>

--- resource/c_common/oic_platform/src/oic_platform.c
+++ resource/c_common/oic_platform/src/oic_platform.c
@@ -20,6 +20,10 @@

 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+
+#ifdef HAVE_STRING_H
+#include <string.h>
 #endif

 #ifdef HAVE_SYS_SOCKET_H


x86: ia32_signal: remove using temporary variable

Impact: cleanup

No need to use temporary variable.
Also rename the variable same as arch/x86/kernel/signal_32.c.

Signed-off-by: Hiroshi Shimamoto <db8c2e91c9f58451d767d75787c2de778d30f637@ct.jp.nec.com>
Reviewed-by: WANG Cong <a133357995cace5c6bbf373f48d0bf90ebc1b429@zeuux.org>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- arch/x86/ia32/ia32_signal.c
+++ arch/x86/ia32/ia32_signal.c
@@ -218,7 +218,7 @@

 static int ia32_restore_sigcontext(struct pt_regs *regs,
 				   struct sigcontext_ia32 __user *sc,
-				   unsigned int *peax)
+				   unsigned int *pax)
 {
 	unsigned int tmpflags, gs, oldgs, err = 0;
 	void __user *buf;
@@ -265,9 +265,7 @@
 	buf = compat_ptr(tmp);
 	err |= restore_i387_xstate_ia32(buf);

-	err |= __get_user(tmp, &sc->ax);
-	*peax = tmp;
-
+	err |= __get_user(*pax, &sc->ax);
 	return err;
 }


x86: use kernel_stack_pointer() in dumpstack.c

The way to obtain a kernel-mode stack pointer from a struct pt_regs in
32-bit mode is "subtle": the stack doesn't actually contain the stack
pointer, but rather the location where it would have been marks the
actual previous stack frame.  For clarity, use kernel_stack_pointer()
instead of coding this weirdness explicitly.

Furthermore, user_mode() is only valid when the process is known to
not run in V86 mode.  Use the safer user_mode_vm() instead.

Signed-off-by: H. Peter Anvin <8a453bad9912ffe59bc0f0b8abe03df9be19379e@zytor.com>

--- arch/x86/kernel/dumpstack.c
+++ arch/x86/kernel/dumpstack.c
@@ -268,11 +268,12 @@

 	show_registers(regs);
 #ifdef CONFIG_X86_32
-	sp = (unsigned long) (&regs->sp);
-	savesegment(ss, ss);
-	if (user_mode(regs)) {
+	if (user_mode_vm(regs)) {
 		sp = regs->sp;
 		ss = regs->ss & 0xffff;
+	} else {
+		sp = kernel_stack_pointer(regs);
+		savesegment(ss, ss);
 	}
 	printk(KERN_EMERG "EIP: [<%08lx>] ", regs->ip);
 	print_symbol("%s", regs->ip);


Bug 746675 - Workaround thread unsafety of icaltimezone_load_builtin_timezone()

--- calendar/libedata-cal/e-subprocess-cal-factory.c
+++ calendar/libedata-cal/e-subprocess-cal-factory.c
@@ -137,6 +137,36 @@
 e_subprocess_cal_factory_new (GCancellable *cancellable,
 			       GError **error)
 {
+	icalarray *builtin_timezones;
+	gint ii;
+
+#ifdef HAVE_ICAL_UNKNOWN_TOKEN_HANDLING
+	ical_set_unknown_token_handling_setting (ICAL_DISCARD_TOKEN);
+#endif
+
+	/* XXX Pre-load all built-in timezones in libical.
+	 *
+	 *     Built-in time zones in libical 0.43 are loaded on demand,
+	 *     but not in a thread-safe manner, resulting in a race when
+	 *     multiple threads call icaltimezone_load_builtin_timezone()
+	 *     on the same time zone.  Until built-in time zone loading
+	 *     in libical is made thread-safe, work around the issue by
+	 *     loading all built-in time zones now, so libical's internal
+	 *     time zone array will be fully populated before any threads
+	 *     are spawned.
+	 */
+	builtin_timezones = icaltimezone_get_builtin_timezones ();
+	for (ii = 0; ii < builtin_timezones->num_elements; ii++) {
+		icaltimezone *zone;
+
+		zone = icalarray_element_at (builtin_timezones, ii);
+
+		/* We don't care about the component right now,
+		 * we just need some function that will trigger
+		 * icaltimezone_load_builtin_timezone(). */
+		icaltimezone_get_component (zone);
+	}
+
 	return g_initable_new (
 		E_TYPE_SUBPROCESS_CAL_FACTORY,
 		cancellable, error, NULL);


use strtok_r instead

use strtok_r instead

--- src/dotenv.c
+++ src/dotenv.c
@@ -6,11 +6,7 @@
 #include <dotenv.h>

-#define VAR_OPEN_TAG "${"
-#define VAR_CLOSE_TAG "}"
-#define COMMENT_CHAR '#'
-
-/* strtok() won't remove the whole ${ part, only the $ */
+/* strtok_r() won't remove the whole ${ part, only the $ */
 #define remove_bracket(name) name + 1

@@ -31,18 +27,18 @@

 static bool is_nested(char *value)
 {
-    return strstr(value, VAR_OPEN_TAG) && strstr(value, VAR_CLOSE_TAG);
+    return strstr(value, "${") && strstr(value, "}");
 }

 static char *parse_value(char *value)
 {
-    char *search = value, *parsed = NULL;
+    char *search = value, *parsed = NULL, *tok_ptr;
     char *name;

     if (value && is_nested(value)) {
         while (1) {
-            parsed = concat(parsed, strtok(search, "${"));
-            name = strtok(NULL, "}");
+            parsed = concat(parsed, strtok_r(search, "${", &tok_ptr));
+            name = strtok_r(NULL, "}", &tok_ptr);

             if (!name) {
                 break;
@@ -55,15 +51,15 @@
     return value;
 }

-static bool is_commented(char *line)
+static bool is_commented(const char *line)
 {
-    if (COMMENT_CHAR == line[0]) {
+    if ('#' == line[0]) {
         return true;
     }

     int i = 0;
     while (' ' == line[i]) {
-        if (COMMENT_CHAR == line[++i]) {
+        if ('#' == line[++i]) {
             return true;
         }
     }
@@ -87,13 +83,13 @@

 static void parse(FILE *file, bool overwrite)
 {
-    char *name, *original, *line = NULL;
+    char *name, *original, *line = NULL, *tok_ptr;
     size_t len = 0;

     while (-1 != getline(&line, &len, file)) {
         if (!is_commented(line)) {
-            name = strtok(line, "=");
-            original = strtok(NULL, "\n");
+            name = strtok_r(line, "=", &tok_ptr);
+            original = strtok_r(NULL, "\n", &tok_ptr);

             set_variable(name, original, overwrite);
         }
@@ -103,10 +99,10 @@

 static FILE *open_default(char *base_path)
 {
-    char path[strlen(base_path) + 5];
+    char path[strlen(base_path) + strlen(".env") + 1];
     sprintf(path, "%s/.env", base_path);

-    return fopen(path, "r");
+    return fopen(path, "rb");
 }

 int env_load(char *path, bool overwrite)
@@ -114,7 +110,7 @@
     FILE *file = open_default(path);

     if (!file) {
-        file = fopen(path, "r");
+        file = fopen(path, "rb");

         if (!file) {
             return -1;


driver: support GetNameOwner on unique name

This should simply return the unique name if it is registered, otherwise
error out.

Signed-off-by: Tom Gundersen <7c8224529a7c718e876cb2496c973509fde1e50e@jklm.no>

--- src/driver.c
+++ src/driver.c
@@ -904,13 +904,13 @@
         if (strcmp(name_str, "org.freedesktop.DBus") == 0) {
                 c_dvar_write(out_v, "org.freedesktop.DBus");
         } else {
-                NameOwner *owner;
-
-                owner = name_registry_resolve_owner(&peer->bus->names, name_str);
+                Peer *owner;
+
+                owner = bus_find_peer_by_name(peer->bus, name_str);
                 if (!owner)
                         return DRIVER_E_NAME_OWNER_NOT_FOUND;

-                driver_dvar_write_unique_name(out_v, c_container_of(owner, Peer, owned_names));
+                driver_dvar_write_unique_name(out_v, owner);
         }

         c_dvar_write(out_v, ")");


Update ephyr functions for ScreenInit() and ShadowUpdate().

--- src/driver.c
+++ src/driver.c
@@ -498,6 +498,7 @@
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     EphyrScrPrivPtr scrpriv = pScrn->driverPrivate;
     Pixel redMask, greenMask, blueMask;
+    char *fb_data;

     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NestedScreenInit\n");
     NestedPrintPscreen(pScrn);
@@ -527,11 +528,21 @@
     if (!miSetPixmapDepths())
         return FALSE;

-    /* TODO: replace with corresponding Xephyr function
-    if (!fbScreenInit(pScreen, NestedClientGetFrameBuffer(PCLIENTDATA(pScrn)),
+    /* XXX: Shouldn't we call ephyrMapFramebuffer()
+     * instead of hostx_screen_init() here? */
+    fb_data = hostx_screen_init(pScrn,
+                                pScrn->frameX0, pScrn->frameY0,
+                                pScrn->VirtualX, pScrn->VirtualY,
+                                ephyrBufferHeight(pScrn),
+                                NULL, /* bytes per line/row (not used) */
+                                &pScrn->bitsPerPixel);
+
+    if (!fbScreenInit(pScreen,
+                      fb_data,
                       pScrn->virtualX, pScrn->virtualY, pScrn->xDpi,
-                      pScrn->yDpi, pScrn->displayWidth, pScrn->bitsPerPixel))
-        return FALSE; */
+                      pScrn->yDpi, pScrn->displayWidth, pScrn->bitsPerPixel)) {
+        return FALSE;
+    }

     fbPictureInit(pScreen, 0, 0);

@@ -581,14 +592,7 @@

 static void
 NestedShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf) {
-    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
-    EphyrScrPrivPtr scrpriv = pScrn->driverPrivate;
-
-    RegionPtr pRegion = DamageRegion(pBuf->pDamage);
-    /* TODO: replace with corresponding Xephyr function
-    NestedClientUpdateScreen(scrpriv,
-                             pRegion->extents.x1, pRegion->extents.y1,
-                             pRegion->extents.x2, pRegion->extents.y2); */
+    ephyrShadowUpdate(pScreen, pBuf);
 }

 static Bool


driver: Fix integer overflow check

driver: Fix integer overflow check

--- src/driver.c
+++ src/driver.c
@@ -429,14 +429,14 @@

 	co_sdo_send(self, map_index, 0, (uint8_t)0);

-	uint8_t i;
-	for (i = 0; i <= 255 && map->entries[i].index; ++i) {
+	int i;
+	for (i = 0; i <= UINT8_MAX && map->entries[i].index; ++i) {
 		struct co_pdo_map_entry* e = &map->entries[i];
 		uint32_t data = e->index << 16 | e->subindex << 8 | e->length;
 		co_sdo_send(self, map_index, i + 1, data);
 	}

-	co_sdo_send(self, map_index, 0, i);
+	co_sdo_send(self, map_index, 0, (uint8_t)i);

 	co_sdo_send(self, com_index, PDO_COMMUNICATION_COB,
 		    (uint32_t)(0x40000000 + cobid));


All done with #142, along with a ton of other stuff.

--- tests/validator/common.h
+++ tests/validator/common.h
@@ -286,6 +286,7 @@
         }
       }

+      /*
       for(size_t i = 0; i < x64asm::eflags.size(); i++)
       {
         auto op = x64asm::eflags[i];
@@ -299,6 +300,7 @@
           EXPECT_CPU_EQ_INT(expected_flag, actual_flag, tmp.str());
         }
       }
+      */

 #undef EXPECT_CPU_EQ_INT
 #undef EXPECT_CPU_EQ_CODE


mark a potential memory leak and fix a dumb syntax error

--- hgd/hgd-netd.c
+++ hgd/hgd-netd.c
@@ -135,7 +135,7 @@
 	playing = hgd_get_playing_item();
 	if (playing == NULL) {
 		hgd_sock_send_line(sess->sock_fd, "ok|0");
-		return -1
+		return -1;
 	}

 	xasprintf(&reply, "ok|1|%d|%s|%s",
@@ -374,6 +374,7 @@
 	/* free up */
 	for (i = 0; i < list.n_items; i ++)
 		free(list.items[i]);
+	//free(list.items);

 	return (0);
 }


Removed a file that generated in process of compilation.

--- tests_vala/test_string.c
+++ tests_vala/test_string.c
@@ -1,396 +0,0 @@
-/* test_string.c generated by valac 0.28.0, the Vala compiler
- * generated from test_string.vala, do not modify */
-
-/* Copyright (C) 2015, WSID   */
-/* This file is part of Crank System.
- *
- *  Crank System is free software: you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation, either
- *  version 3 of the License, or (at your option) any later version.
- *
- *  Crank System is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with Crank System.
- *  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <glib.h>
-#include <glib-object.h>
-#include <stdlib.h>
-#include <string.h>
-#include <crankbase.h>
-
-#define _g_free0(var) (var = (g_free (var), NULL))
-#define _vala_assert(expr, msg) if G_LIKELY (expr) ; else g_assertion_message_expr (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
-#define _vala_return_if_fail(expr, msg) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return; }
-#define _vala_return_val_if_fail(expr, msg, val) if G_LIKELY (expr) ; else { g_return_if_fail_warning (G_LOG_DOMAIN, G_STRFUNC, msg); return val; }
-#define _vala_warn_if_fail(expr, msg) if G_LIKELY (expr) ; else g_warn_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, msg);
-
-
-
-gint _vala_main (gchar** args, int args_length1);
-void test_read_space (void);
-static void _test_read_space_gcallback (void);
-void test_read_word (void);
-static void _test_read_word_gcallback (void);
-void test_scan_word (void);
-static void _test_scan_word_gcallback (void);
-void test_check_char (void);
-static void _test_check_char_gcallback (void);
-void test_check_chars (void);
-static void _test_check_chars_gcallback (void);
-void test_check_chars_str (void);
-static void _test_check_chars_str_gcallback (void);
-void test_scan_char (void);
-
-
-static void _test_read_space_gcallback (void) {
-	test_read_space ();
-}
-
-
-static void _test_read_word_gcallback (void) {
-	test_read_word ();
-}
-
-
-static void _test_scan_word_gcallback (void) {
-	test_scan_word ();
-}
-
-
-static void _test_check_char_gcallback (void) {
-	test_check_char ();
-}
-
-
-static void _test_check_chars_gcallback (void) {
-	test_check_chars ();
-}
-
-
-static void _test_check_chars_str_gcallback (void) {
-	test_check_chars_str ();
-}
-
-
-gint _vala_main (gchar** args, int args_length1) {
-	gint result = 0;
-	g_test_init (&args_length1, &args, NULL);
-	g_test_add_func ("/crank/base/string/read/space", _test_read_space_gcallback);
-	g_test_add_func ("/crank/base/string/read/word", _test_read_word_gcallback);
-	g_test_add_func ("/crank/base/string/scan/word", _test_scan_word_gcallback);
-	g_test_add_func ("/crank/base/string/check/char", _test_check_char_gcallback);
-	g_test_add_func ("/crank/base/string/check/chars", _test_check_chars_gcallback);
-	g_test_add_func ("/crank/base/string/check/chars_str", _test_check_chars_str_gcallback);
-	g_test_run ();
-	result = 0;
-	return result;
-}
-
-
-int main (int argc, char ** argv) {
-#if !GLIB_CHECK_VERSION (2,35,0)
-	g_type_init ();
-#endif
-	return _vala_main (argv, argc);
-}
-
-
-void test_read_space (void) {
-	gchar* subject = NULL;
-	gchar* _tmp0_ = NULL;
-	guint pos = 0U;
-	guint space = 0U;
-	guint _tmp1_ = 0U;
-	gboolean _tmp2_ = FALSE;
-	guint _tmp3_ = 0U;
-	guint _tmp4_ = 0U;
-	guint _tmp5_ = 0U;
-	gboolean _tmp6_ = FALSE;
-	guint _tmp7_ = 0U;
-	guint _tmp8_ = 0U;
-	guint _tmp9_ = 0U;
-	gboolean _tmp10_ = FALSE;
-	guint _tmp11_ = 0U;
-	guint _tmp12_ = 0U;
-	guint _tmp13_ = 0U;
-	gboolean _tmp14_ = FALSE;
-	guint _tmp15_ = 0U;
-	guint _tmp16_ = 0U;
-	_tmp0_ = g_strdup ("  A string!");
-	subject = _tmp0_;
-	pos = (guint) 0;
-	_tmp2_ = crank_str_read_space (subject, &pos, &_tmp1_);
-	space = _tmp1_;
-	_vala_assert (_tmp2_, "Crank.str_read_space (subject, ref pos, out space)");
-	_tmp3_ = pos;
-	_vala_assert (_tmp3_ == ((guint) 2), "pos == 2");
-	_tmp4_ = space;
-	_vala_assert (_tmp4_ == ((guint) 2), "space == 2");
-	_tmp6_ = crank_str_read_space (subject, &pos, &_tmp5_);
-	space = _tmp5_;
-	_vala_assert (!_tmp6_, "! Crank.str_read_space (subject, ref pos, out space)");
-	_tmp7_ = pos;
-	_vala_assert (_tmp7_ == ((guint) 2), "pos == 2");
-	_tmp8_ = space;
-	_vala_assert (_tmp8_ == ((guint) 0), "space == 0");
-	pos = (guint) 3;
-	_tmp10_ = crank_str_read_space (subject, &pos, &_tmp9_);
-	space = _tmp9_;
-	_vala_assert (_tmp10_, "Crank.str_read_space (subject, ref pos, out space)");
-	_tmp11_ = pos;
-	_vala_assert (_tmp11_ == ((guint) 4), "pos == 4");
-	_tmp12_ = space;
-	_vala_assert (_tmp12_ == ((guint) 1), "space == 1");
-	pos = (guint) 7;
-	_tmp14_ = crank_str_read_space (subject, &pos, &_tmp13_);
-	space = _tmp13_;
-	_vala_assert (!_tmp14_, "! Crank.str_read_space (subject, ref pos, out space)");
-	_tmp15_ = pos;
-	_vala_assert (_tmp15_ == ((guint) 7), "pos == 7");
-	_tmp16_ = space;
-	_vala_assert (_tmp16_ == ((guint) 0), "space == 0");
-	_g_free0 (subject);
-}
-
-
-void test_read_word (void) {
-	gchar* subject = NULL;
-	gchar* _tmp0_ = NULL;
-	guint pos = 0U;
-	gchar* word = NULL;
-	gchar* _tmp1_ = NULL;
-	gboolean _tmp2_ = FALSE;
-	guint _tmp3_ = 0U;
-	const gchar* _tmp4_ = NULL;
-	gchar* _tmp5_ = NULL;
-	gboolean _tmp6_ = FALSE;
-	gchar* _tmp7_ = NULL;
-	gboolean _tmp8_ = FALSE;
-	guint _tmp9_ = 0U;
-	const gchar* _tmp10_ = NULL;
-	gchar* _tmp11_ = NULL;
-	gboolean _tmp12_ = FALSE;
-	guint _tmp13_ = 0U;
-	const gchar* _tmp14_ = NULL;
-	_tmp0_ = g_strdup ("A quick brown fox jumps over the lazy dog");
-	subject = _tmp0_;
-	pos = (guint) 0;
-	_tmp2_ = crank_str_read_word (subject, &pos, &_tmp1_);
-	_g_free0 (word);
-	word = _tmp1_;
-	_vala_assert (_tmp2_, "Crank.str_read_word (subject, ref pos, out word)");
-	_tmp3_ = pos;
-	_vala_assert (_tmp3_ == ((guint) 1), "pos == 1");
-	_tmp4_ = word;
-	_vala_assert (g_strcmp0 (_tmp4_, "A") == 0, "word == \"A\"");
-	_tmp6_ = crank_str_read_word (subject, &pos, &_tmp5_);
-	_g_free0 (word);
-	word = _tmp5_;
-	_vala_assert (!_tmp6_, "! Crank.str_read_word (subject, ref pos, out word)");
-	pos = (guint) 10;
-	_tmp8_ = crank_str_read_word (subject, &pos, &_tmp7_);
-	_g_free0 (word);
-	word = _tmp7_;
-	_vala_assert (_tmp8_, "Crank.str_read_word (subject, ref pos, out word)");
-	_tmp9_ = pos;
-	_vala_assert (_tmp9_ == ((guint) 13), "pos == 13");
-	_tmp10_ = word;
-	_vala_assert (g_strcmp0 (_tmp10_, "own") == 0, "word == \"own\"");
-	pos = (guint) 20;
-	_tmp12_ = crank_str_read_word (subject, &pos, &_tmp11_);
-	_g_free0 (word);
-	word = _tmp11_;
-	_vala_assert (_tmp12_, "Crank.str_read_word (subject, ref pos, out word)");
-	_tmp13_ = pos;
-	_vala_assert (_tmp13_ == ((guint) 23), "pos == 23");
-	_tmp14_ = word;
-	_vala_assert (g_strcmp0 (_tmp14_, "mps") == 0, "word == \"mps\"");
-	_g_free0 (word);
-	_g_free0 (subject);
-}
-
-
-void test_scan_char (void) {
-	gchar* subject = NULL;
-	gchar* _tmp0_ = NULL;
-	guint pos = 0U;
-	gchar sym = '\0';
-	gchar* _tmp1_ = NULL;
-	gboolean _tmp2_ = FALSE;
-	gchar* _tmp3_ = NULL;
-	gchar _tmp4_ = '\0';
-	gchar* _tmp5_ = NULL;
-	gboolean _tmp6_ = FALSE;
-	gchar* _tmp7_ = NULL;
-	gchar _tmp8_ = '\0';
-	gchar* _tmp9_ = NULL;
-	gboolean _tmp10_ = FALSE;
-	gchar* _tmp11_ = NULL;
-	gchar _tmp12_ = '\0';
-	gchar* _tmp13_ = NULL;
-	gboolean _tmp14_ = FALSE;
-	gchar* _tmp15_ = NULL;
-	_tmp0_ = g_strdup ("( : )");
-	subject = _tmp0_;
-	pos = (guint) 0;
-	_tmp2_ = crank_str_scan_char (subject, &pos, &_tmp1_);
-	_tmp3_ = _tmp1_;
-	sym = *_tmp3_;
-	_vala_assert (_tmp2_, "Crank.str_scan_char (subject, ref pos, out sym)");
-	_g_free0 (_tmp3_);
-	_tmp4_ = sym;
-	_vala_assert (_tmp4_ == '(', "sym == '('");
-	_tmp6_ = crank_str_scan_char (subject, &pos, &_tmp5_);
-	_tmp7_ = _tmp5_;
-	sym = *_tmp7_;
-	_vala_assert (_tmp6_, "Crank.str_scan_char (subject, ref pos, out sym)");
-	_g_free0 (_tmp7_);
-	_tmp8_ = sym;
-	_vala_assert (_tmp8_ == ':', "sym == ':'");
-	_tmp10_ = crank_str_scan_char (subject, &pos, &_tmp9_);
-	_tmp11_ = _tmp9_;
-	sym = *_tmp11_;
-	_vala_assert (_tmp10_, "Crank.str_scan_char (subject, ref pos, out sym)");
-	_g_free0 (_tmp11_);
-	_tmp12_ = sym;
-	_vala_assert (_tmp12_ == ')', "sym == ')'");
-	_tmp14_ = crank_str_scan_char (subject, &pos, &_tmp13_);
-	_tmp15_ = _tmp13_;
-	sym = *_tmp15_;
-	_vala_assert (!_tmp14_, "! Crank.str_scan_char (subject, ref pos, out sym)");
-	_g_free0 (_tmp15_);
-	_g_free0 (subject);
-}
-
-
-void test_scan_word (void) {
-	gchar* subject = NULL;
-	gchar* _tmp0_ = NULL;
-	guint pos = 0U;
-	gchar* word = NULL;
-	gchar* _tmp1_ = NULL;
-	gboolean _tmp2_ = FALSE;
-	const gchar* _tmp3_ = NULL;
-	gchar* _tmp4_ = NULL;
-	gboolean _tmp5_ = FALSE;
-	const gchar* _tmp6_ = NULL;
-	gchar* _tmp7_ = NULL;
-	gboolean _tmp8_ = FALSE;
-	const gchar* _tmp9_ = NULL;
-	_tmp0_ = g_strdup ("Cookie cake strawberry");
-	subject = _tmp0_;
-	pos = (guint) 0;
-	_tmp2_ = crank_str_scan_word (subject, &pos, &_tmp1_);
-	_g_free0 (word);
-	word = _tmp1_;
-	_vala_assert (_tmp2_, "Crank.str_scan_word (subject, ref pos, out word)");
-	_tmp3_ = word;
-	_vala_assert (g_strcmp0 (_tmp3_, "Cookie") == 0, "word == \"Cookie\"");
-	_tmp5_ = crank_str_scan_word (subject, &pos, &_tmp4_);
-	_g_free0 (word);
-	word = _tmp4_;
-	_vala_assert (_tmp5_, "Crank.str_scan_word (subject, ref pos, out word)");
-	_tmp6_ = word;
-	_vala_assert (g_strcmp0 (_tmp6_, "cake") == 0, "word == \"cake\"");
-	_tmp8_ = crank_str_scan_word (subject, &pos, &_tmp7_);
-	_g_free0 (word);
-	word = _tmp7_;
-	_vala_assert (_tmp8_, "Crank.str_scan_word (subject, ref pos, out word)");
-	_tmp9_ = word;
-	_vala_assert (g_strcmp0 (_tmp9_, "strawberry") == 0, "word == \"strawberry\"");
-	_g_free0 (word);
-	_g_free0 (subject);
-}
-
-
-void test_check_char (void) {
-	gchar* subject = NULL;
-	gchar* _tmp0_ = NULL;
-	guint pos = 0U;
-	gboolean _tmp1_ = FALSE;
-	gboolean _tmp2_ = FALSE;
-	gboolean _tmp3_ = FALSE;
-	gboolean _tmp4_ = FALSE;
-	gboolean _tmp5_ = FALSE;
-	_tmp0_ = g_strdup ("( : )");
-	subject = _tmp0_;
-	pos = (guint) 0;
-	_tmp1_ = crank_str_check_char (subject, &pos, ':');
-	_vala_assert (!_tmp1_, "! Crank.str_check_char (subject, ref pos, ':')");
-	_tmp2_ = crank_str_check_char (subject, &pos, '(');
-	_vala_assert (_tmp2_, "Crank.str_check_char (subject, ref pos, '(')");
-	_tmp3_ = crank_str_check_char (subject, &pos, ')');
-	_vala_assert (!_tmp3_, "! Crank.str_check_char (subject, ref pos, ')')");
-	_tmp4_ = crank_str_check_char (subject, &pos, ':');
-	_vala_assert (_tmp4_, "Crank.str_check_char (subject, ref pos, ':')");
-	_tmp5_ = crank_str_check_char (subject, &pos, ')');
-	_vala_assert (_tmp5_, "Crank.str_check_char (subject, ref pos, ')')");
-	_g_free0 (subject);
-}
-
-
-void test_check_chars (void) {
-	gchar* subject = NULL;
-	gchar* _tmp0_ = NULL;
-	guint pos = 0U;
-	gchar chars[3] = {0};
-	gchar _tmp1_[3] = {0};
-	gint _tmp2_ = 0;
-	gint _tmp3_ = 0;
-	gint _tmp4_ = 0;
-	gint _tmp5_ = 0;
-	_tmp0_ = g_strdup ("( : ) ,");
-	subject = _tmp0_;
-	pos = (guint) 0;
-	_tmp1_[0] = '(';
-	_tmp1_[1] = ':';
-	_tmp1_[2] = ')';
-	memcpy (chars, _tmp1_, 3 * sizeof (gchar));
-	_tmp2_ = crank_str_check_chars (subject, &pos, chars, (guint) 3);
-	_vala_assert (0 == _tmp2_, "0 == Crank.str_check_chars (subject, ref pos, chars)");
-	_tmp3_ = crank_str_check_chars (subject, &pos, chars, (guint) 3);
-	_vala_assert (1 == _tmp3_, "1 == Crank.str_check_chars (subject, ref pos, chars)");
-	_tmp4_ = crank_str_check_chars (subject, &pos, chars, (guint) 3);
-	_vala_assert (2 == _tmp4_, "2 == Crank.str_check_chars (subject, ref pos, chars)");
-	_tmp5_ = crank_str_check_chars (subject, &pos, chars, (guint) 3);
-	_vala_assert ((-1) == _tmp5_, "-1 == Crank.str_check_chars (subject, ref pos, chars)");
-	_g_free0 (subject);
-}
-
-
-void test_check_chars_str (void) {
-	gchar* subject = NULL;
-	gchar* _tmp0_ = NULL;
-	guint pos = 0U;
-	gchar* chars = NULL;
-	gchar* _tmp1_ = NULL;
-	gint _tmp2_ = 0;
-	gint _tmp3_ = 0;
-	gint _tmp4_ = 0;
-	gint _tmp5_ = 0;
-	_tmp0_ = g_strdup ("( : ) ,");
-	subject = _tmp0_;
-	pos = (guint) 0;
-	_tmp1_ = g_strdup ("(:)");
-	chars = _tmp1_;
-	_tmp2_ = crank_str_check_chars_str (subject, &pos, chars);
-	_vala_assert (0 == _tmp2_, "0 == Crank.str_check_chars_str (subject, ref pos, chars)");
-	_tmp3_ = crank_str_check_chars_str (subject, &pos, chars);
-	_vala_assert (1 == _tmp3_, "1 == Crank.str_check_chars_str (subject, ref pos, chars)");
-	_tmp4_ = crank_str_check_chars_str (subject, &pos, chars);
-	_vala_assert (2 == _tmp4_, "2 == Crank.str_check_chars_str (subject, ref pos, chars)");
-	_tmp5_ = crank_str_check_chars_str (subject, &pos, chars);
-	_vala_assert ((-1) == _tmp5_, "-1 == Crank.str_check_chars_str (subject, ref pos, chars)");
-	_g_free0 (chars);
-	_g_free0 (subject);
-}
-
-
-


playing with the conditional

playing with the conditional

--- random_tester.c
+++ random_tester.c
@@ -86,9 +86,8 @@
     {
         rootNk = 1 / pow(histogram[i], 0.5);
         poisson = (poisson_fact * pow(k, i)) / factorial(i);
-        if(histogram[i] / points >= poisson - poisson * rootNk
-            && histogram[i] / points <= poisson + poisson * rootNk)
-                poisson_boxes++;
+        if((histogram[i] / points >= poisson - poisson * rootNk) && (histogram[i] / points <= poisson + poisson * rootNk)) {
+            poisson_boxes++;
         }
     }
     printf("%d\n", poisson_boxes);


Added a note about the requirement

Added a note about the requirement

--- service/testing/mongo_temporary_server.h
+++ service/testing/mongo_temporary_server.h
@@ -4,6 +4,9 @@

    A temporary server for testing of mongo-based services.  Starts one up in a
    temporary directory and gives the uri to connect to.
+
+   NOTE: This is not a self-contained util. mongod need to be installed prior
+         to using mongo_temporary_server.
 */

 #include "jml/utils/environment.h"


Remove explicit cast to float.

Remove explicit cast to float.

--- lib/statespace_avx.h
+++ lib/statespace_avx.h
@@ -103,8 +103,8 @@

       float buffer[8];
       _mm256_storeu_ps(buffer, s1);
-      return (float)(buffer[0] + buffer[1] + buffer[2] + buffer[3]
-                     + buffer[4] + buffer[5] + buffer[6] + buffer[7]);
+      return buffer[0] + buffer[1] + buffer[2] + buffer[3]
+           + buffer[4] + buffer[5] + buffer[6] + buffer[7];
     };

     return ParallelFor::RunReduce(


Compliant: fixed debug compilation

Compliant: fixed debug compilation

Former-commit-id: db52d42dddb979475b9dee04a11c39d4f77ac9ff

--- applications/plugins/Compliant/mapping/RigidJointMultiMapping.h
+++ applications/plugins/Compliant/mapping/RigidJointMultiMapping.h
@@ -86,7 +86,9 @@
 	}

-
+
+#undef NDEBUG
+

     void assemble_geometric(const vector<typename self::const_in_coord_type>& in_pos,
                             const typename self::const_out_deriv_type& out_force) {
@@ -97,7 +99,7 @@
         assert( this->getFromModels()[0] != this->getFromModels()[1] );

         assert( this->getToModels().size() == 1 );
-        assert( this->getToModels()[0].size() == 1 );
+        assert( this->getToModels()[0]->size() == 1 );

         typedef typename self::geometric_type::CompressedMatrix matrix_type;
         matrix_type& dJ = this->geometric.compressedMatrix;


Added new folders;

Added new folders;

git-svn-id: fbb392d5347ebc45c06187f72dfd8bab02595dbf@397840 13f79535-47bb-0310-9956-ffa450edef68

error: pathspec 'modules/wsdl/woden/include/woden/util/axis2_om_util.h' did not match any file(s) known to git

--- modules/wsdl/woden/include/woden/util/axis2_om_util.h
+++ modules/wsdl/woden/include/woden/util/axis2_om_util.h
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_OM_UTIL.H
+#define AXIS2_OM_UTIL
+
+#include <axis2_array_list.h>
+#include <axis2_string.h>
+#include <axis2_om_element.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_first_child_element(axis2_om_element_t *ele,
+                                      axis2_env_t **env,
+                                      axis2_om_node_t *ele_node,
+                                      axis2_om_node_t **child_node);
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_last_child_element(axis2_om_element_t *ele,
+                                     axis2_env_t **env,
+                                     axis2_om_node_t *ele_node,
+                                     axis2_om_node_t **child_node);
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_next_sibling_element(axis2_om_element_t *ele,
+                                       axis2_env_t **env,
+                                       axis2_om_node_t *ele_node,
+                                       axis2_om_node_t **next_node);
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_first_child_element_with_localname(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_char_t *localname,
+                                             axis2_om_node_t **child_node);
+
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_last_child_element_with_localname(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_char_t *localname,
+                                             axis2_om_node_t **child_node);
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_next_siblng_element_with_localname(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_char_t *localname,
+                                             axis2_om_node_t **next_node);
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_first_child_element_with_uri_localname(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_char_t *localname,
+                                             axis2_char_t *uri,
+                                             axis2_om_node_t **child_node);
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_last_child_element_with_uri_localname(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_char_t *localname,
+                                             axis2_char_t *uri,
+                                             axis2_om_node_t **child_node);                        AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_next_sibling_element_with_uri_localname(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_char_t *localname,
+                                             axis2_char_t *uri,
+                                             axis2_om_node_t **next_node);
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_first_child_element_with_localnames(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_array_list_t *names,
+                                             axis2_om_node_t **child_node);
+
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_last_child_element_with_localnames(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_array_list_t *names,
+                                             axis2_om_node_t **child_node);
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_next_siblng_element_with_localnames(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_array_list_t *names,
+                                             axis2_om_node_t **next_node);
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_first_child_element_with_localname_attr(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_char_t *localname,
+                                             axis2_char_t *attr_name,
+                                             axis2_char_t *attr_value,
+                                             axis2_om_node_t **child_node);
+
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_last_child_element_with_localname_attr(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_char_t *localname,
+                                             axis2_char_t *attr_name,
+                                             axis2_char_t *attr_value,
+                                             axis2_om_node_t **child_node);
+
+AXIS2_DECLARE(axis2_om_element_t *)
+axis2_om_util_get_next_siblng_element_with_localname_attr(axis2_om_element_t *ele,
+                                             axis2_env_t  **env,
+                                             axis2_om_node_t *ele_node,
+                                             axis2_char_t *localname,
+                                             axis2_char_t *attr_name,
+                                             axis2_char_t *attr_value,
+                                             axis2_om_node_t **next_node);
+
+AXIS2_DECLARE(axis2_char_t *)
+axis2_om_util_get_child_text(axis2_om_node_t *node,
+                             axis2_env_t **env);
+
+AXIS2_DECLARE(axis2_char_t *)
+axis2_om_util_get_localname(axis2_om_node_t *node,
+                            axis2_env_t **env);
+
+AXIS2_DECLARE(axis2_char_t *)
+axis2_om_util_get_node_namespace_uri(axis2_om_node_t *om_node,
+                                     axis2_env_t **env);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_OM_UTIL */


label: Convert to g_object_notify_by_pspec

This avoids pspec lookup overhead in g_object_notify.

--- gtk/gtklabel.c
+++ gtk/gtklabel.c
@@ -351,8 +351,11 @@
   PROP_TRACK_VISITED_LINKS,
   PROP_LINES,
   PROP_XALIGN,
-  PROP_YALIGN
+  PROP_YALIGN,
+  NUM_PROPERTIES
 };
+
+static GParamSpec *label_props[NUM_PROPERTIES] = { NULL, };

 /* When rotating ellipsizable text we want the natural size to request
  * more to ensure the label wont ever ellipsize in an allocation of full natural size.
@@ -742,43 +745,41 @@
    * set the #GtkLabel:use-underline property to %TRUE in order for the label
    * to display them.
    */
-  g_object_class_install_property (gobject_class,
-                                   PROP_LABEL,
-                                   g_param_spec_string ("label",
-                                                        P_("Label"),
-                                                        P_("The text of the label"),
-                                                        "",
-                                                        GTK_PARAM_READWRITE));
-  g_object_class_install_property (gobject_class,
-				   PROP_ATTRIBUTES,
-				   g_param_spec_boxed ("attributes",
-						       P_("Attributes"),
-						       P_("A list of style attributes to apply to the text of the label"),
-						       PANGO_TYPE_ATTR_LIST,
-						       GTK_PARAM_READWRITE));
-  g_object_class_install_property (gobject_class,
-                                   PROP_USE_MARKUP,
-                                   g_param_spec_boolean ("use-markup",
-							 P_("Use markup"),
-							 P_("The text of the label includes XML markup. See pango_parse_markup()"),
-                                                        FALSE,
-                                                        GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-  g_object_class_install_property (gobject_class,
-                                   PROP_USE_UNDERLINE,
-                                   g_param_spec_boolean ("use-underline",
-							 P_("Use underline"),
-							 P_("If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key"),
-                                                        FALSE,
-                                                        GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
-  g_object_class_install_property (gobject_class,
-				   PROP_JUSTIFY,
-                                   g_param_spec_enum ("justify",
-                                                      P_("Justification"),
-                                                      P_("The alignment of the lines in the text of the label relative to each other. This does NOT affect the alignment of the label within its allocation. See GtkLabel:xalign for that"),
-						      GTK_TYPE_JUSTIFICATION,
-						      GTK_JUSTIFY_LEFT,
-                                                      GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+  label_props[PROP_LABEL] =
+      g_param_spec_string ("label",
+                           P_("Label"),
+                           P_("The text of the label"),
+                           "",
+                           GTK_PARAM_READWRITE);
+
+  label_props[PROP_ATTRIBUTES] =
+      g_param_spec_boxed ("attributes",
+                          P_("Attributes"),
+                          P_("A list of style attributes to apply to the text of the label"),
+                          PANGO_TYPE_ATTR_LIST,
+                          GTK_PARAM_READWRITE);
+
+  label_props[PROP_USE_MARKUP] =
+      g_param_spec_boolean ("use-markup",
+                            P_("Use markup"),
+                            P_("The text of the label includes XML markup. See pango_parse_markup()"),
+                            FALSE,
+                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+  label_props[PROP_USE_UNDERLINE] =
+      g_param_spec_boolean ("use-underline",
+                            P_("Use underline"),
+                            P_("If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key"),
+                            FALSE,
+                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+  label_props[PROP_JUSTIFY] =
+      g_param_spec_enum ("justify",
+                         P_("Justification"),
+                         P_("The alignment of the lines in the text of the label relative to each other. This does NOT affect the alignment of the label within its allocation. See GtkLabel:xalign for that"),
+                         GTK_TYPE_JUSTIFICATION,
+                         GTK_JUSTIFY_LEFT,
+                         GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

   /**
    * GtkLabel:xalign:
@@ -790,13 +791,13 @@
    *
    * Since: 3.16
    */
-  g_object_class_install_property (gobject_class,
-                                   PROP_XALIGN,
-                                   g_param_spec_float ("xalign",
-                                                       P_("X align"),
-                                                       P_("The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts."),
-                                                       0.0, 1.0, 0.5,
-                                                       GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+  label_props[PROP_XALIGN] =
+      g_param_spec_float ("xalign",
+                          P_("X align"),
+                          P_("The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts."),
+                          0.0, 1.0,
+                          0.5,
+                          GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

   /**
    * GtkLabel:yalign:
@@ -808,117 +809,107 @@
    *
    * Since: 3.16
    */
-  g_object_class_install_property (gobject_class,
-                                   PROP_YALIGN,
-                                   g_param_spec_float ("yalign",
-                                                       P_("Y align"),
-                                                       P_("The vertical alignment, from 0 (top) to 1 (bottom)"),
-                                                       0.0, 1.0, 0.5,
-                                                       GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_PATTERN,
-                                   g_param_spec_string ("pattern",
-                                                        P_("Pattern"),
-                                                        P_("A string with _ characters in positions correspond to characters in the text to underline"),
-                                                        NULL,
-                                                        GTK_PARAM_WRITABLE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_WRAP,
-                                   g_param_spec_boolean ("wrap",
-                                                        P_("Line wrap"),
-                                                        P_("If set, wrap lines if the text becomes too wide"),
-                                                        FALSE,
-                                                        GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+  label_props[PROP_YALIGN] =
+      g_param_spec_float ("yalign",
+                          P_("Y align"),
+                          P_("The vertical alignment, from 0 (top) to 1 (bottom)"),
+                          0.0, 1.0,
+                          0.5,
+                          GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+  label_props[PROP_PATTERN] =
+      g_param_spec_string ("pattern",
+                           P_("Pattern"),
+                           P_("A string with _ characters in positions correspond to characters in the text to underline"),
+                           NULL,
+                           GTK_PARAM_WRITABLE);
+
+  label_props[PROP_WRAP] =
+      g_param_spec_boolean ("wrap",
+                            P_("Line wrap"),
+                            P_("If set, wrap lines if the text becomes too wide"),
+                            FALSE,
+                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

   /**
    * GtkLabel:wrap-mode:
    *
-   * If line wrapping is on (see the #GtkLabel:wrap property) this controls
-   * how the line wrapping is done. The default is %PANGO_WRAP_WORD, which
+   * If line wrapping is on (see the #GtkLabel:wrap property) this controls
+   * how the line wrapping is done. The default is %PANGO_WRAP_WORD, which
    * means wrap on word boundaries.
    *
    * Since: 2.10
    */
-  g_object_class_install_property (gobject_class,
-                                   PROP_WRAP_MODE,
-                                   g_param_spec_enum ("wrap-mode",
-						      P_("Line wrap mode"),
-						      P_("If wrap is set, controls how linewrapping is done"),
-						      PANGO_TYPE_WRAP_MODE,
-						      PANGO_WRAP_WORD,
-						      GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-  g_object_class_install_property (gobject_class,
-                                   PROP_SELECTABLE,
-                                   g_param_spec_boolean ("selectable",
-                                                        P_("Selectable"),
-                                                        P_("Whether the label text can be selected with the mouse"),
-                                                        FALSE,
-                                                        GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-  g_object_class_install_property (gobject_class,
-                                   PROP_MNEMONIC_KEYVAL,
-                                   g_param_spec_uint ("mnemonic-keyval",
-						      P_("Mnemonic key"),
-						      P_("The mnemonic accelerator key for this label"),
-						      0,
-						      G_MAXUINT,
-						      GDK_KEY_VoidSymbol,
-						      GTK_PARAM_READABLE));
-  g_object_class_install_property (gobject_class,
-                                   PROP_MNEMONIC_WIDGET,
-                                   g_param_spec_object ("mnemonic-widget",
-							P_("Mnemonic widget"),
-							P_("The widget to be activated when the label's mnemonic "
-							  "key is pressed"),
-							GTK_TYPE_WIDGET,
-							GTK_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_CURSOR_POSITION,
-                                   g_param_spec_int ("cursor-position",
-                                                     P_("Cursor Position"),
-                                                     P_("The current position of the insertion cursor in chars"),
-                                                     0,
-                                                     G_MAXINT,
-                                                     0,
-                                                     GTK_PARAM_READABLE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_SELECTION_BOUND,
-                                   g_param_spec_int ("selection-bound",
-                                                     P_("Selection Bound"),
-                                                     P_("The position of the opposite end of the selection from the cursor in chars"),
-                                                     0,
-                                                     G_MAXINT,
-                                                     0,
-                                                     GTK_PARAM_READABLE));
-
+  label_props[PROP_WRAP_MODE] =
+      g_param_spec_enum ("wrap-mode",
+                         P_("Line wrap mode"),
+                         P_("If wrap is set, controls how linewrapping is done"),
+                         PANGO_TYPE_WRAP_MODE,
+                         PANGO_WRAP_WORD,
+                         GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+  label_props[PROP_SELECTABLE] =
+      g_param_spec_boolean ("selectable",
+                            P_("Selectable"),
+                            P_("Whether the label text can be selected with the mouse"),
+                            FALSE,
+                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+  label_props[PROP_MNEMONIC_KEYVAL] =
+      g_param_spec_uint ("mnemonic-keyval",
+                         P_("Mnemonic key"),
+                         P_("The mnemonic accelerator key for this label"),
+                         0, G_MAXUINT,
+                         GDK_KEY_VoidSymbol,
+                         GTK_PARAM_READABLE);
+
+  label_props[PROP_MNEMONIC_WIDGET] =
+      g_param_spec_object ("mnemonic-widget",
+                           P_("Mnemonic widget"),
+                           P_("The widget to be activated when the label's mnemonic key is pressed"),
+                           GTK_TYPE_WIDGET,
+                           GTK_PARAM_READWRITE);
+
+  label_props[PROP_CURSOR_POSITION] =
+      g_param_spec_int ("cursor-position",
+                        P_("Cursor Position"),
+                        P_("The current position of the insertion cursor in chars"),
+                        0, G_MAXINT,
+                        0,
+                        GTK_PARAM_READABLE);
+
+  label_props[PROP_SELECTION_BOUND] =
+      g_param_spec_int ("selection-bound",
+                        P_("Selection Bound"),
+                        P_("The position of the opposite end of the selection from the cursor in chars"),
+                        0, G_MAXINT,
+                        0,
+                        GTK_PARAM_READABLE);
+
   /**
    * GtkLabel:ellipsize:
    *
-   * The preferred place to ellipsize the string, if the label does
-   * not have enough room to display the entire string, specified as a
-   * #PangoEllipsizeMode.
+   * The preferred place to ellipsize the string, if the label does
+   * not have enough room to display the entire string, specified as a
+   * #PangoEllipsizeMode.
    *
-   * Note that setting this property to a value other than
-   * %PANGO_ELLIPSIZE_NONE has the side-effect that the label requests
-   * only enough space to display the ellipsis "...". In particular, this
-   * means that ellipsizing labels do not work well in notebook tabs, unless
+   * Note that setting this property to a value other than
+   * %PANGO_ELLIPSIZE_NONE has the side-effect that the label requests
+   * only enough space to display the ellipsis "...". In particular, this
+   * means that ellipsizing labels do not work well in notebook tabs, unless
    * the #GtkNotebook tab-expand child property is set to %TRUE. Other ways
    * to set a label's width are gtk_widget_set_size_request() and
    * gtk_label_set_width_chars().
    *
    * Since: 2.6
    */
-  g_object_class_install_property (gobject_class,
-				   PROP_ELLIPSIZE,
-                                   g_param_spec_enum ("ellipsize",
-                                                      P_("Ellipsize"),
-                                                      P_("The preferred place to ellipsize the string, if the label does not have enough room to display the entire string"),
-						      PANGO_TYPE_ELLIPSIZE_MODE,
-						      PANGO_ELLIPSIZE_NONE,
-                                                      GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+  label_props[PROP_ELLIPSIZE] =
+      g_param_spec_enum ("ellipsize",
+                         P_("Ellipsize"),
+                         P_("The preferred place to ellipsize the string, if the label does not have enough room to display the entire string"),
+                         PANGO_TYPE_ELLIPSIZE_MODE,
+                         PANGO_ELLIPSIZE_NONE,
+                         GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

   /**
    * GtkLabel:width-chars:
@@ -932,34 +923,31 @@
    *
    * Since: 2.6
    **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_WIDTH_CHARS,
-                                   g_param_spec_int ("width-chars",
-                                                     P_("Width In Characters"),
-                                                     P_("The desired width of the label, in characters"),
-                                                     -1,
-                                                     G_MAXINT,
-                                                     -1,
-                                                     GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
+  label_props[PROP_WIDTH_CHARS] =
+      g_param_spec_int ("width-chars",
+                        P_("Width In Characters"),
+                        P_("The desired width of the label, in characters"),
+                        -1, G_MAXINT,
+                        -1,
+                        GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
   /**
    * GtkLabel:single-line-mode:
-   *
+   *
    * Whether the label is in single line mode. In single line mode,
    * the height of the label does not depend on the actual text, it
    * is always set to ascent + descent of the font. This can be an
-   * advantage in situations where resizing the label because of text
+   * advantage in situations where resizing the label because of text
    * changes would be distracting, e.g. in a statusbar.
    *
    * Since: 2.6
    **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_SINGLE_LINE_MODE,
-                                   g_param_spec_boolean ("single-line-mode",
-                                                        P_("Single Line Mode"),
-                                                        P_("Whether the label is in single line mode"),
-                                                        FALSE,
-                                                        GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+  label_props[PROP_SINGLE_LINE_MODE] =
+      g_param_spec_boolean ("single-line-mode",
+                            P_("Single Line Mode"),
+                            P_("Whether the label is in single line mode"),
+                            FALSE,
+                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

   /**
    * GtkLabel:angle:
@@ -971,20 +959,18 @@
    *
    * Since: 2.6
    **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_ANGLE,
-                                   g_param_spec_double ("angle",
-							P_("Angle"),
-							P_("Angle at which the label is rotated"),
-							0.0,
-							360.0,
-							0.0,
-							GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
-
+  label_props[PROP_ANGLE] =
+      g_param_spec_double ("angle",
+                           P_("Angle"),
+                           P_("Angle at which the label is rotated"),
+                           0.0, 360.0,
+                           0.0,
+                           GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
   /**
    * GtkLabel:max-width-chars:
-   *
-   * The desired maximum width of the label, in characters. If this property
+   *
+   * The desired maximum width of the label, in characters. If this property
    * is set to -1, the width will be calculated automatically.
    *
    * See the section on [text layout][label-text-layout]
@@ -993,15 +979,13 @@
    *
    * Since: 2.6
    **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_MAX_WIDTH_CHARS,
-                                   g_param_spec_int ("max-width-chars",
-                                                     P_("Maximum Width In Characters"),
-                                                     P_("The desired maximum width of the label, in characters"),
-                                                     -1,
-                                                     G_MAXINT,
-                                                     -1,
-                                                     GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+  label_props[PROP_MAX_WIDTH_CHARS] =
+      g_param_spec_int ("max-width-chars",
+                        P_("Maximum Width In Characters"),
+                        P_("The desired maximum width of the label, in characters"),
+                        -1, G_MAXINT,
+                        -1,
+                        GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

   /**
    * GtkLabel:track-visited-links:
@@ -1012,13 +996,12 @@
    *
    * Since: 2.18
    */
-  g_object_class_install_property (gobject_class,
-                                   PROP_TRACK_VISITED_LINKS,
-                                   g_param_spec_boolean ("track-visited-links",
-                                                         P_("Track visited links"),
-                                                         P_("Whether visited links should be tracked"),
-                                                         TRUE,
-                                                         GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+  label_props[PROP_TRACK_VISITED_LINKS] =
+      g_param_spec_boolean ("track-visited-links",
+                            P_("Track visited links"),
+                            P_("Whether visited links should be tracked"),
+                            TRUE,
+                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);

   /**
    * GtkLabel:lines:
@@ -1030,25 +1013,25 @@
    *
    * Since: 3.10
    */
-  g_object_class_install_property (gobject_class,
-                                   PROP_LINES,
-                                   g_param_spec_int ("lines",
-                                                     P_("Number of lines"),
-                                                     P_("The desired number of lines, when ellipsizing a wrapping label"),
-                                                     -1,
-                                                     G_MAXINT,
-                                                     -1,
-                                                     GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+  label_props[PROP_LINES] =
+      g_param_spec_int ("lines",
+                        P_("Number of lines"),
+                        P_("The desired number of lines, when ellipsizing a wrapping label"),
+                        -1, G_MAXINT,
+                        -1,
+                        GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+
+  g_object_class_install_properties (gobject_class, NUM_PROPERTIES, label_props);
+
   /*
    * Key bindings
    */
-
   binding_set = gtk_binding_set_by_class (class);

   /* Moving the insertion point */
   add_move_binding (binding_set, GDK_KEY_Right, 0,
 		    GTK_MOVEMENT_VISUAL_POSITIONS, 1);
-
+
   add_move_binding (binding_set, GDK_KEY_Left, 0,
 		    GTK_MOVEMENT_VISUAL_POSITIONS, -1);

@@ -2010,7 +1993,7 @@
   GtkLabelPrivate *priv = label->priv;

   priv->mnemonic_widget = NULL;
-  g_object_notify (G_OBJECT (label), "mnemonic-widget");
+  g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_MNEMONIC_WIDGET]);
 }

 /**
@@ -2062,7 +2045,7 @@
       gtk_widget_add_mnemonic_label (priv->mnemonic_widget, GTK_WIDGET (label));
     }

-  g_object_notify (G_OBJECT (label), "mnemonic-widget");
+  g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_MNEMONIC_WIDGET]);
 }

 /**
@@ -2132,7 +2115,7 @@

   priv->label = str;

-  g_object_notify (G_OBJECT (label), "label");
+  g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_LABEL]);
 }

 static void
@@ -2146,7 +2129,7 @@
     {
       priv->use_markup = val;

-      g_object_notify (G_OBJECT (label), "use-markup");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_USE_MARKUP]);
     }
 }

@@ -2161,7 +2144,7 @@
     {
       priv->use_underline = val;

-      g_object_notify (G_OBJECT (label), "use-underline");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_USE_UNDERLINE]);
     }
 }

@@ -2197,7 +2180,7 @@
   if (keyval != priv->mnemonic_keyval)
     {
       gtk_label_setup_mnemonic (label, keyval);
-      g_object_notify (G_OBJECT (label), "mnemonic-keyval");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_MNEMONIC_KEYVAL]);
     }

   gtk_label_clear_layout (label);
@@ -2268,7 +2251,7 @@
     pango_attr_list_unref (priv->attrs);
   priv->attrs = attrs;

-  g_object_notify (G_OBJECT (label), "attributes");
+  g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_ATTRIBUTES]);

   gtk_label_clear_layout (label);
   gtk_widget_queue_resize (GTK_WIDGET (label));
@@ -2948,7 +2931,7 @@
       /* No real need to be this drastic, but easier than duplicating the code */
       gtk_label_clear_layout (label);

-      g_object_notify (G_OBJECT (label), "justify");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_JUSTIFY]);
       gtk_widget_queue_resize (GTK_WIDGET (label));
     }
 }
@@ -2996,8 +2979,8 @@

       /* No real need to be this drastic, but easier than duplicating the code */
       gtk_label_clear_layout (label);
-
-      g_object_notify (G_OBJECT (label), "ellipsize");
+
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_ELLIPSIZE]);
       gtk_widget_queue_resize (GTK_WIDGET (label));
     }
 }
@@ -3042,7 +3025,7 @@
   if (priv->width_chars != n_chars)
     {
       priv->width_chars = n_chars;
-      g_object_notify (G_OBJECT (label), "width-chars");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_WIDTH_CHARS]);
       gtk_widget_queue_resize (GTK_WIDGET (label));
     }
 }
@@ -3089,7 +3072,7 @@
     {
       priv->max_width_chars = n_chars;

-      g_object_notify (G_OBJECT (label), "max-width-chars");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_MAX_WIDTH_CHARS]);
       gtk_widget_queue_resize (GTK_WIDGET (label));
     }
 }
@@ -3146,7 +3129,7 @@

       gtk_label_clear_layout (label);
       gtk_widget_queue_resize (GTK_WIDGET (label));
-      g_object_notify (G_OBJECT (label), "wrap");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_WRAP]);
     }
 }

@@ -3191,8 +3174,8 @@
   if (priv->wrap_mode != wrap_mode)
     {
       priv->wrap_mode = wrap_mode;
-      g_object_notify (G_OBJECT (label), "wrap-mode");
-
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_WRAP_MODE]);
+
       gtk_widget_queue_resize (GTK_WIDGET (label));
     }
 }
@@ -5494,9 +5477,9 @@
   if (setting != old_setting)
     {
       g_object_freeze_notify (G_OBJECT (label));
-      g_object_notify (G_OBJECT (label), "selectable");
-      g_object_notify (G_OBJECT (label), "cursor-position");
-      g_object_notify (G_OBJECT (label), "selection-bound");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_SELECTABLE]);
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_CURSOR_POSITION]);
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_SELECTION_BOUND]);
       g_object_thaw_notify (G_OBJECT (label));
       gtk_widget_queue_draw (GTK_WIDGET (label));
     }
@@ -5559,7 +5542,7 @@
       gtk_label_clear_layout (label);
       gtk_widget_queue_resize (GTK_WIDGET (label));

-      g_object_notify (G_OBJECT (label), "angle");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_ANGLE]);
     }
 }

@@ -5728,9 +5711,9 @@
       g_object_freeze_notify (G_OBJECT (label));

       if (priv->select_info->selection_anchor != anchor_index)
-        g_object_notify (G_OBJECT (label), "selection-bound");
+        g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_SELECTION_BOUND]);
       if (priv->select_info->selection_end != end_index)
-        g_object_notify (G_OBJECT (label), "cursor-position");
+        g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_CURSOR_POSITION]);

       priv->select_info->selection_anchor = anchor_index;
       priv->select_info->selection_end = end_index;
@@ -6046,7 +6029,7 @@
       gtk_label_clear_layout (label);
       gtk_widget_queue_resize (GTK_WIDGET (label));

-      g_object_notify (G_OBJECT (label), "single-line-mode");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_SINGLE_LINE_MODE]);
     }
 }

@@ -6813,7 +6796,7 @@
       /* FIXME: shouldn't have to redo everything here */
       gtk_label_recalculate (label);

-      g_object_notify (G_OBJECT (label), "track-visited-links");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_TRACK_VISITED_LINKS]);
     }
 }

@@ -6936,7 +6919,7 @@
     {
       priv->lines = lines;
       gtk_label_clear_layout (label);
-      g_object_notify (G_OBJECT (label), "lines");
+      g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_LINES]);
       gtk_widget_queue_resize (GTK_WIDGET (label));
     }
 }
@@ -7136,7 +7119,7 @@
   label->priv->xalign = xalign;

   gtk_widget_queue_draw (GTK_WIDGET (label));
-  g_object_notify (G_OBJECT (label), "xalign");
+  g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_XALIGN]);
 }

 /**
@@ -7180,7 +7163,7 @@
   label->priv->yalign = yalign;

   gtk_widget_queue_draw (GTK_WIDGET (label));
-  g_object_notify (G_OBJECT (label), "yalign");
+  g_object_notify_by_pspec (G_OBJECT (label), label_props[PROP_YALIGN]);
 }

 /**


[pango-coverage] Fix optimization bug in pango_coverage_to_bytes()

--- pango/pango-coverage.c
+++ pango/pango-coverage.c
@@ -392,15 +392,18 @@
 	  guchar *data = coverage->blocks[i].data;
 	  guchar first_val = data[0];

-	  for (j = 1 ; j < 64; j++)
-	    if (data[j] != first_val)
-	      break;
-
-	  if (j == 64)
-	    {
-	      g_slice_free1 (64, data);
-	      coverage->blocks[i].data = NULL;
-	      coverage->blocks[i].level = first_val & 0x3;
+	  if (first_val == 0 || first_val == 0xff)
+	    {
+	      for (j = 1 ; j < 64; j++)
+		if (data[j] != first_val)
+		  break;
+
+	      if (j == 64)
+		{
+		  g_slice_free1 (64, data);
+		  coverage->blocks[i].data = NULL;
+		  coverage->blocks[i].level = first_val & 0x3;
+		}
 	    }
 	}


table_selector: add explicit casts to suppress warnings

--- lib/table_selector.c
+++ lib/table_selector.c
@@ -2147,9 +2147,9 @@
   }

   {
-    int i = 0;
+    size_t i = 0;
     if (!result_set_created) { i++; }
-    int n_result_sets = GRN_PTR_VECTOR_SIZE(&result_set_stack);
+    size_t n_result_sets = GRN_PTR_VECTOR_SIZE(&result_set_stack);
     for (; i < n_result_sets; i++) {
       grn_obj *result_set_ = GRN_PTR_VALUE_AT(&result_set_stack, i);
       grn_obj_close(ctx, result_set_);


label: Don't crash when a builder file contains unknown attributes

--- gtk/gtklabel.c
+++ gtk/gtklabel.c
@@ -1531,11 +1531,12 @@
 	}

       attr = attribute_from_text (data->builder, name, value, error);
-      attr->start_index = start_val;
-      attr->end_index   = end_val;

       if (attr)
 	{
+          attr->start_index = start_val;
+          attr->end_index   = end_val;
+
 	  if (!data->attrs)
 	    data->attrs = pango_attr_list_new ();


Fix resource leak in error path of function sfload_file()

--- fluidsynth/src/sfloader/fluid_defsfont.c
+++ fluidsynth/src/sfloader/fluid_defsfont.c
@@ -2010,6 +2010,7 @@
   if (!(sf = FLUID_NEW (SFData)))
     {
       FLUID_LOG(FLUID_ERR, "Out of memory");
+      fclose(fd);
       err = TRUE;
     }


Prevent NULL pointer dereference when accessing coroutine names during garbage collection cycles.

Closes #1493

--- Cython/Utility/Coroutine.c
+++ Cython/Utility/Coroutine.c
@@ -950,8 +950,11 @@
 static PyObject *
 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self)
 {
-    Py_INCREF(self->gi_name);
-    return self->gi_name;
+    PyObject *name = self->gi_name;
+    // avoid NULL pointer dereference during garbage collection
+    if (unlikely(!name)) name = Py_None;
+    Py_INCREF(name);
+    return name;
 }

 static int
@@ -978,8 +981,11 @@
 static PyObject *
 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
 {
-    Py_INCREF(self->gi_qualname);
-    return self->gi_qualname;
+    PyObject *name = self->gi_qualname;
+    // avoid NULL pointer dereference during garbage collection
+    if (unlikely(!name)) name = Py_None;
+    Py_INCREF(name);
+    return name;
 }

 static int