app/testpmd: fix SW checksum calculation enabling

In current design, we can't enable SW checksum calculation
for the devices which don't have checksum offloading abilities
via the command "csum set ip|tcp|udp|sctp|outer-ip sw <port_id>".
But SW checksum calculation shouldn't depend on HW offloading
abilities. This patch is to fix this issue.

Fixes: 3926dd2b6668 ("app/testpmd: enforce offload capabilities check")

Signed-off-by: Jiayu Hu <32e4f0527a0c8fd19a4086e4191a246becffadac@intel.com>
Reviewed-by: Shahaf Shuler <59427d49da6f2b944fbf4cb5ee70ef3ac25f744f@mellanox.com>

--- app/test-pmd/cmdline.c
+++ app/test-pmd/cmdline.c
@@ -3706,40 +3706,40 @@
 			hw = 1;

 		if (!strcmp(res->proto, "ip")) {
-			if (dev_info.tx_offload_capa &
-						DEV_TX_OFFLOAD_IPV4_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+						DEV_TX_OFFLOAD_IPV4_CKSUM)) {
 				csum_offloads |= DEV_TX_OFFLOAD_IPV4_CKSUM;
 			} else {
 				printf("IP checksum offload is not supported "
 				       "by port %u\n", res->port_id);
 			}
 		} else if (!strcmp(res->proto, "udp")) {
-			if (dev_info.tx_offload_capa &
-						DEV_TX_OFFLOAD_UDP_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+						DEV_TX_OFFLOAD_UDP_CKSUM)) {
 				csum_offloads |= DEV_TX_OFFLOAD_UDP_CKSUM;
 			} else {
 				printf("UDP checksum offload is not supported "
 				       "by port %u\n", res->port_id);
 			}
 		} else if (!strcmp(res->proto, "tcp")) {
-			if (dev_info.tx_offload_capa &
-						DEV_TX_OFFLOAD_TCP_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+						DEV_TX_OFFLOAD_TCP_CKSUM)) {
 				csum_offloads |= DEV_TX_OFFLOAD_TCP_CKSUM;
 			} else {
 				printf("TCP checksum offload is not supported "
 				       "by port %u\n", res->port_id);
 			}
 		} else if (!strcmp(res->proto, "sctp")) {
-			if (dev_info.tx_offload_capa &
-						DEV_TX_OFFLOAD_SCTP_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+						DEV_TX_OFFLOAD_SCTP_CKSUM)) {
 				csum_offloads |= DEV_TX_OFFLOAD_SCTP_CKSUM;
 			} else {
 				printf("SCTP checksum offload is not supported "
 				       "by port %u\n", res->port_id);
 			}
 		} else if (!strcmp(res->proto, "outer-ip")) {
-			if (dev_info.tx_offload_capa &
-					DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) {
+			if (hw == 0 || (dev_info.tx_offload_capa &
+					DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)) {
 				csum_offloads |=
 						DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM;
 			} else {


Update PFFileObject.h (#1382)

Update PFFileObject.h (#1382)

--- Parse/Parse/PFFileObject.h
+++ Parse/Parse/PFFileObject.h
@@ -15,6 +15,14 @@

 NS_ASSUME_NONNULL_BEGIN

+ /**
+ `PFFile` was renamed to `PFFileObject`.
+ This class is just for warning developer what the right class is, in case they are migrating from SDKs before 1.17.2.
+ */
+__attribute__((unavailable("PFFile was renamed to PFFileObject. Please use it instead.")))
+@interface PFFile : NSObject
+@end
+
 /**
  `PFFileObject` representes a file of binary data stored on the Parse servers.
  This can be a image, video, or anything else that an application needs to reference in a non-relational way.


Fix high bitdepth variance overflow on uint32_t

BUG=webm:1305

Change-Id: I4c56631359e298b99e618c07bcbae9f793c5e2ac

--- aom_dsp/x86/highbd_variance_sse4.c
+++ aom_dsp/x86/highbd_variance_sse4.c
@@ -68,39 +68,42 @@
 uint32_t aom_highbd_8_variance4x4_sse4_1(const uint8_t *a, int a_stride,
                                          const uint8_t *b, int b_stride,
                                          uint32_t *sse) {
-  int64_t sum;
+  int64_t sum, diff;
   uint64_t local_sse;

   variance4x4_64_sse4_1(a, a_stride, b, b_stride, &local_sse, &sum);
   *sse = (uint32_t)local_sse;

-  return *sse - (uint32_t)((sum * sum) >> 4);
+  diff = (int64_t)*sse - ((sum * sum) >> 4);
+  return (diff >= 0) ? (uint32_t)diff : 0;
 }

 uint32_t aom_highbd_10_variance4x4_sse4_1(const uint8_t *a, int a_stride,
                                           const uint8_t *b, int b_stride,
                                           uint32_t *sse) {
-  int64_t sum;
+  int64_t sum, diff;
   uint64_t local_sse;

   variance4x4_64_sse4_1(a, a_stride, b, b_stride, &local_sse, &sum);
   *sse = (uint32_t)ROUND_POWER_OF_TWO(local_sse, 4);
   sum = ROUND_POWER_OF_TWO(sum, 2);

-  return *sse - (uint32_t)((sum * sum) >> 4);
+  diff = (int64_t)*sse - ((sum * sum) >> 4);
+  return (diff >= 0) ? (uint32_t)diff : 0;
 }

 uint32_t aom_highbd_12_variance4x4_sse4_1(const uint8_t *a, int a_stride,
                                           const uint8_t *b, int b_stride,
                                           uint32_t *sse) {
-  int64_t sum;
+  int64_t sum, diff;
   uint64_t local_sse;

   variance4x4_64_sse4_1(a, a_stride, b, b_stride, &local_sse, &sum);
   *sse = (uint32_t)ROUND_POWER_OF_TWO(local_sse, 8);
   sum = ROUND_POWER_OF_TWO(sum, 4);

-  return *sse - (uint32_t)((sum * sum) >> 4);
+  diff = (int64_t)*sse - ((sum * sum) >> 4);
+  return diff >= 0 ? (uint32_t)diff : 0;
 }

 // Sub-pixel


Bug in Vm Hooks

Bug in Vm Hooks

git-svn-id: addd40251ba30a5efebfaf2146a7968786ebe177@460 3034c82b-c49b-4eb3-8279-a7acafdc01c0


[libcheckers] document checker states

[libcheckers] document checker states

Dave Wysochanski, Red Hat

--- libcheckers/checkers.h
+++ libcheckers/checkers.h
@@ -2,7 +2,44 @@
 #define _CHECKERS_H

 /*
- * path states
+ *
+ * Userspace (multipath/multipathd) path states
+ *
+ * PATH_WILD:
+ * - Use: None of the checkers (returned if we don't have an fd)
+ * - Description: Corner case where "fd <= 0" for path fd (see checker_check())
+ *
+ * PATH_UNCHECKED:
+ * - Use: Only in directio checker
+ * - Description: set when fcntl(F_GETFL) fails to return flags or O_DIRECT
+ *   not include in flags, or O_DIRECT read fails
+ * - Notes:
+ *   - multipathd: uses it to skip over paths in sync_map_state()
+ *   - multipath: used in update_paths(); if state==PATH_UNCHECKED, call
+ *     pathinfo()
+ *
+ * PATH_DOWN:
+ * - Use: All checkers (directio, emc_clariion, hp_sw, readsector0, tur)
+ * - Description: Either a) SG_IO ioctl failed, or b) check condition on some
+ *   SG_IO ioctls that succeed (tur, readsector0 checkers); path is down and
+ *   you shouldn't try to send commands to it
+ *
+ * PATH_UP:
+ * - Use: All checkers (directio, emc_clariion, hp_sw, readsector0, tur)
+ * - Description: Path is up and I/O can be sent to it
+ *
+ * PATH_SHAKY:
+ * - Use: Only emc_clariion
+ * - Description: Indicates path not available for "normal" operations
+ *
+ * PATH_GHOST:
+ * - Use: Only hp_sw
+ * - Description: Indicates a "passive/standby" path on active/passive HP
+ *   arrays.  These paths will return valid answers to certain SCSI commands
+ *   (tur, read_capacity, inquiry, start_stop), but will fail I/O commands.
+ *   The path needs an initialization command to be sent to it in order for
+ *   I/Os to succeed.
+ *
  */
 #define PATH_WILD	-1
 #define PATH_UNCHECKED	0


Forgot to declare the additional pinning methods.

--- JSQMessagesViewController/Categories/UIView+JSQMessages.h
+++ JSQMessagesViewController/Categories/UIView+JSQMessages.h
@@ -35,4 +35,8 @@
  */
 - (void)jsq_pinAllEdgesOfSubview:(UIView *)subview;

+- (void)jsq_pinBottomOfSubview:(UIView *)subview;
+- (void)jsq_pinTopOfSubview:(UIView *)subview;
+
+
 @end


android/handsfree: Split AT+VGS and AT+VGM parsing function

--- android/handsfree.c
+++ android/handsfree.c
@@ -155,8 +155,8 @@
 	device_cleanup();
 }

-static void at_cmd_vgs_vgm(struct hfp_gw_result *result,
-				enum hfp_gw_cmd_type type, void *user_data)
+static void at_cmd_vgm(struct hfp_gw_result *result, enum hfp_gw_cmd_type type,
+								void *user_data)
 {
 	struct hal_ev_handsfree_volume ev;
 	unsigned int val;
@@ -171,7 +171,41 @@
 		if (hfp_gw_result_has_next(result))
 			break;

-		ev.type = GPOINTER_TO_UINT(type);
+		ev.type = HAL_HANDSFREE_VOLUME_TYPE_MIC;
+		ev.volume = val;
+
+		ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE,
+				HAL_EV_HANDSFREE_VOLUME, sizeof(ev), &ev);
+
+		hfp_gw_send_result(device.gw, HFP_RESULT_OK);
+
+		return;
+	case HFP_GW_CMD_TYPE_READ:
+	case HFP_GW_CMD_TYPE_TEST:
+	case HFP_GW_CMD_TYPE_COMMAND:
+		break;
+	}
+
+	hfp_gw_send_result(device.gw, HFP_RESULT_ERROR);
+}
+
+static void at_cmd_vgs(struct hfp_gw_result *result, enum hfp_gw_cmd_type type,
+								void *user_data)
+{
+	struct hal_ev_handsfree_volume ev;
+	unsigned int val;
+
+	DBG("");
+
+	switch (type) {
+	case HFP_GW_CMD_TYPE_SET:
+		if (!hfp_gw_result_get_number(result, &val) || val > 15)
+			break;
+
+		if (hfp_gw_result_has_next(result))
+			break;
+
+		ev.type = HAL_HANDSFREE_VOLUME_TYPE_SPEAKER;
 		ev.volume = val;

 		ipc_send_notif(hal_ipc, HAL_SERVICE_ID_HANDSFREE,
@@ -270,23 +304,15 @@
 {
 	if (device.hsp) {
 		/* TODO CKPD */
-		hfp_gw_register(device.gw, at_cmd_vgs_vgm, "+VGS",
-				GUINT_TO_POINTER(HAL_HANDSFREE_VOLUME_TYPE_SPEAKER),
-				NULL);
-		hfp_gw_register(device.gw, at_cmd_vgs_vgm, "+VGM",
-				GUINT_TO_POINTER(HAL_HANDSFREE_VOLUME_TYPE_MIC),
-				NULL);
+		hfp_gw_register(device.gw, at_cmd_vgs, "+VGS", NULL, NULL);
+		hfp_gw_register(device.gw, at_cmd_vgm, "+VGM", NULL, NULL);
 		return;
 	}

 	hfp_gw_register(device.gw, at_cmd_bia, "+BIA", NULL, NULL);
 	hfp_gw_register(device.gw, at_cmd_cops, "+COPS", NULL, NULL);
-	hfp_gw_register(device.gw, at_cmd_vgs_vgm, "+VGS",
-			GUINT_TO_POINTER(HAL_HANDSFREE_VOLUME_TYPE_SPEAKER),
-			NULL);
-	hfp_gw_register(device.gw, at_cmd_vgs_vgm, "+VGM",
-			GUINT_TO_POINTER(HAL_HANDSFREE_VOLUME_TYPE_MIC),
-			NULL);
+	hfp_gw_register(device.gw, at_cmd_vgs, "+VGS", NULL, NULL);
+	hfp_gw_register(device.gw, at_cmd_vgm, "+VGM", NULL, NULL);
 }

 static void at_cmd_cmer(struct hfp_gw_result *result, enum hfp_gw_cmd_type type,


Add an IPv6 printer.

Add an IPv6 printer.

Signed-off-by: Peter Jones <2e0a021e603479ff81838c00c3b770daca4e0214@redhat.com>

--- src/dp-message.c
+++ src/dp-message.c
@@ -21,6 +21,98 @@

 #include "efivar.h"
 #include "dp.h"
+
+static ssize_t
+format_ipv6_port(char *buffer, size_t buffer_size, uint8_t const *ipaddr,
+		uint16_t port)
+{
+	uint16_t *ip = (uint16_t *)ipaddr;
+	off_t offset = 0;
+	ssize_t needed;
+
+	needed = snprintf(buffer, buffer_size, "[");
+	if (needed < 0)
+		return -1;
+	offset += needed;
+
+	// deciding how to print an ipv6 ip requires 2 passes, because
+	// RFC5952 says we have to use :: a) only once and b) to maximum effect.
+	int largest_zero_block_size = 0;
+	int largest_zero_block_offset = -1;
+
+	int this_zero_block_size = 0;
+	int this_zero_block_offset = -1;
+
+	int in_zero_block = 0;
+
+	int i;
+	for (i = 0; i < 8; i++) {
+		if (ip[i] != 0 && in_zero_block) {
+			if (this_zero_block_size > largest_zero_block_size) {
+				largest_zero_block_size = this_zero_block_size;
+				largest_zero_block_offset =
+							this_zero_block_offset;
+				this_zero_block_size = 0;
+				this_zero_block_offset = -1;
+				in_zero_block = 0;
+			}
+		}
+		if (ip[i] == 0) {
+			if (in_zero_block == 0) {
+				in_zero_block = 1;
+				this_zero_block_offset = i;
+			}
+			this_zero_block_size++;
+		}
+	}
+	if (this_zero_block_size > largest_zero_block_size) {
+		largest_zero_block_size = this_zero_block_size;
+		largest_zero_block_offset = this_zero_block_offset;
+		this_zero_block_size = 0;
+		this_zero_block_offset = -1;
+		in_zero_block = 0;
+	}
+	if (largest_zero_block_size == 1)
+		largest_zero_block_offset = -1;
+
+	for (i = 0; i < 8; i++) {
+		if (largest_zero_block_offset == i) {
+			needed = snprintf(buffer + offset,
+					  buffer_size == 0 ? 0
+						: buffer_size - offset,
+					  "::");
+			if (needed < 0)
+				return -1;
+			offset += needed;
+			i += largest_zero_block_size -1;
+			continue;
+		} else if (i > 0) {
+			needed = snprintf(buffer + offset,
+					  buffer_size == 0 ? 0
+						: buffer_size - offset,
+					  ":");
+			if (needed < 0)
+				return -1;
+			offset += needed;
+		}
+
+		needed = snprintf(buffer + offset,
+				  buffer_size == 0 ? 0 : buffer_size - offset,
+				  "%x", ip[i]);
+		if (needed < 0)
+			return -1;
+		offset += needed;
+	}
+
+	needed = snprintf(buffer + offset,
+			  buffer_size == 0 ? 0 : buffer_size - offset,
+			  "]:%d", port);
+	if (needed < 0)
+		return -1;
+	offset += needed;
+
+	return offset;
+}

 ssize_t
 format_message_dn(char *buf, size_t size, const_efidp dp)
@@ -57,6 +149,36 @@
 			     a->static_ip_addr);
 		break;
 			     }
+	case EFIDP_MSG_IPv6: {
+		efidp_ipv6_addr const *a = &dp->ipv6_addr;
+		char *addr0 = NULL;
+		char *addr1 = NULL;
+
+		sz = format_ipv6_port(addr0, 0, a->local_ipv6_addr,
+				      a->local_port);
+		if (sz < 0)
+			return sz;
+
+		addr0 = alloca(sz+1);
+		sz = format_ipv6_port(addr0, sz, a->local_ipv6_addr,
+				      a->local_port);
+		if (sz < 0)
+			return sz;
+
+		sz = format_ipv6_port(addr1, 0, a->remote_ipv6_addr,
+				      a->remote_port);
+		if (sz < 0)
+			return sz;
+		addr1 = alloca(sz+1);
+		sz = format_ipv6_port(addr1, sz, a->remote_ipv6_addr,
+				      a->remote_port);
+		if (sz < 0)
+			return sz;
+
+		off += pbufx(buf, size, off, "IPv6(%s<->%s,%hx,%hhx)",
+			     addr0, addr1, a->protocol, a->ip_addr_origin);
+		break;
+			     }
 	case EFIDP_MSG_VENDOR:
 		off += format_vendor(buf+off, size?size-off:0, "VenMsg", dp);
 		break;


More efficient COutputLoggerStream: stream does not eval params if not needed

--- libs/base/include/mrpt/utils/COutputLogger.h
+++ libs/base/include/mrpt/utils/COutputLogger.h
@@ -260,9 +260,9 @@
 		~COutputLoggerStreamWrapper() { if (m_logger.isLoggingLevelVisible(m_level)) m_logger.logStr(m_level, m_str.str()); }

 		template <typename T>
-		std::stringstream & operator << (const T &val) {
-			m_str << val;
-			return m_str;
+		COutputLoggerStreamWrapper& operator << (const T &val) {
+			if (m_logger.isLoggingLevelVisible(m_level)) m_str << val;
+			return *this;
 		}
 	private:
 		std::stringstream m_str;


* added encap-formats information to the codec-info to the WX-Wizard as well (uncompiled here, but should run fine)

--- modules/gui/wxwindows/streamdata.h
+++ modules/gui/wxwindows/streamdata.h
@@ -51,63 +51,85 @@

 static struct codec vcodecs_array[] =
 {
-    { "MPEG-1 Video" , "mp1v" , N_("MPEG-1 Video codec"),
+    { "MPEG-1 Video" , "mp1v" , N_("MPEG-1 Video codec (useable with MPEG PS, " \
+		"MPEG TS, MPEG1, OGG and RAW)"),
 //       {MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_AVI, MUX_RAW, -1,-1,-1 } },
        {MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_RAW, -1,-1,-1,-1 } },
-    { "MPEG-2 Video" , "mp2v" , N_("MPEG-2 Video codec"),
+    { "MPEG-2 Video" , "mp2v" , N_("MPEG-2 Video codec (useable with MPEG PS, " \
+		"MPEG TS, MPEG1, OGG and RAW)"),
 //       {MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_AVI, MUX_RAW, -1,-1,-1 } },
        {MUX_PS, MUX_TS, MUX_MPEG, MUX_OGG, MUX_RAW, -1,-1,-1,-1 } },
-    { "MPEG-4 Video" , "mp4v" , N_("MPEG-4 Video codec"),
+    { "MPEG-4 Video" , "mp4v" , N_("MPEG-4 Video codec (useable with MPEG PS, " \
+		"MPEG TS, MPEG1, ASF, MPEG4, OGG and RAW)"),
 //       {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_AVI,MUX_RAW, -1} },
        {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_RAW, -1,-1} },
-    { "DIVX 1" ,"DIV1",N_("DivX first version") ,
+    { "DIVX 1" ,"DIV1",N_("DivX first version (useable with MPEG TS, MPEG1, ASF" \
+		" and OGG)") ,
 //       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , MUX_AVI , -1,-1,-1,-1 } },
        {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
-    { "DIVX 2" ,"DIV2",N_("DivX second version") ,
-       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
-    { "DIVX 3" ,"DIV3",N_("DivX third version") ,
-       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
-    { "H 263" , "H263" , N_("H263 is a video codec optimized for videoconference (low rates)") ,
-       { MUX_TS, MUX_AVI, -1,-1,-1,-1,-1,-1,-1 } },
-    { "H 264" , "H264" , N_("H264 is a new video codec") ,
-       { MUX_TS, MUX_AVI, -1,-1,-1,-1,-1,-1,-1 } },
-    { "WMV 1" , "WMV1", N_("WMV (Windows Media Video) 1") ,
-       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
-    { "WMV 2" , "WMV2", N_("WMV (Windows Media Video) 2") ,
-       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
-    { "MJPEG" , "MJPG", N_("MJPEG consists of a series of JPEG pictures") ,
-       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
-    { "Theora" , "theo", N_("Theora is a free general-purpose codec"),
+    { "DIVX 2" ,"DIV2",N_("DivX second version (useable with MPEG TS, MPEG1, ASF" \
+		" and OGG)") ,
+       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
+    { "DIVX 3" ,"DIV3",N_("DivX third version (useable with MPEG TS, MPEG1, ASF" \
+		" and OGG)") ,
+       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
+    { "H 263" , "H263" , N_("H263 is a video codec optimized for videoconference " \
+		"(low rates, useable with MPEG TS)") ,
+       { MUX_TS, -1, -1,-1,-1,-1,-1,-1,-1 } },
+    { "H 264" , "H264" , N_("H264 is a new video codec (useable with MPEG TS " \
+		"and MPEG4)") ,
+       { MUX_TS, MUX_MP4, -1,-1,-1,-1,-1,-1,-1 } },
+    { "WMV 1" , "WMV1", N_("WMV (Windows Media Video) 1 (useable with MPEG TS, " \
+		"MPEG1, ASF and OGG)") ,
+       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
+    { "WMV 2" , "WMV2", N_("WMV (Windows Media Video) 2 (useable with MPEG TS, " \
+		"MPEG1, ASF and OGG)") ,
+       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
+    { "MJPEG" , "MJPG", N_("MJPEG consists of a series of JPEG pictures " \
+		"(useable with MPEG TS, MPEG1, ASF and OGG)") ,
+       {MUX_TS , MUX_MPEG , MUX_ASF , MUX_OGG , -1 , -1,-1,-1,-1 } },
+    { "Theora" , "theo", N_("Theora is a free general-purpose codec (useable " \
+		"with MPEG TS)"),
        {MUX_TS, -1,-1,-1,-1,-1,-1,-1,-1} },
-    { "Dummy", "dummy", N_("Dummy codec (do not transcode)") ,
+    { "Dummy", "dummy", N_("Dummy codec (do not transcode, useable with all " \
+		"encapsulation formats)") ,
       {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_WAV,MUX_RAW,MUX_MOV}},
     { NULL,NULL,NULL , {-1,-1,-1,-1,-1,-1,-1,-1,-1}} /* Do not remove me */
 };

 static struct codec acodecs_array[] =
 {
-    { "MPEG Audio" , "mpga" , N_("The standard MPEG audio (1/2) format") ,
+    { "MPEG Audio" , "mpga" , N_("The standard MPEG audio (1/2) format " \
+		"(useable with MPEG PS, MPEG TS, MPEG1, ASF, OGG and RAW)") ,
 //       {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_AVI,MUX_RAW, -1,-1} },
        {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_RAW, -1,-1,-1} },
-    { "MP3" , "mp3" , N_("MPEG Audio Layer 3") ,
+    { "MP3" , "mp3" , N_("MPEG Audio Layer 3 (useable with MPEG PS, MPEG TS, " \
+		"MPEG1, ASF, OGG and RAW)") ,
 //       {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_AVI,MUX_RAW, -1,-1} },
        {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_RAW, -1,-1, -1} },
-    { "MPEG 4 Audio" , "mp4a" , N_("Audio format for MPEG4") ,
+    { "MPEG 4 Audio" , "mp4a" , N_("Audio format for MPEG4 (useable with " \
+		"MPEG TS and MPEG4)") ,
        {MUX_TS, MUX_MP4, -1,-1,-1,-1,-1,-1,-1 } },
-    { "A/52" , "a52" , N_("DVD audio format") ,
+    { "A/52" , "a52" , N_("DVD audio format (useable with MPEG PS, MPEG TS, " \
+		"MPEG1, ASF, OGG and RAW)") ,
 //       {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_AVI,MUX_RAW, -1,-1} },
        {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_OGG,MUX_RAW, -1,-1,-1} },
-    { "Vorbis" , "vorb" , N_("Vorbis is a free audio codec") ,
+    { "Vorbis" , "vorb" , N_("Vorbis is a free audio codec (useable with OGG)") ,
        {MUX_OGG, -1,-1,-1,-1,-1,-1,-1,-1} },
-    { "FLAC" , "flac" , N_("FLAC is a lossless audio codec") ,
+    { "FLAC" , "flac" , N_("FLAC is a lossless audio codec (useable with OGG " \
+		"and RAW)") ,
        {MUX_OGG , MUX_RAW, -1,-1,-1,-1,-1,-1,-1} },
-    { "Speex" , "spx" , N_("A free audio codec dedicated to compression of voice") ,
+    { "Speex" , "spx" , N_("A free audio codec dedicated to compression of " \
+		"voice (useable with OGG)") ,
        {MUX_OGG, -1,-1,-1,-1,-1,-1,-1,-1} },
-    { "Uncompressed, integer" , "s16l" , N_("Uncompressed audio samples"),
+    { "Uncompressed, integer" , "s16l" , N_("Uncompressed audio samples " \
+		"(useable with WAV)"),
        {MUX_WAV, -1,-1,-1,-1,-1,-1,-1,-1} },
-    { "Uncompressed, floating" , "fl32" , N_("Uncompressed audio samples"),
+    { "Uncompressed, floating" , "fl32" , N_("Uncompressed audio samples " \
+		"(useable with WAV)"),
        {MUX_WAV, -1,-1,-1,-1,-1,-1,-1,-1} },
-    { "Dummy", "dummy", N_("Dummy codec (do not transcode)") ,
+    { "Dummy", "dummy", N_("Dummy codec (do not transcode, useable with all " \
+		"encapsulation formats)") ,
 //     {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_AVI,MUX_RAW,MUX_MOV}},
      {MUX_PS,MUX_TS,MUX_MPEG,MUX_ASF,MUX_MP4,MUX_OGG,MUX_RAW,MUX_MOV,MUX_WAV}},
     { NULL,NULL,NULL , {-1,-1,-1,-1,-1,-1,-1,-1,-1}} /* Do not remove me */


ENH: change included file to BaselineFunctorBase

--- Code/Baseline/otbPlatformPositionToBaselineCalculator.h
+++ Code/Baseline/otbPlatformPositionToBaselineCalculator.h
@@ -24,7 +24,7 @@
 #include "otbMacro.h"
 #include <vnl/vnl_vector.h>
 #include "otbPlatformPositionAdapter.h"
-#include "otbLengthOrientationBaselineFunctor.h"
+#include "otbBaselineFunctorBase.h"

 namespace otb
 {


Changed many calls to dict stufff to dict2 variants. *** Somehow the call to printobject was changed back to fwrite?!?! ***

--- Python/ceval.c
+++ Python/ceval.c
@@ -61,7 +61,7 @@
 static int testbool();
 static int assign_subscript PROTO((object *, object *, object *));
 static int assign_slice PROTO((object *, object *, object *, object *));
-static int import_from PROTO((object *, object *, char *));
+static int import_from PROTO((object *, object *, object *));

 static frameobject *current_frame;
@@ -442,8 +442,8 @@
 			if (is_stringobject(v)) {
 				char *s = getstringvalue(v);
 				int len = getstringsize(v);
-				err = printobject(v, fp, PRINT_RAW);
-				if (err == 0 && len > 0 && s[len-1] == '\n')
+				fwrite(s, 1, len, fp);
+				if (len > 0 && s[len-1] == '\n')
 					softspace(sysget("stdout"), 0);
 			}
 			else {
@@ -560,9 +560,9 @@
 			break;

 		case DELETE_NAME:
-			name = GETNAME(oparg);
-			if ((err = dictremove(f->f_locals, name)) != 0)
-				err_setstr(NameError, name);
+			w = GETNAMEV(oparg);
+			if ((err = dict2remove(f->f_locals, w)) != 0)
+				err_setstr(NameError, getstringvalue(w));
 			break;

 		case UNPACK_TUPLE:
@@ -631,14 +631,17 @@
 			break;

 		case LOAD_NAME:
-			name = GETNAME(oparg);
-			x = dictlookup(f->f_locals, name);
+			w = GETNAMEV(oparg);
+			x = dict2lookup(f->f_locals, w);
 			if (x == NULL) {
-				x = dictlookup(f->f_globals, name);
+				err_clear();
+				x = dict2lookup(f->f_globals, w);
 				if (x == NULL) {
-					x = getbuiltin(name);
+					err_clear();
+					x = getbuiltin(w);
 					if (x == NULL) {
-						err_setstr(NameError, name);
+						err_setstr(NameError,
+							getstringvalue(w));
 						break;
 					}
 				}
@@ -648,12 +651,14 @@
 			break;

 		case LOAD_GLOBAL:
-			name = GETNAME(oparg);
-			x = dictlookup(f->f_globals, name);
+			w = GETNAMEV(oparg);
+			x = dict2lookup(f->f_globals, w);
 			if (x == NULL) {
-				x = getbuiltin(name);
+				err_clear();
+				x = getbuiltin(w);
 				if (x == NULL) {
-					err_setstr(NameError, name);
+					err_setstr(NameError,
+						getstringvalue(w));
 					break;
 				}
 			}
@@ -662,10 +667,10 @@
 			break;

 		case LOAD_LOCAL:
-			name = GETNAME(oparg);
-			x = dictlookup(f->f_locals, name);
+			w = GETNAMEV(oparg);
+			x = dict2lookup(f->f_locals, w);
 			if (x == NULL) {
-				err_setstr(NameError, name);
+				err_setstr(NameError, getstringvalue(w));
 				break;
 			}
 			INCREF(x);
@@ -728,9 +733,9 @@
 			break;

 		case IMPORT_FROM:
-			name = GETNAME(oparg);
+			w = GETNAMEV(oparg);
 			v = TOP();
-			err = import_from(f->f_locals, v, name);
+			err = import_from(f->f_locals, v, w);
 			break;

 		case JUMP_FORWARD:
@@ -1131,7 +1136,6 @@
 	INCREF(w);
 	return w;
 }
-
 /* External interface to call any callable object. The arg may be NULL. */

 object *
@@ -1464,36 +1468,36 @@
 import_from(locals, v, name)
 	object *locals;
 	object *v;
-	char *name;
+	object *name;
 {
 	object *w, *x;
 	w = getmoduledict(v);
-	if (name[0] == '*') {
+	if (getstringvalue(name)[0] == '*') {
 		int i;
 		int n = getdictsize(w);
 		for (i = 0; i < n; i++) {
-			name = getdictkey(w, i);
-			if (name == NULL || name[0] == '_')
+			name = getdict2key(w, i);
+			if (name == NULL || getstringvalue(name)[0] == '_')
 				continue;
-			x = dictlookup(w, name);
+			x = dict2lookup(w, name);
 			if (x == NULL) {
 				/* XXX can't happen? */
-				err_setstr(NameError, name);
+				err_setstr(NameError, getstringvalue(name));
 				return -1;
 			}
-			if (dictinsert(locals, name, x) != 0)
+			if (dict2insert(locals, name, x) != 0)
 				return -1;
 		}
 		return 0;
 	}
 	else {
-		x = dictlookup(w, name);
+		x = dict2lookup(w, name);
 		if (x == NULL) {
-			err_setstr(NameError, name);
+			err_setstr(NameError, getstringvalue(name));
 			return -1;
 		}
 		else
-			return dictinsert(locals, name, x);
+			return dict2insert(locals, name, x);
 	}
 }


[POWERPC] powerpc: fix building gdb against asm/ptrace.h

Ulrich Weigand found a bug with the current version of the
asm-powerpc/ptrace.h that prevents building at least the
SPU target version of gdb, since some ptrace opcodes are
not defined.

The problem seems to have originated in the merging of 32 and
64 bit versions of that file, the problem is that some opcodes
are only valid on 64 bit kernels, but are also used by 32 bit
programs, so they can't depends on the __powerpc64__ symbol.

Signed-off-by: Arnd Bergmann <31ce0e01d6a887319e98c2278af71350d5f64c4f@de.ibm.com>
Signed-off-by: Paul Mackerras <19a0ba370c443ba08d20b5061586430ab449ee8c@samba.org>

--- include/asm-powerpc/ptrace.h
+++ include/asm-powerpc/ptrace.h
@@ -215,12 +215,10 @@
 #define PTRACE_GETVRREGS	18
 #define PTRACE_SETVRREGS	19

-#ifndef __powerpc64__
 /* Get/set all the upper 32-bits of the SPE registers, accumulator, and
  * spefscr, in one go */
 #define PTRACE_GETEVRREGS	20
 #define PTRACE_SETEVRREGS	21
-#endif /* __powerpc64__ */

 /*
  * Get or set a debug register. The first 16 are DABR registers and the
@@ -235,7 +233,6 @@
 #define PPC_PTRACE_GETFPREGS	0x97	/* Get FPRs 0 - 31 */
 #define PPC_PTRACE_SETFPREGS	0x96	/* Set FPRs 0 - 31 */

-#ifdef __powerpc64__
 /* Calls to trace a 64bit program from a 32bit program */
 #define PPC_PTRACE_PEEKTEXT_3264 0x95
 #define PPC_PTRACE_PEEKDATA_3264 0x94
@@ -243,6 +240,5 @@
 #define PPC_PTRACE_POKEDATA_3264 0x92
 #define PPC_PTRACE_PEEKUSR_3264  0x91
 #define PPC_PTRACE_POKEUSR_3264  0x90
-#endif /* __powerpc64__ */

 #endif /* _ASM_POWERPC_PTRACE_H */


Fixed unaligned access

Fixed unaligned access

--- libfreerdp/core/info.c
+++ libfreerdp/core/info.c
@@ -285,7 +285,8 @@
 	{
 		ptrconv.bp = Stream_Pointer(s);

-		if (ptrconv.wp[cbClientAddress / 2 - 1])
+		if ((cbClientAddress < sizeof(WCHAR)) || (ptrconv.bp[cbClientAddress - 1]) ||
+		    (ptrconv.bp[cbClientAddress - 2]))
 		{
 			WLog_ERR(TAG, "protocol error: clientAddress must be null terminated");
 			return FALSE;
@@ -334,7 +335,8 @@
 	{
 		ptrconv.bp = Stream_Pointer(s);

-		if (ptrconv.wp[cbClientDir / 2 - 1])
+		if ((cbClientDir < sizeof(WCHAR)) || (ptrconv.bp[cbClientDir - 1]) ||
+		    (ptrconv.bp[cbClientDir - 2]))
 		{
 			WLog_ERR(TAG, "protocol error: clientDir must be null terminated");
 			return FALSE;


Working on Debugging why the servos do not drive

--- Proj5,Jagielski,Martinez.c
+++ Proj5,Jagielski,Martinez.c
@@ -120,25 +120,25 @@

 // look-up table for the numbers
 unsigned char number[]={
-    0x3f,   //0
-    //0x06,   //1
-    //0x5B,   //2
-    0x79,   //3
-    //0x66,   //4
-    //0x6D,   //5
-    //0x7D,   //6
-    //0x07,   //7
-    0x7F,   //8
-    //0x6F,   //9
-    //0x77,   //A
-    //0x7C,   //B
-    //0x39,   //C
-    //0x5E,   //D
-    //0x79,   //E
-    //0x71,   //F
+    0x3f,   //0   gfedcba
+    0x30,   //1   0110000
+    0x5B,   //2   1011011
+    0x79,   //3   1111001
+    0x74,   //4   1110100
+    0x6D,   //5   1101101
+    0x6F,   //6   1101111
+    0x38,   //7   0111000
+    0x7F,   //8   1111111
+    0x7D,   //9   1111101
+    0x77,   //A
+    0x7C,   //B
+    0x39,   //C
+    0x5E,   //D
+    0x79,   //E
+    0x71,   //F
     0x00,    //clear
     0x76,    //H
-    //0x38,    //L
+    0x38,    //L
     0x4F,    //E
 };

@@ -175,8 +175,10 @@
     //initialization
     INTConfigureSystem(INT_SYSTEM_CONFIG_MULT_VECTOR); //configure system for best performance
     INTEnableSystemMultiVectoredInt(); //enable multi-vector interrupts
+    core_timer_interrupt_initialize();
     timer1_interrupt_initialize(); //initialize timer 1
     timer2_interrupt_initialize(); //initialize timer 2
+    timer3_interrupt_initialize(); //initialize timer 3
     output_compare2_initialize();
     output_compare3_initialize();
     SYSTEMConfig(SYS_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE);
@@ -193,8 +195,6 @@
     PORTSetPinsDigitalOut (IOPORT_C, BIT_1|BIT_4);
     PORTSetPinsDigitalOut (IOPORT_G, BIT_0|BIT_1);
     PORTSetPinsDigitalOut (IOPORT_D, BIT_7|BIT_9|BIT_0|BIT_10);
-    PORTB = 0;      // initialize PORTG to 0
-    PORTD = 0;      // initialize PortD to 0

     /*----------Set the PMOD LEDs as output----------*/

@@ -205,7 +205,7 @@

     /*----------Set the Pmod Sensor as input----------*/
     PORTSetPinsDigitalIn (IOPORT_A, BIT_7|BIT_9|BIT_10);
-    PORTSetPinsDigitalIn (IOPORT_F, BIT_12);
+    PORTSetPinsDigitalIn (IOPORT_E, BIT_8);

     /*----------Set the Servo Driver Pmod as output----------*/
     PORTSetPinsDigitalOut (IOPORT_D, BIT_1| BIT_2);
@@ -217,6 +217,7 @@
     AD1CON3bits.ADCS = 2; // ADC clock period is Tad = 2*(ADCS+1)*Tpb = 2*3*12.5ns = 75ns
     AD1CON1bits.ADON = 1; // turn on A/D converter

+    LED1=LED2=LED3=LED4=1;

     while(1){
@@ -232,6 +233,7 @@
                 switch(movementMode){ /*----------OC2 IS CURRENTLY SET TO BE THE RIGHTMOST SERVO, OC3 IS THE LEFTMOST SERVO----------*/
                     case stop:
                         movementMode = forward;
+                        active = 1;
                         LED1=1;
                         LED2=LED3=LED4=0;
                         break;
@@ -256,6 +258,7 @@

                     case reverse: /*----------!!!If Robot moves oddly, switch the forward and back Duty Cycle configs!!!----------*/
                         movementMode = stop;
+                        active = 0;
                         LED1=LED2=LED3=LED4=1;
                         break;

@@ -271,9 +274,10 @@
         else if (!Btn1 && btnLock) { // When both buttons are off, unlock the buttons.
                 btnLock = 0;
         }
-
+        LEDs = floor(((micVal-sigOffset)*8.0)/(sigPeak-sigOffset)+0.5);
+        displaySigLevel(LEDs);
         intDisplay = (sec*10) + tenthSec;
-        toArray(intDisplay);
+
     }
 }

@@ -385,21 +389,21 @@

 void core_timer_interrupt_initialize(void){ //Timer to control updating of SSDs. Pings at 75Hz
     OpenCoreTimer(CORE_TICK_RATE);
-    mConfigIntCoreTimer((CT_INT_ON | CT_INT_PRIOR_6 | CT_INT_SUB_PRIOR_0));
+    mConfigIntCoreTimer((CT_INT_ON | CT_INT_PRIOR_6 | CT_INT_SUB_PRIOR_1));
 }

 void timer1_interrupt_initialize(void){ //Timer used to set the microphone sample rate. Pings at 20,000Hz
     OpenTimer1( (T2_ON | T1_SOURCE_INT | T1_PS_1_256), (T1_INTR_RATE) );

-    mT1SetIntPriority(1);
-    mT1SetIntSubPriority(1);
+    mT1SetIntPriority(6);
+    mT1SetIntSubPriority(2);
     mT1IntEnable(1);
 }

 void timer2_interrupt_initialize(void){ //Timer used to control seconds counter. Pings every 100ms or 10Hz
     OpenTimer2( (T2_ON | T2_SOURCE_INT | T2_PS_1_256), (T2_INTR_RATE) );

-    mT2SetIntPriority(2);
+    mT2SetIntPriority(7);
     mT2SetIntSubPriority(0);
     mT2IntEnable(1);
 }
@@ -407,7 +411,7 @@
 void timer3_interrupt_initialize(void){ //Timer used to drive the servos. Pings every 62.5Hz
     OpenTimer3( (T3_ON | T3_SOURCE_INT | T3_PS_1_256), (MOTOR_TICK_RATE) );

-    mT3SetIntPriority(3);
+    mT3SetIntPriority(4);
     mT3SetIntSubPriority(0);
     mT3IntEnable(1);
 }
@@ -426,6 +430,7 @@

     slowDownDisplay(disp==Left, number[display_value], number[display_value1]);   // debouncing & display digit

+    toArray(intDisplay);

     if(disp==Left) //display on the right side SSD
     {
@@ -441,7 +446,7 @@
     mCTClearIntFlag();  // Clear the interrupt flag

 }
-void __ISR(_TIMER_1_VECTOR, IPL2SOFT) Timer1Handler(void){ //Reading from microphone
+void __ISR(_TIMER_1_VECTOR, IPL6SOFT) Timer1Handler(void){ //Reading from microphone
     micVal = readADC(3); // sample and convert pin 3

     if(active){
@@ -451,7 +456,7 @@
     mT1ClearIntFlag();
 }

-void __ISR(_TIMER_2_VECTOR, IPL1SOFT) Timer2Handler(void){ //Counting Time
+void __ISR(_TIMER_2_VECTOR, IPL7SOFT) Timer2Handler(void){ //Counting Time

     if(active){
         if(tenthSec == 9){
@@ -470,7 +475,7 @@
     mT2ClearIntFlag();
 }

-void __ISR(_TIMER_3_VECTOR, IPL3SOFT) Timer3Handler(void){ //Settings for PWM
+void __ISR(_TIMER_3_VECTOR, IPL4SOFT) Timer3Handler(void){ //Settings for PWM
     switch(movementMode){ /*----------OC2 IS CURRENTLY SET TO BE THE RIGHTMOST SERVO, OC3 IS THE LEFTMOST SERVO----------*/
         case stop:
             SetDCOC2PWM(MOTOR_TICK_RATE / 9); //Set Duty Cycle to keep both servos still (666.666666 Hz)


[Description] MKNodeFieldTypeOptionSet does not need to explicitly conform to MKNodeFieldNumericType

MKNodeFieldOptionSetType already coforms to MKNodeFieldNumericType

--- MachOKit/Core/Description/Type/MKNodeFieldTypeOptionSet.h
+++ MachOKit/Core/Description/Type/MKNodeFieldTypeOptionSet.h
@@ -28,13 +28,12 @@
 #include <MachOKit/macho.h>
 @import Foundation;

-#import <MachOKit/MKNodeFieldNumericType.h>
 #import <MachOKit/MKNodeFieldOptionSetType.h>

 NS_ASSUME_NONNULL_BEGIN

 //----------------------------------------------------------------------------//
-@interface MKNodeFieldTypeOptionSet : NSObject <MKNodeFieldOptionSetType, MKNodeFieldNumericType> {
+@interface MKNodeFieldTypeOptionSet : NSObject <MKNodeFieldOptionSetType> {
 @package
     id<MKNodeFieldNumericType> _underlyingType;
     MKNodeFieldOptionSetOptions *_options;


[PATCH] bitops: sh: make thread_info.flags an unsigned long

The test_bit() routines are defined to work on a pointer to unsigned long.
But thread_info.flags is __u32 (unsigned int) on sh and it is passed to flag
set/clear/test wrappers in include/linux/thread_info.h.  So the compiler will
print warnings.

This patch changes to unsigned long instead.

Signed-off-by: Akinobu Mita <2d10151a363fa2f042c93a06902bb3cea5019452@miraclelinux.com>
Cc: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>
Cc: Kazumoto Kojima <5f374640ce4129c6fb14371ee9c992d96e0e729c@rr.iij4u.or.jp>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- include/asm-sh/thread_info.h
+++ include/asm-sh/thread_info.h
@@ -18,7 +18,7 @@
 struct thread_info {
 	struct task_struct	*task;		/* main task structure */
 	struct exec_domain	*exec_domain;	/* execution domain */
-	__u32			flags;		/* low level flags */
+	unsigned long		flags;		/* low level flags */
 	__u32			cpu;
 	int			preempt_count; /* 0 => preemptable, <0 => BUG */
 	struct restart_block	restart_block;


Fixed warning

Fixed warning

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

--- include/axis2_ws_info_list.h
+++ include/axis2_ws_info_list.h
@@ -42,7 +42,7 @@
 #endif

 struct axis2_ws_info;
-struct dep_engine;
+struct axis2_dep_engine;
 typedef struct axis2_ws_info_list axis2_ws_info_list_t;
 typedef struct axis2_ws_info_list_ops axis2_ws_info_list_ops_t;


fix another typo

fix another typo

--- include/builtins/helmholtz.h
+++ include/builtins/helmholtz.h
@@ -713,7 +713,7 @@
         e2e_p(T[j], Prop_z, dx, dy, 0, scale, true);
         e2e_e(T[j + 1], Evan_mz, dx, dy, 0, scale);
       } else if (tag <= 5) {
-        e2e_p(T[j], Prop_y, dx, dy, 0, scale, true);
+        e2e_p(T[j], Prop_y, dz, dx, 0, scale, true);
         e2e_e(T[j + 1], Evan_my, dz, dx, 0, scale);
       } else if (tag <= 13) {
         e2e_p(T[j], Prop_x, -dz, dy, 0, scale, true);


Fix a comment.

Fix a comment.

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

--- include/clang/AST/DeclBase.h
+++ include/clang/AST/DeclBase.h
@@ -318,7 +318,7 @@
     return const_cast<Decl*>(this)->getCanonicalDecl();
   }

-  /// \brief Whether this particular Decl is a primary one.
+  /// \brief Whether this particular Decl is a canonical one.
   bool isCanonicalDecl() const { return getCanonicalDecl() == this; }

 protected:


Silence a GCC member initialization order warning.

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

--- include/clang/Parse/Parser.h
+++ include/clang/Parse/Parser.h
@@ -754,8 +754,8 @@
   /// enter a new C++ declarator scope and exit it when the function is
   /// finished.
   class DeclaratorScopeObj {
+    Parser &P;
     CXXScopeSpec &SS;
-    Parser &P;
   public:
     DeclaratorScopeObj(Parser &p, CXXScopeSpec &ss) : P(p), SS(ss) {}


scale: use ngli_mat4_{scale,translate}()

--- libnodegl/node_scale.c
+++ libnodegl/node_scale.c
@@ -58,31 +58,18 @@
     struct scale *s = node->priv_data;
     struct ngl_node *child = s->child;
     const float *f = get_factors(s, t);
-    const NGLI_ALIGNED_MAT(sm) = {
-        f[0], 0.0f, 0.0f, 0.0f,
-        0.0f, f[1], 0.0f, 0.0f,
-        0.0f, 0.0f, f[2], 0.0f,
-        0.0f, 0.0f, 0.0f, 1.0f,
-    };
+    NGLI_ALIGNED_MAT(sm);
+    ngli_mat4_scale(sm, f[0], f[1], f[2]);
     static const float zero_anchor[3] = { 0.0, 0.0, 0.0 };
     const int translate = memcmp(s->anchor, zero_anchor, sizeof(s->anchor));
     if (translate) {
         const float *a = s->anchor;
-        const NGLI_ALIGNED_MAT(tm) = {
-            1.0f, 0.0f, 0.0f, 0.0f,
-            0.0f, 1.0f, 0.0f, 0.0f,
-            0.0f, 0.0f, 1.0f, 0.0f,
-            a[0], a[1], a[2], 1.0f,
-        };
+        NGLI_ALIGNED_MAT(tm);
+        ngli_mat4_translate(tm, a[0], a[1], a[2]);
         ngli_mat4_mul(child->modelview_matrix, node->modelview_matrix, tm);
         ngli_mat4_mul(child->modelview_matrix, child->modelview_matrix, sm);
-        const NGLI_ALIGNED_MAT(itm) = {
-            1.0f, 0.0f, 0.0f, 0.0f,
-            0.0f, 1.0f, 0.0f, 0.0f,
-            0.0f, 0.0f, 1.0f, 0.0f,
-           -a[0],-a[1],-a[2], 1.0f,
-        };
-        ngli_mat4_mul(child->modelview_matrix, child->modelview_matrix, itm);
+        ngli_mat4_translate(tm, -a[0], -a[1], -a[2]);
+        ngli_mat4_mul(child->modelview_matrix, child->modelview_matrix, tm);
     } else {
         ngli_mat4_mul(child->modelview_matrix, node->modelview_matrix, sm);
     }


Add MacOSX support

Add MacOSX support

mmap() with FIXEDMAP fails, otherwise things work.

--- libraries/libmdb/mdb.c
+++ libraries/libmdb/mdb.c
@@ -59,13 +59,26 @@

 #ifndef _WIN32
 #include <pthread.h>
+#ifdef __APPLE__
+#include <semaphore.h>
+#endif
+#endif
+
+#ifndef BYTE_ORDER
+#define BYTE_ORDER	__BYTE_ORDER
+#endif
+#ifndef LITTLE_ENDIAN
+#define LITTLE_ENDIAN	__LITTLE_ENDIAN
+#endif
+#ifndef BIG_ENDIAN
+#define BIG_ENDIAN	__BIG_ENDIAN
 #endif

 #include "mdb.h"
 #include "midl.h"

-#if (__BYTE_ORDER == __LITTLE_ENDIAN) == (__BYTE_ORDER == __BIG_ENDIAN)
-# error "Unknown or unsupported endianness (__BYTE_ORDER)"
+#if (BYTE_ORDER == LITTLE_ENDIAN) == (BYTE_ORDER == BIG_ENDIAN)
+# error "Unknown or unsupported endianness (BYTE_ORDER)"
 #elif (-6 & 5) || CHAR_BIT != 8 || UINT_MAX < 0xffffffff || ULONG_MAX % 0xFFFF
 # error "Two's complement, reasonably sized integer types, please"
 #endif
@@ -102,6 +115,13 @@
 #define	close(fd)	CloseHandle(fd)
 #define	munmap(ptr,len)	UnmapViewOfFile(ptr)
 #else
+#ifdef __APPLE__
+#define LOCK_MUTEX_R(env)	sem_wait((env)->me_rmutex)
+#define UNLOCK_MUTEX_R(env)	sem_post((env)->me_rmutex)
+#define LOCK_MUTEX_W(env)	sem_wait((env)->me_wmutex)
+#define UNLOCK_MUTEX_W(env)	sem_post((env)->me_wmutex)
+#define fdatasync(fd)	fsync(fd)
+#else
 	/** Lock the reader mutex.
 	 */
 #define LOCK_MUTEX_R(env)	pthread_mutex_lock(&(env)->me_txns->mti_mutex)
@@ -117,6 +137,7 @@
 	/** Unlock the writer mutex.
 	 */
 #define UNLOCK_MUTEX_W(env)	pthread_mutex_unlock(&(env)->me_txns->mti_wmutex)
+#endif	/* __APPLE__ */

 	/** Get the error code for the last failed system function.
 	 */
@@ -139,6 +160,10 @@
 	 *	fundamental to the use of memory-mapped files.
 	 */
 #define	GET_PAGESIZE(x)	((x) = sysconf(_SC_PAGE_SIZE))
+#endif
+
+#if defined(_WIN32) || defined(__APPLE__)
+#define MNAME_LEN	32
 #endif

 /** @} */
@@ -424,8 +449,8 @@
 	uint32_t	mtb_magic;
 		/** Version number of this lock file. Must be set to #MDB_VERSION. */
 	uint32_t	mtb_version;
-#ifdef _WIN32
-	char	mtb_rmname[32];
+#if defined(_WIN32) || defined(__APPLE__)
+	char	mtb_rmname[MNAME_LEN];
 #else
 		/** Mutex protecting access to this table.
 		 *	This is the reader lock that #LOCK_MUTEX_R acquires.
@@ -463,8 +488,8 @@
 		char pad[(sizeof(MDB_txbody)+CACHELINE-1) & ~(CACHELINE-1)];
 	} mt1;
 	union {
-#ifdef _WIN32
-		char mt2_wmname[32];
+#if defined(_WIN32) || defined(__APPLE__)
+		char mt2_wmname[MNAME_LEN];
 #define	mti_wmname	mt2.mt2_wmname
 #else
 		pthread_mutex_t	mt2_wmutex;
@@ -555,8 +580,8 @@
 	 * They are in host byte order in case that lets some
 	 * accesses be optimized into a 32-bit word access.
 	 */
-#define mn_lo mn_offset[__BYTE_ORDER!=__LITTLE_ENDIAN]
-#define mn_hi mn_offset[__BYTE_ORDER==__LITTLE_ENDIAN] /**< part of dsize or pgno */
+#define mn_lo mn_offset[BYTE_ORDER!=LITTLE_ENDIAN]
+#define mn_hi mn_offset[BYTE_ORDER==LITTLE_ENDIAN] /**< part of dsize or pgno */
 	unsigned short	mn_offset[2];	/**< storage for #mn_lo and #mn_hi */
 /** @defgroup mdb_node Node Flags
  *	@ingroup internal
@@ -813,6 +838,10 @@
 #ifdef _WIN32
 	HANDLE		me_rmutex;		/* Windows mutexes don't reside in shared mem */
 	HANDLE		me_wmutex;
+#endif
+#ifdef __APPLE__
+	sem_t		*me_rmutex;		/* Apple doesn't support shared mutexes */
+	sem_t		*me_wmutex;
 #endif
 };
 	/** max number of pages to commit in one writev() call */
@@ -2115,7 +2144,7 @@
 		 * probably not enough to assure uniqueness...
 		 */
 		sprintf(env->me_txns->mti_rmname, "Global\\MDBr%.20s", lpath);
-		ptr = env->me_txns->mti_rmname + sizeof("Global\\MDBr");
+		ptr = env->me_txns->mti_rmname + sizeof("Global\\MDBr")-1;
 		while ((ptr = strchr(ptr, '\\')))
 			*ptr++ = '/';
 		env->me_rmutex = CreateMutex(&mdb_all_sa, FALSE, env->me_txns->mti_rmname);
@@ -2123,16 +2152,47 @@
 			rc = ErrCode();
 			goto fail;
 		}
-		sprintf(env->me_txns->mti_rmname, "Global\\MDBw%.20s", lpath);
-		ptr = env->me_txns->mti_rmname + sizeof("Global\\MDBw");
+		sprintf(env->me_txns->mti_wmname, "Global\\MDBw%.20s", lpath);
+		ptr = env->me_txns->mti_wmname + sizeof("Global\\MDBw")-1;
 		while ((ptr = strchr(ptr, '\\')))
 			*ptr++ = '/';
-		env->me_wmutex = CreateMutex(&mdb_all_sa, FALSE, env->me_txns->mti_rmname);
+		env->me_wmutex = CreateMutex(&mdb_all_sa, FALSE, env->me_txns->mti_wmname);
 		if (!env->me_wmutex) {
 			rc = ErrCode();
 			goto fail;
 		}
-#else
+#else	/* _WIN32 */
+#ifdef __APPLE__
+		char *ptr;
+		sprintf(env->me_txns->mti_rmname, "MDBr%.28s", lpath);
+		ptr = env->me_txns->mti_rmname + sizeof("MDBr")-1;
+		while ((ptr = strchr(ptr, '/')))
+			*ptr++ = '_';
+		if (sem_unlink(env->me_txns->mti_rmname)) {
+			rc = ErrCode();
+			if (rc != ENOENT && rc != EINVAL)
+				goto fail;
+		}
+		env->me_rmutex = sem_open(env->me_txns->mti_rmname, O_CREAT, mode, 1);
+		if (!env->me_rmutex) {
+			rc = ErrCode();
+			goto fail;
+		}
+		sprintf(env->me_txns->mti_wmname, "MDBw%.28s", lpath);
+		ptr = env->me_txns->mti_wmname + sizeof("MDBw")-1;
+		while ((ptr = strchr(ptr, '/')))
+			*ptr++ = '_';
+		if (sem_unlink(env->me_txns->mti_wmname)) {
+			rc = ErrCode();
+			if (rc != ENOENT && rc != EINVAL)
+				goto fail;
+		}
+		env->me_wmutex = sem_open(env->me_txns->mti_wmname, O_CREAT, mode, 1);
+		if (!env->me_wmutex) {
+			rc = ErrCode();
+			goto fail;
+		}
+#else	/* __APPLE__ */
 		pthread_mutexattr_t mattr;

 		pthread_mutexattr_init(&mattr);
@@ -2142,7 +2202,8 @@
 		}
 		pthread_mutex_init(&env->me_txns->mti_mutex, &mattr);
 		pthread_mutex_init(&env->me_txns->mti_wmutex, &mattr);
-#endif
+#endif	/* __APPLE__ */
+#endif	/* _WIN32 */
 		env->me_txns->mti_version = MDB_VERSION;
 		env->me_txns->mti_magic = MDB_MAGIC;
 		env->me_txns->mti_txnid = 0;
@@ -2172,6 +2233,18 @@
 			goto fail;
 		}
 		env->me_wmutex = OpenMutex(SYNCHRONIZE, FALSE, env->me_txns->mti_wmname);
+		if (!env->me_wmutex) {
+			rc = ErrCode();
+			goto fail;
+		}
+#endif
+#ifdef __APPLE__
+		env->me_rmutex = sem_open(env->me_txns->mti_rmname, 0);
+		if (!env->me_rmutex) {
+			rc = ErrCode();
+			goto fail;
+		}
+		env->me_wmutex = sem_open(env->me_txns->mti_wmname, 0);
 		if (!env->me_wmutex) {
 			rc = ErrCode();
 			goto fail;
@@ -2341,7 +2414,7 @@
 static int
 mdb_cmp_cint(const MDB_val *a, const MDB_val *b)
 {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if BYTE_ORDER == LITTLE_ENDIAN
 	unsigned short *u, *c;
 	int x;


Added more types to csVariant

Added more types to csVariant

git-svn-id: 28d9401aa571d5108e51b194aae6f24ca5964c06@35945 8cc4aa7f-3514-0410-904f-f2cc9021211c

--- include/iutil/pluginconfig.h
+++ include/iutil/pluginconfig.h
@@ -24,6 +24,10 @@
  */
 /**\addtogroup util
  * @{ */
+#include "csgeom/vector2.h"
+#include "csgeom/vector3.h"
+#include "csgeom/vector4.h"
+#include "csutil/cscolor.h"
 #include "csutil/scf.h"
 #include "csutil/scfstr.h"

@@ -39,7 +43,23 @@
   /// Float type
   CSVAR_FLOAT,
   /// String type
-  CSVAR_STRING
+  CSVAR_STRING,
+  /// csColor type
+  CSVAR_COLOR,
+  /// csColor4 type
+  CSVAR_COLOR4,
+  /// csVector2 type
+  CSVAR_VECTOR2,
+  /// csVector3 type
+  CSVAR_VECTOR3,
+  /// csVector4 type
+  CSVAR_VECTOR4,
+  /// A VFS path, ie either a file or a directory
+  CSVAR_VFSPATH,
+  /// A VFS file
+  CSVAR_VFSFILE,
+  /// A VFS directory
+  CSVAR_VFSDIR
 };

 /**
@@ -55,35 +75,56 @@
   {
     long l;
     bool b;
-    float f;
+    // TODO: this could be more optimized...
+    float f[4];
     iString* s;
-  } v;
+  } val;
+
   void Clear()
   {
-    if ((type == CSVAR_STRING) && (v.s != 0)) v.s->DecRef();
-  }
+    if ((type == CSVAR_STRING
+	 || type == CSVAR_VFSPATH
+	 || type == CSVAR_VFSFILE
+	 || type == CSVAR_VFSDIR)
+	&& (val.s != 0)) val.s->DecRef();
+  }
+
 public:
   /// Constructor initialized with a value of type CSVAR_CMD
-  csVariant () { type = CSVAR_CMD; memset (&v, 0, sizeof (v)); }
+  csVariant () { type = CSVAR_CMD; memset (&val, 0, sizeof (val)); }
   /// Constructor initialized with a value of type CSVAR_LONG
-  csVariant (int i) { type = CSVAR_LONG; v.l = i; }
+  csVariant (int i) { type = CSVAR_LONG; val.l = i; }
   /// Constructor initialized with a value of type CSVAR_LONG
-  csVariant (long l) { type = CSVAR_LONG; v.l = l; }
+  csVariant (long l) { type = CSVAR_LONG; val.l = l; }
   /// Constructor initialized with a value of type CSVAR_BOOL
-  csVariant (bool b) { type = CSVAR_BOOL; v.b = b; }
+  csVariant (bool b) { type = CSVAR_BOOL; val.b = b; }
   /// Constructor initialized with a value of type CSVAR_FLOAT
-  csVariant (float f) { type = CSVAR_FLOAT; v.f = f; }
+  csVariant (float f) { type = CSVAR_FLOAT; val.f[0] = f; }
   /// Constructor initialized with a value of type CSVAR_STRING
-  csVariant (const char* s) { type = CSVAR_STRING; v.s = s ? new scfString (s) : nullptr; }
+  csVariant (const char* s) { type = CSVAR_STRING; val.s = s ? new scfString (s) : nullptr; }
+  /// Constructor initialized with a value of type CSVAR_COLOR
+  csVariant (csColor c) { type = CSVAR_COLOR; val.f[0] = c[0]; val.f[1] = c[1]; val.f[2] = c[2]; }
+  /// Constructor initialized with a value of type CSVAR_COLOR4
+  csVariant (csColor4 c) { type = CSVAR_COLOR4; val.f[0] = c[0]; val.f[1] = c[1]; val.f[2] = c[2]; val.f[3] = c[3]; }
+  /// Constructor initialized with a value of type CSVAR_VECTOR2
+  csVariant (csVector2 v) { type = CSVAR_VECTOR2; val.f[0] = v[0]; val.f[1] = v[1]; }
+  /// Constructor initialized with a value of type CSVAR_VECTOR3
+  csVariant (csVector3 v) { type = CSVAR_VECTOR3; val.f[0] = v[0]; val.f[1] = v[1]; val.f[2] = v[2]; }
+  /// Constructor initialized with a value of type CSVAR_VECTOR4
+  csVariant (csVector4 v) { type = CSVAR_VECTOR4; val.f[0] = v[0]; val.f[1] = v[1]; val.f[2] = v[2]; val.f[3] = v[3]; }

   /// Copy constructor.
   csVariant (const csVariant& var)
   {
-    memset (&v, 0, sizeof (v));
+    memset (&val, 0, sizeof (val));

     type = var.type;
-    v = var.v;
-    if ((type == CSVAR_STRING) && (v.s != 0)) v.s->IncRef();
+    val = var.val;
+    if ((type == CSVAR_STRING
+	 || type == CSVAR_VFSPATH
+	 || type == CSVAR_VFSFILE
+	 || type == CSVAR_VFSDIR)
+	&& (val.s != 0)) val.s->IncRef();
   }

   ~csVariant () { Clear(); }
@@ -93,8 +134,12 @@
   {
     Clear ();
     type = var.type;
-    v = var.v;
-    if ((type == CSVAR_STRING) && (v.s != 0)) v.s->IncRef ();
+    val = var.val;
+    if ((type == CSVAR_STRING
+	 || type == CSVAR_VFSPATH
+	 || type == CSVAR_VFSFILE
+	 || type == CSVAR_VFSDIR)
+	&& (val.s != 0)) val.s->IncRef ();
     return var;
   }

@@ -103,21 +148,21 @@
   {
     Clear();
     type = CSVAR_LONG;
-    v.l = l;
+    val.l = l;
   }
   /// Assign a bool
   void SetBool (bool b)
   {
     Clear();
     type = CSVAR_BOOL;
-    v.b = b;
+    val.b = b;
   }
   /// Assign a float
   void SetFloat (float f)
   {
     Clear();
     type = CSVAR_FLOAT;
-    v.f = f;
+    val.f[0] = f;
   }
   /// Assign a string
   void SetString (const char* s)
@@ -125,9 +170,9 @@
     Clear();
     type = CSVAR_STRING;
     if (s)
-      v.s = new scfString (s);
+      val.s = new scfString (s);
     else
-      v.s = 0;
+      val.s = 0;
   }
   /// Assign a command. A command has no value, it is just a flag which can be set or not.
   void SetCommand ()
@@ -135,33 +180,157 @@
     Clear();
     type = CSVAR_CMD;
   }
+  /// Assign a csColor
+  void SetColor (csColor c)
+  {
+    Clear();
+    type = CSVAR_COLOR;
+    val.f[0] = c[0];
+    val.f[1] = c[1];
+    val.f[2] = c[2];
+  }
+  /// Assign a csColor4
+  void SetColor4 (csColor4 c)
+  {
+    Clear();
+    type = CSVAR_COLOR4;
+    val.f[0] = c[0];
+    val.f[1] = c[1];
+    val.f[2] = c[2];
+    val.f[3] = c[3];
+  }
+  /// Assign a csVector2
+  void SetVector2 (csVector2 v)
+  {
+    Clear();
+    type = CSVAR_VECTOR2;
+    val.f[0] = v[0];
+    val.f[1] = v[1];
+  }
+  /// Assign a csVector3
+  void SetVector3 (csVector3 v)
+  {
+    Clear();
+    type = CSVAR_VECTOR3;
+    val.f[0] = v[0];
+    val.f[1] = v[1];
+    val.f[2] = v[2];
+  }
+  /// Assign a csVector4
+  void SetVector4 (csVector4 v)
+  {
+    Clear();
+    type = CSVAR_VECTOR4;
+    val.f[0] = v[0];
+    val.f[1] = v[1];
+    val.f[2] = v[2];
+    val.f[3] = v[3];
+  }
+  /// Assign a VFS path, ie either a file or a directory
+  void SetVFSPath (const char* s)
+  {
+    Clear();
+    type = CSVAR_VFSPATH;
+    if (s)
+      val.s = new scfString (s);
+    else
+      val.s = 0;
+  }
+  /// Assign a VFS file
+  void SetVFSFile (const char* s)
+  {
+    Clear();
+    type = CSVAR_VFSFILE;
+    if (s)
+      val.s = new scfString (s);
+    else
+      val.s = 0;
+  }
+  /// Assign a VFS directory
+  void SetVFSDir (const char* s)
+  {
+    Clear();
+    type = CSVAR_VFSDIR;
+    if (s)
+      val.s = new scfString (s);
+    else
+      val.s = 0;
+  }

   /// Retrieve a long
   long GetLong () const
   {
     CS_ASSERT (type == CSVAR_LONG);
-    return v.l;
+    return val.l;
   }
   /// Retrieve a bool
   bool GetBool () const
   {
     CS_ASSERT (type == CSVAR_BOOL);
-    return v.b;
+    return val.b;
   }
   /// Retrieve a float
   float GetFloat () const
   {
     CS_ASSERT (type == CSVAR_FLOAT);
-    return v.f;
+    return val.f[0];
   }
   /// Retrieve a string
   const char* GetString () const
   {
     CS_ASSERT (type == CSVAR_STRING);
-    return v.s->GetData();
-  }
-
-  /// Get the type of the contained value. The default value is CSVAR_LONG.
+    return val.s->GetData();
+  }
+  /// Retrieve a csColor
+  csColor GetColor () const
+  {
+    CS_ASSERT (type == CSVAR_COLOR);
+    return csColor (val.f[0], val.f[1], val.f[2]);
+  }
+  /// Retrieve a csColor4
+  csColor4 GetColor4 () const
+  {
+    CS_ASSERT (type == CSVAR_COLOR4);
+    return csColor4 (val.f[0], val.f[1], val.f[2], val.f[3]);
+  }
+  /// Retrieve a csVector2
+  csVector2 GetVector2 () const
+  {
+    CS_ASSERT (type == CSVAR_VECTOR2);
+    return csVector2 (val.f[0], val.f[1]);
+  }
+  /// Retrieve a csVector3
+  csVector3 GetVector3 () const
+  {
+    CS_ASSERT (type == CSVAR_VECTOR3);
+    return csVector3 (val.f[0], val.f[1], val.f[2]);
+  }
+  /// Retrieve a csVector4
+  csVector4 GetVector4 () const
+  {
+    CS_ASSERT (type == CSVAR_VECTOR4);
+    return csVector4 (val.f[0], val.f[1], val.f[2], val.f[3]);
+  }
+  /// Retrieve a VFS path, ie either a file or a directory
+  const char* GetVFSPath () const
+  {
+    CS_ASSERT (type == CSVAR_VFSPATH);
+    return val.s->GetData();
+  }
+  /// Retrieve a VFS file
+  const char* GetVFSFile () const
+  {
+    CS_ASSERT (type == CSVAR_VFSFILE);
+    return val.s->GetData();
+  }
+  /// Retrieve a VFS directory
+  const char* GetVFSDir () const
+  {
+    CS_ASSERT (type == CSVAR_VFSDIR);
+    return val.s->GetData();
+  }
+
+  /// Get the type of the contained value. The default value is CSVAR_CMD.
   csVariantType GetType () const { return type; }
 };


[ADT] Revert r305326 changes in BitVector.h to fix broken builds.

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

--- include/llvm/ADT/BitVector.h
+++ include/llvm/ADT/BitVector.h
@@ -16,7 +16,6 @@

 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/iterator_range.h"
-#include "llvm/Support/Compiler.h"
 #include "llvm/Support/MathExtras.h"
 #include <algorithm>
 #include <cassert>
@@ -73,7 +72,7 @@
 };

 class BitVector {
-  using BitWord = unsigned long;
+  typedef unsigned long BitWord;

   enum { BITWORD_SIZE = (unsigned)sizeof(BitWord) * CHAR_BIT };

@@ -81,11 +80,10 @@
                 "Unsupported word size");

   MutableArrayRef<BitWord> Bits; // Actual bits.
-  unsigned Size = 0;             // Size of bitvector in bits.
+  unsigned Size;                 // Size of bitvector in bits.

 public:
-  using size_type = unsigned;
-
+  typedef unsigned size_type;
   // Encapsulation of a single bit.
   class reference {
     friend class BitVector;
@@ -120,8 +118,21 @@
     }
   };

+  typedef const_set_bits_iterator_impl<BitVector> const_set_bits_iterator;
+  typedef const_set_bits_iterator set_iterator;
+
+  const_set_bits_iterator set_bits_begin() const {
+    return const_set_bits_iterator(*this);
+  }
+  const_set_bits_iterator set_bits_end() const {
+    return const_set_bits_iterator(*this, -1);
+  }
+  iterator_range<const_set_bits_iterator> set_bits() const {
+    return make_range(set_bits_begin(), set_bits_end());
+  }
+
   /// BitVector default ctor - Creates an empty bitvector.
-  BitVector() = default;
+  BitVector() : Size(0) {}

   /// BitVector ctor - Creates a bitvector of specified number of bits. All
   /// bits are initialized to the specified value.
@@ -151,21 +162,6 @@
   }

   ~BitVector() { std::free(Bits.data()); }
-
-  using const_set_bits_iterator = const_set_bits_iterator_impl<BitVector>;
-  using set_iterator = const_set_bits_iterator;
-
-  const_set_bits_iterator set_bits_begin() const {
-    return const_set_bits_iterator(*this);
-  }
-
-  const_set_bits_iterator set_bits_end() const {
-    return const_set_bits_iterator(*this, -1);
-  }
-
-  iterator_range<const_set_bits_iterator> set_bits() const {
-    return make_range(set_bits_begin(), set_bits_end());
-  }

   /// empty - Tests whether there are no bits in this bitvector.
   bool empty() const { return Size == 0; }
@@ -922,13 +918,11 @@
 } // end namespace llvm

 namespace std {
-
-/// Implement std::swap in terms of BitVector swap.
-inline void
-swap(llvm::BitVector &LHS, llvm::BitVector &RHS) {
-  LHS.swap(RHS);
-}
-
+  /// Implement std::swap in terms of BitVector swap.
+  inline void
+  swap(llvm::BitVector &LHS, llvm::BitVector &RHS) {
+    LHS.swap(RHS);
+  }
 } // end namespace std

 #endif // LLVM_ADT_BITVECTOR_H


CachedFactory destruction was leaking memory (cached objects were not deleted).
What to do with in use objects ? Deleting anyway for the moment but it might not be a good idea...
Any comments are welcome.

git-svn-id: e2e1a767b54e5f731ad8ac18fa5089ee37d5625a@794 7ec92016-0320-0410-acc4-a06ded1c099a

--- include/loki/CachedFactory.h
+++ include/loki/CachedFactory.h
@@ -22,7 +22,9 @@

 // $Id$

-
+#include <functional>
+#include <algorithm>
+#include <iostream>
 #include <vector>
 #include <iterator>
 #include <map>
@@ -30,7 +32,6 @@
 #include <loki/Key.h>

 #ifdef DO_EXTRA_LOKI_TESTS
-	#include <iostream>
 	#define D( x ) x
 #else
 	#define D( x ) ;
@@ -680,7 +681,6 @@
         KeyToObjVectorMap   fromKeyToObjVector;
         FetchedObjToKeyMap  providedObjects;
         unsigned            outObjects;
-        unsigned            maxCreation;

         ObjVector& getContainerFromKey(Key key){
             return fromKeyToObjVector[key];
@@ -743,7 +743,28 @@
             SP::onDestroy();
             EP::onDestroy(pProduct);
         }
-
+
+		// delete the object
+		template<class T> struct deleteObject : public std::unary_function<T, void>
+		{
+			void operator()(T x){ delete x; }
+		};
+
+		// delete the objects in the vector
+		template<class T> struct deleteVectorObjects : public std::unary_function<T, void>
+		{
+			void operator()(T x){
+				ObjVector &vec(x.second);
+				std::for_each(vec.begin(), vec.end(), deleteObject< typename ObjVector::value_type>());
+			}
+		};
+
+		// delete the keys of the map
+		template<class T> struct deleteMapKeys : public std::unary_function<T, void>
+		{
+			void operator()(T x){ delete x.first; }
+		};
+
      protected:
         virtual void remove(AbstractProduct * const pProduct)
         {
@@ -777,20 +798,23 @@

         ~CachedFactory()
         {
+        	using namespace std;
+            // debug information
             SP::onDebug();
-            // If execution breaks here
-            // Then you tried to destroy this Cache without releasing all the objects
-            //assert(outObjects==0);
-            // debug information
+            // cleaning the Cache
+            for_each(fromKeyToObjVector.begin(), fromKeyToObjVector.end(), deleteVectorObjects< typename KeyToObjVectorMap::value_type >() );
             if(!providedObjects.empty())
             {
-                D( std::cout << "====>>  Cache destructor : deleting "<< providedObjects.size()<<" objects  <<====" << std::endl << std::endl; )
-            }
-            // cleaning the Cache
-
-            typename FetchedObjToKeyMap::iterator itr;
-            for(itr=providedObjects.begin(); itr!=providedObjects.end();++itr)
-                delete itr->first;
+				// The factory is responsible for the creation and destruction of objects.
+				// If objects are out during the destruction of the Factory : deleting anyway.
+				// This might not be a good idea. But throwing an exception in a destructor is
+				// considered as a bad pratice and asserting might be too much.
+				// What to do ? Leaking memory or corrupting in use pointers ? hmm...
+                D( cout << "====>>  Cache destructor : deleting "<< providedObjects.size()<<" in use objects  <<====" << endl << endl; )
+                for_each(providedObjects.begin(), providedObjects.end(),
+	                deleteMapKeys< typename FetchedObjToKeyMap::value_type >()
+                );
+            }
         }

         ///////////////////////////////////


Add feature support for AES for PSA crypto config

Basic support for enabling AES through PSA_WANT_KEY_TYPE_AES.

Signed-off-by: David Brown <0af22db655f3ade5845314d695c1f4910314b0cb@linaro.org>

--- include/mbedtls/config_psa.h
+++ include/mbedtls/config_psa.h
@@ -219,6 +219,12 @@
 #define MBEDTLS_PK_C
 #endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY */
 #endif /* PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY */
+
+#if defined(PSA_WANT_KEY_TYPE_AES)
+#if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_AES)
+#define MBEDTLS_AES_C
+#endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_AES */
+#endif /* PSA_WANT_KEY_TYPE_AES */

 #else /* MBEDTLS_PSA_CRYPTO_CONFIG */

@@ -328,6 +334,10 @@
 #define PSA_WANT_ALG_SHA_512 1
 #endif

+#if defined(MBEDTLS_AES_C)
+#define PSA_WANT_KEY_TYPE_AES 1
+#endif
+
 #endif /* MBEDTLS_PSA_CRYPTO_CONFIG */

 #ifdef __cplusplus


interps are in/out

interps are in/out

git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@24149 d31e2699-5ff4-0310-a27c-f18f2fbe73fe

--- include/parrot/interpreter.h
+++ include/parrot/interpreter.h
@@ -104,8 +104,8 @@
  * gets its own macro.
  */

-#define PARROT_INTERP /*@notnull@*/ Parrot_Interp interp
-#define NULLOK_INTERP /*@null@*/    Parrot_Interp interp
+#define PARROT_INTERP /*@notnull@*/ /*@in@*/ /*@out@*/ Parrot_Interp interp
+#define NULLOK_INTERP /*@null@*/    /*@in@*/ /*@out@*/ Parrot_Interp interp
 #define SHIM_INTERP   /*@unused@*/ /*@null@*/ Parrot_Interp interp_unused __attribute__unused__


Fix parse error message

Fix parse error message

--- include/rapidjson/error/en.h
+++ include/rapidjson/error/en.h
@@ -40,7 +40,6 @@

 		case kParseErrorTermination:					return RAPIDJSON_ERROR_STRING("Terminate parsing due to Handler error.");
 		case kParseErrorUnspecificSyntaxError:			return RAPIDJSON_ERROR_STRING("Unspecific syntax error.");
-		case kParseErrorStackSizeLimitExceeded:			return RAPIDJSON_ERROR_STRING("Parsing stack size limit is exceeded.");

 		default:
 			return RAPIDJSON_ERROR_STRING("Unknown error.");


hotfix

hotfix

--- include/solver/spgqpsolver.h
+++ include/solver/spgqpsolver.h
@@ -357,7 +357,12 @@
 	/* prepare for Mdot */
 	#ifdef USE_PETSCVECTOR
 		/* without cuda */
-		TRYCXX( PetscMalloc1(3,&Mdots_val) );
+		#ifdef USE_CUDA
+			gpuErrchk( cudaMalloc((void **)&Mdots_val,3*sizeof(double)) );
+		#else
+			TRYCXX( PetscMalloc1(3,&Mdots_val) );
+		#endif
+
 		TRYCXX( PetscMalloc1(3,&Mdots_vec) );

 		Mdots_vec[0] = d->get_vector();
@@ -380,8 +385,14 @@
 	free(temp);

 	#ifdef USE_PETSCVECTOR
-		TRYCXX( PetscFree(Mdots_val) );
-		TRYCXX( PetscFree(Mdots_vec) );
+		#ifdef USE_CUDA
+			gpuErrchk( cudaFree(&Mdots_val) );
+//			gpuErrchk( cudaFree(&Mdots_vec) );
+			TRYCXX( PetscFree(Mdots_vec) );
+		#else
+			TRYCXX( PetscFree(Mdots_val) );
+			TRYCXX( PetscFree(Mdots_vec) );
+		#end
 	#endif

 	LOG_FUNC_END
@@ -1039,16 +1050,22 @@
 	TRYCXX( VecCUDACopyToGPU(Mdots_vec[1]) );
 	TRYCXX( VecCUDACopyToGPU(Mdots_vec[2]) );

-	VecDot(Mdots_vec[0],Mdots_vec[0], dd);
-	VecDot(Mdots_vec[0],Mdots_vec[1], dAd);
-	VecDot(Mdots_vec[0],Mdots_vec[2], gd);
-#else
 	TRYCXX( VecMDot( Mdots_vec[0], 3, Mdots_vec, Mdots_val) );

 	*dd = Mdots_val[0];
 	*dAd = Mdots_val[1];
 	*gd = Mdots_val[2];

+//	VecDot(Mdots_vec[0],Mdots_vec[0], dd);
+//	VecDot(Mdots_vec[0],Mdots_vec[1], dAd);
+//	VecDot(Mdots_vec[0],Mdots_vec[2], gd);
+#else
+	TRYCXX( VecMDot( Mdots_vec[0], 3, Mdots_vec, Mdots_val) );
+
+	*dd = Mdots_val[0];
+	*dAd = Mdots_val[1];
+	*gd = Mdots_val[2];
+
 #endif


[AST] Always initialize 'TypeRepr *' in TupleTypeElement

--- include/swift/AST/TypeRepr.h
+++ include/swift/AST/TypeRepr.h
@@ -653,7 +653,7 @@
   TypeRepr *Type;
   SourceLoc TrailingCommaLoc;

-  TupleTypeReprElement() {}
+  TupleTypeReprElement(): Type(nullptr) {}
   TupleTypeReprElement(TypeRepr *Type): Type(Type) {}
 };


unix: fix the build

unix: fix the build

uv_signal_t.signum was moved to uv.h in an earlier commit.

--- include/uv-private/uv-unix.h
+++ include/uv-private/uv-unix.h
@@ -252,8 +252,7 @@
   int mode;

 #define UV_SIGNAL_PRIVATE_FIELDS                                              \
-  ngx_queue_t queue;                                                          \
-  unsigned int signum;                                                        \
+  ngx_queue_t queue;

 #define UV_FS_EVENT_PRIVATE_FIELDS                                            \
   uv_fs_event_cb cb;                                                          \


sys/directdraw/gstdirectdrawsink.c

Original commit message from CVS:
* sys/directdraw/gstdirectdrawsink.c
(gst_directdraw_sink_buffer_alloc):
Reverting previous commit, it had it all mixed up, was for a different
patch (major automation screw-up). Sorry!

--- sys/directdraw/gstdirectdrawsink.c
+++ sys/directdraw/gstdirectdrawsink.c
@@ -572,8 +572,6 @@
     guint size, GstCaps * caps, GstBuffer ** buf)
 {
   GstDirectDrawSink *ddrawsink = GST_DIRECTDRAW_SINK (bsink);
-  GstStructure *structure;
-  gint width, height;
   GstDDrawSurface *surface = NULL;
   GstFlowReturn ret = GST_FLOW_OK;
   GstCaps *buffer_caps = caps;
@@ -581,14 +579,6 @@

   GST_CAT_INFO_OBJECT (directdrawsink_debug, ddrawsink,
       "a buffer of %u bytes was requested", size);
-
-  structure = gst_caps_get_structure (caps, 0);
-  if (!gst_structure_get_int (structure, "width", &width) ||
-      !gst_structure_get_int (structure, "height", &height)) {
-    GST_WARNING_OBJECT (ddrawsink, "invalid caps for buffer allocation %"
-        GST_PTR_FORMAT, caps);
-    return GST_FLOW_UNEXPECTED;
-  }

   g_mutex_lock (ddrawsink->pool_lock);

@@ -601,8 +591,8 @@
           ddrawsink->buffer_pool);

       /* If the surface is invalid for our need, destroy */
-      if ((surface->width != width) ||
-          (surface->height != height) ||
+      if ((surface->width != ddrawsink->video_width) ||
+          (surface->height != ddrawsink->video_height) ||
           (memcmp (&surface->dd_pixel_format, &ddrawsink->dd_pixel_format,
                   sizeof (DDPIXELFORMAT)) ||
               !gst_directdraw_sink_surface_check (ddrawsink, surface))
@@ -625,7 +615,9 @@
     HRESULT hres;
     DDSURFACEDESC2 surface_desc;
     DDSURFACEDESC2 *sd;
-
+    GstStructure *structure = NULL;
+
+    structure = gst_caps_get_structure (caps, 0);
     if (!gst_structure_get_int (structure, "depth", &depth)) {
       GST_CAT_DEBUG_OBJECT (directdrawsink_debug, ddrawsink,
           "Can't get depth from buffer_alloc caps");
@@ -681,7 +673,7 @@
             buffer_caps = copy_caps;
             buffercaps_unref = TRUE;
             /* update buffer size needed to store video frames according to new caps */
-            size = width * height * (bpp / 8);
+            size = ddrawsink->video_width * ddrawsink->video_height * (bpp / 8);

             /* update our member pixel format */
             gst_ddrawvideosink_get_format_from_caps (ddrawsink, buffer_caps,


Set one-8kHz.pcm instead of old one.pcm as default input for asrclient application

--- platforms/asr-client/src/main.c
+++ platforms/asr-client/src/main.c
@@ -80,7 +80,7 @@
 		params->input_file = apr_pstrdup(pool,input_file);
 	}
 	else {
-		params->input_file = "one.pcm";
+		params->input_file = "one-8kHz.pcm";
 	}

 	if(profile) {


APPEND was broken because of recent eof-change in istream-limit.

--- src/imap/cmd-append.c
+++ src/imap/cmd-append.c
@@ -289,7 +289,7 @@
 	struct client *client = cmd->client;
 	struct cmd_append_context *ctx = cmd->context;
 	size_t size;
-	int failed;
+	int failed, all_written;

 	if (ctx->save_ctx != NULL) {
 		if (mailbox_save_continue(ctx->save_ctx) < 0 ||
@@ -307,7 +307,8 @@
 		i_stream_skip(ctx->input, size);
 	}

-	if (ctx->input->v_offset == ctx->msg_size || client->input->closed) {
+	all_written = ctx->input->v_offset == ctx->msg_size;
+	if (all_written || client->input->closed) {
 		/* finished */
 		i_stream_unref(ctx->input);
 		ctx->input = NULL;
@@ -316,7 +317,7 @@
 			/* failed above */
 			client_send_storage_error(cmd, ctx->storage);
 			failed = TRUE;
-		} else if (client->input->eof) {
+		} else if (!all_written) {
 			/* client disconnected */
 			failed = TRUE;
 			mailbox_save_cancel(ctx->save_ctx);


Send search result in one write()

Send search result in one write()

--- src/imap/cmd-search.c
+++ src/imap/cmd-search.c
@@ -106,8 +106,13 @@
 static void cmd_search_more_callback(struct client_command_context *cmd)
 {
 	struct client *client = cmd->client;
+	bool finished;

-	if (cmd_search_more(cmd)) {
+	o_stream_cork(client->output);
+	finished = cmd_search_more(cmd);
+	o_stream_uncork(client->output);
+
+	if (finished) {
 		client_command_free(cmd);
 		client_continue_pending_input(client);
 	} else {


imap: Ignore QRESYNC parameters for SELECT when returning NOMODSEQ.

--- src/imap/cmd-select.c
+++ src/imap/cmd-select.c
@@ -358,7 +358,7 @@
 	}

 	if (ctx->qresync_uid_validity == status.uidvalidity &&
-	    status.uidvalidity != 0) {
+	    status.uidvalidity != 0 && !client->nonpermanent_modseqs) {
 		if ((ret = select_qresync(ctx)) < 0) {
 			client_send_box_error(ctx->cmd, ctx->box);
 			return -1;


imap: Don't crash with QRESYNC SELECT specifying sequences larger than mailbox's message count.

--- src/imap/imap-fetch.c
+++ src/imap/imap-fetch.c
@@ -150,6 +150,7 @@
 expunges_drop_known(struct imap_fetch_context *ctx, struct mail *mail,
 		    ARRAY_TYPE(seq_range) *expunged_uids)
 {
+	struct mailbox_status status;
 	const uint32_t *seqs, *uids;
 	unsigned int i, count;

@@ -158,8 +159,10 @@
 	i_assert(array_count(ctx->qresync_sample_uidset) == count);
 	i_assert(count > 0);

+	mailbox_get_status(ctx->box, STATUS_MESSAGES, &status);
+
 	/* FIXME: we could do removals from the middle as well */
-	for (i = 0; i < count; i++) {
+	for (i = 0; i < count && seqs[i] <= status.messages; i++) {
 		mail_set_seq(mail, seqs[i]);
 		if (uids[i] != mail->uid)
 			break;


net: Improve net/mii.h

net: Improve net/mii.h

--- src/include/net/mii.h
+++ src/include/net/mii.h
@@ -8,108 +8,116 @@
 #ifndef MII_H_
 #define MII_H_

-#define MII_BMCR	    0x00	/* Basic mode control register */
-#define MII_BMSR	    0x01	/* Basic mode status register  */
-#define MII_PHYSID1	    0x02	/* PHYS ID 1		       */
-#define MII_PHYSID2	    0x03	/* PHYS ID 2		       */
-#define MII_ADVERTISE	    0x04	/* Advertisement control reg   */
-#define MII_LPA		    0x05	/* Link partner ability reg    */
-#define MII_EXPANSION	    0x06	/* Expansion register	       */
-#define MII_CTRL1000	    0x09	/* 1000BASE-T control	       */
-#define MII_STAT1000	    0x0a	/* 1000BASE-T status	       */
-#define MII_ESTATUS	    0x0f	/* Extended Status */
-#define MII_DCOUNTER	    0x12	/* Disconnect counter	       */
-#define MII_FCSCOUNTER	    0x13	/* False carrier counter       */
-#define MII_NWAYTEST	    0x14	/* N-way auto-neg test reg     */
-#define MII_RERRCOUNTER     0x15	/* Receive error counter       */
-#define MII_SREVISION	    0x16	/* Silicon revision	       */
-#define MII_RESV1	    0x17	/* Reserved...		       */
-#define MII_LBRERROR	    0x18	/* Lpback, rx, bypass error    */
-#define MII_PHYADDR	    0x19	/* PHY address		       */
-#define MII_RESV2	    0x1a	/* Reserved...		       */
-#define MII_TPISTATUS	    0x1b	/* TPI status for 10mbps       */
-#define MII_NCONFIG	    0x1c	/* Network interface config    */
+#define MII_BMCR          0x00 /* Basic mode control register */
+#define MII_BMSR          0x01 /* Basic mode status register */
+#define MII_PHYSID1       0x02 /* PHYS ID 1 */
+#define MII_PHYSID2       0x03 /* PHYS ID 2 */
+#define MII_ADVERTISE     0x04 /* Advertisement control reg */
+#define MII_LPA           0x05 /* Link partner ability reg */
+#define MII_EXPANSION     0x06 /* Expansion register */
+#define MII_CTRL1000      0x09 /* 1000BASE-T control */
+#define MII_STAT1000      0x0a /* 1000BASE-T status */
+#define MII_ESTATUS       0x0f /* Extended Status */
+#define MII_DCOUNTER      0x12 /* Disconnect counter  */
+#define MII_FCSCOUNTER    0x13 /* False carrier counter */
+#define MII_NWAYTEST      0x14 /* N-way auto-neg test reg */
+#define MII_RERRCOUNTER   0x15 /* Receive error counter */
+#define MII_SREVISION     0x16 /* Silicon revision */
+#define MII_RESV1         0x17 /* Reserved... */
+#define MII_LBRERROR      0x18 /* Lpback, rx, bypass error */
+#define MII_PHYADDR       0x19 /* PHY address */
+#define MII_RESV2         0x1a /* Reserved...  */
+#define MII_TPISTATUS     0x1b /* TPI status for 10mbps */
+#define MII_NCONFIG       0x1c /* Network interface config */

 /* Link partner ability register. */
-#define LPA_SLCT		0x001f	/* Same as advertise selector  */
-#define LPA_10HALF		0x0020	/* Can do 10mbps half-duplex   */
-#define LPA_1000XFULL		0x0020	/* Can do 1000BASE-X full-duplex */
-#define LPA_10FULL		0x0040	/* Can do 10mbps full-duplex   */
-#define LPA_1000XHALF		0x0040	/* Can do 1000BASE-X half-duplex */
-#define LPA_100HALF		0x0080	/* Can do 100mbps half-duplex  */
-#define LPA_1000XPAUSE		0x0080	/* Can do 1000BASE-X pause     */
-#define LPA_100FULL		0x0100	/* Can do 100mbps full-duplex  */
-#define LPA_1000XPAUSE_ASYM	0x0100	/* Can do 1000BASE-X pause asym*/
-#define LPA_100BASE4		0x0200	/* Can do 100mbps 4k packets   */
-#define LPA_PAUSE_CAP		0x0400	/* Can pause		       */
-#define LPA_PAUSE_ASYM		0x0800	/* Can pause asymetrically     */
-#define LPA_RESV		0x1000	/* Unused...		       */
-#define LPA_RFAULT		0x2000	/* Link partner faulted        */
-#define LPA_LPACK		0x4000	/* Link partner acked us       */
-#define LPA_NPAGE		0x8000	/* Next page bit	       */
-
-#define LPA_DUPLEX              (LPA_10FULL | LPA_100FULL)
-#define LPA_10                  (LPA_10FULL | LPA_10HALF)
-#define LPA_100                 (LPA_100FULL | LPA_100HALF)
-#define LPA_1000                (LPA_1000XFULL | LPA_1000XHALF)
+#define LPA_SLCT            0x001f /* Same as advertise selector */
+#define LPA_10HALF          0x0020 /* Can do 10mbps half-duplex */
+#define LPA_1000XFULL       0x0020 /* Can do 1000BASE-X full-duplex */
+#define LPA_10FULL          0x0040 /* Can do 10mbps full-duplex */
+#define LPA_1000XHALF       0x0040 /* Can do 1000BASE-X half-duplex */
+#define LPA_100HALF         0x0080 /* Can do 100mbps half-duplex */
+#define LPA_1000XPAUSE      0x0080 /* Can do 1000BASE-X pause */
+#define LPA_100FULL         0x0100 /* Can do 100mbps full-duplex */
+#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
+#define LPA_100BASE4        0x0200 /* Can do 100mbps 4k packets */
+#define LPA_PAUSE_CAP       0x0400 /* Can pause */
+#define LPA_PAUSE_ASYM      0x0800 /* Can pause asymetrically */
+#define LPA_RESV            0x1000 /* Unused... */
+#define LPA_RFAULT          0x2000 /* Link partner faulted */
+#define LPA_LPACK           0x4000 /* Link partner acked us */
+#define LPA_NPAGE           0x8000 /* Next page bit */
+
+#define LPA_DUPLEX         (LPA_10FULL | LPA_100FULL)
+#define LPA_10             (LPA_10FULL | LPA_10HALF)
+#define LPA_100            (LPA_100FULL | LPA_100HALF)
+#define LPA_1000           (LPA_1000XFULL | LPA_1000XHALF)
+
+/* 1000BASE-T Status register */
+#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
+#define LPA_1000REMRXOK   0x1000 /* Link partner remote receiver status */
+#define LPA_1000FULL      0x0800 /* Link partner 1000BASE-T full duplex */
+#define LPA_1000HALF      0x0400 /* Link partner 1000BASE-T half duplex */

 /* Basic mode control register. */
-#define BMCR_RESV		0x003f	/* Unused...		       */
-#define BMCR_SPEED1000		0x0040	/* MSB of Speed (1000)	       */
-#define BMCR_CTST		0x0080	/* Collision test	       */
-#define BMCR_FULLDPLX		0x0100	/* Full duplex		       */
-#define BMCR_ANRESTART		0x0200	/* Auto negotiation restart    */
-#define BMCR_ISOLATE		0x0400	/* Disconnect DP83840 from MII */
-#define BMCR_PDOWN		0x0800	/* Powerdown the DP83840       */
-#define BMCR_ANENABLE		0x1000	/* Enable auto negotiation     */
-#define BMCR_SPEED100		0x2000	/* Select 100Mbps	       */
-#define BMCR_LOOPBACK		0x4000	/* TXD loopback bits	       */
-#define BMCR_RESET		0x8000	/* Reset the DP83840	       */
+#define BMCR_RESV         0x003f /* Unused... */
+#define BMCR_SPEED1000    0x0040 /* MSB of Speed (1000) */
+#define BMCR_CTST         0x0080 /* Collision test */
+#define BMCR_FULLDPLX     0x0100 /* Full duplex */
+#define BMCR_ANRESTART    0x0200 /* Auto negotiation restart */
+#define BMCR_ISOLATE      0x0400 /* Disconnect DP83840 from MII */
+#define BMCR_PDOWN        0x0800 /* Powerdown the DP83840 */
+#define BMCR_ANENABLE     0x1000 /* Enable auto negotiation */
+#define BMCR_SPEED100     0x2000 /* Select 100Mbps */
+#define BMCR_LOOPBACK     0x4000 /* TXD loopback bits */
+#define BMCR_RESET        0x8000 /* Reset the DP83840 */

 /* Basic mode status register. */
-#define BMSR_ERCAP		0x0001	/* Ext-reg capability	       */
-#define BMSR_JCD		0x0002	/* Jabber detected	       */
-#define BMSR_LSTATUS		0x0004	/* Link status		       */
-#define BMSR_ANEGCAPABLE	0x0008	/* Able to do auto-negotiation */
-#define BMSR_RFAULT		0x0010	/* Remote fault detected       */
-#define BMSR_ANEGCOMPLETE	0x0020	/* Auto-negotiation complete   */
-#define BMSR_RESV		0x00c0	/* Unused...		       */
-#define BMSR_ESTATEN		0x0100	/* Extended Status in R15 */
-#define BMSR_100HALF2		0x0200	/* Can do 100BASE-T2 HDX */
-#define BMSR_100FULL2		0x0400	/* Can do 100BASE-T2 FDX */
-#define BMSR_10HALF		0x0800	/* Can do 10mbps, half-duplex  */
-#define BMSR_10FULL		0x1000	/* Can do 10mbps, full-duplex  */
-#define BMSR_100HALF		0x2000	/* Can do 100mbps, half-duplex */
-#define BMSR_100FULL		0x4000	/* Can do 100mbps, full-duplex */
-#define BMSR_100BASE4		0x8000	/* Can do 100mbps, 4k packets  */
+#define BMSR_ERCAP        0x0001 /* Ext-reg capability */
+#define BMSR_JCD          0x0002 /* Jabber detected */
+#define BMSR_LSTATUS      0x0004 /* Link status */
+#define BMSR_ANEGCAPABLE  0x0008 /* Able to do auto-negotiation */
+#define BMSR_RFAULT       0x0010 /* Remote fault detected */
+#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
+#define BMSR_RESV         0x00c0 /* Unused... */
+#define BMSR_ESTATEN      0x0100 /* Extended Status in R15 */
+#define BMSR_100HALF2     0x0200 /* Can do 100BASE-T2 HDX */
+#define BMSR_100FULL2     0x0400 /* Can do 100BASE-T2 FDX */
+#define BMSR_10HALF       0x0800 /* Can do 10mbps, half-duplex */
+#define BMSR_10FULL       0x1000 /* Can do 10mbps, full-duplex */
+#define BMSR_100HALF      0x2000 /* Can do 100mbps, half-duplex */
+#define BMSR_100FULL      0x4000 /* Can do 100mbps, full-duplex */
+#define BMSR_100BASE4     0x8000 /* Can do 100mbps, 4k packets */

 /* Advertisement control register. */
-#define ADVERTISE_SLCT		0x001f	/* Selector bits	       */
-#define ADVERTISE_CSMA		0x0001	/* Only selector supported     */
-#define ADVERTISE_10HALF	0x0020	/* Try for 10mbps half-duplex  */
-#define ADVERTISE_1000XFULL	0x0020	/* Try for 1000BASE-X full-duplex */
-#define ADVERTISE_10FULL	0x0040	/* Try for 10mbps full-duplex  */
-#define ADVERTISE_1000XHALF	0x0040	/* Try for 1000BASE-X half-duplex */
-#define ADVERTISE_100HALF	0x0080	/* Try for 100mbps half-duplex */
-#define ADVERTISE_1000XPAUSE	0x0080	/* Try for 1000BASE-X pause    */
-#define ADVERTISE_100FULL	0x0100	/* Try for 100mbps full-duplex */
-#define ADVERTISE_1000XPSE_ASYM 0x0100	/* Try for 1000BASE-X asym pause */
-#define ADVERTISE_100BASE4	0x0200	/* Try for 100mbps 4k packets  */
-#define ADVERTISE_PAUSE_CAP	0x0400	/* Try for pause	       */
-#define ADVERTISE_PAUSE_ASYM	0x0800	/* Try for asymetric pause     */
-#define ADVERTISE_RESV		0x1000	/* Unused...		       */
-#define ADVERTISE_RFAULT	0x2000	/* Say we can detect faults    */
-#define ADVERTISE_LPACK		0x4000	/* Ack link partners response  */
-#define ADVERTISE_NPAGE		0x8000	/* Next page bit	       */
-
-#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
-			ADVERTISE_CSMA)
-#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
-		       ADVERTISE_100HALF | ADVERTISE_100FULL)
+#define ADVERTISE_SLCT          0x001f /* Selector bits */
+#define ADVERTISE_CSMA          0x0001 /* Only selector supported */
+#define ADVERTISE_10HALF        0x0020 /* Try for 10mbps half-duplex */
+#define ADVERTISE_1000XFULL     0x0020 /* Try for 1000BASE-X full-duplex */
+#define ADVERTISE_10FULL        0x0040 /* Try for 10mbps full-duplex */
+#define ADVERTISE_1000XHALF     0x0040 /* Try for 1000BASE-X half-duplex */
+#define ADVERTISE_100HALF       0x0080 /* Try for 100mbps half-duplex */
+#define ADVERTISE_1000XPAUSE    0x0080 /* Try for 1000BASE-X pause */
+#define ADVERTISE_100FULL       0x0100 /* Try for 100mbps full-duplex */
+#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */
+#define ADVERTISE_100BASE4      0x0200 /* Try for 100mbps 4k packets */
+#define ADVERTISE_PAUSE_CAP     0x0400 /* Try for pause */
+#define ADVERTISE_PAUSE_ASYM    0x0800 /* Try for asymetric pause */
+#define ADVERTISE_RESV          0x1000 /* Unused... */
+#define ADVERTISE_RFAULT        0x2000 /* Say we can detect faults */
+#define ADVERTISE_LPACK         0x4000 /* Ack link partners response */
+#define ADVERTISE_NPAGE         0x8000 /* Next page bit */
+
+#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | ADVERTISE_CSMA)
+
+#define ADVERTISE_ALL  (ADVERTISE_10HALF |  \
+						ADVERTISE_10FULL | \
+						ADVERTISE_100HALF | \
+						ADVERTISE_100FULL)

 /* 1000BASE-T Control register */
-#define ADVERTISE_1000FULL	0x0200	/* Advertise 1000BASE-T full duplex */
-#define ADVERTISE_1000HALF	0x0100	/* Advertise 1000BASE-T half duplex */
+#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
+#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */

 /* Some values interleave for 10/1000 modes, so wee need another numeration */
 #define NET_10HALF    (1 << 0)
@@ -121,6 +129,37 @@

 #define NET_GBIT      (NET_1000HALF | NET_1000FULL)

+
+/**
+ * mii_nway_result
+ * @negotiated: value of MII ANAR and'd with ANLPAR
+ *
+ * Given a set of MII abilities, check each bit and returns the
+ * currently supported media, in the priority order defined by
+ * IEEE 802.3u.  We use LPA_xxx constants but note this is not the
+ * value of LPA solely, as described above.
+ *
+ * The one exception to IEEE 802.3u is that 100baseT4 is placed
+ * between 100T-full and 100T-half.  If your phy does not support
+ * 100T4 this is fine.  If your phy places 100T4 elsewhere in the
+ * priority order, you will need to roll your own function.
+ */
+static inline unsigned int mii_nway_result (unsigned int negotiated) {
+	unsigned int ret;
+
+	if (negotiated & LPA_100FULL)
+		ret = LPA_100FULL;
+	else if (negotiated & LPA_100BASE4)
+		ret = LPA_100BASE4;
+	else if (negotiated & LPA_100HALF)
+		ret = LPA_100HALF;
+	else if (negotiated & LPA_10FULL)
+		ret = LPA_10FULL;
+	else
+		ret = LPA_10HALF;
+
+	return ret;
+}
 static inline int net_speed_to_adv(int speed) {
 	int res = 0;
 	if (speed & NET_10HALF) { res |= ADVERTISE_10HALF; }
@@ -198,5 +237,4 @@
 	return 0;
 }

-
 #endif /* MII_H_ */


Remove unused macro

Remove unused macro

--- src/internal/native.c
+++ src/internal/native.c
@@ -27,9 +27,6 @@
 #define MAX_NATIVE_ARGS     32
 #define MAX_NATIVE_ARG_SIZE 8  /* in bytes */

-#define COPY_VA_ARG(dest, args, type, va_type) \
-  *(type*)dest = va_arg(args, va_type);
-
 static struct sampgdk_array natives;

 SAMPGDK_MODULE_INIT(native) {


ipu: added video crop meta to buffers from buffer pool

Signed-off-by: Carlos Rafael Giani <d7d2e6b3863b2910d2ca34828bc651c85d88df6f@pseudoterminal.org>

--- src/ipu/buffer_pool.c
+++ src/ipu/buffer_pool.c
@@ -123,15 +123,22 @@

 	if (fsl_ipu_pool->add_video_meta)
 	{
+		GstVideoCropMeta *video_crop_meta;
+
 		gst_buffer_add_video_meta_full(
 			buf,
 			GST_VIDEO_FRAME_FLAG_NONE,
 			GST_VIDEO_INFO_FORMAT(info),
-			GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info),
+			GST_VIDEO_INFO_WIDTH(info), GST_VIDEO_INFO_HEIGHT(info),
 			GST_VIDEO_INFO_N_PLANES(info),
 			info->offset,
 			info->stride
 		);
+		video_crop_meta = gst_buffer_add_video_crop_meta(buf);
+		video_crop_meta->x = 0;
+		video_crop_meta->y = 0;
+		video_crop_meta->width = GST_VIDEO_INFO_WIDTH(info);
+		video_crop_meta->height = GST_VIDEO_INFO_HEIGHT(info);
 	}

 	if (fsl_ipu_pool->add_phys_mem_meta)


implemented istream_available(partial) for istream_delayed

--- src/istream-delayed.c
+++ src/istream-delayed.c
@@ -86,6 +86,17 @@
     return (struct istream_delayed *)(((char*)istream) - offsetof(struct istream_delayed, output));
 }

+static off_t
+istream_delayed_available(istream_t istream, int partial)
+{
+    struct istream_delayed *delayed = istream_to_delayed(istream);
+
+    if (delayed->input == NULL)
+        return (off_t)-1;
+    else
+        return istream_available(delayed->input, partial);
+}
+
 static void
 istream_delayed_read(istream_t istream)
 {
@@ -104,6 +115,7 @@
 }

 static const struct istream istream_delayed = {
+    .available = istream_delayed_available,
     .read = istream_delayed_read,
     .close = istream_delayed_close,
 };


start writing until first substitution, even when not in "writing" mode

--- src/istream-replace.c
+++ src/istream-replace.c
@@ -98,9 +98,6 @@
     struct substitution *s = ctx;
     struct replace *replace = s->replace;

-    if (!replace->writing)
-        return 0;
-
     assert(replace->quiet || replace->position <= s->start);
     assert(replace->first_substitution != NULL);
     assert(replace->first_substitution->start <= s->start);
@@ -121,7 +118,6 @@
     istream_clear_unref(&s->istream);

     if (replace->first_substitution != s ||
-        !replace->writing ||
         (!replace->quiet && replace->position < s->start))
         return;

@@ -321,9 +317,14 @@
     if (replace->quiet)
         return 0;

-    if (replace->first_substitution == NULL)
+    if (replace->first_substitution == NULL) {
+        if (!replace->writing)
+            /* block after the last substitution, unless the caller
+               has already set the "writing" flag */
+            return 1;
+
         max_length = (size_t)(replace->source_length - replace->position);
-    else if (replace->position < replace->first_substitution->start)
+    } else if (replace->position < replace->first_substitution->start)
         max_length = (size_t)(replace->first_substitution->start - replace->position);
     else
         max_length = 0;


loop in istream_replace_read() until there is output

--- src/istream-replace.c
+++ src/istream-replace.c
@@ -23,6 +23,8 @@
     struct istream output;
     istream_t input;

+    unsigned had_input:1, had_output:1;
+
     int finished;
     struct growing_buffer *buffer;
     off_t source_length, position;
@@ -105,6 +107,7 @@
         (replace->buffer != NULL && replace->position < s->start))
         return 0;

+    replace->had_output = 1;
     return istream_invoke_data(&replace->output, data, length);
 }

@@ -209,6 +212,7 @@
     if (length > max_length)
         length = max_length;

+    replace->had_output = 1;
     nbytes = istream_invoke_data(&replace->output, data, length);
     assert(nbytes <= length);

@@ -327,6 +331,8 @@
 replace_source_data(const void *data, size_t length, void *ctx)
 {
     struct replace *replace = ctx;
+
+    replace->had_input = 1;

     if (replace->buffer != NULL) {
         if (replace->source_length >= 8 * 1024 * 1024) {
@@ -445,6 +451,8 @@
     struct replace *replace = istream_to_replace(istream);
     int ret;

+    replace->had_output = 0;
+
     ret = replace_read_substitution(replace);
     if (ret)
         return;
@@ -456,8 +464,14 @@
             return;
     }

-    if (replace->input != NULL)
+    if (replace->had_output || replace->input == NULL)
+        return;
+
+    do {
+        replace->had_input = 0;
         istream_read(replace->input);
+    } while (replace->had_input && !replace->had_output &&
+             replace->input != NULL);
 }

 static void


mac80211: uninitialized return val in __ieee80211_sta_handle_tspec_ac_params

The return value should be initialized to false so that there's a
valid return value when there are no sessions that need work to be
done on them. Luckily, the side effect of using the uninitialized
value is an extra harmless driver call.

Coverity: CID 1260096
Fixes: 02219b3abca59 ("mac80211: add WMM admission control support")
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>
[extend commit message]
Signed-off-by: Johannes Berg <bff32994ff0f8d048f262a8388145a71b6071bfe@intel.com>


egl_helper: sdl2: add native_gfx_request_exit() implementation

Signed-off-by: Julien Olivain <e017b3aecfdd2dc1bdcf241eeb088a15ff1e3ada@free.fr>

--- src/egl_helper.c
+++ src/egl_helper.c
@@ -412,6 +412,8 @@

 #ifdef ENABLE_SDL2

+static int g_sdl_terminate = 0;
+
 egl_t *
 egl_init(int width, int height, int xpos, int ypos)
 {
@@ -465,12 +467,12 @@

   while (SDL_PollEvent( &e ) != 0) {
     if (e.type == SDL_QUIT) {
-      exit(EXIT_SUCCESS);
+      g_sdl_terminate = 1;
     }
     else if (e.type == SDL_KEYDOWN) {
       if (e.key.keysym.sym == SDLK_ESCAPE
           || e.key.keysym.sym == SDLK_q) {
-        exit(EXIT_SUCCESS);
+        g_sdl_terminate = 1;
       }
     }
   }
@@ -494,6 +496,13 @@
 native_gfx_get_name(void)
 {
   return ("SDL2");
+}
+
+int
+native_gfx_request_exit(const native_gfx_t *gfx)
+{
+  (void)gfx; /* Unused. */
+  return (g_sdl_terminate);
 }

 #else /* ENABLE_SDL2 */


[gi] Add missing (allow-none) annotations to g_dbus_connection_register_object()

--- gio/gdbusconnection.c
+++ gio/gdbusconnection.c
@@ -3109,7 +3109,8 @@
  * @flags: Flags describing how to subscribe to the signal (currently unused).
  * @callback: Callback to invoke when there is a signal matching the requested data.
  * @user_data: User data to pass to @callback.
- * @user_data_free_func: Function to free @user_data with when subscription is removed or %NULL.
+ * @user_data_free_func: (allow-none): Function to free @user_data with when
+ *                       subscription is removed or %NULL.
  *
  * Subscribes to signals on @connection and invokes @callback with a
  * whenever the signal is received. Note that @callback
@@ -4640,7 +4641,7 @@
  * @object_path: The object path to register at.
  * @interface_info: Introspection data for the interface.
  * @vtable: (allow-none): A #GDBusInterfaceVTable to call into or %NULL.
- * @user_data: Data to pass to functions in @vtable.
+ * @user_data: (allow-none): Data to pass to functions in @vtable.
  * @user_data_free_func: Function to call when the object path is unregistered.
  * @error: Return location for error or %NULL.
  *


Исправлена работа с массивами, TBeginit перенесена к выражениям как инициализатор массива

--- libs/compiler/syntax.c
+++ libs/compiler/syntax.c
@@ -112,13 +112,13 @@
 		|| value == TStructbeg
 		|| value == TStructend
 		|| value == TDeclarr
-		|| value == TBeginit
 		|| value == TStructinit;
 }

 int is_expression(const int value)
 {
-	return value == TConstd
+	return value == TBeginit
+		|| value == TConstd
 		|| value == TStringd
 		|| value == TExprend
 		|| value == TCondexpr
@@ -142,6 +142,23 @@
 {
 	switch (sx->tree[i++])
 	{
+		// Может иметь несколько потомков
+		case TBeginit:		// ArrayInit: n+1 потомков (размерность инициализатора, n выражений-инициализаторов);
+		{
+			size_t n = sx->tree[i++];
+			for (size_t j = 0; j < n; j++)
+			{
+				i = skipper(sx, i);
+			}
+
+			if (sx->tree[i] != TExprend)
+			{
+				system_error("TBeginit need TExprend");
+				exit(139);
+			}
+			return i + 1;
+		}
+
 		case TCondexpr:
 			return skipper(sx, i);
 		case TIdenttoaddr:
@@ -197,7 +214,7 @@
 		return i;
 	}

-	if (sx->tree[i] >= 9001 && sx->tree[i] <= 9595 || sx->tree[i] == 9651)
+	if ((sx->tree[i] >= 9001 && sx->tree[i] <= 9595) || sx->tree[i] == 9651)
 	{
 		i += 1;
 		while (!is_expression(sx->tree[i]))
@@ -266,29 +283,7 @@
 				i = skipper(sx, i);
 			}

-			return i;	// FIXME
-		}
-		case TBeginit:		// ArrayInit: n+1 потомков (размерность инициализатора, n выражений-инициализаторов);
-		{
-			size_t n = sx->tree[i++];
-			for (size_t j = 0; j < n; j++)
-			{
-				if (sx->tree[i] == TBeginit)
-				{
-					i = checker(sx, i);
-				}
-				else
-				{
-					i = skipper(sx, i);
-				}
-			}
-
-			if (sx->tree[i] != TExprend)
-			{
-				system_error("TBeginit need TExprend");
-				exit(139);
-			}
-			return i + 1;
+			return checker(sx, i);
 		}
 		case TStructbeg:	// StructDecl: n+2 потомков (размерность структуры, n объявлений полей, инициализатор (может не быть));
 			return i + 1;	// FIXME
@@ -381,7 +376,7 @@
 	i--;

 	if (!is_expression(sx->tree[i])
-		&& !(sx->tree[i] >= 9001 && sx->tree[i] <= 9595 || sx->tree[i] == 9651))
+		&& !((sx->tree[i] >= 9001 && sx->tree[i] <= 9595) || sx->tree[i] == 9651))
 	{
 		printf("checker: tree[%li] = %i\n", i, sx->tree[i]);
 	}


gdesktopappinfo: Use "Keywords" instead of "X-GNOME-Keywords"

The field has now been standardized, so drop the prefix.

--- gio/gdesktopappinfo.c
+++ gio/gdesktopappinfo.c
@@ -64,7 +64,7 @@
 #define MIME_CACHE_GROUP            "MIME Cache"
 #define GENERIC_NAME_KEY            "GenericName"
 #define FULL_NAME_KEY               "X-GNOME-FullName"
-#define KEYWORDS_KEY                "X-GNOME-Keywords"
+#define KEYWORDS_KEY                "Keywords"

 enum {
   PROP_0,


fix fcntl O_* flags for arm

fix fcntl O_* flags for arm

no idea why these 4 are permuted and the rest are standard/generic

--- arch/arm/bits/fcntl.h
+++ arch/arm/bits/fcntl.h
@@ -7,13 +7,13 @@
 #define O_DSYNC      010000
 #define O_SYNC     04010000
 #define O_RSYNC    04010000
-#define O_DIRECTORY 0200000
-#define O_NOFOLLOW  0400000
+#define O_DIRECTORY  040000
+#define O_NOFOLLOW  0100000
 #define O_CLOEXEC  02000000

 #define O_ASYNC      020000
-#define O_DIRECT     040000
-#define O_LARGEFILE 0100000
+#define O_DIRECT    0200000
+#define O_LARGEFILE 0400000
 #define O_NOATIME  01000000
 #define O_NDELAY O_NONBLOCK


be friendly with gcc-3.1.1 -O2, which takes advantage of ANSI C pointer aliasing rule (gcc optimization/7427).  from tsubai@netbsd, sync w/kame


Добавлена печать cast_expression

Добавлена печать cast_expression

--- libs/compiler/writer.c
+++ libs/compiler/writer.c
@@ -397,6 +397,30 @@
 }

 /**
+ *	Write cast expression
+ *
+ *	@param	wrt			Writer
+ *	@param	nd			Node in AST
+ *	@param	indent		Indentation
+ */
+static void write_cast_expression(writer *const wrt, const node *const nd, const size_t indent)
+{
+	write_indent(wrt, indent);
+	write(wrt, "EXPR_CAST from ");
+
+	const item_t target_type = expression_get_type(nd);
+	const item_t source_type = expression_cast_get_source_type(nd);
+
+	write_type(wrt, source_type);
+	write(wrt, " to ");
+	write_type(wrt, target_type);
+	write_expression_metadata(wrt, nd);
+
+	const node operand = expression_cast_get_operand(nd);
+	write_expression(wrt, &operand, indent + 1);
+}
+
+/**
  *	Write unary expression
  *
  *	@param	wrt			Writer
@@ -508,6 +532,10 @@

 		case EXPR_MEMBER:
 			write_member_expression(wrt, nd, indent);
+			return;
+
+		case EXPR_CAST:
+			write_cast_expression(wrt, nd, indent);
 			return;

 		case EXPR_UNARY:


gsettingschema: fix uninitialized value warning

This error could actually happen in case the assertions are off.

--- gio/gsettingsschema.c
+++ gio/gsettingsschema.c
@@ -950,7 +950,7 @@
 {
   GSettingsSchema *s = schema;
   GVariantIter *iter;
-  GVariant *value;
+  GVariant *value = NULL;

   g_return_val_if_fail (schema != NULL, NULL);


ARM: 5696/1: Include device.h in VIC driver

Currently build with the next head fails on archs using PL190
VIC because when we include amba/bus.h we need to include
device.h first.

Signed-off-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@stericsson.com>
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- arch/arm/common/vic.c
+++ arch/arm/common/vic.c
@@ -22,6 +22,7 @@
 #include <linux/list.h>
 #include <linux/io.h>
 #include <linux/sysdev.h>
+#include <linux/device.h>
 #include <linux/amba/bus.h>

 #include <asm/mach/irq.h>


Set the required IPL at the syn-cache pool instead of doing a splsoftnet() explicitly.  The function syn_cache_lookup() is always called at IPL_SOFTNET so a splsoftassert() is better than a needless splsoftnet(). OK markus@ dlg@


ds lyb BUGFIX forgotten debug message

ds lyb BUGFIX forgotten debug message

Fixes #2921

--- src/plugins/ds_lyb.c
+++ src/plugins/ds_lyb.c
@@ -748,7 +748,6 @@
     /* consolidate the cache */
     --data_cache.cache_count;
     if (i < data_cache.cache_count) {
-        SRPLG_LOG_ERR(srpds_name, "arg1 %p, arg2 %p, arg3 %u", data_cache.caches + i, data_cache.caches + i + 1, (data_cache.cache_count - i) * sizeof *data_cache.caches);
         memmove(data_cache.caches + i, data_cache.caches + i + 1, (data_cache.cache_count - i) * sizeof *data_cache.caches);
     } else if (!data_cache.cache_count) {
         free(data_cache.caches);


added cmd to create a counter

added cmd to create a counter

--- libs/ebb/CmdMenuPrim.c
+++ libs/ebb/CmdMenuPrim.c
@@ -195,6 +195,17 @@
 static sval
 CmdMenuPrim_doRun(CmdMenuPrimRef self, char *buf, uval len)
 {
+  char tmpbuf[80];
+  EBBCtrPrimId ctr;
+  sval n;
+
+  if ((len > 9 && bufEq(buf, "ctr_create", 10))) {
+    EBBCtrPrimGlobalSharedCreate(&ctr);
+    EBB_LRT_printf("%p\n", *ctr);
+    sprintf(tmpbuf, "%p", *ctr);
+    EBBCALL(self->stdout, write, buf, 17, &n);
+  }
+#if 0
   //Feel free to comment this out, just using it to test the global EBB stuff
   EBBCtrPrimId ctr;
   uval v;
@@ -227,6 +238,7 @@

   rc = EBBMessageNode8(2, testMsgHandler, 1, 2, 3, 4, 5, 6, 7, 8, &rcode);
   EBB_LRT_printf("%s, MsgNode: rc=%ld rcode=0x%lx\n", __func__, rc, rcode);
+#endif

 #if 0
   EBBCtrPrimGlobalSharedCreate(&ctr);


fix some resource id free log

fix some resource id free log

--- src/engine-gst.c
+++ src/engine-gst.c
@@ -2875,10 +2875,18 @@
 engine_gst_dispose (GObject *object)
 {
   EngineGstPrivate *priv = GET_PRIVATE (object);
+  int i;

   if (priv->listen_thread) {
     _umms_socket_thread_join((MeegoMediaPlayerControl *)object);
     priv->listen_thread = NULL;
+  }
+
+  for (i = 0; i < UMMS_MAX_SERV_CONNECTS; i++) {
+    if (priv->serv_fds[i] != -1) {
+      close(priv->serv_fds[i]);
+    }
+    priv->serv_fds[i] = -1;
   }

   if (priv->socks_lock) {
@@ -3661,6 +3669,9 @@

   g_mutex_lock (priv->socks_lock);
   for (i = 0; i < UMMS_MAX_SERV_CONNECTS; i++) {
+    if (priv->serv_fds[i] != -1) {
+      close(priv->serv_fds[i]);
+    }
     priv->serv_fds[i] = -1;
   }
   g_mutex_unlock (priv->socks_lock);