io_pres_read: use new pres2pbuf api

io_pres_read: use new pres2pbuf api

--- nmsg/io_pres_read.c
+++ nmsg/io_pres_read.c
@@ -35,6 +35,7 @@
 _nmsg_io_thr_pres_read(void *user) {
 	Nmsg__NmsgPayload *np;
 	char line[1024];
+	nmsg_res res;
 	struct nmsg_io *io;
 	struct nmsg_io_buf *iobuf;
 	struct nmsg_io_pres *iopres;
@@ -46,7 +47,9 @@
 	iopres = iothr->iopres;
 	np = NULL;

-	iopres->clos = nmsg_pbmod_init(iopres->mod, io->debug);
+	res = nmsg_pbmod_init(iopres->mod, &iopres->clos, io->debug);
+	if (res != nmsg_res_success)
+		return (NULL);

 	if (iothr->io->debug >= 4)
 		fprintf(stderr, "nmsg_io: started pres thread @ %p\n", iothr);
@@ -57,7 +60,6 @@
 	}

 	while (fgets(line, sizeof(line), iopres->fp) != NULL) {
-		nmsg_res res;
 		size_t sz;
 		uint8_t *pbuf;

@@ -65,16 +67,24 @@
 			goto thr_pres_end;

 		iothr->count_pres_in += 1;
-		res = nmsg_pbmod_pres2pbuf(iopres->mod, iopres->clos, line,
-					   &pbuf, &sz);
+		res = nmsg_pbmod_pres2pbuf(iopres->mod, iopres->clos, line);
 		if (res == nmsg_res_failure) {
 			iothr->res = res;
 			goto thr_pres_end;
 		}
 		if (res == nmsg_res_success)
 			continue;
+		if (res != nmsg_res_pbuf_ready) {
+			iothr->res = res;
+			goto thr_pres_end;
+		}

-		/* nmsg_res_pbuf_ready */
+		res = nmsg_pbmod_pres2pbuf_finalize(iopres->mod, iopres->clos,
+						    &pbuf, &sz);
+		if (res != nmsg_res_success) {
+			iothr->res = res;
+			goto thr_pres_end;
+		}

 		nmsg_time_get(&iothr->now);
 		iothr->count_pres_payload_in += 1;
@@ -123,7 +133,7 @@
 		}
 	}
 thr_pres_end:
