MFi386: Merge updates to the cpu pseudo-driver.  Compile, not runtime tested.

--- sys/amd64/amd64/legacy.c
+++ sys/amd64/amd64/legacy.c
@@ -38,6 +38,7 @@
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
+#include <sys/cpu.h>
 #include <sys/kernel.h>
 #include <sys/malloc.h>
 #include <sys/module.h>
@@ -132,30 +133,23 @@
 {
 	device_t child;
 	int i;
-	struct pcpu *pc;
+
+	/* First, attach the CPU pseudo-driver. */
+	for (i = 0; i <= mp_maxid; i++)
+		if (!CPU_ABSENT(i)) {
+			child = BUS_ADD_CHILD(dev, 0, "cpu", i);
+			if (child == NULL)
+				panic("legacy_attach cpu");
+			device_probe_and_attach(child);
+		}

 	/*
-	 * First, let our child driver's identify any child devices that
+	 * Second, let our child driver's identify any child devices that
 	 * they can find.  Once that is done attach any devices that we
 	 * found.
 	 */
 	bus_generic_probe(dev);
 	bus_generic_attach(dev);
-
-	/* Attach CPU pseudo-driver. */
-	if (!devclass_get_device(devclass_find("cpu"), 0)) {
-		for (i = 0; i <= mp_maxid; i++)
-			if (!CPU_ABSENT(i)) {
-				pc = pcpu_find(i);
-				KASSERT(pc != NULL, ("pcpu_find failed"));
-				child = BUS_ADD_CHILD(dev, 0, "cpu", i);
-				if (child == NULL)
-					panic("legacy_attach cpu");
-				device_probe_and_attach(child);
-				pc->pc_device = child;
-				device_set_ivars(child, pc);
-			}
-	}

 	/*
 	 * If we didn't see ISA on a pci bridge, create some
@@ -244,6 +238,14 @@
  */
 static int	cpu_read_ivar(device_t dev, device_t child, int index,
 		    uintptr_t *result);
+static device_t cpu_add_child(device_t bus, int order, const char *name,
+		    int unit);
+static struct resource_list *cpu_get_rlist(device_t dev, device_t child);
+
+struct cpu_device {
+	struct resource_list cd_rl;
+	struct pcpu *cd_pcpu;
+};

 static device_method_t cpu_methods[] = {
 	/* Device interface */
@@ -255,10 +257,15 @@
 	DEVMETHOD(device_resume,	bus_generic_resume),

 	/* Bus interface */
+	DEVMETHOD(bus_add_child,	cpu_add_child),
 	DEVMETHOD(bus_read_ivar,	cpu_read_ivar),
 	DEVMETHOD(bus_print_child,	bus_generic_print_child),
-	DEVMETHOD(bus_alloc_resource,	bus_generic_alloc_resource),
-	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
+	DEVMETHOD(bus_get_resource_list, cpu_get_rlist),
+	DEVMETHOD(bus_get_resource,	bus_generic_rl_get_resource),
+	DEVMETHOD(bus_set_resource,	bus_generic_rl_set_resource),
+	DEVMETHOD(bus_alloc_resource,	bus_generic_rl_alloc_resource),
+	DEVMETHOD(bus_release_resource,	bus_generic_rl_release_resource),
+	DEVMETHOD(bus_driver_added,	bus_generic_driver_added),
 	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
 	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
 	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
@@ -272,19 +279,50 @@
 	cpu_methods,
 	1,		/* no softc */
 };
-static devclass_t cpu_devclass;
+devclass_t cpu_devclass;
 DRIVER_MODULE(cpu, legacy, cpu_driver, cpu_devclass, 0, 0);

+static device_t
+cpu_add_child(device_t bus, int order, const char *name, int unit)
+{
+	struct cpu_device *cd;
+	device_t child;
+	struct pcpu *pc;
+
+	if ((cd = malloc(sizeof(*cd), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL)
+		return (NULL);
+
+	resource_list_init(&cd->cd_rl);
+	pc = pcpu_find(unit);
+	KASSERT(pc != NULL, ("pcpu_find failed"));
+	cd->cd_pcpu = pc;
+
+	child = device_add_child_ordered(bus, order, name, unit);
+	if (child != NULL) {
+		pc->pc_device = child;
+		device_set_ivars(child, cd);
+	} else
+		free(cd, M_DEVBUF);
+	return (child);
+}
+
+static struct resource_list *
+cpu_get_rlist(device_t dev, device_t child)
+{
+	struct cpu_device *cpdev;
+
+	cpdev = device_get_ivars(child);
+	return (&cpdev->cd_rl);
+}
+
 static int
 cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
 {
-	struct pcpu *pc;
-
-	if (index != 0)
+	struct cpu_device *cpdev;
+
+	if (index != CPU_IVAR_PCPU)
 		return (ENOENT);
-	pc = device_get_ivars(child);
-	if (pc == NULL)
-		return (ENOENT);
-	*result = (uintptr_t)pc;
+	cpdev = device_get_ivars(dev);
+	*result = (uintptr_t)cpdev->cd_pcpu;
 	return (0);
 }


Add spaces around && .

Add spaces around && .

--- KERN/netinet/sctp_crc32.c
+++ KERN/netinet/sctp_crc32.c
@@ -40,7 +40,7 @@

 #include <netinet/sctp_os.h>
 #if defined(__APPLE__)
-#if !defined(APPLE_LEOPARD) &&!defined(APPLE_SNOWLEOPARD) &&!defined(APLE_LION)
+#if !defined(APPLE_LEOPARD) && !defined(APPLE_SNOWLEOPARD) && !defined(APLE_LION)
 #include <sys/time.h>
 #endif
 #endif


bonding: fix link detect in non-interrupt mode

Stopping then re-starting a bond interface containing slaves that
used polling for link detection caused the bond to think all slave
links were down and inactive.

Move the start of the polling for link from slave_add() to
bond_ethdev_start() and in bond_ethdev_stop() make sure we clear
the last_link_status of the slaves.

Fixes: a45b288ef21a ("bond: support link status polling")

Signed-off-by: Nelson Escobar <921f6477015852c9d60fa5cb7e6a106f68b238db@cisco.com>
Signed-off-by: John Daley <097981eb5abe5dbeac3142a4f5a88742d916de86@cisco.com>
Acked-by: Declan Doherty <b4388acd850cd8caad5000a112795063f04807ac@intel.com>

--- drivers/net/bonding/rte_eth_bond_pmd.c
+++ drivers/net/bonding/rte_eth_bond_pmd.c
@@ -1454,18 +1454,11 @@
 	slave_details->port_id = slave_eth_dev->data->port_id;
 	slave_details->last_link_status = 0;

-	/* If slave device doesn't support interrupts then we need to enabled
-	 * polling to monitor link status */
+	/* Mark slave devices that don't support interrupts so we can
+	 * compensate when we start the bond
+	 */
 	if (!(slave_eth_dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)) {
 		slave_details->link_status_poll_enabled = 1;
-
-		if (!internals->link_status_polling_enabled) {
-			internals->link_status_polling_enabled = 1;
-
-			rte_eal_alarm_set(internals->link_status_polling_interval_ms * 1000,
-					bond_ethdev_slave_link_status_change_monitor,
-					(void *)&rte_eth_devices[internals->port_id]);
-		}
 	}

 	slave_details->link_status_wait_to_complete = 0;
@@ -1550,6 +1543,18 @@
 					eth_dev->data->port_id, internals->slaves[i].port_id);
 			return -1;
 		}
+		/* We will need to poll for link status if any slave doesn't
+		 * support interrupts
+		 */
+		if (internals->slaves[i].link_status_poll_enabled)
+			internals->link_status_polling_enabled = 1;
+	}
+	/* start polling if needed */
+	if (internals->link_status_polling_enabled) {
+		rte_eal_alarm_set(
+			internals->link_status_polling_interval_ms * 1000,
+			bond_ethdev_slave_link_status_change_monitor,
+			(void *)&rte_eth_devices[internals->port_id]);
 	}

 	if (internals->user_defined_primary_port)
@@ -1622,6 +1627,8 @@

 	internals->active_slave_count = 0;
 	internals->link_status_polling_enabled = 0;
+	for (i = 0; i < internals->slave_count; i++)
+		internals->slaves[i].last_link_status = 0;

 	eth_dev->data->dev_link.link_status = 0;
 	eth_dev->data->dev_started = 0;


* subversion/libsvn_subr/sqlite.c
  (svn_sqlite__get_statement): Add a cautionary assert statement.

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@875456 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_subr/sqlite.c
+++ subversion/libsvn_subr/sqlite.c
@@ -126,6 +126,8 @@
 svn_sqlite__get_statement(svn_sqlite__stmt_t **stmt, svn_sqlite__db_t *db,
                           int stmt_idx)
 {
+  SVN_ERR_ASSERT(stmt_idx < db->nbr_statements);
+
   if (db->prepared_stmts[stmt_idx] == NULL)
     SVN_ERR(svn_sqlite__prepare(&db->prepared_stmts[stmt_idx], db,
                                 db->statement_strings[stmt_idx],


Allow to quit even with ESC even while waiting for drop

--- PsxVram-SDL.c
+++ PsxVram-SDL.c
@@ -294,6 +294,8 @@
 				running = 0;
 			}
 		}
+		if (event.type == SDL_KEYDOWN && event.key.keysym.sym == SDLK_ESCAPE)
+			running = 0;
 		SDL_UpdateWindowSurface(window);
 	}
 	SDL_FreeSurface(winSur);


Keep list sorted.

Keep list sorted.


Changed number of particles from 10,000 to 100.

--- Project/Game.h
+++ Project/Game.h
@@ -58,7 +58,7 @@
     CubeDrawable cube_right;
     ParticlesDrawable particles;
 public:
-    Game() : particles(10000) {}
+    Game() : particles(100) {}
     static Game * New(void) { return new Game(); }
     void PrintShaderError(GLint shader);


Put back in the < 7.0 changes for the net giant. Robert has committed his patch :-)

--- KERN/netinet/sctp_input.c
+++ KERN/netinet/sctp_input.c
@@ -2191,7 +2191,7 @@
 				return (m);
 			}
 			oso = (*inp_p)->sctp_socket;
-#if (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
+#if (defined(__FreeBSD__) && __FreeBSD_version < 700000)
 			/*
 			 * We do this to keep the sockets side happy during
 			 * the sonewcon ONLY.
@@ -2208,7 +2208,7 @@
 			     ,NULL , (*inp_p)->def_vrf_id
 #endif
 			    );
-#if (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
+#if (defined(__FreeBSD__) && __FreeBSD_version < 700000)
 			NET_UNLOCK_GIANT();
 #endif
 			SCTP_TCB_LOCK((*stcb));


net/i40e/base: add link speed convert function

Introduce a helper function which can convert the AdminQ link speed
definition into a virtchnl definition. This can then be used by host
driver implementations in order to safely convert to the interface
recognized by the virtual functions.

Signed-off-by: Qi Zhang <9e9e58ffa71a29bb7b87766b362515be648fcbe0@intel.com>
Acked-by: Beilei Xing <7fb7e49de6d75fb4140bfcdada52e66859d93ebd@intel.com>

--- drivers/net/i40e/base/i40e_prototype.h
+++ drivers/net/i40e/base/i40e_prototype.h
@@ -496,6 +496,38 @@
 	return i40e_ptype_lookup[ptype];
 }

+#ifdef PF_DRIVER
+/**
+ * i40e_virtchnl_link_speed - Convert AdminQ link_speed to virtchnl definition
+ * @link_speed: the speed to convert
+ *
+ * Returns the link_speed in terms of the virtchnl interface, for use in
+ * converting link_speed as reported by the AdminQ into the format used for
+ * talking to virtchnl devices. If we can't represent the link speed properly,
+ * report LINK_SPEED_UNKNOWN.
+ **/
+STATIC INLINE enum virtchnl_link_speed
+i40e_virtchnl_link_speed(enum i40e_aq_link_speed link_speed)
+{
+	switch (link_speed) {
+	case I40E_LINK_SPEED_100MB:
+		return VIRTCHNL_LINK_SPEED_100MB;
+	case I40E_LINK_SPEED_1GB:
+		return VIRTCHNL_LINK_SPEED_1GB;
+	case I40E_LINK_SPEED_10GB:
+		return VIRTCHNL_LINK_SPEED_10GB;
+	case I40E_LINK_SPEED_40GB:
+		return VIRTCHNL_LINK_SPEED_40GB;
+	case I40E_LINK_SPEED_20GB:
+		return VIRTCHNL_LINK_SPEED_20GB;
+	case I40E_LINK_SPEED_25GB:
+		return VIRTCHNL_LINK_SPEED_25GB;
+	case I40E_LINK_SPEED_UNKNOWN:
+	default:
+		return VIRTCHNL_LINK_SPEED_UNKNOWN;
+	}
+}
+#endif /* PF_DRIVER */
 /* prototype for functions used for SW spinlocks */
 void i40e_init_spinlock(struct i40e_spinlock *sp);
 void i40e_acquire_spinlock(struct i40e_spinlock *sp);


* subversion/svn/tree-conflicts.c   (svn_cl__append_human_readable_tree_conflict_description): Print the    victim path in 'Invalid tree conflict data' error message.

--- subversion/svn/tree-conflicts.c
+++ subversion/svn/tree-conflicts.c
@@ -201,14 +201,15 @@
   svn_stringbuf_t *their_phrase_with_victim, *our_phrase_with_victim;
   struct tree_conflict_phrases *phrases = new_tree_conflict_phrases(pool);

+  victim_name = svn_path_basename(conflict->path, pool);
   their_phrase = select_their_phrase(conflict, phrases);
   our_phrase = select_our_phrase(conflict, phrases);
   if (! our_phrase || ! their_phrase)
-    return svn_error_create(SVN_ERR_WC_CORRUPT, NULL,
-                            _("Invalid tree conflict data"));
+    return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
+                             _("Invalid tree conflict data for victim %s"),
+                             victim_name);

   /* Substitute the '%s' format in the phrases with the victim path. */
