Yajl: Remove empty parent keys from tests

--- src/plugins/yajl/testmod_yajl.c
+++ src/plugins/yajl/testmod_yajl.c
@@ -34,8 +34,6 @@
 {
 	Key *k1, *k2;
 	KeySet *ks = ksNew(10,
-			keyNew("user/tests/yajl",
-			       KEY_END),
 			k1 = keyNew("user/tests/yajl/nullkey",
 			       KEY_VALUE, "will be removed",
 			       KEY_END),
@@ -54,25 +52,9 @@
 KeySet *getBelowKeys(void)
 {
 	KeySet *ks = ksNew(10,
-			keyNew("user/tests/yajl",
-			       KEY_END),
-			keyNew("user/tests/yajl/fancy",
-			       KEY_END),
-			keyNew("user/tests/yajl/fancy/path",
-			       KEY_END),
-			keyNew("user/tests/yajl/fancy/path/below",
-			       KEY_END),
-			keyNew("user/tests/yajl/fancy/path/below/x",
-			       KEY_END),
-			keyNew("user/tests/yajl/fancy/path/below/x/y",
-			       KEY_END),
 			keyNew("user/tests/yajl/fancy/path/below/x/y/z",
 			       KEY_VALUE, "val1",
 			       KEY_END),
-			keyNew("user/tests/yajl/fancy/path/below/v",
-			       KEY_END),
-			keyNew("user/tests/yajl/fancy/path/below/v/y",
-			       KEY_END),
 			keyNew("user/tests/yajl/fancy/path/below/v/y/z",
 			       KEY_VALUE, "val2",
 			       KEY_END),
@@ -114,8 +96,6 @@
 KeySet *getBooleanKeys(void)
 {
 	KeySet *ks = ksNew(10,
-			keyNew("user/tests/yajl",
-			       KEY_END),
 			keyNew("user/tests/yajl/boolean_key",
 			       KEY_VALUE, "true",
 			       KEY_META, "type", "boolean",
@@ -134,8 +114,6 @@
 KeySet *getNumberKeys(void)
 {
 	KeySet *ks = ksNew(10,
-			keyNew("user/tests/yajl",
-			       KEY_END),
 			keyNew("user/tests/yajl/number_key",
 			       KEY_VALUE, "25",
 			       KEY_META, "type", "double",
@@ -157,8 +135,6 @@
 KeySet *getStringKeys(void)
 {
 	KeySet *ks = ksNew(10,
-			keyNew("user/tests/yajl",
-			       KEY_END),
 			keyNew("user/tests/yajl/string_key",
 			       KEY_VALUE, "25",
 			       KEY_END),
@@ -177,26 +153,18 @@
 KeySet *getMapKeys (void)
 {
 	KeySet *ks = ksNew(10,
-			keyNew("user/tests/yajl",
-			       KEY_END),
-			keyNew("user/tests/yajl/map",
-			       KEY_END),
 			keyNew("user/tests/yajl/map/string_key",
 			       KEY_VALUE, "25",
 			       KEY_END),
 			keyNew("user/tests/yajl/map/second_string_key",
 			       KEY_VALUE, "some string",
 			       KEY_END),
-			keyNew("user/tests/yajl/map/nested_map",
-			       KEY_END),
 			keyNew("user/tests/yajl/map/nested_map/string_key",
 			       KEY_VALUE, "25",
 			       KEY_END),
 			keyNew("user/tests/yajl/map/nested_map/second_string_key",
 			       KEY_VALUE, "some string",
 			       KEY_END),
-			keyNew("user/tests/yajl/second_map",
-			       KEY_END),
 			keyNew("user/tests/yajl/second_map/string_key",
 			       KEY_VALUE, "25",
 			       KEY_END),
@@ -218,10 +186,6 @@
 KeySet *getArrayKeys(void)
 {
 	KeySet *ks = ksNew(30,
-			keyNew("user/tests/yajl",
-			       KEY_END),
-			keyNew("user/tests/yajl/array",
-			       KEY_END),
 			keyNew("user/tests/yajl/array/#0",
 			       KEY_VALUE, "true",
 			       KEY_META, "type", "boolean",
@@ -290,21 +254,6 @@
 KeySet *getOpenICCKeys(void)
 {
 	KeySet *ks = ksNew(60,
-			keyNew("user/tests/yajl",
-			       KEY_END),
-
-keyNew("user/tests/yajl/org",
-		KEY_END),
-keyNew("user/tests/yajl/org/freedesktop",
-		KEY_END),
-keyNew("user/tests/yajl/org/freedesktop/openicc",
-		KEY_END),
-keyNew("user/tests/yajl/org/freedesktop/openicc/device",
-		KEY_END),
-keyNew("user/tests/yajl/org/freedesktop/openicc/device/camera",
-		KEY_END),
-keyNew("user/tests/yajl/org/freedesktop/openicc/device/camera/#0",
-		KEY_END),
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/camera/#0/prefix",
 		KEY_VALUE, "EXIF_",
 		KEY_END),
@@ -331,8 +280,6 @@
 		KEY_VALUE, "1", KEY_END),
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/camera/#0/comment",
 		KEY_VALUE, "nonsense example", KEY_END),
-keyNew("user/tests/yajl/org/freedesktop/openicc/device/camera/#1",
-		KEY_END),
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/camera/#1/prefix",
 		KEY_VALUE, "EXIF_", KEY_END),
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/camera/#1/EXIF_model",
@@ -356,10 +303,6 @@
 // keyNew("user/tests/yajl/org/freedesktop/openicc/device/camera/#1/automatic_assignment",
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/camera/#1/automatic_assigment",
 		KEY_VALUE, "1", KEY_END),
-keyNew("user/tests/yajl/org/freedesktop/openicc/device/monitor",
-		KEY_END),
-keyNew("user/tests/yajl/org/freedesktop/openicc/device/monitor/#0",
-		KEY_END),
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/monitor/#0/prefix",
 		KEY_VALUE, "EDID_", KEY_END),
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/monitor/#0/EDID_mnft_id",
@@ -394,8 +337,6 @@
 		KEY_VALUE, "Vendor1", KEY_END),
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/monitor/#0/EDID_date",
 		KEY_VALUE, "2007-T16", KEY_END),
-keyNew("user/tests/yajl/org/freedesktop/openicc/device/monitor/#1",
-		KEY_END),
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/monitor/#1/prefix",
 		KEY_VALUE, "EDID_", KEY_END),
 keyNew("user/tests/yajl/org/freedesktop/openicc/device/monitor/#1/EDID_mnft_id",


Added argument m,n,k metadata to JSON files

--- include/internal/tuning.h
+++ include/internal/tuning.h
@@ -108,11 +108,17 @@
     printf(" or %.1lf %s\n", C::GetMetric(args)/(time_ms*1.0e6), C::PerformanceUnit().c_str());
   }

-  // Outputs the results as JSON to disk
-  tuner.PrintJSON("clblast_"+C::KernelFamily()+".json", {
+  // Outputs the results as JSON to disk, including some meta-data
+  auto metadata = std::vector<std::pair<std::string,std::string>>{
     {"kernel_family", C::KernelFamily()},
     {"precision", std::to_string(static_cast<size_t>(args.precision))}
-  });
+  };
+  for (auto &o: C::GetOptions()) {
+    if (o == kArgM) { metadata.push_back({"arg_m", std::to_string(args.m)}); }
+    if (o == kArgN) { metadata.push_back({"arg_n", std::to_string(args.n)}); }
+    if (o == kArgK) { metadata.push_back({"arg_k", std::to_string(args.k)}); }
+  }
+  tuner.PrintJSON("clblast_"+C::KernelFamily()+".json", metadata);
 }

 // =================================================================================================


DMAENGINE: generic slave channel control v3

This adds an interface to the DMAengine to make it possible to
reconfigure a slave channel at runtime. We add a few foreseen
config parameters to the passed struct, with a void * pointer
for custom per-device or per-platform runtime slave data.

Signed-off-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@stericsson.com>
Signed-off-by: Dan Williams <24ee2bf0bd8ac766c348bf1f0639943bac1535c6@intel.com>

--- include/linux/dmaengine.h
+++ include/linux/dmaengine.h
@@ -114,11 +114,17 @@
  * @DMA_TERMINATE_ALL: terminate all ongoing transfers
  * @DMA_PAUSE: pause ongoing transfers
  * @DMA_RESUME: resume paused transfer
+ * @DMA_SLAVE_CONFIG: this command is only implemented by DMA controllers
+ * that need to runtime reconfigure the slave channels (as opposed to passing
+ * configuration data in statically from the platform). An additional
+ * argument of struct dma_slave_config must be passed in with this
+ * command.
  */
 enum dma_ctrl_cmd {
 	DMA_TERMINATE_ALL,
 	DMA_PAUSE,
 	DMA_RESUME,
+	DMA_SLAVE_CONFIG,
 };

 /**
@@ -197,6 +203,71 @@
 	struct device device;
 	int dev_id;
 	atomic_t *idr_ref;
+};
+
+/**
+ * enum dma_slave_buswidth - defines bus with of the DMA slave
+ * device, source or target buses
+ */
+enum dma_slave_buswidth {
+	DMA_SLAVE_BUSWIDTH_UNDEFINED = 0,
+	DMA_SLAVE_BUSWIDTH_1_BYTE = 1,
+	DMA_SLAVE_BUSWIDTH_2_BYTES = 2,
+	DMA_SLAVE_BUSWIDTH_4_BYTES = 4,
+	DMA_SLAVE_BUSWIDTH_8_BYTES = 8,
+};
+
+/**
+ * struct dma_slave_config - dma slave channel runtime config
+ * @direction: whether the data shall go in or out on this slave
+ * channel, right now. DMA_TO_DEVICE and DMA_FROM_DEVICE are
+ * legal values, DMA_BIDIRECTIONAL is not acceptable since we
+ * need to differentiate source and target addresses.
+ * @src_addr: this is the physical address where DMA slave data
+ * should be read (RX), if the source is memory this argument is
+ * ignored.
+ * @dst_addr: this is the physical address where DMA slave data
+ * should be written (TX), if the source is memory this argument
+ * is ignored.
+ * @src_addr_width: this is the width in bytes of the source (RX)
+ * register where DMA data shall be read. If the source
+ * is memory this may be ignored depending on architecture.
+ * Legal values: 1, 2, 4, 8.
+ * @dst_addr_width: same as src_addr_width but for destination
+ * target (TX) mutatis mutandis.
+ * @src_maxburst: the maximum number of words (note: words, as in
+ * units of the src_addr_width member, not bytes) that can be sent
+ * in one burst to the device. Typically something like half the
+ * FIFO depth on I/O peripherals so you don't overflow it. This
+ * may or may not be applicable on memory sources.
+ * @dst_maxburst: same as src_maxburst but for destination target
+ * mutatis mutandis.
+ *
+ * This struct is passed in as configuration data to a DMA engine
+ * in order to set up a certain channel for DMA transport at runtime.
+ * The DMA device/engine has to provide support for an additional
+ * command in the channel config interface, DMA_SLAVE_CONFIG
+ * and this struct will then be passed in as an argument to the
+ * DMA engine device_control() function.
+ *
+ * The rationale for adding configuration information to this struct
+ * is as follows: if it is likely that most DMA slave controllers in
+ * the world will support the configuration option, then make it
+ * generic. If not: if it is fixed so that it be sent in static from
+ * the platform data, then prefer to do that. Else, if it is neither
+ * fixed at runtime, nor generic enough (such as bus mastership on
+ * some CPU family and whatnot) then create a custom slave config
+ * struct and pass that, then make this config a member of that
+ * struct, if applicable.
+ */
+struct dma_slave_config {
+	enum dma_data_direction direction;
+	dma_addr_t src_addr;
+	dma_addr_t dst_addr;
+	enum dma_slave_buswidth src_addr_width;
+	enum dma_slave_buswidth dst_addr_width;
+	u32 src_maxburst;
+	u32 dst_maxburst;
 };

 static inline const char *dma_chan_name(struct dma_chan *chan)


wireless: add peer-to-peer related definitions

The Peer-to-Peer IE is vendor-specific IE identified by WiFi Alliance
OUI and specific P2P OUI type. The payload of this IE consists of
so-called P2P attributes. This patch adds definitions for processing
these attributes.

Reviewed-by: Hante Meuleman <31ca5aa57e9f47a38c33f2797b138069dfa82656@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <d101f7ec36e185d305862a92a05a9a0c1b62aa38@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <c740ae0f5dfc9bd2203ae1a0d3155a31e94c745d@broadcom.com>
Signed-off-by: Arend van Spriel <06447fbe43693466d3293d0b5eaeeb2efd3d7d3a@broadcom.com>
Signed-off-by: Johannes Berg <bff32994ff0f8d048f262a8388145a71b6071bfe@intel.com>

--- include/linux/ieee80211.h
+++ include/linux/ieee80211.h
@@ -905,6 +905,38 @@
 	} u;
 } __packed;

+/*
+ * Peer-to-Peer IE attribute related definitions.
+ */
+/**
+ * enum ieee80211_p2p_attr_id - identifies type of peer-to-peer attribute.
+ */
+enum ieee80211_p2p_attr_id {
+	IEEE80211_P2P_ATTR_STATUS = 0,
+	IEEE80211_P2P_ATTR_MINOR_REASON,
+	IEEE80211_P2P_ATTR_CAPABILITY,
+	IEEE80211_P2P_ATTR_DEVICE_ID,
+	IEEE80211_P2P_ATTR_GO_INTENT,
+	IEEE80211_P2P_ATTR_GO_CONFIG_TIMEOUT,
+	IEEE80211_P2P_ATTR_LISTEN_CHANNEL,
+	IEEE80211_P2P_ATTR_GROUP_BSSID,
+	IEEE80211_P2P_ATTR_EXT_LISTEN_TIMING,
+	IEEE80211_P2P_ATTR_INTENDED_IFACE_ADDR,
+	IEEE80211_P2P_ATTR_MANAGABILITY,
+	IEEE80211_P2P_ATTR_CHANNEL_LIST,
+	IEEE80211_P2P_ATTR_ABSENCE_NOTICE,
+	IEEE80211_P2P_ATTR_DEVICE_INFO,
+	IEEE80211_P2P_ATTR_GROUP_INFO,
+	IEEE80211_P2P_ATTR_GROUP_ID,
+	IEEE80211_P2P_ATTR_INTERFACE,
+	IEEE80211_P2P_ATTR_OPER_CHANNEL,
+	IEEE80211_P2P_ATTR_INVITE_FLAGS,
+	/* 19 - 220: Reserved */
+	IEEE80211_P2P_ATTR_VENDOR_SPECIFIC = 221,
+
+	IEEE80211_P2P_ATTR_MAX
+};
+
 /**
  * struct ieee80211_bar - HT Block Ack Request
  *


do not make memory operands dependend on number of reload user

--- ir/be/bechordal_main.c
+++ ir/be/bechordal_main.c
@@ -346,9 +346,12 @@
 	if (! be_is_Reload(irn))
 		return;

-	// only use memory operands, if the reload is only used by 1 node
+	/* always use addressmode, it's good for x86 */
+#if 0
+	/* only use memory operands, if the reload is only used by 1 node */
 	if(get_irn_n_edges(irn) > 1)
 		return;
+#endif

 	spill = be_get_Reload_mem(irn);
 	block = get_nodes_block(irn);


ieee80211: add mesh action codes

ieee80211: add mesh action codes

Signed-off-by: Thomas Pedersen <5f50a84c1fa3bcff146405017f36aec1a10a9e38@cozybit.com>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>

--- include/linux/ieee80211.h
+++ include/linux/ieee80211.h
@@ -1307,6 +1307,21 @@
 	WLAN_SP_MGK_ACK = 5,
 };

+/* Mesh action codes */
+enum ieee80211_mesh_actioncode {
+	WLAN_MESH_ACTION_LINK_METRIC_REPORT,
+	WLAN_MESH_ACTION_HWMP_PATH_SELECTION,
+	WLAN_MESH_ACTION_GATE_ANNOUNCEMENT,
+	WLAN_MESH_ACTION_CONGESTION_CONTROL_NOTIFICATION,
+	WLAN_MESH_ACTION_MCCA_SETUP_REQUEST,
+	WLAN_MESH_ACTION_MCCA_SETUP_REPLY,
+	WLAN_MESH_ACTION_MCCA_ADVERTISEMENT_REQUEST,
+	WLAN_MESH_ACTION_MCCA_ADVERTISEMENT,
+	WLAN_MESH_ACTION_MCCA_TEARDOWN,
+	WLAN_MESH_ACTION_TBTT_ADJUSTMENT_REQUEST,
+	WLAN_MESH_ACTION_TBTT_ADJUSTMENT_RESPONSE,
+};
+
 /* Security key length */
 enum ieee80211_key_len {
 	WLAN_KEY_LEN_WEP40 = 5,


fix memory leak in g_bookmark_file_parse()

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

Signed-off-by: Ravi Sankar Guntur <66954012c32699f1532ef3b4a55c5fdb6a5e1456@samsung.com>

--- glib/gbookmarkfile.c
+++ glib/gbookmarkfile.c
@@ -1418,9 +1418,9 @@

 static gboolean
 g_bookmark_file_parse (GBookmarkFile  *bookmark,
-			 const gchar      *buffer,
-			 gsize             length,
-			 GError          **error)
+			 const gchar  *buffer,
+			 gsize         length,
+			 GError       **error)
 {
   GMarkupParseContext *context;
   ParseData *parse_data;
@@ -1431,6 +1431,9 @@

   if (!buffer)
     return FALSE;
+
+  parse_error = NULL;
+  end_error = NULL;

   if (length == (gsize) -1)
     length = strlen (buffer);
@@ -1443,30 +1446,22 @@
   					parse_data,
   					(GDestroyNotify) parse_data_free);

-  parse_error = NULL;
   retval = g_markup_parse_context_parse (context,
   					 buffer,
   					 length,
   					 &parse_error);
   if (!retval)
-    {
-      g_propagate_error (error, parse_error);
-
-      return FALSE;
-    }
-
-  end_error = NULL;
-  retval = g_markup_parse_context_end_parse (context, &end_error);
-  if (!retval)
-    {
-      g_propagate_error (error, end_error);
-
-      return FALSE;
-    }
-
+    g_propagate_error (error, parse_error);
+  else
+   {
+     retval = g_markup_parse_context_end_parse (context, &end_error);
+      if (!retval)
+        g_propagate_error (error, end_error);
+   }
+
   g_markup_parse_context_free (context);
-
-  return TRUE;
+
+  return retval;
 }

 static gchar *
@@ -1685,14 +1680,11 @@

   parse_error = NULL;
   retval = g_bookmark_file_parse (bookmark, data, length, &parse_error);
+
   if (!retval)
-    {
-      g_propagate_error (error, parse_error);
-
-      return FALSE;
-    }
-
-  return TRUE;
+    g_propagate_error (error, parse_error);
+
+  return retval;
 }

 /**


combo error

combo error

[r20762]

error: pathspec 'ir/be/test/fehler118.c' did not match any file(s) known to git

--- ir/be/test/fehler118.c
+++ ir/be/test/fehler118.c
@@ -0,0 +1,22 @@
+#include <stdlib.h>
+
+char *test(char *name) {
+	char *p, *trunc = NULL;
+	int plen;
+	int min_part = 3;
+	do {
+	        p = strrchr(name, '.');
+	        p = p ? p+1 : name;
+	        while (*p) {
+	            	plen = strcspn(p, '.');
+	                p += plen;
+	            	if (plen > min_part) trunc = p-1;
+                	if (*p) p++;
+	        }
+	} while (trunc == NULL && --min_part != 0);
+	return p;
+}
+
+int main() {
+	return 0;
+}


genirq: Remove now obsolete set_irq_wake()

Missed that one in the big compat remval patch

Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>


convert: Fix tautological comparisons in tests

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

--- glib/tests/convert.c
+++ glib/tests/convert.c
@@ -168,7 +168,7 @@
       error2 = NULL;
       result2 = g_utf8_to_ucs4 (utf8, -1, &items_read2, &items_written2, &error2);
       g_assert (error || items_read2 == items_read);
-      g_assert (error || items_written2 == items_written2);
+      g_assert (error || items_written2 == items_written);
       g_assert_cmpint (!!result, ==, !!result2);
       g_assert_cmpint (!!error, ==, !!error2);
       if (result)
@@ -309,7 +309,7 @@
       error2 = NULL;
       result2 = g_utf8_to_utf16 (utf8, -1, &items_read2, &items_written2, &error2);
       g_assert (error || items_read2 == items_read);
-      g_assert (error || items_written2 == items_written2);
+      g_assert (error || items_written2 == items_written);
       g_assert_cmpint (!!result, ==, !!result2);
       g_assert_cmpint (!!error, ==, !!error2);
       if (result)
@@ -526,7 +526,7 @@
       error2 = NULL;
       result2 = g_utf16_to_ucs4 (utf16, -1, &items_read2, &items_written2, &error2);
       g_assert (error || items_read2 == items_read);
-      g_assert (error || items_written2 == items_written2);
+      g_assert (error || items_written2 == items_written);
       g_assert_cmpint (!!result, ==, !!result2);
       g_assert_cmpint (!!error, ==, !!error2);
       if (result)


[SCSI] net: add FCoE offload support through net_device

This adds support to provide Fiber Channel over Ethernet (FCoE) offload
through net_device's net_device_ops struct. The offload through net_device
for FCoE is enabled in kernel as built-in or module driver.

Signed-off-by: Yi Zou <5b3a821cf7a153d601945bbe257e1150110342e4@intel.com>
Acked-by: David Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@HansenPartnership.com>

--- include/linux/netdevice.h
+++ include/linux/netdevice.h
@@ -582,6 +582,14 @@
 #define HAVE_NETDEV_POLL
 	void                    (*ndo_poll_controller)(struct net_device *dev);
 #endif
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+	int			(*ndo_fcoe_ddp_setup)(struct net_device *dev,
+						      u16 xid,
+						      struct scatterlist *sgl,
+						      unsigned int sgc);
+	int			(*ndo_fcoe_ddp_done)(struct net_device *dev,
+						     u16 xid);
+#endif
 };

 /*
@@ -841,6 +849,11 @@
 #ifdef CONFIG_DCB
 	/* Data Center Bridging netlink ops */
 	struct dcbnl_rtnl_ops *dcbnl_ops;
+#endif
+
+#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
+	/* max exchange id for FCoE LRO by ddp */
+	unsigned int		fcoe_ddp_xid;
 #endif

 #ifdef CONFIG_COMPAT_NET_DEV_OPS


logging test: unset G_MESSAGES_DEBUG

logging test: unset G_MESSAGES_DEBUG

Having G_MESSAGES_DEBUG=all in the environment will fail this testcase.

--- glib/tests/logging.c
+++ glib/tests/logging.c
@@ -261,6 +261,8 @@
 int
 main (int argc, char *argv[])
 {
+  unsetenv ("G_MESSAGES_DEBUG");
+
   g_test_init (&argc, &argv, NULL);
   g_test_bug_base ("http://bugzilla.gnome.org/");


netfilter: cleanup struct nf_hook_ops indentation

Signed-off-by: Pablo Neira Ayuso <707d14912bb250caf67dfe0ea4035681fbfc4f56@netfilter.org>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>


Update linux/rtnetlink.h to upstream version

--- include/linux/rtnetlink.h
+++ include/linux/rtnetlink.h
@@ -267,12 +267,13 @@
 	RTA_PREFSRC,
 	RTA_METRICS,
 	RTA_MULTIPATH,
-	RTA_PROTOINFO,
+	RTA_PROTOINFO, /* no longer used */
 	RTA_FLOW,
 	RTA_CACHEINFO,
-	RTA_SESSION,
+	RTA_SESSION, /* no longer used */
 	RTA_MP_ALGO, /* no longer used */
 	RTA_TABLE,
+	RTA_GENERATION,
 	__RTA_MAX
 };


Remove dead code.

Remove dead code.

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

--- include/llvm/Object/ELF.h
+++ include/llvm/Object/ELF.h
@@ -390,7 +390,6 @@

   ErrorOr<StringRef> getStaticSymbolName(const Elf_Sym *Symb) const;
   ErrorOr<StringRef> getDynamicSymbolName(const Elf_Sym *Symb) const;
-  ErrorOr<StringRef> getSymbolName(const Elf_Sym *Symb, bool IsDynamic) const;

   ErrorOr<StringRef> getSectionName(const Elf_Shdr *Section) const;
   ErrorOr<ArrayRef<uint8_t> > getSectionContents(const Elf_Shdr *Sec) const;
@@ -911,14 +910,6 @@
 }

 template <class ELFT>
-ErrorOr<StringRef> ELFFile<ELFT>::getSymbolName(const Elf_Sym *Symb,
-                                                bool IsDynamic) const {
-  if (IsDynamic)
-    return getDynamicSymbolName(Symb);
-  return getStaticSymbolName(Symb);
-}
-
-template <class ELFT>
 ErrorOr<StringRef>
 ELFFile<ELFT>::getSectionName(const Elf_Shdr *Section) const {
   uint32_t Offset = Section->sh_name;


Made documentation comment consistent.

Made documentation comment consistent.

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

--- include/loki/LevelMutex.h
+++ include/loki/LevelMutex.h
@@ -718,8 +718,8 @@
  either pthreads or the Windows CRITICAL_SECTION. If you want to use a mutex
  mechanism besides one of those, then all you have to do is provide a class
  which wraps the mutex and implements these functions.
-    explicit SpinLevelMutex( unsigned int level );
-    virtual ~SpinLevelMutex( void );
+    explicit MutexPolicy( unsigned int level );
+    virtual ~MutexPolicy( void );
     virtual MutexErrors::Type Lock( void ) volatile;
     virtual MutexErrors::Type TryLock( void ) volatile;
     virtual MutexErrors::Type Unlock( void ) volatile;


tweak journal display

tweak journal display

--- pfl/ctlcli.c
+++ pfl/ctlcli.c
@@ -623,7 +623,7 @@
 psc_ctlmsg_journal_prhdr(__unusedx struct psc_ctlmsghdr *mh,
     __unusedx const void *m)
 {
-	printf("%-16s %4s %4s %6s %2s "
+	printf("%-15s %4s %4s %6s %2s "
 	    "%9s %7s %8s "
 	    "%6s %4s %5s\n",
 	    "journal", "flag", "used", "total", "rs",
@@ -637,7 +637,7 @@
 {
 	const struct psc_ctlmsg_journal *pcj = m;

-	printf("%-16s %c%c%c%c %4u %6u %2u "
+	printf("%-15s %c%c%c%c %4u %6u %2u "
 	    "%9"PRIx64" %7"PRIx64" %8"PRIx64" "
 	    "%6d %4"PRId64" %5u\n",
 	    pcj->pcj_name,


remove superflouous comment

remove superflouous comment

--- include/mega/useralerts.h
+++ include/mega/useralerts.h
@@ -173,7 +173,6 @@
         unsigned fileCount, folderCount;

         std::vector<handle> items;
-           // never includes UNDEF

         handle parentHandle;


Compiler warning, unused variable

Compiler warning, unused variable

/home/marcus/GIT/BGT3xxx/bgt-linux-pcie-drv/v4l/stv090x.c: In function
'stv090x_set_tspath':
/home/marcus/GIT/BGT3xxx/bgt-linux-pcie-drv/v4l/stv090x.c:5108:5:
warning: unused variable 'speed' [-Wunused-variable]
u8 speed;
     ^

--- bgt-linux-pcie-drv/linux/drivers/media/dvb/frontends/stv090x.c
+++ bgt-linux-pcie-drv/linux/drivers/media/dvb/frontends/stv090x.c
@@ -5105,7 +5105,7 @@
 static int stv090x_set_tspath(struct stv090x_state *state)
 {
 	u32 reg;
-	u8 speed;
+	//u8 speed;

 	if (state->internal->dev_ver >= 0x20) {
 		switch (state->config->ts1_mode) {


Update cookie.h

Update cookie.h

--- include/pistache/cookie.h
+++ include/pistache/cookie.h
@@ -110,7 +110,7 @@
     CookieJar();

     void add(const Cookie& cookie);
-    void removeCookie(const std::string& name);  // Unimplemented
+    void removeAllCookies();

     void addFromRaw(const char *str, size_t len);
     Cookie get(const std::string& name) const;


Factory function updated and SFINAE typo fixed.

--- include/unique_resource.h
+++ include/unique_resource.h
@@ -117,7 +117,7 @@
             return m_resource.get();
         }

-        template<class RR = R, std::enable_if_t<std::is_pointer_v<RR>>
+        template<class RR = R, std::enable_if_t<std::is_pointer_v<RR>, int> = 0>
         RR operator->() const noexcept
         {
             return m_resource.get();
@@ -192,7 +192,7 @@
                                                                     && std::is_nothrow_constructible_v<std::decay_t<D>, D>)
     {
         const bool must_release{r == invalid};
-        auto ur = unique_resource{r, d};
+        unique_resource<std::decay_t<R>, std::decay_t<D>> ur{std::forward<R>(r), std::forward<D>(d)};

         if( must_release == true )
         {


MixedVector from multi_model branch.

MixedVector from multi_model branch.

--- include/utilities_slsim.h
+++ include/utilities_slsim.h
@@ -3,10 +3,16 @@

 #include "standard.h"
 #include <typeinfo>
+#include <vector>
+#include <map>
+#include <string>
+#include <stdexcept>
+#include <algorithm>
+#include <iterator>

 namespace Utilities{
 	//typedef double PosType;
-
+
 	template <class T>
 	void Matrix(T **matrix, long rows, long cols){
 		matrix = new T*[rows];
@@ -14,160 +20,265 @@
 		for (long i = 1; i < rows; ++i)
 			matrix[i] = matrix[0] + i * cols;
 	}
-
+
 	template <class T>
-	void free_Matrix(T **matrix, long rows, long cols){
+	void free_Matrix(T **matrix, long rows, long){
 		if (rows) delete[] matrix[0];
 		delete []matrix;
 	}
-
+
 	PosType **PosTypeMatrix(long rows, long cols);
 	void free_PosTypeMatrix(PosType **matrix, long rows, long cols);
-
+
 	/** \brief A container that can hold mixed objects all derived from
 	 * a base class and retains the ability to access derived class functions/members.
 	 *
 	 * The indexing operator is overridden to return a reference to the base class and
 	 * a templated index<>() function provides a reference to elements with derived class
-	 * type information.  The order of the elements is not the same as the order in which
-   * they were put in - DClass1 elements are listed first.  (This could be changed in the
-   * future if need be.)
+	 * type information.
 	 *
 	 *
 	 *

 	 * example:
-   *
 	 * InputParams params(paramfile);
      * params.put("gauss_r2",1,"non");
  	 * SourceGaussian source1(params);
 	 * SourceUniform source2(params);
      *
-	 * Utilities::MixedVector<Source,SourceGaussian,SourceUniform> mvector;
+	 * Utilities::MixedVector<Source> mvector;
      *
-	 * mvector.push(source1);
-	 * mvector.push(source1);
-	 * mvector.push(source2);
-	 * mvector.push(source2);
+	 * mvector.push_back(source1);
+	 * mvector.push_back(source1);
+	 * mvector.push_back(source2);
+	 * mvector.push_back(source2);
 	 * cout << "Number of Uniform Sources " << mvector.size<SourceUniform>() << "   Number of Gausssian Sources "
 	 *		<< mvector.size<SourceGaussian>() << endl;
      *
      * // change derived class attribute
-	 * mvector.index<SourceGaussian>(0).source_gauss_r2 = 0.5;
+	 * mvector.at<SourceGaussian>(0).source_gauss_r2 = 0.5;
 	 * cout << "A base class attribute " << mvector[2].getTotalFlux()
 	 *		<< " A derived class attribute  "
-	 *		<< mvector.index<SourceGaussian>(0).source_gauss_r2
-	 *		<< "  " << mvector.index<SourceGaussian>(1).source_gauss_r2
+	 *		<< mvector.at<SourceGaussian>(0).source_gauss_r2
+	 *		<< "  " << mvector.at<SourceGaussian>(1).source_gauss_r2
 	 *		<< endl;
 	 *
-	 *

+	 *

 	 */
-	template <class BaseClass,class DClass1,class DClass2>
-	class MixedVector{
+	template<class BaseT>
+	class MixedVector
+	{
 	public:
-		/// add an object of type DClass1 to the vector
-		void push(const DClass1 &obj){
-			v_class1.push_back(obj);
-		}
-		/// add an object of type DClass2 to the vector
-		void push(const DClass2 &obj){
-			v_class2.push_back(obj);
-		}
-		/// erase element, all DClass2 elements are erased before DClass1 objects
-		void pop_back(){
-			if(v_class2.size() > 0) v_class2.pop_back();
-			else v_class1.pop_back();
-		}
-
+		/// destroy the vector and all contained items
+		~MixedVector()
+		{
+			clear();
+		}
+
+		/// add an object of type SubclassT to the vector
+		template<typename SubclassT>
+		void push_back(const SubclassT& obj)
+		{
+			// make sure this is a subclass of BaseT
+			check_type(obj);
+
+			// copy the object
+			BaseT* copy = new SubclassT(obj);
+
+			// add the copy of the object to the list of items
+			items.push_back(copy);
+
+			// add the copy to type map
+			tmap[typeid(SubclassT)].push_back(copy);
+		}
+
+		/// pop element from back of vector
+		void pop_back()
+		{
+			// get very last element
+			BaseT* back = items.back();
+
+			// remove from the vector in the type map
+			tmap[typeid(*back)].pop_back();
+
+			// remove from items
+			items.pop_back();
+
+			// delete from memory
+			delete back;
+		}
+
+		/// erase the last element of a specific type
+		template<typename SubclassT>
+		void pop_back()
+		{
+			// search for vector belonging to SubclassT
+			tmap_iterator found = tmap.find(typeid(SubclassT));
+			if(found == tmap.end())
+				return;
+
+			// pop from vector for type
+			found->second.pop_back();
+
+			// go through list of all items from back, until item of correct type is found
+			for(typename std::vector<BaseT*>::reverse_iterator it = items.rbegin(); it != items.rend(); ++it)
+			{
+				if(typeid(**it) == typeid(SubclassT))
+				{
+					// remove the item
+					delete(*it);
+					items.erase(it);
+					return;
+				}
+			}
+		}
+
 		/// Indexing operator for all elements in form of a reference to the base class.
-		BaseClass & operator[](size_t in){
-			if(in < v_class1.size()) return v_class1[in];
-			return v_class2[in - v_class1.size()];
-		}
-
+		BaseT& operator[](std::size_t i) const
+		{
+			return *items[i];
+		}
+
 		/// clear all elements
-		void clear(){
-			v_class1.clear();
-			v_class2.clear();
-		}
-
+		void clear()
+		{
+			for(std::size_t i = 0, n = items.size(); i < n; ++i)
+				delete items[i];
+			items.clear();
+			tmap.clear();
+		}
+
 		/// clear all elements of a given type
-		template <typename T>
-		void clear(){
-			if(typeid(T) == typeid(DClass1)) v_class1.clear();
-			if(typeid(T) == typeid(DClass2)) v_class2.clear();
-		}
-
-		/// erase the last element of a specific type
-		template <typename T>
-		void pop(){
-			if(typeid(T) == typeid(DClass1)) v_class1.pop_back();
-			if(typeid(T) == typeid(DClass2)) v_class2.pop_back();
-		}
-
-
-		/// Checks if derived type is one of the allowed types (returns true) for this object
-		template <typename T>
-		bool CheckType(){
-			if(typeid(T) == typeid(DClass1)) return true;
-			if(typeid(T) == typeid(DClass2)) return true;
-
-			return false;
-		}
-		/// Checks if element i is of the derived type T
-		template <typename T>
-		bool CheckType(size_t i){
-			if(i < v_class1.size()){
-				if(typeid(T) == typeid(DClass1)) return true;
-				return false;
-			}else if(i < v_class1.size() + v_class2.size()){
-				if(typeid(T) == typeid(DClass2)) return true;
-				return false;
-			}
-
-			return false;
-		}
-
-
-		/** \brief Templated indexing function for elements of a specific derived class.
-		 * The index runs 0 ... size<T>() - 1
+		template<typename SubclassT>
+		void clear()
+		{
+			// remove vector for subclass
+			tmap.erase(typeid(SubclassT));
+
+			// erase items matching type
+			items.erase(std::remove_if(items.begin(), items.end(), is_type<SubclassT>), items.end());
+		}
+
+		/// Checks if element i is of the derived type SubclassT
+		template<typename SubclassT>
+		bool CheckType(std::size_t i)
+		{
+			return is_type<SubclassT>(items[i]);
+		}
+
+		/// indexed access with bounds checking
+		BaseT& at(std::size_t i)
+		{
+			return *items.at(i);
+		}
+
+		/// indexed access with bounds checking (const)
+		const BaseT& at(std::size_t i) const
+		{
+			return *items.at(i);
+		}
+
+		/** \brief Templated indexing operator for elements of a specific derived class.
+		 * The index runs 0 ... size<SubclassT>() - 1
+		 * Does bounds checking.
 		 */
-		template <typename T>
-		T & index(size_t i){
-
-			if(typeid(T) == typeid(DClass1)) return dynamic_cast<T &>( v_class1[i]);
-			if(typeid(T) == typeid(DClass2)) return dynamic_cast<T &>( v_class2[i]);
-
-			ERROR_MESSAGE();
-			std::cout << "MixedVector::index<type>() accessed with invalid type." << std::endl;
-			exit(1);
-		}
-
-		/// get a pointer to a specific derived class element, index runs 0 ... size<DClass1>()-1
-		void get(DClass1 *obj,size_t index){
-			obj = &(v_class1[index]);
-		}
-		/// get a pointer to a specific derived class element, index runs 0 ... size<DClass2>()-1
-		void get(DClass2 *obj,size_t index){
-			obj = &(v_class2[index]);
-		}
-
-		/// number of elements of a specific type T
-		template <typename T>
-		size_t size(){
-			if(typeid(T) == typeid(DClass1)) return v_class1.size();
-			if(typeid(T) == typeid(DClass2)) return v_class2.size();
-			return 0;
-		}
-
-		/// Total number of all elements
-		size_t size(){
-			return v_class1.size() + v_class2.size();
-		}
-
+		template<typename SubclassT>
+		SubclassT& at(std::size_t i)
+		{
+			tmap_iterator found = tmap.find(typeid(SubclassT));
+			if(found == tmap.end())
+				throw std::out_of_range(std::string() + "type " + typeid(SubclassT).name() + " not in vector");
+			return *found->second.at(i);
+		}
+
+		/// Templated indexing operator for elements of a specific derived class (const).
+		template<typename SubclassT>
+		const SubclassT& at(std::size_t i) const
+		{
+			tmap_iterator found = tmap.find(typeid(SubclassT));
+			if(found == tmap.end())
+				throw std::out_of_range(std::string() + "type " + typeid(SubclassT).name() + " not in vector");
+			return *found->second.at(i);
+		}
+
+		/// number of all elements
+		std::size_t size() const
+		{
+			return items.size();
+		}
+
+		/// number of elements of a specific type
+		template<typename SubclassT>
+		std::size_t size() const
+		{
+			tmap_iterator found = tmap.find(typeid(SubclassT));
+			if(found == tmap.end())
+				return 0;
+			return found->second.size();
+		}
+
+		/// check if vector of items is empty
+		bool empty() const
+		{
+			return items.empty();
+		}
+
+		/// check if vector of items of type SubclassT is empty
+		template<typename SubclassT>
+		bool empty() const
+		{
+			tmap_iterator found = tmap.find(typeid(SubclassT));
+			if(found == tmap.end())
+				return true;
+
+			return found->second.empty();
+		}
+
+		/// get vector of all items
+		std::vector<BaseT*> vector() const
+		{
+			return items;
+		}
+
+		/// get vector of all items of type SubclassT
+		template<typename SubclassT>
+		std::vector<SubclassT*> vector() const
+		{
+			std::vector<SubclassT*> results;
+
+			tmap_iterator found = tmap.find(typeid(SubclassT));
+			if(found == tmap.end())
+				return results;
+
+			results.reserve(found->second.size());
+			std::transform(found->second.begin(), found->second.end(), std::back_inserter(results), to_type<SubclassT>);
+
+			return results;
+		}
+
 	private:
-		std::vector<DClass1> v_class1;
-		std::vector<DClass2> v_class2;
+		class type_index
+		{
+		public:
+			type_index(const std::type_info& type) : t(type) {}
+			inline bool operator<(const type_index& rhs) const { return t.before(rhs.t); }
+
+		private:
+			const std::type_info& t;
+		};
+
+		template<typename SubclassT>
+		inline static bool is_type(const BaseT* obj) { return (typeid(*obj) == typeid(SubclassT)); }
+
+		template<typename SubclassT>
+		inline static SubclassT* to_type(BaseT* obj) { return (SubclassT*)obj; }
+
+		inline static void check_type(const BaseT&) {}
+
+		std::vector<BaseT*> items;
+		std::map<type_index, std::vector<BaseT*> > tmap;
+
+		typedef typename std::map<type_index, std::vector<BaseT*> >::const_iterator tmap_iterator;
 	};
-
+
 }
 #endif


correct wording on cw_uuidString documentation

--- Source/NSStringAdditions.h
+++ Source/NSStringAdditions.h
@@ -47,8 +47,8 @@
  Returns a UUID String

  On OS X 10.8 and later this method calls the new [[NSUUID UUID] UUIDString]
- function. For 10.7 compatibility this method calls CFUUIDCreateString() if the
- NSUUID class doesn't exist.
+ function. For 10.7 compatibility this method calls CFUUIDCreateString() and
+ bridges that to a NSString.

  @return a new UUID NSString instance
  */


[FIX] missed a break

[FIX] missed a break

--- metadata_writer_zeromq.c
+++ metadata_writer_zeromq.c
@@ -283,8 +283,10 @@
         break;
     case META_TYPE_MUNIN:
         md_zeromq_handle_munin(mwz, (struct md_munin_event*) event);
+        break;
     case META_TYPE_SYSEVENT:
         md_zeromq_handle_sysevent(mwz, (struct md_sysevent*) event);
+        break;
     default:
         break;
     }


fix bug in textfilecontent54 probe

fix bug in textfilecontent54 probe

--- src/OVAL/probes/independent/textfilecontent54.c
+++ src/OVAL/probes/independent/textfilecontent54.c
@@ -225,6 +225,7 @@
                                                  "path", NULL, r0 = SEXP_string_newf("%s", path),
                                                  "filename", NULL, r1 = probe_ent_getval(pfd->filename_ent),
                                                  NULL);
+                        SEXP_vfree (r0, r1, NULL);
                         probe_item_setstatus (item, OVAL_STATUS_DOESNOTEXIST);
 		        probe_itement_setstatus (item, "filename", 1, OVAL_STATUS_DOESNOTEXIST);
 		} else {
@@ -232,11 +233,11 @@
                                                  /* entities */
                                                  "path", NULL, r0 = SEXP_string_newf("%s", path),
                                                  NULL);
+                        SEXP_free(r0);
 		}

 		SEXP_list_add(pfd->item_list, item);
-
-                SEXP_vfree(r0, r1, item, NULL);
+                SEXP_free(item);

 		goto cleanup;
 	}


Change on/off button for Sataicase usermod.

--- usermods/Animated_Staircase/Animated_Staircase.h
+++ usermods/Animated_Staircase/Animated_Staircase.h
@@ -406,6 +406,14 @@
       }
     }

+    void appendConfigData() {
+      //oappend(SET_F("dd=addDropdown('staircase','selectfield');"));
+      //oappend(SET_F("addOption(dd,'1st value',0);"));
+      //oappend(SET_F("addOption(dd,'2nd value',1);"));
+      //oappend(SET_F("addInfo('staircase:selectfield',1,'additional info');"));  // 0 is field type, 1 is actual field
+    }
+
+
     /*
     * Writes the configuration to internal flash memory.
     */
@@ -458,15 +466,11 @@

       useUSSensorTop     = top[FPSTR(_useTopUltrasoundSensor)] | useUSSensorTop;
       topPIRorTriggerPin = top[FPSTR(_topPIRorTrigger_pin)] | topPIRorTriggerPin;
-//      topPIRorTriggerPin = min(33,max(-1,(int)topPIRorTriggerPin)); // bounds check
       topEchoPin         = top[FPSTR(_topEcho_pin)] | topEchoPin;
-//      topEchoPin         = min(39,max(-1,(int)topEchoPin)); // bounds check

       useUSSensorBottom     = top[FPSTR(_useBottomUltrasoundSensor)] | useUSSensorBottom;
       bottomPIRorTriggerPin = top[FPSTR(_bottomPIRorTrigger_pin)] | bottomPIRorTriggerPin;
-//      bottomPIRorTriggerPin = min(33,max(-1,(int)bottomPIRorTriggerPin)); // bounds check
       bottomEchoPin         = top[FPSTR(_bottomEcho_pin)] | bottomEchoPin;
-//      bottomEchoPin         = min(39,max(-1,(int)bottomEchoPin)); // bounds check

       topMaxDist    = top[FPSTR(_topEchoCm)] | topMaxDist;
       topMaxDist    = min(150,max(30,(int)topMaxDist));     // max distnace ~1.5m (a lag of 9ms may be expected)
@@ -504,22 +508,22 @@
     * tab of the web-UI.
     */
     void addToJsonInfo(JsonObject& root) {
-      JsonObject staircase = root["u"];
-      if (staircase.isNull()) {
-        staircase = root.createNestedObject("u");
-      }
-
-      JsonArray usermodEnabled = staircase.createNestedArray(F("Staircase"));  // name
-      String btn = F("<button class=\"btn infobtn\" onclick=\"requestJson({staircase:{enabled:");
-      if (enabled) {
-        btn += F("false}});\">");
-        btn += F("enabled");
-      } else {
-        btn += F("true}});\">");
-        btn += F("disabled");
-      }
-      btn += F("</button>");
-      usermodEnabled.add(btn);                             // value
+      JsonObject user = root["u"];
+      if (user.isNull()) {
+        user = root.createNestedObject("u");
+      }
+
+      JsonArray infoArr = user.createNestedArray(FPSTR(_name));  // name
+
+      String uiDomString = F("<button class=\"btn btn-xs\" onclick=\"requestJson({");
+      uiDomString += FPSTR(_name);
+      uiDomString += F(":{");
+      uiDomString += FPSTR(_enabled);
+      uiDomString += enabled ? F(":false}});\">") : F(":true}});\">");
+      uiDomString += F("<i class=\"icons ");
+      uiDomString += enabled ? "on" : "off";
+      uiDomString += F("\"></i></button>");
+      infoArr.add(uiDomString);
     }
 };


repair comment

repair comment

--- dev/pckbc/wskbdmap_mfii.c
+++ dev/pckbc/wskbdmap_mfii.c
@@ -1,9 +1,9 @@
-/*	$OpenBSD: wskbdmap_mfii.c,v 1.37 2008/07/16 16:33:18 miod Exp $ */
+/*	$OpenBSD: wskbdmap_mfii.c,v 1.38 2008/07/30 15:53:31 deraadt Exp $ */
 /*	$NetBSD: wskbdmap_mfii.c,v 1.15 2000/05/19 16:40:04 drochner Exp $	*/

 /*
  * PLEASE DO NOT FORGET TO REGEN
- 	sys/dev/usb/ukbdmap.c
+ *	sys/dev/usb/ukbdmap.c
  * AFTER ANY CHANGES TO THIS FILE!
  */


fix: baudrate value

fix: baudrate value

--- ArduinoFirmwareEsp/config.h
+++ ArduinoFirmwareEsp/config.h
@@ -26,7 +26,7 @@
   //Arduino STAR OTTO configuration parameters
   #define BOARDMODEL "STAROTTO"
   #define ESP_CH_UART
-  #define BAUDRATE_COMMUNICATION 115200
+  #define BAUDRATE_COMMUNICATION 460800
   #define WIFI_LED 14
   #define HOSTNAME "Arduino-Star-Otto"
 #elif defined(PRIMO)


purged the bus locking code

purged the bus locking code

--- devices/STM32F4_ChibiOS.h
+++ devices/STM32F4_ChibiOS.h
@@ -4,7 +4,6 @@
 #include "ch.h"
 #include "hal.h"
 #include "spi_tx_only.h"
-#include "bus_locking.h"

 #if !defined(GLCD_USE_PARALLEL)
 #if GLCD_USE_SPI_UART
@@ -17,12 +16,8 @@
     #define GLCD_SELECT()       spi_uart_clear_chip_select()
     #define GLCD_DESELECT()     spi_uart_set_chip_select()
 #  else
-    //extern int bus_lock_spi_mtx(const SPIDriver *driver_address);
-    //extern int bus_unlock_spi_mtx(const SPIDriver *driver_address);
-    //#define GLCD_SELECT()     bus_unlock_spi_mtx(CHIBIOS_SPI_PEREPHERIAL); spiSelect(CHIBIOS_SPI_PEREPHERIAL)
-    //#define GLCD_DESELECT()   bus_lock_spi_mtx(CHIBIOS_SPI_PEREPHERIAL); spiUnselect(CHIBIOS_SPI_PEREPHERIAL)
-    #define GLCD_SELECT()     bus_unlock_spi_mtx(CHIBIOS_SPI_PEREPHERIAL); spiSelect(CHIBIOS_SPI_PEREPHERIAL)
-    #define GLCD_DESELECT()   bus_lock_spi_mtx(CHIBIOS_SPI_PEREPHERIAL); spiUnselect(CHIBIOS_SPI_PEREPHERIAL)
+    #define GLCD_SELECT()     spiSelect(CHIBIOS_SPI_PEREPHERIAL)
+    #define GLCD_DESELECT()   spiUnselect(CHIBIOS_SPI_PEREPHERIAL)
 #  endif
 #else
 #   error "Parallel not yet supported under chibios"


Add some fixes to the Linux version of criticalsection.h
Review URL: http://codereview.chromium.org/243095

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

--- third_party/libjingle/files/talk/base/criticalsection.h
+++ third_party/libjingle/files/talk/base/criticalsection.h
@@ -80,23 +80,36 @@

 #ifdef POSIX
 class CriticalSection {
-public:
+ public:
   CriticalSection() {
     pthread_mutexattr_t mutex_attribute;
+    pthread_mutexattr_init(&mutex_attribute);
     pthread_mutexattr_settype(&mutex_attribute, PTHREAD_MUTEX_RECURSIVE);
     pthread_mutex_init(&mutex_, &mutex_attribute);
+    pthread_mutexattr_destroy(&mutex_attribute);
+    TRACK_OWNER(thread_ = 0);
   }
   ~CriticalSection() {
     pthread_mutex_destroy(&mutex_);
   }
   void Enter() {
     pthread_mutex_lock(&mutex_);
+    TRACK_OWNER(thread_ = pthread_self());
   }
   void Leave() {
+    TRACK_OWNER(thread_ = 0);
     pthread_mutex_unlock(&mutex_);
   }
-private:
+
+#if CS_TRACK_OWNER
+  bool CurrentThreadIsOwner() const {
+    return pthread_equal(thread_, pthread_self());
+  }
+#endif  // CS_TRACK_OWNER
+
+ private:
   pthread_mutex_t mutex_;
+  TRACK_OWNER(pthread_t thread_);
 };
 #endif // POSIX


backout

backout

--- thrust/iterator/detail/placement/placed_iterator_base.h
+++ thrust/iterator/detail/placement/placed_iterator_base.h
@@ -26,9 +26,6 @@
 namespace detail
 {

-// XXX WAR circular #inclusion with this forward declaration
-template<typename Iterator> struct has_place;
-
 template<typename UnplacedIterator> class placed_iterator;

 template<typename UnplacedIterator,


gmetad: pthread_t is an opaque type which could oveflow an int

printing a pthread_t is not valid (as it is an opaque type), but at
least this will avoid overflows in 64bit platforms where pointer is used

--- gmetad/data_thread.c
+++ gmetad/data_thread.c
@@ -28,7 +28,7 @@

    if(get_debug_msg_level())
       {
-         fprintf(stderr,"Data thread %d is monitoring [%s] data source\n", (int) pthread_self(), d->name);
+         fprintf(stderr,"Data thread %lu is monitoring [%s] data source\n", (unsigned long)pthread_self(), d->name);
          for(i = 0; i < d->num_sources; i++)
             {
                addr = d->sources[i];


*** empty log message ***

*** empty log message ***

--- gmetad/data_thread.c
+++ gmetad/data_thread.c
@@ -33,7 +33,7 @@
    data_source_list_t *d = (data_source_list_t *)arg;
    struct timeval start, end;
    gzFile gz = NULL;
-   char *output, *p;
+   char *output, *p = NULL;
    int output_index;
    int output_len;
    int count;
@@ -54,6 +54,7 @@
      {
        /* Assume the best from the beginning */
        d->dead = 0;
+       d->last_heard_from = 0;

        gettimeofday(&start, NULL);

@@ -70,9 +71,10 @@
          {
            err_msg("data_thread() got no answer from any [%s] datasource", d->name);
            d->dead = 1;
-/*
+	   d->last_heard_from = time(NULL);
+	   /*
            goto take_a_break;
-*/
+	   */
          }
        else
          {


fill gap at bottom

fill gap at bottom

--- spectrogram.c
+++ spectrogram.c
@@ -211,7 +211,7 @@

 	/* spectrogram */
 	p->s.x = 0;
-	p->s.y = p->w.height;
+	p->s.y = p->w.height + 1;
 	p->s.width = w;
 	p->s.height = h * 0.25;


ignore the empty string.

ignore the empty string.

--- swoole_http_client_coro.c
+++ swoole_http_client_coro.c
@@ -682,11 +682,11 @@
             {
                 continue;
             }
-            if (Z_TYPE_P(value) != IS_STRING)
+            convert_to_string(value);
+            if (Z_STRLEN_P(value) == 0)
             {
                 continue;
             }
-            convert_to_string(value);
             swString_append_ptr(http_client_buffer, key, keylen);
             swString_append_ptr(http_client_buffer, "=", 1);


resolved MSVC warnings and added missing include directive

--- php_yugioh.c
+++ php_yugioh.c
@@ -6,6 +6,7 @@
 #include <wctype.h>

 #include "php.h"
+#include "ext/standard/info.h"
 #include "php_yugioh.h"
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -516,14 +517,14 @@
 			continue;
 		}

-		HashTable *main_deck_ht = u_create_table(deck.size_main);
+		HashTable *main_deck_ht = u_create_table((uint32_t)deck.size_main);
 		for (j = 0; j < deck.size_main; ++j) {
 			zval card_zv;
 			ZVAL_LONG(&card_zv, deck.main_deck[j]);
 			zend_hash_next_index_insert(main_deck_ht, &card_zv);
 		}

-		HashTable *extra_deck_ht = u_create_table(deck.size_extra);
+		HashTable *extra_deck_ht = u_create_table((uint32_t)deck.size_extra);
 		for (j = 0; j < deck.size_extra; ++j) {
 			zval card_zv;
 			ZVAL_LONG(&card_zv, deck.extra_deck[j]);


removed duplicate header file

removed duplicate header file

--- numpy/core/include/numpy/npy_object.h
+++ numpy/core/include/numpy/npy_object.h
@@ -1,67 +0,0 @@
-#ifndef _NPY_OBJECT_H_
-#define _NPY_OBJECT_H_
-
-#include "npy_defs.h"
-
-/* Simple object model for numpy objects.
-   This is similar to the Python object model. */
-
-typedef struct _NpyObject _NpyObject;
-
-typedef void (*npy_destructor)(_NpyObject *);
-
-typedef struct _NpyTypeObject {
-    npy_destructor ntp_dealloc;
-} _NpyTypeObject;
-
-#define NpyObject_HEAD                          \
-    npy_intp nob_refcnt;                        \
-    _NpyTypeObject* nob_type;                   \
-    void *nob_interface;
-
-struct _NpyObject {
-    NpyObject_HEAD;
-};
-
-#define Npy_INTERFACE(a) ((a)->nob_interface)
-
-
-#define _Npy_INCREF(a)                                                \
-       do {                                                           \
-            if (0 == (a)->nob_refcnt && NULL != Npy_INTERFACE(a))     \
-                NpyInterface_INCREF(Npy_INTERFACE(a));                \
-            (a)->nob_refcnt++;                                        \
-       } while(0)                                                     \
-
-
-#define _Npy_DECREF(a)                                          \
-        if (--(a)->nob_refcnt == 0) {                           \
-            if (NULL != Npy_INTERFACE(a))                       \
-                NpyInterface_DECREF(Npy_INTERFACE(a));          \
-            else (a)->nob_type->ntp_dealloc((_NpyObject*)a);    \
-        }
-
-
-#define _Npy_XINCREF(a) if ((a) == NULL) ; else _Npy_INCREF(a)
-#define _Npy_XDECREF(a) if ((a) == NULL) ; else _Npy_DECREF(a)
-
-
-/* To be called by interface objects that are managing the lifetime of
-   a core object. */
-#define Npy_DEALLOC(a) (a)->nob_type->ntp_dealloc((_NpyObject*)a)
-
-#define NpyObject_TypeCheck(a, t) ((a)->nob_type == t)
-
-#define _NpyObject_Init(a, t)                   \
-    do {                                        \
-        (a)->nob_refcnt = 1;                    \
-        (a)->nob_type = t;                      \
-        (a)->nob_interface = NULL;              \
-    } while (0)
-
-#define _NpyObject_HEAD_INIT(t)                 1, t, NULL,
-
-#define NpyObject_Wrapper(a) ((a)->interface)
-
-
-#endif


Update osc.c

Update osc.c

Adding support for IPv6 connections.

--- driver/osc/osc.c
+++ driver/osc/osc.c
@@ -24,6 +24,24 @@

 struct MIDIDriverOSC * MIDIDriverOSCCreate( ) {
   struct MIDIDriverOSC * driver = malloc( sizeof( struct MIDIDriverOSC ) );
+#if (defined(AF_INET6) && defined(ENABLE_IPV6))
+  struct sockaddr_in6 addr;
+  memset(&addr, 0, sizeof(addr));
+
+  driver->refs   = 1;
+  driver->socket = socket( PF_INET6, SOCK_DGRAM, 0 );
+
+  if (driver->socket == -1)
+  {
+      free (driver);
+      return NULL;
+  }
+
+  addr.sin6_family = AF_INET6;
+  addr.sin6_port = 5006;
+  addr.sin6_addr =  in6addr_any;
+
+#else
   struct sockaddr_in addr;
   memset(&addr, 0, sizeof(addr));

@@ -39,7 +57,7 @@
   addr.sin_family = AF_INET;
   addr.sin_port = 5006;
   addr.sin_addr.s_addr = INADDR_ANY;
-
+#endif
   bind( driver->socket, (struct sockaddr *) &addr, sizeof(addr) );

   driver->in_queue  = MIDIMessageQueueCreate();


[netdrvr] wd: fix build breakage with new NS8390p API

From: Alan Cox <alan@redhat.com>

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

--- drivers/net/wd.c
+++ drivers/net/wd.c
@@ -337,7 +337,7 @@
 #ifdef CONFIG_NET_POLL_CONTROLLER
 	dev->poll_controller = ei_poll;
 #endif
-	NS8390_init(dev, 0);
+	NS8390p_init(dev, 0);

 #if 1
 	/* Enable interrupt generation on softconfig cards -- M.U */


sh: pfc: Convert index to field and value pair

Update the way the PFC code is passing bitfield
selection between configure register functions.

Convert the code from using index only to bitfield
number and selected value. First step towards future
variable bitfield width support.

Signed-off-by: Magnus Damm <2336f5729424d0c84d319e991b3648cafa2c3c5b@opensource.se>
Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>

--- drivers/sh/pfc.c
+++ drivers/sh/pfc.c
@@ -287,7 +287,8 @@
 }

 static int get_config_reg(struct pinmux_info *gpioc, pinmux_enum_t enum_id,
-			  struct pinmux_cfg_reg **crp, int *indexp,
+			  struct pinmux_cfg_reg **crp,
+			  int *fieldp, int *valuep,
 			  unsigned long **cntp)
 {
 	struct pinmux_cfg_reg *config_reg;
@@ -306,7 +307,8 @@
 		for (n = 0; n < (r_width / f_width) * (1 << f_width); n++) {
 			if (config_reg->enum_ids[n] == enum_id) {
 				*crp = config_reg;
-				*indexp = n;
+				*fieldp = n / (1 << f_width);
+				*valuep = n % (1 << f_width);
 				*cntp = &config_reg->cnt[n / (1 << f_width)];
 				return 0;
 			}
@@ -349,36 +351,22 @@

 static void write_config_reg(struct pinmux_info *gpioc,
 			     struct pinmux_cfg_reg *crp,
-			     int index)
-{
-	unsigned long ncomb, pos, value;
-	void __iomem *mapped_reg;
-
-	ncomb = 1 << crp->field_width;
-	pos = index / ncomb;
-	value = index % ncomb;
-
-	mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
+			     int field, int value)
+{
+	void __iomem *mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);

 	gpio_write_reg(mapped_reg, crp->reg_width, crp->field_width,
-		       pos, value, crp->reg);
+		       field, value, crp->reg);
 }

 static int check_config_reg(struct pinmux_info *gpioc,
 			    struct pinmux_cfg_reg *crp,
-			    int index)
-{
-	unsigned long ncomb, pos, value;
-	void __iomem *mapped_reg;
-
-	ncomb = 1 << crp->field_width;
-	pos = index / ncomb;
-	value = index % ncomb;
-
-	mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);
+			    int field, int value)
+{
+	void __iomem *mapped_reg = pfc_phys_to_virt(gpioc, crp->reg);

 	if (gpio_read_reg(mapped_reg, crp->reg_width,
-			  crp->field_width, pos, crp->reg) == value)
+			  crp->field_width, field, crp->reg) == value)
 		return 0;

 	return -1;
@@ -392,7 +380,7 @@
 	struct pinmux_cfg_reg *cr = NULL;
 	pinmux_enum_t enum_id;
 	struct pinmux_range *range;
-	int in_range, pos, index;
+	int in_range, pos, field, value;
 	unsigned long *cntp;

 	switch (pinmux_type) {
@@ -423,7 +411,8 @@

 	pos = 0;
 	enum_id = 0;
-	index = 0;
+	field = 0;
+	value = 0;
 	while (1) {
 		pos = get_gpio_enum_id(gpioc, gpio, pos, &enum_id);
 		if (pos <= 0)
@@ -470,17 +459,19 @@
 		if (!in_range)
 			continue;

-		if (get_config_reg(gpioc, enum_id, &cr, &index, &cntp) != 0)
+		if (get_config_reg(gpioc, enum_id, &cr,
+				   &field, &value, &cntp) != 0)
 			goto out_err;

 		switch (cfg_mode) {
 		case GPIO_CFG_DRYRUN:
-			if (!*cntp || !check_config_reg(gpioc, cr, index))
+			if (!*cntp || !check_config_reg(gpioc, cr,
+							field, value))
 				continue;
 			break;

 		case GPIO_CFG_REQ:
-			write_config_reg(gpioc, cr, index);
+			write_config_reg(gpioc, cr, field, value);
 			*cntp = *cntp + 1;
 			break;


Updated the wingcc driver to reflect the changes for the keypress bug

--- drivers/wingcc.c
+++ drivers/wingcc.c
@@ -131,6 +131,7 @@
 void plD_eop_wingcc( PLStream * );
 void plD_bop_wingcc( PLStream * );
 void plD_tidy_wingcc( PLStream * );
+void plD_wait_wingcc( PLStream * );
 void plD_state_wingcc( PLStream *, PLINT );
 void plD_esc_wingcc( PLStream *, PLINT, void * );

@@ -230,6 +231,7 @@
     pdt->pl_tidy     = (plD_tidy_fp) plD_tidy_wingcc;
     pdt->pl_state    = (plD_state_fp) plD_state_wingcc;
     pdt->pl_esc      = (plD_esc_fp) plD_esc_wingcc;
+	pdt->pl_wait     = (plD_wait_fp) plD_wait_wingcc;
 }

 static TCHAR* szWndClass = _T( "PlplotWin" );
@@ -834,68 +836,6 @@
     dev->already_erased = 2;

     NormalCursor();
-
-    if ( !pls->nopause )
-    {
-        dev->waiting = 1;
-        while ( GetMessage( &dev->msg, NULL, 0, 0 ) )
-        {
-            TranslateMessage( &dev->msg );
-            switch ( (int) dev->msg.message )
-            {
-            case WM_CONTEXTMENU:
-            case WM_RBUTTONDOWN:
-                TrackPopupMenu( dev->PopupMenu, TPM_CENTERALIGN | TPM_RIGHTBUTTON, LOWORD( dev->msg.lParam ),
-                    HIWORD( dev->msg.lParam ), 0, dev->hwnd, NULL );
-                break;
-
-            case WM_CHAR:
-                if ( ( (TCHAR) ( dev->msg.wParam ) == 32 ) ||
-                     ( (TCHAR) ( dev->msg.wParam ) == 13 ) )
-                {
-                    dev->waiting = 0;
-                }
-                else if ( ( (TCHAR) ( dev->msg.wParam ) == 27 ) ||
-                          ( (TCHAR) ( dev->msg.wParam ) == 'q' ) ||
-                          ( (TCHAR) ( dev->msg.wParam ) == 'Q' ) )
-                {
-                    dev->waiting = 0;
-                    PostQuitMessage( 0 );
-                }
-                break;
-
-            case WM_LBUTTONDBLCLK:
-                Debug( "WM_LBUTTONDBLCLK\t" );
-                dev->waiting = 0;
-                break;
-
-            case WM_COMMAND:
-                switch ( LOWORD( dev->msg.wParam ) )
-                {
-                case PopupPrint:
-                    Debug( "PopupPrint" );
-                    PrintPage( pls );
-                    break;
-                case PopupNextPage:
-                    Debug( "PopupNextPage" );
-                    dev->waiting = 0;
-                    break;
-                case PopupQuit:
-                    Debug( "PopupQuit" );
-                    dev->waiting = 0;
-                    PostQuitMessage( 0 );
-                    break;
-                }
-                break;
-
-            default:
-                DispatchMessage( &dev->msg );
-                break;
-            }
-            if ( dev->waiting == 0 )
-                break;
-        }
-    }
 }

 //--------------------------------------------------------------------------
@@ -957,11 +897,74 @@
     }
 }

-
-
-
-//--------------------------------------------------------------------------
-// plD_state_png()
+void
+plD_wait_wingcc( PLStream * pls )
+{
+	wingcc_Dev *dev = (wingcc_Dev *) pls->dev;
+
+    Debug( "Wait for user input\n" );
+
+    dev->waiting = 1;
+	while ( dev->waiting == 1 && GetMessage( &dev->msg, NULL, 0, 0 ) )
+    {
+        TranslateMessage( &dev->msg );
+		switch ( (int) dev->msg.message )
+		{
+        case WM_RBUTTONDOWN:
+		case WM_CONTEXTMENU:
+			TrackPopupMenu( dev->PopupMenu, TPM_CENTERALIGN | TPM_RIGHTBUTTON, LOWORD( dev->msg.lParam ),
+				HIWORD( dev->msg.lParam ), 0, dev->hwnd, NULL );
+			break;
+
+		case WM_CHAR:
+			if ( ( (TCHAR) ( dev->msg.wParam ) == 32 ) ||
+				 ( (TCHAR) ( dev->msg.wParam ) == 13 ) )
+            {
+				dev->waiting = 0;
+			}
+			else if ( ( (TCHAR) ( dev->msg.wParam ) == 27 ) ||
+					  ( (TCHAR) ( dev->msg.wParam ) == 'q' ) ||
+					  ( (TCHAR) ( dev->msg.wParam ) == 'Q' ) )
+			{
+				dev->waiting = 0;
+				PostQuitMessage( 0 );
+			}
+			break;
+
+		case WM_LBUTTONDBLCLK:
+			Debug( "WM_LBUTTONDBLCLK\t" );
+			dev->waiting = 0;
+			break;
+
+		case WM_COMMAND:
+			switch ( LOWORD( dev->msg.wParam ) )
+			{
+			case PopupPrint:
+				Debug( "PopupPrint" );
+				PrintPage( pls );
+				break;
+			case PopupNextPage:
+				Debug( "PopupNextPage" );
+				dev->waiting = 0;
+				break;
+			case PopupQuit:
+				Debug( "PopupQuit" );
+				dev->waiting = 0;
+				PostQuitMessage( 0 );
+				break;
+			}
+                break;
+
+		default:
+			DispatchMessage( &dev->msg );
+			break;
+		}
+	}
+}
+
+
+//--------------------------------------------------------------------------
+// plD_state_wingcc()
 //
 // Handle change in PLStream state (color, pen width, fill attribute, etc).
 //--------------------------------------------------------------------------


Add/remove from epoll set.

Add/remove from epoll set.

--- stutterfuzz.c
+++ stutterfuzz.c
@@ -229,6 +229,13 @@
 	conn->file = file_next();
 	conn->offset = 0;
 	list_add(&conn->conn_list, &conn_pending_head);
+	struct epoll_event ev = {
+		.events = EPOLLOUT,
+		.data = {
+			.ptr = conn,
+		},
+	};
+	assert(!epoll_ctl(epoll_fd, EPOLL_CTL_ADD, conn->fd, &ev));
 	open_conns++;
 }

@@ -273,6 +280,7 @@
 	if (!error) {
 		list_del(&conn->conn_list);
 		list_add(&conn->conn_list, &conn_open_head);
+		assert(!epoll_ctl(epoll_fd, EPOLL_CTL_DEL, conn->fd, NULL));
 		return;
 	}
 	if (error == EINPROGRESS) {


freedreno/ir3: add support for a few gs5 ops

Tested on a4xx. This is part of the builtins added by ARB_gpu_shader5
and GLSL ES 3.10.

Signed-off-by: Ilia Mirkin <bcbbb7aa705ec3a5fc5824c01a845186c3d62fca@alum.mit.edu>

--- src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -1175,6 +1175,33 @@

 	case nir_op_bcsel:
 		dst[0] = ir3_SEL_B32(b, src[1], 0, ir3_b2n(b, src[0]), 0, src[2], 0);
+		break;
+
+	case nir_op_bit_count:
+		dst[0] = ir3_CBITS_B(b, src[0], 0);
+		break;
+	case nir_op_ifind_msb: {
+		struct ir3_instruction *cmp;
+		dst[0] = ir3_CLZ_S(b, src[0], 0);
+		cmp = ir3_CMPS_S(b, dst[0], 0, create_immed(b, 0), 0);
+		cmp->cat2.condition = IR3_COND_GE;
+		dst[0] = ir3_SEL_B32(b,
+				ir3_SUB_U(b, create_immed(b, 31), 0, dst[0], 0), 0,
+				cmp, 0, dst[0], 0);
+		break;
+	}
+	case nir_op_ufind_msb:
+		dst[0] = ir3_CLZ_B(b, src[0], 0);
+		dst[0] = ir3_SEL_B32(b,
+				ir3_SUB_U(b, create_immed(b, 31), 0, dst[0], 0), 0,
+				src[0], 0, dst[0], 0);
+		break;
+	case nir_op_find_lsb:
+		dst[0] = ir3_BFREV_B(b, src[0], 0);
+		dst[0] = ir3_CLZ_B(b, dst[0], 0);
+		break;
+	case nir_op_bitfield_reverse:
+		dst[0] = ir3_BFREV_B(b, src[0], 0);
 		break;

 	default:


decided screw it, use polling.

decided screw it, use polling.

--- Atmega328p/7SegClock/main.c
+++ Atmega328p/7SegClock/main.c
@@ -1,6 +1,6 @@
 #include <avr/io.h> //allows more human readable stuff
 #include <avr/interrupt.h>  //allows interrupts
-#include <avr/power.h> //power reduction management
+//#include <avr/power.h> //power reduction management

 #include "ShiftOut.h"
 #include "IIC.h"
@@ -42,13 +42,13 @@

   sei();
   //Timer0SetupMode(0x00);
-  Timer0SetupPrescale(0x60);
-  Timer0SetupInterrupt(0x10);
+  //Timer0SetupPrescale(0x60);
+  //Timer0SetupInterrupt(0x10);

   while(1){

-    cli();
+    //cli();
     TWIStart();
     TWIWrite(address | (0<<0));
     TWIWrite(0x01);
@@ -57,8 +57,9 @@
     uint8_t Minutes = TWIReadACK();
     uint8_t Hours = TWIReadNACK();
     TWIStop();
-    sei();
+    //sei();

+    static uint8_t HourAdd = 0, MinuteAdd = 0, HourState = 1, MinuteState = 1;
     static uint8_t MinutesOnes = 0, MinutesTens = 0, HoursOnes = 0, HoursTens = 0;

     MinutesOnes = Minutes & 0x0F;//(Minutes & 0x01) + (2*(Minutes & 0x02)) + (4*(Minutes & 0x04)) + (8*(Minutes & 0x08));
@@ -74,7 +75,7 @@
     PORTD |= (1 << LatchPin);

-/*
+///*
     if((HourPort & HourMask) && !HourState){
       HourAdd = 1;
       HourState = 1;
@@ -88,7 +89,7 @@
     }else if((!(MinutePort & MinuteMask)) && MinuteState){
       MinuteState = 0;
     }else {;}
-*/
+//*/

     if(HourAdd){
       HoursOnes += 1;
@@ -100,13 +101,13 @@
         HoursOnes = 0;
       }

-      cli();
+      //cli();
       TWIStart();
       TWIWrite(address | (0<<0));
       TWIWrite(0x02);
       TWIWrite(0x00 | (HoursTens << 4) | (HoursOnes << 0));
       TWIStop();
-      sei();
+      //sei();
       HourAdd = 0;
     }

@@ -120,13 +121,13 @@
         MinutesOnes = 0;
       }

-      cli();
+      //cli();
       TWIStart();
       TWIWrite(address | (0<<0));
       TWIWrite(0x01);
       TWIWrite(0x00 | (MinutesTens << 4) | (MinutesOnes << 0));
       TWIStop();
-      sei();
+      //sei();

       MinuteAdd = 0;
     }
@@ -135,7 +136,7 @@
   }
 }

-
+/*
 ISR(TIMER0_OVF_vect){

   if((HourPort & HourMask) && !HourState){
@@ -156,3 +157,4 @@

 }
+*/


Include VBO.h

Include VBO.h

--- BombDefender/BombDefender.h
+++ BombDefender/BombDefender.h
@@ -7,6 +7,7 @@
 #include <FWPlatformBase.h>
 #include <Sprite.h>
 #include <shader_program.h>
+#include <VBO.h>

 class BombDefender : public FWContextBase {
 public:


[moo_gnu] Adding '__' to directive

[moo_gnu] Adding '__' to directive

--- compiler.h
+++ compiler.h
@@ -15,7 +15,7 @@

 /* Interrupts */
 #ifdef __GNUC__
-	#define ISR(num, func_name) __attribute__((interrupt(num))) void func_name(void)
+	#define ISR(num, func_name) __attribute__((__interrupt__(num))) void func_name(void)
 #elif __IAR_SYSTEMS_ICC__
 	#define ISR(num, func_name) #pragma vector=num \
                                     __interrupt void func_name(void)


Added offset output

Added offset output

--- spit/randdd.c
+++ spit/randdd.c
@@ -45,9 +45,10 @@
     memcpy(str2, readbuf, 10);
     str1[10]=0;
     str2[10]=0;
-
-    if (memcmp(buf, readbuf, size) != 0) {
-      fprintf(stderr,"*error* failed verification\n");
+
+    int p = memcmp(buf, readbuf, size);
+    if (p != 0) {
+      fprintf(stderr,"*error* failed verification at offset %d\n", p);
       exit(1);
     }
     fprintf(stderr,"*info* succeeded %zd byte verification of '%s'.\n*info* the first few bytes: RAM '%s', on device '%s'\n", size, device, str1, str2);


Working on improving ACNA refinement of defects

--- CDJSVis/filtering/defects.c
+++ CDJSVis/filtering/defects.c
@@ -12,6 +12,9 @@
 #include "utilities.h"
 #include "array_utils.h"
 #include "atom_structure.h"
+
+#define DEBUG
+#define DEBUGACNA

 static PyObject* findDefects(PyObject*, PyObject*);
 static int findDefectClusters(int, double *, int *, int *, struct Boxes *, double, double *, int *);
@@ -23,6 +26,7 @@
 static int refineDefectsUsingAcna(int, int *, int, int *, double, int *, double *, double *, double *, double *, int, int *);
 static int compare_two_nebs(const void *, const void *);
 static int checkVacancyRecursive(int, int, int *, int *, int *, struct NeighbourList2 *, struct NeighbourList2 *, int *, int *);
+static int checkVacancyACNARecursive(int, int, int *, int *, int *, struct NeighbourList2 *, struct NeighbourList2 *, int *, int *);

 /*******************************************************************************
@@ -738,182 +742,304 @@
 }

 /*******************************************************************************
- * Use ACNA to refine the defects
+ * check if vacancy is linked to an ACNA interstitial
+ *******************************************************************************/
+static int checkVacancyACNARecursive(int vacIndex, int numChanges, int *vacs, int *ints, int *acnaInts, struct NeighbourList2 *nebListVacs,
+        struct NeighbourList2 *nebListInts, int *vacMask, int *intMask)
+{
+    int i, foundNeb;
+    struct NeighbourList2 vacNebs;
+    int numVacNebs, nebIndex = -1;
+
+
+    /* return if this vacancy has already been checked */
+    if (vacMask[vacIndex]) return numChanges;
+
+    /* we are checking this vacancy now */
+    vacMask[vacIndex] = 1;
+
+    /* list of neighbouring interstitials for this vacancy */
+    vacNebs = nebListVacs[vacIndex];
+    numVacNebs = vacNebs.neighbourCount;
+
+    /* skip if doesn't have any neighbouring interstitials */
+    if (numVacNebs < 1) return numChanges;
+
+#ifdef DEBUGACNA
+    printf("DEFECTSC: Start checking vacancy %d (num int nebs %d)\n", vacIndex, numVacNebs);
+#endif
+
+    /* we loop over the neighbouring interstitials of this vacancy until we
+     * we find a suitable neighbour or we run out of neighbours
+     */
+    i = 0;
+    foundNeb = 0;
+    while (foundNeb == 0 && i < numVacNebs)
+    {
+        int j;
+        struct Neighbour vacNeb = vacNebs.neighbour[i];
+        struct NeighbourList2 intNebs = nebListInts[vacNeb.index];
+        int numIntNebs = intNebs.neighbourCount;
+
+        /* check if this interstitial is closest to this vacancy */
+        j = 0;
+        while (intMask[vacNeb.index] == 0 && foundNeb == 0 && j < numIntNebs)
+        {
+            struct Neighbour intNeb = intNebs.neighbour[j];
+            int vacIndex2 = intNeb.index;
+
+            /* not the closest, so we check the vacancy that is closer */
+            if (vacIndex2 != vacIndex)
+            {
+#ifdef DEBUGACNA
+                printf("DEFECTSC: Need to check vacancy %d first (interstitial %d)\n", vacIndex2, vacNeb.index);
+#endif
+
+                /* call self */
+                numChanges = checkVacancyACNARecursive(vacIndex2, numChanges, vacs, ints, acnaInts, nebListVacs, nebListInts, vacMask, intMask);
+            }
+            /* it is the closest, so we store it as possible split int atom with this vacancy */
+            else
+            {
+                foundNeb = 1;
+                nebIndex = vacNeb.index;
+            }
+
+            j++;
+        }
+
+        i++;
+    }
+
+    /* check if this is a split interstitial */
+    if (foundNeb)
+    {
+        int intIndex = acnaInts[nebIndex];
+
+#ifdef DEBUGACNA
+        printf("DEFECTSC: Vacancy %d combines with interstitial %d\n", vacIndex, intIndex);
+#endif
+
+        /* remove from vacancies array */
+        vacs[vacIndex] = -1;
+
+        /* remove from interstitials array */
+        ints[intIndex] = -1;
+
+        /* set mask */
+        intMask[nebIndex] = 1;
+
+        numChanges++;
+    }
+
+    return numChanges;
+}
+
+/*******************************************************************************
+ * Use ACNA to refine the defects.
+ *
+ * First we make a list of all interstitials that have the ideal ACNA value.
+ * Next we build lists of neighbours for ints and vacs and sort these lists.
+ * Looping over vacancies we find the closest int that is not closer to another
+ * vac and mark as normal atoms
  *******************************************************************************/
 static int
 refineDefectsUsingAcna(int NVacancies, int *vacancies, int NInterstitials, int *interstitials, double vacancyRadius,
         int *PBC, double *cellDims, double *pos, double *refPos, double *acnaArray, int acnaStructureType, int *counters)
 {
-    int i, boxstat;
-    int numChanges = 0;
-    double maxSep, maxSep2, *defectPos;
-    double approxBoxWidth;
-    struct Boxes *boxes;
+    int i;
+    int numAcnaInts, *acnaInts;

 #ifdef DEBUG
     printf("DEFECTSC: Refining defects using ACNA...\n");
 #endif

-    /* first make defect pos and box */
-    /* build positions array of all defects */
-    defectPos = malloc(3 * NInterstitials * sizeof(double));
-    if (defectPos == NULL)
-    {
-        PyErr_SetString(PyExc_MemoryError, "Could not allocate defectPos");
-        return 1;
-    }
-
-    /* add defects positions: int then split */
+    /* first we make a list of interstitials that have the ideal ACNA value */
+    acnaInts = malloc(NInterstitials * sizeof(int));
+    if (acnaInts == NULL)
+    {
+        PyErr_SetString(PyExc_MemoryError, "Could not allocate acnaInts");
+        return 101;
+    }
+    numAcnaInts = 0;
     for (i = 0; i < NInterstitials; i++)
     {
-        int index  = interstitials[i];
-        int i3 = i * 3;
-        int ind3 = index * 3;
-        defectPos[i3    ] = pos[ind3    ];
-        defectPos[i3 + 1] = pos[ind3 + 1];
-        defectPos[i3 + 2] = pos[ind3 + 2];
-    }
-
-    /* max separation */
-    maxSep = 2.0 * vacancyRadius;
-    maxSep2 = maxSep * maxSep;
-
-    /* box defects */
-    approxBoxWidth = (maxSep < 3.0) ? 3.0 : maxSep;
-    boxes = setupBoxes(approxBoxWidth, PBC, cellDims);
-    if (boxes == NULL)
-    {
-        free(defectPos);
-        return 2;
-    }
-    boxstat = putAtomsInBoxes(NInterstitials, defectPos, boxes);
-    free(defectPos);
-    if (boxstat) return 3;
-
-    /* loop over vacancies and see if there is a single neighbouring intersitial */
-    for (i = 0; i < NVacancies; i++)
-    {
-        int vacIndex, j, exitLoop, boxNebListSize;
-        int boxNebList[27] , boxIndex;
-        int nebIntCount = 0;
-        int foundIndex = -1;
-        int foundIntIndex = -1;
-        double refxpos, refypos, refzpos;
-//            double foundSep2;
-
-        vacIndex = vacancies[i];
-
-        refxpos = refPos[3*vacIndex];
-        refypos = refPos[3*vacIndex+1];
-        refzpos = refPos[3*vacIndex+2];
-
-        /* get box index of this atom */
-        boxIndex = boxIndexOfAtom(refxpos, refypos, refzpos, boxes);
-        if (boxIndex < 0)
-        {
-            freeBoxes(boxes);
+        int index = interstitials[i];
+        int acnaVal = (int) acnaArray[index];
+        /* we store the index in the interstitials array */
+        if (acnaVal == acnaStructureType) acnaInts[numAcnaInts++] = i;
+    }
+    //TODO: realloc if different size
+
+#ifdef DEBUG
+    printf("DEFECTSC: Number of interstitials with ideal ACNA type: %d\n", numAcnaInts);
+#endif
+
+    if (numAcnaInts > 0 && NVacancies > 0)
+    {
+        int *intMask, *vacMask, numChanges;
+        double *intPos, *vacPos, maxSep;
+        struct NeighbourList2 *nebListInts;
+        struct NeighbourList2 *nebListVacs;
+
+        /* build positions array of all vacancies and interstitials */
+        vacPos = malloc(3 * NVacancies * sizeof(double));
+        if (vacPos == NULL)
+        {
+            PyErr_SetString(PyExc_MemoryError, "Could not allocate vacPos");
+            free(acnaInts);
+            return 1;
+        }
+        intPos = malloc(3 * numAcnaInts * sizeof(double));
+        if (intPos == NULL)
+        {
+            PyErr_SetString(PyExc_MemoryError, "Could not allocate intPos");
+            free(vacPos);
+            free(acnaInts);
+            return 2;
+        }
+
+        /* add vacancy positions */
+        for (i = 0; i < NVacancies; i++)
+        {
+            int index = vacancies[i];
+            int index3 = 3 * index;
+            int i3 = 3 * i;
+            vacPos[i3    ] = refPos[index3    ];
+            vacPos[i3 + 1] = refPos[index3 + 1];
+            vacPos[i3 + 2] = refPos[index3 + 2];
+        }
+
+        /* interstitial positions */
+        for (i = 0; i < numAcnaInts; i++)
+        {
+            int intIndex = acnaInts[i];
+            int index = interstitials[intIndex];
+            int index3 = 3 * index;
+            int i3 = i * 3;
+            intPos[i3    ] = pos[index3    ];
+            intPos[i3 + 1] = pos[index3 + 1];
+            intPos[i3 + 2] = pos[index3 + 2];
+        }
+
+        /* max separation */
+        maxSep = 2.0 * vacancyRadius;
+
+        /* construct list of neighbouring interstitials for each vacancy */
+        nebListVacs = constructNeighbourList2DiffPos(NVacancies, vacPos, numAcnaInts, intPos, cellDims, PBC, maxSep);
+
+        if (nebListVacs == NULL)
+        {
+            free(vacPos);
+            free(intPos);
+            free(acnaInts);
+            return 3;
+        }
+
+        /* construct list of neighbouring vacancies for each interstitial */
+        nebListInts = constructNeighbourList2DiffPos(numAcnaInts, intPos, NVacancies, vacPos, cellDims, PBC, maxSep);
+
+        /* free position arrays (only required for constructing neighbour lists) */
+        free(intPos);
+        free(vacPos);
+
+        if (nebListInts == NULL)
+        {
+            freeNeighbourList2(nebListVacs, NVacancies);
+            free(acnaInts);
             return 4;
         }

-        /* find neighbouring boxes */
-        boxNebListSize = getBoxNeighbourhood(boxIndex, boxNebList, boxes);
-
-        /* loop over neighbouring boxes */
-        exitLoop = 0;
-        for (j = 0; j < boxNebListSize; j++)
-        {
-            int k, checkBox;
-
-            if (exitLoop) break;
-
-            checkBox = boxNebList[j];
-
-            /* now loop over all reference atoms in the box */
-            for (k = 0; k < boxes->boxNAtoms[checkBox]; k++)
+        /* sort the neighbour lists by separation */
+        for (i = 0; i < NVacancies; i++)
+            qsort(nebListVacs[i].neighbour, nebListVacs[i].neighbourCount, sizeof(struct Neighbour), compare_two_nebs);
+
+        for (i = 0; i < numAcnaInts; i++)
+            qsort(nebListInts[i].neighbour, nebListInts[i].neighbourCount, sizeof(struct Neighbour), compare_two_nebs);
+
+#ifdef DEBUGACNA
+        printf("DEFECTSC: Vacancy neb lists\n");
+        for (i = 0; i < NVacancies; i++)
+        {
+            int j;
+
+            printf("DEFECTSC:   Vacancy %d\n", i);
+            for (j = 0; j < nebListVacs[i].neighbourCount; j++)
             {
-                int index, intIndex;
-                double xpos, ypos, zpos, sep2;
-
-                intIndex = boxes->boxAtoms[checkBox][k];
-                index = interstitials[intIndex];
-
-                /* skip if this interstitial has already been detected as lattice atom */
-                if (index < 0) continue;
-
-                /* pos of interstitial */
-                xpos = pos[3*index];
-                ypos = pos[3*index+1];
-                zpos = pos[3*index+2];
-
-                /* separation */
-                sep2 = atomicSeparation2(refxpos, refypos, refzpos, xpos, ypos, zpos,
-                                         cellDims[0], cellDims[1], cellDims[2], PBC[0], PBC[1], PBC[2]);
-
-                if (sep2 < maxSep2)
-                {
-                    if (++nebIntCount > 1)
-                    {
-                        exitLoop = 1;
-                        break;
-                    }
-
-                    foundIndex = index;
-                    foundIntIndex = intIndex;
-//                        foundSep2 = sep2;
-                }
+                struct Neighbour neb = nebListVacs[i].neighbour[j];
+                printf("DEFECTSC:     Neb %d: int index %d; sep %lf\n", j, neb.index, neb.separation);
             }
         }
-
-        if (nebIntCount == 1)
-        {
-            int acnaVal;
-
-//                printf("DEBUG: found 1 neb for vac; checking acna val\n");
-
-            /* check ACNA for FCC (hardcoded for now, not good...) */
-            acnaVal = (int) acnaArray[foundIndex];
-//                printf("DEBUG:   acna val is %d (%d)\n", acnaVal, ATOM_STRUCTURE_FCC);
-            if (acnaVal == acnaStructureType)
+
+        printf("DEFECTSC: Interstitial neb lists\n");
+        for (i = 0; i < numAcnaInts; i++)
+        {
+            int j;
+
+            printf("DEFECTSC:   Interstitial %d\n", i);
+            for (j = 0; j < nebListInts[i].neighbourCount; j++)
             {
-//                    printf("DEBUG:   this should not be a Frenkel pair... (sep = %lf)\n", sqrt(foundSep2));
-
-                vacancies[i] = -1;
-                interstitials[foundIntIndex] = -1;
-
-                numChanges++;
+                struct Neighbour neb = nebListInts[i].neighbour[j];
+                printf("DEFECTSC:     Neb %d: vac index %d; sep %lf\n", j, neb.index, neb.separation);
             }
-
-            /* could also check extending local vac rad and see if that helps... */
-
-
-        }
-
-
-    }
-
-    /* free */
-    freeBoxes(boxes);
-
-    /* recreate vacancies/interstitials arrays */
+        }
+#endif
+
+        /* set up mask arrays */
+        intMask = calloc(numAcnaInts, sizeof(int));
+        if (intMask == NULL)
+        {
+            PyErr_SetString(PyExc_MemoryError, "Could not allocate intMask");
+            free(acnaInts);
+            freeNeighbourList2(nebListVacs, NVacancies);
+            freeNeighbourList2(nebListInts, numAcnaInts);
+            return 5;
+        }
+        vacMask = calloc(NVacancies, sizeof(int));
+        if (vacMask == NULL)
+        {
+            PyErr_SetString(PyExc_MemoryError, "Could not allocate vacMask");
+            free(acnaInts);
+            free(intMask);
+            freeNeighbourList2(nebListVacs, NVacancies);
+            freeNeighbourList2(nebListInts, numAcnaInts);
+            return 6;
+        }
+
+        /* loop over vacancies, checking if they combine with an ACNA interstitial */
+        numChanges = 0;
+        for (i = 0; i < NVacancies; i++)
+            numChanges = checkVacancyACNARecursive(i, numChanges, vacancies, interstitials, acnaInts, nebListVacs, nebListInts, vacMask, intMask);
+
+        /* recreate vacancies/interstitials arrays */
 #ifdef DEBUG
-    printf("DEFECTSC: number of changes during ACNA refinement = %d\n", numChanges);
+        printf("DEFECTSC: number of changes during ACNA refinement = %d\n", numChanges);
 #endif
-    if (numChanges)
-    {
-        int count;
-
-        /* recreate interstitials array */
-        count = 0;
-        for (i = 0; i < NInterstitials; i++)
-            if (interstitials[i] != -1) interstitials[count++] = interstitials[i];
-        NInterstitials = count;
-
-        /* recreate vacancies array */
-        count = 0;
-        for (i = 0; i < NVacancies; i++)
-            if (vacancies[i] != -1) vacancies[count++] = vacancies[i];
-        NVacancies = count;
+
+        /* free memory */
+        free(vacMask);
+        free(intMask);
+        free(acnaInts);
+        freeNeighbourList2(nebListVacs, NVacancies);
+        freeNeighbourList2(nebListInts, numAcnaInts);
+
+        if (numChanges)
+        {
+            int count;
+
+            /* recreate interstitials array */
+            count = 0;
+            for (i = 0; i < NInterstitials; i++)
+                if (interstitials[i] != -1) interstitials[count++] = interstitials[i];
+            NInterstitials = count;
+
+            /* recreate vacancies array */
+            count = 0;
+            for (i = 0; i < NVacancies; i++)
+                if (vacancies[i] != -1) vacancies[count++] = vacancies[i];
+            NVacancies = count;
+        }
     }

     /* store counters */


updated warning about deprecated methods

--- Source/UIView+AutoLayout.h
+++ Source/UIView+AutoLayout.h
@@ -315,7 +315,7 @@

  All methods listed in this document have been deprecated. The below documentation will provide instructions on how to migrate to the newer more flexible methods.

- @warning Deprecated methods will be removed in future releases.
+ @warning Deprecated methods will be removed in version 1.0.0.
  */

 @interface UIView (AutoLayoutDeprecated)


No particle colors opt

No particle colors opt

--- bernstein_manifold_release/i4k_OGL/src/intro.c
+++ bernstein_manifold_release/i4k_OGL/src/intro.c
@@ -219,28 +219,30 @@
 // Create the particle locations and move them to the GPU
 #pragma code_seg(".GenerateParticles")
 void GenerateParticles(void) {
-    unsigned int seed = 23690984;
+    //unsigned int seed = 23690984;
+    unsigned int seed = 0;

     // Set vertex location
     int vertex_id = 0;
     int color_id = 0;
-    float zp = 1.0f;
+    float pp[3];
+    pp[2] = 1.0f;
     for (int z = 0; z < NUM_PARTICLES_PER_DIM; z++) {
-        float yp = -1.0f;
+        pp[1] = -1.0f;
         for (int y = 0; y < NUM_PARTICLES_PER_DIM; y++) {
-            float xp = -1.0f;
+            pp[0] = -1.0f;
             for (int x = 0; x < NUM_PARTICLES_PER_DIM; x++) {
-                vertices_[vertex_id++] = xp + 2.0f * jo_frand(&seed) / (float)NUM_PARTICLES_PER_DIM;
-                vertices_[vertex_id++] = yp + 2.0f * jo_frand(&seed) / (float)NUM_PARTICLES_PER_DIM;
-                vertices_[vertex_id++] = zp + 2.0f * jo_frand(&seed) / (float)NUM_PARTICLES_PER_DIM;
+                for (int dim = 0; dim < 3; dim++) {
+                    vertices_[vertex_id++] = pp[dim] + 2.0f / (float)NUM_PARTICLES_PER_DIM * jo_frand(&seed);
+                }
                 color_id += 3;  // ignore RGB
                 // fran
                 colors_[color_id++] = jo_frand(&seed);
-                xp += 2.0f / (float)NUM_PARTICLES_PER_DIM;
+                pp[0] += 2.0f / (float)NUM_PARTICLES_PER_DIM;
             }
-            yp += 2.0f / (float)NUM_PARTICLES_PER_DIM;
+            pp[1] += 2.0f / (float)NUM_PARTICLES_PER_DIM;
         }
-        zp -= 2.0f / (float)NUM_PARTICLES_PER_DIM;
+        pp[2] -= 2.0f / (float)NUM_PARTICLES_PER_DIM;
     }
 }


Applied innodb-4.1-ss36 and innodb-4.1-ss38 snapshots

Fixes:
- Bug #24299:
- Bug #25596:

--- innobase/dict/dict0dict.c
+++ innobase/dict/dict0dict.c
@@ -26,6 +26,9 @@
 #include "pars0sym.h"
 #include "que0que.h"
 #include "rem0cmp.h"
+
+/* Implement isspace() in a locale-independent way. (Bug #24299) */
+#define ib_isspace(c) ((char) (c) && strchr(" \v\f\t\r\n", c))

 dict_sys_t*	dict_sys	= NULL;	/* the dictionary system */

@@ -2374,7 +2377,7 @@

 	*success = FALSE;

-	while (isspace(*ptr)) {
+	while (ib_isspace(*ptr)) {
 		ptr++;
 	}

@@ -2419,7 +2422,7 @@

 	*id = NULL;

-	while (isspace(*ptr)) {
+	while (ib_isspace(*ptr)) {
 		ptr++;
 	}

@@ -2450,7 +2453,7 @@
 			len++;
 		}
 	} else {
-		while (!isspace(*ptr) && *ptr != '(' && *ptr != ')'
+		while (!ib_isspace(*ptr) && *ptr != '(' && *ptr != ')'
 		       && (accept_also_dot || *ptr != '.')
 		       && *ptr != ',' && *ptr != '\0') {

@@ -2480,12 +2483,12 @@
 	if (heap && !quote) {
 		/* EMS MySQL Manager sometimes adds characters 0xA0 (in
 		latin1, a 'non-breakable space') to the end of a table name.
-		But isspace(0xA0) is not true, which confuses our foreign key
-		parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
-		and 0xA0 are at the end of the string.
-
-		TODO: we should lex the string using thd->charset_info, and
-		my_isspace(). Only after that, convert id names to UTF-8. */
+		After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
+		and 0xA0 are at the end of the string, and ib_isspace()
+		does not work for multi-byte UTF-8 characters.
+
+		In MySQL 5.1 we lex the string using thd->charset_info, and
+		my_isspace(). This workaround is not needed there. */

 		b = (byte*)(*id);
 		id_len = strlen(b);
@@ -2956,11 +2959,11 @@

 		ut_a(success);

-		if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') {
+		if (!ib_isspace(*ptr) && *ptr != '"' && *ptr != '`') {
 	        	goto loop;
 		}

-		while (isspace(*ptr)) {
+		while (ib_isspace(*ptr)) {
 			ptr++;
 		}

@@ -2990,7 +2993,7 @@
 		goto loop;
 	}

-	if (!isspace(*ptr)) {
+	if (!ib_isspace(*ptr)) {
 	        goto loop;
 	}

@@ -3078,7 +3081,7 @@
 	}
 	ptr = dict_accept(ptr, "REFERENCES", &success);

-	if (!success || !isspace(*ptr)) {
+	if (!success || !ib_isspace(*ptr)) {
 		dict_foreign_report_syntax_err(name, start_of_latest_foreign,
 									ptr);
 		return(DB_CANNOT_ADD_CONSTRAINT);
@@ -3461,7 +3464,7 @@

 	ptr = dict_accept(ptr, "DROP", &success);

-	if (!isspace(*ptr)) {
+	if (!ib_isspace(*ptr)) {

 	        goto loop;
 	}


recorderendpoint/kmsbasemediamuxer: Check error: NULL

During the transition period from 16.4 to 18.04, the CURL HTTP plugin is
disabled and the "curlhttpsink" element is not available.

--- src/gst-plugins/recorderendpoint/kmsbasemediamuxer.c
+++ src/gst-plugins/recorderendpoint/kmsbasemediamuxer.c
@@ -136,12 +136,16 @@
     if (kms_is_valid_uri (uri)) {
       /* We use souphttpclientsink */
       sink = gst_element_factory_make ("curlhttpsink", NULL);
-      g_object_set (sink, "blocksize", MEGA_BYTES (1), "qos", FALSE,
-          "async", FALSE, NULL);
+      if (sink != NULL) {
+        g_object_set (sink, "blocksize", MEGA_BYTES (1), "qos", FALSE,
+            "async", FALSE, NULL);
+      }
+      else {
+        GST_ERROR_OBJECT (self, "CURL HTTP element not available: curlhttpsink");
+      }
     } else {
       GST_ERROR_OBJECT (self, "URL not valid");
     }
-
   }

   g_free (prot);


testfind enhancements

testfind enhancements

git-svn-id: bb0627f6f70d46b61088c62c6186faa4b96a9496@352 91ce42f0-d328-0410-95d8-f526ca767f89

--- bacula/src/tools/testfind.c
+++ bacula/src/tools/testfind.c
@@ -46,6 +46,8 @@
 "Usage: testfind [-d debug_level] [-] [pattern1 ...]\n"
 "       -a          print extended attributes (Win32 debug)\n"
 "       -dnn        set debug level to nn\n"
+"       -e          specify file of exclude patters\n"
+"       -i          specify file of include patters\n"
 "       -           read pattern(s) from stdin\n"
 "       -?          print this message.\n"
 "\n"
@@ -67,8 +69,11 @@
    FF_PKT *ff;
    char name[1000];
    int i, ch, hard_links;
-
-   while ((ch = getopt(argc, argv, "ad:?")) != -1) {
+   char *inc = NULL;
+   char *exc = NULL;
+   FILE *fd;
+
+   while ((ch = getopt(argc, argv, "ad:e:i:?")) != -1) {
       switch (ch) {
          case 'a':                    /* print extended attributes *debug* */
 	    attrs = 1;
@@ -81,6 +86,14 @@
 	    }
 	    break;

+         case 'e':                    /* exclude patterns */
+	    exc = optarg;
+	    break;
+
+         case 'i':                    /* include patterns */
+	    inc = optarg;
+	    break;
+
          case '?':
 	 default:
 	    usage();
@@ -93,7 +106,7 @@
    jcr = new_jcr(sizeof(JCR), NULL);

    ff = init_find_files();
-   if (argc == 0) {
+   if (argc == 0 && !inc) {
       add_fname_to_include_list(ff, 0, "/"); /* default to / */
    } else {
       for (i=0; i < argc; i++) {
@@ -107,9 +120,33 @@
 	 add_fname_to_include_list(ff, 0, argv[i]);
       }
    }
-
-  find_files(jcr, ff, print_file, NULL);
-  hard_links = term_find_files(ff);
+   if (inc) {
+      fd = fopen(inc, "r");
+      if (!fd) {
+         printf("Could not open include file: %s\n", inc);
+	 exit(1);
+      }
+      while (fgets(name, sizeof(name)-1, fd)) {
+	 strip_trailing_junk(name);
+	 add_fname_to_include_list(ff, 0, name);
+      }
+      fclose(fd);
+   }
+
+   if (exc) {
+      fd = fopen(exc, "r");
+      if (!fd) {
+         printf("Could not open exclude file: %s\n", exc);
+	 exit(1);
+      }
+      while (fgets(name, sizeof(name)-1, fd)) {
+	 strip_trailing_junk(name);
+	 add_fname_to_exclude_list(ff, name);
+      }
+      fclose(fd);
+   }
+   find_files(jcr, ff, print_file, NULL);
+   hard_links = term_find_files(ff);

    printf(_("\
 Total files    : %d\n\


correct typos. apologis for not pointing out.

--- build/files.c
+++ build/files.c
@@ -1096,7 +1096,7 @@
     k = strlen(fileName);
     while (x--) {
 	l = strlen(fl->docDirs[x]);
-	if (l < k && strncmp(filename, fl->docDirs[x], l) == 0 && filename[l] == '/')
+	if (l < k && strncmp(fileName, fl->docDirs[x], l) == 0 && fileName[l] == '/')
 	    return 1;
     }
     return 0;


stream_to_pack: xread does not guarantee to read all requested bytes

The deflate loop in bulk-checkin::stream_to_pack expects to get all bytes
from a file that it requests to read in a single function call. But it
used xread(), which does not give that guarantee. Replace it by
read_in_full().

Signed-off-by: Johannes Sixt <fd432345609ae4d58c1aa629cb66ba96d1391622@kdbg.org>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

--- bulk-checkin.c
+++ bulk-checkin.c
@@ -114,7 +114,7 @@

 		if (size && !s.avail_in) {
 			ssize_t rsize = size < sizeof(ibuf) ? size : sizeof(ibuf);
-			if (xread(fd, ibuf, rsize) != rsize)
+			if (read_in_full(fd, ibuf, rsize) != rsize)
 				die("failed to read %d bytes from '%s'",
 				    (int)rsize, path);
 			offset += rsize;


Fixed a memory allocation bug that may cause a debug mode crash.

--- C/SRC/msgbox.c
+++ C/SRC/msgbox.c
@@ -32,6 +32,8 @@
 *    2020-01-14 JFL Fixed a regression due to a change in MsvcLibX's version  *
 *		    of BreakArgLine():					      *
 *                   Remove C escape sequences, like \n \xXX, from the string. *
+*    2020-08-23 JFL Fixed a memory allocation bug that may cause a debug mode *
+*		    crash.                                                    *
 *                                                                             *
 *          Copyright 2016 Hewlett Packard Enterprise Development LP          *
 * Licensed under the Apache 2.0 license - www.apache.org/licenses/LICENSE-2.0 *
@@ -39,7 +41,7 @@

 #define PROGRAM_DESCRIPTION "Display a Message Box and return the user's choice"
 #define PROGRAM_NAME    "msgbox"
-#define PROGRAM_VERSION "2020-01-14"
+#define PROGRAM_VERSION "2020-08-23"

 #define _CRT_SECURE_NO_WARNINGS 1 /* Avoid Visual C++ 2005 security warnings */

@@ -64,14 +66,13 @@
 #define streqi(s1, s2) (!lstrcmpi(s1, s2))   /* Idem, not case sensitive */

 // Define WIN32 replacements for Standard C library functions
-#define malloc(size) (void *)LocalAlloc(LMEM_FIXED, size)
+/* 2020-08-17 Bug fix: Do NOT redefine malloc/realloc/free as this breaks the release of blocks indirectly allocated by C library functions */
 #define strlwr CharLower
 #define strcmp lstrcmp
 #define strcpy lstrcpy
 #define strcat lstrcat
 #define strlen lstrlen
 #define _tell(hf) _llseek(hf, 0, FILE_CURRENT)
-#define _filelength(hf) (

 #define NARGS 20


InnoDB: LOCK TABLES clean-up, part 2

InnoDB: LOCK TABLES clean-up, part 2

--- innobase/lock/lock0lock.c
+++ innobase/lock/lock0lock.c
@@ -3508,6 +3508,10 @@
 	lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, in_lock);

 	lock_table_remove_low(in_lock);
+
+	if (lock_get_type(in_lock) == LOCK_TABLE_EXP) {
+		in_lock->trx->n_lock_table_exp--;
+	}

 	/* Check if waiting locks in the queue can now be granted: grant
 	locks if there are no conflicting locks ahead. */
@@ -3609,7 +3613,6 @@
 			if (lock_get_type(lock) == LOCK_TABLE_EXP) {
 				ut_a(lock_get_mode(lock) == LOCK_S
 					|| lock_get_mode(lock) == LOCK_X);
-				trx->n_lock_table_exp--;
 			}
 		}

@@ -3676,7 +3679,6 @@
 			}

 			lock_table_dequeue(lock);
-			trx->n_lock_table_exp--;

 			lock = UT_LIST_GET_LAST(trx->trx_locks);
 			continue;


fuse: add mtab entry asynchronously

fuse: add mtab entry asynchronously

Instead of taking libfuse's approach to the bug referred
-- making use of an ad-hoc mount option --, we get over
the issue by not waiting for mtab manipulation to complete.
If mtab manipulation happens to fail for some reason, just
log an error message (instead of aborting the mount).

Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 511 (mount hangs with some audit configurations)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=511

--- contrib/fuse-lib/mount.c
+++ contrib/fuse-lib/mount.c
@@ -125,6 +125,21 @@
                 char templ[] = "/tmp/fusermountXXXXXX";
                 char *tmp;

+                /* mtab update done async, just log if fails */
+                res = fork ();
+                if (res)
+                        exit (res == -1 ? 1 : 0);
+                res = fork ();
+                if (res) {
+                        if (res != -1)
+                                res = waitpid (res, &status, 0);
+                        if (res == -1)
+                                GFFUSE_LOGERR ("%s: /etc/mtab update failed",
+                                               progname);
+
+                        exit (0);
+                }
+
                 sigprocmask (SIG_SETMASK, &oldmask, NULL);
                 setuid (geteuid ());


Fix typo.

Fix typo.

--- bus/ibusimpl.c
+++ bus/ibusimpl.c
@@ -600,7 +600,7 @@
         "      <arg name=\"context\" direction=\"out\" type=\"o\"/>\n"
         "    </method>\n"
         "    <method name=\"RegisterComponent\">\n"
-        "      <arg name=\"components\" direction=\"in\" type=\"av\"/>\n"
+        "      <arg name=\"components\" direction=\"in\" type=\"v\"/>\n"
         "    </method>\n"
         "    <method name=\"ListEngines\">\n"
         "      <arg name=\"engines\" direction=\"out\" type=\"av\"/>\n"


Update SafeKey header docs.

Update SafeKey header docs.

--- BraintreePaymentFlow/Public/ThreeDSecure/BTThreeDSecurePostalAddress.h
+++ BraintreePaymentFlow/Public/ThreeDSecure/BTThreeDSecurePostalAddress.h
@@ -29,7 +29,7 @@
 @property (nonatomic, nullable, copy) NSString *streetAddress;

 /**
- Optional. line 2 of the Address (eg. suite, apt #, etc.)
+ Optional. Line 2 of the Address (eg. suite, apt #, etc.)
  */
 @property (nonatomic, nullable, copy) NSString *extendedAddress;


Revert "cleanup"

Revert "cleanup"

This reverts commit cb84da6ac471272fbfc60caea4cfe8f1d80052b2.

--- mock4cpp/include/mock4cpp/Stubbing.h
+++ mock4cpp/include/mock4cpp/Stubbing.h
@@ -49,6 +49,7 @@

 protected:
+	virtual void startVerification() = 0;
 	virtual void VerifyInvocations(const int times) = 0;
 	virtual void clearProgress() = 0;
 private:


Eliminate two useracc(..., VM_PROT_READ) calls that immediately precede
copyin() calls.

Submitted by:	bde

--- sys/alpha/alpha/machdep.c
+++ sys/alpha/alpha/machdep.c
@@ -1418,11 +1418,9 @@
 		return (EINVAL);

 	/*
-	 * Test and fetch the context structure.
-	 * We grab it all at once for speed.
-	 */
-	if (useracc((caddr_t)scp, sizeof (*scp), VM_PROT_READ) == 0 ||
-	    copyin((caddr_t)scp, (caddr_t)&ksc, sizeof ksc))
+	 * Fetch the entire context structure at once for speed.
+	 */
+	if (copyin((caddr_t)scp, (caddr_t)&ksc, sizeof ksc))
 		return (EINVAL);

 	/*
@@ -1488,11 +1486,9 @@
 		return (EINVAL);

 	/*
-	 * Test and fetch the context structure.
-	 * We grab it all at once for speed.
-	 */
-	if (useracc((caddr_t)ucp, sizeof(ucontext_t), VM_PROT_READ) == 0 ||
-	    copyin((caddr_t)ucp, (caddr_t)&uc, sizeof(ucontext_t)))
+	 * Fetch the entire context structure at once for speed.
+	 */
+	if (copyin((caddr_t)ucp, (caddr_t)&uc, sizeof(ucontext_t)))
 		return (EINVAL);

 	/*