-	nmsg_pbmod_fini(iopres->mod, iopres->clos);
+	nmsg_pbmod_fini(iopres->mod, &iopres->clos);
 	if (io->debug >= 2)
 		fprintf(stderr, "nmsg_io: iothr=%p"
 			" count_pres_in=%" PRIu64


ut_print_buf(): Add a Valgrind check that the buffer is wholly defined.

--- ut/ut0ut.c
+++ ut/ut0ut.c
@@ -344,6 +344,8 @@
 {
 	const byte*	data;
 	ulint		i;
+
+	UNIV_MEM_ASSERT_RW(buf, len);

 	fprintf(file, " len %lu; hex ", len);


Fixed the log-prefix buffer - it was too small and the setup code lacked a bounds-check.

--- util/log.c
+++ util/log.c
@@ -4,7 +4,11 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: log.c,v $
- * Revision 1.9  1995-09-29 17:12:34  quinn
+ * Revision 1.10  1995-12-06 09:51:27  quinn
+ * Fixed the log-prefix buffer - it was too small and the setup code lacked
+ * a bounds-check.
+ *
+ * Revision 1.9  1995/09/29  17:12:34  quinn
  * Smallish
  *
  * Revision 1.8  1995/09/27  15:03:02  quinn
@@ -71,7 +75,7 @@

 static int l_level = LOG_DEFAULT_LEVEL;
 static FILE *l_file = stderr;
-static char l_prefix[30] = "log";
+static char l_prefix[512] = "log";

 static struct {
     int mask;
@@ -107,7 +111,7 @@
 {
     l_level = level;
     if (prefix && *prefix)
-    	strcpy(l_prefix, prefix);
+    	sprintf(l_prefix, "%.512s", prefix);
     if (!name || !*name || l_file != stderr)
 	return;
     if (!(l_file = fopen(name, "a")))


linux build

linux build

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

--- ASCOfficePPTXFile/PPTXFormat/Theme.h
+++ ASCOfficePPTXFile/PPTXFormat/Theme.h
@@ -299,9 +299,9 @@

 		virtual void FillShapeProperties(Logic::ShapeProperties& props, const CString& type)const
 		{
-			if(Presentation.IsInit())
-			{
-				props.FillFromTextListStyle(Presentation->defaultTextStyle);
+            if(presentation.IsInit())
+			{
+                props.FillFromTextListStyle(presentation->defaultTextStyle);
 				props.SetTextType(0);
 			}
 			if(type == _T("table-cell"))
@@ -349,7 +349,7 @@

 		bool									isThemeOverride;

-		smart_ptr<Presentation>					Presentation;
+        smart_ptr<Presentation>					presentation;

 	public:
 		void SetColorMap(const Logic::ClrMap& map){m_map = ↦};
@@ -359,4 +359,4 @@
 	};
 } // namespace PPTX

-#endif // PPTX_THEME_FILE_INCLUDE_H_+#endif // PPTX_THEME_FILE_INCLUDE_H_


minor shell fix

minor shell fix


add test case 'pfmerge' for vire-benchmark

--- tests/vrt_benchmark.c
+++ tests/vrt_benchmark.c
@@ -1303,6 +1303,16 @@
             free(cmd);
         }

+        if (test_is_selected("pfmerge") && types_is_selected("hyperloglog")) {
+            len = redisFormatCommand(&cmd,"PFADD myhll:__rand_key__ %s:__rand_field__", data);
+            benchmark("PFADD (needed to benchmark PFMERGE)",cmd,len);
+            free(cmd);
+
+            len = redisFormatCommand(&cmd,"PFMERGE myhllm:__rand_key__ myhll:__rand_key__ myhll:__rand_key__");
+            benchmark("PFMERGE",cmd,len);
+            free(cmd);
+        }
+
         if (!config.csv) printf("\n");
     } while(config.loop);


Fix a compiler warning by using a printf format matching the variable type.

--- usr.sbin/sa/db.c
+++ usr.sbin/sa/db.c
@@ -89,7 +89,7 @@
 		goto closeout;
 	} else if (rv == 0) {	/* It's there; verify version. */
 		if (data.size != sizeof(version)) {
-			warnx("invalid version size %d in %s",
+			warnx("invalid version size %zd in %s",
 			    data.size, uname);
 			error = -1;
 			goto closeout;


cfparser: %include directive

cfparser: %include directive

This includes body of other file into current one.

Based on patch by Andrew Dunstan.

--- usual/cfparser.c
+++ usual/cfparser.c
@@ -29,6 +29,8 @@
 #include <usual/logging.h>
 #include <usual/time.h>

+#define MAX_INCLUDE 10
+
 /*
  * INI file parser.
  */
@@ -43,7 +45,7 @@
 	return lineno;
 }

-bool parse_ini_file(const char *fn, cf_handler_f user_handler, void *arg)
+static bool parse_ini_file_internal(const char *fn, cf_handler_f user_handler, void *arg, int inclevel)
 {
 	char *buf;
 	char *p, *key, *val;
@@ -59,6 +61,38 @@
 	while (*p) {
 		/* space at the start of line - including empty lines */
 		while (*p && isspace(*p)) p++;
+
+		if (strncmp(p, "%include", 8) == 0 && p[8] != 0 && isblank(p[8])) {
+			if (inclevel >= MAX_INCLUDE) {
+				log_error("include nesting level too deep (%s:%d), stopping loading",
+					  fn, count_lines(buf, p));
+				goto failed;
+			}
+			p += 8;
+			while (*p && isblank(*p)) p++;
+			/* now read value */
+			val = p;
+			while (*p && (*p != '\n'))
+				p++;
+			vlen = p - val;
+			/* eat space at end */
+			while (vlen > 0 && isspace(val[vlen - 1]))
+				vlen--;
+
+			/*
+			 * val now has the name of the file to be included.
+			 * Process it recursively.
+			 */
+			o1 = val[vlen];
+			val[vlen] = 0;
+			log_debug("processing include: %s", val);
+			ok = parse_ini_file_internal(val, user_handler, arg, inclevel + 1);
+			val[vlen] = o1;
+			if (!ok)
+				goto failed;
+			log_debug("returned to processing file %s", fn);
+			continue;
+		}

 		/* skip comment lines */
 		if (*p == '#' || *p == ';') {
@@ -139,6 +173,11 @@
 failed:
 	free(buf);
 	return false;
+}
+
+bool parse_ini_file(const char *fn, cf_handler_f user_handler, void *arg)
+{
+	return parse_ini_file_internal(fn, user_handler, arg, 0);
 }

 /*


added interior flux integrals

added interior flux integrals

--- proteusModule/proteus/CompKernel.h
+++ proteusModule/proteus/CompKernel.h
@@ -877,7 +877,19 @@
     return flux*w_dS;
   }

+  inline double InteriorElementBoundaryFlux(const double& flux,
+					    const double& w_dS)
+  {
+    return flux*w_dS;
+  }
+
   inline double ExteriorNumericalAdvectiveFluxJacobian(const double& dflux_left,
+						       const double& v)
+  {
+    return dflux_left*v;
+  }
+
+  inline double InteriorNumericalAdvectiveFluxJacobian(const double& dflux_left,
 						       const double& v)
   {
     return dflux_left*v;


Revision 5 is 82559B.

Revision 5 is 82559B.


check for m_devget() returning NULL, increment ierror count
and just return;

OK mglocker@

--- dev/pcmcia/if_malo.c
+++ dev/pcmcia/if_malo.c
@@ -1,4 +1,4 @@
-/*      $OpenBSD: if_malo.c,v 1.62 2008/07/27 13:02:37 mglocker Exp $ */
+/*      $OpenBSD: if_malo.c,v 1.63 2008/07/29 10:05:38 thib Exp $ */

 /*
  * Copyright (c) 2007 Marcus Glocker <mglocker@openbsd.org>
@@ -929,6 +929,11 @@
 	/* prepare mbuf */
 	m = m_devget(sc->sc_data + rxdesc->pkgoffset - ETHER_ALIGN,
 	    rxdesc->pkglen + ETHER_ALIGN, 0, ifp, NULL);
+	if (m == NULL) {
+		DPRINTF(1, "RX m_devget failed!\n");
+		ifp->if_ierrors++;
+		return;
+	}
 	m_adj(m, ETHER_ALIGN);

 #if NBPFILTER > 0


Added warning-free is_negative to allow absv, sign, and DivRU instantiations with unsigned types

--- uutility.h
+++ uutility.h
@@ -16,6 +16,7 @@

 #include "utypes.h"
 #include "traits.h"
+#include "ulimits.h"
 #include <assert.h>

 namespace ustl {
@@ -150,19 +151,25 @@
 #undef UNVOID_DISTANCE
 #endif

+// The compiler issues a warning if an unsigned type is compared to 0.
+template <typename T, bool IsSigned> struct __is_negative { inline bool operator()(const T& v) { return (v < 0); } };
+template <typename T> struct __is_negative<T,false> { inline bool operator()(const T&) { return (false); } };
+/// Warning-free way to check if \p v is negative, even if for unsigned types.
+template <typename T> inline bool is_negative (const T& v) { return (__is_negative<T,numeric_limits<T>::is_signed>()(v)); }
+
 /// \brief Returns the absolute value of \p v
 /// Unlike the stdlib functions, this is inline and works with all types.
 template <typename T>
 inline T absv (T v)
 {
-    return (v < 0 ? -v : v);
+    return (is_negative(v) ? -v : v);
 }

 /// \brief Returns -1 for negative values, 1 for positive, and 0 for 0
 template <typename T>
 inline T sign (T v)
 {
-    return ((0 < v) - (v < 0));
+    return ((0 < v) - is_negative(v));
 }

 /// Returns the absolute value of the distance i1 and i2
@@ -302,7 +309,7 @@
 inline T1 DivRU (T1 n1, T2 n2)
 {
     T2 adj = n2 - 1;
-    if (n1 < 0)
+    if (is_negative (n1))
 	adj = -adj;
     return ((n1 + adj) / n2);
 }


remove error If-Modified-Since Header

remove error If-Modified-Since Header

--- uws_http.c
+++ uws_http.c
@@ -119,6 +119,19 @@
 int
 http_router(int sockfd)
 {
+    /*
+
+    char *mod_time_str ;
+    if((mod_time_str = get_header_param("If-Modified-Since", request_header))) {
+        puts(mod_time_str);
+        char *file_mod_time = get_file_time(error_file_path);
+        if(is_expire(mod_time_str, file_mod_time)) {
+            send_error_response(client_fd, 304);
+            return;
+        }
+    }
+
+   */
     char path[PATH_LEN];
     struct stat stat_buff;
     int i = 0;


Update openhevc module

Update openhevc module

git-svn-id: ab66a9de07fa9d47c5829c82992f5279466c775f@4709 63c20433-aa62-49bd-875c-5a186b69a8fb

--- modules/openhevc_dec/openhevc_dec.c
+++ modules/openhevc_dec/openhevc_dec.c
@@ -45,12 +45,11 @@
 	Bool state_found;

 	u32 nalu_size_length;
-	u32 had_pic;
+	u32 restart_from;

 	GF_ESD *esd;
+	OpenHevc_Handle openHevcHandle;
 } HEVCDec;
-
-OpenHevc_Handle openHevcHandle;

 static GF_Err HEVC_ConfigureStream(HEVCDec *ctx, GF_ESD *esd)
 {
@@ -58,7 +57,8 @@
 	ctx->width = ctx->height = ctx->out_size = 0;
 	ctx->state_found = GF_FALSE;

-	openHevcHandle = libOpenHevcInit(ctx->nb_threads);
+	ctx->openHevcHandle = libOpenHevcInit(ctx->nb_threads);
+    libOpenHevcSetDisableAU(ctx->openHevcHandle, 1);
 	ctx->is_init = GF_TRUE;

 	if (esd->decoderConfig->decoderSpecificInfo && esd->decoderConfig->decoderSpecificInfo->data) {
@@ -71,7 +71,7 @@
 			GF_HEVCParamArray *ar = gf_list_get(cfg->param_array, i);
 			for (j=0; j< gf_list_count(ar->nalus); j++) {
 				GF_AVCConfigSlot *sl = gf_list_get(ar->nalus, j);
-				libOpenHevcDecode(openHevcHandle, sl->data, sl->size, 0);
+				libOpenHevcDecode(ctx->openHevcHandle, sl->data, sl->size, 0);

 				if (ar->type==GF_HEVC_NALU_SEQ_PARAM) {
 					HEVCState hevc;
@@ -86,6 +86,7 @@
 	} else {
 		ctx->nalu_size_length = 0;
 	}
+
 	ctx->stride = ctx->width;
 	ctx->out_size = ctx->stride * ctx->height * 3 / 2;
 	return GF_OK;
@@ -122,9 +123,10 @@
 	HEVCDec *ctx = (HEVCDec*) ifcg->privateStack;

 	if (ctx->is_init) {
-		libOpenHevcClose(openHevcHandle);
+		libOpenHevcClose(ctx->openHevcHandle);
 		ctx->is_init = GF_FALSE;
 	}
+	fprintf(stderr, "closing hevc dec\n");
 	ctx->width = ctx->height = ctx->out_size = 0;
 	return GF_OK;
 }
@@ -177,9 +179,10 @@
 }
 static GF_Err HEVC_SetCapabilities(GF_BaseDecoder *ifcg, GF_CodecCapability capability)
 {
+	HEVCDec *ctx = (HEVCDec*) ifcg->privateStack;
 	switch (capability.CapCode) {
     case GF_CODEC_WAIT_RAP:
-            libOpenHevcFlush(openHevcHandle);
+            libOpenHevcFlush(ctx->openHevcHandle);
         return GF_OK;
 	case GF_CODEC_MEDIA_SWITCH_QUALITY:
 		/*todo - update temporal filtering*/
@@ -193,16 +196,57 @@

 }

+static GF_Err HEVC_flush_picture(HEVCDec *ctx, char *outBuffer, u32 *outBufferLength )
+{
+	unsigned int a_w, a_h, a_stride;
+    OpenHevc_Frame_cpy openHevcFrame;
+	u8 *pY, *pU, *pV;
+
+	libOpenHevcGetPictureInfo(ctx->openHevcHandle, &openHevcFrame.frameInfo);
+
+
+	a_w      = openHevcFrame.frameInfo.nWidth;
+    a_h      = openHevcFrame.frameInfo.nHeight;
+    a_stride = openHevcFrame.frameInfo.nYPitch;
+
+    if ((ctx->width != a_w) || (ctx->height!=a_h) || (ctx->stride != a_stride)) {
+		ctx->width = a_w;
+		ctx->stride = a_stride;
+		ctx->height = a_h;
+		ctx->out_size = ctx->stride * a_w * 3 / 2;
+		/*always force layer resize*/
+		*outBufferLength = ctx->out_size;
+		return GF_BUFFER_TOO_SMALL;
+	}
+
+    pY = outBuffer;
+    pU = outBuffer + ctx->stride * ctx->height;
+    pV = outBuffer + 5*ctx->stride * ctx->height/4;
+    openHevcFrame.pvY = (void*) pY;
+    openHevcFrame.pvU = (void*) pU;
+    openHevcFrame.pvV = (void*) pV;
+    *outBufferLength = 0;
+    if (libOpenHevcGetOutputCpy(ctx->openHevcHandle, 1, &openHevcFrame)) {
+        *outBufferLength = ctx->out_size;
+    }
+    return GF_OK;
+}
+
+
 static GF_Err HEVC_ProcessData(GF_MediaDecoder *ifcg,
 		char *inBuffer, u32 inBufferLength,
 		u16 ES_ID,
 		char *outBuffer, u32 *outBufferLength,
 		u8 PaddingBits, u32 mmlevel)
 {
-	unsigned int got_pic, a_w, a_h, a_stride;
+	GF_Err e;
+	unsigned int got_pic;
     OpenHevc_Frame_cpy openHevcFrame;
 	HEVCDec *ctx = (HEVCDec*) ifcg->privateStack;
-	u8 *pY, *pU, *pV;
+	u8 *pY, *pU, *pV, *ptr;
+	u32 nb_pics=0;
+	u32 input_data_consumed = 0;
+	u32 sc_size, i, nalu_size;

 	if (!inBuffer) {
@@ -213,9 +257,12 @@
 	    openHevcFrame.pvU = (void*) pU;
 	    openHevcFrame.pvV = (void*) pV;
 	    *outBufferLength = 0;
-	    if (libOpenHevcGetOutputCpy(openHevcHandle, 1, &openHevcFrame)) {
-	        *outBufferLength = ctx->out_size;
-	    }
+
+		if ( libOpenHevcDecode(ctx->openHevcHandle, NULL, 0, 0) ) {
+			if (libOpenHevcGetOutputCpy(ctx->openHevcHandle, 1, &openHevcFrame)) {
+				*outBufferLength = ctx->out_size;
+			}
+		}
  		return GF_OK;
 	}

@@ -228,97 +275,89 @@
 		return GF_BUFFER_TOO_SMALL;
 	}

+	nb_pics = 0;
+	if (ctx->restart_from) {
+		inBuffer += ctx->restart_from;
+		inBufferLength -= ctx->restart_from;
+		ctx->restart_from = 0;
+
+		e = HEVC_flush_picture(ctx, outBuffer, outBufferLength);
+		if (e) return e;
+		nb_pics ++;
+	}
+
 	got_pic = 0;
-	if (ctx->had_pic) {
-		got_pic = 1;
-		ctx->had_pic = 0;
-	} else {
-		u32 sc_size = 0;
-		u32 i, nalu_size = 0;
-		u8 *ptr = inBuffer;
-
-		if (!ctx->nalu_size_length) {
-			u32 size = gf_media_nalu_next_start_code(inBuffer, inBufferLength, &sc_size);
-			if (sc_size) {
-				ptr += size+sc_size;
-				inBufferLength-=size+sc_size;
+
+	sc_size = 0;
+	nalu_size = 0;
+	ptr = inBuffer;
+	if (!ctx->nalu_size_length) {
+		u32 size = gf_media_nalu_next_start_code(inBuffer, inBufferLength, &sc_size);
+		if (sc_size) {
+			ptr += size+sc_size;
+			inBufferLength-=size+sc_size;
+		}
+	}
+
+	while (inBufferLength) {
+
+		if (ctx->nalu_size_length) {
+			for (i=0; i<ctx->nalu_size_length; i++) {
+				nalu_size = (nalu_size<<8) + ptr[i];
 			}
-		}
-
-		while (inBufferLength) {
-
-			if (ctx->nalu_size_length) {
-				for (i=0; i<ctx->nalu_size_length; i++) {
-					nalu_size = (nalu_size<<8) + ptr[i];
+			ptr += ctx->nalu_size_length;
+		} else {
+			nalu_size = gf_media_nalu_next_start_code(ptr, inBufferLength, &sc_size);
+		}
+
+		//fprintf(stderr, "HEVC decode NAL type %d size %d\n", (ptr[0] & 0x7E) >> 1, nalu_size);
+
+		if (!ctx->state_found) {
+			u8 nal_type = (ptr[0] & 0x7E) >> 1;
+			switch (nal_type) {
+			case GF_HEVC_NALU_VID_PARAM:
+			case GF_HEVC_NALU_SEQ_PARAM:
+			case GF_HEVC_NALU_PIC_PARAM:
+				ctx->state_found = GF_TRUE;
+				break;
+			}
+		}
+
+		if (ctx->state_found) {
+			got_pic = libOpenHevcDecode(ctx->openHevcHandle, ptr, nalu_size, 0);
+			if (got_pic) {
+				nb_pics ++;
+				e = HEVC_flush_picture(ctx, outBuffer, outBufferLength);
+				if (e) {
+					if (e==GF_BUFFER_TOO_SMALL) {
+						if (ctx->nalu_size_length) {
+							ctx->restart_from = nalu_size + ctx->nalu_size_length;
+						} else {
+							ctx->restart_from = input_data_consumed + sc_size;
+						}
+					}
+					return e;
 				}
-				ptr += ctx->nalu_size_length;
-			} else {
-				nalu_size = gf_media_nalu_next_start_code(ptr, inBufferLength, &sc_size);
+				got_pic = 0;
 			}
-
-			if (!ctx->state_found) {
-				u8 nal_type = (ptr[0] & 0x7E) >> 1;
-				switch (nal_type) {
-				case GF_HEVC_NALU_VID_PARAM:
-				case GF_HEVC_NALU_SEQ_PARAM:
-				case GF_HEVC_NALU_PIC_PARAM:
-					ctx->state_found = GF_TRUE;
-					break;
-				}
-			}
-
-			if (ctx->state_found) {
-				if (!got_pic) {
-					got_pic = libOpenHevcDecode(openHevcHandle, ptr, nalu_size, 0);
-				} else {
-//					libOpenHevcDecode(ptr, nalu_size);
-//					printf("%d bytes left over from frame - nal type %d\n", nalu_size, (ptr[0] & 0x7E) >> 1 );
-				}
-			}
-
-			ptr += nalu_size;
-			if (ctx->nalu_size_length) {
-				if (inBufferLength < nalu_size + ctx->nalu_size_length) break;
-				inBufferLength -= nalu_size + ctx->nalu_size_length;
-			} else {
-				if (!sc_size || (inBufferLength < nalu_size + sc_size)) break;
-				inBufferLength -= nalu_size + sc_size;
-				ptr += sc_size;
-			}
-		}
-		if (got_pic==0) {
-			*outBufferLength = 0;
-			return GF_OK;
-		}
-	}
-
-	libOpenHevcGetPictureInfo(openHevcHandle, &openHevcFrame.frameInfo);
-
-    a_w      = openHevcFrame.frameInfo.nWidth;
-    a_h      = openHevcFrame.frameInfo.nHeight;
-    a_stride = openHevcFrame.frameInfo.nYPitch;
-
-    if ((ctx->width != a_w) || (ctx->height!=a_h) || (ctx->stride != a_stride)) {
-		ctx->width = a_w;
-		ctx->stride = a_stride;
-		ctx->height = a_h;
-		ctx->out_size = ctx->stride * a_w * 3 / 2;
-		ctx->had_pic = 1;
-		/*always force layer resize*/
-		*outBufferLength = ctx->out_size;
-		return GF_BUFFER_TOO_SMALL;
-	}
-
-    pY = outBuffer;
-    pU = outBuffer + ctx->stride * ctx->height;
-    pV = outBuffer + 5*ctx->stride * ctx->height/4;
-    openHevcFrame.pvY = (void*) pY;
-    openHevcFrame.pvU = (void*) pU;
-    openHevcFrame.pvV = (void*) pV;
-    *outBufferLength = 0;
-    if (libOpenHevcGetOutputCpy(openHevcHandle, 1, &openHevcFrame)) {
-        *outBufferLength = ctx->out_size;
-    }
+		}
+
+		ptr += nalu_size;
+		if (ctx->nalu_size_length) {
+			if (inBufferLength < nalu_size + ctx->nalu_size_length) break;
+			inBufferLength -= nalu_size + ctx->nalu_size_length;
+			input_data_consumed += nalu_size + ctx->nalu_size_length;
+		} else {
+			if (!sc_size || (inBufferLength < nalu_size + sc_size)) break;
+			inBufferLength -= nalu_size + sc_size;
+			ptr += sc_size;
+			input_data_consumed += sc_size;
+		}
+	}
+	if (!nb_pics && (got_pic==0)) {
+		*outBufferLength = 0;
+		return GF_OK;
+	}

 	return GF_OK;
 }
@@ -339,7 +378,8 @@

 static const char *HEVC_GetCodecName(GF_BaseDecoder *dec)
 {
-	return libOpenHevcVersion(openHevcHandle);
+	HEVCDec *ctx = (HEVCDec*) dec->privateStack;
+	return libOpenHevcVersion(ctx->openHevcHandle);
 }

 GF_BaseDecoder *NewHEVCDec()


re-org code in advancing tile

re-org code in advancing tile

git-svn-id: f2acecaac6fbd5a03f3d4799db58dda434111981@11234 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- psc_fsutil_libs/psc_util/journal.c
+++ psc_fsutil_libs/psc_util/journal.c
@@ -936,27 +936,23 @@
 	struct psc_journal_shdw_tile *pjst;
 	struct psc_journal_enthdr *pje;

- restart:
+	/*
+	 * If another thread is moving a tile, wait for it to complete.
+	 */
 	spinlock(&pjs->pjs_lock);
+	while (pjs->pjs_state & PJSHDW_ADVTILE) {
+		psc_waitq_wait(&pjs->pjs_waitq, &pjs->pjs_lock);
+		spinlock(&pjs->pjs_lock);
+	}
 	pjst = pjs->pjs_pjsts[pjs->pjs_curtile];
 	if (slot == (pjst->pjst_sjent + pjs->pjs_tilesize)) {
-		if (pjs->pjs_state & PJSHDW_ADVTILE) {
-			/* Another thread has already begun the tile advance
-			 *    procedures.  Wait for it to complete then
-			 *    retry.
-			 */
-			while (pjs->pjs_state & PJSHDW_ADVTILE) {
-				psc_waitq_wait(&pjs->pjs_waitq, &pjs->pjs_lock);
-				goto restart;
-			}
-		} else {
-			/* Tile advancementment is our job.  Note the pjs lock
-			 *    may be dropped if the next tile is still busy.
-			 */
-			pjs->pjs_state |= PJSHDW_ADVTILE;
-			pjournal_shdw_advtile_locked(pjs, block);
-		}
-	}
+		/* Tile advancementment is our job.  Note the pjs lock
+		 *    may be dropped if the next tile is still busy.
+		 */
+		pjs->pjs_state |= PJSHDW_ADVTILE;
+		pjournal_shdw_advtile_locked(pjs, block);
+	}
+	pjst = pjs->pjs_pjsts[pjs->pjs_curtile];
 	freelock(&pjs->pjs_lock);
 	/* No other states are allowed, this must be the active tile.
 	 * The big journal lock is being held so our slot # is the


start code in proctile()

start code in proctile()

git-svn-id: f2acecaac6fbd5a03f3d4799db58dda434111981@11290 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- psc_fsutil_libs/psc_util/journal.c
+++ psc_fsutil_libs/psc_util/journal.c
@@ -894,10 +894,16 @@
  *
  */
 void
-pjournal_shdw_proctile(struct psc_journal_shdw_tile *pjst)
-{
-	if (pjst->pjst_state)		/* bogus code for now */
-		return;
+pjournal_shdw_proctile(struct psc_journal_shdw_tile *pjst,
+		const struct psc_journal *pj)
+{
+	int				 i;
+	struct psc_journal_enthdr	*pje;
+	struct psc_journal_shdw		*pjs = pj->pj_shdw;
+
+	for (i = 0; i < pjs->pjs_tilesize; i++) {
+		pje = (struct psc_journal_enthdr *)((char *)pjst->pjst_base + PJ_PJESZ(pj) * i);
+	}
 }

 /**
@@ -921,6 +927,8 @@
 		pje = (struct psc_journal_enthdr *)((char *)pjst->pjst_base + PJ_PJESZ(pj) * i);
 		pje->pje_magic = PJE_MAGIC;
 		pje->pje_type = PJE_FORMAT;
+		pje->pje_xid = PJE_XID_NONE;
+		pje->pje_sid = PJE_XID_NONE;
 	}

 	pjst->pjst_tail = pjs->pjs_endslot;
@@ -1057,7 +1065,7 @@
 				continue;
 			}
 			freelock(&pjst->pjst_lock);
-			pjournal_shdw_proctile(pjst);
+			pjournal_shdw_proctile(pjst, pj);
 			pjournal_shdw_preptile(pjst, pj);
 		}
 		spinlock(&pjournal_tilewaitqlock);


stm32/hwtimer32: Clear status register after counter is set

Whenever a timer interrupt occurs, the status register is checked for
overflow and the overflow status is passed to process_timers(), which
increments clksrc_high. When setting the clock to a new time, we don't
want the previous overflow state to trigger this process.

To avoid this problem, just clear status register when new value is
assigned to counter. To avoid race between updating counter and clearing
status, operation is performed when counters are disabled.

BUG=b:200828093
BRANCH=none
TEST=make -j buildall

Signed-off-by: Patryk Duda <6aed17a362577cf10cb5675888c1635d522769c1@semihalf.com>
Change-Id: Ief65ac86fcf5c164f99855cc08c96c2ceddb29ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3347657
Reviewed-by: Tom Hughes <fc5c12f30a5ed2baa0581f44ee14ad1eb7b20d83@chromium.org>

--- chip/stm32/hwtimer32.c
+++ chip/stm32/hwtimer32.c
@@ -46,7 +46,20 @@

 void __hw_clock_source_set(uint32_t ts)
 {
+	/*
+	 * Stop counter to avoid race between setting counter value
+	 * and clearing status.
+	 */
+	STM32_TIM_CR1(TIM_CLOCK32) &= ~1;
+
+	/* Set counter value */
 	STM32_TIM32_CNT(TIM_CLOCK32) = ts;
+
+	/* Clear status */
+	STM32_TIM_SR(TIM_CLOCK32) = 0;
+
+	/* Start counting */
+	STM32_TIM_CR1(TIM_CLOCK32) |= 1;
 }

 static void __hw_clock_source_irq(void)


D3D; fix warnings

D3D; fix warnings

--- modules/video_output/msw/direct3d.c
+++ modules/video_output/msw/direct3d.c
@@ -484,7 +484,7 @@

     LPDIRECT3D9 (WINAPI *OurDirect3DCreate9)(UINT SDKVersion);
     OurDirect3DCreate9 =
-        (void *)GetProcAddress(sys->hd3d9_dll, TEXT("Direct3DCreate9"));
+        (void *)GetProcAddress(sys->hd3d9_dll, "Direct3DCreate9");
     if (!OurDirect3DCreate9) {
         msg_Err(vd, "Cannot locate reference to Direct3DCreate9 ABI in DLL");
         return VLC_EGENERIC;
@@ -609,9 +609,8 @@
     // If it is present, override default settings
     for (UINT Adapter=0; Adapter< IDirect3D9_GetAdapterCount(d3dobj); ++Adapter) {
         D3DADAPTER_IDENTIFIER9 Identifier;
-        HRESULT Res;
-        Res = IDirect3D9_GetAdapterIdentifier(d3dobj,Adapter,0,&Identifier);
-        if (strstr(Identifier.Description,"PerfHUD") != 0) {
+        HRESULT Res = IDirect3D9_GetAdapterIdentifier(d3dobj,Adapter,0,&Identifier);
+        if (SUCCEEDED(Res) && strstr(Identifier.Description,"PerfHUD") != 0) {
             AdapterToUse = Adapter;
             DeviceType = D3DDEVTYPE_REF;
             break;


release pages

release pages

--- src/kernel/mmu.c
+++ src/kernel/mmu.c
@@ -67,6 +67,16 @@
   mapping->page_head = page;
 }

+static void release_pages(struct mapping *mapping) {
+  struct page *page = mapping->page_head, *next;
+
+  while (page) {
+    next = page->next;
+    buddy_free(page);
+    page = next;
+  }
+}
+
 static uint32_t *mmu_create_pl1(struct mapping *mapping) {
   struct page *page = buddy_alloc(L1_SIZE);
   add_page(mapping, page);
@@ -208,9 +218,9 @@
   }

   mmu_set_ttb(0);
-  // TODO: release allocated memory

   list_remove(&mapping->next);
+  release_pages(mapping);
   slab_cache_free(mapping_cache, mapping);

   return 0;


Change time_t to int

Change time_t to int

--- src/kopsik_api.h
+++ src/kopsik_api.h
@@ -131,8 +131,8 @@
   char *GUID;
   int Billable;
   char *Tags;
-  time_t Started;
-  time_t Ended;
+  int Started;
+  int Ended;
 } KopsikTimeEntryViewItem;

 typedef struct {


[tests] Handle properties returned from AdgAlignment properly

By convention, g_object_get() of a GObject based library must return a
copy (or a referenced instance) of the requested property.

--- adg/tests/test-alignment.c
+++ adg/tests/test-alignment.c
@@ -27,6 +27,7 @@
     AdgAlignment *alignment;
     AdgPair null_factor, identity_factor;
     const AdgPair *factor;
+    AdgPair *factor_dup;

     alignment = adg_alignment_new(NULL);
     null_factor.x = 0;
@@ -53,16 +54,19 @@

     /* Using GObject property methods */
     g_object_set(alignment, "factor", &identity_factor, NULL);
-    g_object_get(alignment, "factor", &factor, NULL);
-    g_assert(adg_pair_equal(factor, &identity_factor));
+    g_object_get(alignment, "factor", &factor_dup, NULL);
+    g_assert(adg_pair_equal(factor_dup, &identity_factor));
+    g_free(factor_dup);

     g_object_set(alignment, "factor", NULL, NULL);
-    g_object_get(alignment, "factor", &factor, NULL);
-    g_assert(adg_pair_equal(factor, &identity_factor));
+    g_object_get(alignment, "factor", &factor_dup, NULL);
+    g_assert(adg_pair_equal(factor_dup, &identity_factor));
+    g_free(factor_dup);

     g_object_set(alignment, "factor", &null_factor, NULL);
-    g_object_get(alignment, "factor", &factor, NULL);
-    g_assert(adg_pair_equal(factor, &null_factor));
+    g_object_get(alignment, "factor", &factor_dup, NULL);
+    g_assert(adg_pair_equal(factor_dup, &null_factor));
+    g_free(factor_dup);

     g_object_unref(alignment);
 }


OOPS!

OOPS!

--- mudlib/mud/home/System/lwo/logbuf.c
+++ mudlib/mud/home/System/lwo/logbuf.c
@@ -44,6 +44,8 @@

 		deque->push_back(tail);
 		tail = text;
+	} else {
+		tail += text;
 	}
 }


Version 0.26

Version 0.26

--- mudlib/mud/include/kotaka/version.h
+++ mudlib/mud/include/kotaka/version.h
@@ -1 +1 @@
-#define KOTAKA_VERSION "0.25"
+#define KOTAKA_VERSION "0.26"


Removed unused code

Removed unused code

--- DataStructures/SimpleIntervalTree.h
+++ DataStructures/SimpleIntervalTree.h
@@ -9,26 +9,6 @@

 namespace data_structures {
 namespace interval_trees {
-
-// If you inherit from this type you claim that your function is commutative.
-struct CommutativeDataBase {};
-
-// Inherit from this type:
-//  struct D: public CommutativeDataHelper<D> {
-//     void Add(const D&) {
-//       ..
-//     }
-//  };
-template<class T>
-struct CommutativeDataHelper : CommutativeDataBase {
-	void AddFront(const T& value) {
-		static_cast<T*>(this)->Add(value);
-	}
-	void AddBack(const T& value) {
-		static_cast<T*>(this)->Add(value);
-	}
-};
-

 // Data should implement the following methods:
 //   1) Copy constructor / operator=
@@ -79,7 +59,6 @@
 			Recompute(offset);
 		}
 	}
-

 	void AddAt(size_t offset, const Data& data, bool add_front=false) {
 		assert(offset < size_);


Fix a compilation error
  friend TClass
must be
  friend class TClass;

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

--- cont/inc/TVirtualCollectionProxy.h
+++ cont/inc/TVirtualCollectionProxy.h
@@ -1,4 +1,4 @@
-// @(#)root/cont:$Name:  $:$Id: TVirtualCollectionProxy.h,v 1.3 2004/08/20 21:02:10 brun Exp $
+// @(#)root/cont:$Name:  $:$Id: TVirtualCollectionProxy.h,v 1.4 2004/10/07 17:08:53 brun Exp $
 // Author: Philippe Canal 20/08/2003

 /*************************************************************************
@@ -31,7 +31,7 @@
 protected:
    TClass *fClass;
    virtual void SetValueClass(TClass *newcl) = 0;
-   friend TClass;
+   friend class TClass;

 public:
    TVirtualCollectionProxy() : fClass(0) {};


Update tests

Update tests

--- tests/check_signon.c
+++ tests/check_signon.c
@@ -518,7 +518,7 @@
     }

     gchar *objectPath;
-    com_nokia_SingleSignOn_AuthService_register_new_identity (proxy, &objectPath, &error);
+    SSO_AuthService_register_new_identity (proxy, &objectPath, &error);

     if (error)
     {
@@ -534,18 +534,18 @@
                                        objectPath,
                                        "com.nokia.SingleSignOn.Identity");

-    com_nokia_SingleSignOn_Identity_store_credentials (proxy,
-                                                             0,
-                                                             "James Bond",
-                                                             "007",
-                                                             1,
-                                                             methods,
-                                                             "caption",
-                                                             NULL,
-                                                             NULL,
-                                                             0,
-                                                             &id,
-                                                             &error);
+    SSO_Identity_store_credentials (proxy,
+                                    0,
+                                    "James Bond",
+                                    "007",
+                                    1,
+                                    methods,
+                                    "caption",
+                                    NULL,
+                                    NULL,
+                                    0,
+                                    &id,
+                                    &error);

     g_hash_table_destroy (methods);


update test cases

update test cases

--- tests/core/test_08.c
+++ tests/core/test_08.c
@@ -85,7 +85,7 @@

     xo_emit("\n\n");

-    xo_open_container("data");
+    xo_open_container("data2");
     xo_open_container("contents");

     xo_emit("{T:Item/%-10s}{T:Count/%12s}\n");
@@ -97,11 +97,11 @@
 		ip->i_title, ip->i_count);
     }

-    xo_close_container("data");
+    xo_close_container("data2");

     xo_emit("\n\n");

-    xo_open_container("data");
+    xo_open_container("data3");
     xo_open_marker("m1");
     xo_open_container("contents");

@@ -114,15 +114,15 @@
 		ip->i_title, ip->i_count);
     }

-    xo_close_container("data");	/* Should be a noop */
+    xo_close_container("data3");	/* Should be a noop */
     xo_emit("{:test}", "one");

     xo_close_marker("m1");
-    xo_close_container("data");	/* Should be a noop */
+    xo_close_container("data3");	/* Should be a noop */

     xo_emit("\n\n");

-    xo_open_container("data");
+    xo_open_container("data4");
     xo_open_marker("m1");
     xo_open_container("contents");

@@ -138,13 +138,13 @@
 	for (i = 0; i < 3; i++) {
 	    xo_open_instance("sub");
 	    xo_emit("{Lwc:/Name}{:name/%d} + 1 = {:next/%d}\n", i, i + 1);
-	    xo_close_container("data");
+	    xo_close_container("data4");
 	}
 	xo_close_marker("m2");
 	xo_emit("{Lwc:/Last}{:last/%d}\n", i);
     }

-    xo_close_container("data");	/* Should be a noop */
+    xo_close_container("data4");	/* Should be a noop */
     xo_emit("{:test}", "one");

     xo_emit("\n\n");


Fix critical conversion bug that results in nil timeouts

%d was improperly converting doubles into 0s

--- SocketIO/Source/socket.io.js.h
+++ SocketIO/Source/socket.io.js.h
@@ -31,8 +31,8 @@
         hostURL,
         reconnection? @"true" : @"false",
         (attemptLimit == -1)? @"Infinity" : @(attemptLimit),
-        reconnectionDelay * MSEC_PER_SEC,
-        reconnectionDelayMax * MSEC_PER_SEC,
-        timeout * MSEC_PER_SEC
+        (int)(reconnectionDelay * MSEC_PER_SEC),
+        (int)(reconnectionDelayMax * MSEC_PER_SEC),
+        (int)(timeout * MSEC_PER_SEC)
     ];
 }


Linux: Consume all events on a fd in one go

* This fixes libusb_handle_events_timeout() only handling one event
* Fixes #123

Conflicts:
	libusb/version_nano.h

--- libusb/os/linux_usbfs.c
+++ libusb/os/linux_usbfs.c
@@ -2524,7 +2524,9 @@
 			continue;
 		}

-		r = reap_for_handle(handle);
+		do {
+			r = reap_for_handle(handle);
+		} while (r == 0);
 		if (r == 1 || r == LIBUSB_ERROR_NO_DEVICE)
 			continue;
 		else if (r < 0)


Linux: improve reporting of URB error status codes

Fix the way overflow errors are handled (they can occur in any
transaction, not just the last one in a transfer) and add tests
for other commonly-occuring error statuses.

--- libusb/os/linux_usbfs.c
+++ libusb/os/linux_usbfs.c
@@ -1867,12 +1867,21 @@
 			(urb->status == -EOVERFLOW && urb->actual_length > 0))
 		itransfer->transferred += urb->actual_length;

-
+	/* Many of these errors can occur on *any* urb of a multi-urb
+	 * transfer.  When they do, we tear down the rest of the transfer.
+	 */
 	switch (urb->status) {
 	case 0:
 		break;
 	case -EREMOTEIO: /* short transfer */
 		break;
+	case -ENOENT: /* cancelled */
+	case -ECONNRESET:
+		break;
+	case -ESHUTDOWN:
+		usbi_dbg("device removed");
+		tpriv->reap_status = LIBUSB_TRANSFER_NO_DEVICE;
+		goto cancel_remaining;
 	case -EPIPE:
 		usbi_dbg("detected endpoint stall");
 		if (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)
@@ -1887,18 +1896,13 @@
 	case -ETIME:
 	case -EPROTO:
 	case -EILSEQ:
-		/* These can happen on *any* urb of a multi-urb transfer, so
-		 * save a status and tear down rest of the transfer */
 		usbi_dbg("low level error %d", urb->status);
 		tpriv->reap_action = ERROR;
-		if (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)
-			tpriv->reap_status = LIBUSB_TRANSFER_ERROR;
 		goto cancel_remaining;
 	default:
 		usbi_warn(ITRANSFER_CTX(itransfer),
 			"unrecognised urb status %d", urb->status);
-		if (tpriv->reap_status == LIBUSB_TRANSFER_COMPLETED)
-			tpriv->reap_status = LIBUSB_TRANSFER_ERROR;
+		tpriv->reap_action = ERROR;
 		goto cancel_remaining;
 	}

@@ -1916,6 +1920,9 @@
 		goto out_unlock;

 cancel_remaining:
+	if (ERROR == tpriv->reap_action && LIBUSB_TRANSFER_COMPLETED == tpriv->reap_status)
+		tpriv->reap_status = LIBUSB_TRANSFER_ERROR;
+
 	if (tpriv->num_retired == tpriv->num_urbs) /* nothing to cancel */
 		goto completed;

@@ -1954,6 +1961,7 @@
 	int num_urbs = tpriv->num_urbs;
 	int urb_idx = 0;
 	int i;
+	enum libusb_transfer_status status = LIBUSB_TRANSFER_COMPLETED;

 	usbi_mutex_lock(&itransfer->lock);
 	for (i = 0; i < num_urbs; i++) {
@@ -1987,6 +1995,9 @@

 	if (tpriv->reap_action != NORMAL) { /* cancelled or submit_fail */
 		usbi_dbg("CANCEL: urb status %d", urb->status);
+
+		if (status == LIBUSB_TRANSFER_COMPLETED)
+			status = LIBUSB_TRANSFER_ERROR;

 		if (tpriv->num_retired == num_urbs) {
 			usbi_dbg("CANCEL: last URB handled, reporting");
@@ -2006,6 +2017,12 @@
 	switch (urb->status) {
 	case 0:
 		break;
+	case -ENOENT: /* cancelled */
+		break;
+	case -ESHUTDOWN:
+		usbi_dbg("device removed");
+		status = LIBUSB_TRANSFER_NO_DEVICE;
+		break;
 	case -ETIME:
 	case -EPROTO:
 	case -EILSEQ:
@@ -2023,7 +2040,7 @@
 		usbi_dbg("last URB in transfer --> complete!");
 		free_iso_urbs(tpriv);
 		usbi_mutex_unlock(&itransfer->lock);
-		return usbi_handle_transfer_completion(itransfer, LIBUSB_TRANSFER_COMPLETED);
+		return usbi_handle_transfer_completion(itransfer, status);
 	}

 out:
@@ -2057,6 +2074,12 @@
 	case 0:
 		itransfer->transferred = urb->actual_length;
 		status = LIBUSB_TRANSFER_COMPLETED;
+		break;
+	case -ENOENT: /* cancelled */
+		break;
+	case -ESHUTDOWN:
+		usbi_dbg("device removed");
+		status = LIBUSB_TRANSFER_NO_DEVICE;
 		break;
 	case -EPIPE:
 		usbi_dbg("unsupported control request");


gl-renderer: Always setup gl-renderer

gl-renderer: Always setup gl-renderer

Currently, the gl-renderer setup is being done on per-output
basis. This isn't desirable when trying to make weston run
with zero outputs.

When there are no outputs present, there is no surface available
to attach an EGLContext to with eglMakeCurrent, which makes
any EGL command fail.

The problem is solved by using EGL_KHR_surfaceless_context to
bind an EGLContext to EGL_NO_SURFACE, or if that is
unavailable, creating a dummy PbufferSurface and binding an
EGLContext to it, so EGL gets set up properly.

v2:

- Move PbufferSurface creation into its own function
- Introduce a new EGLConfig with EGL_PBUFFER_BIT set
  and use it to create a PbufferSurface
- Make PbufferSurface attributes definition static
- Check for return of gl_renderer_setup and terminate
  in case it fails
- Remove redundant gl_renderer_setup call from
  gl_renderer_output_create
- Only destroy the dummy surface if it is valid

This patch causes a warning from Mesa when using the i965 driver:
libEGL warning: FIXME: egl/x11 doesn't support front buffer rendering.
A bug has been filed about it since it seems to be spurious:
https://bugs.freedesktop.org/show_bug.cgi?id=96694

Signed-off-by: Armin Krezović <31ec4b88003c779f400d1506dcff569d5faae2fb@gmail.com>
[Pekka: filed a Mesa bug and added the note in commit msg]
Reviewed-by: Pekka Paalanen <0f6ae7001e34c37b02fb2c1c2573ddf8f442136a@collabora.co.uk>

--- libweston/gl-renderer.c
+++ libweston/gl-renderer.c
@@ -175,6 +175,8 @@
 	EGLContext egl_context;
 	EGLConfig egl_config;

+	EGLSurface dummy_surface;
+
 	struct wl_array vertices;
 	struct wl_array vtxcnt;

@@ -200,6 +202,8 @@
 	int has_egl_buffer_age;

 	int has_configless_context;
+
+	int has_surfaceless_context;

 	int has_dmabuf_import;
 	struct wl_list dmabuf_images;
@@ -2597,12 +2601,6 @@
 		return -1;
 	}

-	if (gr->egl_context == NULL)
-		if (gl_renderer_setup(ec, go->egl_surface) < 0) {
-			free(go);
-			return -1;
-		}
-
 	for (i = 0; i < BUFFER_DAMAGE_COUNT; i++)
 		pixman_region32_init(&go->buffer_damage[i]);

@@ -2653,6 +2651,9 @@

 	wl_list_for_each_safe(image, next, &gr->dmabuf_images, link)
 		dmabuf_image_destroy(image);
+
+	if (gr->dummy_surface != EGL_NO_SURFACE)
+		eglDestroySurface(gr->egl_display, gr->dummy_surface);

 	eglTerminate(gr->egl_display);
 	eglReleaseThread();
@@ -2764,6 +2765,9 @@
 	if (check_extension(extensions, "EGL_MESA_configless_context"))
 		gr->has_configless_context = 1;
 #endif
+
+	if (check_extension(extensions, "EGL_KHR_surfaceless_context"))
+		gr->has_surfaceless_context = 1;

 #ifdef EGL_EXT_image_dma_buf_import
 	if (check_extension(extensions, "EGL_EXT_image_dma_buf_import"))
@@ -2794,6 +2798,7 @@
 	EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
 	EGL_NONE
 };
+

 /** Checks whether a platform EGL client extension is supported
  *
@@ -2873,6 +2878,43 @@
 }

 static int
+gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) {
+	EGLConfig pbuffer_config;
+
+	static const EGLint pbuffer_config_attribs[] = {
+		EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
+		EGL_RED_SIZE, 1,
+		EGL_GREEN_SIZE, 1,
+		EGL_BLUE_SIZE, 1,
+		EGL_ALPHA_SIZE, 0,
+		EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+		EGL_NONE
+	};
+
+	static const EGLint pbuffer_attribs[] = {
+		EGL_WIDTH, 10,
+		EGL_HEIGHT, 10,
+		EGL_NONE
+	};
+
+	if (egl_choose_config(gr, pbuffer_config_attribs, NULL, 0, &pbuffer_config) < 0) {
+		weston_log("failed to choose EGL config for PbufferSurface");
+		return -1;
+	}
+
+	gr->dummy_surface = eglCreatePbufferSurface(gr->egl_display,
+						    pbuffer_config,
+						    pbuffer_attribs);
+
+	if (gr->dummy_surface == EGL_NO_SURFACE) {
+		weston_log("failed to create PbufferSurface\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+static int
 gl_renderer_create(struct weston_compositor *ec, EGLenum platform,
 	void *native_window, const EGLint *attribs,
 	const EGLint *visual_id, int n_ids)
@@ -2956,9 +2998,26 @@
 	if (gr->has_dmabuf_import)
 		gr->base.import_dmabuf = gl_renderer_import_dmabuf;

+	if (gr->has_surfaceless_context) {
+		weston_log("EGL_KHR_surfaceless_context available\n");
+		gr->dummy_surface = EGL_NO_SURFACE;
+	} else {
+		weston_log("EGL_KHR_surfaceless_context unavailable. "
+			   "Trying PbufferSurface\n");
+
+		if (gl_renderer_create_pbuffer_surface(gr) < 0)
+			goto fail_with_error;
+	}
+
 	wl_display_add_shm_format(ec->wl_display, WL_SHM_FORMAT_RGB565);

 	wl_signal_init(&gr->destroy_signal);
+
+	if (gl_renderer_setup(ec, gr->dummy_surface) < 0) {
+		if (gr->dummy_surface != EGL_NO_SURFACE)
+			eglDestroySurface(gr->egl_display, gr->dummy_surface);
+		goto fail_with_error;
+	}

 	return 0;


Clean up PyString_Size().

Clean up PyString_Size().

Removed string_getsize(), since it was only useful when
PyString_AsStringAndSize was able to convert an (ascii)
Unicode object to a C string.

--- Objects/stringobject.c
+++ Objects/stringobject.c
@@ -494,33 +494,26 @@
 /* -------------------------------------------------------------------- */
 /* object api */

-static Py_ssize_t
-string_getsize(register PyObject *op)
-{
-	char *s;
-	Py_ssize_t len;
-	if (PyString_AsStringAndSize(op, &s, &len))
-		return -1;
-	return len;
-}
-
 Py_ssize_t
 PyString_Size(register PyObject *op)
-{
-	if (!PyString_Check(op))
-		return string_getsize(op);
-	return Py_SIZE(op);
-}
-
-/*const*/ char *
-PyString_AsString(register PyObject *op)
 {
 	if (!PyString_Check(op)) {
 		PyErr_Format(PyExc_TypeError,
 		     "expected bytes, %.200s found", Py_TYPE(op)->tp_name);
-		return NULL;
-	}
-	return ((PyStringObject *)op) -> ob_sval;
+		return -1;
+	}
+	return Py_SIZE(op);
+}
+
+char *
+PyString_AsString(register PyObject *op)
+{
+	if (!PyString_Check(op)) {
+		PyErr_Format(PyExc_TypeError,
+		     "expected bytes, %.200s found", Py_TYPE(op)->tp_name);
+		return NULL;
+	}
+	return ((PyStringObject *)op)->ob_sval;
 }

 int


Added regex check for atm to bank message

--- validate.h
+++ validate.h
@@ -19,6 +19,7 @@
 bool IsValidATMCommand(std::string command) {
     std::vector<boost::regex> Allowed =
                 {boost::regex("^login\\s{1}(alice|bob|eve)$"),
+                 boost::regex("^login\\s{1}(912343|396175|431253)$"),
                  boost::regex("^balance$"),
                  boost::regex("^withdraw\\s{1}\\d{1,19}$"),
                  boost::regex("^transfer\\s{1}\\d{1,19}\\s{1}(alice|bob|eve)$"),


<krb.h>

<krb.h>

git-svn-id: 193148810cf65385f3a195dbc9a8b504846da3a2@4669 ec53bebd-3082-4978-b11e-865c3cabbd6b


ia64: fix compilation warnings introduced by commit v4.7-174-g44f0ed1

* linux/ia64/syscallent.h: Undefine sys_oldlstat, sys_lstat and
sys_lstat64 before redefining them to printargs.

Reported-by: Mike Frysinger <8f3f75c74bd5184edcfa6534cab3c13a00a2f794@gentoo.org>

--- linux/ia64/syscallent.h
+++ linux/ia64/syscallent.h
@@ -70,6 +70,7 @@
 #define sys_getgroups		printargs
 #define sys_setgroups		printargs
 #define sys_select		printargs
+#undef sys_oldlstat
 #define sys_oldlstat		printargs
 #define sys_readdir		printargs
 #define sys_profil		printargs
@@ -79,6 +80,7 @@
 #define sys_setitimer		printargs
 #define sys_getitimer		printargs
 #define sys_stat		printargs
+#undef sys_lstat
 #define sys_lstat		printargs
 #define sys_fstat		printargs
 #define sys_olduname		printargs
@@ -122,6 +124,7 @@
 #define sys_truncate64		printargs
 #define sys_ftruncate64		printargs
 #define sys_stat64		printargs
+#undef sys_lstat64
 #define sys_lstat64		printargs
 #define sys_fstat64		printargs
 #define sys_fcntl64		printargs


Do not wrap methods using double[].

Do not wrap methods using double[].

--- OpenSim/Common/Scale.h
+++ OpenSim/Common/Scale.h
@@ -96,15 +96,17 @@

     void getScaleFactors(SimTK::Vec3& aScaleFactors) const;
     SimTK::Vec3& getScaleFactors() { return _scaleFactors; }
+#ifndef SWIG
     void getScaleFactors(double rScaleFactors[]){   // A variant that uses basic types for use by GUI
         getScaleFactors(SimTK::Vec3::updAs(rScaleFactors));
     }
-
+#endif
     void setScaleFactors(const SimTK::Vec3& aScaleFactors);
+#ifndef SWIG
     void setScaleFactors(const double aScaleFactors[]){ // A variant that uses basic types for use by GUI
         setScaleFactors(SimTK::Vec3::getAs(aScaleFactors));
     }
-
+#endif
     bool getApply(void) const { return _apply; }
     void setApply(bool state) { _apply = state; }
 };


+vaVdpVideoMixerCreate, +vaVdpVideoMixerDestroy

--- vdpau-va.c
+++ vdpau-va.c
@@ -56,6 +56,11 @@
     uint32_t        height;
 } VdpBitmapSurfaceData;

+typedef struct {
+    HandleType      type;
+    VdpDeviceData  *device;
+} VdpVideoMixerData;
+
 // ===============

 static
@@ -393,9 +398,19 @@
                       VdpVideoMixerParameter const *parameters,
                       void const *const *parameter_values, VdpVideoMixer *mixer)
 {
-    traceVdpVideoMixerCreate("{zilch}", device, feature_count, features, parameter_count, parameters,
+    traceVdpVideoMixerCreate("{part}", device, feature_count, features, parameter_count, parameters,
         parameter_values, mixer);
-    return VDP_STATUS_NO_IMPLEMENTATION;
+    VdpDeviceData *deviceData = handlestorage_get(device, HANDLETYPE_DEVICE);
+    if (NULL == deviceData) return VDP_STATUS_INVALID_HANDLE;
+
+    // TODO: handle parameters and features
+    VdpVideoMixerData *data = calloc(1, sizeof(VdpVideoMixerData));
+    data->type = HANDLETYPE_VIDEO_MIXER;
+    data->device = deviceData;
+
+    *mixer = handlestorage_add(data);
+
+    return VDP_STATUS_OK;
 }

 static
@@ -464,8 +479,14 @@
 VdpStatus
 vaVdpVideoMixerDestroy(VdpVideoMixer mixer)
 {
-    traceVdpVideoMixerDestroy("{zilch}", mixer);
-    return VDP_STATUS_NO_IMPLEMENTATION;
+    traceVdpVideoMixerDestroy("{full}", mixer);
+    VdpVideoMixerData *mixerData = handlestorage_get(mixer, HANDLETYPE_VIDEO_MIXER);
+    if (NULL == mixerData) return VDP_STATUS_INVALID_HANDLE;
+
+    handlestorage_expunge(mixer);
+    free(mixerData);
+
+    return VDP_STATUS_OK;
 }

 static


libjpeg bugfix: incorrect right side clearing

--- c/src/image-libjpeg.c
+++ c/src/image-libjpeg.c
@@ -75,7 +75,7 @@

                     xleft--;
                     if ( xleft == 0 && in_x < IMAGE_SLICE_SIZE-1 ) {
-                        memset(this + (in_x*4+1), 0, (IMAGE_SLICE_SIZE-in_x)*4);
+                        memset(this + (in_x+1)*4, 0, (IMAGE_SLICE_SIZE-in_x-1)*4);
                         break;
                     }
                 }
@@ -84,6 +84,7 @@
         }
     }

+    // TODO: are we clearing the first row after the image correctly?
     int clear_rows = i->s_h*IMAGE_SLICE_SIZE - y;
     int start_clear_row = IMAGE_SLICE_SIZE - clear_rows;
     int clear_bytes = clear_rows * IMAGE_SLICE_SIZE*4;


added clearing of ability structure

added clearing of ability structure

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@3625 67ed7778-7388-44ab-90cf-0a291f65f57c

--- camlibs/ptp/library.c
+++ camlibs/ptp/library.c
@@ -305,6 +305,7 @@
 	CameraAbilities a;

 	for (i = 0; models[i].model; i++) {
+		memset(&a,0, sizeof(a));
 		strcpy (a.model, models[i].model);
 		a.status = GP_DRIVER_STATUS_EXPERIMENTAL;
 		a.port   = GP_PORT_USB;
@@ -318,6 +319,7 @@
 		CR (gp_abilities_list_append (list, a));
 	}

+	memset(&a,0, sizeof(a));
 	strcpy(a.model, "USB PTP Class Camera");
 	a.status = GP_DRIVER_STATUS_EXPERIMENTAL;
 	a.port   = GP_PORT_USB;


added some more values for Canons

added some more values for Canons

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@10740 67ed7778-7388-44ab-90cf-0a291f65f57c


Fix DS_SUBMODULES array declaration

Fix DS_SUBMODULES array declaration

--- utils/oscap-ds.c
+++ utils/oscap-ds.c
@@ -40,7 +40,9 @@
 #include "oscap-tool.h"
 #include <oscap_debug.h>

-static struct oscap_module* DS_SUBMODULES[];
+#define DS_SUBMODULES_NUM 8 /* See actual DS_SUBMODULES array
+				initialization below. */
+static struct oscap_module* DS_SUBMODULES[DS_SUBMODULES_NUM];
 bool getopt_ds(int argc, char **argv, struct oscap_action *action);
 int app_ds_sds_split(const struct oscap_action *action);
 int app_ds_sds_compose(const struct oscap_action *action);
@@ -143,7 +145,7 @@
 	.func = app_ds_rds_validate
 };

-static struct oscap_module* DS_SUBMODULES[] = {
+static struct oscap_module* DS_SUBMODULES[DS_SUBMODULES_NUM] = {
 	&DS_SDS_SPLIT_MODULE,
 	&DS_SDS_COMPOSE_MODULE,
 	&DS_SDS_ADD_MODULE,


Revive the compilability of the Libbraille braille driver. (dm)

--- Drivers/Braille/Libbraille/braille.c
+++ Drivers/Braille/Libbraille/braille.c
@@ -128,9 +128,9 @@
         }
       braille_write(bytes, brl->textColumns);

-      if(brl->cursor >= 0)
+      if(brl->cursor != BRL_NO_CURSOR)
         {
-          braille_filter(translateOutputCell(getCursorDots()), brl->cursor);
+          braille_filter(translateOutputCell(getScreenCursorDots()), brl->cursor);
         }

       braille_render();


Added a sample documentation plate for Entity components.

--- EntityComponents/EC_Light/EC_Light.h
+++ EntityComponents/EC_Light/EC_Light.h
@@ -17,7 +17,62 @@
     class Light;
 }

+/**

+

+

+
+
Light

+Makes the entity a light source.
+
+Registered by RexLogic::RexLogicModule.
+
+Attributes:
+

+
Vector3df: direction.
+
Specifies the direction vector the light is shining at.

+
enum: light type.
+
One of the values "Point", "Spot" or "Directional".

+
Color: diffuse color.
+
Specifies the color the light casts.

+
Color: specular color.
+
Specifies the color of the reflections the light casts.

+
bool: cast shadows.
+
If true, this light casts dynamically calculated shadows on the scene.

+
float: light range.
+
Specifies how far in world space units the light reaches.

+
float: constant attenuation.
+
Specifies the constant term of the light attenuation equation.

+
float: linear attenuation.
+
Specifies the linear term of the light attenuation equation.

+
float: quadratic attenuation.
+
Specifies the quadratic term of the light attenuation equation.

+
float: light inner angle.
+
Specifies inner umbra angle of the light. Only applicable for spotlights.

+
float: light outer angle.
+
Specifies outer penumbra angle of the light. Only applicable for spotlights.

+

+
+Exposes the following scriptable functions:
+

+
...
+

+
+Reacts on the following actions:
+

+
"hide": Disables the light from affecting the scene.
+
"show": Enables the light in the scene.
+
"toggleVisibility": Toggles between the enabled and disabled states.
+

+
+

+
+Does not emit any actions.
+
+Depends on the component OgrePlaceable. The position in the OgrePlaceable component specifies the position in the world space where this light is placed at.
+

+
+*/
 class EC_Light : public Foundation::ComponentInterface
 {
     DECLARE_EC(EC_Light);


get rid of the userspace flag so that we're not treated like an insecure
liblustre client

git-svn-id: f2acecaac6fbd5a03f3d4799db58dda434111981@6999 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- lnet-lite/lnet/api-ni.c
+++ lnet-lite/lnet/api-ni.c
@@ -699,8 +699,11 @@
         } else {/* client case (liblustre) */

                 /* My PID must be unique on this node and flag I'm userspace */
-                the_lnet.ln_pid = getpid() | LNET_PID_USERFLAG;
-        }
+                //the_lnet.ln_pid = getpid() | LNET_PID_USERFLAG;
+                the_lnet.ln_pid = getpid();
+        }
+
+        CERROR("my pid=%u\n", the_lnet.ln_pid);
 #endif

         rc = lnet_descriptor_setup();