-  victim_name = svn_path_basename(conflict->path, pool);
   their_phrase_with_victim = svn_stringbuf_createf(pool, their_phrase,
                                                    victim_name);
   our_phrase_with_victim = svn_stringbuf_createf(pool, our_phrase,


include camel-log.h to avoid unresolved symbols.

1999-12-19  bertrand  <Bertrand.Guiheneuf@aful.org>

	* camel/camel-folder-utils.c: include camel-log.h
	to avoid unresolved symbols.

--- camel/camel-folder-utils.c
+++ camel/camel-folder-utils.c
@@ -25,8 +25,9 @@
  * USA
  */

-
+#include <config.h>
 #include "camel-folder-utils.h"
+#include "camel-log.h"
 #include "camel-mime-message.h"


enlightenment/conf: fix missing icons in settings panel

Shows the 'unknown' icon for settings panel items which have no icon defined.
@fix

--- src/modules/conf/e_conf.c
+++ src/modules/conf/e_conf.c
@@ -356,6 +356,8 @@
    ci->label = eina_stringshare_add(label);
    if (icon_file) ci->icon_file = eina_stringshare_add(icon_file);
    if (icon) ci->icon = eina_stringshare_add(icon);
+   if ((!ci->icon_file) && (!ci->icon))
+     ci->icon = eina_stringshare_add("unknown");
    cat->items = eina_list_append(cat->items, ci);
 }


Don't include <stddef.h> for offsetof() - its also defined in <sys/types.h>

--- sys/ia64/ia64/genassym.c
+++ sys/ia64/ia64/genassym.c
@@ -36,8 +36,6 @@
  *	from: @(#)genassym.c	5.11 (Berkeley) 5/10/91
  * $FreeBSD$
  */
-
-#include <stddef.h>

 #include <sys/param.h>
 #include <sys/systm.h>


net/octeontx: fix uninitialized variable in port open

Coverity issue: 195045
Fixes: f18b146c498d ("net/octeontx: create ethdev ports")
Cc: stable@dpdk.org

Signed-off-by: Santosh Shukla <23b682afe3504ae4f88c66c3cabfb34f87e9916e@caviumnetworks.com>

--- drivers/net/octeontx/octeontx_ethdev.c
+++ drivers/net/octeontx/octeontx_ethdev.c
@@ -122,7 +122,7 @@
 	int res;

 	res = 0;
-
+	memset(&bgx_port_conf, 0x0, sizeof(bgx_port_conf));
 	PMD_INIT_FUNC_TRACE();

 	res = octeontx_bgx_port_open(nic->port_id, &bgx_port_conf);


Code indentation fix.

Code indentation fix.

* subversion/svndumpfilter/main.c
  (new_revision_record): Fix indentation of if..else block and
  spurious new line.

Patch by: Senthil Kumaran <senthil@collab.net>

--- subversion/svndumpfilter/main.c
+++ subversion/svndumpfilter/main.c
@@ -250,14 +250,9 @@
   rb->rev_orig = SVN_STR_TO_REV(val);

   if (rb->pb->do_renumber_revs)
-    {
-      rb->rev_actual = rb->rev_orig - rb->pb->rev_drop_count;
-    }
+    rb->rev_actual = rb->rev_orig - rb->pb->rev_drop_count;
   else
-    {
-      rb->rev_actual = rb->rev_orig;
-    }
-
+    rb->rev_actual = rb->rev_orig;

   SVN_ERR(svn_stream_printf(header_stream, pool,
                             SVN_REPOS_DUMPFILE_REVISION_NUMBER ": %ld\n",
@@ -276,7 +271,6 @@
       SVN_ERR(svn_stream_printf(header_stream, pool, "%s: %s\n",
                                 (const char *)key,
                                 (const char *)val));
-
     }

   SVN_ERR(svn_stream_close(header_stream));


imapx_untagged_fetch: Replace assertion with runtime-warning.

Temporary Band-Aid until we can figure out why some users are hitting
this assertion.  Libraries should never abort programs on their own.

--- camel/camel-imapx-server.c
+++ camel/camel-imapx-server.c
@@ -1952,8 +1952,7 @@

 					} while (!found && min <= max);

-					if (!found)
-						g_assert_not_reached ();
+					g_return_val_if_fail (found, FALSE);

 					server_flags = r->server_flags;
 					server_user_flags = r->server_user_flags;


net/emcute: add doc that QoS -1 is not supported

--- sys/include/net/emcute.h
+++ sys/include/net/emcute.h
@@ -66,6 +66,7 @@
  *              how to put / how to encode the IPv(4/6) address AND the port of
  *              a gateway in the GwAdd field of the GWINFO message
  * @todo        QOS level 2
+ * @todo        QOS level -1
  * @todo        put the node to sleep (send DISCONNECT with duration field set)
  * @todo        handle DISCONNECT messages initiated by the broker/gateway
  * @todo        support for pre-defined and short topic IDs


Added implementation notes for [re]set_exc_info().

--- Python/ceval.c
+++ Python/ceval.c
@@ -2616,6 +2616,67 @@
 }

+/* Implementation notes for set_exc_info() and reset_exc_info():
+
+- Below, 'exc_ZZZ' stands for 'exc_type', 'exc_value' and
+  'exc_traceback'.  These always travel together.
+
+- tstate->curexc_ZZZ is the "hot" exception that is set by
+  PyErr_SetString(), cleared by PyErr_Clear(), and so on.
+
+- Once an exception is caught by an except clause, it is transferred
+  from tstate->curexc_ZZZ to tstate->exc_ZZZ, from which sys.exc_info()
+  can pick it up.  This is the primary task of set_exc_info().
+
+- Now let me explain the complicated dance with frame->f_exc_ZZZ.
+
+  Long ago, when none of this existed, there were just a few globals:
+  one set corresponding to the "hot" exception, and one set
+  corresponding to sys.exc_ZZZ.  (Actually, the latter weren't C
+  globals; they were simply stored as sys.exc_ZZZ.  For backwards
+  compatibility, they still are!)  The problem was that in code like
+  this:
+
+     try:
+	"something that may fail"
+     except "some exception":
+	"do something else first"
+	"print the exception from sys.exc_ZZZ."
+
+  if "do something else first" invoked something that raised and caught
+  an exception, sys.exc_ZZZ were overwritten.  That was a frequent
+  cause of subtle bugs.  I fixed this by changing the semantics as
+  follows:
+
+    - Within one frame, sys.exc_ZZZ will hold the last exception caught
+      *in that frame*.
+
+    - But initially, and as long as no exception is caught in a given
+      frame, sys.exc_ZZZ will hold the last exception caught in the
+      previous frame (or the frame before that, etc.).
+
+  The first bullet fixed the bug in the above example.  The second
+  bullet was for backwards compatibility: it was (and is) common to
+  have a function that is called when an exception is caught, and to
+  have that function access the caught exception via sys.exc_ZZZ.
+  (Example: traceback.print_exc()).
+
+  At the same time I fixed the problem that sys.exc_ZZZ weren't
+  thread-safe, by introducing sys.exc_info() which gets it from tstate;
+  but that's really a separate improvement.
+
+  The reset_exc_info() function in ceval.c restores the tstate->exc_ZZZ
+  variables to what they were before the current frame was called.  The
+  set_exc_info() function saves them on the frame so that
+  reset_exc_info() can restore them.  The invariant is that
+  frame->f_exc_ZZZ is NULL iff the current frame never caught an
+  exception (where "catching" an exception applies only to successful
+  except clauses); and if the current frame ever caught an exception,
+  frame->f_exc_ZZZ is the exception that was stored in tstate->exc_ZZZ
+  at the start of the current frame.
+
+*/
+
 static void
 set_exc_info(PyThreadState *tstate,
 	     PyObject *type, PyObject *value, PyObject *tb)


iwlwifi: remove duplicate initialization in __iwl_down()

We initialize exit_pending twice.  It's the second initialization which
is correct.  That was added in d745d472af "iwlwifi: cancel scan when
down the device".

Signed-off-by: Dan Carpenter <72501f147b2753e6660fdce744d9ac3084854f5e@gmail.com>
Acked-by: Wey-Yi Guy <15ba08e2ad0b84ec2e6b8e47b27706f8a8e5edd0@intel.com>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>

--- drivers/net/wireless/iwlwifi/iwl-agn.c
+++ drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2537,7 +2537,7 @@
 static void __iwl_down(struct iwl_priv *priv)
 {
 	unsigned long flags;
-	int exit_pending = test_bit(STATUS_EXIT_PENDING, &priv->status);
+	int exit_pending;

 	IWL_DEBUG_INFO(priv, DRV_NAME " is going down\n");


Update ExponentialSpringForce.h

Update ExponentialSpringForce.h

More refinements to the Doxygen comments.

--- Simbody/include/simbody/internal/ExponentialSpringForce.h
+++ Simbody/include/simbody/internal/ExponentialSpringForce.h
@@ -24,38 +24,56 @@
 namespace SimTK {

 //=============================================================================
-/** Class ExponentialSpringParameters manages the parameters used to specify
-the characteristics of an ExponentialSpringForce instance.  Changing a
-parameter will invalidate the system at Stage::Topology, although the
-invalidation will not occur until the parameters are set on an actual
-instance of ExponentialSpringForce.
-
-The force in the normal direction is computed using an exponential:
-
-       fNormal = d1 * exp(-d2*(py-d0)) * (1.0 - kvNorm)
-
-where py is the distance of the spring point on the Body above the plane
-of the floor expressied in the frame of the contact plane.
-
-The friction force is modeled using a linear spring with damping:
-
-       fFric = -kpFric*(pxz-p0) - kvFric*vxz,
-
-where pxz is the position of the spring on the Body projected onto the plane
-of the floor and expressed in the floor frame, and p0 is the spring zero
-in the plane of the floor.
-
-d0 is the only parameter that can be positive, negative, or zero.  All other
-parameters should be positive (and sometimes 0.0).
-
-Note that there are 4 additional quantities that determine the
-behavior of an exponential spring that are not handled by this class.
-They are p0, mus, muk, and sliding.  These quantities are handled as
-as states in order to allow them to change during the course of a simulation.
-See ExponentialSpringForce for details on these states.
-
-@see ExponentialSpringForce::setParameters()
-@see ExponentialSpringForce */
+/** ExponentialSpringParameters is a helper class used to customize the
+characteristics of an ExponentialSpringForce instance.  To customize the
+parameters on such an instance, the user should
+
+1) Create an ExponentialSpringParameters object. For example,
+
+        ExponentialSpringParameters myParams;
+
+2) Use the available 'set' methods in this class to change the parameters
+of that object. For example,
+
+        myParams.setNormalViscosity(0.25);
+
+3) And then use ExponentialSpringForce::setParameters() to alter the
+parameters of one (or many) ExponentialSpringForce instances. For example,
+
+        ExponentialSpringForce spr1, spr2;
+        spr1.setParameters(myParams);
+        spr2.setParameters(myParams);
+
+4) When a new set of parameters is set on an ExponentialSpringForce
+instance, as above in step 3, the System will be invalidated at
+Stage::Topology.  The System must therefore be realized at Stage::Topology
+before a simulation can proceed.
+
+        System.realizeTopology();
+
+Note that each ExponentialSpringForce instance owns its own private
+ExponentialSpringParameters object. The myParams object is just used to set
+the parameter values of the privately owned parameters object.  It is fine for
+objects like myParams to go out out of scope or for myParams objects
+allocated from the heap to be deleted.
+
+The default values of the parameters held by ExponentialSpringParamters
+work well for typical contact interactions, but clearly will not be
+appropriate for simulating many contact interactions.  For example, one might
+need to simulate an interaction in which very little energy is dissipated
+during a bounce.
+
+For an explanation of the equaitons that underlie exponential spring forces,
+refer to class ExponentialSpringForce. For details on the customizable
+parameters, refer to the member variables of this class (below) and also the
+'set' methods available in this class (also below).
+
+Note that there are 2 quantities not managed by this class that can be
+customized.  These are the static coefficient of friction (mus) and the
+kinetic coefficient of friction (muk).  mus and muk are handled as states in
+order to allow them to change during the course of a simulation. They can be
+set using ExponentialSpringForce::setMuStatic() and
+ExponentialSpringForce::setMuKinetic(). */
 class SimTK_SIMBODY_EXPORT ExponentialSpringParameters {
 protected:
     /** d0 shifts the exponential function up and down with respect to
@@ -73,7 +91,7 @@
     Real d2;

     /** kvNorm is the viscosity of the spring in the normal direction. Its
-    default value is 0.5. kvNorm can have a value of 0.0. */
+    default value is 0.5. kvNorm may be set equal to 0.0. */
     Real kvNorm;

     /** kpFric is the elasticity of the friction spring. Its default value
@@ -82,8 +100,8 @@

     /** kvFric is the viscosity of the friction spring. By default, its value
     is set relative to kpFric so that critical damping would occur for a
-    specified mass (i.e., kvFric = 2 * sqrt(kpFric * mass)).
-    kvFric can be 0.0. */
+    specified mass (i.e., kvFric = 2*sqrt(kpFric*mass)). kvFric may also be
+    set independently from kpFric and may be set to 0.0. */
     Real kvFric;

     /** kTau is equal to 1.0/tau. tau is the characteristic time to transition
@@ -129,7 +147,8 @@

     /** Set the viscosity of the exponential part of the spring. This viscosity
     only applies to the component of the velocity of the body spring point
-    that is normal to the floor plane.
+    normal to the contact plane. To eliminate energy dissipation in the normal
+    direction, set kvNorm equal to 0.0.
     @param kvNorm Viscosity of the spring in the normal direction. Its default
     value is 0.5. */
     void setNormalViscosity(Real& kvNorm);
@@ -153,7 +172,16 @@
     @param kp Elastcity of the friction spring */
     void setElasticity(Real kp);

-    /** Set the vicosity of the friction spring.  Its value can be set to 0.0.
+    /** Set the viscosity of the friction spring. Setting the viscosity equal
+    to 0.0 is fine, but may not have the expected result.  If a body is not
+    sliding, setting kv = 0.0 will simply allow the body to vibrate in place
+    indefinitely. If a body is sliding, even if kv = 0.0, the kinetic energy
+    of the body will still be dissipated because the frictional force will
+    not be zero.  (The elastic part of the friction spring is stretched and so
+    still applies a force, but potential energy is not stored in the spring
+    because the spring zero is continually released.) The only way to eliminate
+    energy dissipation entirely is to set the coefficients of friction equal to
+    0.0, which can be done by one call to ExponentialSpringForce::setMuStatic(0.0).
     @param kv Viscosity of the friction spring */
     void setViscosity(Real kv);

@@ -166,7 +194,7 @@
     Real getViscosity() const;

     /** Set the time constant for transitioning back and forth between the
-    static and kinetic coefficents of friction.  The transition is mediated
+    static and kinetic coefficents of friction. The transition is mediated
     by a rising or falling exponential that is asymptotic to mu static or
     or mu kinetic respectively. The default value of tau is 0.01 s.
     @param tau Time constant for sliding transitions */
@@ -189,10 +217,10 @@
     Real getSettleVelocity() const;

     /** The member variables managed by this class are used by the underlying
-    implementation of the %ExponentialSpringForce Subsystem.  Direct access
-    is given to %ExponentialSpringForceImpl for reasons of speed and
+    implementation of the ExponentialSpringForce Subsystem.  Direct access
+    is given to ExponentialSpringForceImpl for reasons of speed and
     convenience.  Direct access is not given to other classes to ensure that
-    these paramters are set only to valid values. */
+    paramters are set only to valid values. */
     friend class ExponentialSpringForceImpl;
 };

@@ -508,17 +536,18 @@
 STATES
 ------
 DISCRETE STATES\n
-@param mus static coefficient of friction.  0.0 <= mus <= 1.0
-@param muk kinetic coefficient of friction.  0.0 <= muk <= mus
-@param station Point on the MobilizedBody expressed in the body frame.
+    mus = Static coefficient of friction.  0.0 <= mus <= 1.0 \n
+    muk = Kinetic coefficient of friction.  0.0 <= muk <= mus \n
+    station = Point on the MobilizedBody expressed in the body frame.
+

 AUTO UPDATE DISCRETE STATE\n
-@param p0 Zero of the frictional spring.
+    p0 = Zero of the frictional spring.
+

 CONTINUOUS STATE\n
-@param Sliding Characterizes whether the spring zero is sliding (1.0) or fixed
-in place (0.0). This state is used for transitioning back and forth between
-mus and muk.
+    Sliding = Indicator of whether the MobilizedBody is sliding.
+

 ----------
 PARAMETERS


for MPW __SC__

for MPW __SC__

--- Python/fmod.c
+++ Python/fmod.c
@@ -24,12 +24,15 @@

 /* Portable fmod(x, y) implementation for systems that don't have it */

-#include <math.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "mymath.h"
 #include <errno.h>

 double
-fmod(x, y)
-	double x, y;
+fmod(double x, double y)
 {
 	double i, f;


Use unsigned long instead of unsigned for the integer casts here.  The
former works for both ILP32 and LP64 programming models, while the
latter fails LP64.

# uintpr_t is better, but iirc, we can't pollute the name space to use it
# I likely need to audit all my uintptr_t changes for that issue...


[PATCH] zd1211rw: Add ID for ZyXEL AG-220

Tested by Christoph Sager and Tomas Klas

zd1211b chip 0586:3412 v4810 high 00-13-49 AL7230B_RF pa0 g----

Signed-off-by: Daniel Drake <83b0c3d63e8a11eb6e40077030b59e95bfe31ffa@gentoo.org>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>

--- drivers/net/wireless/zd1211rw/zd_usb.c
+++ drivers/net/wireless/zd1211rw/zd_usb.c
@@ -66,6 +66,7 @@
 	{ USB_DEVICE(0x0b05, 0x171b), .driver_info = DEVICE_ZD1211B },
 	{ USB_DEVICE(0x0586, 0x3410), .driver_info = DEVICE_ZD1211B },
 	{ USB_DEVICE(0x0baf, 0x0121), .driver_info = DEVICE_ZD1211B },
+	{ USB_DEVICE(0x0586, 0x3412), .driver_info = DEVICE_ZD1211B },
 	/* "Driverless" devices that need ejecting */
 	{ USB_DEVICE(0x0ace, 0x2011), .driver_info = DEVICE_INSTALLER },
 	{}


Honor the IFF_MONITOR flag.

Honor the IFF_MONITOR flag.

PR:		kern/99500
Submitted by:	Craig Leres <leres ee.lbl.gov>
Approved by:	re (kensmith)


regulator: pfuze100: add MODULE_LICENSE() in pfuze100 driver

Fix building error on x86_64 and i386:
WARNING: modpost: missing MODULE_LICENSE() in
drivers/regulator/pfuze100-regulator.o

Signed-off-by: Robin Gong <38993a1496cc753319ccb5b37e3ed10435688db0@freescale.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>

--- drivers/regulator/pfuze100-regulator.c
+++ drivers/regulator/pfuze100-regulator.c
@@ -451,4 +451,5 @@

 MODULE_AUTHOR("Robin Gong <b38343@freescale.com>");
 MODULE_DESCRIPTION("Regulator Driver for Freescale PFUZE100 PMIC");
+MODULE_LICENSE("GPL v2");
 MODULE_ALIAS("pfuze100-regulator");


Fix the comment.

Fix the comment.

--- sys/netgraph/ng_eiface.c
+++ sys/netgraph/ng_eiface.c
@@ -282,8 +282,8 @@
 }

 /*
- * We simply relay the packet to the ether hook, if it is connected.
- * We have been throughthe netgraph locking an are guaranteed to
+ * We simply relay the packet to the "ether" hook, if it is connected.
+ * We have been through the netgraph locking and are guaranteed to
  * be the only code running in this node at this time.
  */
 static void


staging: android: timed_output : disable the timed output device when the device is unregistered

(Life cycle of timed output device driver)

1) register the device as the timed output
2) enable() ops is called via the sysfs
   timeout > 0 : timer is activated and device is turned on
   timeout = 0 : timer is cancelled and device is off
