more cpBooling

more cpBooling

--- src/cpSpace.c
+++ src/cpSpace.c
@@ -31,7 +31,7 @@
 #pragma mark Contact Set Helpers

 // Equal function for contactSet.
-static int
+static cpBool
 contactSetEql(cpShape **shapes, cpArbiter *arb)
 {
 	cpShape *a = shapes[0];
@@ -61,7 +61,7 @@
 #pragma mark Collision Pair Function Helpers

 // Equals function for collFuncSet.
-static int
+static cpBool
 collFuncSetEql(cpCollisionHandler *check, cpCollisionHandler *pair)
 {
 	return ((check->a == pair->a && check->b == pair->b) || (check->b == pair->a && check->a == pair->b));
@@ -85,7 +85,7 @@
 	void *data;
 } postStepCallback;

-static int
+static cpBool
 postStepFuncSetEql(postStepCallback *a, postStepCallback *b){
 	return a->obj == b->obj;
 }
@@ -102,7 +102,7 @@
 #pragma mark Misc Helper Funcs

 // Default collision functions.
-static int alwaysCollide(cpArbiter *arb, cpSpace *space, void *data){return 1;}
+static cpBool alwaysCollide(cpArbiter *arb, cpSpace *space, void *data){return 1;}
 static void nothing(cpArbiter *arb, cpSpace *space, void *data){}

 // BBfunc callback for the spatial hash.
@@ -574,7 +574,7 @@
 	cpLayers layers;
 	cpGroup group;
 	cpSpaceSegmentQueryFunc func;
-	int anyCollision;
+	cpBool anyCollision;
 } segQueryContext;

 static cpFloat
@@ -590,7 +590,7 @@
 			context->func(shape, info.t, info.n, data);
 		}

-		context->anyCollision = 1;
+		context->anyCollision = cpTrue;
 	}

 	return 1.0f;
@@ -603,7 +603,7 @@
 		start, end,
 		layers, group,
 		func,
-		0,
+		cpFalse,
 	};

 	cpSpaceHashSegmentQuery(space->staticShapes, &context, start, end, 1.0f, (cpSpaceHashSegmentQueryFunc)segQueryFunc, data);
@@ -747,7 +747,7 @@
 	space->contactBuffersHead = buffer;
 }

-static inline int
+static inline cpBool
 queryReject(cpShape *a, cpShape *b)
 {
 	return
@@ -773,7 +773,7 @@
 	cpHashValue collHashID = CP_HASH_PAIR(a->collision_type, b->collision_type);
 	cpCollisionHandler *handler = (cpCollisionHandler *)cpHashSetFind(space->collFuncSet, collHashID, &ids);

-	int sensor = a->sensor || b->sensor;
+	cpBool sensor = a->sensor || b->sensor;
 	if(sensor && handler == &space->defaultHandler) return;

 	// Shape 'a' should have the lower shape type. (required by cpCollideShapes() )
@@ -842,7 +842,7 @@
 		cpBody *b = arb->private_body_b;

 		// both bodies are either static or sleeping
-		int sleepingNow = (!a|| a->node.next) && (!b|| b->node.next);
+		cpBool sleepingNow = (!a|| a->node.next) && (!b|| b->node.next);

 		if(sleepingNow){
 			arb->state = cpArbiterStateSleep;
@@ -1078,7 +1078,7 @@
 	cpArray *bodies = space->bodies;
 	cpArray *constraints = space->constraints;

-	space->locked = 1;
+	space->locked = cpTrue;

 	// Empty the arbiter list.
 	space->arbiters->num = 0;
@@ -1151,7 +1151,7 @@
 		}
 	}

-	space->locked = 0;
+	space->locked = cpFalse;

 	// run the post solve callbacks
 	for(int i=0; i<arbiters->num; i++){


igt/gem_exec_alignment: Remember to require 48b objects!

In order to actually use the high space we need to set the can-use-48bit
flag.

Signed-off-by: Chris Wilson <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-wilson.co.uk>

--- tests/gem_exec_alignment.c
+++ tests/gem_exec_alignment.c
@@ -100,15 +100,18 @@
 	execobj = calloc(sizeof(*execobj), count + 1);
 	igt_assert(execobj);

-	for (i = 0; i < count; i++)
+	for (i = 0; i < count; i++) {
 		execobj[i].handle = gem_create(fd, 4096);
+		if ((gtt_size-1) >> 32)
+			execobj[i].flags = 1<<3; /* EXEC_OBJECT_SUPPORTS_48B_ADDRESS */
+	}
 	execobj[i].handle = gem_create(fd, 4096);
 	gem_write(fd, execobj[i].handle, 0, &bbe, sizeof(bbe));

 	memset(&execbuf, 0, sizeof(execbuf));
 	execbuf.buffers_ptr = (uintptr_t)execobj;
 	execbuf.buffer_count = count + 1;
-	gem_execbuf(fd, &execbuf);
+	igt_require(__gem_execbuf(fd, &execbuf) == 0);

 	for (alignment = 4096; alignment < gtt_size; alignment <<= 1) {
 		for (i = 0; i < count; i++)
@@ -119,9 +122,10 @@
 			execbuf.buffers_ptr = (uintptr_t)(execobj + (factor - 1) * count / factor);
 		}

-		igt_debug("testing %lld x alignment=%lld\n",
-			  (long long)execbuf.buffer_count,
-			  (long long)alignment);
+		igt_debug("testing %lld x alignment=%#llx [%db]\n",
+			  (long long)execbuf.buffer_count - 1,
+			  (long long)alignment,
+			  find_last_bit(alignment));
 		gem_execbuf(fd, &execbuf);
 		for (i = 0; i < count; i++)
 			igt_assert_eq_u64(execobj[i].alignment, alignment);
@@ -143,12 +147,18 @@

 	memset(&execobj, 0, sizeof(execobj));
 	execobj.handle = gem_create(fd, 4096);
+	execobj.flags = 1<<3; /* EXEC_OBJECT_SUPPORTS_48B_ADDRESS */
 	gem_write(fd, execobj.handle, 0, &batch, sizeof(batch));

 	memset(&execbuf, 0, sizeof(execbuf));
 	execbuf.buffers_ptr = (uintptr_t)&execobj;
 	execbuf.buffer_count = 1;

+	gtt_size = gem_aperture_size(fd);
+	if (__gem_execbuf(fd, &execbuf)) {
+		execobj.flags = 0;
+		gtt_size = 1ull << 32;
+	}
 	gem_execbuf(fd, &execbuf);

 	execobj.alignment = 3*4096;
@@ -169,13 +179,13 @@
 		igt_assert_eq_u64(execobj.offset % execobj.alignment, 0);
 	}

-	gtt_size = gem_aperture_size(fd);
 	for (execobj.alignment = 4096;
 	     execobj.alignment < gtt_size;
 	     execobj.alignment <<= 1) {
-		igt_debug("starting offset: %#llx, next alignment: %#llx\n",
+		igt_debug("starting offset: %#llx, next alignment: %#llx [%db]\n",
 			  (long long)execobj.offset,
-			  (long long)execobj.alignment);
+			  (long long)execobj.alignment,
+			  find_last_bit(execobj.alignment));
 		gem_execbuf(fd, &execbuf);
 		igt_assert_eq_u64(execobj.offset % execobj.alignment, 0);
 	}


Faster SplashScreen

Faster SplashScreen

--- rxtools/source/lib/draw.c
+++ rxtools/source/lib/draw.c
@@ -16,7 +16,7 @@
     int i;
 //    unsigned char *screenPos = screen;
     color = color >> 16 & 0xFF | color & 0xFF00 | color << 16 & 0xFF0000
-    for (i = 0; i < (SCREEN_HEIGHT * SCREEN_WIDTH * 3); i += 4)
+    for (i = 0; i < SCREEN_SIZE; i += 4)
     {
 //        *(screenPos++) = color >> 16; //B
 //        *(screenPos++) = color >> 8; //G
@@ -185,15 +185,10 @@

 //----------------Some of my shit..........
 void SplashScreen(){
-	u8* Top = GetFilePack(TOP_PIC);
-    for(int i = 0; i < 0x46500; i+=3){
-		*(TOP_SCREEN + i + 0) = Top[i];
-		*(TOP_SCREEN + i + 1) = Top[i + 1];
-		*(TOP_SCREEN + i + 2) = Top[i + 2];
-        if(TOP_SCREEN2){
-            *(TOP_SCREEN2 + i + 0) = Top[i];
-    		*(TOP_SCREEN2 + i + 1) = Top[i + 1];
-    		*(TOP_SCREEN2 + i + 2) = Top[i + 2];
-        }
+	unsigned *Top = (unsigned *)GetFilePack(TOP_PIC);
+	for(int i = 0; i < SCREEN_SIZE >> 4; i++){
+		*(TOP_SCREEN + i) = Top[i];
+        if(TOP_SCREEN2)
+            *(TOP_SCREEN2 + i) = Top[i];
 	}
 }


add comment subproduction problem of reference counter Py_INCREF() / Py_DECREF() ?

--- src/cpymain.c
+++ src/cpymain.c
@@ -73,6 +73,7 @@
         // perhaps something will be happened in PyObject_GetAttrString(noattr)
         // and on below code, 'a' could not be set "{sO}" as a valid kw object
         // so raised 'ERROR: PyArg_ParseTupleAndKeywords()' in cpymPyObject()
+        // or a problem of reference counter Py_INCREF() / Py_DECREF() ?
         fprintf(stderr, "not have attr a.__dict__\n");
       }
     }


tests/gem_ring_sync_copy: reduce memory usage

gem_ring_sync_copy uses a lot of memory and gets OOM killed on smaller
systems (eg android devices).  Most of the allocation is for "busy work"
to keep the render rings busy and for this we can just re-use the same
few buffers over and over. This enables the test to be run on low end
devices.

Reviewed-by: Damien Lespiau <64bd3cb94f359c1a3ce68dae5e26b40578526277@intel.com>
Signed-off-by: Tim Gore <574638b6c8be9618c62b9975be7a73fefbc6d4f1@intel.com>
Signed-off-by: Damien Lespiau <64bd3cb94f359c1a3ce68dae5e26b40578526277@intel.com>

--- tests/gem_ring_sync_copy.c
+++ tests/gem_ring_sync_copy.c
@@ -57,6 +57,7 @@

 #define WIDTH	512
 #define HEIGHT	512