Ruby 1.9.2 compatibility: STR2CSTR is deprecated. Use Str2cstr instead.

--- ext/lda-ruby/lda-inference.c
+++ ext/lda-ruby/lda-inference.c
@@ -778,7 +778,7 @@
 	if (!corpus_loaded)
 		return Qnil;

-	run_quiet_em(STR2CSTR(start), last_corpus);
+	run_quiet_em(StringValuePtr(start), last_corpus);

 	return Qnil;
 }
@@ -788,7 +788,7 @@
  * Load settings from the given file.
  */
 static VALUE wrap_load_settings(VALUE self, VALUE settings_file) {
-	read_settings(STR2CSTR(settings_file));
+	read_settings(StringValuePtr(settings_file));

 	return Qtrue;
 }
@@ -800,7 +800,7 @@
  */
 static VALUE wrap_load_corpus(VALUE self, VALUE filename) {
 	if (!corpus_loaded) {
-		last_corpus = read_data(STR2CSTR(filename));
+		last_corpus = read_data(StringValuePtr(filename));
 		corpus_loaded = TRUE;
 		return Qtrue;
 	} else {


update to finalized murmur3

update to finalized murmur3

--- ext/libmurmur3/MurmurHash3.c
+++ ext/libmurmur3/MurmurHash3.c
@@ -1,58 +1,94 @@
+/*-----------------------------------------------------------------------------
+// MurmurHash3 was written by Austin Appleby, and is placed in the public
+// domain. The author hereby disclaims copyright to this source code. */
+
 #include "MurmurHash3.h"

 /* Note - The x86 and x64 versions do _not_ produce the same results, as the
 // algorithms are optimized for their respective platforms. You can still
 // compile and run any of them on any platform, but your performance with the
 // non-native version will be less than optimal.
-
 //-----------------------------------------------------------------------------
 // Block read - if your platform needs to do endian-swapping or can only
-// handle aligned reads, do the conversion here */
+// handle aligned reads, do the conversion here */

 FORCE_INLINE uint32_t getblock ( const uint32_t * p, int i ){ return p[i]; }
-
-/*----------*/
-
-FORCE_INLINE void bmix32(uint32_t * h1, uint32_t * k1, uint32_t * c1, uint32_t * c2 )
-{
-  *c1 = *c1*5+0x7b7d159c;
-  *c2 = *c2*5+0x6bce6396;
-
-  *k1 = *k1 * *c1;
-  *k1 = ROTL32(*k1,11);
-  *k1 = *k1 * *c2;
-
-  *h1 = ROTL32(*h1,13);
-  *h1 = *h1*5+0x52dce729;
-  *h1 ^= *k1;
-}
-
-/*----------*/
-
-void MurmurHash3_x86_32 ( const void * key, int len,
-                          uint32_t seed, void * out )
+FORCE_INLINE uint64_t getblock_64 ( const uint64_t * p, int i ){ return p[i]; }
+
+/*-----------------------------------------------------------------------------
+// Block mix - mix the key block, combine with hash block, mix the hash block,
+// repeat. */
+
+FORCE_INLINE void bmix ( uint32_t * h1, uint32_t * k1, uint32_t * c1, uint32_t * c2 )
+{
+  *k1 *= *c1; *k1 = ROTL32(*k1,15); *k1 *= *c2; *h1 ^= *k1;
+  *h1 = ROTL32(*h1,13); *h1 = *h1*5+0xe6546b64;
+}
+
+FORCE_INLINE void bmix_64 ( uint64_t * h1, uint64_t * h2, uint64_t * k1, uint64_t * k2, uint64_t * c1, uint64_t * c2 )
+{
+  *k1 *= *c1; *k1  = ROTL64(*k1,31); *k1 *= *c2; *h1 ^= *k1;
+  *h1 = ROTL64(*h1,27); *h1 += *h2; *h1 = *h1*5+0x52dce729;
+  *k2 *= *c2; *k2  = ROTL64(*k2,33); *k2 *= *c1; *h2 ^= *k2;
+  *h2 = ROTL64(*h2,31); *h2 += *h1; *h2 = *h2*5+0x38495ab5;
+}
+
+FORCE_INLINE void bmix12 ( uint32_t * h1, uint32_t * h2,
+                           uint32_t * h3, uint32_t * h4,
+                           uint32_t * k1, uint32_t * k2,
+                           uint32_t * k3, uint32_t * k4,
+                           uint32_t * c1, uint32_t * c2,
+                           uint32_t * c3, uint32_t * c4 )
+{
+  *k1 *= *c1; *k1  = ROTL32(*k1,15); *k1 *= *c2; *h1 ^= *k1;
+  *k2 *= *c2; *k2  = ROTL32(*k2,16); *k2 *= *c3; *h2 ^= *k2;
+  *k3 *= *c3; *k3  = ROTL32(*k3,17); *k3 *= *c4; *h3 ^= *k3;
+  *k4 *= *c4; *k4  = ROTL32(*k4,18); *k4 *= *c1; *h4 ^= *k4;
+
+  *h1 = ROTL32(*h1,19); *h1 += *h2; *h1 = *h1*5+0x561ccd1b;
+  *h2 = ROTL32(*h2,17); *h2 += *h3; *h2 = *h2*5+0x0bcaa747;
+  *h3 = ROTL32(*h3,15); *h3 += *h4; *h3 = *h3*5+0x96cd1c35;
+  *h4 = ROTL32(*h4,13); *h4 += *h1; *h4 = *h4*5+0x32ac3b17;
+}
+
+/*-----------------------------------------------------------------------------
+// Finalization mix - force all bits of a hash block to avalanche */
+
+FORCE_INLINE uint32_t fmix ( uint32_t h ){ h ^= h >> 16; h *= 0x85ebca6b; h ^= h >> 13; h *= 0xc2b2ae35; h ^= h >> 16; return h; }
+FORCE_INLINE uint64_t fmix_64 ( uint64_t k )
+{
+  k ^= k >> 33;
+  k *= BIG_CONSTANT(0xff51afd7ed558ccd);
+  k ^= k >> 33;
+  k *= BIG_CONSTANT(0xc4ceb9fe1a85ec53);
+  k ^= k >> 33;
+
+  return k;
+}
+
+void MurmurHash3_x86_32 ( const void * key, int len, uint32_t seed, void * out )
 {
   const uint8_t * data = (const uint8_t*)key;
   const int nblocks = len / 4;

-  uint32_t h1 = 0x971e137b ^ seed;
-
-  uint32_t c1 = 0x95543787;
-  uint32_t c2 = 0x2ad7eb25;
-
-  /*  body  */
+  uint32_t h1 = seed;
+
+  uint32_t c1 = 0xcc9e2d51;
+  uint32_t c2 = 0x1b873593;
+
+  /* body */

   const uint32_t * blocks = (const uint32_t *)(data + nblocks*4);
+
   int i = -nblocks;

   for(i; i; i++)
   {
     uint32_t k1 = getblock(blocks,i);
-
-    bmix32(&h1,&k1,&c1,&c2);
+    bmix(&h1,&k1,&c1,&c2);
   }

-  /* tail */
+  /*  tail */

   const uint8_t * tail = (const uint8_t*)(data + nblocks*4);

@@ -63,119 +99,49 @@
   case 3: k1 ^= tail[2] << 16;
   case 2: k1 ^= tail[1] << 8;
   case 1: k1 ^= tail[0];
-      bmix32(&h1,&k1,&c1,&c2);
+          k1 *= c1; k1 = ROTL32(k1,16); k1 *= c2; h1 ^= k1;
   };

-  /* finalization  */
+  /*  finalization */

   h1 ^= len;

-  h1 *= 0x85ebca6b;
-  h1 ^= h1 >> 13;
-  h1 *= 0xc2b2ae35;
-  h1 ^= h1 >> 16;
-
-  h1 ^= seed;
+  h1 = fmix(h1);

   *(uint32_t*)out = h1;
 }

-/*-----------------------------------------------------------------------------
-// This mix is large enough that VC++ refuses to inline it unless we use
-// __forceinline. It's also not all that fast due to register spillage. */
-
-FORCE_INLINE void bmix32_2 ( uint32_t * h1, uint32_t * h2,
-                           uint32_t * h3, uint32_t * h4,
-                           uint32_t * k1, uint32_t * k2,
-                           uint32_t * k3, uint32_t * k4,
-                           uint32_t * c1, uint32_t * c2 )
-{
-  *k1 *= *c1;
-  *k1  = ROTL32(*k1,11);
-  *k1 *= *c2;
-  *h1 ^= *k1;
-  *h1 += *h2;
-  *h1 += *h3;
-  *h1 += *h4;
-
-  *h1 = ROTL32(*h1,17);
-
-  *k2 *= *c2;
-  *k2  = ROTL32(*k2,11);
-  *k2 *= *c1;
-  *h2 ^= *k2;
-  *h2 += *h1;
-
-  *h1 = *h1*3+0x52dce729;
-  *h2 = *h2*3+0x38495ab5;
-
-  *c1 = *c1*5+0x7b7d159c;
-  *c2 = *c2*5+0x6bce6396;
-
-  *k3 *= *c1;
-  *k3  = ROTL32(*k3,11);
-  *k3 *= *c2;
-  *h3 ^= *k3;
-  *h3 += *h1;
-
-  *k4 *= *c2;
-  *k4  = ROTL32(*k4,11);
-  *k4 *= *c1;
-  *h4 ^= *k4;
-  *h4 += *h1;
-
-  *h3 = *h3*3+0x52dce729;
-  *h4 = *h4*3+0x38495ab5;
-
-  *c1 = *c1*5+0x7b7d159c;
-  *c2 = *c2*5+0x6bce6396;
-}
-
-/*----------
-// Finalization mix - force all bits of a hash block to avalanche
-// avalanches all bits to within 0.25% bias */
-
-FORCE_INLINE uint32_t fmix32 ( uint32_t h )
-{
-  h ^= h >> 16;
-  h *= 0x85ebca6b;
-  h ^= h >> 13;
-  h *= 0xc2b2ae35;
-  h ^= h >> 16;
-
-  return h;
-}
-
-void MurmurHash3_x86_128 ( const void * key, const int len,
-                           uint32_t seed, void * out )
+void MurmurHash3_x86_128 ( const void * key, const int len, uint32_t seed, void * out )
 {
   const uint8_t * data = (const uint8_t*)key;
   const int nblocks = len / 16;

-  uint32_t h1 = 0x8de1c3ac ^ seed;
-  uint32_t h2 = 0xbab98226 ^ seed;
-  uint32_t h3 = 0xfcba5b2d ^ seed;
-  uint32_t h4 = 0x32452e3e ^ seed;
-
-  uint32_t c1 = 0x95543787;
-  uint32_t c2 = 0x2ad7eb25;
+  uint32_t h1 = seed;
+  uint32_t h2 = seed;
+  uint32_t h3 = seed;
+  uint32_t h4 = seed;
+
+  uint32_t c1 = 0x239b961b;
+  uint32_t c2 = 0xab0e9789;
+  uint32_t c3 = 0x38b34ae5;
+  uint32_t c4 = 0xa1e38b93;

   /* body */

-  const uint32_t * blocks = (const uint32_t *)(data);
-  int i;
-
-  for(i = 0; i < nblocks; i++)
+  const uint32_t * blocks = (const uint32_t *)(data + nblocks*16);
+
+  int i = -nblocks;
+  for(i; i; i++)
   {
     uint32_t k1 = getblock(blocks,i*4+0);
     uint32_t k2 = getblock(blocks,i*4+1);
     uint32_t k3 = getblock(blocks,i*4+2);
     uint32_t k4 = getblock(blocks,i*4+3);

-    bmix32_2(&h1,&h2,&h3,&h4, &k1,&k2,&k3,&k4, &c1,&c2);
+    bmix12(&h1,&h2,&h3,&h4, &k1,&k2,&k3,&k4, &c1, &c2, &c3, &c4);
   }

-  /*  tail  */
+  /*  tail */

   const uint8_t * tail = (const uint8_t*)(data + nblocks*16);

@@ -189,32 +155,38 @@
   case 15: k4 ^= tail[14] << 16;
   case 14: k4 ^= tail[13] << 8;
   case 13: k4 ^= tail[12] << 0;
+           k4 *= c4; k4  = ROTL32(k4,18); k4 *= c1; h4 ^= k4;
+
   case 12: k3 ^= tail[11] << 24;
   case 11: k3 ^= tail[10] << 16;
   case 10: k3 ^= tail[ 9] << 8;
   case  9: k3 ^= tail[ 8] << 0;
+           k3 *= c3; k3  = ROTL32(k3,17); k3 *= c4; h3 ^= k3;
+
   case  8: k2 ^= tail[ 7] << 24;
   case  7: k2 ^= tail[ 6] << 16;
   case  6: k2 ^= tail[ 5] << 8;
   case  5: k2 ^= tail[ 4] << 0;
+           k2 *= c2; k2  = ROTL32(k2,16); k2 *= c3; h2 ^= k2;
+
   case  4: k1 ^= tail[ 3] << 24;
   case  3: k1 ^= tail[ 2] << 16;
   case  2: k1 ^= tail[ 1] << 8;
   case  1: k1 ^= tail[ 0] << 0;
-           bmix32_2(&h1,&h2,&h3,&h4, &k1,&k2,&k3,&k4, &c1,&c2);
+           k1 *= c1; k1  = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
   };

-  /* finalization */
+  /*  finalization  */

   h4 ^= len;

   h1 += h2; h1 += h3; h1 += h4;
   h2 += h1; h3 += h1; h4 += h1;

-  h1 = fmix32(h1);
-  h2 = fmix32(h2);
-  h3 = fmix32(h3);
-  h4 = fmix32(h4);
+  h1 = fmix(h1);
+  h2 = fmix(h2);
+  h3 = fmix(h3);
+  h4 = fmix(h4);

   h1 += h2; h1 += h3; h1 += h4;
   h2 += h1; h3 += h1; h4 += h1;
@@ -225,83 +197,31 @@
   ((uint32_t*)out)[3] = h4;
 }