3) unregister the timed output device if not used any more

So the registered device should be disabled explicitly when the module is removed.
('disabled' means the timer is stopped and the device is turned off)

Rather than implementing that code in each driver,
just call enable() with timeout = 0 to clean up the driver.

Signed-off-by: Milo(Woogyom) Kim <44ea671b8b7a8196e0a2fe07b01cac0858e18926@ti.com>
Cc: Mike Lockwood <368d0007e4626f70737d16df5e49ed8806b98c3f@android.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/android/timed_output.c
+++ drivers/staging/android/timed_output.c
@@ -99,6 +99,7 @@

 void timed_output_dev_unregister(struct timed_output_dev *tdev)
 {
+	tdev->enable(tdev, 0);
 	device_remove_file(tdev->dev, &dev_attr_enable);
 	device_destroy(timed_output_class, MKDEV(0, tdev->index));
 	dev_set_drvdata(tdev->dev, NULL);


Some cleanup and small changes:   - Use malloc() and free() instead of MALLOC() and FREE() macros.   - Do not check malloc results if M_WAITOK was used.   - Remove linked list of all netgraph sockets. It isn't needed.   - Use ng_findhook() instead of searching the list ourselves.   - Use NG_WAITOK in syscalls.   - Remove unneeded includes.   - style(9)


staging: comedi: das_08: remove the 8254 'logic2phys' usage

The three 8254 timers have a 1:1 relationship to the comedi
channels. The 'logic2phys' usage just makes the driver more
complex.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/das08.c
+++ drivers/staging/comedi/drivers/das08.c
@@ -448,7 +448,7 @@
 {
 	struct das08_private_struct *devpriv = dev->private;
 	struct i8254_struct *st = &devpriv->i8254;
-	int chan = st->logic2phys[insn->chanspec];
+	int chan = insn->chanspec;

 	data[0] = i8254_read(st->iobase, 0, chan);
 	return 1;
@@ -460,7 +460,7 @@
 {
 	struct das08_private_struct *devpriv = dev->private;
 	struct i8254_struct *st = &devpriv->i8254;
-	int chan = st->logic2phys[insn->chanspec];
+	int chan = insn->chanspec;

 	i8254_write(st->iobase, 0, chan, data[0]);
 	return 1;
@@ -472,7 +472,7 @@
 {
 	struct das08_private_struct *devpriv = dev->private;
 	struct i8254_struct *st = &devpriv->i8254;
-	int chan = st->logic2phys[insn->chanspec];
+	int chan = insn->chanspec;

 	if (insn->n != 2)
 		return -EINVAL;
@@ -848,9 +848,6 @@
 		s->insn_config = das08_counter_config;
 		/* Set-up the 8254 structure */
 		devpriv->i8254.channels = 3;
-		devpriv->i8254.logic2phys[0] = 0;
-		devpriv->i8254.logic2phys[1] = 1;
-		devpriv->i8254.logic2phys[2] = 2;
 		devpriv->i8254.iobase = iobase + thisboard->i8254_offset;
 		i8254_initialize(&devpriv->i8254);
 	} else {


Assert tcbinfo lock in tcp_attach(), as it is required; the caller
(tcp_usr_attach()) currently grabs it.

MFC after:	7 days


staging: comedi: das08: remove subdevice pointer math

Convert the comedi_subdevice access from pointer math to array
access.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/das08.c
+++ drivers/staging/comedi/drivers/das08.c
@@ -670,7 +670,7 @@
 	if (ret)
 		return ret;

-	s = dev->subdevices + 0;
+	s = &dev->subdevices[0];
 	/* ai */
 	if (thisboard->ai_nbits) {
 		s->type = COMEDI_SUBD_AI;
@@ -689,7 +689,7 @@
 		s->type = COMEDI_SUBD_UNUSED;
 	}

-	s = dev->subdevices + 1;
+	s = &dev->subdevices[1];
 	/* ao */
 	if (thisboard->ao_nbits) {
 		s->type = COMEDI_SUBD_AO;
@@ -704,7 +704,7 @@
 		s->type = COMEDI_SUBD_UNUSED;
 	}

-	s = dev->subdevices + 2;
+	s = &dev->subdevices[2];
 	/* di */
 	if (thisboard->di_nchan) {
 		s->type = COMEDI_SUBD_DI;
@@ -718,7 +718,7 @@
 		s->type = COMEDI_SUBD_UNUSED;
 	}

-	s = dev->subdevices + 3;
+	s = &dev->subdevices[3];
 	/* do */
 	if (thisboard->do_nchan) {
 		s->type = COMEDI_SUBD_DO;
@@ -732,7 +732,7 @@
 		s->type = COMEDI_SUBD_UNUSED;
 	}

-	s = dev->subdevices + 4;
+	s = &dev->subdevices[4];
 	/* 8255 */
 	if (thisboard->i8255_offset != 0) {
 		subdev_8255_init(dev, s, NULL, (unsigned long)(dev->iobase +
@@ -742,7 +742,7 @@
 		s->type = COMEDI_SUBD_UNUSED;
 	}

-	s = dev->subdevices + 5;
+	s = &dev->subdevices[5];
 	/* 8254 */
 	if (thisboard->i8254_offset != 0) {
 		s->type = COMEDI_SUBD_COUNTER;
@@ -838,7 +838,7 @@
 void das08_common_detach(struct comedi_device *dev)
 {
 	if (dev->subdevices)
-		subdev_8255_cleanup(dev, dev->subdevices + 4);
+		subdev_8255_cleanup(dev, &dev->subdevices[4]);
 }
 EXPORT_SYMBOL_GPL(das08_common_detach);


MFC r180836

MFC r180836

Increase UDBHASHSIZE from 16 to 128 items.
Previous value was chosen 10 years ago and not very effective now.
This change gives several percents speedup on 1000 L2TP mpd links.


staging: comedi: das16: cleanup printk message in board attach

Convert this printk message into a dev_err().

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Reviewed-by: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/das16.c
+++ drivers/staging/comedi/drivers/das16.c
@@ -1025,9 +1025,8 @@
 	if (it->options[3]) {
 		if (it->options[3] != 0 &&
 		    it->options[3] != 1 && it->options[3] != 10) {
-			printk
-			    ("\n Invalid option.  Master clock must be set "
-							"to 1 or 10 (MHz)\n");
+			dev_err(dev->class_dev,
+				"Invalid option. Master clock must be set to 1 or 10 (MHz)\n");
 			return -EINVAL;
 		}
 	}


Adjust the padding of struct pcpu to r193219.

Submitted by:	Eygene Ryabinkin


staging: comedi: mf6x4: use comedi_timeout()

Use comedi_timeout() to wait for the analog input end-of-conversion.

Signed-off-by: H Hartley Sweeten <382ff55d8e07d1082d179e669636cd1552da4f36@visionengravers.com>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/staging/comedi/drivers/mf6x4.c
+++ drivers/staging/comedi/drivers/mf6x4.c
@@ -133,21 +133,18 @@
 	return insn->n;
 }

-static int mf6x4_ai_wait_for_eoc(struct comedi_device *dev,
-				 unsigned int timeout)
-{
-	struct mf6x4_private *devpriv = dev->private;
-	unsigned int eolc;
-
-	while (timeout--) {
-		eolc = ioread32(devpriv->gpioc_R) & MF6X4_GPIOC_EOLC;
-		if (eolc)
-			return 0;
-
-		udelay(1);
-	}
-
-	return -ETIME;
+static int mf6x4_ai_eoc(struct comedi_device *dev,
+			struct comedi_subdevice *s,
+			struct comedi_insn *insn,
+			unsigned long context)
+{
+	struct mf6x4_private *devpriv = dev->private;
+	unsigned int status;
+
+	status = ioread32(devpriv->gpioc_R);
+	if (status & MF6X4_GPIOC_EOLC)
+		return 0;
+	return -EBUSY;
 }

 static int mf6x4_ai_insn_read(struct comedi_device *dev,
@@ -168,7 +165,7 @@
 		/* Trigger ADC conversion by reading ADSTART */
 		ioread16(devpriv->bar1_mem + MF6X4_ADSTART_R);

-		ret = mf6x4_ai_wait_for_eoc(dev, 100);
+		ret = comedi_timeout(dev, s, insn, mf6x4_ai_eoc, 0);
 		if (ret)
 			return ret;


v4l2object: always set the GstV4l2Error on error

Some of the error case were conditional to using try_fmt or not.
This is slightly unexpected, always set the error so the caller
can decide.

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

--- sys/v4l2/gstv4l2object.c
+++ sys/v4l2/gstv4l2object.c
@@ -3596,36 +3596,30 @@
   }
 invalid_dimensions:
   {
-    if (!try_only) {
-      GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
-          (_("Device '%s' cannot capture at %dx%d"),
-              v4l2object->videodev, width, height),
-          ("Tried to capture at %dx%d, but device returned size %dx%d",
-              width, height, format.fmt.pix.width, format.fmt.pix.height));
-    }
+    GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
+        (_("Device '%s' cannot capture at %dx%d"),
+            v4l2object->videodev, width, height),
+        ("Tried to capture at %dx%d, but device returned size %dx%d",
+            width, height, format.fmt.pix.width, format.fmt.pix.height));
     return FALSE;
   }
 invalid_pixelformat:
   {
-    if (!try_only) {
-      GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
-          (_("Device '%s' cannot capture in the specified format"),
-              v4l2object->videodev),
-          ("Tried to capture in %" GST_FOURCC_FORMAT
-              ", but device returned format" " %" GST_FOURCC_FORMAT,
-              GST_FOURCC_ARGS (pixelformat),
-              GST_FOURCC_ARGS (format.fmt.pix.pixelformat)));
-    }
+    GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
+        (_("Device '%s' cannot capture in the specified format"),
+            v4l2object->videodev),
+        ("Tried to capture in %" GST_FOURCC_FORMAT
+            ", but device returned format" " %" GST_FOURCC_FORMAT,
+            GST_FOURCC_ARGS (pixelformat),
+            GST_FOURCC_ARGS (format.fmt.pix.pixelformat)));
     return FALSE;
   }
 invalid_planes:
   {
-    if (!try_only) {
-      GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
-          (_("Device '%s' does support non-contiguous planes"),
-              v4l2object->videodev),
-          ("Device wants %d planes", format.fmt.pix_mp.num_planes));
-    }
+    GST_V4L2_ERROR (error, RESOURCE, SETTINGS,
+        (_("Device '%s' does support non-contiguous planes"),
+            v4l2object->videodev),
+        ("Device wants %d planes", format.fmt.pix_mp.num_planes));
     return FALSE;
   }
 invalid_field:


OMAP: DSS2: FEATURES: Remove DSI & SDI from OMAP2

OMAP2 doesn't support SDI or DSI. Remove them from
omap2_dss_supported_displays.

Signed-off-by: Tomi Valkeinen <e1ca4dbb8be1acaf20734fecd2da10ed1d46a9bb@ti.com>

--- drivers/video/omap2/dss/dss_features.c
+++ drivers/video/omap2/dss/dss_features.c
@@ -66,8 +66,7 @@

 static const enum omap_display_type omap2_dss_supported_displays[] = {
 	/* OMAP_DSS_CHANNEL_LCD */
-	OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI |
-	OMAP_DISPLAY_TYPE_SDI | OMAP_DISPLAY_TYPE_DSI,
+	OMAP_DISPLAY_TYPE_DPI | OMAP_DISPLAY_TYPE_DBI,

 	/* OMAP_DSS_CHANNEL_DIGIT */
 	OMAP_DISPLAY_TYPE_VENC,


v4l2: fix sRGB colorspace definition

v4l2: fix sRGB colorspace definition

V4l2 can also use the sRGB colorspace for YUV formats and thus needs a
default matrix.

--- sys/v4l2/gstv4l2object.c
+++ sys/v4l2/gstv4l2object.c
@@ -1904,13 +1904,7 @@
       cinfo->primaries = GST_VIDEO_COLOR_PRIMARIES_BT709;
       break;
     case V4L2_COLORSPACE_SRGB:
-      cinfo->range = GST_VIDEO_COLOR_RANGE_0_255;
-      cinfo->matrix = GST_VIDEO_COLOR_MATRIX_RGB;
-      cinfo->transfer = GST_VIDEO_TRANSFER_SRGB;
-      cinfo->primaries = GST_VIDEO_COLOR_PRIMARIES_BT709;
-      break;
     case V4L2_COLORSPACE_JPEG:
-      /* This is in fact sYCC */
       cinfo->range = GST_VIDEO_COLOR_RANGE_0_255;
       cinfo->matrix = GST_VIDEO_COLOR_MATRIX_BT601;
       cinfo->transfer = GST_VIDEO_TRANSFER_SRGB;


omxvideodec: Always free all pending frames when caps changes require reconfiguration

--- omx/gstomxvideodec.c
+++ omx/gstomxvideodec.c
@@ -1059,19 +1059,20 @@
       self->started = FALSE;
     }

+    /* FIXME: Workaround for
+     * https://bugzilla.gnome.org/show_bug.cgi?id=654529
+     */
+    g_list_foreach (GST_BASE_VIDEO_CODEC (self)->frames,
+        (GFunc) gst_base_video_codec_free_frame, NULL);
+    g_list_free (GST_BASE_VIDEO_CODEC (self)->frames);
+    GST_BASE_VIDEO_CODEC (self)->frames = NULL;
+
     if (klass->hacks & GST_OMX_HACK_NO_COMPONENT_RECONFIGURE) {
       GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self);
       gst_omx_video_dec_stop (GST_BASE_VIDEO_DECODER (self));
       gst_omx_video_dec_close (self);

       GST_BASE_VIDEO_CODEC_STREAM_LOCK (self);
-      /* FIXME: Workaround for
-       * https://bugzilla.gnome.org/show_bug.cgi?id=654529
-       */
-      g_list_foreach (GST_BASE_VIDEO_CODEC (self)->frames,
-          (GFunc) gst_base_video_codec_free_frame, NULL);
-      g_list_free (GST_BASE_VIDEO_CODEC (self)->frames);
-      GST_BASE_VIDEO_CODEC (self)->frames = NULL;

       if (!gst_omx_video_dec_open (self))
         return FALSE;
@@ -1080,6 +1081,7 @@
       if (gst_omx_port_manual_reconfigure (self->in_port,
               TRUE) != OMX_ErrorNone)
         return FALSE;
+
       if (gst_omx_port_set_enabled (self->in_port, FALSE) != OMX_ErrorNone)
         return FALSE;
     }


Rename a variable ContentAuthenticator to SignedInfo

--- ccnd/lib/ccn_buf_encoder.c
+++ ccnd/lib/ccn_buf_encoder.c
@@ -153,7 +153,7 @@
 int
 ccn_encode_ContentObject(struct ccn_charbuf *buf,
                          const struct ccn_charbuf *Name,
-                         const struct ccn_charbuf *ContentAuthenticator,
+                         const struct ccn_charbuf *SignedInfo,
                          const void *data,
                          size_t size,
                          const char *digest_algorithm,
@@ -176,7 +176,7 @@

     if (0 != ccn_sigc_init(sig_ctx, digest_algorithm)) return (-1);
     if (0 != ccn_sigc_update(sig_ctx, Name->buf, Name->length)) return (-1);
-    if (0 != ccn_sigc_update(sig_ctx, ContentAuthenticator->buf, ContentAuthenticator->length)) return (-1);
+    if (0 != ccn_sigc_update(sig_ctx, SignedInfo->buf, SignedInfo->length)) return (-1);
     if (0 != ccn_sigc_update(sig_ctx, content_header->buf, content_header->length - 1)) return (-1);
     if (0 != ccn_sigc_update(sig_ctx, data, size)) return (-1);
     if (0 != ccn_sigc_update(sig_ctx, content_header->buf + content_header->length - 1, 1)) return (-1);
@@ -192,7 +192,7 @@
     res |= ccn_charbuf_append_tt(buf, CCN_DTAG_ContentObject, CCN_DTAG);
     res |= ccn_encode_Signature(buf, digest_algorithm, NULL, 0, signature, signature_size);
     res |= ccn_charbuf_append_charbuf(buf, Name);
-    res |= ccn_charbuf_append_charbuf(buf, ContentAuthenticator);
+    res |= ccn_charbuf_append_charbuf(buf, SignedInfo);
     res |= ccn_encode_Content(buf, data, size);
     res |= ccn_charbuf_append_closer(buf);


de pee

de pee

--- dev/cardbus/if_rl_cardbus.c
+++ dev/cardbus/if_rl_cardbus.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: if_rl_cardbus.c,v 1.1 2002/06/08 00:10:54 aaron Exp $ */
+/*	$OpenBSD: if_rl_cardbus.c,v 1.2 2002/06/08 10:01:38 jason Exp $ */
 /*	$NetBSD: if_rl_cardbus.c,v 1.3.8.3 2001/11/14 19:14:02 nathanw Exp $	*/

 /*
@@ -117,18 +117,17 @@
 	int sc_intrline;
 };

-static int rl_cardbus_match	__P((struct device *, void *, void *));
-static void rl_cardbus_attach	__P((struct device *, struct device *, void *));
-static int rl_cardbus_detach	__P((struct device *, int));
-void rl_cardbus_setup		__P((struct rl_cardbus_softc *));
+static int rl_cardbus_match(struct device *, void *, void *);
+static void rl_cardbus_attach(struct device *, struct device *, void *);
+static int rl_cardbus_detach(struct device *, int);
+void rl_cardbus_setup(struct rl_cardbus_softc *);

 struct cfattach rl_cardbus_ca = {
 	sizeof(struct rl_cardbus_softc), rl_cardbus_match, rl_cardbus_attach,
 	    rl_cardbus_detach
 };

-const struct rl_type *rl_cardbus_lookup
-	__P((const struct cardbus_attach_args *));
+const struct rl_type *rl_cardbus_lookup (const struct cardbus_attach_args *);

 const struct rl_type *
 rl_cardbus_lookup(ca)


Fix crash passing an empty list to python openAuth() API

If passing a 'credtype' parameter which was an empty list
to the python openAuth() API, the 'credtype' field in
the virConnectAuth struct would not be initialized. This
lead to a crash when later trying to free that field.

Signed-off-by: Daniel P. Berrange <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>

--- python/libvirt-override.c
+++ python/libvirt-override.c
@@ -1820,6 +1820,7 @@
     PyObject *pycredtype;
     virConnectAuth auth;

+    memset(&auth, 0, sizeof(auth));
     if (!PyArg_ParseTuple(args, (char *)"zOi:virConnectOpenAuth", &name, &pyauth, &flags))
         return NULL;


Remove logging from example app + use define instead of magic number

--- examples/application_changes_example.c
+++ examples/application_changes_example.c
@@ -28,6 +28,8 @@
 #include "sysrepo.h"

 volatile int exit_application = 0;
+
+#define MAX_LEN 100

 static void
 print_value(sr_val_t *value)
@@ -127,7 +129,6 @@
     sr_val_t *values = NULL;
     size_t count = 0;
     int rc = SR_ERR_OK;
-    #define MAX_LEN 100
     char select_xpath[MAX_LEN];
     snprintf(select_xpath, MAX_LEN, "/%s:*//*", module_name);

@@ -150,7 +151,7 @@
     sr_change_oper_t oper;
     sr_val_t *old_value = NULL;
     sr_val_t *new_value = NULL;
-    char change_path[50] = {0,};
+    char change_path[MAX_LEN] = {0,};

     printf("\n\n ========== CONFIG HAS CHANGED, CURRENT RUNNING CONFIG: ==========\n\n");
@@ -160,7 +161,7 @@
     printf("\n\n ========== CHANGES: =============================================\n\n");

-    snprintf(change_path, 50, "/%s:*", module_name);
+    snprintf(change_path, MAX_LEN, "/%s:*", module_name);

     rc = sr_get_changes_iter(session, change_path , &it);
     if (SR_ERR_OK != rc) {
@@ -205,7 +206,6 @@
     }

     printf("Application will watch for changes in %s\n", module_name);
-    sr_log_stderr(SR_LL_DBG);
     /* connect to sysrepo */
     rc = sr_connect("example_application", SR_CONN_DEFAULT, &connection);
     if (SR_ERR_OK != rc) {


feat(test): Add test with multiple readers in one readergroup

--- tests/pubsub/check_pubsub_subscribe.c
+++ tests/pubsub/check_pubsub_subscribe.c
@@ -24,6 +24,7 @@
 #define PUBLISHER_DATA           42      /* Published data */
 #define PUBLISHVARIABLE_NODEID   1000    /* Published data nodeId */
 #define SUBSCRIBEVARIABLE_NODEID 1002    /* Subscribed data nodeId */
+#define SUBSCRIBEVARIABLE2_NODEID 1003   /* Subscribed data nodeId */
 #define READERGROUP_COUNT        2       /* Value to add readergroup to connection */
 #define CHECK_READERGROUP_COUNT  3       /* Value to check readergroup count */

@@ -1245,6 +1246,191 @@
         checkReceived();
 } END_TEST

+/* Have two readers listening for the same writer */
+START_TEST(MultiPublishSubscribeInt32) {
+    /* To check status after running both publisher and subscriber */
+    UA_StatusCode retVal = UA_STATUSCODE_GOOD;
+    UA_PublishedDataSetConfig pdsConfig;
+    UA_NodeId dataSetWriter;
+    UA_NodeId readerIdentifier;
+    UA_NodeId writerGroup;
+
+    /* Published DataSet */
+    memset(&pdsConfig, 0, sizeof(UA_PublishedDataSetConfig));
+    pdsConfig.publishedDataSetType = UA_PUBSUB_DATASET_PUBLISHEDITEMS;
+    pdsConfig.name = UA_STRING("PublishedDataSet Test");
+    UA_Server_addPublishedDataSet(server, &pdsConfig, &publishedDataSetId);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* Create variable to publish integer data */
+    UA_NodeId publisherNode;
+    UA_VariableAttributes attr = UA_VariableAttributes_default;
+    attr.description           = UA_LOCALIZEDTEXT("en-US","Published Int32");
+    attr.displayName           = UA_LOCALIZEDTEXT("en-US","Published Int32");
+    attr.dataType              = UA_TYPES[UA_TYPES_INT32].typeId;
+    UA_Int32 publisherData     = 42;
+    UA_Variant_setScalar(&attr.value, &publisherData, &UA_TYPES[UA_TYPES_INT32]);
+    retVal = UA_Server_addVariableNode(server, UA_NODEID_NUMERIC(1, PUBLISHVARIABLE_NODEID),
+                                       UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER),
+                                       UA_NODEID_NUMERIC(0, UA_NS0ID_ORGANIZES),
+                                       UA_QUALIFIEDNAME(1, "Published Int32"),
+                                       UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE),
+                                       attr, NULL, &publisherNode);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* Data Set Field */
+    UA_NodeId dataSetFieldIdent;
+    UA_DataSetFieldConfig dataSetFieldConfig;
+    memset(&dataSetFieldConfig, 0, sizeof(UA_DataSetFieldConfig));
+    dataSetFieldConfig.dataSetFieldType              = UA_PUBSUB_DATASETFIELD_VARIABLE;
+    dataSetFieldConfig.field.variable.fieldNameAlias = UA_STRING("Published Int32");
+    dataSetFieldConfig.field.variable.promotedField  = UA_FALSE;
+    dataSetFieldConfig.field.variable.publishParameters.publishedVariable = publisherNode;
+    dataSetFieldConfig.field.variable.publishParameters.attributeId       = UA_ATTRIBUTEID_VALUE;
+    UA_Server_addDataSetField (server, publishedDataSetId, &dataSetFieldConfig, &dataSetFieldIdent);
+
+    /* Writer group */
+    UA_WriterGroupConfig writerGroupConfig;
+    memset(&writerGroupConfig, 0, sizeof(writerGroupConfig));
+    writerGroupConfig.name               = UA_STRING("WriterGroup Test");
+    writerGroupConfig.publishingInterval = PUBLISH_INTERVAL;
+    writerGroupConfig.enabled            = UA_FALSE;
+    writerGroupConfig.writerGroupId      = WRITER_GROUP_ID;
+    writerGroupConfig.encodingMimeType   = UA_PUBSUB_ENCODING_UADP;
+    /* Message settings in WriterGroup to include necessary headers */
+    writerGroupConfig.messageSettings.encoding             = UA_EXTENSIONOBJECT_DECODED;
+    writerGroupConfig.messageSettings.content.decoded.type = &UA_TYPES[UA_TYPES_UADPWRITERGROUPMESSAGEDATATYPE];
+    UA_UadpWriterGroupMessageDataType *writerGroupMessage  = UA_UadpWriterGroupMessageDataType_new();
+    writerGroupMessage->networkMessageContentMask =
+        (UA_UadpNetworkMessageContentMask)UA_UADPNETWORKMESSAGECONTENTMASK_PUBLISHERID |
+        (UA_UadpNetworkMessageContentMask)UA_UADPNETWORKMESSAGECONTENTMASK_GROUPHEADER |
+        (UA_UadpNetworkMessageContentMask)UA_UADPNETWORKMESSAGECONTENTMASK_WRITERGROUPID |
+        (UA_UadpNetworkMessageContentMask)UA_UADPNETWORKMESSAGECONTENTMASK_PAYLOADHEADER;
+    writerGroupConfig.messageSettings.content.decoded.data = writerGroupMessage;
+    retVal |= UA_Server_addWriterGroup(server, connectionId, &writerGroupConfig, &writerGroup);
+    UA_Server_setWriterGroupOperational(server, writerGroup);
+    UA_UadpWriterGroupMessageDataType_delete(writerGroupMessage);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* DataSetWriter */
+    UA_DataSetWriterConfig dataSetWriterConfig;
+    memset(&dataSetWriterConfig, 0, sizeof(dataSetWriterConfig));
+    dataSetWriterConfig.name            = UA_STRING("DataSetWriter Test");
+    dataSetWriterConfig.dataSetWriterId = DATASET_WRITER_ID;
+    dataSetWriterConfig.keyFrameCount   = 10;
+    retVal |= UA_Server_addDataSetWriter(server, writerGroup, publishedDataSetId,
+                                         &dataSetWriterConfig, &dataSetWriter);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* Reader Group */
+    UA_ReaderGroupConfig readerGroupConfig;
+    memset (&readerGroupConfig, 0, sizeof (UA_ReaderGroupConfig));
+    readerGroupConfig.name = UA_STRING ("ReaderGroup Test");
+    retVal |=  UA_Server_addReaderGroup(server, connectionId, &readerGroupConfig, &readerGroupId);
+    UA_Server_setReaderGroupOperational(server, readerGroupId);
+
+    /* Data Set Reader */
+    /* Parameters to filter received NetworkMessage */
+    UA_DataSetReaderConfig readerConfig;
+    memset (&readerConfig, 0, sizeof (UA_DataSetReaderConfig));
+    readerConfig.name             = UA_STRING ("DataSetReader Test");
+    UA_UInt16 publisherIdentifier = PUBLISHER_ID;
+    readerConfig.publisherId.type = &UA_TYPES[UA_TYPES_UINT16];
+    readerConfig.publisherId.data = &publisherIdentifier;
+    readerConfig.writerGroupId    = WRITER_GROUP_ID;
+    readerConfig.dataSetWriterId  = DATASET_WRITER_ID;
+
+    /* Setting up Meta data configuration in DataSetReader */
+    UA_DataSetMetaDataType *pMetaData = &readerConfig.dataSetMetaData;
+    /* FilltestMetadata function in subscriber implementation */
+    UA_DataSetMetaDataType_init(pMetaData);
+    pMetaData->name = UA_STRING ("DataSet Test");
+    /* Static definition of number of fields size to 1 to create one
+       targetVariable */
+    pMetaData->fieldsSize = 1;
+    pMetaData->fields     = (UA_FieldMetaData*)
+        UA_Array_new(pMetaData->fieldsSize, &UA_TYPES[UA_TYPES_FIELDMETADATA]);
+    /* Unsigned Integer DataType */
+    UA_FieldMetaData_init (&pMetaData->fields[0]);
+    UA_NodeId_copy(&UA_TYPES[UA_TYPES_INT32].typeId, &pMetaData->fields[0].dataType);
+    pMetaData->fields[0].builtInType = UA_NS0ID_INT32;
+    pMetaData->fields[0].valueRank   = -1; /* scalar */
+    retVal |= UA_Server_addDataSetReader(server, readerGroupId, &readerConfig,
+                                         &readerIdentifier);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* Add Subscribed Variables */
+    /* Variable to subscribe data */
+    UA_NodeId newnodeId;
+    UA_VariableAttributes vAttr = UA_VariableAttributes_default;
+    vAttr.description = UA_LOCALIZEDTEXT ("en-US", "Subscribed Int32");
+    vAttr.displayName = UA_LOCALIZEDTEXT ("en-US", "Subscribed Int32");
+    vAttr.dataType    = UA_TYPES[UA_TYPES_INT32].typeId;
+    retVal = UA_Server_addVariableNode(server, UA_NODEID_NUMERIC(1, SUBSCRIBEVARIABLE_NODEID), folderId,
+                                       UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT),
+                                       UA_QUALIFIEDNAME(1, "Subscribed Int32"),
+                                       UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE),
+                                       vAttr, NULL, &newnodeId);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* For creating Targetvariable */
+    UA_FieldTargetVariable targetVar;
+    memset(&targetVar, 0, sizeof(UA_FieldTargetVariable));
+    targetVar.targetVariable.attributeId  = UA_ATTRIBUTEID_VALUE;
+    targetVar.targetVariable.targetNodeId = newnodeId;
+    retVal |= UA_Server_DataSetReader_createTargetVariables(server, readerIdentifier, 1, &targetVar);
+
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* Create a second reader for the same writer in the same readergroup */
+
+    UA_NodeId reader2Id;
+    retVal |= UA_Server_addDataSetReader(server, readerGroupId, &readerConfig, &reader2Id);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* Variable to subscribe data */
+    UA_NodeId newnodeId2;
+    retVal = UA_Server_addVariableNode(server, UA_NODEID_NUMERIC(1, SUBSCRIBEVARIABLE2_NODEID), folderId,
+                                       UA_NODEID_NUMERIC(0, UA_NS0ID_HASCOMPONENT),
+                                       UA_QUALIFIEDNAME(1, "Subscribed Int32 - 2"),
+                                       UA_NODEID_NUMERIC(0, UA_NS0ID_BASEDATAVARIABLETYPE),
+                                       vAttr, NULL, &newnodeId2);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* Create Targetvariable */
+    targetVar.targetVariable.targetNodeId = newnodeId2;
+    retVal |= UA_Server_DataSetReader_createTargetVariables(server, reader2Id, 1, &targetVar);
+
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+    UA_FieldTargetDataType_clear(&targetVar.targetVariable);
+
+    /* run server - publisher and subscriber */
+    UA_free(pMetaData->fields);
+    UA_Server_run_iterate(server, true);
+    UA_Server_run_iterate(server, true);
+
+    checkReceived();
+
+    /* Check the received value for the second reader */
+    UA_Variant publishedNodeData;
+    UA_Variant_init(&publishedNodeData);
+    retVal = UA_Server_readValue(server, UA_NODEID_NUMERIC(1, PUBLISHVARIABLE_NODEID),
+                                 &publishedNodeData);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* Read data received by the Subscriber */
+    UA_Variant subscribedNodeData;
+    UA_Variant_init(&subscribedNodeData);
+    retVal = UA_Server_readValue(server, newnodeId2, &subscribedNodeData);
+    ck_assert_int_eq(retVal, UA_STATUSCODE_GOOD);
+
+    /* Check if data sent from Publisher is being received by Subscriber */
+    ck_assert_int_eq(*(UA_UInt32 *)publishedNodeData.data,
+                     *(UA_UInt32 *)subscribedNodeData.data);
+    UA_Variant_clear(&subscribedNodeData);
+    UA_Variant_clear(&publishedNodeData);
+} END_TEST
+
 int main(void) {
     TCase *tc_add_pubsub_readergroup = tcase_create("PubSub readerGroup items handling");
     tcase_add_checked_fixture(tc_add_pubsub_readergroup, setup, teardown);
@@ -1282,6 +1468,9 @@
     tcase_add_test(tc_pubsub_publish_subscribe, SinglePublishSubscribeBool);
     tcase_add_test(tc_pubsub_publish_subscribe, SinglePublishSubscribewithValidIdentifiers);

+    /* Test cases with several readers */
+    tcase_add_test(tc_pubsub_publish_subscribe, MultiPublishSubscribeInt32);
+
     Suite *suite = suite_create("PubSub readerGroups/reader/Fields handling and publishing");
     suite_add_tcase(suite, tc_add_pubsub_readergroup);
     suite_add_tcase(suite, tc_pubsub_publish_subscribe);


* Add the basic header for sha256 so that we can do the integrity check in the nexus daemon.

--- builder/targets/FreeBSD/share/nsrc/nexusd/nexusd.c
+++ builder/targets/FreeBSD/share/nsrc/nexusd/nexusd.c
@@ -10,6 +10,8 @@
 #include <sys/mount.h>
 #include <sys/uio.h>
 #include <signal.h>
+#include <sha256.h>
+

 int setctty(const char *);
 int remount(const char *sourcepath, const char *destpath, int flags);
@@ -39,6 +41,7 @@
 		close(0);
 		close(1);
 		close(2);
+
 		remount(BINPATH, "/bin", MNT_NOATIME|MNT_RDONLY|MNT_UNION);
 		remount(LIBPATH, "/lib", MNT_NOATIME|MNT_RDONLY|MNT_UNION);
 		remount(LIBEXECPATH, "/libexec", MNT_NOATIME|MNT_RDONLY|MNT_UNION);


* open /dev/console earlier in the process.

--- builder/targets/FreeBSD/share/nsrc/nexusd/nexusd.c
+++ builder/targets/FreeBSD/share/nsrc/nexusd/nexusd.c
@@ -38,12 +38,18 @@
 	int ret;
 	ret = realmain();
 	/* How the hell did we get here? */
-	return 1;
+	return (ret);
 }

 int realmain() {
 	int ret;
 	if (getpid() == 1) {
+		close(0);
+		close(1);
+		close(2);
+
+		setctty("/dev/console");
+
 		ret = checkhash();
 		if (ret != 0) {
 			return (ret);
@@ -58,9 +64,6 @@
 			return 2;
 		}

-		close(0);
-		close(1);
-		close(2);

 		remount(BINPATH, "/bin", MNT_NOATIME|MNT_RDONLY|MNT_UNION);


Fix a stray stdint include for client vs2008 compatibility.

--- inc/osvr/Util/TimeValueC.h
+++ inc/osvr/Util/TimeValueC.h
@@ -28,12 +28,13 @@
 #include <osvr/Util/Export.h>
 #include <osvr/Util/AnnotationMacrosC.h>
 #include <osvr/Util/PlatformConfig.h>
+#include <osvr/Util/StdInt.h>

 /* Library/third-party includes */
 /* none */

 /* Standard includes */
-#include <stdint.h>
+/* none */

 #ifdef __cplusplus
 extern "C" {


移除无用宏定义

移除无用宏定义

--- include/LCUI/kernel/main.h
+++ include/LCUI/kernel/main.h
@@ -42,15 +42,6 @@
 #define __LCUI_KERNEL_MAIN_H__

 LCUI_BEGIN_HEADER
-
-/**************** 任务的添加模式 *******************/
-#define ADD_MODE_ADD_NEW	0 /* 新增 */
-#define ADD_MODE_NOT_REPEAT	1 /* 不能重复 */
-#define ADD_MODE_REPLACE	2 /* 覆盖 */
-
-#define AND_ARG_F	1<<3	/* 第一个参数 */
-#define AND_ARG_S 	1<<4	/* 第二个参数 */
-/***************************************************/

 typedef struct {
 	LCUI_ID id;			/**< 标识号 */


Fixed autopen Closure operator() returns.

--- include/Red/Util/Closure.h
+++ include/Red/Util/Closure.h
@@ -215,7 +215,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3 )
 			{

-				Call ( A2, A3 );
+				return Call ( A2, A3 );

 			};

@@ -260,7 +260,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3 )
 			{

-				Call ( A1, A3 );
+				return Call ( A1, A3 );

 			};

@@ -305,7 +305,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2 )
 			{

-				Call ( A1, A2 );
+				return Call ( A1, A2 );

 			};

@@ -352,7 +352,7 @@
 			inline Return operator() ( Arg3 A3 )
 			{

-				Call ( A3 );
+				return Call ( A3 );

 			};

@@ -400,7 +400,7 @@
 			inline Return operator() ( Arg2 A2 )
 			{

-				Call ( A2 );
+				return Call ( A2 );

 			};

@@ -448,7 +448,7 @@
 			inline Return operator() ( Arg1 A1 )
 			{

-				Call ( A1 );
+				return Call ( A1 );

 			};

@@ -498,7 +498,7 @@
 			inline Return operator() ()
 			{

-				Call ();
+				return Call ();

 			};

@@ -545,7 +545,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg4 A4 )
 			{

-				Call ( A2, A3, A4 );
+				return Call ( A2, A3, A4 );

 			};