+#define NUM_BUSY_BUFFERS 32

 typedef struct {
 	int drm_fd;
@@ -163,11 +164,13 @@
 	size_t array_size;
 	int i;

-	array_size = data->n_buffers_load * sizeof(struct igt_buf);
+	/* allocate 32 buffer objects and re-use them as needed */
+	array_size = NUM_BUSY_BUFFERS * sizeof(struct igt_buf);
+
 	data->render.srcs = malloc(array_size);
 	data->render.dsts = malloc(array_size);

-	for (i = 0; i < data->n_buffers_load; i++) {
+	for (i = 0; i < NUM_BUSY_BUFFERS; i++) {
 		scratch_buf_init(data, &data->render.srcs[i], WIDTH, HEIGHT,
 				 0xdeadbeef);
 		scratch_buf_init(data, &data->render.dsts[i], WIDTH, HEIGHT,
@@ -177,10 +180,10 @@
 	for (i = 0; i < data->n_buffers_load; i++) {
 		data->render.copy(data->batch,
 				  NULL,			/* context */
-				  &data->render.srcs[i],
+				  &data->render.srcs[i % NUM_BUSY_BUFFERS],
 				  0, 0,			/* src_x, src_y */
 				  WIDTH, HEIGHT,
-				  &data->render.dsts[i],
+				  &data->render.dsts[i % NUM_BUSY_BUFFERS],
 				  0, 0			/* dst_x, dst_y */);
 	}
 }
@@ -189,7 +192,7 @@
 {
 	int i;

-	for (i = 0; i < data->n_buffers_load; i++) {
+	for (i = 0; i < NUM_BUSY_BUFFERS; i++) {
 		drm_intel_bo_unreference(data->render.srcs[i].bo);
 		drm_intel_bo_unreference(data->render.dsts[i].bo);
 	}
@@ -225,11 +228,13 @@
 	size_t array_size;
 	int i;

-	array_size = data->n_buffers_load * sizeof(drm_intel_bo *);
+	/* allocate 32 buffer objects and re-use them as needed */
+	array_size = NUM_BUSY_BUFFERS * sizeof(drm_intel_bo *);
+
 	data->blitter.srcs = malloc(array_size);
 	data->blitter.dsts = malloc(array_size);

-	for (i = 0; i < data->n_buffers_load; i++) {
+	for (i = 0; i < NUM_BUSY_BUFFERS; i++) {
 		data->blitter.srcs[i] = bo_create(data,
 						  WIDTH, HEIGHT,
 						  0xdeadbeef);
@@ -240,8 +245,8 @@

 	for (i = 0; i < data->n_buffers_load; i++) {
 		intel_copy_bo(data->batch,
-			      data->blitter.srcs[i],
-			      data->blitter.dsts[i],
+			      data->blitter.srcs[i % NUM_BUSY_BUFFERS],
+			      data->blitter.dsts[i % NUM_BUSY_BUFFERS],
 			      WIDTH*HEIGHT*4);
 	}
 }
@@ -250,7 +255,7 @@
 {
 	int i;

-	for (i = 0; i < data->n_buffers_load; i++) {
+	for (i = 0; i < NUM_BUSY_BUFFERS; i++) {
 		drm_intel_bo_unreference(data->blitter.srcs[i]);
 		drm_intel_bo_unreference(data->blitter.dsts[i]);
 	}


New GetPHOSTrackSegmentIndex function for the analysis of reconstructed events

--- PHOS/AliPHOSRecParticle.h
+++ PHOS/AliPHOSRecParticle.h
@@ -35,6 +35,7 @@
   virtual ~AliPHOSRecParticle(){} ; // dtor

   AliPHOSTrackSegment * GetPHOSTrackSegment() const ;
+  Int_t                 GetPHOSTrackSegmentIndex(){return fPHOSTrackSegment;}
   Int_t *               GetPrimaries(Int_t & number) ;

 private:


tests: libc: Update libc testcases to solve coverity issues

The coverity report "Out-of-bounds access". The reason is
The room of src and dest buffer is less than the count wanted
to be copyied. So enlarged the src and dest buffer to solve this
issue.

Fixes:#35345
Fixes:#35346

Signed-off-by: Ying ming <d3fca11d184a89ae0a68cb35f26e2e1e6bff4322@intel.com>

--- tests/lib/c_lib/src/main.c
+++ tests/lib/c_lib/src/main.c
@@ -528,8 +528,8 @@
 void test_memcpy(void)
 {
 	/* make sure the buffer is word aligned */
-	uintptr_t mem_dest[3] = {0};
-	uintptr_t mem_src[3] = {0};
+	uintptr_t mem_dest[4] = {0};
+	uintptr_t mem_src[4] = {0};
 	unsigned char *mem_dest_tmp = NULL;
 	unsigned char *mem_src_tmp = NULL;


Changed a built-in namespace for consistency

--- src/zorbamisc/ns_consts.h
+++ src/zorbamisc/ns_consts.h
@@ -31,7 +31,7 @@
 #define ZORBA_NODEREF_FN_NS "http://www.zorba-xquery.com/zorba/node-ref-functions"
 #define ZORBA_COLLECTION_FN_NS "http://www.zorba-xquery.com/zorba/collection-functions"

-#define ZORBA_DEF_COLLATION_NS "http://www.zorba-xquery.com/collations/IDENTICAL/en/US"
+#define ZORBA_DEF_COLLATION_NS "http://www.zorba-xquery.com/zorba/collations/IDENTICAL/en/US"
 #define W3C_CODEPT_COLLATION_NS "http://www.w3.org/2005/xpath-functions/collation/codepoint"

 #endif


Made ANSI C

Made ANSI C

--- core/alsp_src/generic/vprintf.c
+++ core/alsp_src/generic/vprintf.c
@@ -17,14 +17,6 @@

 #include "defs.h"

-#ifdef HAVE_STDARG_H
-#include <stdarg.h>
-
-#else
-#include <varargs.h>
-
-#endif
-
 /*
  * PI_oprintf uses the varargs package and vfprintf to print to
  * a file.
@@ -33,20 +25,11 @@

 /*VARARGS0 */
 void
-#ifdef HAVE_STDARG_H
-PI_oprintf(char *fmt, ...)
-#else
-PI_oprintf(char *fmt, va_alist)
-    va_dcl
-#endif
+PI_oprintf(const char *fmt, ...)
 {
     va_list args;

-#ifdef HAVE_STDARG_H
     va_start(args, fmt);
-#else
-    va_start(args);
-#endif

 #ifdef KERNAL
     vfprintf(stdout, fmt, args);


Add more shorthand CPP macros. They are nice, actually.

--- core/base/v7/inc/ROOT/TLogger.h
+++ core/base/v7/inc/ROOT/TLogger.h
@@ -118,8 +118,10 @@
 #define R__LOG_HERE(LEVEL, GROUP) \
   ROOT::Experimental::TLogEntry(LEVEL, GROUP).SetFile(__FILE__).SetLine(__LINE__).SetFunction(__PRETTY_FUNCTION__)

-
+#define R__FATAL_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kFatal, GROUP)
 #define R__ERROR_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kError, GROUP)
 #define R__WARNING_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kWarning, GROUP)
+#define R__INFO_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kInfo, GROUP)
+#define R__DEBUG_HERE(GROUP) R__LOG_HERE(ROOT::Experimental::ELogLevel::kDebug, GROUP)

 #endif


test/ring: factorize object checks

test/ring: factorize object checks

Do code clean up by moving repeated code inside 'test_ring_mem_cmp'
function to validate data and print information of enqueue/dequeue
elements if validation fails.

Signed-off-by: Feifei Wang <2493857810266eaae720c9869c8b9d6ce45d3739@arm.com>
Reviewed-by: Ruifeng Wang <a548d51fbc42485a8ba807711a537e88c2b59dd2@arm.com>
Reviewed-by: Phil Yang <5a9b6465c065ff0e1fd5d2cb9eb2185e82f34247@arm.com>
Reviewed-by: Dharmik Thakkar <724f3610823e4b14afc73144686337ac966281c2@arm.com>
Reviewed-by: Honnappa Nagarahalli <01ccf438b971cc1d8919c8a7f18443cae9429d8b@arm.com>
Acked-by: Konstantin Ananyev <cbd5212b59ab42a210d72992d23a3aa17cfd3eaf@intel.com>

--- app/test/test_ring.c
+++ app/test/test_ring.c
@@ -258,6 +258,21 @@
 			((uint32_t *)obj)[i] = i;
 }

+static int
+test_ring_mem_cmp(void *src, void *dst, unsigned int size)
+{
+	int ret;
+
+	ret = memcmp(src, dst, size);
+	if (ret) {
+		rte_hexdump(stdout, "src", src, size);
+		rte_hexdump(stdout, "dst", dst, size);
+		printf("data after dequeue is not the same\n");
+	}
+
+	return ret;
+}
+
 static void
 test_ring_print_test_string(const char *istr, unsigned int api_type, int esize)
 {
@@ -383,7 +398,7 @@
 	struct rte_ring *r;
 	void **src = NULL, **cur_src = NULL, **dst = NULL, **cur_dst = NULL;
 	int ret;
-	unsigned int i, j;
+	unsigned int i, j, temp_sz;
 	int rand;
 	const unsigned int rsz = RING_SIZE - 1;

@@ -444,12 +459,11 @@
 			TEST_RING_VERIFY(rte_ring_empty(r));

 			/* check data */
-			if (esize[i] == -1) {
-				TEST_RING_VERIFY(memcmp(src, dst,
-					rsz * sizeof(void *)) == 0);
-			} else
-				TEST_RING_VERIFY(memcmp(src, dst,
-					rsz * esize[i]) == 0);
+			temp_sz = rsz * sizeof(void *);
+			if (esize[i] != -1)
+				temp_sz = rsz * esize[i];
+			TEST_RING_VERIFY(test_ring_mem_cmp(src, dst,
+						temp_sz) == 0);
 		}

 		/* Free memory before test completed */
@@ -543,14 +557,8 @@
 		cur_dst = test_ring_inc_ptr(cur_dst, esize[i], MAX_BULK);

 		/* check data */
-		if (memcmp(src, dst, RTE_PTR_DIFF(cur_dst, dst))) {
-			rte_hexdump(stdout, "src", src,
-					RTE_PTR_DIFF(cur_src, src));
-			rte_hexdump(stdout, "dst", dst,
-					RTE_PTR_DIFF(cur_dst, dst));
-			printf("data after dequeue is not the same\n");
-			goto fail;
-		}
+		if (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))
+			goto fail;

 		/* Free memory before test completed */
 		rte_ring_free(r);
@@ -621,14 +629,8 @@
 		}

 		/* check data */
-		if (memcmp(src, dst, RTE_PTR_DIFF(cur_dst, dst))) {
-			rte_hexdump(stdout, "src", src,
-					RTE_PTR_DIFF(cur_src, src));
-			rte_hexdump(stdout, "dst", dst,
-					RTE_PTR_DIFF(cur_dst, dst));
-			printf("data after dequeue is not the same\n");
-			goto fail;
-		}
+		if (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))
+			goto fail;

 		/* Free memory before test completed */
 		rte_ring_free(r);
@@ -756,14 +758,8 @@
 			goto fail;

 		/* check data */
-		if (memcmp(src, dst, RTE_PTR_DIFF(cur_dst, dst))) {
-			rte_hexdump(stdout, "src", src,
-					RTE_PTR_DIFF(cur_src, src));
-			rte_hexdump(stdout, "dst", dst,
-					RTE_PTR_DIFF(cur_dst, dst));
-			printf("data after dequeue is not the same\n");
-			goto fail;
-		}
+		if (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))
+			goto fail;

 		/* Free memory before test completed */
 		rte_ring_free(r);
@@ -868,12 +864,8 @@
 		}

 		/* check data */
-		if (memcmp(src, dst, RTE_PTR_DIFF(cur_dst, dst))) {
-			rte_hexdump(stdout, "src", src, RTE_PTR_DIFF(cur_src, src));
-			rte_hexdump(stdout, "dst", dst, RTE_PTR_DIFF(cur_dst, dst));
-			printf("data after dequeue is not the same\n");
-			goto fail_test;
-		}
+		if (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))
+			goto fail_test;

 		/* Following tests use the configured flags to decide
 		 * SP/SC or MP/MC.
@@ -920,12 +912,8 @@
 		cur_dst = test_ring_inc_ptr(cur_dst, esize[i], 2);

 		/* check data */
-		if (memcmp(src, dst, RTE_PTR_DIFF(cur_dst, dst))) {
-			rte_hexdump(stdout, "src", src, RTE_PTR_DIFF(cur_src, src));
-			rte_hexdump(stdout, "dst", dst, RTE_PTR_DIFF(cur_dst, dst));
-			printf("data after dequeue is not the same\n");
-			goto fail_test;
-		}
+		if (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))
+			goto fail_test;

 		rte_ring_free(rp);
 		rte_free(src);
@@ -1058,12 +1046,8 @@
 		}

 		/* check data */
-		if (memcmp(src, dst, RTE_PTR_DIFF(cur_dst, dst))) {
-			rte_hexdump(stdout, "src", src, RTE_PTR_DIFF(cur_src, src));
-			rte_hexdump(stdout, "dst", dst, RTE_PTR_DIFF(cur_dst, dst));
-			printf("data after dequeue is not the same\n");
-			goto test_fail;
-		}
+		if (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))
+			goto test_fail;

 		rte_free(src_orig);
 		rte_free(dst_orig);


firmata: update dev->period, pwm_min_period, pwm_max_period, from ns to us

Signed-off-by: Rick Waldron <dd8fdbe95c7f81f312b273ef8860922803e9ef16@gmail.com>
Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- src/firmata/firmata_mraa.c
+++ src/firmata/firmata_mraa.c
@@ -418,7 +418,7 @@
         return NULL;
     }
     dev->pin = pin;
-    dev->period = 2048000; // Locked, in ns
+    dev->period = 2048; // Locked, in us
     dev->advance_func = (mraa_adv_func_t*) func_table;

     return dev;
@@ -483,8 +483,8 @@
     b->i2c_bus_count = 1;
     b->def_i2c_bus = 0;
     b->i2c_bus[0].bus_id = 0;