-/*-----------------------------------------------------------------------------
-// Block read - if your platform needs to do endian-swapping or can only
-// handle aligned reads, do the conversion here */
-
-FORCE_INLINE uint64_t getblock_64 ( const uint64_t * p, int i )
-{
-  return p[i];
-}
-
-/* Block mix - combine the key bits with the hash bits and scramble everything */
-
-FORCE_INLINE void bmix64 ( uint64_t * h1, uint64_t * h2,
-                           uint64_t * k1, uint64_t * k2,
-                           uint64_t * c1, uint64_t * c2 )
-{
-  *k1 *= *c1;
-  *k1  = ROTL64(*k1,23);
-  *k1 *= *c2;
-
-  *k2 *= *c2;
-  *k2  = ROTL64(*k2,23);
-  *k2 *= *c1;
-
-  *h1 = ROTL64(*h1,17);
-  *h1 += *h2;
-  *h1 ^= *k1;
-
-  *h2 = ROTL64(*h2,41);
-  *h2 += *h1;
-  *h2 ^= *k2;
-
-  *h1 = *h1*3+0x52dce729;
-  *h2 = *h2*3+0x38495ab5;
-
-  *c1 = *c1*5+0x7b7d159c;
-  *c2 = *c2*5+0x6bce6396;
-}
-
-/* Finalization mix - avalanches all bits to within 0.05% bias */
-
-FORCE_INLINE uint64_t fmix64 ( uint64_t k )
-{
-  k ^= k >> 33;
-  k *= BIG_CONSTANT(0xff51afd7ed558ccd);
-  k ^= k >> 33;
-  k *= BIG_CONSTANT(0xc4ceb9fe1a85ec53);
-  k ^= k >> 33;
-
-  return k;
-}
-
-void MurmurHash3_x64_128 ( const void * key, const int len,
-                           const uint32_t seed, void * out )
+void MurmurHash3_x64_128 ( const void * key, const int len, const uint32_t seed, void * out )
 {
   const uint8_t * data = (const uint8_t*)key;
   const int nblocks = len / 16;

-  uint64_t h1 = BIG_CONSTANT(0x9368e53c2f6af274) ^ seed;
-  uint64_t h2 = BIG_CONSTANT(0x586dcd208f7cd3fd) ^ seed;
+  uint64_t h1 = seed;
+  uint64_t h2 = seed;

   uint64_t c1 = BIG_CONSTANT(0x87c37b91114253d5);
   uint64_t c2 = BIG_CONSTANT(0x4cf5ad432745937f);

- /*  body  */
+  /*  body  */

   const uint64_t * blocks = (const uint64_t *)(data);
+
   int i = 0;
-
   for(i; i < nblocks; i++)
   {
     uint64_t k1 = getblock_64(blocks,i*2+0);
     uint64_t k2 = getblock_64(blocks,i*2+1);

-    bmix64(&h1,&h2,&k1,&k2,&c1,&c2);
+    bmix_64(&h1,&h2,&k1,&k2,&c1,&c2);
   }

-  /* tail */
+  /*  tail */

   const uint8_t * tail = (const uint8_t*)(data + nblocks*16);

@@ -317,6 +237,8 @@
   case 11: k2 ^= ((uint64_t) tail[10]) << 16;
   case 10: k2 ^= ((uint64_t) tail[ 9]) << 8;
   case  9: k2 ^= ((uint64_t) tail[ 8]) << 0;
+           k2 *= c2; k2  = ROTL64(k2,33); k2 *= c1; h2 ^= k2;
+
   case  8: k1 ^= ((uint64_t) tail[ 7]) << 56;
   case  7: k1 ^= ((uint64_t) tail[ 6]) << 48;
   case  6: k1 ^= ((uint64_t) tail[ 5]) << 40;
@@ -325,18 +247,18 @@
   case  3: k1 ^= ((uint64_t) tail[ 2]) << 16;
   case  2: k1 ^= ((uint64_t) tail[ 1]) << 8;
   case  1: k1 ^= ((uint64_t) tail[ 0]) << 0;
-           bmix64(&h1,&h2,&k1,&k2,&c1,&c2);
-  };
-
-  /* finalization */
+           k1 *= c1; k1  = ROTL64(k1,29); k1 *= c2; h1 ^= k1;
+  };
+
+  /*  finalization */

   h2 ^= len;

   h1 += h2;
   h2 += h1;