@@ -590,7 +590,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg4 A4 )
 			{

-				Call ( A1, A3, A4 );
+				return Call ( A1, A3, A4 );

 			};

@@ -635,7 +635,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg4 A4 )
 			{

-				Call ( A1, A2, A4 );
+				return Call ( A1, A2, A4 );

 			};

@@ -680,7 +680,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3 )
 			{

-				Call ( A1, A2, A3 );
+				return Call ( A1, A2, A3 );

 			};

@@ -727,7 +727,7 @@
 			inline Return operator() ( Arg3 A3, Arg4 A4 )
 			{

-				Call ( A3, A4 );
+				return Call ( A3, A4 );

 			};

@@ -775,7 +775,7 @@
 			inline Return operator() ( Arg2 A2, Arg4 A4 )
 			{

-				Call ( A2, A4 );
+				return Call ( A2, A4 );

 			};

@@ -823,7 +823,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3 )
 			{

-				Call ( A2, A3 );
+				return Call ( A2, A3 );

 			};

@@ -871,7 +871,7 @@
 			inline Return operator() ( Arg1 A1, Arg4 A4 )
 			{

-				Call ( A1, A4 );
+				return Call ( A1, A4 );

 			};

@@ -919,7 +919,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3 )
 			{

-				Call ( A1, A3 );
+				return Call ( A1, A3 );

 			};