-    b->pwm_min_period = 2048000;
-    b->pwm_max_period = 2048000;
+    b->pwm_min_period = 2048;
+    b->pwm_max_period = 2048;

     b->pins = (mraa_pininfo_t*) calloc(b->phy_pin_count, sizeof(mraa_pininfo_t));
     if (b->pins == NULL) {


tests: mockup: fix a typo in comment

tests: mockup: fix a typo in comment

It should have been 'check' not 'chech'.

Signed-off-by: Bartosz Golaszewski <e5d45fddd9040473413b909b802f629a971ad04c@baylibre.com>

--- tests/mockup/gpio-mockup.c
+++ tests/mockup/gpio-mockup.c
@@ -107,7 +107,7 @@
 	if (rv)
 		goto err_unref_module;

-	/* We need to chech that the gpio-mockup debugfs directory exists. */
+	/* We need to check that the gpio-mockup debugfs directory exists. */
 	rv = access("/sys/kernel/debug/gpio-mockup", R_OK);
 	if (rv)
 		goto err_unref_module;


coffee kicks in now, previous commit now in trunk

--- signer/src/daemon/engine.c
+++ signer/src/daemon/engine.c
@@ -704,6 +704,8 @@
             ods_log_assert(zone->xfrd);
             netio_add_handler(engine->xfrhandler->netio,
                 &zone->xfrd->handler);
+        } else if (!zone->xfrd->serial_disk_acquired) {
+            xfrd_set_timer_now(zone->xfrd);
         }
     } else if (zone->xfrd) {
         netio_remove_handler(engine->xfrhandler->netio,


commit nit

commit nit

--- signer/src/daemon/engine.c
+++ signer/src/daemon/engine.c
@@ -507,7 +507,8 @@
     /* set up hsm */
     result = hsm_open(engine->config->cfg_filename, hsm_prompt_pin, NULL); /* LEAKS */
     if (result != HSM_OK) {
-        se_log_error("Error initializing libhsm (errno %i)", result);
+        se_log_error("setup failed: error initializing libhsm (errno %i)",
+            result);
         return 1;
     }


drop signatures if signing increased the serial

--- signer/src/signer/domain.c
+++ signer/src/signer/domain.c
@@ -867,6 +867,9 @@
                 ldns_native2rdf_int32(LDNS_RDF_TYPE_INT32, serial),
                 SE_SOA_RDATA_SERIAL);
             if (soa_serial) {
+                if (ldns_rdf2native_int32(soa_serial) != serial) {
+                    rrset->drop_signatures = 1;
+                }
                 ldns_rdf_deep_free(soa_serial);
              } else {
                 se_log_error("unable to sign domain: failed to replace "


Fix client cursors hotspot on scaled outputs

--- types/wlr_output.c
+++ types/wlr_output.c
@@ -346,12 +346,6 @@
 	float translate[16];
 	wlr_matrix_translate(&translate, cursor_box.x, cursor_box.y, 0);

-	// Assume cursors without a surface are already scaled for the output
-	if (cursor->surface != NULL) {
-		cursor_box.width *= cursor->output->scale;
-		cursor_box.height *= cursor->output->scale;
-	}
-
 	float scale[16];
 	wlr_matrix_scale(&scale, cursor_box.width, cursor_box.height, 1);

@@ -546,8 +540,8 @@
 static void output_cursor_commit(struct wlr_output_cursor *cursor) {
 	// Some clients commit a cursor surface with a NULL buffer to hide it.
 	cursor->enabled = wlr_surface_has_buffer(cursor->surface);
-	cursor->width = cursor->surface->current->width;
-	cursor->height = cursor->surface->current->height;
+	cursor->width = cursor->surface->current->width * cursor->output->scale;
+	cursor->height = cursor->surface->current->height * cursor->output->scale;

 	if (cursor->output->hardware_cursor != cursor) {
 		cursor->output->needs_swap = true;
@@ -580,8 +574,8 @@
 		return;
 	}

-	cursor->hotspot_x = hotspot_x;
-	cursor->hotspot_y = hotspot_y;
+	cursor->hotspot_x = hotspot_x * cursor->output->scale;
+	cursor->hotspot_y = hotspot_y * cursor->output->scale;

 	if (surface && surface == cursor->surface) {
 		if (cursor->output->hardware_cursor == cursor &&


Fixed the thread crach

Fixed the thread crach

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

--- modules/core/transport/http/receiver/http_svr_thread.c
+++ modules/core/transport/http/receiver/http_svr_thread.c
@@ -377,7 +377,7 @@
         thread_env = NULL;
     }
 #ifdef AXIS2_SVR_MULTI_THREADED
-    AXIS2_THREAD_POOL_EXIT_THREAD(env->thread_pool, thd);
+    /*AXIS2_THREAD_POOL_EXIT_THREAD(env->thread_pool, thd);*/
 #endif

     return NULL;


enhanced sofiasip client agent

enhanced sofiasip client agent

--- modules/mrcp-sofiasip/src/mrcp_sofiasip_client_agent.c
+++ modules/mrcp-sofiasip/src/mrcp_sofiasip_client_agent.c
@@ -57,11 +57,11 @@
 static apt_bool_t mrcp_sofia_task_terminate(apt_task_t *task);

 static apt_bool_t mrcp_sofia_session_offer(mrcp_session_t *session, mrcp_session_descriptor_t *descriptor);
-static apt_bool_t mrcp_sofia_session_terminate(mrcp_session_t *session);
+static apt_bool_t mrcp_sofia_session_terminate_request(mrcp_session_t *session);

 static const mrcp_session_request_vtable_t session_request_vtable = {
 	mrcp_sofia_session_offer,
-	mrcp_sofia_session_terminate
+	mrcp_sofia_session_terminate_request
 };

 static apt_bool_t mrcp_sofia_config_validate(mrcp_sofia_agent_t *sofia_agent, mrcp_sofia_client_config_t *config, apr_pool_t *pool);
@@ -212,6 +212,20 @@
 	return TRUE;
 }

+static apt_bool_t mrcp_sofia_session_destroy(mrcp_sofia_session_t *sofia_session)
+{
+	if(sofia_session->nh) {
+		nua_handle_bind(sofia_session->nh, NULL);
+		nua_handle_destroy(sofia_session->nh);
+	}
+	if(sofia_session->home) {
+		sofia_session->session->obj = NULL;
+		su_home_unref(sofia_session->home);
+		sofia_session->home = NULL;
+	}
+	return TRUE;
+}
+
 static apt_bool_t mrcp_sofia_session_offer(mrcp_session_t *session, mrcp_session_descriptor_t *descriptor)
 {
 	char sdp_str[2048];
@@ -233,24 +247,24 @@
 	return TRUE;
 }

-static apt_bool_t mrcp_sofia_session_terminate(mrcp_session_t *session)
+static apt_bool_t mrcp_sofia_session_terminate_request(mrcp_session_t *session)
 {
 	mrcp_sofia_session_t *sofia_session = session->obj;
 	if(!sofia_session || !sofia_session->nh) {
 		return FALSE;
 	}

-	sofia_session->terminate_requested = TRUE;
 	nua_bye(sofia_session->nh,TAG_END());
 	return TRUE;
 }

-
-static void mrcp_sofia_on_call_ready(mrcp_sofia_agent_t   *sofia_agent,
-									 nua_handle_t         *nh,
-									 mrcp_sofia_session_t *sofia_session,
-									 sip_t const          *sip,
-									 tagi_t                tags[])
+static void mrcp_sofia_on_session_ready(
+						int                   status,
+						mrcp_sofia_agent_t   *sofia_agent,
+						nua_handle_t         *nh,
+						mrcp_sofia_session_t *sofia_session,
+						sip_t const          *sip,
+						tagi_t                tags[])
 {
 	const char *local_sdp_str = NULL, *remote_sdp_str = NULL;
 	mrcp_session_descriptor_t *descriptor = NULL;
@@ -274,34 +288,30 @@
 	mrcp_session_answer(sofia_session->session,descriptor);
 }

-static void mrcp_sofia_on_call_terminate(mrcp_sofia_agent_t   *sofia_agent,
-									     nua_handle_t         *nh,
-									     mrcp_sofia_session_t *sofia_session,
-									     sip_t const          *sip,
-									     tagi_t                tags[])
+static void mrcp_sofia_on_session_terminate(
+						int                   status,
+						mrcp_sofia_agent_t   *sofia_agent,
+						nua_handle_t         *nh,
+						mrcp_sofia_session_t *sofia_session,
+						sip_t const          *sip,
+						tagi_t                tags[])
 {
 	if(sofia_session->terminate_requested == TRUE) {
 		mrcp_session_terminate_response(sofia_session->session);
-		if(sofia_session->nh) {
-			nua_handle_bind(sofia_session->nh, NULL);
-			nua_handle_destroy(sofia_session->nh);
-		}
-		if(sofia_session->home) {
-			sofia_session->session->obj = NULL;
-			su_home_unref(sofia_session->home);
-			sofia_session->home = NULL;
-		}
+		mrcp_sofia_session_destroy(sofia_session);
 	}
 	else {
 		mrcp_session_terminate_event(sofia_session->session);
 	}
 }

-static void mrcp_sofia_on_state_change(mrcp_sofia_agent_t   *sofia_agent,
-									   nua_handle_t         *nh,
-									   mrcp_sofia_session_t *sofia_session,
-									   sip_t const          *sip,
-									   tagi_t                tags[])
+static void mrcp_sofia_on_state_change(
+						int                   status,
+						mrcp_sofia_agent_t   *sofia_agent,
+						nua_handle_t         *nh,
+						mrcp_sofia_session_t *sofia_session,
+						sip_t const          *sip,
+						tagi_t                tags[])
 {
 	int ss_state = nua_callstate_init;
 	tl_gets(tags,
@@ -312,41 +322,64 @@

 	switch(ss_state) {
 		case nua_callstate_ready:
-			mrcp_sofia_on_call_ready(sofia_agent,nh,sofia_session,sip,tags);
+			mrcp_sofia_on_session_ready(status,sofia_agent,nh,sofia_session,sip,tags);
 			break;
 		case nua_callstate_terminated:
-			mrcp_sofia_on_call_terminate(sofia_agent,nh,sofia_session,sip,tags);
-			break;
-	}
-}
-
-static void mrcp_sofia_on_resource_discover(mrcp_sofia_agent_t   *sofia_agent,
-									        nua_handle_t         *nh,
-									        mrcp_sofia_session_t *sofia_session,
-									        sip_t const          *sip,
-									        tagi_t                tags[])
+			mrcp_sofia_on_session_terminate(status,sofia_agent,nh,sofia_session,sip,tags);
+			break;
+	}
+}
+
+static void mrcp_sofia_on_bye(
+						int                   status,
+						mrcp_sofia_agent_t   *sofia_agent,
+						nua_handle_t         *nh,
+						mrcp_sofia_session_t *sofia_session,
+						sip_t const          *sip,
+						tagi_t                tags[])
+{
+	if(status == 200) {
+		sofia_session->terminate_requested = TRUE;
+	}
+	else {
+		mrcp_session_terminate_response(sofia_session->session);
+		mrcp_sofia_session_destroy(sofia_session);
+	}
+}
+
+static void mrcp_sofia_on_resource_discover(
+						int                   status,
+						mrcp_sofia_agent_t   *sofia_agent,
+						nua_handle_t         *nh,
+						mrcp_sofia_session_t *sofia_session,
+						sip_t const          *sip,
+						tagi_t                tags[])
 {
 }

 /** This callback will be called by SIP stack to process incoming events */
-static void mrcp_sofia_event_callback( nua_event_t           nua_event,
-									   int                   status,
-									   char const           *phrase,
-									   nua_t                *nua,
-									   mrcp_sofia_agent_t   *sofia_agent,
-									   nua_handle_t         *nh,
-									   mrcp_sofia_session_t *sofia_session,
-									   sip_t const          *sip,
-									   tagi_t                tags[])
+static void mrcp_sofia_event_callback(
+						nua_event_t           nua_event,
+						int                   status,
+						char const           *phrase,
+						nua_t                *nua,
+						mrcp_sofia_agent_t   *sofia_agent,
+						nua_handle_t         *nh,
+						mrcp_sofia_session_t *sofia_session,
+						sip_t const          *sip,
+						tagi_t                tags[])
 {
 	apt_log(APT_PRIO_INFO,"Recieve SIP Event [%s] Status %d %s",nua_event_name(nua_event),status,phrase);

 	switch(nua_event) {
 		case nua_i_state:
-			mrcp_sofia_on_state_change(sofia_agent,nh,sofia_session,sip,tags);
+			mrcp_sofia_on_state_change(status,sofia_agent,nh,sofia_session,sip,tags);
 			break;
 		case nua_i_options:
-			mrcp_sofia_on_resource_discover(sofia_agent,nh,sofia_session,sip,tags);
+			mrcp_sofia_on_resource_discover(status,sofia_agent,nh,sofia_session,sip,tags);
+			break;
+		case nua_r_bye:
+			mrcp_sofia_on_bye(status,sofia_agent,nh,sofia_session,sip,tags);
 			break;
 		case nua_r_shutdown:
 			/* break main loop of sofia thread */


vm: fix some size_t/uint64_t issues (11)

--- src/cvm/cvm.h
+++ src/cvm/cvm.h
@@ -605,7 +605,7 @@
     void print_ssa_registers();

   private:
-    typedef std::vector<std::pair<size_t, std::string>> disasm_map_t;
+    typedef std::vector<std::pair<uint64_t, std::string>> disasm_map_t;
     disasm_map_t disasm;
     bool         has_disasm = false;
     void         prepare_disasm();


Update user_main.c

Update user_main.c

--- app/user/user_main.c
+++ app/user/user_main.c
@@ -32,10 +32,10 @@
 }
 void ICACHE_FLASH_ATTR
 user_init(void) {
-    //uart_init(9600, 9600);
-    printf("engine start \n");
-    led_init();
-    led_red();
+    uart_init(115200, 115200);
+    //printf("engine start \n");
+    //led_init();
+    //led_red();
 	gpio_14_init();
 	if (get_gpio14() == 0)
 	{
@@ -101,4 +101,4 @@
 		printf("[*] DrCOM start\n");
 		xTaskCreate(waitap, "waitap", 8192, NULL, 2, NULL);
 	}
-}+}


vpp/gen8: Use 48 bit address relocation for STATE_BASE_ADDRESS

Use 48 bit address relocation for Surface state address, Dynamic state address
and Instruction base address.

Signed-off-by: Sreerenj Balachandran <8526e100bdc7a12d85af109c9f42b86756e50e67@intel.com>
Reviewed-by: Zhao Yakui <21bae65ecea50a19bd9d0fef489914760189fd5b@intel.com>

--- src/gen8_post_processing.c
+++ src/gen8_post_processing.c
@@ -1246,21 +1246,20 @@
     OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY);
 	OUT_BATCH(batch, 0);
 	OUT_BATCH(batch, 0);
-	/* DW4. Surface state address */
-    OUT_RELOC(batch, pp_context->surface_state_binding_table.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); /* Surface state base address */
-	OUT_BATCH(batch, 0);
-	/* DW6. Dynamic state address */
-    OUT_RELOC(batch, pp_context->dynamic_state.bo, I915_GEM_DOMAIN_RENDER | I915_GEM_DOMAIN_SAMPLER,
+
+	/* DW4-5. Surface state address */
+    OUT_RELOC64(batch, pp_context->surface_state_binding_table.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY); /* Surface state base address */
+
+	/* DW6-7. Dynamic state address */
+    OUT_RELOC64(batch, pp_context->dynamic_state.bo, I915_GEM_DOMAIN_RENDER | I915_GEM_DOMAIN_SAMPLER,
 		0, 0 | BASE_ADDRESS_MODIFY);
-	OUT_BATCH(batch, 0);

 	/* DW8. Indirect object address */
     OUT_BATCH(batch, 0 | BASE_ADDRESS_MODIFY);
 	OUT_BATCH(batch, 0);

-	/* DW10. Instruction base address */
-    OUT_RELOC(batch, pp_context->instruction_state.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY);
-	OUT_BATCH(batch, 0);
+	/* DW10-11. Instruction base address */
+    OUT_RELOC64(batch, pp_context->instruction_state.bo, I915_GEM_DOMAIN_INSTRUCTION, 0, BASE_ADDRESS_MODIFY);

     OUT_BATCH(batch, 0xFFFF0000 | BASE_ADDRESS_MODIFY);
     OUT_BATCH(batch, 0xFFFF0000 | BASE_ADDRESS_MODIFY);


test-client-view-operations.c: Removing unneeded nasty comment.

--- tests/libebook/client/test-client-view-operations.c
+++ tests/libebook/client/test-client-view-operations.c
@@ -256,14 +256,10 @@
 	g_test_init (&argc, &argv, NULL);
 	setlocale (LC_ALL, "en_US.UTF-8");

+	g_test_add ("/EBookClient/ConcurrentViews", ETestServerFixture, &book_closure,
+		    e_test_server_utils_setup, test_concurrent_views, e_test_server_utils_teardown);
 	g_test_add ("/EBookClient/DirectAccess/ConcurrentViews", ETestServerFixture, &direct_book_closure,
 		    e_test_server_utils_setup, test_concurrent_views, e_test_server_utils_teardown);

-	/* Run Direct Access only to protect against lockups, this second iteration fails
-	 * while adding the initial contact, don't know why yet.
-	 */
-	g_test_add ("/EBookClient/ConcurrentViews", ETestServerFixture, &book_closure,
-		    e_test_server_utils_setup, test_concurrent_views, e_test_server_utils_teardown);
-
 	return e_test_server_utils_run ();
 }


synapticsmst: Set TB16/WD15 appropriately in topology

--- plugins/synapticsmst/fu-plugin-synapticsmst.c
+++ plugins/synapticsmst/fu-plugin-synapticsmst.c
@@ -31,6 +31,7 @@
 #define SYNAPTICS_FLASH_MODE_DELAY 3

 #define HWID_DELL_INC	"85d38fda-fc0e-5c6f-808f-076984ae7978"
+#define DELL_DOCK_FLASH_GUID	"e7ca1f36-bf73-4574-afe6-a4ccacabf479"

 struct FuPluginData {
 	gchar		*dock_type;
@@ -139,6 +140,10 @@
 	fu_device_add_icon (dev, "computer");
 	fu_device_set_version (dev, synapticsmst_device_get_version (device));
 	fu_device_add_guid (dev, guid_str);
+
+	/* Currently recognizes TB16/WD15 */
+	if (data->dock_type != NULL)
+		fu_device_add_parent_guid (dev, DELL_DOCK_FLASH_GUID);

 	fu_plugin_device_add (plugin, dev);
 	fu_plugin_cache_add (plugin, dev_id_str, dev);


- minor fix for win9x font selection

- minor fix for win9x font selection

--- win32/stock.c
+++ win32/stock.c
@@ -924,6 +924,7 @@
          elf. lfCharSet = ctx_CHARSET2index[ i];
          EnumFontFamiliesEx( dc, &elf, ( FONTENUMPROC) fep, ( LPARAM) &es, 0);
       }
+      elf. lfCharSet = DEFAULT_CHARSET;
    } else {
       EnumFontFamiliesEx( dc, &elf, ( FONTENUMPROC) fep, ( LPARAM) &es, 0);
    }


Ignore nohup on win32

Ignore nohup on win32

--- win32/win32.c
+++ win32/win32.c
@@ -289,6 +289,10 @@

 extern int sigaction(int sig, struct sigaction *act, struct sigaction *oact)
 {
+    if (sig == SIGHUP) {
+        return 0;
+    }
+
     void (*ret)(int) = signal(sig, act->sa_handler);
     if (oact != NULL) {
         oact->sa_handler = ret;


Addresses #1531 Reimplemented setenv, unsetenv correctly

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@9974 c7de825b-a66e-492c-adef-691d508d4ae1

--- windows/env.c
+++ windows/env.c
@@ -1,25 +1,22 @@
 #include <windows.h>
 #include <toku_stdlib.h>
+#include "toku_portability.h"
+#include <assert.h>

 int
 setenv(const char *name, const char *value, int overwrite) {
-    char buf[2]; //Need a dummy buffer
-    BOOL exists = TRUE;
-    int r = GetEnvironmentVariable(name, buf, sizeof(buf));
-    if (r==0) {
-        r = GetLastError();
-        if (r==ERROR_ENVVAR_NOT_FOUND) exists = FALSE;
-        else {
-            errno = r;
-            r = -1;
-            goto cleanup;
-        }
-    }
+    char * current = getenv(name);
+    BOOL exists = current!=NULL;
+
+    int r;
     if (overwrite || !exists) {
-        r = SetEnvironmentVariable(name, value);
-        if (r==0) {
+        char setstring[sizeof("=") + strlen(name) + strlen(value)];
+        int bytes = snprintf(setstring, sizeof(setstring), "%s=%s", name, value);
+        assert(bytes>=0);
+        assert((size_t)bytes < sizeof(setstring));
+        r = _putenv(setstring);
+        if (r==-1) {
             errno = GetLastError();
-            r = -1;
             goto cleanup;
         }
     }
@@ -30,12 +27,7 @@

 int
 unsetenv(const char *name) {
-    int r = SetEnvironmentVariable(name, NULL);
-    if (r==0) { //0 is failure
-        r = -1;
-        errno = GetLastError();
-    }
-    else r = 0;
+    int r = setenv(name, "", 1);
     return r;
 }


Avoid "(null)"s in log if the user disconnects before nick/login

git-svn-id: fa0849429efd6140f8c6b0411d4b758884714b35@7796 94223b32-352b-4d6d-a509-7b239cf53eea

--- wired/users.c
+++ wired/users.c
@@ -901,7 +901,7 @@
 	wi_string_t		*identifier;

 	wi_recursive_lock_lock(user->user_lock);
-	identifier = wi_string_with_format(WI_STR("%@/%@/%@"), user->nick, user->login, user->ip);
+	identifier = wi_string_with_format(WI_STR("%#@/%#@/%#@"), user->nick, user->login, user->ip);
 	wi_recursive_lock_unlock(user->user_lock);

 	return identifier;


fflush and look for the correct temp file

--- wizbit/file.c
+++ wizbit/file.c
@@ -87,11 +87,16 @@
         git_sha1 commit;
         struct git_error *error;

+	/* Its early days. While we are writing to this temporary file, we need to
+	   fflush our changes to disk before we can do a snapshot
+	*/
+	fflush(file->fp);
+
         loader = git_object_loader_new(WIZ_OBJECTS);
         writer = git_loose_object_writer_new(loader, WIZ_OBJECTS);

         blob_writer = git_blob_writer_new();
-	git_blob_writer_set_contents_from_file(blob_writer, "/tmp/foo");
+	git_blob_writer_set_contents_from_file(blob_writer, WIZ_WORKING"foo");
 	git_blob_writer_write(blob_writer, writer, blob, &error);

         tree_writer = git_tree_writer_new();


fixed typo

fixed typo

--- wlancap2hcx.c
+++ wlancap2hcx.c
@@ -2498,7 +2498,7 @@
 	printf("\x1B[35mfound Fast Roaming Remote Request\x1B[0m\n");

 if(fbsflag == true)
-	printf("\x1B[35mfound Fast BSS transition (Fast Roaming)\x1B[0m\n");
+	printf("\x1B[35mfound Fast BSS transition (fast roaming)\x1B[0m\n");

 if(ipv4flag == true)
 	printf("\x1B[35mfound IPv4 packets\x1B[0m\n");


Moved from alpha to beta.

Moved from alpha to beta.

--- wled00/wled.h
+++ wled00/wled.h
@@ -173,7 +173,7 @@
 #endif

 // Global Variable definitions
-WLED_GLOBAL char versionString[] _INIT("0.12.0-a0");
+WLED_GLOBAL char versionString[] _INIT("0.12.0-b0");
 #define WLED_CODENAME "Hikari"

 // AP and OTA default passwords (for maximum security change them!)


Version bump.

Version bump.

--- wled00/wled.h
+++ wled00/wled.h
@@ -8,7 +8,7 @@
  */

 // version code in format yymmddb (b = daily build)
-#define VERSION 2103205
+#define VERSION 2103210

 //uncomment this if you have a "my_config.h" file you'd like to use
 //#define WLED_USE_MY_CONFIG


test gridfs file properties

test gridfs file properties

--- tests/test-mongoc-gridfs.c
+++ tests/test-mongoc-gridfs.c
@@ -178,6 +178,64 @@

 static void
+test_properties (void)
+{
+   mongoc_client_t *client;
+   mongoc_gridfs_t *gridfs;
+   bson_error_t error;
+   bson_t *doc_in;
+   mongoc_gridfs_file_t *file;
+   mongoc_gridfs_file_list_t *list;
+   bson_t query = BSON_INITIALIZER;
+   const bson_value_t *file_id;
+   const char *alias0, *alias1;
+
+   client = test_framework_client_new (NULL);
+
+   gridfs = get_test_gridfs (client, "list", &error);
+   assert (gridfs);
+
+   mongoc_gridfs_drop (gridfs, &error);
+
+   /* the C Driver sets _id to an ObjectId, but other drivers can do anything */
+   doc_in = BCON_NEW (
+         "_id", BCON_INT32 (1),
+         "md5", BCON_UTF8 ("md5"),
+         "filename", BCON_UTF8 ("filename"),
+         "contentType", BCON_UTF8 ("content_type"),
+         "aliases", "[", BCON_UTF8 ("alias0"), BCON_UTF8 ("alias1"), "]",
+         "metadata", "{", "key", BCON_UTF8 ("value"), "}",
+         "chunkSize", BCON_INT32 (100));
+
+   assert (mongoc_collection_insert (mongoc_gridfs_get_files (gridfs),
+                                     MONGOC_INSERT_NONE, doc_in, NULL, NULL));
+
+   list = mongoc_gridfs_find (gridfs, &query);
+   file = mongoc_gridfs_file_list_next (list);
+   file_id = mongoc_gridfs_file_get_id (file);
+   assert (file_id);
+   ASSERT_CMPINT (BSON_TYPE_INT32, ==, file_id->value_type);
+   ASSERT_CMPINT (1, ==, file_id->value.v_int32);
+   ASSERT_CMPSTR ("md5", mongoc_gridfs_file_get_md5 (file));
+   ASSERT_CMPSTR ("filename", mongoc_gridfs_file_get_filename (file));
+   ASSERT_CMPSTR ("content_type", mongoc_gridfs_file_get_content_type (file));
+   assert (BCON_EXTRACT ((bson_t *)mongoc_gridfs_file_get_aliases (file),
+                         "0", BCONE_UTF8 (alias0),
+                         "1", BCONE_UTF8 (alias1)));
+
+   ASSERT_CMPSTR ("alias0", alias0);
+   ASSERT_CMPSTR ("alias1", alias1);
+
+   drop_collections (gridfs, &error);
+   mongoc_gridfs_file_destroy (file);
+   mongoc_gridfs_file_list_destroy (list);
+   bson_destroy (doc_in);
+   mongoc_gridfs_destroy (gridfs);
+   mongoc_client_destroy (client);
+}
+
+
+static void
 test_create_from_stream (void)
 {
    mongoc_gridfs_t *gridfs;
@@ -423,6 +481,7 @@
    TestSuite_Add (suite, "/GridFS/create", test_create);
    TestSuite_Add (suite, "/GridFS/create_from_stream", test_create_from_stream);
    TestSuite_Add (suite, "/GridFS/list", test_list);
+   TestSuite_Add (suite, "/GridFS/properties", test_properties);
    TestSuite_Add (suite, "/GridFS/read", test_read);
    TestSuite_Add (suite, "/GridFS/stream", test_stream);
    TestSuite_Add (suite, "/GridFS/remove", test_remove);


Update mpconfigboard.h

Update mpconfigboard.h

Removed ignore PA30 PA31 in order to allow using them as pinout

--- ports/atmel-samd/boards/uchip/mpconfigboard.h
+++ ports/atmel-samd/boards/uchip/mpconfigboard.h
@@ -16,8 +16,6 @@

 #define IGNORE_PIN_PA27     1
 #define IGNORE_PIN_PA28     1
-#define IGNORE_PIN_PA30     1
-#define IGNORE_PIN_PA31     1

 #define IGNORE_PIN_PB01     1
 #define IGNORE_PIN_PB02     1


alarm: Check proper cancellable from timer source ready callback

on_timer_source_ready is called in two cases:

1) When the timer fires
2) When the input stream cancellable is cancelled

We attempt to check for this latter case up front at the start of the
function and react appropriately. We do this by checking if
self->priv->cancellable is cancelled.

Unforunately, checking self->priv->cancellable isn't always right,
because self->priv->cancellable isn't always the cancellable associated
with the input stream.  They can get out of sync, when for instance, the
alarm expiration time is changed. In this case the old input stream
cancellable will get cancelled, and self->priv->cancellable will get set
to the new cancellable.

This commit makes sure the on_timer_source_ready callback always checks
the cancellable associated with the input stream.  It accomplishes this
by allocating a GTask and using that as the callback data instead of
the alarm object directly.

https://bugzilla.gnome.org/show_bug.cgi?id=708975

--- src/goaidentity/goaalarm.c
+++ src/goaidentity/goaalarm.c
@@ -359,18 +359,23 @@

 #ifdef HAVE_TIMERFD
 static gboolean
-on_timer_source_ready (GObject *stream, GoaAlarm *self)
+on_timer_source_ready (GObject *stream, GTask *task)
 {
   gint64 number_of_fires;
   gssize bytes_read;
   gboolean run_again = FALSE;
   GError *error = NULL;
+  GoaAlarm *self;
+  GCancellable *cancellable;
+
+  self = g_task_get_source_object (task);
+  cancellable = g_task_get_cancellable (task);

   g_return_val_if_fail (GOA_IS_ALARM (self), FALSE);
   g_return_val_if_fail (self->priv->type == GOA_ALARM_TYPE_TIMER, FALSE);

   g_rec_mutex_lock (&self->priv->lock);
-  if (g_cancellable_is_cancelled (self->priv->cancellable))
+  if (g_cancellable_is_cancelled (cancellable))
     goto out;

   bytes_read =
@@ -403,9 +408,14 @@
 }

 static void
-clear_timer_source_pointer (GoaAlarm *self)
-{
+clear_timer_source (GTask *task)
+{
+  GoaAlarm *self;
+
+  self = g_task_get_source_object (task);
   self->priv->timer.source = NULL;
+
+  g_object_unref (task);
 }
 #endif

@@ -417,6 +427,7 @@
   int fd;
   int result;
   GSource *source;
+  GTask *task;
   static gboolean seen_before = FALSE;

   if (!seen_before)
@@ -448,6 +459,8 @@

   self->priv->type = GOA_ALARM_TYPE_TIMER;
   self->priv->timer.stream = g_unix_input_stream_new (fd, TRUE);
+
+  task = g_task_new (self, self->priv->cancellable, NULL, NULL);

   source =
     g_pollable_input_stream_create_source (G_POLLABLE_INPUT_STREAM
@@ -455,8 +468,8 @@
                                            self->priv->cancellable);
   self->priv->timer.source = source;
   g_source_set_callback (self->priv->timer.source,
-                         (GSourceFunc) on_timer_source_ready, self,
-                         (GDestroyNotify) clear_timer_source_pointer);
+                         (GSourceFunc) on_timer_source_ready, task,
+                         (GDestroyNotify) clear_timer_source);
   g_source_attach (self->priv->timer.source, self->priv->context);
   g_source_unref (source);


use memcpy to copy structure, fix some errors also

--- program/test/radio_controller/radio_control.c
+++ program/test/radio_controller/radio_control.c
@@ -1,7 +1,9 @@
 #include "radio_control.h"
 #include "pwm_decoder.h"
 #include <stdio.h>
-//#define DEBUG_RADIO_CONTROLLER
+#include <string.h>
+#include "delay.h"
+#define DEBUG_RADIO_CONTROLLER
 static radio_controller_t radio_controller = {
 	.roll_control_input = 0.0f,
 	.pitch_control_input = 0.0f,
@@ -14,26 +16,23 @@
 void update_radio_control_input(radio_controller_t *rc_data)
 {
 	get_pwm_decode_value(&radio_controller);
-	rc_data->roll_control_input = radio_controller.roll_control_input;
-	rc_data->pitch_control_input = radio_controller.pitch_control_input;
-	rc_data->throttle_control_input  = radio_controller.throttle_control_input ;
-	rc_data->yaw_rate_control_input = radio_controller.yaw_rate_control_input;
-	rc_data->safety = radio_controller.safety;
-	rc_data->mode = radio_controller.mode;
+	memcpy(rc_data, &radio_controller, sizeof(radio_controller_t));
+
 #ifdef DEBUG_RADIO_CONTROLLER
 	printf("%d,%d,%d,%d,",
-		(int16_t) (my_rc.roll_control_input*100),
-		(int16_t) (my_rc.pitch_control_input*100),
-		(int16_t) (my_rc.throttle_control_input),
-		(int16_t) (my_rc.yaw_rate_control_input*100));
-	if (my_rc.safety == ENGINE_ON) {
+		(int16_t) (rc_data->roll_control_input*100),
+		(int16_t) (rc_data->pitch_control_input*100),
+		(int16_t) (rc_data->throttle_control_input),
+		(int16_t) (rc_data->yaw_rate_control_input*100));
+	if (rc_data->safety == ENGINE_ON) {

-			printf("ENGINE_ON,%d");
+			printf("ENGINE_ON,");
 	} else {

-			printf("ENGINE_OFF,%d");
+			printf("ENGINE_OFF");

 	}
 	printf("\r\n");
+	Delay_1us(100);
 #endif
 }


Update MOE_main.h

Update MOE_main.h


Introduce Wocky API Versioning

Introduce Wocky API Versioning

--- wocky/wocky.h
+++ wocky/wocky.h
@@ -88,6 +88,10 @@
 #include "wocky-xmpp-writer.h"
 #undef WOCKY_H_INSIDE

+#define WOCKY_API_VER_0_0	0x0
+#define WOCKY_API_VER_0_1	(G_ENCODE_VERSION(0,1))
+#define WOCKY_API_VERSION	WOCKY_API_VER_0_0
+
 G_BEGIN_DECLS

 void wocky_init (void);


Fix a bug introduced by my own previous commit (addition of the current
line/column display).

I overlooked that ee(1) doesn't maintain proper line numbering when
adding/removing lines, so after those operations linenumber displayed may not
match the reality. Also use proper variable for current column diaplay, because
the one used previously reflects the offset of current char, which doesn't
equial screen position when tabs present.

Reviewed by:	bp

--- usr.bin/ee/ee.c
+++ usr.bin/ee/ee.c
@@ -338,6 +338,7 @@
 char *resolve_name P_((char *name));
 int restrict_mode P_((void));
 int unique_test P_((char *string, char *list[]));
+void renumber_lines P_((struct text *firstline, int startnumber));
 void strings_init P_((void));

 #undef P_
@@ -610,7 +611,7 @@
 		if (info_window)
 		{
 			snprintf(count_text, count_text_len, "L: %d C: %d %s", \
-				curr_line->line_number, position, count_text_default);
+				curr_line->line_number, scr_horz + 1, count_text_default);
 			wmove(count_win, 0, 0);
 			wclrtoeol(count_win);
 			if (!nohighlight)
@@ -804,6 +805,7 @@
 		if (temp_buff->next_line != NULL)
 			temp_buff->next_line->prev_line = curr_line;
 		curr_line->next_line = temp_buff->next_line;
+		renumber_lines(curr_line->next_line, curr_line->line_number + 1);
 		temp2 = temp_buff->line;
 		if (in == 8)
 			d_char = '\n';
@@ -1045,8 +1047,8 @@
 	temp_nod->line = extra= malloc(10);
 	temp_nod->line_length = 1;
 	temp_nod->max_length = 10;
-	temp_nod->line_number = curr_line->line_number + 1;
 	temp_nod->next_line = curr_line->next_line;
+	renumber_lines(temp_nod, curr_line->line_number + 1);
 	if (temp_nod->next_line != NULL)
 		temp_nod->next_line->prev_line = temp_nod;
 	temp_nod->prev_line = curr_line;
@@ -2256,8 +2258,8 @@
 		if (!(*append))	/* if not append to current line, insert new one */
 		{
 			tline = txtalloc();	/* allocate data structure for next line */
-			tline->line_number = curr_line->line_number + 1;
 			tline->next_line = curr_line->next_line;
+			renumber_lines(tline, curr_line->line_number + 1);
 			tline->prev_line = curr_line;
 			curr_line->next_line = tline;
 			if (tline->next_line != NULL)
@@ -4843,6 +4845,19 @@
 		counter++;
 	}
 	return(num_match);
+}
+
+void
+renumber_lines(firstline, startnumber)
+struct text *firstline;
+int startnumber;
+{
+	struct text *lineptr;
+	int i;
+
+	i = startnumber;
+	for (lineptr = firstline; lineptr != NULL; lineptr = lineptr->next_line)
+		lineptr->line_number = i++;
 }

 #ifndef NO_CATGETS


Bug fix with WorkingDir

Bug fix with WorkingDir

--- util/cpp/main.c
+++ util/cpp/main.c
@@ -5,6 +5,7 @@

 extern struct tokenname tkidf[], tkkey[];
 extern char *symbol2str();
+extern char *getwdir();
 extern char *inctable[];
 extern int err_occurred;
 int idfsize = IDFSIZE;
@@ -56,10 +57,10 @@
 		fatal("use: %s [options] [source]", prog_name);
 		break;
 	}
-	WorkingDir = inctable[0];

 	if (!InsertFile(source, (char **) 0, &dummy)) /* read the source file	*/
 		fatal("%s: no source file %s\n", prog_name,
 			source ? source : "stdin");
+	WorkingDir = getwdir(dummy);
 	preprocess(source);
 }


Remove extra include

Remove extra include

--- util/dsmetool.c
+++ util/dsmetool.c
@@ -46,7 +46,6 @@
 #include <sys/select.h>
 #include <sys/ioctl.h>
 #include <linux/rtc.h>
-#include "../include/android/android_alarm.h"

 #include <pwd.h>
 #include <grp.h>


cleanup

cleanup

--- src/gusanos/lua/bindings.h
+++ src/gusanos/lua/bindings.h
@@ -7,21 +7,9 @@
 #include <string>
 #include <list>

-/*
-class CGameObject;
-class CWormInputHandler;
-class CWorm;
-class CViewport;
-*/
-
 namespace LuaBindings
 {
 	void init();
-
-	//int print(lua_State* state);
-
-	//std::string runLua(LuaReference ref, std::list<std::string> const& args);
-
 }


improved construction of page rank matrix

--- networkit/cpp/algebraic/algorithms/AlgebraicPageRank.h
+++ networkit/cpp/algebraic/algorithms/AlgebraicPageRank.h
@@ -27,17 +27,21 @@
 	AlgebraicPageRank(const Graph& graph, const double damp = 0.85, const double tol = 1e-8) : damp(damp), tol(tol) {
 		Matrix A = Matrix::adjacencyMatrix(graph);
 		// normalize At by out-degree
-		Vector outDeg = GraphBLAS::rowReduce(A);
-		std::vector<Triplet> scaleMatrixTriplets(A.numberOfRows());
-		for (index i = 0; i < A.numberOfRows(); ++i) {
-			scaleMatrixTriplets[i] = {i,i,1.0/outDeg[i]};
+		Vector invOutDeg = GraphBLAS::rowReduce(A);
+#pragma omp parallel for
+		for (index i = 0; i < invOutDeg.getDimension(); ++i) {
+			invOutDeg[i] = 1.0/invOutDeg[i];
 		}
-		Matrix scaleMatrix(A.numberOfRows(), scaleMatrixTriplets);
-		Matrix P = scaleMatrix * A;
-		M = (scaleMatrix * A).transpose() * damp;
+
+		std::vector<Triplet> mTriplets(A.nnz());
+		index idx = 0;
+		A.forNonZeroElementsInRowOrder([&](index i, index j, double value) {
+			mTriplets[idx++] = {j,i, damp * value * invOutDeg[i]};
+		});
+		M = std::move(Matrix(A.numberOfRows(), mTriplets));
 	}

-	void run();
+	void run() override;

 	/**
 	 * Get a vector containing the betweenness score for each node in the graph.


Improve doxygen help for spectrum component extend above/below API functions. https://tracker.physiomeproject.org/show_bug.cgi?id=3919

git-svn-id: b9baf8c2d14a71b3ba9c27a102eb6e792fc13348@11169 3c1deb5b-d424-0410-962d-aba41a686d42

--- core/source/api/zinc/spectrum.h
+++ core/source/api/zinc/spectrum.h
@@ -530,9 +530,9 @@
 	cmzn_spectrumcomponent_id component, bool reverse);

 /**
- * Get the extend_above flag of a spectrum component, an extend above spectrum component
- * will have the spectrum component colour rendered even when field value exceeds
- * spectrum maximum range.
+ * Get the 'extend above' flag of a spectrum component, which controls
+ * whether values above the maximum are rendered for this component.
+ * @see cmzn_spectrumcomponent_set_extend_above
  *
  * @param component  Handle to the zinc spectrum component.
  * @return  true if spectrum component extends above, false if
@@ -542,9 +542,11 @@
 	cmzn_spectrumcomponent_id component);

 /**
- * Set the extend_above flag of a spectrum component, an extend_above
- * spectrum component will have the colour rendered even when field value exceeds
- * spectrum maximum range.
+ * Set the 'extend above' flag of a spectrum component.
+ * When on (true), values above the maximum are rendered with the same colour
+ * as the maximum value. When off, no colour is set for this component for
+ * values above the maximum value.
+ * By default, extend above is on (true).
  *
  * @param component  Handle to the zinc spectrum component.
  * @param extend_above  Value to be set to the zinc spectrum component.
@@ -555,9 +557,9 @@
 	cmzn_spectrumcomponent_id component, bool extend_above);

 /**
- * Get the extend_below flag of a spectrum component, an extend below spectrum component
- * will have the spectrum component colour rendered even when field value is below
- * spectrum minimum range.
+ * Get the 'extend below' flag of a spectrum component, which controls
+ * whether values below the minimum are rendered for this component.
+ * @see cmzn_spectrumcomponent_set_extend_below
  *
  * @param component  Handle to the zinc spectrum component.
  * @return  true if spectrum component extends below, false if
@@ -567,9 +569,11 @@
 	cmzn_spectrumcomponent_id component);

 /**
- * Set the extend_below flag of a spectrum component, an extend below spectrum component
- * will have the spectrum component colour rendered even when field value is below
- * spectrum minimum range.
+ * Set the 'extend below' flag of a spectrum component.
+ * When on (true), values below the minimum are rendered with the same colour
+ * as the minimum value. When off, no colour is set for this component for
+ * values below the minimum value.
+ * By default, extend below is on (true).
  *
  * @param component  Handle to the zinc spectrum component.
  * @param extend_below  Value to be set to the zinc spectrum component.


iteflash: honor Ctrl+C signal

iteflash: honor Ctrl+C signal

Ensure all configuration (e.g. CCD, FTDI, linux) abort
when Ctrl+c is pressed.

BRANCH=none
BUG=none
TEST=Verify the Ctrl+c quits when using linux driver
with C2D2

Change-Id: Idc0555ae9689a118d9375f2b31f24cc7d1e61a4b
Signed-off-by: Jett Rink <9d4aef0593e6843318d99df31597fb6153b89787@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2064591
Reviewed-by: Matthew Blecker <d18f4466f2802f9c78c5c14a42b8c21fdbfabfcd@chromium.org>

--- util/iteflash.c
+++ util/iteflash.c
@@ -172,6 +172,10 @@
 static inline int i2c_byte_transfer(struct common_hnd *chnd, uint8_t addr,
 				    uint8_t *data, int write, int numbytes)
 {
+	/* If we got a termination signal, stop sending data */
+	if (exit_requested)
+		return -1;
+
 	return chnd->conf.i2c_if->byte_transfer(chnd, addr, data, write,
 		numbytes);
 }
@@ -220,10 +224,6 @@
 	uint8_t failed_ack = 0;

 	for (i = 0; i < tcnt; i++) {
-		/* If we got a termination signal, stop sending data */
-		if (exit_requested)
-			return -1;
-
 		/* WORKAROUND: force SDA before sending the next byte */
 		*b++ = SET_BITS_LOW; *b++ = SDA_BIT; *b++ = SCL_BIT | SDA_BIT;
 		/* write byte */
@@ -318,10 +318,6 @@

 	rbuf_idx = 0;
 	do {
-		/* If we got a termination signal, stop sending data */
-		if (exit_requested)
-			return -1;
-
 		ret = ftdi_read_data(ftdi, &rbuf[rbuf_idx], rcnt);
 		if (ret < 0) {
 			fprintf(stderr, "read byte failed\n");
@@ -342,10 +338,6 @@
 			   (((!write * numbytes) > 0x7f) ? 2 : 0)];
 	size_t response_size;
 	size_t extra = 0;
-
-	/* Do nothing if user wants to quit. */
-	if (exit_requested)
-		return -1;

 	/*
 	 * Build a message following format described in ./include/usb_i2c.h.


support $int("0XFF")

support $int("0XFF")


remove trailing spaces

remove trailing spaces

Change-Id: Ic92addd7c152e0216d5c9a35f5661914a5671f03

--- src/dec/vp8.c
+++ src/dec/vp8.c
@@ -297,7 +297,7 @@
   if (frm_hdr->partition_length_ > buf_size) {
     return VP8SetError(dec, VP8_STATUS_NOT_ENOUGH_DATA,
                        "bad partition length");
-  }
+  }
   br = &dec->br_;
   VP8InitBitReader(br, buf, buf + frm_hdr->partition_length_);
   buf += frm_hdr->partition_length_;


changed mod->jit pos (should be fixed to 0)

--- vm/neko_mod.h
+++ vm/neko_mod.h
@@ -23,6 +23,7 @@
 #include "neko.h"

 typedef struct _neko_module {
+	value jit;
 	unsigned int nglobals;
 	unsigned int nfields;
 	unsigned int codesize;
@@ -33,7 +34,6 @@
 	value exports;
 	value debuginf;
 	int_val *code;
-	value jit;
 } neko_module;

 typedef void *readp;


fix version

fix version

--- core/src/xmake/prefix/version.h
+++ core/src/xmake/prefix/version.h
@@ -44,12 +44,12 @@
 #define XM_VERSION_ALTER            XM_CONFIG_VERSION_ALTER

 /// the build version
+#ifndef XM_CONFIG_VERSION_BUILD
+#   define XM_CONFIG_VERSION_BUILD  0
+#endif
 #define XM_VERSION_BUILD            XM_CONFIG_VERSION_BUILD

 /// the build version string
-#ifndef XM_CONFIG_VERSION_BUILD
-#   define XM_CONFIG_VERSION_BUILD  0
-#endif
 #define XM_VERSION_BUILD_STRING     __tb_mstring_ex__(XM_CONFIG_VERSION_BUILD)

 /// the version string


Translate the categories

Translate the categories

--- src/desktop.c
+++ src/desktop.c
@@ -174,18 +174,18 @@

 static DesktopCategory _desktop_categories[] =
 {
-	{ FALSE, "Audio",	"Audio",	"gnome-mime-audio",	},
-	{ FALSE, "Development",	"Development",	"applications-development"},
-	{ FALSE, "Education",	"Education",	"applications-science"	},
-	{ FALSE, "Game",	"Games",	"applications-games"	},
-	{ FALSE, "Graphics",	"Graphics",	"applications-graphics"	},
-	{ FALSE, "AudioVideo",	"Multimedia",	"applications-multimedia"},
-	{ FALSE, "Network",	"Network",	"applications-internet" },
-	{ FALSE, "Office",	"Office",	"applications-office"	},
-	{ FALSE, "Settings",	"Settings",	"gnome-settings"	},
-	{ FALSE, "System",	"System",	"applications-system"	},
-	{ FALSE, "Utility",	"Utilities",	"applications-utilities"},
-	{ FALSE, "Video",	"Video",	"video"			}
+	{ FALSE, "Audio",	N_("Audio"),	"gnome-mime-audio",	},
+	{ FALSE, "Development",	N_("Development"),"applications-development"},
+	{ FALSE, "Education",	N_("Education"),"applications-science"	},
+	{ FALSE, "Game",	N_("Games"),	"applications-games"	},
+	{ FALSE, "Graphics",	N_("Graphics"),	"applications-graphics"	},
+	{ FALSE, "AudioVideo",	N_("Multimedia"),"applications-multimedia"},
+	{ FALSE, "Network",	N_("Network"),	"applications-internet" },
+	{ FALSE, "Office",	N_("Office"),	"applications-office"	},
+	{ FALSE, "Settings",	N_("Settings"),	"gnome-settings"	},
+	{ FALSE, "System",	N_("System"),	"applications-system"	},
+	{ FALSE, "Utility",	N_("Utilities"),"applications-utilities"},
+	{ FALSE, "Video",	N_("Video"),	"video"			}
 };
 static const size_t _desktop_categories_cnt = sizeof(_desktop_categories)
 	/ sizeof(*_desktop_categories);
@@ -2686,7 +2686,7 @@
 		if(dc->show == TRUE)
 			continue;
 		dc->show = TRUE;
-		if((icon = desktopicon_new_category(desktop, dc->name,
+		if((icon = desktopicon_new_category(desktop, _(dc->name),
 						dc->icon)) == NULL)
 			continue;
 		desktopicon_set_callback(icon, _refresh_done_categories_open,
@@ -2700,7 +2700,7 @@
 	DesktopCategory * dc = data;

 #ifdef DEBUG
-	fprintf(stderr, "DEBUG: %s() \"%s\"\n", __func__, dc->name);
+	fprintf(stderr, "DEBUG: %s() \"%s\"\n", __func__, _(dc->name));
 #endif
 	desktop->category = dc;
 	desktop_set_icons(desktop, DESKTOP_ICONS_APPLICATIONS);


[numerics] correct typo

[numerics] correct typo

--- numerics/src/FrictionContact/rolling_fc3d_projection.c
+++ numerics/src/FrictionContact/rolling_fc3d_projection.c
@@ -400,7 +400,7 @@
   numerics_printf("Set the Default SolverOptions for the ONECONTACT_ProjectionOnCone  Solver\n");

-  options->solverId = SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnCone;
+  options->solverId = SICONOS_ROLLING_FRICTION_3D_ONECONTACT_ProjectionOnCone;
   options->numberOfInternalSolvers = 0;
   options->isSet = 1;
   options->filterOn = 1;


hyperv: remove duplicit addr check

hyperv: remove duplicit addr check

We already check addr is not negative right after filling
its value. There's no need to check it before using it too.

Signed-off-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>
Fixes: a7a1d1f59e8ba2d8a3ed920ef595ccdfb0d8feb6
Reviewed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

--- src/hyperv/hyperv_driver.c
+++ src/hyperv/hyperv_driver.c
@@ -560,9 +560,6 @@

     driveNumberStr = g_strdup_printf("%u", diskdrive->data->DriveNumber);
     virDomainDiskSetSource(disk, driveNumberStr);
-
-    if (addr < 0)
-        goto cleanup;

     if (controller->data->ResourceType == MSVM_RASD_RESOURCETYPE_PARALLEL_SCSI_HBA) {
         for (i = 0; i < HYPERV_MAX_SCSI_CONTROLLERS; i++) {


VPP: Adjust vertical scaling step for AVS on IVB

Signed-off-by: Xiang, Haihao <8d677183e5993577d4fa73a419b76987913292d6@intel.com>

--- src/i965_post_processing.c
+++ src/i965_post_processing.c
@@ -2207,10 +2207,13 @@
     struct i965_sampler_8x8_state *sampler_8x8_state;
     int index, i;
     int width[3], height[3], pitch[3], offset[3];
+    int src_width, src_height;

     /* source surface */
     gen7_pp_set_media_rw_message_surface(ctx, pp_context, src_surface, 0, 0,
                                          width, height, pitch, offset);
+    src_width = width[0];
+    src_height = height[0];

     /* destination surface */
     gen7_pp_set_media_rw_message_surface(ctx, pp_context, dst_surface, 24, 1,
@@ -2379,7 +2382,7 @@
     pp_static_parameter->grf2.avs_wa_five_div_256_width = (float) 5.0 / (256 * dw);

     pp_static_parameter->grf3.sampler_load_horizontal_scaling_step_ratio = (float) pp_avs_context->src_w / pp_avs_context->dest_w;
-    pp_static_parameter->grf4.sampler_load_vertical_scaling_step = (float) 1.0 / pp_avs_context->dest_h;
+    pp_static_parameter->grf4.sampler_load_vertical_scaling_step = (float) src_rect->height / src_height / pp_avs_context->dest_h;
     pp_static_parameter->grf5.sampler_load_vertical_frame_origin = -(float)pp_avs_context->dest_y / pp_avs_context->dest_h;
     pp_static_parameter->grf6.sampler_load_horizontal_frame_origin = -(float)pp_avs_context->dest_x / pp_avs_context->dest_w;


fix a memory leak

fix a memory leak

--- src/display.c
+++ src/display.c
@@ -409,6 +409,8 @@
         pango_cairo_show_layout(display->cr, display->layout);
         cairo_restore(display->cr);
     }
+
+    free(buf);
 }

 static int runes_display_glyphs_are_monospace(RunesTerm *t, int width)


Delete: src/ia64/Lget_fpreg-ia64.c

Delete: src/ia64/Lget_fpreg-ia64.c

}(Logical change 1.162)

--- src/ia64/Lget_fpreg-ia64.c
+++ src/ia64/Lget_fpreg-ia64.c
@@ -1,5 +0,0 @@
-#define UNW_LOCAL_ONLY
-#include <libunwind.h>
-#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
-#include "Gget_fpreg-ia64.c"
-#endif


Doxygenの記述を修正

Doxygenの記述を修正

--- src/doxygen.c
+++ src/doxygen.c
@@ -1,31 +1,31 @@
 /**
  * \mainpage YACASL2 内部仕様書
  * \section メイン関数
- * - casl2.c
- * - comet2.c
- * - dumpword.c
+ * - src/casl2.c
+ * - src/comet2.c
+ * - src/dumpword.c
  *
  * \section そのほかのソースファイル
- * - assemble.c
- * - cerr.c
- * - cmd.c
- * - cmem.c
- * - dump.c
- * - exec.c
- * - hash.c
- * - label.c
- * - struct.c
- * - token.c
- * - word.c
+ * - src/assemble.c
+ * - src/cerr.c
+ * - src/cmd.c
+ * - src/cmem.c
+ * - src/dump.c
+ * - src/exec.c
+ * - src/hash.c
+ * - src/label.c
+ * - src/struct.c
+ * - src/token.c
+ * - src/word.c
  *
  * \section ヘッダファイル
- * - assemble.h
- * - exec.h
- * - struct.h
- * - word.h
- * - hash.h
- * - cerr.h
- * - cmem.h
+ * - include/assemble.h
+ * - include/exec.h
+ * - include/struct.h
+ * - include/word.h
+ * - include/hash.h
+ * - include/cerr.h
+ * - include/cmem.h
  *
  * \section Webサイト
  * http://www.j8takagi.net/yacasl2/


imap: cmd_getmetadata_stream_continue returns bool, not int
The behaviour is unchanged, but we shouldn't pretend that -1 is different
from TRUE in a boolean context. Its only caller only cares about whether
it's 0 or not.

Signed-off-by: Phil Carmody <e888d2bd6f13f82caa51a37c03d034c76f661ba3@dovecot.fi>

--- src/imap/cmd-getmetadata.c
+++ src/imap/cmd-getmetadata.c
@@ -226,7 +226,7 @@
 			i_stream_get_error(ctx->cur_stream));
 		client_disconnect(ctx->cmd->client,
 				  "Internal GETMETADATA failure");
-		return -1;
+		return TRUE;
 	}
 	if (!i_stream_have_bytes_left(ctx->cur_stream)) {
 		/* Input stream gave less data than expected */
@@ -234,7 +234,7 @@
 			i_stream_get_name(ctx->cur_stream));
 		client_disconnect(ctx->cmd->client,
 				  "Internal GETMETADATA failure");
-		return -1;
+		return TRUE;
 	}
 	o_stream_set_flush_pending(ctx->cmd->client->output, TRUE);
 	return FALSE;