-  h1 = fmix64(h1);
-  h2 = fmix64(h2);
+  h1 = fmix_64(h1);
+  h2 = fmix_64(h2);

   h1 += h2;
   h2 += h1;
@@ -344,5 +266,3 @@
   ((uint64_t*)out)[0] = h1;
   ((uint64_t*)out)[1] = h2;
 }
-
-/*-----------------------------------------------------------------------------*/


dfbtest_sync: Added StretchBlit() to random operations.

--- tests/dfbtest_sync.c
+++ tests/dfbtest_sync.c
@@ -253,7 +253,7 @@
           int j,n = rand()%100;

           for (j=0; j<n; j++) {
-               switch (rand()%2) {
+               switch (rand()%3) {
                     case 0:
                          dest->SetDrawingFlags( dest, rand() & (DSDRAW_BLEND) );
                          dest->FillRectangle( dest, rand()%100, rand()%100, rand()%100, rand()%100 );
@@ -266,6 +266,14 @@
                                                                  DSBLIT_ROTATE90) );
                          dest->Blit( dest, source, NULL, rand()%100, rand()%100 );
                          break;
+
+                    case 2:
+                         dest->SetBlittingFlags( dest, rand() & (DSBLIT_BLEND_ALPHACHANNEL |
+                                                                 DSBLIT_BLEND_COLORALPHA   |
+                                                                 DSBLIT_COLORIZE           |
+                                                                 DSBLIT_ROTATE90) );
+                         dest->StretchBlit( dest, source, NULL, NULL );
+                         break;
                }
           }