@@ -967,7 +967,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2 )
 			{

-				Call ( A1, A2 );
+				return Call ( A1, A2 );

 			};

@@ -1017,7 +1017,7 @@
 			inline Return operator() ( Arg4 A4 )
 			{

-				Call ( A4 );
+				return Call ( A4 );

 			};

@@ -1068,7 +1068,7 @@
 			inline Return operator() ( Arg3 A3 )
 			{

-				Call ( A3 );
+				return Call ( A3 );

 			};

@@ -1119,7 +1119,7 @@
 			inline Return operator() ( Arg2 A2 )
 			{

-				Call ( A2 );
+				return Call ( A2 );

 			};

@@ -1170,7 +1170,7 @@
 			inline Return operator() ( Arg1 A1 )
 			{

-				Call ( A1 );
+				return Call ( A1 );

 			};

@@ -1223,7 +1223,7 @@
 			inline Return operator() ()
 			{

-				Call ();
+				return Call ();

 			};

@@ -1271,7 +1271,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A2, A3, A4, A5 );
+				return Call ( A2, A3, A4, A5 );

 			};

@@ -1316,7 +1316,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A1, A3, A4, A5 );
+				return Call ( A1, A3, A4, A5 );

 			};

@@ -1361,7 +1361,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A1, A2, A4, A5 );
+				return Call ( A1, A2, A4, A5 );

 			};