imap: Improved unexpected FETCH error messages.

--- src/imap/imap-fetch-body.c
+++ src/imap/imap-fetch-body.c
@@ -33,7 +33,8 @@

 	errno = state->cur_input->stream_errno;
 	mail_storage_set_critical(state->cur_mail->box->storage,
-		"read(%s) failed: %m (FETCH for mailbox %s UID %u)",
+		"read(%s) failed: %m (FETCH %s for mailbox %s UID %u)",
+		state->cur_human_name,
 		i_stream_get_name(state->cur_input),
 		mailbox_get_vname(state->cur_mail->box), state->cur_mail->uid);
 }
@@ -124,6 +125,31 @@
 	return 1;
 }

+static const char *
+get_body_human_name(pool_t pool, struct imap_fetch_body_data *body)
+{
+	string_t *str;
+	uoff_t partial_offset, partial_size;
+
+	str = t_str_new(64);
+	if (body->binary)
+		str_append(str, "BINARY[");
+	else
+		str_append(str, "BODY[");
+	str_append(str, body->section);
+	str_append_c(str, ']');
+
+	partial_offset = imap_msgpart_get_partial_offset(body->msgpart);
+	partial_size = imap_msgpart_get_partial_size(body->msgpart);
+	if (partial_offset != 0 || partial_size != (uoff_t)-1) {
+		str_printfa(str, "<%"PRIuUOFF_T, partial_offset);
+		if (partial_size != (uoff_t)-1)
+			str_printfa(str, ".%"PRIuUOFF_T, partial_size);
+		str_append_c(str, '>');
+	}
+	return p_strdup(pool, str_c(str));
+}
+
 static int fetch_body_msgpart(struct imap_fetch_context *ctx, struct mail *mail,
 			      struct imap_fetch_body_data *body)
 {
@@ -148,7 +174,7 @@
 	ctx->state.cur_input = result.input;
 	ctx->state.cur_size = result.size;
 	ctx->state.cur_size_field = result.size_field;
-	ctx->state.cur_human_name = body->section;
+	ctx->state.cur_human_name = get_body_human_name(ctx->ctx_pool, body);

 	str = get_prefix(&ctx->state, body, ctx->state.cur_size,
 			 result.binary_decoded_input_has_nuls);


Minor cleanup

Minor cleanup

--- opencog/learning/moses/metapopulation/metapopulation.h
+++ opencog/learning/moses/metapopulation/metapopulation.h
@@ -499,12 +499,13 @@
     deme_expander _dex;

     // Structure holding stats about diversity
-    struct diversity_stats {
-        float count,            // number of pairs of candidates considered
-            mean,               // average bscore distance between all candidates
-            std,                // std dev bscore distance between all candidates
-            min,                // min bscore distance between all candidates
-            max;                // max bscore distance between all candidates
+    struct diversity_stats
+    {
+        double count;    // number of pairs of candidates considered
+        double mean;     // average bscore distance between all candidates
+        double std;      // std dev bscore distance between all candidates
+        double min;      // min bscore distance between all candidates
+        double max;      // max bscore distance between all candidates
     };

     /**


test case fix

test case fix

--- paddle/fluid/platform/enforce.h
+++ paddle/fluid/platform/enforce.h
@@ -127,14 +127,14 @@
 #define UNLIKELY(condition) __builtin_expect(static_cast<bool>(condition), 0)
 #else
 // there is no equivalent intrinsics in msvc.
-#define UNLIKELY(condition) (condition == 0)
+#define UNLIKELY(condition) (condition)
 #endif

 #if !defined(_WIN32)
 #define LIKELY(condition) __builtin_expect(static_cast<bool>(condition), 1)
 #else
 // there is no equivalent intrinsics in msvc.
-#define LIKELY(condition) (condition != 0)
+#define LIKELY(condition) !(condition)
 #endif

 template <typename... Args>
@@ -248,7 +248,6 @@
   throw_on_error(e, "");
 }

-#if !defined(_WIN32)
 #define PADDLE_THROW(...)                                              \
   do {                                                                 \
     throw ::paddle::platform::EnforceNotMet(                           \
@@ -271,17 +270,6 @@
 #else
 #define PADDLE_ENFORCE(...) ::paddle::platform::throw_on_error(__VA_ARGS__);
 #endif  // REPLACE_ENFORCE_GLOG
-
-#else  // !_WIN32
-// disable enforce, caused by the varardic macro exception error
-#define PADDLE_THROW(x)                                      \
-  do {                                                       \
-    throw std::make_exception_ptr(                           \
-        std::runtime_error("Windows disable the enforce.")); \
-  } while (false)
-
-#define PADDLE_ENFORCE(x, ...) x
-#endif  // !_WIN32

 #define PADDLE_THROW_EOF()                                                     \
   do {                                                                         \
@@ -302,7 +290,26 @@
  *    extra messages is also supported, for example:
  *    PADDLE_ENFORCE(a, b, "some simple enforce failed between %d numbers", 2)
  */
-#if !defined(_WIN32)
+#define PADDLE_ENFORCE_NOT_NULL(__VAL, ...)                  \
+  do {                                                       \
+    if (UNLIKELY(nullptr == (__VAL))) {                      \
+      PADDLE_THROW(#__VAL " should not be null\n%s",         \
+                   paddle::string::Sprintf("" __VA_ARGS__)); \
+    }                                                        \
+  } while (0)
+
+#define __PADDLE_BINARY_COMPARE(__VAL0, __VAL1, __CMP, __INV_CMP, ...)  \
+  do {                                                                  \
+    if (UNLIKELY(!((__VAL0)__CMP(__VAL1)))) {                           \
+      PADDLE_THROW("Enforce failed. Expected %s " #__CMP                \
+                   " %s, but received %s:%s " #__INV_CMP " %s:%s.\n%s", \
+                   #__VAL0, #__VAL1, #__VAL0,                           \
+                   paddle::string::to_string(__VAL0), #__VAL1,          \
+                   paddle::string::to_string(__VAL1),                   \
+                   paddle::string::Sprintf("" __VA_ARGS__));            \
+    }                                                                   \
+  } while (0)
+
 #define PADDLE_ENFORCE_EQ(__VAL0, __VAL1, ...) \
   __PADDLE_BINARY_COMPARE(__VAL0, __VAL1, ==, !=, __VA_ARGS__)
 #define PADDLE_ENFORCE_NE(__VAL0, __VAL1, ...) \
@@ -316,46 +323,5 @@
 #define PADDLE_ENFORCE_LE(__VAL0, __VAL1, ...) \
   __PADDLE_BINARY_COMPARE(__VAL0, __VAL1, <=, >, __VA_ARGS__)

-#define PADDLE_ENFORCE_NOT_NULL(__VAL, ...)                  \
-  do {                                                       \
-    if (UNLIKELY(nullptr == (__VAL))) {                      \
-      PADDLE_THROW(#__VAL " should not be null\n%s",         \
-                   paddle::string::Sprintf("" __VA_ARGS__)); \
-    }                                                        \
-  } while (0)
-
-#define __PADDLE_BINARY_COMPARE(__VAL0, __VAL1, __CMP, __INV_CMP, ...)  \
-  do {                                                                  \
-    if (UNLIKELY(!((__VAL0)__CMP(__VAL1)))) {                           \
-      PADDLE_THROW("Enforce failed. Expected %s " #__CMP                \
-                   " %s, but received %s:%s " #__INV_CMP " %s:%s.\n%s", \
-                   #__VAL0, #__VAL1, #__VAL0,                           \
-                   paddle::string::to_string(__VAL0), #__VAL1,          \
-                   paddle::string::to_string(__VAL1),                   \
-                   paddle::string::Sprintf("" __VA_ARGS__));            \
-    }                                                                   \
-  } while (0)
-#else
-#define PADDLE_ENFORCE_EQ(__VAL0, __VAL1, ...) ((__VAL0) == (__VAL1))
-#define PADDLE_ENFORCE_NE(__VAL0, __VAL1, ...) ((__VAL0) != (__VAL1))
-#define PADDLE_ENFORCE_GT(__VAL0, __VAL1, ...) ((__VAL0) > (__VAL1))
-#define PADDLE_ENFORCE_GE(__VAL0, __VAL1, ...) ((__VAL0) >= (__VAL1))
-#define PADDLE_ENFORCE_LT(__VAL0, __VAL1, ...) ((__VAL0) < (__VAL1))
-#define PADDLE_ENFORCE_LE(__VAL0, __VAL1, ...) ((__VAL0) <= (__VAL1))
-
-#define __PADDLE_BINARY_COMPARE(__VAL0, __VAL1, __CMP, __INV_CMP, ...) \
-  do {                                                                 \
-    if (!((__VAL0)__CMP(__VAL1))) {                                    \
-      PADDLE_THROW("Windows disable the enforce. Enforce failed.");    \
-    }                                                                  \
-  } while (0)
-#define PADDLE_ENFORCE_NOT_NULL(__VAL1, ...)                       \
-  do {                                                             \
-    if (nullptr == (__VAL1)) {                                     \
-      PADDLE_THROW("Windows disable the enforce. Enforce failed"); \
-    }                                                              \
-  } while (0)
-#endif  // !_WIN32
-
 }  // namespace platform
 }  // namespace paddle