need #include <dns/log.h>

need #include <dns/log.h>

--- bin/tests/nconf_test.c
+++ bin/tests/nconf_test.c
@@ -25,6 +25,7 @@

 #include <isc/mem.h>

+#include <dns/log.h>
 #include <dns/namedconf.h>

 #include <isc/error.h>


Removed obsolete notification BACKGROUND_PAGE_TRACKER_CHANGED.

BUG=80755
TEST=Just make sure Chrome compiles.

Review URL: http://codereview.chromium.org/6929038

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

--- content/common/notification_type.h
+++ content/common/notification_type.h
@@ -1035,12 +1035,6 @@
     // acknowledged the module incompatibility. No details are expected.
     MODULE_INCOMPATIBILITY_BADGE_CHANGE,

-    // Background App Tracking Notifications -----------------------------------
-    // Sent when the state of the background page tracker has changed (the
-    // number of unacknowledged background pages have changed). Source is the
-    // BackgroundPageTracker and there are no Details.
-    BACKGROUND_PAGE_TRACKER_CHANGED,
-
     // Accessibility Notifications ---------------------------------------------

     // Notification that a window in the browser UI (not the web content)


xbps-bin::install.c: remove unused var to make this build with gcc-4.6.

Reported and patch provided by ojab in issue 4.