@@ -1406,7 +1406,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3, Arg5 A5 )
 			{

-				Call ( A1, A2, A3, A5 );
+				return Call ( A1, A2, A3, A5 );

 			};

@@ -1451,7 +1451,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3, Arg4 A4 )
 			{

-				Call ( A1, A2, A3, A4 );
+				return Call ( A1, A2, A3, A4 );

 			};

@@ -1498,7 +1498,7 @@
 			inline Return operator() ( Arg3 A3, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A3, A4, A5 );
+				return Call ( A3, A4, A5 );

 			};

@@ -1546,7 +1546,7 @@
 			inline Return operator() ( Arg2 A2, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A2, A4, A5 );
+				return Call ( A2, A4, A5 );

 			};

@@ -1594,7 +1594,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg5 A5 )
 			{

-				Call ( A2, A3, A5 );
+				return Call ( A2, A3, A5 );

 			};

@@ -1642,7 +1642,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg4 A4 )
 			{

-				Call ( A2, A3, A4 );
+				return Call ( A2, A3, A4 );

 			};

@@ -1690,7 +1690,7 @@
 			inline Return operator() ( Arg1 A1, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A1, A4, A5 );
+				return Call ( A1, A4, A5 );

 			};

@@ -1738,7 +1738,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg5 A5 )
 			{

-				Call ( A1, A3, A5 );
+				return Call ( A1, A3, A5 );

 			};

@@ -1786,7 +1786,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg4 A4 )
 			{

-				Call ( A1, A3, A4 );
+				return Call ( A1, A3, A4 );

 			};

@@ -1834,7 +1834,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg5 A5 )
 			{

-				Call ( A1, A2, A5 );
+				return Call ( A1, A2, A5 );

 			};

@@ -1882,7 +1882,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg4 A4 )
 			{

-				Call ( A1, A2, A4 );
+				return Call ( A1, A2, A4 );

 			};

@@ -1930,7 +1930,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3 )
 			{

-				Call ( A1, A2, A3 );
+				return Call ( A1, A2, A3 );

 			};

@@ -1980,7 +1980,7 @@
 			inline Return operator() ( Arg4 A4, Arg5 A5 )
 			{

-				Call ( A4, A5 );
+				return Call ( A4, A5 );

 			};

@@ -2031,7 +2031,7 @@
 			inline Return operator() ( Arg3 A3, Arg5 A5 )
 			{

-				Call ( A3, A5 );
+				return Call ( A3, A5 );

 			};

@@ -2082,7 +2082,7 @@
 			inline Return operator() ( Arg3 A3, Arg4 A4 )
 			{

-				Call ( A3, A4 );
+				return Call ( A3, A4 );

 			};

@@ -2133,7 +2133,7 @@
 			inline Return operator() ( Arg2 A2, Arg5 A5 )
 			{

-				Call ( A2, A5 );
+				return Call ( A2, A5 );

 			};

@@ -2184,7 +2184,7 @@
 			inline Return operator() ( Arg2 A2, Arg4 A4 )
 			{

-				Call ( A2, A4 );
+				return Call ( A2, A4 );

 			};

@@ -2235,7 +2235,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3 )
 			{

-				Call ( A2, A3 );
+				return Call ( A2, A3 );

 			};

@@ -2286,7 +2286,7 @@
 			inline Return operator() ( Arg1 A1, Arg5 A5 )
 			{

-				Call ( A1, A5 );
+				return Call ( A1, A5 );

 			};

@@ -2337,7 +2337,7 @@
 			inline Return operator() ( Arg1 A1, Arg4 A4 )
 			{

-				Call ( A1, A4 );
+				return Call ( A1, A4 );

 			};

@@ -2388,7 +2388,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3 )
 			{

-				Call ( A1, A3 );
+				return Call ( A1, A3 );

 			};

@@ -2439,7 +2439,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2 )
 			{

-				Call ( A1, A2 );
+				return Call ( A1, A2 );

 			};

@@ -2492,7 +2492,7 @@
 			inline Return operator() ( Arg5 A5 )
 			{

-				Call ( A5 );
+				return Call ( A5 );

 			};

@@ -2546,7 +2546,7 @@
 			inline Return operator() ( Arg4 A4 )
 			{

-				Call ( A4 );
+				return Call ( A4 );

 			};

@@ -2600,7 +2600,7 @@
 			inline Return operator() ( Arg3 A3 )
 			{

-				Call ( A3 );
+				return Call ( A3 );

 			};

@@ -2654,7 +2654,7 @@
 			inline Return operator() ( Arg2 A2 )
 			{

-				Call ( A2 );
+				return Call ( A2 );

 			};

@@ -2708,7 +2708,7 @@
 			inline Return operator() ( Arg1 A1 )
 			{

-				Call ( A1 );
+				return Call ( A1 );

 			};

@@ -2764,7 +2764,7 @@
 			inline Return operator() ()
 			{

-				Call ();
+				return Call ();

 			};

@@ -2813,7 +2813,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg4 A4, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A2, A3, A4, A5, A6 );
+				return Call ( A2, A3, A4, A5, A6 );

 			};

@@ -2858,7 +2858,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg4 A4, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A1, A3, A4, A5, A6 );
+				return Call ( A1, A3, A4, A5, A6 );

 			};

@@ -2903,7 +2903,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg4 A4, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A1, A2, A4, A5, A6 );
+				return Call ( A1, A2, A4, A5, A6 );

 			};

@@ -2948,7 +2948,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A1, A2, A3, A5, A6 );
+				return Call ( A1, A2, A3, A5, A6 );

 			};

@@ -2993,7 +2993,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3, Arg4 A4, Arg6 A6 )
 			{

-				Call ( A1, A2, A3, A4, A6 );
+				return Call ( A1, A2, A3, A4, A6 );

 			};

@@ -3038,7 +3038,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A1, A2, A3, A4, A5 );
+				return Call ( A1, A2, A3, A4, A5 );

 			};

@@ -3085,7 +3085,7 @@
 			inline Return operator() ( Arg3 A3, Arg4 A4, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A3, A4, A5, A6 );
+				return Call ( A3, A4, A5, A6 );

 			};

@@ -3133,7 +3133,7 @@
 			inline Return operator() ( Arg2 A2, Arg4 A4, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A2, A4, A5, A6 );
+				return Call ( A2, A4, A5, A6 );

 			};

@@ -3181,7 +3181,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A2, A3, A5, A6 );
+				return Call ( A2, A3, A5, A6 );

 			};

@@ -3229,7 +3229,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg4 A4, Arg6 A6 )
 			{

-				Call ( A2, A3, A4, A6 );
+				return Call ( A2, A3, A4, A6 );

 			};

@@ -3277,7 +3277,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A2, A3, A4, A5 );
+				return Call ( A2, A3, A4, A5 );

 			};

@@ -3325,7 +3325,7 @@
 			inline Return operator() ( Arg1 A1, Arg4 A4, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A1, A4, A5, A6 );
+				return Call ( A1, A4, A5, A6 );

 			};

@@ -3373,7 +3373,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A1, A3, A5, A6 );
+				return Call ( A1, A3, A5, A6 );

 			};

@@ -3421,7 +3421,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg4 A4, Arg6 A6 )
 			{

-				Call ( A1, A3, A4, A6 );
+				return Call ( A1, A3, A4, A6 );

 			};

@@ -3469,7 +3469,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A1, A3, A4, A5 );
+				return Call ( A1, A3, A4, A5 );

 			};

@@ -3517,7 +3517,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A1, A2, A5, A6 );
+				return Call ( A1, A2, A5, A6 );

 			};

@@ -3565,7 +3565,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg4 A4, Arg6 A6 )
 			{

-				Call ( A1, A2, A4, A6 );
+				return Call ( A1, A2, A4, A6 );

 			};

@@ -3613,7 +3613,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A1, A2, A4, A5 );
+				return Call ( A1, A2, A4, A5 );

 			};

@@ -3661,7 +3661,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3, Arg6 A6 )
 			{

-				Call ( A1, A2, A3, A6 );
+				return Call ( A1, A2, A3, A6 );

 			};

@@ -3709,7 +3709,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3, Arg5 A5 )
 			{

-				Call ( A1, A2, A3, A5 );
+				return Call ( A1, A2, A3, A5 );

 			};

@@ -3757,7 +3757,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3, Arg4 A4 )
 			{

-				Call ( A1, A2, A3, A4 );
+				return Call ( A1, A2, A3, A4 );

 			};

@@ -3807,7 +3807,7 @@
 			inline Return operator() ( Arg4 A4, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A4, A5, A6 );
+				return Call ( A4, A5, A6 );

 			};

@@ -3858,7 +3858,7 @@
 			inline Return operator() ( Arg3 A3, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A3, A5, A6 );
+				return Call ( A3, A5, A6 );

 			};

@@ -3909,7 +3909,7 @@
 			inline Return operator() ( Arg3 A3, Arg4 A4, Arg6 A6 )
 			{

-				Call ( A3, A4, A6 );
+				return Call ( A3, A4, A6 );

 			};

@@ -3960,7 +3960,7 @@
 			inline Return operator() ( Arg3 A3, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A3, A4, A5 );
+				return Call ( A3, A4, A5 );

 			};

@@ -4011,7 +4011,7 @@
 			inline Return operator() ( Arg2 A2, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A2, A5, A6 );
+				return Call ( A2, A5, A6 );

 			};

@@ -4062,7 +4062,7 @@
 			inline Return operator() ( Arg2 A2, Arg4 A4, Arg6 A6 )
 			{

-				Call ( A2, A4, A6 );
+				return Call ( A2, A4, A6 );

 			};

@@ -4113,7 +4113,7 @@
 			inline Return operator() ( Arg2 A2, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A2, A4, A5 );
+				return Call ( A2, A4, A5 );

 			};

@@ -4164,7 +4164,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg6 A6 )
 			{

-				Call ( A2, A3, A6 );
+				return Call ( A2, A3, A6 );

 			};

@@ -4215,7 +4215,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg5 A5 )
 			{

-				Call ( A2, A3, A5 );
+				return Call ( A2, A3, A5 );

 			};

@@ -4266,7 +4266,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3, Arg4 A4 )
 			{

-				Call ( A2, A3, A4 );
+				return Call ( A2, A3, A4 );

 			};

@@ -4317,7 +4317,7 @@
 			inline Return operator() ( Arg1 A1, Arg5 A5, Arg6 A6 )
 			{

-				Call ( A1, A5, A6 );
+				return Call ( A1, A5, A6 );

 			};

@@ -4368,7 +4368,7 @@
 			inline Return operator() ( Arg1 A1, Arg4 A4, Arg6 A6 )
 			{

-				Call ( A1, A4, A6 );
+				return Call ( A1, A4, A6 );

 			};

@@ -4419,7 +4419,7 @@
 			inline Return operator() ( Arg1 A1, Arg4 A4, Arg5 A5 )
 			{

-				Call ( A1, A4, A5 );
+				return Call ( A1, A4, A5 );

 			};

@@ -4470,7 +4470,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg6 A6 )
 			{

-				Call ( A1, A3, A6 );
+				return Call ( A1, A3, A6 );

 			};

@@ -4521,7 +4521,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg5 A5 )
 			{

-				Call ( A1, A3, A5 );
+				return Call ( A1, A3, A5 );

 			};