fix compilation with USE_YUVj flag

fix compilation with USE_YUVj flag

(not that we'll ever need it, but...)

Change-Id: I9af993c62372097846c5ca6bae8362b59c3502dc

--- src/dsp/yuv.h
+++ src/dsp/yuv.h
@@ -298,12 +298,12 @@
   return (luma + rounding) >> YUV_FIX;  // no need to clip
 }

-static WEBP_INLINE int VP8_RGB_TO_U(int r, int g, int b, int rounding) {
+static WEBP_INLINE int VP8RGBToU(int r, int g, int b, int rounding) {
   const int u = -11058 * r - 21710 * g + 32768 * b;
   return VP8ClipUV(u, rounding);
 }

-static WEBP_INLINE int VP8_RGB_TO_V(int r, int g, int b, int rounding) {
+static WEBP_INLINE int VP8RGBToV(int r, int g, int b, int rounding) {
   const int v = 32768 * r - 27439 * g - 5329 * b;
   return VP8ClipUV(v, rounding);
 }


Apparently get_bit_count is equal to get_pos, not get_remaining.

Stupid porting error from ffmpeg, that lead to the problem of
parsing only the first line of each interlace field (so two lines total).

Appropriately fix to gst_bit_reader_get_pos and remove the FIXME-FFMPEG for those.

Still some parsing artifacts and warnings present though, but now the debug
image dumps are actually seen as real subtitles, with some just having a few lines
wrong.

--- src/dvb-sub.c
+++ src/dvb-sub.c
@@ -695,9 +695,6 @@
 	guint run_length;
 	int pixels_read = 0;

-	/* FIXME-FFMPEG: The code in libavcodec checks for bits remaining to be less than buf_size,
-	 * FIXME-FFMPEG: but in my test sample they are always exactly equal, and the loop is never entered.
-	 * FIXME-FFMPEG: This can't be right, so fixed to a less than or equal check; query ffmpeg folk */
 	while (gst_bit_reader_get_remaining (&gb) <= buf_size << 3 && pixels_read < dbuf_len) {
 		gst_bit_reader_get_bits_uint32 (&gb, &bits, 2);

@@ -842,10 +839,9 @@
 	guint run_length;
 	int pixels_read = 0;

-	/* FIXME-FFMPEG: The code in libavcodec checks for bits remaining to be less than buf_size,
-	 * FIXME-FFMPEG: but in my test sample they are always exactly equal, and the loop is never entered.
-	 * FIXME-FFMPEG: This can't be right, so fixed to a less than or equal check; query ffmpeg folk */
-	while (gst_bit_reader_get_remaining (&gb) <= buf_size << 3 && pixels_read < dbuf_len) {
+	//gst_util_dump_mem (*srcbuf, buf_size);
+
+	while (gst_bit_reader_get_pos (&gb) < buf_size << 3 && pixels_read < dbuf_len) {
 		gst_bit_reader_get_bits_uint32 (&gb, &bits, 4);

 		if (bits) {
@@ -1001,7 +997,11 @@
 		av_log(0, AV_LOG_ERROR, "DVBSub error: line overflow\n");
 #endif

-	(*srcbuf) += (gst_bit_reader_get_remaining (&gb) + 7) >> 3;
+	dvb_log (DVB_LOG_PIXEL, G_LOG_LEVEL_DEBUG,
+	         "bitreader position is %u; (%u + 7) >> 3 = %u",
+	         gst_bit_reader_get_pos (&gb), gst_bit_reader_get_pos (&gb), (gst_bit_reader_get_pos (&gb) + 7) >> 3);
+
+	(*srcbuf) += (gst_bit_reader_get_pos (&gb) + 7) >> 3;

 	dvb_log (DVB_LOG_PIXEL, G_LOG_LEVEL_DEBUG,
 	         "(n=4): Returning with %d pixels read (caller will advance x_pos by that)", pixels_read);


Implementation of end of display set parsing, ported from libavcodec.

This also adds saving to *.png files when enabled with a macro.
It shows that things don't seem to quite work yet in read_4bit_string

The representation of the final data is currently ported straight from
libavcodec representation. We probably will want to change this to
something more suitable for Qt/gstreamer straight away, as I can see
already many ways to improve the data structures, both for sanity and
suitability for conversion to gst/QtImage

--- src/dvb-sub.c
+++ src/dvb-sub.c
@@ -36,6 +36,8 @@
 #include <gst/base/gstbitreader.h> /* GstBitReader */
 #include "ffmpeg-colorspace.h" /* YUV_TO_RGB1_CCIR */

+//#define DEBUG_SAVE_IMAGES /* NOTE: This requires netpbm on the system - pnmtopng is called with system() */
+
 /* FIXME: Are we waiting for an acquisition point before trying to do things? */
 /* FIXME: In the end convert some of the guint8/16 (especially stack variables) back to gint for access efficiency */

@@ -107,6 +109,34 @@

 	DVBSubObjectDisplay *display_list;
 } DVBSubRegion;
+
+/* FIXME: AVCodec representation of graphics data. Can be removed once it is converted away from ffmpeg way */
+/**
+ * four components are given, that's all.
+ * the last component is alpha
+ */
+typedef struct AVPicture {
+	guint8 *data[4];
+	int linesize[4]; /** number of bytes per line */ /* FIXME: Why does this have four elements, we use only first */
+} AVPicture;
+
+typedef struct DVBSubtitleRect {
+	int x; /** x coordinate of top left corner */
+	int y; /** y coordinate of top left corner */
+	int w; /** width */
+	int h; /** height */
+
+	/* FIXME: AVCodec representation of graphics data.
+	 * FIXME: Convert to be suitable for us in Qt and GStreamer. */
+	/** data+linesize for the bitmap of this subtitle.*/
+	AVPicture pict;
+} DVBSubtitleRect;
+
+/* FIXME: Temporary */
+typedef struct AVSubtitle {
+	unsigned num_rects;
+	DVBSubtitleRect **rects;
+} AVSubtitle;

 typedef struct _DvbSubPrivate DvbSubPrivate;
 struct _DvbSubPrivate
@@ -130,6 +160,7 @@
 	BOTTOM_FIELD = 1
 } DvbSubPixelDataSubBlockFieldType;

+/* FIXME: It might make sense to pass DvbSubPrivate for all the get_* functions, instead of public DvbSub */
 static DVBSubObject *
 get_object (DvbSub *dvb_sub, guint16 object_id)
 {
@@ -581,7 +612,7 @@
                           const guint8 **srcbuf, gint buf_size,
                           guint8 non_mod, guint8 *map_table)
 {
-	g_print ("Inside %s\n", __PRETTY_FUNCTION__);
+	g_print ("READ_nBIT_STRING (4): Inside %s with dbuf_len = %d\n", __PRETTY_FUNCTION__, dbuf_len);
 	/* TODO */
 	GstBitReader gb = GST_BIT_READER_INIT (*srcbuf, buf_size);
 	/* FIXME: Handle FALSE returns from gst_bit_reader_get_* calls? */
@@ -590,15 +621,19 @@
 	guint run_length;
 	int pixels_read = 0;

-	while (gst_bit_reader_get_remaining (&gb) < (buf_size << 3) && pixels_read < dbuf_len) {
+	while (gst_bit_reader_get_remaining (&gb) < buf_size << 3 && pixels_read < dbuf_len) {
 		gst_bit_reader_get_bits_uint32 (&gb, &bits, 2);

 		if (bits) {
 			if (non_mod != 1 || bits != 1) {
-				if (map_table)
+				if (map_table) {
 					*destbuf++ = map_table[bits];
-				else
+					g_print ("READ_nBIT_STRING (4): Putting value in destbuf: 0x%x", map_table[bits]);
+				}
+				else {
 					*destbuf++ = bits;
+					g_print ("READ_nBIT_STRING (4): Putting value in destbuf: 0x%x\n", map_table[bits]);
+				}
 			}
 			pixels_read++;
 		} else {
@@ -613,6 +648,7 @@
 				else {
 					if (map_table)
 						bits = map_table[bits];
+					g_print ("READ_nBIT_STRING (4): Putting value 0x%x in destbuf %d times\n", bits, run_length);
 					while (run_length-- > 0 && pixels_read < dbuf_len) {
 						*destbuf++ = bits;
 						pixels_read++;
@@ -882,13 +918,253 @@
 	}
 }

+#ifdef DEBUG_SAVE_IMAGES
+static void png_save2(const char *filename, guint32 *bitmap, int w, int h)
+{
+	int x, y, v;
+	FILE *f;
+	char fname[40], fname2[40];
+	char command[1024];
+
+	snprintf(fname, sizeof(fname), "%s.ppm", filename);
+
+	f = fopen(fname, "w");
+	if (!f) {
+		perror(fname);
+		exit(1);
+	}
+	fprintf(f, "P6\n"
+	        "%d %d\n"
+	        "%d\n",
+	        w, h, 255);
+	for(y = 0; y < h; y++) {
+		for(x = 0; x < w; x++) {
+			v = bitmap[y * w + x];
+			putc((v >> 16) & 0xff, f);
+			putc((v >> 8) & 0xff, f);
+			putc((v >> 0) & 0xff, f);
+		}
+	}
+	fclose(f);
+
+
+	snprintf(fname2, sizeof(fname2), "%s-a.pgm", filename);
+
+	f = fopen(fname2, "w");
+	if (!f) {
+		perror(fname2);
+		exit(1);
+	}
+	fprintf(f, "P5\n"
+	        "%d %d\n"
+	        "%d\n",
+	        w, h, 255);
+	for(y = 0; y < h; y++) {
+		for(x = 0; x < w; x++) {
+			v = bitmap[y * w + x];
+			putc((v >> 24) & 0xff, f);
+		}
+	}
+	fclose(f);
+
+	snprintf(command, sizeof(command), "pnmtopng -alpha %s %s > %s.png 2> /dev/null", fname2, fname, filename);
+	system(command);
+
+	//snprintf(command, sizeof(command), "rm %s %s", fname, fname2);
+	//system(command);
+}
+
 static void
+save_display_set(DvbSub *dvb_sub)
+{
+	DvbSubPrivate *priv = (DvbSubPrivate *)dvb_sub->private_data;
+
+	DVBSubRegion *region;
+	DVBSubRegionDisplay *display;
+	DVBSubCLUT *clut;
+	guint32 *clut_table;
+	int x_pos, y_pos, width, height;
+	int x, y, y_off, x_off;
+	guint32 *pbuf;
+	char filename[32];
+	static int fileno_index = 0;
+
+	x_pos = -1;
+	y_pos = -1;
+	width = 0;
+	height = 0;
+
+	for (display = priv->display_list; display; display = display->next) {
+		region = get_region(dvb_sub, display->region_id);
+
+		if (x_pos == -1) {
+			x_pos = display->x_pos;
+			y_pos = display->y_pos;
+			width = region->width;
+			height = region->height;
+		} else {
+			if (display->x_pos < x_pos) {
+				width += (x_pos - display->x_pos);
+				x_pos = display->x_pos;
+			}
+
+			if (display->y_pos < y_pos) {
+				height += (y_pos - display->y_pos);
+				y_pos = display->y_pos;
+			}
+
+			if (display->x_pos + region->width > x_pos + width) {
+				width = display->x_pos + region->width - x_pos;
+			}
+
+			if (display->y_pos + region->height > y_pos + height) {
+				height = display->y_pos + region->height - y_pos;
+			}
+		}
+	}
+
+	if (x_pos >= 0) {
+
+		pbuf = g_malloc (width * height * 4);
+
+		for (display = priv->display_list; display; display = display->next) {
+			region = get_region(dvb_sub, display->region_id);
+
+			x_off = display->x_pos - x_pos;
+			y_off = display->y_pos - y_pos;
+
+			clut = get_clut(dvb_sub, region->clut);
+
+			if (clut == 0)
+				clut = &default_clut;
+
+			switch (region->depth) {
+				case 2:
+					clut_table = clut->clut4;
+					break;
+				case 8:
+					clut_table = clut->clut256;
+					break;
+				case 4:
+				default:
+					clut_table = clut->clut16;
+					break;
+			}
+
+			for (y = 0; y < region->height; y++) {
+				for (x = 0; x < region->width; x++) {
+					pbuf[((y + y_off) * width) + x_off + x] =
+						clut_table[region->pbuf[y * region->width + x]];
+					//g_print ("pbuf@%dx%d = 0x%x\n", x_off + x, y_off + y, clut_table[region->pbuf[y * region->width + x]]);
+				}
+			}
+
+		}
+
+		snprintf (filename, sizeof(filename), "dvbs.%d", fileno_index);
+
+		png_save2 (filename, pbuf, width, height);
+
+		g_free (pbuf);
+	}
+
+	fileno_index++;
+}
+#endif
+
+static gint
 _dvb_sub_parse_end_of_display_set (DvbSub *dvb_sub, guint16 page_id, guint8 *buf, gint buf_size)
 {
-	static int counter = 0;
-	++counter;
-	g_print ("END OF DISPLAY SET %d: page_id = %u, length = %d\n", counter, page_id, buf_size);
-	/* TODO */
+	DvbSubPrivate *priv = (DvbSubPrivate *)dvb_sub->private_data;
+
+	/* FIXME: Temporarily declared in here for save_display_set testing */
+	AVSubtitle *sub = g_slice_new0 (AVSubtitle);
+
+	DVBSubRegion *region;
+	DVBSubRegionDisplay *display;
+	DVBSubtitleRect *rect;
+	DVBSubCLUT *clut;
+	guint32 *clut_table;
+	int i;
+
+	g_print ("END OF DISPLAY SET: page_id = %u, length = %d\n", page_id, buf_size);
+
+	sub->rects = NULL;
+#if 0 /* FIXME: PTS stuff not figured out yet */
+	sub->start_display_time = 0;
+	sub->end_display_time = priv->page_time_out * 1000;
+	sub->format = 0; /* 0 = graphics */
+#endif
+
+	sub->num_rects = priv->display_list_size;
+
+	if (sub->num_rects > 0){
+		sub->rects = g_malloc0 (sizeof(*sub->rects) * sub->num_rects); /* GSlice? */
+		for(i=0; i<sub->num_rects; i++)
+			sub->rects[i] = g_malloc0 (sizeof(*sub->rects[i])); /* GSlice? */
+	}
+
+	i = 0;
+
+	for (display = priv->display_list; display; display = display->next) {
+		region = get_region(dvb_sub, display->region_id);
+		rect = sub->rects[i];
+
+		if (!region)
+			continue;
+
+		rect->x = display->x_pos;
+		rect->y = display->y_pos;
+		rect->w = region->width;
+		rect->h = region->height;
+#if 0 /* FIXME: Don't think we need to save the number of colors in the palette when we are saving as RGBA? */
+		rect->nb_colors = 16;
+#endif
+#if 0 /* FIXME: Needed to be specified once we support strings of characters based subtitles */
+		rect->type      = SUBTITLE_BITMAP;
+#endif
+		rect->pict.linesize[0] = region->width;
+
+		clut = get_clut(dvb_sub, region->clut);
+
+		if (!clut)
+			clut = &default_clut;
+
+		switch (region->depth) {
+			case 2:
+				clut_table = clut->clut4;
+				break;
+			case 8:
+				clut_table = clut->clut256;
+				break;
+			case 4:
+			default:
+				clut_table = clut->clut16;
+				break;
+		}
+
+		/* FIXME: Tweak this to be saved in a format most suitable for Qt and GStreamer instead.
+		 * Currently kept in AVPicture for quick save_display_set testing */
+		rect->pict.data[1] = g_malloc((1 << region->depth) * sizeof(guint32)); /* FIXME: Can we use GSlice here? */
+		memcpy(rect->pict.data[1], clut_table, (1 << region->depth) * sizeof(guint32));
+		g_print ("rect->pict.data[1] content:\n");
+		gst_util_dump_mem (rect->pict.data[1], (1 << region->depth) * sizeof(guint32));
+
+		rect->pict.data[0] = g_malloc(region->buf_size); /* FIXME: Can we use GSlice here? */
+		memcpy(rect->pict.data[0], region->pbuf, region->buf_size);
+		g_print ("rect->pict.data[0] content:\n");
+		gst_util_dump_mem (rect->pict.data[0], region->buf_size);
+
+		i++;
+	}
+
+	sub->num_rects = i;
+
+#ifdef DEBUG_SAVE_IMAGES
+	save_display_set(dvb_sub);
+#endif
+
+	return 1; /* FIXME: The caller of this function is probably supposed to do something with the return value */
 }

 /**


Minor optimization.

Minor optimization.

svn path=/trunk/; revision=2616

--- pango/break.c
+++ pango/break.c
@@ -627,8 +627,10 @@
       /* ---- Cursor position breaks (Grapheme breaks) ---- */

       {
+	GraphemeBreakType GB_type;
+	gboolean is_grapheme_boundary = FALSE;
         /* Find the GraphemeBreakType of wc */
-	GraphemeBreakType GB_type = GB_Other;
+	GB_type = GB_Other;
 	switch (type)
 	  {
 	  case G_UNICODE_CONTROL:
@@ -685,21 +687,23 @@
 	/* Grapheme Cluster Boundary Rules */
 	/* We apply Rules GB1 and GB2 at the end of the function */
 	if (wc == '\n' && prev_wc == '\r')
-	  attrs[i].is_cursor_position = FALSE; /* Rule GB3 */
+	  is_grapheme_boundary = FALSE; /* Rule GB3 */
 	else if (GB_type == GB_ControlCRLF || prev_GB_type == GB_ControlCRLF)
-	  attrs[i].is_cursor_position = TRUE; /* Rules GB4 and GB5 */
+	  is_grapheme_boundary = TRUE; /* Rules GB4 and GB5 */
 	else if (GB_type == GB_InHangulSyllable)
-	  attrs[i].is_cursor_position = FALSE; /* Rules GB6, GB7, GB8 */
+	  is_grapheme_boundary = FALSE; /* Rules GB6, GB7, GB8 */
 	else if (GB_type == GB_Extend)
-	  attrs[i].is_cursor_position = FALSE; /* Rule GB9 */
+	  is_grapheme_boundary = FALSE; /* Rule GB9 */
 	else if (GB_type == GB_SpacingMark)
-	  attrs[i].is_cursor_position = FALSE; /* Rule GB9a */
+	  is_grapheme_boundary = FALSE; /* Rule GB9a */
 	else if (prev_GB_type == GB_Prepend)
-	  attrs[i].is_cursor_position = FALSE; /* Rule GB9b */
+	  is_grapheme_boundary = FALSE; /* Rule GB9b */
 	else
-	  attrs[i].is_cursor_position = TRUE;  /* Rule GB10 */
+	  is_grapheme_boundary = TRUE;  /* Rule GB10 */

 	prev_GB_type = GB_type;
+
+	attrs[i].is_cursor_position = is_grapheme_boundary;
       }

       /* If this is a grapheme boundary, we have to decide if backspace


- now it works

- now it works

--- streams/src/modules/sth.c
+++ streams/src/modules/sth.c
@@ -1795,6 +1795,39 @@
 	      ebadmsg:
 		return (ERR_PTR(-EBADMSG));
 	}
+}
+
+streams_noinline void
+__strputbq_band(struct stdata *sd, queue_t *q, mblk_t *mp)
+{
+	struct qband *qb;
+
+	qb = __find_qband(q, mp->b_band);
+	if (likely(qb->qb_last == mp->b_prev) || likely(qb->qb_last == NULL))
+		qb->qb_last = mp;
+	if (likely(qb->qb_first == mp->b_next) || likely(qb->qb_first == NULL))
+		qb->qb_first = mp;
+	qb->qb_msgs++;
+	if ((qb->qb_count += msgsize(mp)) >= qb->qb_hiwat)
+		if (likely(!test_and_set_bit(QB_FULL_BIT, &qb->qb_flag)))
+			q->q_blocked++;
+	clear_bit(STRPRI_BIT, &sd->sd_flag);
+}
+
+streams_noinline void
+__strputbq_pri(struct stdata *sd, queue_t *q, mblk_t *mp)
+{
+	mp->b_band = 0;
+	if ((mp->b_next = q->q_first))
+		mp->b_next->b_prev = mp;
+	mp->b_prev = NULL;
+	q->q_first = mp;
+	if (q->q_last == NULL)
+		q->q_last = mp;
+	q->q_msgs++;
+	if ((q->q_count += msgsize(mp)) >= q->q_hiwat)
+		set_bit(QFULL_BIT, &q->q_flag);
+	set_bit(STRPRI_BIT, &sd->sd_flag);
 }

 /**
@@ -1852,33 +1885,11 @@
 			if (likely(mp->b_band == 0)) {
 				if ((q->q_count += msgsize(mp)) >= q->q_hiwat)
 					set_bit(QFULL_BIT, &q->q_flag);
-			} else {
-				struct qband *qb;
-
-				qb = __find_qband(q, mp->b_band);
-				if (likely(qb->qb_last == b_prev) || likely(qb->qb_last == NULL))
-					qb->qb_last = mp;
-				if (likely(qb->qb_first == b_next) || likely(qb->qb_first == NULL))
-					qb->qb_first = mp;
-				qb->qb_msgs++;
-				if ((qb->qb_count += msgsize(mp)) >= qb->qb_hiwat)
-					if (likely(!test_and_set_bit(QB_FULL_BIT, &qb->qb_flag)))
-						q->q_blocked++;
-			}
-			clear_bit(STRPRI_BIT, &sd->sd_flag);
-		} else {
-			mp->b_band = 0;
-			if ((mp->b_next = q->q_first))
-				mp->b_next->b_prev = mp;
-			mp->b_prev = NULL;
-			q->q_first = mp;
-			if (q->q_last == NULL)
-				q->q_last = mp;
-			q->q_msgs++;
-			if ((q->q_count += msgsize(mp)) >= q->q_hiwat)
-				set_bit(QFULL_BIT, &q->q_flag);
-			set_bit(STRPRI_BIT, &sd->sd_flag);
-		}
+				clear_bit(STRPRI_BIT, &sd->sd_flag);
+			} else
+				__strputbq_band(sd, q, mp);
+		} else
+			__strputbq_pri(sd, q, mp);
 	}
 	if (likely(release)) {
 		clear_bit(QHLIST_BIT, &q->q_flag);
@@ -4859,7 +4870,7 @@
 		const int sd_rdopt = sd->sd_rdopt;
 		const int sd_flag = sd->sd_flag;
 		mblk_t *mp, *first = NULL;
-		queue_t *q = sd->sd_wq;
+		queue_t *q = sd->sd_rq;
 		bool stop = false;
 		ssize_t mread = nbytes;

@@ -5973,6 +5984,7 @@
 	struct strbuf ctl, dat;
 	int flags, band = 0;
 	int err, retval = 0;
+	queue_t *q = sd->sd_rq;
 	mblk_t *mp;

 	if (unlikely(flagsp == NULL))
@@ -6023,7 +6035,6 @@

 	if (likely(!(err = straccess_rlock(sd, FREAD)))) {
 		ssize_t mread = datp ? ((datp->maxlen > 0) ? datp->maxlen : -1) : -1;
-		queue_t *q = sd->sd_rq;

 		dassert(q != NULL);

@@ -6123,7 +6134,7 @@
 				retval |= MOREDATA;
 			}
 		}
-		strputbq(sd, sd->sd_rq, mp, true);	/* clears QHLIST bit */
+		strputbq(sd, q, mp, true);	/* clears QHLIST bit */
 	      done:
 		/* copy out return values */
 		if (likely(ctlp != NULL))


> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
> Sent: 24 January 2001 16:51
> To: Dave Page
> Subject: Re: [PATCHES] ODBC Patch for OJs/Large Querys & Rows
>
>
> > SQL_OJ_LEFT = Left outer joins are supported.
>
> Yes.
<snip>

In addition to my earlier patch, this one adds support for SQLGetInfo
SQL_OJ_CAPABILITIES to the ODBC driver.

Dave Page

--- src/interfaces/odbc/info.c
+++ src/interfaces/odbc/info.c
@@ -416,6 +416,17 @@
     case SQL_ODBC_SQL_OPT_IEF: /* ODBC 1.0 */
 		p = "N";
         break;
+
+	case SQL_OJ_CAPABILITIES: /* ODBC 2.01 */
+		len = 4;
+		value = (SQL_OJ_LEFT |
+				SQL_OJ_RIGHT |
+				SQL_OJ_FULL |
+				SQL_OJ_NESTED |
+				SQL_OJ_NOT_ORDERED |
+				SQL_OJ_INNER |
+				SQL_OJ_ALL_COMPARISON_OPS);
+		break;

     case SQL_ORDER_BY_COLUMNS_IN_SELECT: /* ODBC 2.0 */
 		p = (PROTOCOL_62(ci) || PROTOCOL_63(ci)) ? "Y" : "N";


broadway: Sync surface updates with paint clock

We now only update surface data after we have painted. Before we painted
in an idle, which meant we might send black data some times if we e.g.
resized the window and had not painted yet. Also, it means we're updating
less often to the daemon, saving resources.

We still have to queue a flush in the idle for non-draw operations,
otherwise e.g. resize of a toplevel will never be flushed if the clock
is frozen (e.g. during toplevel resize).

--- gdk/broadway/gdkwindow-broadway.c
+++ gdk/broadway/gdkwindow-broadway.c
@@ -83,18 +83,16 @@
 	       gdk_window_impl_broadway,
 	       GDK_TYPE_WINDOW_IMPL)

-static guint dirty_flush_id = 0;
-
-static gboolean
-dirty_flush_idle (gpointer data)
+static void
+update_dirty_windows_and_sync (void)
 {
   GList *l;
   GdkBroadwayDisplay *display;
-
-  dirty_flush_id = 0;
+  gboolean updated_surface;

   display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());

+  updated_surface = FALSE;
   for (l = display->toplevels; l != NULL; l = l->next)
     {
       GdkWindowImplBroadway *impl = l->data;
@@ -102,6 +100,7 @@
       if (impl->dirty)
 	{
 	  impl->dirty = FALSE;
+	  updated_surface = TRUE;
 	  _gdk_broadway_server_window_update (display->server,
 					      impl->id,
 					      impl->surface);
@@ -110,16 +109,32 @@

   /* We sync here to ensure all references to the impl->surface memory
      is done, as we may later paint new data in them. */
-  gdk_display_sync (GDK_DISPLAY (display));
+  if (updated_surface)
+    gdk_display_sync (GDK_DISPLAY (display));
+  else
+    gdk_display_flush (GDK_DISPLAY (display));
+}
+
+static guint flush_id = 0;
+
+static gboolean
+flush_idle (gpointer data)
+{
+  flush_id = 0;
+
+  gdk_display_flush (gdk_display_get_default ());

   return FALSE;
 }

-static void
-queue_dirty_flush (GdkBroadwayDisplay *display)
-{
-  if (dirty_flush_id == 0)
-    dirty_flush_id = gdk_threads_add_idle (dirty_flush_idle, NULL);
+/* We need to flush in an idle rather than AFTER_PAINT, as the clock
+   is frozen during e.g. window resizes so the paint will not happen
+   and the window resize request is never flushed. */
+static void
+queue_flush (GdkWindow *window)
+{
+  if (flush_id == 0)
+    flush_id = gdk_threads_add_idle (flush_idle, NULL);
 }

 static void
@@ -195,6 +210,25 @@
   window->viewable = TRUE;

   _gdk_window_update_size (broadway_screen->root_window);
+}
+
+static void
+on_frame_clock_after_paint (GdkFrameClock *clock,
+                            GdkWindow     *window)
+{
+  update_dirty_windows_and_sync ();
+}
+
+static void
+connect_frame_clock (GdkWindow *window)
+{
+  if (WINDOW_IS_TOPLEVEL (window))
+    {
+      GdkFrameClock *frame_clock = gdk_window_get_frame_clock (window);
+
+      g_signal_connect (frame_clock, "after-paint",
+                        G_CALLBACK (on_frame_clock_after_paint), window);
+    }
 }

 void
@@ -229,6 +263,8 @@
   g_assert (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT);

   broadway_display->toplevels = g_list_prepend (broadway_display->toplevels, impl);
+
+  connect_frame_clock (window);
 }

 void
@@ -384,7 +420,7 @@

   broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
   if (_gdk_broadway_server_window_show (broadway_display->server, impl->id))
-    queue_dirty_flush (broadway_display);
+    queue_flush (window);

 }

@@ -405,7 +441,7 @@

   broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
   if (_gdk_broadway_server_window_hide (broadway_display->server, impl->id))
-    queue_dirty_flush (broadway_display);
+    queue_flush (window);

   _gdk_window_clear_update_area (window);
 }
@@ -460,7 +496,7 @@
 					   with_move,
 					   x, y,
 					   window->width, window->height);
-  queue_dirty_flush (broadway_display);
+  queue_flush (window);
   if (size_changed)
     window->resize_count++;
 }
@@ -1327,7 +1363,6 @@

   impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
   impl->dirty = TRUE;
-  queue_dirty_flush (GDK_BROADWAY_DISPLAY (gdk_window_get_display (window)));
 }

 void
@@ -1393,7 +1428,7 @@
       if (_gdk_broadway_server_window_translate (broadway_display->server,
 						 impl->id,
 						 area, dx, dy))
-	queue_dirty_flush (broadway_display);
+	queue_flush (window);
     }
 }


ghost api details

ghost api details

--- parma/parma.h
+++ parma/parma.h
@@ -184,7 +184,10 @@
     double stepFactor = 0.1, int verbosity=0);

 /**
- * @brief create an APF Balancer using ghost element aware diffusion
+ * @brief create an APF Balancer using ghost element aware diffusion for a
+ * vertex-based partition
+ * @remark Ghosting for a vertex-based partition is asymetric; ghosts
+ * are only needed for vertices on the boundary that are owned.
  * @param m (In) partitioned mesh
  * @param layers (In) depth of ghosting
  * @param stepFactor (In) amount of weight to migrate between parts during