--- bin/xbps-bin/install.c
+++ bin/xbps-bin/install.c
@@ -383,7 +383,6 @@
 static int
 exec_transaction(struct transaction *trans)
 {
-	const struct xbps_handle *xhp;
 	prop_dictionary_t instpkgd;
 	prop_object_t obj;
 	const char *pkgname, *version, *pkgver, *instver, *filen, *tract;
@@ -391,7 +390,6 @@
 	bool update, preserve, autoinst;
 	pkg_state_t state;

-	xhp = xbps_handle_get();
 	/*
 	 * Only show the URLs to download the binary packages.
 	 */


xbps-dgraph: add two new optional objs: homepage and license.

--- bin/xbps-dgraph/main.c
+++ bin/xbps-dgraph/main.c
@@ -45,7 +45,7 @@
  */
 static const char *optional_objs[] = {
 	"conflicts", "conf_files", "replaces", "run_depends", "preserve",
-	"requiredby", "provides"
+	"requiredby", "provides", "homepage", "license"
 };

 /*


V4L/DVB (10210): Fix a bug on v4lgrab.c

V4L/DVB (10210): Fix a bug on v4lgrab.c

v4lgrab  breaks the fputc macro on some systems, because of #defined
FILE.

Also, I also added comments because it was not at all clear that to get gspca
cameras to work with this application you need v4l1compat.

Signed-off-by: Simon Harrison <c3aae1f244e3355d3c86d89cff06c89aae43abc8@yahoo.co.uk>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@redhat.com>

--- Documentation/video4linux/v4lgrab.c
+++ Documentation/video4linux/v4lgrab.c
@@ -4,12 +4,21 @@
  *
  *	Compile with:
  *		gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab
- *      Use as:
- *              v4lgrab >image.ppm
+ *	Use as:
+ *		v4lgrab >image.ppm
  *
  *	Copyright (C) 1998-05-03, Phil Blundell <philb@gnu.org>
- *      Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
- *      with minor modifications (Dave Forrest, drf5n@virginia.edu).
+ *	Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
+ *	with minor modifications (Dave Forrest, drf5n@virginia.edu).
+ *
+ *
+ *	For some cameras you may need to pre-load libv4l to perform
+ *	the necessary decompression, e.g.:
+ *
+ *	export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so
+ *	./v4lgrab >image.ppm
+ *
+ *	see http://hansdegoede.livejournal.com/3636.html for details.
  *
  */

@@ -24,7 +33,7 @@
 #include <linux/types.h>
 #include <linux/videodev.h>

-#define FILE "/dev/video0"
+#define VIDEO_DEV "/dev/video0"

 /* Stole this from tvset.c */

@@ -90,7 +99,7 @@

 int main(int argc, char ** argv)
 {
-  int fd = open(FILE, O_RDONLY), f;
+  int fd = open(VIDEO_DEV, O_RDONLY), f;
   struct video_capability cap;
   struct video_window win;
   struct video_picture vpic;
@@ -100,13 +109,13 @@
   unsigned int i, src_depth;

   if (fd < 0) {
-    perror(FILE);
+    perror(VIDEO_DEV);
     exit(1);
   }

   if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
     perror("VIDIOGCAP");
-    fprintf(stderr, "(" FILE " not a video4linux device?)\n");
+    fprintf(stderr, "(" VIDEO_DEV " not a video4linux device?)\n");
     close(fd);
     exit(1);
   }


Make the tree compile again on architectures without drm(4).

ok maja@, miod@, jsg@

--- uvm/uvm_device.c
+++ uvm/uvm_device.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: uvm_device.c,v 1.43 2013/06/07 20:46:14 kettenis Exp $	*/
+/*	$OpenBSD: uvm_device.c,v 1.44 2013/08/13 06:56:41 kettenis Exp $	*/
 /*	$NetBSD: uvm_device.c,v 1.30 2000/11/25 06:27:59 chs Exp $	*/

 /*
@@ -50,7 +50,10 @@
 #include <uvm/uvm.h>
 #include <uvm/uvm_device.h>

+#if defined(__amd64__) || defined(__i386__) || \
+    defined(__macppc__) || defined(__sparc64__)
 #include "drm.h"
+#endif

 /*
  * private global data structure


Eliminated obsolete variables from renderer state struct.

svn path=/trunk/; revision=276

--- bindings/tk/plserver.h
+++ bindings/tk/plserver.h
@@ -1,6 +1,9 @@
 /* $Id$
  * $Log$
- * Revision 1.1  1993/07/02 06:58:32  mjl
+ * Revision 1.2  1993/07/16 22:01:29  mjl
+ * Eliminated obsolete variables from renderer state struct.
+ *
+ * Revision 1.1  1993/07/02  06:58:32  mjl
  * The new TCL/TK driver!  Yes it's finally here!  YAAAAAAAAYYYYYYY!!!
  *
  */
@@ -36,15 +39,8 @@
     char  *filetype;			/* Set to "fifo" or "socket" */

     int   nbytes;			/* data bytes waiting to be read */
-    int   orient;			/* Orientation */
-    float aspect;			/* Aspect ratio */
-    int   orientset, aspectset;		/* Flags governing the above */

     short xmin, xmax, ymin, ymax;	/* Data minima and maxima */
-    int   xlen, ylen;			/* Data system lengths */
-    float vpxmin, vpxmax;		/* Viewport minima and maxima */
-    float vpymin, vpymax;
-
     PLFLT xold, yold;			/* Endpoints of last line plotted */
 } PLRDev;


Update RingOpenGL - Add Function (Source Code) : void glNormal3i(GLint nx,GLint ny,GLint nz)

--- extensions/ringopengl/ring_opengl21.c
+++ extensions/ringopengl/ring_opengl21.c
@@ -6308,6 +6308,28 @@
 		return ;
 	}
 	glNormal3f( (GLfloat ) RING_API_GETNUMBER(1), (GLfloat ) RING_API_GETNUMBER(2), (GLfloat ) RING_API_GETNUMBER(3));
+}
+
+
+RING_FUNC(ring_glNormal3i)
+{
+	if ( RING_API_PARACOUNT != 3 ) {
+		RING_API_ERROR(RING_API_MISS3PARA);
+		return ;
+	}
+	if ( ! RING_API_ISNUMBER(1) ) {
+		RING_API_ERROR(RING_API_BADPARATYPE);
+		return ;
+	}
+	if ( ! RING_API_ISNUMBER(2) ) {
+		RING_API_ERROR(RING_API_BADPARATYPE);
+		return ;
+	}
+	if ( ! RING_API_ISNUMBER(3) ) {
+		RING_API_ERROR(RING_API_BADPARATYPE);
+		return ;
+	}
+	glNormal3i( (GLint ) RING_API_GETNUMBER(1), (GLint ) RING_API_GETNUMBER(2), (GLint ) RING_API_GETNUMBER(3));
 }

 RING_API void ringlib_init(RingState *pRingState)
@@ -6618,4 +6640,5 @@
 	ring_vm_funcregister("glnormal3b",ring_glNormal3b);
 	ring_vm_funcregister("glnormal3d",ring_glNormal3d);
 	ring_vm_funcregister("glnormal3f",ring_glNormal3f);
-}
+	ring_vm_funcregister("glnormal3i",ring_glNormal3i);
+}


Update RingOpenGL - Add Function (Source Code) : void glArrayElement(GLint i)

--- extensions/ringopengl/ring_opengl21.c
+++ extensions/ringopengl/ring_opengl21.c
@@ -80,10 +80,25 @@
 	RING_API_RETNUMBER(glAreTexturesResident( (GLsizei )  (int) RING_API_GETNUMBER(1),(GLuint *) RING_API_GETCPOINTER(2,"GLuint"),(GLboolean *) RING_API_GETCPOINTER(3,"GLboolean")));
 }

+
+RING_FUNC(ring_glArrayElement)
+{
+	if ( RING_API_PARACOUNT != 1 ) {
+		RING_API_ERROR(RING_API_MISS1PARA);
+		return ;
+	}
+	if ( ! RING_API_ISNUMBER(1) ) {
+		RING_API_ERROR(RING_API_BADPARATYPE);
+		return ;
+	}
+	glArrayElement( (GLint ) RING_API_GETNUMBER(1));
+}
+
 RING_API void ringlib_init(RingState *pRingState)
 {
 	ring_vm_funcregister("glaccum",ring_glAccum);
 	ring_vm_funcregister("glactivetexture",ring_glActiveTexture);
 	ring_vm_funcregister("glalphafunc",ring_glAlphaFunc);
 	ring_vm_funcregister("glaretexturesresident",ring_glAreTexturesResident);
+	ring_vm_funcregister("glarrayelement",ring_glArrayElement);
 }


operator[] on buffers

operator[] on buffers

git-svn-id: 17d41c460f3ddabe6271dd210d2e0bf85f349cae@955 29311d96-e01e-0410-9327-a35deaab8ce9

--- ceph/include/buffer.h
+++ ceph/include/buffer.h
@@ -248,6 +248,16 @@
     unsigned length() const { return _len; }
     unsigned offset() const { return _off; }
     unsigned unused_tail_length() const { return _raw->len - (_off+_len); }
+    const char& operator[](unsigned n) const {
+      assert(_raw);
+      assert(n < _len);
+      return _raw->data[_off + n];
+    }
+    char& operator[](unsigned n) {
+      assert(_raw);
+      assert(n < _len);
+      return _raw->data[_off + n];
+    }

     const char *raw_c_str() const { assert(_raw); return _raw->data; }
     unsigned raw_length() const { assert(_raw); return _raw->len; }
@@ -520,6 +530,23 @@
     }

+    /*
+     * get a char
+     */
+    const char& operator[](unsigned n) {
+      assert(n < _len);
+      for (std::list<ptr>::iterator p = _buffers.begin();
+	   p != _buffers.end();
+	   p++) {
+	if (n >= p->length()) {
+	  n -= p->length();
+	  continue;
+	}
+	return (*p)[n];
+      }
+      assert(0);
+    }
+
     /*
      * return a contiguous ptr to whole bufferlist contents.
      */


code cleanup: double promotion warnings with new bevel code & wrong use of NULL in cycles.

--- blender/blender_util.h
+++ blender/blender_util.h
@@ -287,7 +287,7 @@
 	bool is_used(const K& key)
 	{
 		T *data = find(key);
-		return (data)? used_set.find(data) != used_set.end(): NULL;
+		return (data) ? used_set.find(data) != used_set.end() : false;
 	}

 	void used(T *data)


[FIX] only perfect matches were found in --no-gaps mode

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@13510 e6417c60-b987-48fd-844e-b20f0fcc1017

--- extras/apps/razers3/razers.h
+++ extras/apps/razers3/razers.h
@@ -2000,10 +2000,10 @@
 #endif

     int mismatchDelta, scoreInit;
-    int minScore = 0;
+    int minScore;
     if (IsSameType<TScoreMode, RazerSErrors>::VALUE)
     {
-        int minScore = verifier.options->errorCutOff[readId];
+        minScore = verifier.options->errorCutOff[readId];
         if (minScore == 0)
             return false;


Pairs can now be equal to other pairs

Pairs can now be equal to other pairs

They compare equal if their firsts and seconds are equal.

--- vm/value.c
+++ vm/value.c
@@ -151,6 +151,11 @@
 				return !memcmp(toCharArr(s1), toCharArr(s2), s1->length);
 			}
 		}
+		else if (getType(v1) == T_PAIR)
+		{
+			// pairs count as simple datatypes, so this is safe
+			return equal(toFirst(v1), toFirst(v2)) && equal(toSecond(v1), toSecond(v2));
+		}
 	}
 	return false;
 }


small fix in the upper bound change computation in Prunable

--- fastlib/u/dongryel/kde/kde.h
+++ fastlib/u/dongryel/kde/kde.h
@@ -578,7 +578,7 @@
     dl = kernel_value_range.lo * num_references;
     de = 0.5 * num_references *
       (kernel_value_range.lo + kernel_value_range.hi);
-    du = -kernel_value_range.hi * num_references;
+    du = (1 - kernel_value_range.hi) * num_references;

     // refine the lower bound using the new lower bound info
     double new_mass_l = stat.mass_l_ + dl;


Errant tab character.

Errant tab character.

--- ch1/e01-08_countbtn.c
+++ ch1/e01-08_countbtn.c
@@ -25,7 +25,7 @@
 			default:
 				break;
 		}
-
+
 	printf("Blanks\tTabs\tNewlines\n");
 	printf("%d\t%d\t%d\n", blanks, tabs, newlines);


client: tablet-shell: fallback in the lack of lockscreen icon

lockscreen, homescreen and shell launchers are falling back okay already and
only lockscreen icon was missing some way to keep the shell client running in
the absence of images. This patch fix it.

Signed-off-by: Tiago Vignatti <f080760b2054d506aacc8dee97f8804c19fbc3aa@intel.com>

--- clients/tablet-shell.c
+++ clients/tablet-shell.c
@@ -197,11 +197,17 @@

 	cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
 	icon = load_cairo_surface(key_lockscreen_icon);
-	width = cairo_image_surface_get_width(icon);
-	height = cairo_image_surface_get_height(icon);
-	cairo_set_source_surface(cr, icon,
-				 allocation.x + (allocation.width - width) / 2,
-				 allocation.y + (allocation.height - height) / 2);
+	if (icon) {
+		width = cairo_image_surface_get_width(icon);
+		height = cairo_image_surface_get_height(icon);
+		cairo_set_source_surface(cr, icon,
+			allocation.x + (allocation.width - width) / 2,
+			allocation.y + (allocation.height - height) / 2);
+	} else {
+		fprintf(stderr, "couldn't load lockscreen icon: %s\n",
+				 key_lockscreen_icon);
+		cairo_set_source_rgb(cr, 0.2, 0, 0);
+	}
 	cairo_paint(cr);
 	cairo_destroy(cr);
 	cairo_surface_destroy(icon);


dissable effc++ warnings in easylogger++ source

--- client/libs/logger/easylogging++.h
+++ client/libs/logger/easylogging++.h
@@ -13,6 +13,7 @@
 //  http://easylogging.muflihun.com
 //  http://muflihun.com
 //
+#pragma GCC diagnostic ignored "-Weffc++"
 #ifndef EASYLOGGINGPP_H
 #define EASYLOGGINGPP_H
 // Compilers and C++0x/C++11 Evaluation
@@ -6661,3 +6662,4 @@
 #   define START_EASYLOGGINGPP(argc, argv) el::Helpers::setArgs(argc, argv)
 #endif  // defined(ELPP_UNICODE)
 #endif // EASYLOGGINGPP_H
+#pragma GCC diagnostic warning "-Weffc++"


build-export: Use parse_datetime() for --timestamp

This allows you more flexibility for defining the timestamp and
makes it compatilb with ostree commit.

Closes: #1538
Approved by: alexlarsson

--- app/flatpak-builtins-build-export.c
+++ app/flatpak-builtins-build-export.c
@@ -31,6 +31,7 @@

 #include "flatpak-builtins.h"
 #include "flatpak-utils.h"
+#include "parse-datetime.h"

 static char *opt_subject;
 static char *opt_body;
@@ -62,7 +63,7 @@
   { "exclude", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_exclude, N_("Files to exclude"), N_("PATTERN") },
   { "include", 0, 0, G_OPTION_ARG_STRING_ARRAY, &opt_include, N_("Excluded files to include"), N_("PATTERN") },
   { "gpg-homedir", 0, 0, G_OPTION_ARG_STRING, &opt_gpg_homedir, N_("GPG Homedir to use when looking for keyrings"), N_("HOMEDIR") },
-  { "timestamp", 0, 0, G_OPTION_ARG_STRING, &opt_timestamp, N_("Override the timestamp of the commit"), N_("ISO-8601-TIMESTAMP") },
+  { "timestamp", 0, 0, G_OPTION_ARG_STRING, &opt_timestamp, N_("Override the timestamp of the commit"), N_("TIMESTAMP") },
 #ifdef FLATPAK_ENABLE_P2P
   { "collection-id", 0, 0, G_OPTION_ARG_STRING, &opt_collection_id, N_("Collection ID"), "COLLECTION-ID" },
 #endif  /* FLATPAK_ENABLE_P2P */
@@ -656,7 +657,7 @@
   gboolean is_runtime = FALSE;
   gboolean is_extension = FALSE;
   guint64 installed_size = 0,download_size = 0;
-  GTimeVal ts;
+  struct timespec ts;
   const char *collection_id;

   context = g_option_context_new (_("LOCATION DIRECTORY [BRANCH] - Create a repository from a build directory"));
@@ -900,12 +901,8 @@
   /* The timestamp is used for the commit metadata and AppStream data */
   if (opt_timestamp != NULL)
     {
-      if (!g_time_val_from_iso8601 (opt_timestamp, &ts))
-        {
-          g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
-                       "Could not parse '%s'", opt_timestamp);
-          goto out;
-        }
+      if (!parse_datetime (&ts, opt_timestamp, NULL))
+        return flatpak_fail (error, _("Could not parse '%s'"), opt_timestamp);
     }

   if (opt_timestamp == NULL)


state_notify.c: Use ib_stream_pump_close() instead of ib_stream_pump_flush() when ending data submission to a pump.