@@ -4572,7 +4572,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3, Arg4 A4 )
 			{

-				Call ( A1, A3, A4 );
+				return Call ( A1, A3, A4 );

 			};

@@ -4623,7 +4623,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg6 A6 )
 			{

-				Call ( A1, A2, A6 );
+				return Call ( A1, A2, A6 );

 			};

@@ -4674,7 +4674,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg5 A5 )
 			{

-				Call ( A1, A2, A5 );
+				return Call ( A1, A2, A5 );

 			};

@@ -4725,7 +4725,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg4 A4 )
 			{

-				Call ( A1, A2, A4 );
+				return Call ( A1, A2, A4 );

 			};

@@ -4776,7 +4776,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2, Arg3 A3 )
 			{

-				Call ( A1, A2, A3 );
+				return Call ( A1, A2, A3 );

 			};

@@ -4829,7 +4829,7 @@
 			inline Return operator() ( Arg5 A5, Arg6 A6 )
 			{

-				Call ( A5, A6 );
+				return Call ( A5, A6 );

 			};

@@ -4883,7 +4883,7 @@
 			inline Return operator() ( Arg4 A4, Arg6 A6 )
 			{

-				Call ( A4, A6 );
+				return Call ( A4, A6 );

 			};

@@ -4937,7 +4937,7 @@
 			inline Return operator() ( Arg4 A4, Arg5 A5 )
 			{

-				Call ( A4, A5 );
+				return Call ( A4, A5 );

 			};

@@ -4991,7 +4991,7 @@
 			inline Return operator() ( Arg3 A3, Arg6 A6 )
 			{

-				Call ( A3, A6 );
+				return Call ( A3, A6 );

 			};

@@ -5045,7 +5045,7 @@
 			inline Return operator() ( Arg3 A3, Arg5 A5 )
 			{

-				Call ( A3, A5 );
+				return Call ( A3, A5 );

 			};

@@ -5099,7 +5099,7 @@
 			inline Return operator() ( Arg3 A3, Arg4 A4 )
 			{

-				Call ( A3, A4 );
+				return Call ( A3, A4 );

 			};

@@ -5153,7 +5153,7 @@
 			inline Return operator() ( Arg2 A2, Arg6 A6 )
 			{

-				Call ( A2, A6 );
+				return Call ( A2, A6 );

 			};

@@ -5207,7 +5207,7 @@
 			inline Return operator() ( Arg2 A2, Arg5 A5 )
 			{

-				Call ( A2, A5 );
+				return Call ( A2, A5 );

 			};

@@ -5261,7 +5261,7 @@
 			inline Return operator() ( Arg2 A2, Arg4 A4 )
 			{

-				Call ( A2, A4 );
+				return Call ( A2, A4 );

 			};

@@ -5315,7 +5315,7 @@
 			inline Return operator() ( Arg2 A2, Arg3 A3 )
 			{

-				Call ( A2, A3 );
+				return Call ( A2, A3 );

 			};

@@ -5369,7 +5369,7 @@
 			inline Return operator() ( Arg1 A1, Arg6 A6 )
 			{

-				Call ( A1, A6 );
+				return Call ( A1, A6 );

 			};

@@ -5423,7 +5423,7 @@
 			inline Return operator() ( Arg1 A1, Arg5 A5 )
 			{

-				Call ( A1, A5 );
+				return Call ( A1, A5 );

 			};

@@ -5477,7 +5477,7 @@
 			inline Return operator() ( Arg1 A1, Arg4 A4 )
 			{

-				Call ( A1, A4 );
+				return Call ( A1, A4 );

 			};

@@ -5531,7 +5531,7 @@
 			inline Return operator() ( Arg1 A1, Arg3 A3 )
 			{

-				Call ( A1, A3 );
+				return Call ( A1, A3 );

 			};

@@ -5585,7 +5585,7 @@
 			inline Return operator() ( Arg1 A1, Arg2 A2 )
 			{

-				Call ( A1, A2 );
+				return Call ( A1, A2 );

 			};

@@ -5641,7 +5641,7 @@
 			inline Return operator() ( Arg6 A6 )
 			{

-				Call ( A6 );
+				return Call ( A6 );

 			};

@@ -5698,7 +5698,7 @@
 			inline Return operator() ( Arg5 A5 )
 			{

-				Call ( A5 );
+				return Call ( A5 );

 			};

@@ -5755,7 +5755,7 @@
 			inline Return operator() ( Arg4 A4 )
 			{

-				Call ( A4 );
+				return Call ( A4 );

 			};

@@ -5812,7 +5812,7 @@
 			inline Return operator() ( Arg3 A3 )
 			{

-				Call ( A3 );
+				return Call ( A3 );

 			};

@@ -5869,7 +5869,7 @@
 			inline Return operator() ( Arg2 A2 )
 			{

-				Call ( A2 );
+				return Call ( A2 );

 			};

@@ -5926,7 +5926,7 @@
 			inline Return operator() ( Arg1 A1 )
 			{

-				Call ( A1 );
+				return Call ( A1 );

 			};

@@ -5985,7 +5985,7 @@
 			inline Return operator() ()
 			{

-				Call ();
+				return Call ();

 			};


Luncher: Add preview windows to the popup on exec if they are already visible.

--- src/modules/luncher/bar.c
+++ src/modules/luncher/bar.c
@@ -1298,15 +1298,21 @@
                {
                   if (!eina_list_data_find(ic->execs, ex))
                     ic->execs = eina_list_append(ic->execs, ex);
-                  evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW,
-                      _bar_exec_new_show, ic);
+                  if (evas_object_visible_get(ec->frame))
+                    _bar_exec_new_show(ic, NULL, NULL, NULL);
+                  else
+                    evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW,
+                        _bar_exec_new_show, ic);
                }
              else
                {
                   if (!eina_list_data_find(ic->clients, ec))
                     ic->clients = eina_list_append(ic->clients, ec);
-                  evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW,
-                      _bar_exec_new_show, ic);
+                  if (evas_object_visible_get(ec->frame))
+                    _bar_exec_new_show(ic, NULL, NULL, NULL);
+                  else
+                    evas_object_event_callback_add(ec->frame, EVAS_CALLBACK_SHOW,
+                        _bar_exec_new_show, ic);
                }
           }
         else


Correct order of parameters for Mat4

Correct order of parameters for Mat4

--- include/canvas/Math/Mat4.h
+++ include/canvas/Math/Mat4.h
@@ -13,8 +13,9 @@
   Mat4(const Vec4& col1, const Vec4& col2, const Vec4& col3, const Vec4& col4)
     : col{col1, col2, col3, col4} {}

-  Mat4(const Vec3& right, const Vec3& up, const Vec3& forward)
-    : col{{right, 0.0f}, {up, 0.0f}, {forward, 0.0f}, {0.0f, 0.0f, 0.0f, 1.0f}} {}
+  Mat4(const Vec3& forward, const Vec3& up, const Vec3& right,
+       const Vec3& position = {0.0f, 0.0f, 0.0f})
+    : col{{forward, 0.0f}, {up, 0.0f}, {right, 0.0f}, {position, 1.0f}} {}
 };

 Mat4 operator*(const Mat4& left, const Mat4& right);


Add more Unix platforms on which Skia for Chromium has been built,
this patch was tested on FreeBSD, Solaris, NetBSD, and DragonFly BSD.

http://codereview.chromium.org/8672011/

git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@2764 2bbb7eff-a529-9590-31e7-b0007b416f81

--- include/core/SkPreConfig.h
+++ include/core/SkPreConfig.h
@@ -30,7 +30,8 @@
         #define SK_BUILD_FOR_WIN32
     #elif defined(__SYMBIAN32__)
         #define SK_BUILD_FOR_WIN32
-    #elif defined(linux) || defined(__OpenBSD__)
+    #elif defined(linux) || defined(__FreeBSD__) || defined(__OpenBSD_) || \
+          defined(__sun) || defined(__NetBSD__) || defined(__DragonFly__)
         #define SK_BUILD_FOR_UNIX
     #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
         #define SK_BUILD_FOR_IOS


Refactored assert macros

Refactored assert macros

--- include/criterion/assert.h
+++ include/criterion/assert.h
@@ -53,45 +53,55 @@
             return;                                             \
     } while (0)

+// Common asserts
+
 # define assert(Condition, ...) assert_impl(FATAL, (Condition), ## __VA_ARGS__)
 # define expect(Condition, ...) assert_impl(NORMAL, (Condition), ## __VA_ARGS__)