--- engine/state_notify.c
+++ engine/state_notify.c
@@ -919,7 +919,7 @@
     }

     /* Signal that all data should leave the pipeline. */
-    rc = ib_stream_pump_flush(ib_tx_request_body_pump(tx));
+    rc = ib_stream_pump_close(ib_tx_request_body_pump(tx));
     if (rc != IB_OK) {
         return rc;
     }
@@ -1261,7 +1261,7 @@
     tx->t.finished = ib_clock_get_time();

     /* Signal that all data should leave the pipeline. */
-    rc = ib_stream_pump_flush(ib_tx_response_body_pump(tx));
+    rc = ib_stream_pump_close(ib_tx_request_body_pump(tx));
     if (rc != IB_OK) {
         return rc;
     }


Revert "clutter-main.c: Fix multiple declarations"

This reverts commit 3d74552684a6eb49bc67845bfb3839896395e66a.

This is a part to attempt to further investigate about the 0xC0000264 error
on Windows

--- clutter/clutter-main.c
+++ clutter/clutter-main.c
@@ -914,6 +914,18 @@

   if (clutter_main_loop_level == 0)
     CLUTTER_TIMER_STOP (uprof_get_mainloop_context (), mainloop_timer);
+}
+
+static void
+clutter_threads_impl_lock (void)
+{
+  g_mutex_lock (&clutter_threads_mutex);
+}
+
+static void
+clutter_threads_impl_unlock (void)
+{
+  g_mutex_unlock (&clutter_threads_mutex);
 }

 /**


Initialize a variable to avoid warnings

Initialize a variable to avoid warnings

The gl_mode variable was not initialized, and the compiler complained
when using the anal-retentive compiler flags.

--- clutter/cogl/gl/cogl.c
+++ clutter/cogl/gl/cogl.c
@@ -1184,7 +1184,7 @@
               float            z_far)
 {
   GLfloat fogColor[4];
-  GLenum gl_mode;
+  GLenum gl_mode = GL_LINEAR;

   fogColor[0] = cogl_color_get_red_float (fog_color);
   fogColor[1] = cogl_color_get_green_float (fog_color);


more cleanups

more cleanups

--- kernel/arch/x86/mmu.c
+++ kernel/arch/x86/mmu.c
@@ -26,6 +26,13 @@

 }

+static void mmu_table_set_page(struct mmu_table *table, unsigned int frame, unsigned int page, unsigned int pflags)
+{
+
+    table->entries[frame % MMU_TABLE_SLOTS] = page | pflags;
+
+}
+
 static struct mmu_table *mmu_directory_get_table(struct mmu_directory *directory, unsigned int frame)
 {

@@ -37,13 +44,6 @@
 {

     directory->tables[index] = (struct mmu_table *)((unsigned int)table | tflags);
-
-}
-
-static unsigned int *mmu_get_entry(struct mmu_directory *directory, unsigned int frame)
-{
-
-    return &mmu_directory_get_table(directory, frame)->entries[frame % MMU_TABLE_SLOTS];

 }

@@ -108,14 +108,14 @@
     mmu_directory_set_table(&header->directory, index, &header->table, tflags);

     unsigned int i;
-    unsigned int paddress = (unsigned int)memory->paddress;
+    unsigned int page = (unsigned int)memory->paddress;

-    for (i = 0; i < count; i++)
+    for (i = 0; i < count; i++, page += MMU_PAGE_SIZE)
     {

-        *mmu_get_entry(&header->directory, frame + i) = paddress | pflags;
+        struct mmu_table *table = mmu_directory_get_table(&header->directory, frame + i);

-        paddress += MMU_PAGE_SIZE;
+        mmu_table_set_page(table, frame + i, page, pflags);

     }


T191: T231: rename caps_create->caps_create_old and caps_create2->caps_create

Signed-off-by: Simon Gerber <13ba2e9de9ead0ea0b5f47504fb3a80bb9b1ee3b@inf.ethz.ch>

--- kernel/capabilities.c
+++ kernel/capabilities.c
@@ -686,7 +686,7 @@
 // in the table below.
 STATIC_ASSERT(46 == ObjType_Num, "Knowledge of all cap types");

-static errval_t caps_create(enum objtype type, lpaddr_t lpaddr, uint8_t bits,
+static errval_t caps_create_old(enum objtype type, lpaddr_t lpaddr, uint8_t bits,
                             uint8_t objbits, size_t numobjs, coreid_t owner,
                             struct cte *dest_caps)
 {
@@ -1247,9 +1247,9 @@
 // in the table below.
 STATIC_ASSERT(46 == ObjType_Num, "Knowledge of all cap types");

-static errval_t caps_create2(enum objtype type, lpaddr_t lpaddr, gensize_t size,
-                             gensize_t objsize, size_t count, coreid_t owner,
-                             struct cte *dest_caps)
+static errval_t caps_create(enum objtype type, lpaddr_t lpaddr, gensize_t size,
+                            gensize_t objsize, size_t count, coreid_t owner,
+                            struct cte *dest_caps)
 {
     errval_t err;

@@ -1942,7 +1942,7 @@
     assert(numobjs > 0);

     /* Create the new capabilities */
-    errval_t err = caps_create(type, addr, bits, objbits, numobjs, owner, caps);
+    errval_t err = caps_create_old(type, addr, bits, objbits, numobjs, owner, caps);
     if (err_is_fail(err)) {
         return err;
     }
@@ -2131,7 +2131,7 @@
     /* create new caps */
     struct cte *dest_cte =
         caps_locate_slot(dest_cnode->u.cnode.cnode, dest_slot);
-    err = caps_create2(type, base, size, objsize, count, my_core_id, dest_cte);
+    err = caps_create(type, base, size, objsize, count, my_core_id, dest_cte);
     if (err_is_fail(err)) {
         debug(SUBSYS_CAPS, "caps_retype2: failed to create a dest cap\n");
         return err_push(err, SYS_ERR_RETYPE_CREATE);


posix-timers.c: Don't export local functions

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

--- kernel/posix-timers.c
+++ kernel/posix-timers.c
@@ -256,7 +256,7 @@
 	return 0;
 }

-int posix_get_coarse_res(const clockid_t which_clock, struct timespec *tp)
+static int posix_get_coarse_res(const clockid_t which_clock, struct timespec *tp)
 {
 	*tp = ktime_to_timespec(KTIME_LOW_RES);
 	return 0;


[cleanup] src_constant now using delegating constructor

--- kernel/src_constant.h
+++ kernel/src_constant.h
@@ -32,9 +32,7 @@
         val_(boost::lexical_cast<T>(c)) {}

     explicit constant(T c, category_t t = 0)
-      : terminal(boost::lexical_cast<std::string>(c), t, false, false,
-                 k_base_weight),
-        val_(c) {}
+      : constant(boost::lexical_cast<std::string>(c), t) {}

     ///
     /// \return the value of the constant (as a \c any).


[PATCH] stop_machine.c copyright

[PATCH] stop_machine.c copyright

I had to look back: this code was extracted from the module.c code in 2005.

Signed-off-by: Rusty Russell <df9728c9e5104131c08c7adb03af425394842596@rustcorp.com.au>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- kernel/stop_machine.c
+++ kernel/stop_machine.c
@@ -1,3 +1,6 @@
+/* Copyright 2005 Rusty Russell rusty@rustcorp.com.au IBM Corporation.
+ * GPL v2 and any later version.
+ */
 #include <linux/stop_machine.h>
 #include <linux/kthread.h>
 #include <linux/sched.h>


Check the timeout value in mutex_lock_timed(), as the documentation implies we do.

--- kernel/thread/mutex.c
+++ kernel/thread/mutex.c
@@ -88,6 +88,11 @@
     if(irq_inside_int()) {
         dbglog(DBG_WARNING, "mutex_lock_timed: called inside interrupt\n");
         errno = EPERM;
+        return -1;
+    }
+
+    if(timeout < 0) {
+        errno = EINVAL;
         return -1;
     }


ftrace: Remove force undef config value left for testing

A forced undef of a config value was used for testing and was
accidently left in during the final commit. This causes x86 to
run slower than needed while running function tracing as well
as causes the function graph selftest to fail when DYNMAIC_FTRACE
is not set. This is because the code in MCOUNT expects the ftrace
code to be processed with the config value set that happened to
be forced not set.

The forced config option was left in by:
    commit 6331c28c962561aee59e5a493b7556a4bb585957
    ftrace: Fix dynamic selftest failure on some archs

Link: http://lkml.kernel.org/r/20111102150255.GA6973@debian

Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Reported-by: Rabin Vincent <6bd3f43fd5b2b5689bccc97f6d09e3eb28307598@rab.in>
Signed-off-by: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>


ftrace: Don't manipulate @pos in t_start()

It's rather confusing that in t_start(), in some cases @pos is
incremented, and in some cases it's decremented and then incremented.

This patch rewrites t_start() in a much more general way.

Thus we fix a bug that if ftrace_filtered == 1, functions have tracer
hooks won't be printed, because the branch is always unreachable:

static void *t_start(...)
{
	...
	if (!p)
		return t_hash_start(m, pos);
	return p;
}

Before:
  # echo 'sys_open' > /mnt/tracing/set_ftrace_filter
  # echo 'sys_write:traceon:4' >> /mnt/tracing/set_ftrace_filter
  sys_open

After:
  # echo 'sys_open' > /mnt/tracing/set_ftrace_filter
  # echo 'sys_write:traceon:4' >> /mnt/tracing/set_ftrace_filter
  sys_open
  sys_write:traceon:count=4

Reviewed-by: Liming Wang <8ebed96d16a71333989ee6ad2e944cd8bce34861@windriver.com>
Signed-off-by: Li Zefan <5dc16b054e85ffba6c8d314d8e55ae95dcab12a5@cn.fujitsu.com>
Cc: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>
Cc: Frederic Weisbecker <e8a1bf9163cb25e93cfd6540f223b3872ea7ee55@gmail.com>
LKML-Reference: <b4dfb049526cf5a6c4c5fdb9b2b900f1554f878f@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- kernel/trace/ftrace.c
+++ kernel/trace/ftrace.c
@@ -1467,8 +1467,6 @@
 			iter->pg = iter->pg->next;
 			iter->idx = 0;
 			goto retry;
-		} else {
-			iter->idx = -1;
 		}
 	} else {
 		rec = &iter->pg->records[iter->idx++];
@@ -1497,6 +1495,7 @@
 {
 	struct ftrace_iterator *iter = m->private;
 	void *p = NULL;
+	loff_t l;

 	mutex_lock(&ftrace_lock);
 	/*
@@ -1508,23 +1507,21 @@
 		if (*pos > 0)
 			return t_hash_start(m, pos);
 		iter->flags |= FTRACE_ITER_PRINTALL;
-		(*pos)++;
 		return iter;
 	}

 	if (iter->flags & FTRACE_ITER_HASH)
 		return t_hash_start(m, pos);

-	if (*pos > 0) {
-		if (iter->idx < 0)
-			return p;
-		(*pos)--;
-		iter->idx--;
-	}
-
-	p = t_next(m, p, pos);
-
-	if (!p)
+	iter->pg = ftrace_pages_start;
+	iter->idx = 0;
+	for (l = 0; l <= *pos; ) {
+		p = t_next(m, p, &l);
+		if (!p)
+			break;
+	}
+
+	if (!p && iter->flags & FTRACE_ITER_FILTER)
 		return t_hash_start(m, pos);

 	return p;


tracing: Fix free of probe entry by calling call_rcu_sched()

Because function tracing is very invasive, and can even trace
calls to rcu_read_lock(), RCU access in function tracing is done
with preempt_disable_notrace(). This requires a synchronize_sched()
for updates and not a synchronize_rcu().

Function probes (traceon, traceoff, etc) must be freed after
a synchronize_sched() after its entry has been removed from the
hash. But call_rcu() is used. Fix this by using call_rcu_sched().

Also fix the usage to use hlist_del_rcu() instead of hlist_del().

Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Cc: Paul McKenney <1e0ce936bb9b355d257bf5790d2513c3f28be22b@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>

--- kernel/trace/ftrace.c
+++ kernel/trace/ftrace.c
@@ -3108,8 +3108,8 @@
 					continue;
 			}

-			hlist_del(&entry->node);
-			call_rcu(&entry->rcu, ftrace_free_entry_rcu);
+			hlist_del_rcu(&entry->node);
+			call_rcu_sched(&entry->rcu, ftrace_free_entry_rcu);
 		}
 	}
 	__disable_ftrace_function_probe();


ioloop: Use -1 for infinite poll/epoll timeout rather than INT_MAX. Should improve performance a tiny bit and also works around a CPU eater bug in Linux 2.6.37.

--- src/lib/ioloop.c
+++ src/lib/ioloop.c
@@ -252,11 +252,12 @@
 	item = priorityq_peek(ioloop->timeouts);
 	timeout = (struct timeout *)item;
 	if (timeout == NULL) {
-		/* no timeouts. give it INT_MAX msecs. */
+		/* no timeouts. use INT_MAX msecs for timeval and
+		   return -1 for poll/epoll infinity. */
 		tv_r->tv_sec = INT_MAX / 1000;
 		tv_r->tv_usec = 0;
 		ioloop->next_max_time = (1ULL << (TIME_T_MAX_BITS-1)) - 1;
-		return INT_MAX;
+		return -1;
 	}

 	tv_now.tv_sec = 0;


FIX - release of phpfs

FIX - release of phpfs

--- core/system/fsys/device_handling.c
+++ core/system/fsys/device_handling.c
@@ -865,7 +865,7 @@
 				DEBUG("Going through all user drives. Name %s UserID %lu\n", fentry->f_Name, usr->u_ID );
 				if( id == fentry->f_ID )
 				{
-					*mfile = fentry;
+					//*mfile = fentry;
 					DEBUG("Device is already mounted. Name: %s ID %lu\n", fentry->f_Name, fentry->f_ID );
 					sameDevError = 1;
 					break;
@@ -952,7 +952,7 @@
 						// Set structure to caller
 						if( mfile ){ *mfile = f; }

-						l->sl_Error = FSys_Error_DeviceAlreadyMounted;
+						error = l->sl_Error = FSys_Error_DeviceAlreadyMounted;

 						//FRIEND_MUTEX_UNLOCK( &dm->dm_Mutex );
 						MountUnlock( dm, usr );
@@ -1847,7 +1847,7 @@
 								Log( FLOG_INFO, "[MountFS] -- Could not mount device for user %s. Drive was %s. Pointer to dstFile: %p\n", tmpUser->u_Name ? tmpUser->u_Name : "--nousername--", name ? name : "--noname--", dstFile );
 								if( dstFile != NULL )
 								{
-									filesys->Release( filesys, dstFile );
+									//filesys->Release( filesys, dstFile );
 								}
 							}