+
+# define assert_not(Condition, ...) assert(!(Condition), ## __VA_ARGS__)
+# define expect_not(Condition, ...) expect(!(Condition), ## __VA_ARGS__)
+
+// Native asserts
+
+# define assert_equal(Actual, Expected, ...) \
+    assert((Actual) == (Expected), ## __VA_ARGS__)
+# define expect_equal(Actual, Expected, ...) \
+    expect((Actual) == (Expected), ## __VA_ARGS__)
+
+# define assert_not_equal(Actual, Expected, ...) \
+    assert((Actual) != (Expected), ## __VA_ARGS__)
+# define expectNotEqual(Actual, Expected, ...) \
+    expect((Actual) != (Expected), ## __VA_ARGS__)
+
+// Floating-point asserts
+
+# define assert_float_equal(Actual, Expected, Epsilon, ...) \
+    assert((Expected) - (Actual) < (Epsilon) && (Actual) - (Expected) < (Epsilon), ## __VA_ARGS__)
+# define expect_float_equal(Actual, Expected, Epsilon, ...) \
+    expect((Expected) - (Actual) < (Epsilon) && (Actual) - (Expected) < (Epsilon), ## __VA_ARGS__)
+
+// String asserts
+
+# define assert_strings_equal(Actual, Expected, ...) \
+    assert(!strcmp((Actual), (Expected)), ## __VA_ARGS__)
+# define expect_strings_equal(Actual, Expected, ...) \
+    expect(!strcmp((Actual), (Expected)), ## __VA_ARGS__)
+
+# define assert_strings_not_equal(Actual, Expected, ...) \
+    assert(strcmp((Actual), (Expected)), ## __VA_ARGS__)
+# define expect_strings_not_equal(Actual, Expected, ...) \
+    expect(strcmp((Actual), (Expected)), ## __VA_ARGS__)
+
+// Array asserts

 # define assert_arrays_equal(A, B, Size, ...) \
     assert(!memcmp((A), (B), (Size)), ## __VA_ARGS__)
 # define expect_arrays_equal(A, B, Size, ...) \
     expect(!memcmp((A), (B), (Size)), ## __VA_ARGS__)

-# define assert_equal(Actual, Expected, ...) \
-    assert((Actual) == (Expected), ## __VA_ARGS__)
-# define expect_equal(Actual, Expected, ...) \
-    expect((Actual) == (Expected), ## __VA_ARGS__)
-
-# define assert_float_equal(Actual, Expected, Epsilon, ...) \
-    assert((Expected) - (Actual) < (Epsilon) && (Actual) - (Expected) < (Epsilon), ## __VA_ARGS__)
-# define expect_float_equal(Actual, Expected, Epsilon, ...) \
-    expect((Expected) - (Actual) < (Epsilon) && (Actual) - (Expected) < (Epsilon), ## __VA_ARGS__)
-
-# define assert_strings_equal(Actual, Expected, ...) \
-    assert(!strcmp((Actual), (Expected)), ## __VA_ARGS__)
-# define expect_strings_equal(Actual, Expected, ...) \
-    expect(!strcmp((Actual), (Expected)), ## __VA_ARGS__)
-
-# define assert_not(Condition, ...) assert(!(Condition), ## __VA_ARGS__)
-# define expect_not(Condition, ...) expect(!(Condition), ## __VA_ARGS__)
-
-# define assert_not_equal(Actual, Expected, ...) \
-    assert((Actual) != (Expected), ## __VA_ARGS__)
-# define expectNotEqual(Actual, Expected, ...) \
-    expect((Actual) != (Expected), ## __VA_ARGS__)
-
 # define assert_arrays_not_equal(A, B, Size, ...) \
     assert(memcmp((A), (B), (Size)), ## __VA_ARGS__)
 # define expect_arrays_not_equal(A, B, Size, ...) \
     expect(memcmp((A), (B), (Size)), ## __VA_ARGS__)

-# define assert_strings_not_equal(Actual, Expected, ...) \
-    assert(strcmp((Actual), (Expected)), ## __VA_ARGS__)
-# define expect_strings_not_equal(Actual, Expected, ...) \
-    expect(strcmp((Actual), (Expected)), ## __VA_ARGS__)
-
 #endif /* !CRITERION_ASSERT_H_ */


Fixed missing whitespace.

Fixed missing whitespace.

--- include/fitz/base_pixmap.h
+++ include/fitz/base_pixmap.h
@@ -28,3 +28,4 @@
 fz_error *fz_newscaledpixmap(fz_pixmap **dstp, int w, int h, int n, int xdenom, int ydenom);
 fz_error *fz_scalepixmaptile(fz_pixmap *dstp, int xoffs, int yoffs,
 			     fz_pixmap *tile, int xdenom, int ydenom);
+


Revert "SWDEV-312141 - Renaming of enum to avoid shadow variable compilation warning (#2487)" (#2547)

This reverts commit c093f29d32d0a015def353453f8d00556ea30bf8.

--- include/hip/hip_bfloat16.h
+++ include/hip/hip_bfloat16.h
@@ -56,7 +56,7 @@

     enum truncate_t
     {
-        truncate_0
+        truncate
     };

     __host__ __device__ hip_bfloat16() = default;


mfd: palmas: Change regulator defns to better suite DT

In order to better fit DT parsing in of regulator definitions re-arrange
the platform data struct slightly which requires the definitions of
the regulator IDs earlier in the include file.

Signed-off-by: Graeme Gregory <f3226f91f77a87d909b8920adc91f9a301a7316b@slimlogic.co.uk>
Signed-off-by: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>

--- include/linux/mfd/palmas.h
+++ include/linux/mfd/palmas.h
@@ -130,16 +130,44 @@

 };

+enum palmas_regulators {
+	/* SMPS regulators */
+	PALMAS_REG_SMPS12,
+	PALMAS_REG_SMPS123,
+	PALMAS_REG_SMPS3,
+	PALMAS_REG_SMPS45,
+	PALMAS_REG_SMPS457,
+	PALMAS_REG_SMPS6,
+	PALMAS_REG_SMPS7,
+	PALMAS_REG_SMPS8,
+	PALMAS_REG_SMPS9,
+	PALMAS_REG_SMPS10,
+	/* LDO regulators */
+	PALMAS_REG_LDO1,
+	PALMAS_REG_LDO2,
+	PALMAS_REG_LDO3,
+	PALMAS_REG_LDO4,
+	PALMAS_REG_LDO5,
+	PALMAS_REG_LDO6,
+	PALMAS_REG_LDO7,
+	PALMAS_REG_LDO8,
+	PALMAS_REG_LDO9,
+	PALMAS_REG_LDOLN,
+	PALMAS_REG_LDOUSB,
+	/* Total number of regulators */
+	PALMAS_NUM_REGS,
+};
+
 struct palmas_pmic_platform_data {
 	/* An array of pointers to regulator init data indexed by regulator
 	 * ID
 	 */
-	struct regulator_init_data **reg_data;
+	struct regulator_init_data *reg_data[PALMAS_NUM_REGS];

 	/* An array of pointers to structures containing sleep mode and DVS
 	 * configuration for regulators indexed by ID
 	 */
-	struct palmas_reg_init **reg_init;
+	struct palmas_reg_init *reg_init[PALMAS_NUM_REGS];

 	/* use LDO6 for vibrator control */
 	int ldo6_vibrator;
@@ -291,34 +319,6 @@
 	PALMAS_NUM_IRQ,
 };

-enum palmas_regulators {
-	/* SMPS regulators */
-	PALMAS_REG_SMPS12,
-	PALMAS_REG_SMPS123,
-	PALMAS_REG_SMPS3,
-	PALMAS_REG_SMPS45,
-	PALMAS_REG_SMPS457,
-	PALMAS_REG_SMPS6,
-	PALMAS_REG_SMPS7,
-	PALMAS_REG_SMPS8,
-	PALMAS_REG_SMPS9,
-	PALMAS_REG_SMPS10,
-	/* LDO regulators */
-	PALMAS_REG_LDO1,
-	PALMAS_REG_LDO2,
-	PALMAS_REG_LDO3,
-	PALMAS_REG_LDO4,
-	PALMAS_REG_LDO5,
-	PALMAS_REG_LDO6,
-	PALMAS_REG_LDO7,
-	PALMAS_REG_LDO8,
-	PALMAS_REG_LDO9,
-	PALMAS_REG_LDOLN,
-	PALMAS_REG_LDOUSB,
-	/* Total number of regulators */
-	PALMAS_NUM_REGS,
-};
-
 struct palmas_pmic {
 	struct palmas *palmas;
 	struct device *dev;


remoteproc: remove unused resource type

remoteproc: remove unused resource type

RSC_VIRTIO_CFG isn't being used, so remove it.

Originally it was introduced to overcome a resource table limitation
that prevented describing a virtio device in a single resource table
entry.

The plan though is to describe resource table entries in a TLV fashion,
where each entry will consume the amount of space it requires,
so the original limitation is anyway temporary.

Reported-by: Stephen Boyd <010521127f513270fe503d86ab8316ac5147f4b7@codeaurora.org>
Signed-off-by: Ohad Ben-Cohen <f42ebdd520afb7505b40286b1d13fbb7281e5b96@wizery.com>

--- include/linux/remoteproc.h
+++ include/linux/remoteproc.h
@@ -122,7 +122,6 @@
 	RSC_TRACE	= 2,
 	RSC_VRING	= 3,
 	RSC_VIRTIO_DEV	= 4,
-	RSC_VIRTIO_CFG	= 5,
 };

 /**


IR: Fix GCC error from MDLocation::getInlinedAt()

Apparently GCC didn't like my ternary operator from r225824.  Use an
`if`.

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

--- include/llvm/IR/Metadata.h
+++ include/llvm/IR/Metadata.h
@@ -857,7 +857,9 @@
   unsigned getColumn() const { return SubclassData16; }
   Metadata *getScope() const { return getOperand(0); }
   Metadata *getInlinedAt() const {
-    return getNumOperands() == 2 ? getOperand(1) : nullptr;
+    if (getNumOperands() == 2)
+      return getOperand(1);
+    return nullptr;
   }

   static bool classof(const Metadata *MD) {


SuccIterator on bbs without terminator insts

Remove the assert that triggers if SuccIterator is constructed for a basic block
without a terminator instruction. Instead of triggering an assert a succ_end()
iterator is returned. This models a basic block with zero successors and allows
us to use F->viewCFG() on incompletely constructed functions.

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

--- include/llvm/Support/CFG.h
+++ include/llvm/Support/CFG.h
@@ -109,11 +109,18 @@
   // TODO: This can be random access iterator, only operator[] missing.

   explicit inline SuccIterator(Term_ T) : Term(T), idx(0) {// begin iterator
-    assert(T && "getTerminator returned null!");
   }
   inline SuccIterator(Term_ T, bool)                       // end iterator
-    : Term(T), idx(Term->getNumSuccessors()) {
-    assert(T && "getTerminator returned null!");
+    : Term(T) {
+    if (Term)
+      idx = Term->getNumSuccessors();
+    else
+      // Term == NULL happens, if a basic block is not fully constructed and
+      // consequently getTerminator() returns NULL. In this case we construct a
+      // SuccIterator which describes a basic block that has zero successors.
+      // Defining SuccIterator for incomplete and malformed CFGs is especially
+      // useful for debugging.
+      idx = 0;
   }

   inline const Self &operator=(const Self &I) {
@@ -201,6 +208,7 @@

   /// Get the source BB of this iterator.
   inline BB_ *getSource() {
+    assert(Term && "Source not available, if basic block was malformed");
     return Term->getParent();
   }
 };


A few more minor additions to ELF.h.

A few more minor additions to ELF.h.

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

--- include/llvm/Support/ELF.h
+++ include/llvm/Support/ELF.h
@@ -339,8 +339,17 @@
   STT_FUNC    = 2,   // Symbol is executable code (function, etc.)
   STT_SECTION = 3,   // Symbol refers to a section
   STT_FILE    = 4,   // Local, absolute symbol that refers to a file
+  STT_COMMON  = 5,   // An uninitialised common block
+  STT_TLS     = 6,   // Thread local data object
   STT_LOPROC  = 13,  // Lowest processor-specific symbol type
   STT_HIPROC  = 15   // Highest processor-specific symbol type
+};
+
+enum {
+  STV_DEFAULT   = 0,  // Visibility is specified by binding type
+  STV_INTERNAL  = 1,  // Defined by processor supplements
+  STV_HIDDEN    = 2,  // Not visible to other components
+  STV_PROTECTED = 3   // Visible in other components but not preemptable
 };

 // Relocation entry, without explicit addend.


--- AISResources.h
+++ AISResources.h
@@ -61,7 +61,7 @@
     /** Build an empty instance. */
     AISResources() {}

-    AISResources(const string &database);
+    AISResources(const string &database) throw(AISDatabaseReadFailed) ;

     void add_resource(const string &primary, const Resource &ancillary);
     void add_resource(const string &primary, const ResourceVector &rv);
@@ -87,6 +87,9 @@
 };

 // $Log: AISResources.h,v $
+// Revision 1.2  2003/02/20 22:19:02  jimg
+// Added throw() specification to second constructor.
+//
 // Revision 1.1  2003/02/20 22:10:21  jimg
 // Added.
 //


Tighten up checking on SymbolTable interface to make it illegal to pass a
Type* where a Value* is expected.

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

--- include/llvm/SymbolTable.h
+++ include/llvm/SymbolTable.h
@@ -165,8 +165,9 @@
   /// @brief Insert a constant or type.
   inline void insert(const std::string &Name, Value *Val) {
     assert(Val && "Can't insert null type into symbol table!");
-    assert((isa<Type>(Val) || isa<Constant>(Val)) &&
-           "Can only insert types and constants into a symbol table!");
+    assert(!isa<Type>(Val) && "Cannot insert types with this interface!");
+    assert(isa<Constant>(Val) &&
+           "Can only insert constants into a symbol table!");
     insertEntry(Name, Val->getType(), Val);
   }

@@ -201,6 +202,7 @@
   /// @brief Remove a constant or type from the symbol table.
   inline Value* remove(const std::string &Name, Value *Val) {
     assert(Val && "Can't remove null value from symbol table!");
+    assert(!isa<Type>(Val) && "Can't remove types with this interface!");
     plane_iterator PI = pmap.find(Val->getType());
     return removeEntry(PI, PI->second.find(Name));
   }


Update prototype of maskInterrupt to match implementations.

The prototype will ultimately be removed, but the mismatch is presently
breaking verification.

--- include/machine/hardware.h
+++ include/machine/hardware.h
@@ -29,5 +29,6 @@
 bool_t isIRQPending(void);

 /** MODIFIES: [*] */
-void maskInterrupt(bool_t enable, irq_t irq);
+void maskInterrupt(bool_t disable, irq_t irq);
+
 #endif


[media] v4l2: added missing mutex.h include to v4l2-ctrls.h

This patch fixes following error:
include/media/v4l2-ctrls.h:193:15: error: field ‘_lock’ has incomplete type
include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_lock’:
include/media/v4l2-ctrls.h:570:2: error: implicit declaration of
	function ‘mutex_lock’ [-Werror=implicit-function-declaration]
include/media/v4l2-ctrls.h: In function ‘v4l2_ctrl_unlock’:
include/media/v4l2-ctrls.h:579:2: error: implicit declaration of
	function ‘mutex_unlock’ [-Werror=implicit-function-declaration]

Signed-off-by: Andrzej Hajda <dcc2b772defa18622a340d324a717fd6b8ee2807@samsung.com>
Signed-off-by: Kyungmin Park <504c23c4986a3760712724894be3105092c27331@samsung.com>
Signed-off-by: Hans Verkuil <3a513708f73c27e7d36ebc496aa41dad6a3153ea@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <0cae1d1e981e84d16b82ca3d17be8a7f826608d3@samsung.com>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org

--- include/media/v4l2-ctrls.h
+++ include/media/v4l2-ctrls.h
@@ -22,6 +22,7 @@
 #define _V4L2_CTRLS_H

 #include <linux/list.h>
+#include <linux/mutex.h>
 #include <linux/videodev2.h>

 /* forward references */


mfreerdp-server: extended keyboard event support

--- server/Mac/mf_input.c
+++ server/Mac/mf_input.c
@@ -295,16 +295,69 @@

 	BOOL keyDown = TRUE;
 	CGEventRef kbEvent;
+	CGKeyCode kCode = 0xFF;

 	if (flags & KBD_FLAGS_RELEASE)
 	{
 		keyDown = FALSE;
 	}
-	kbEvent = CGEventCreateKeyboardEvent(source, keymap[code], keyDown);
+
+	if (flags & KBD_FLAGS_EXTENDED)
+	{
+		switch (code) {
+			//case 0x52: //insert
+			case 0x53:
+				kCode = kVK_ForwardDelete;
+				break;
+
+			case 0x4B:
+				kCode = kVK_LeftArrow;
+				break;
+
+			case 0x47:
+				kCode = kVK_Home;
+				break;
+
+			case 0x4F:
+				kCode = kVK_End;
+				break;
+
+			case 0x48:
+				kCode = kVK_UpArrow;
+				break;
+
+			case 0x50:
+				kCode = kVK_DownArrow;
+				break;
+
+			case 0x49:
+				kCode = kVK_PageUp;
+				break;
+
+			case 0x51:
+				kCode = kVK_PageDown;
+				break;
+
+			case 0x4D:
+				kCode = kVK_RightArrow;
+				break;
+
+			default:
+				break;
+		}
+	}
+	else
+	{
+		kCode = keymap[code];
+	}
+
+	kbEvent = CGEventCreateKeyboardEvent(source, kCode, keyDown);
 	CGEventPost(kCGSessionEventTap, kbEvent);
 	CFRelease(kbEvent);
 	CFRelease(source);

+	if (flags & KBD_FLAGS_EXTENDED)
+		printf("extended ");
 	printf("keypress: down = %d, SCAN=%#0X, VK=%#0X\n", keyDown, code, keymap[code]);
 	/*
 	 INPUT keyboard_event;
@@ -355,15 +408,6 @@

 	if (flags & PTR_FLAGS_WHEEL)
 	{
-		/*
-		 mouse_event.mi.dwFlags = MOUSEEVENTF_WHEEL;
-		 mouse_event.mi.mouseData = flags & WheelRotationMask;
-
-		 if (flags & PTR_FLAGS_WHEEL_NEGATIVE)
-		 mouse_event.mi.mouseData *= -1;
-
-		 SendInput(1, &mouse_event, sizeof(INPUT));
-		 */
 		scroll_y = flags & WheelRotationMask;

 		if (flags & PTR_FLAGS_WHEEL_NEGATIVE)
@@ -386,6 +430,34 @@
 		CFRelease(scroll);
 		CFRelease(source);
 	}
+	/*
+	 ///////////////////////////////////////////////
+	 // We dont support horizontal scrolling yet...
+	 ///////////////////////////////////////////////
+	else if (flags & PTR_FLAGS_)
+	{
+		scroll_y = flags & WheelRotationMask;
+
+		if (flags & PTR_FLAGS_WHEEL_NEGATIVE)
+		{
+			scroll_y = -(flags & WheelRotationMask) / 392;
+		}
+		else
+		{
+			scroll_y = (flags & WheelRotationMask) / 120;
+		}
+
+		CGEventSourceRef source = CGEventSourceCreate (kCGEventSourceStateCombinedSessionState);
+		CGEventRef scroll = CGEventCreateScrollWheelEvent(source,
+								  kCGScrollEventUnitLine,
+								  wheelCount,
+								  scroll_y,
+								  scroll_x);
+		CGEventPost(kCGHIDEventTap, scroll);
+
+		CFRelease(scroll);
+		CFRelease(source);
+	} */
 	else
 	{


Validate MODE SENSE 6 header

Validate MODE SENSE 6 header

Found with AFL

--- include/parse_mode_sense.h
+++ include/parse_mode_sense.h
@@ -73,6 +73,8 @@
 	{
 		return false;
 	}
+	if (mode_sense_6_data_len(data) < mode_sense_6_block_descriptor_length(data))
+		return false;
 	return true;
 }