[PATCH] m68knommu: 523x ColdFire processor init code

Low level initialization code for the 523x ColdFire processor family.

Signed-off-by: Greg Ungerer <ed22c22dbde360207569092e60b4298397efb8da@uclinux.com>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

error: pathspec 'arch/m68knommu/platform/523x/config.c' did not match any file(s) known to git

--- arch/m68knommu/platform/523x/config.c
+++ arch/m68knommu/platform/523x/config.c
@@ -0,0 +1,82 @@
+/***************************************************************************/
+
+/*
+ *	linux/arch/m68knommu/platform/523x/config.c
+ *
+ *	Sub-architcture dependant initialization code for the Freescale
+ *	523x CPUs.
+ *
+ *	Copyright (C) 1999-2005, Greg Ungerer (gerg@snapgear.com)
+ *	Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com)
+ */
+
+/***************************************************************************/
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/param.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <asm/dma.h>
+#include <asm/traps.h>
+#include <asm/machdep.h>
+#include <asm/coldfire.h>
+#include <asm/mcfsim.h>
+#include <asm/mcfdma.h>
+
+/***************************************************************************/
+
+void coldfire_pit_tick(void);
+void coldfire_pit_init(irqreturn_t (*handler)(int, void *, struct pt_regs *));
+unsigned long coldfire_pit_offset(void);
+void coldfire_trap_init(void);
+void coldfire_reset(void);
+
+/***************************************************************************/
+
+/*
+ *	DMA channel base address table.
+ */
+unsigned int   dma_base_addr[MAX_M68K_DMA_CHANNELS] = {
+        MCF_MBAR + MCFDMA_BASE0,
+};
+
+unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
+
+/***************************************************************************/
+
+void mcf_disableall(void)
+{
+	*((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff;
+	*((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL)) = 0xffffffff;
+}
+
+/***************************************************************************/
+
+void mcf_autovector(unsigned int vec)
+{
+	/* Everything is auto-vectored on the 5272 */
+}
+
+/***************************************************************************/
+
+void config_BSP(char *commandp, int size)
+{
+	mcf_disableall();
+
+#ifdef CONFIG_BOOTPARAM
+	strncpy(commandp, CONFIG_BOOTPARAM_STRING, size);
+	commandp[size-1] = 0;
+#else
+	memset(commandp, 0, size);
+#endif
+
+	mach_sched_init = coldfire_pit_init;
+	mach_tick = coldfire_pit_tick;
+	mach_gettimeoffset = coldfire_pit_offset;
+	mach_trap_init = coldfire_trap_init;
+	mach_reset = coldfire_reset;
+}
+
+/***************************************************************************/


mdbx-backport: force steady-sync when shrinking DB (fix corruption bug).

Change-Id: I636ee2ad04f28d4038d74bdf2c7061ab885f4b82

--- externals/libmdbx/src/mdbx.c
+++ externals/libmdbx/src/mdbx.c
@@ -4471,7 +4471,30 @@

   const size_t usedbytes = pgno_align2os_bytes(env, pending->mm_geo.next);
   if (env->me_sync_threshold && env->me_sync_pending >= env->me_sync_threshold)
-    flags &= MDBX_WRITEMAP | MDBX_SHRINK_ALLOWED;
+    flags &= MDBX_WRITEMAP | MDBX_SHRINK_ALLOWED; /* force steady */
+
+  /* LY: check conditions to shrink datafile */
+  const pgno_t backlog_gap =
+      pending->mm_dbs[FREE_DBI].md_depth + mdbx_backlog_extragap(env);
+  pgno_t shrink = 0;
+  if ((flags & MDBX_SHRINK_ALLOWED) && pending->mm_geo.shrink &&
+      pending->mm_geo.now - pending->mm_geo.next >
+          pending->mm_geo.shrink + backlog_gap) {
+    const pgno_t aligner =
+        pending->mm_geo.grow ? pending->mm_geo.grow : pending->mm_geo.shrink;
+    const pgno_t with_backlog_gap = pending->mm_geo.next + backlog_gap;
+    const pgno_t aligned = pgno_align2os_pgno(
+        env, with_backlog_gap + aligner - with_backlog_gap % aligner);
+    const pgno_t bottom =
+        (aligned > pending->mm_geo.lower) ? aligned : pending->mm_geo.lower;
+    if (pending->mm_geo.now > bottom) {
+      flags &= MDBX_WRITEMAP | MDBX_SHRINK_ALLOWED; /* force steady */
+      shrink = pending->mm_geo.now - bottom;
+      pending->mm_geo.now = bottom;
+      if (mdbx_meta_txnid_stable(env, head) == pending->mm_txnid_a)
+        mdbx_meta_set_txnid(env, pending, pending->mm_txnid_a + 1);
+    }
+  }

   /* LY: step#1 - sync previously written/updated data-pages */
   int rc = MDBX_RESULT_TRUE;
@@ -4495,28 +4518,6 @@
       if (unlikely(rc != MDBX_SUCCESS))
         goto fail;
       env->me_sync_pending = 0;
-    }
-  }
-
-  /* LY: check conditions to shrink datafile */
-  const pgno_t backlog_gap =
-      pending->mm_dbs[FREE_DBI].md_depth + mdbx_backlog_extragap(env);
-  pgno_t shrink = 0;
-  if ((flags & MDBX_SHRINK_ALLOWED) && pending->mm_geo.shrink &&
-      pending->mm_geo.now - pending->mm_geo.next >
-          pending->mm_geo.shrink + backlog_gap) {
-    const pgno_t aligner =
-        pending->mm_geo.grow ? pending->mm_geo.grow : pending->mm_geo.shrink;
-    const pgno_t with_backlog_gap = pending->mm_geo.next + backlog_gap;
-    const pgno_t aligned = pgno_align2os_pgno(
-        env, with_backlog_gap + aligner - with_backlog_gap % aligner);
-    const pgno_t bottom =
-        (aligned > pending->mm_geo.lower) ? aligned : pending->mm_geo.lower;
-    if (pending->mm_geo.now > bottom) {
-      shrink = pending->mm_geo.now - bottom;
-      pending->mm_geo.now = bottom;
-      if (mdbx_meta_txnid_stable(env, head) == pending->mm_txnid_a)
-        mdbx_meta_set_txnid(env, pending, pending->mm_txnid_a + 1);
     }
   }

@@ -7184,7 +7185,8 @@
 static int mdbx_cursor_touch(MDBX_cursor *mc) {
   int rc = MDBX_SUCCESS;

-  if (mc->mc_dbi >= CORE_DBS && !(*mc->mc_dbflag & (DB_DIRTY | DB_DUPDATA))) {
+  if (mc->mc_dbi >= CORE_DBS &&
+      (*mc->mc_dbflag & (DB_DIRTY | DB_DUPDATA)) == 0) {
     /* Touch DB record of named DB */
     MDBX_cursor mc2;
     MDBX_xcursor mcx;


powerpc/pmac/smp: Fix CPU hotplug crashes on some machines

On some machines that use i2c to synchronize the timebases (such
as PowerMac7,2/7,3 G5 machines), hotplug CPU would crash when
putting back a new CPU online due to the underlying i2c bus being
closed.

This uses the newly added bringup_done() callback to move the close
along with other housekeeping calls, and adds a CPU notifier to
re-open the i2c bus around subsequent hotplug operations

Signed-off-by: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>

--- arch/powerpc/platforms/powermac/smp.c
+++ arch/powerpc/platforms/powermac/smp.c
@@ -840,30 +840,68 @@

 	/* Setup openpic */
 	mpic_setup_this_cpu();
-
-	if (cpu_nr == 0) {
+}
+
+#ifdef CONFIG_HOTPLUG_CPU
+static int smp_core99_cpu_notify(struct notifier_block *self,
+				 unsigned long action, void *hcpu)
+{
+	int rc;
+
+	switch(action) {
+	case CPU_UP_PREPARE:
+	case CPU_UP_PREPARE_FROZEN:
+		/* Open i2c bus if it was used for tb sync */
+		if (pmac_tb_clock_chip_host) {
+			rc = pmac_i2c_open(pmac_tb_clock_chip_host, 1);
+			if (rc) {
+				pr_err("Failed to open i2c bus for time sync\n");
+				return notifier_from_errno(rc);
+			}
+		}
+		break;
+	case CPU_ONLINE:
+	case CPU_UP_CANCELED:
+		/* Close i2c bus if it was used for tb sync */
+		if (pmac_tb_clock_chip_host)
+			pmac_i2c_close(pmac_tb_clock_chip_host);
+		break;
+	default:
+		break;
+	}
+	return NOTIFY_OK;
+}
+
+static struct notifier_block __cpuinitdata smp_core99_cpu_nb = {
+	.notifier_call	= smp_core99_cpu_notify,
+};
+#endif /* CONFIG_HOTPLUG_CPU */
+
+static void __init smp_core99_bringup_done(void)
+{
 #ifdef CONFIG_PPC64
-		extern void g5_phy_disable_cpu1(void);
-
-		/* Close i2c bus if it was used for tb sync */
-		if (pmac_tb_clock_chip_host) {
-			pmac_i2c_close(pmac_tb_clock_chip_host);
-			pmac_tb_clock_chip_host	= NULL;
-		}
-
-		/* If we didn't start the second CPU, we must take
-		 * it off the bus
-		 */
-		if (of_machine_is_compatible("MacRISC4") &&
-		    num_online_cpus() < 2)
-			g5_phy_disable_cpu1();
+	extern void g5_phy_disable_cpu1(void);
+
+	/* Close i2c bus if it was used for tb sync */
+	if (pmac_tb_clock_chip_host)
+		pmac_i2c_close(pmac_tb_clock_chip_host);
+
+	/* If we didn't start the second CPU, we must take
+	 * it off the bus.
+	 */
+	if (of_machine_is_compatible("MacRISC4") &&
+	    num_online_cpus() < 2) {
+		set_cpu_present(1, false);
+		g5_phy_disable_cpu1();
+	}
 #endif /* CONFIG_PPC64 */

-		if (ppc_md.progress)
-			ppc_md.progress("core99_setup_cpu 0 done", 0x349);
-	}
-}
-
+#ifdef CONFIG_HOTPLUG_CPU
+	register_cpu_notifier(&smp_core99_cpu_nb);
+#endif
+	if (ppc_md.progress)
+		ppc_md.progress("smp_core99_bringup_done", 0x349);
+}

 #ifdef CONFIG_HOTPLUG_CPU

@@ -940,6 +978,7 @@
 struct smp_ops_t core99_smp_ops = {
 	.message_pass	= smp_mpic_message_pass,
 	.probe		= smp_core99_probe,
+	.bringup_done	= smp_core99_bringup_done,
 	.kick_cpu	= smp_core99_kick_cpu,
 	.setup_cpu	= smp_core99_setup_cpu,
 	.give_timebase	= smp_core99_give_timebase,


x86, cacheinfo: Base cache sharing info on CPUID 0x8000001d on AMD

The patch is based on a patch submitted by Hans Rosenfeld.
See http://marc.info/?l=linux-kernel&m=133908777200931

Note that  CPUID Fn8000_001D_EAX slightly differs to Intel's CPUID function 4.

Bits 14-25 contain NumSharingCache. Actual number of cores sharing
           this cache. SW to add value of one to get result.

The corresponding bits on Intel are defined as "maximum number of threads
sharing this cache" (with a "plus 1" encoding).

Thus a different method to determine which cores are sharing a cache
level has to be used.

Signed-off-by: Andreas Herrmann <39e536ca8269572d74bff7f8e46f22412f1aee88@amd.com>
Link: 545e2a20fd0ad45a7c764b51547e6741b883ac24@alberich
Signed-off-by: H. Peter Anvin <8a453bad9912ffe59bc0f0b8abe03df9be19379e@linux.intel.com>

--- arch/x86/kernel/cpu/intel_cacheinfo.c
+++ arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -750,12 +750,36 @@
 static int __cpuinit cache_shared_amd_cpu_map_setup(unsigned int cpu, int index)
 {
 	struct _cpuid4_info *this_leaf;
-	int ret, i, sibling;
-	struct cpuinfo_x86 *c = &cpu_data(cpu);
-
-	ret = 0;
-	if (index == 3) {
-		ret = 1;
+	int i, sibling;
+
+	if (cpu_has_topoext) {
+		unsigned int apicid, nshared, first, last;
+
+		if (!per_cpu(ici_cpuid4_info, cpu))
+			return 0;
+
+		this_leaf = CPUID4_INFO_IDX(cpu, index);
+		nshared = this_leaf->base.eax.split.num_threads_sharing + 1;
+		apicid = cpu_data(cpu).apicid;
+		first = apicid - (apicid % nshared);
+		last = first + nshared - 1;
+
+		for_each_online_cpu(i) {
+			apicid = cpu_data(i).apicid;
+			if ((apicid < first) || (apicid > last))
+				continue;
+			if (!per_cpu(ici_cpuid4_info, i))
+				continue;
+			this_leaf = CPUID4_INFO_IDX(i, index);
+
+			for_each_online_cpu(sibling) {
+				apicid = cpu_data(sibling).apicid;
+				if ((apicid < first) || (apicid > last))
+					continue;
+				set_bit(sibling, this_leaf->shared_cpu_map);
+			}
+		}
+	} else if (index == 3) {
 		for_each_cpu(i, cpu_llc_shared_mask(cpu)) {
 			if (!per_cpu(ici_cpuid4_info, i))
 				continue;
@@ -766,21 +790,10 @@
 				set_bit(sibling, this_leaf->shared_cpu_map);
 			}
 		}
-	} else if ((c->x86 == 0x15) && ((index == 1) || (index == 2))) {
-		ret = 1;
-		for_each_cpu(i, cpu_sibling_mask(cpu)) {
-			if (!per_cpu(ici_cpuid4_info, i))
-				continue;
-			this_leaf = CPUID4_INFO_IDX(i, index);
-			for_each_cpu(sibling, cpu_sibling_mask(cpu)) {
-				if (!cpu_online(sibling))
-					continue;
-				set_bit(sibling, this_leaf->shared_cpu_map);
-			}
-		}
-	}
-
-	return ret;
+	} else
+		return 0;
+
+	return 1;
 }

 static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)


A few more comments.

A few more comments.

--- OptionalScopedObject.h
+++ OptionalScopedObject.h
@@ -1,13 +1,16 @@
 #pragma once

+// Class wrapper to provide an optional scoped object on the stack without any dynamic allocations.
 template<typename ScopedObject>
 class OptionalScopedObject
 {
 public:
+	// Creates a new inactive object. The underlying ScopedObject type is not initialized!
 	OptionalScopedObject() : m_active(false)
 	{
 	}

+	// If the underlying ScopedObject was created via construct, it will be deconstructed.
 	~OptionalScopedObject()
 	{
 		destruct();
@@ -16,14 +19,19 @@
 	OptionalScopedObject(OptionalScopedObject&) = delete;
 	void operator = (OptionalScopedObject&) = delete;

+	// Constructs the object. Will destruct the object first if there was already one.
 	template<typename... Args>
 	void construct(Args... args)
 	{
-		destruct();
+		if (m_active)
+		{
+			(*this)->~ScopedObject();
+		}
 		new (m_memory) ScopedObject(args...);
 		m_active = true;
 	}

+	// Destructs the underlying object if one has been previously constructed.
 	void destruct()
 	{
 		if (m_active)
@@ -52,7 +60,7 @@
 		return *reinterpret_cast<ScopedObject*>(m_memory);
 	}

-	// Weather the underlyting object is constructed or not.
+	// Weather the underlying object is constructed or not.
 	operator bool() const
 	{
 		return m_active;


tracing: ctf: fix arguments to ctf_top_thread_info

Arguments in sys_trace_thread_info were reversed.
The order should be base then size.

Signed-off-by: Nicholas Lowell <78486efcf866b347534ad8bb2c5fbf2e8d21f397@lexmark.com>

--- subsys/debug/tracing/ctf/ctf_top.c
+++ subsys/debug/tracing/ctf/ctf_top.c
@@ -89,8 +89,8 @@
 #if defined(CONFIG_THREAD_STACK_INFO)
 	ctf_top_thread_info(
 		(u32_t)(uintptr_t)thread,
-		thread->stack_info.size,
-		thread->stack_info.start
+		thread->stack_info.start,
+		thread->stack_info.size
 		);
 #endif
 }


Adding working lib

Adding working lib

--- tlc5940.c
+++ tlc5940.c
@@ -87,27 +87,24 @@
 unsigned char xlatNeedsPulse = 0;
 void interrupt high_isr(void) {
     unsigned char firstCycleFlag = 0;
-    unsigned char Data_Counter = 0;
     __TLC_BLANK = 1;
     if (__TLC_VPRG == 1) {
         __TLC_VPRG = 0;
         firstCycleFlag = 1;
     }
+    if (firstCycleFlag) {
+        TLC5940_PulseSCLK();
+        firstCycleFlag = 0;
+    }
     if (xlatNeedsPulse == 1) {
         TLC5940_PulseXLAT();
         xlatNeedsPulse = 0;
     }
-    if (firstCycleFlag) {
-        TLC5940_PulseSCLK();
-        firstCycleFlag = 0;
+    __TLC_BLANK = 0;
+    for (int i = 0; i < __TLC_DATA_COUNTER_MAX; i++) {
+        SPI_Write(gsData[i]);
     }
-    __TLC_BLANK = 0;
-    for (;;) {
-        for (int i = 0; i < __TLC_DATA_COUNTER_MAX; i++) {
-            SPI_Write(gsData[i]);
-        }
-        xlatNeedsPulse = 1;
-    }
+    xlatNeedsPulse = 1;
     // Clear interrupt flag so TMR0 can interrupt again
     TMR0IF = 0;
 }


Increase number of channels that can be supported on Android

BUG=
TEST=local
Review URL: https://webrtc-codereview.appspot.com/967005

Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: d5fbdc8e52baaae865949f35a9af6f3478947b7a

--- voice_engine/voice_engine_defines.h
+++ voice_engine/voice_engine_defines.h
@@ -375,9 +375,9 @@
 namespace webrtc
 {
   // Max number of supported channels
-  enum { kVoiceEngineMaxNumOfChannels = 2 };
+  enum { kVoiceEngineMaxNumOfChannels = 32 };
   // Max number of channels which can be played out simultaneously
-  enum { kVoiceEngineMaxNumOfActiveChannels = 2 };
+  enum { kVoiceEngineMaxNumOfActiveChannels = 16 };
 } // namespace webrtc

 // ----------------------------------------------------------------------------


Add support to convert gfx::Rect and gfx::Size to v8 value.

--- common/v8/native_type_conversions.h
+++ common/v8/native_type_conversions.h
@@ -20,6 +20,7 @@
 #include "content/public/renderer/v8_value_converter.h"
 #include "ui/gfx/point.h"
 #include "ui/gfx/rect.h"
+#include "ui/gfx/size.h"
 #include "url/gurl.h"

 // Convert V8 value to arbitrary supported types.
@@ -122,6 +123,14 @@
   return v8::Boolean::New(b);
 }

+inline v8::Handle<v8::Value> ToV8Value(float f) {
+  return v8::Number::New(f);
+}
+
+inline v8::Handle<v8::Value> ToV8Value(double f) {
+  return v8::Number::New(f);
+}
+
 inline v8::Handle<v8::Value> ToV8Value(const char* s) {
   return v8::String::New(s);
 }
@@ -159,6 +168,22 @@
   v8::Handle<v8::Object> obj = v8::Object::New();
   obj->Set(ToV8Value("x"), ToV8Value(point.x()));
   obj->Set(ToV8Value("y"), ToV8Value(point.y()));
+  return obj;
+}
+
+inline v8::Handle<v8::Value> ToV8Value(const gfx::Rect& rect) {
+  v8::Handle<v8::Object> obj = v8::Object::New();
+  obj->Set(ToV8Value("x"), ToV8Value(rect.x()));
+  obj->Set(ToV8Value("y"), ToV8Value(rect.y()));
+  obj->Set(ToV8Value("width"), ToV8Value(rect.width()));
+  obj->Set(ToV8Value("height"), ToV8Value(rect.height()));
+  return obj;
+}
+
+inline v8::Handle<v8::Value> ToV8Value(const gfx::Size& size) {
+  v8::Handle<v8::Object> obj = v8::Object::New();
+  obj->Set(ToV8Value("width"), ToV8Value(size.width()));
+  obj->Set(ToV8Value("height"), ToV8Value(size.height()));
   return obj;
 }


Fix layout options used by external elm_slideshow

SVN revision: 52099

--- src/edje_externals/elm_slideshow.c
+++ src/edje_externals/elm_slideshow.c
@@ -172,7 +172,7 @@
    EDJE_EXTERNAL_PARAM_INFO_INT("timeout"),
    EDJE_EXTERNAL_PARAM_INFO_BOOL("loop"),
    EDJE_EXTERNAL_PARAM_INFO_CHOICE_FULL("transition", "fade", transitions),
-   EDJE_EXTERNAL_PARAM_INFO_CHOICE_FULL("layout", "fullscreen", transitions),
+   EDJE_EXTERNAL_PARAM_INFO_CHOICE_FULL("layout", "fullscreen", layout),
    EDJE_EXTERNAL_PARAM_INFO_SENTINEL
 };


Change title and message property modifiers to copy

--- SDCAlertView/Source/SDCAlertView.h
+++ SDCAlertView/Source/SDCAlertView.h
@@ -53,8 +53,8 @@

 @interface SDCAlertView : UIView

-@property (nonatomic, strong) NSString *title;
-@property (nonatomic, strong) NSString *message;
+@property (nonatomic, copy) NSString *title;
+@property (nonatomic, copy) NSString *message;

 @property (nonatomic) NSInteger cancelButtonIndex;
 @property (nonatomic, readonly) NSInteger firstOtherButtonIndex;


Move fibers out of experimental

Move fibers out of experimental

Summary: folly::fibers have been used by mcrouter for more than 2 years, so not really experimental.

Reviewed By: pavlo-fb

Differential Revision: D3320595

fbshipit-source-id: 68188f92b71a4206d57222993848521ca5437ef5

--- wangle/concurrent/FiberIOExecutor.h
+++ wangle/concurrent/FiberIOExecutor.h
@@ -10,7 +10,7 @@

 #pragma once

-#include <folly/experimental/fibers/FiberManagerMap.h>
+#include <folly/fibers/FiberManagerMap.h>
 #include <wangle/concurrent/IOExecutor.h>

 namespace wangle {


Close opened SDP, add doc for implemented funcs

Signed-off-by: Jiri Pinkava <ceb72a6f0e3f077f8f7e99199f4b556b3392348f@vscht.cz>

--- SDP-2xxx/src/sdp2xxx.c
+++ SDP-2xxx/src/sdp2xxx.c
@@ -31,6 +31,12 @@
 #include <termios.h>
 #include <sys/select.h>

+/**
+ * Open serial port and set parameters as defined for SDP power source
+ *
+ * fname:       file name of serial port
+ * returns:     file descriptor on success, -1 on error
+ */
 static int open_serial(const char* fname)
 {
         int fd;
@@ -55,6 +61,24 @@
         return fd;
 }

+/**
+ * Close opened serial port, if f == -1 do nothigh
+ *
+ * f:           file descriptor
+ */
+void close_serial(int f)
+{
+        if (f != -1)
+                close(f);
+}
+
+/**
+ * Reads data from serial port
+ *
+ * fd:          file descriptor
+ * buf:         buffer to store readed data
+ * count:       number of bytes to read
+ */
 static ssize_t sdp_read(int fd, char *buf, ssize_t count)
 {
         ssize_t size = 0;
@@ -89,6 +113,13 @@
         return size;
 }

+/**
+ * Write data into serial port
+ *
+ * fd:          file descriptor
+ * buf:         buffer with data to write
+ * count:       number of bytes to write
+ */
 static ssize_t sdp_write(int fd, char *buf, ssize_t count)
 {
         return write(fd, buf, count);
@@ -96,6 +127,12 @@
 #endif

 #ifdef _WIN32
+/**
+ * Open serial port and set parameters as defined for SDP power source
+ *
+ * fname:       file name of serial port
+ * returns:     file descriptor on success, -1 on error
+ */
 static HANDLE open_serial(const char* fname)
 {
         HANDLE h;
@@ -152,104 +189,212 @@
         return h;
 }

-static sdp_resp_t sdp_read(HANDLE h, char *buf, ssize_t count)
+/**
+ * Close opened serial port, if f == INVALID_HANDLE_VALUE do nothigh
+ *
+ * f:           file handle
+ */
+void close_serial(HANDLE f)
+{
+        if (h != INVALID_HANDLE_VALUE)
+                CloseHandle(f);
+}
+
+/**
+ * Read data from serial port
+ *
+ * h:           file handle
+ * buf:         buffer to store readed data
+ * count:       number of bytes to read
+ * returns:     number of bytes read
+ */
+static ssize_t sdp_read(HANDLE h, char *buf, ssize_t count)
 {
         DWORD readb;

-        if (!ReadFile(h, buf, 1, &readb, NULL)) {
-                // error
-        }
-        // TODO
-        return -1;
-}
-
+        if (!ReadFile(h, buf, count, &readb, NULL))
+                return -1;
+
+        return readb;
+}
+
+/**
+ * Write data into serial port
+ *
+ * h:           file handle
+ * buf:         buffer with data to send
+ * count:       number of bytes to send
+ * returns:     number of bytes succesfully writen
+ */
 static ssize_t sdp_write(HANDLE h, char *buf, ssize_t count)
 {
         DWORD writeb;
-        // TODO
+
         if (!WriteFile(h, buf, count, &writeb, NULL))
             return -1;
-        return count;
+
+        return writeb;
 }
 #endif

+/**
+ * Open serial port to comunicate with SDP power supply
+ *
+ * sdp:         sdp_t where to store informations about opened SDP PS
+ * fname:       name of serial port to open
+ * addr:        rs485 address of device, for rs232 is ignored - use anny valid
+ */
 int sdp_open(sdp_t *sdp, const char *fname, int addr)
 {
         SDP_F f;
+
+        if (addr < SDP_DEV_ADDR_MIN || addr > SDP_DEV_ADDR_MAX)
+                return -1;

         f = open_serial(fname);
         if (f == SDP_F_ERR)
                 return -1;

-        return -1;
-}
-
+        sdp->f_in = sdp->f_out = f;
+        sdp->addr = addr;
+
+        return 0;
+}
+
+/**
+ * Initialize sdp usign existing opened file
+ *
+ * sdp:         sdp_t where to store informations about opened SDP PS
+ * f:           file descriptor or handle, depend on OS
+ * addr:        rs485 address of device, for rs232 is ignored - use anny valid
+ */
 int sdp_openf(sdp_t *sdp, SDP_F f, int addr)
 {
-        return -1;
-}
-
+        if (addr < SDP_DEV_ADDR_MIN || addr > SDP_DEV_ADDR_MAX)
+                return -1;
+
+        sdp->f_in = sdp->f_out = f;
+        sdp->addr = addr;
+
+        return 0;
+}
+
+/**
+ * Close SDP and all asociated ports
+ *
+ * sdp:         sdp_t structure
+ */
 void sdp_close(sdp_t *sdp)
 {
-        return;
-}
-
-
+        close_serial(sdp->f_in);
+        if (sdp->f_in != sdp->f_out)
+                close_serial(sdp->f_out);
+}
+
+
+/**
+ *
+ * returns:
+ */
 int sdp_get_dev_addr(const sdp_t *sdp)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_get_va_maximums(const sdp_t *sdp, sdp_va_t *va_maximums)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_get_volt_limit(const sdp_t *sdp)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_get_va_data(const sdp_t *sdp, sdp_va_data_t *va_data)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_get_va_setpoint(const sdp_t *sdp, sdp_va_t *va_setpoints)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_get_preset(const sdp_t *sdp, int presn, sdp_va_t *va_preset)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_get_program(const sdp_t *sdp, int progn, sdp_program_t *program)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_get_ldc_info(const sdp_t *sdp, sdp_ldc_info_t *lcd_info)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_remote(const sdp_t *sdp, int enable)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_run_preset(const sdp_t *sdp, int preset)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_run_program(const sdp_t *sdp, int count)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 // TODO
 int sdp_select_ifce(const sdp_t *sdp, sdp_ifce_t ifce)
 {
@@ -271,41 +416,73 @@
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_set_curr(const sdp_t *sdp, int curr)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_set_volt(const sdp_t *sdp, int volt)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_set_volt_limit(const sdp_t *sdp, int volt)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_set_output(const sdp_t *sdp, int enable)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_set_poweron_output(const sdp_t *sdp, int preset, int enable)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_set_preset(const sdp_t *sdp, int presn, const sdp_va_t *va_preset)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_set_program(const sdp_t *sdp, int progn, const sdp_program_t *program)
 {
         return -1;
 }

+/**
+ *
+ * returns:
+ */
 int sdp_stop(const sdp_t *sdp)
 {
         return -1;


toolbar

toolbar

error: pathspec 'toolbar.h' did not match any file(s) known to git

--- toolbar.h
+++ toolbar.h
@@ -0,0 +1,5 @@
+#ifndef TOOLBAR_H
+#define TOOLBAR_H
+
+#endif // TOOLBAR_H
+


Consistent method style in header.

Consistent method style in header.

--- Source/CGAspectRatio.h
+++ Source/CGAspectRatio.h
@@ -85,7 +85,7 @@
 /// @param string A string whose contents are of the form “{w, h}”, where w is the width and h is the height. The w and h values can be integer or float values. An example of a valid string is @”{16.0,9.0}”. The string is not localized, so items are always separated with a comma.
 /// @return A Core Graphics structure that represents an aspect ratio. If the string is not well-formed, the function returns @c CGAspectRatioZero.
 /// @discussion In general, you should use this function only to convert strings that were previously created using the NSStringFromCGAspectRatio function.
-CGAspectRatio CGAspectRatioFromString (NSString *string);
+CGAspectRatio CGAspectRatioFromString(NSString *string);

 /// Returns a string formatted to contain the data from an aspect ratio data structure.
 /// @param aspectRatio A Core Graphics structure representing an aspect ratio.


Fix Eigen support

Fix Eigen support

--- include/CoolPropTools.h
+++ include/CoolPropTools.h
@@ -266,20 +266,22 @@
         }
         throw(errno);
     }
+
     inline void removeRow(Eigen::MatrixXd& matrix, unsigned int rowToRemove)
     {
-        unsigned int numRows = matrix.rows()-1;
-        unsigned int numCols = matrix.cols();
+        unsigned int numRows = static_cast<unsigned int>(matrix.rows())- 1;
+        unsigned int numCols = static_cast<unsigned int>(matrix.cols());

         if( rowToRemove < numRows )
             matrix.block(rowToRemove,0,numRows-rowToRemove,numCols) = matrix.block(rowToRemove+1,0,numRows-rowToRemove,numCols);

         matrix.conservativeResize(numRows,numCols);
     };
+
     inline void removeColumn(Eigen::MatrixXd& matrix, unsigned int colToRemove)
     {
-        unsigned int numRows = matrix.rows();
-        unsigned int numCols = matrix.cols()-1;
+        unsigned int numRows = static_cast<unsigned int>(matrix.rows());
+        unsigned int numCols = static_cast<unsigned int>(matrix.cols())-1;

         if( colToRemove < numCols )
             matrix.block(0,colToRemove,numRows,numCols-colToRemove) = matrix.block(0,colToRemove+1,numRows,numCols-colToRemove);
@@ -290,8 +292,8 @@
     inline Eigen::MatrixXd minor_matrix(const Eigen::MatrixBase<Derived>& A, std::size_t i, std::size_t j)
     {
         Eigen::MatrixXd Am = A;
-        removeRow(Am, i);
-        removeColumn(Am, j);
+        removeRow(Am, static_cast<unsigned int>(i));
+        removeColumn(Am, static_cast<unsigned int>(j));
         return Am;
     };

@@ -301,7 +303,8 @@
         Eigen::MatrixXd Aadj(A.rows(), A.cols());
         for (std::size_t i = 0; i < N; ++i){
             for (std::size_t j = 0; j < N; ++j){
-                Aadj(i,j) = pow(-1, i+j)*minor_matrix(A, i, j).determinant();
+                int negative_1_to_the_i_plus_j = ((i+j)%2==0) ? 1 : -1;
+                Aadj(i, j) = negative_1_to_the_i_plus_j*minor_matrix(A, i, j).determinant();
             }
         }
         return Aadj;
@@ -449,7 +452,22 @@
         return min;
     }

-    inline int Kronecker_delta(int i, int j){if (i == j) {return 1;} else {return 0;}};
+    inline int Kronecker_delta(std::size_t i, std::size_t j){
+        if (i == j) {
+            return static_cast<int>(1);
+        }
+        else {
+            return static_cast<int>(0);
+        }
+    };
+    inline int Kronecker_delta(int i, int j){
+        if (i == j) {
+            return 1;
+        }
+        else {
+            return 0;
+        }
+    };

     class Dictionary
     {


remove unneeded check for config.h

remove unneeded check for config.h

--- include/FLAC/callback.h
+++ include/FLAC/callback.h
@@ -31,10 +31,6 @@

 #ifndef FLAC__CALLBACK_H
 #define FLAC__CALLBACK_H
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif

 #include "ordinals.h"
 #include <stdlib.h> /* for size_t */


write missing docs for remaining new functions

--- include/FLAC/metadata.h
+++ include/FLAC/metadata.h
@@ -1242,7 +1242,7 @@
  *                           terminating \c NULL.
  * \assert
  *    \code entry != NULL \endcode
- *    \code (entry->entry != NULL && entry->length > 0)
+ *    \code (entry->entry != NULL && entry->length > 0) \endcode
  * \retval FLAC__bool
  *    \c true if the field names match, else \c false
  */
@@ -1295,16 +1295,56 @@
  */
 FLAC_API int FLAC__metadata_object_vorbiscomment_remove_entries_matching(FLAC__StreamMetadata *object, const char *field_name);

-/*@@@@ document */
+/** Create a new CUESHEET track instance.
+ *
+ *  The object will be "empty"; i.e. values and data pointers will be \c 0.
+ *
+ * \retval FLAC__StreamMetadata_CueSheet_Track*
+ *    \c NULL if there was an error allocating memory, else the new instance.
+ */
 FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_new();

-/*@@@@ document */
+/** Create a copy of an existing CUESHEET track object.
+ *
+ *  The copy is a "deep" copy, i.e. dynamically allocated data within the
+ *  object is also copied.  The caller takes ownership of the new object and
+ *  is responsible for freeing it with
+ *  FLAC__metadata_object_cuesheet_track_delete().
+ *
+ * \param object  Pointer to object to copy.
+ * \assert
+ *    \code object != NULL \endcode
+ * \retval FLAC__StreamMetadata_CueSheet_Track*
+ *    \c NULL if there was an error allocating memory, else the new instance.
+ */
 FLAC_API FLAC__StreamMetadata_CueSheet_Track *FLAC__metadata_object_cuesheet_track_clone(const FLAC__StreamMetadata_CueSheet_Track *object);

-/*@@@@ document */
+/** Delete a CUESHEET track object
+ *
+ * \param object       A pointer to an existing CUESHEET track object.
+ * \assert
+ *    \code object != NULL \endcode
+ */
 FLAC_API void FLAC__metadata_object_cuesheet_track_delete(FLAC__StreamMetadata_CueSheet_Track *object);

-/*@@@@ document */
+/** Resize a track's index point array.
+ *
+ *  If the size shrinks, elements will truncated; if it grows, new blank
+ *  indices will be added to the end.
+ *
+ * \param object           A pointer to an existing CUESHEET object.
+ * \param track_num        The index of the track to modify.  NOTE: this is not
+ *                         necessarily the same as the track's \a number field.
+ * \param new_num_indices  The desired length of the array; may be \c 0.
+ * \assert
+ *    \code object != NULL \endcode
+ *    \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode
+ *    \code object->data.cue_sheet.num_tracks > track_num \endcode
+ *    \code (object->data.cue_sheet.tracks[track_num].indices == NULL && object->data.cue_sheet.tracks[track_num].num_indices == 0) ||
+ * (object->data.cue_sheet.tracks[track_num].indices != NULL && object->data.cue_sheet.tracks[track_num].num_indices > 0) \endcode
+ * \retval FLAC__bool
+ *    \c false if memory allocation error, else \c true.
+ */
 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_resize_indices(FLAC__StreamMetadata *object, unsigned track_num, unsigned new_num_indices);

 /** Insert an index point in a CUESHEET track at the given index.
@@ -1323,7 +1363,6 @@
  * \assert
  *    \code object != NULL \endcode
  *    \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode
- *    \code object->data.cue_sheet.num_tracks >= track_num \endcode
  *    \code object->data.cue_sheet.num_tracks > track_num \endcode
  *    \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode
  * \retval FLAC__bool
@@ -1331,7 +1370,29 @@
  */
 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num, FLAC__StreamMetadata_CueSheet_Index index);

-/*@@@@ document, add to unit tests */
+/*@@@@ add to unit tests */
+/** Insert a blank index point in a CUESHEET track at the given index.
+ *
+ *  A blank index point is one in which all field values are zero.
+ *
+ * \param object       A pointer to an existing CUESHEET object.
+ * \param track_num    The index of the track to modify.  NOTE: this is not
+ *                     necessarily the same as the track's \a number field.
+ * \param index_num    The index into the track's index array at which to
+ *                     insert the index point.  NOTE: this is not necessarily
+ *                     the same as the index point's \a number field.  The
+ *                     indices at and after \a index_num move right one
+ *                     position.  To append an index point to the end, set
+ *                     \a index_num to
+ *                     \c object->data.cue_sheet.tracks[track_num].num_indices .
+ * \assert
+ *    \code object != NULL \endcode
+ *    \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode
+ *    \code object->data.cue_sheet.num_tracks > track_num \endcode
+ *    \code object->data.cue_sheet.tracks[track_num].num_indices >= index_num \endcode
+ * \retval FLAC__bool
+ *    \c false if realloc fails, else \c true.
+ */
 FLAC_API FLAC__bool FLAC__metadata_object_cuesheet_track_insert_blank_index(FLAC__StreamMetadata *object, unsigned track_num, unsigned index_num);

 /** Delete an index point in a CUESHEET track at the given index.
@@ -1386,6 +1447,8 @@
  * \assert
  *    \code object != NULL \endcode
  *    \code object->type == FLAC__METADATA_TYPE_CUESHEET \endcode
+ *    \code (track->indices != NULL && track->num_indices > 0) ||
+ * (track->indices == NULL && track->num_indices == 0)
  * \retval FLAC__bool
  *    \c false if \a copy is \c true and malloc fails, else \c true.
  */


x86: put ISR stubs in their own text section

Rather than embedding the ISR stub directly inside the function that
invokes IRQ_CONNECT(), stick all the generated stubs in the
.text.irqstubs section.

In this way, we make things easier to debug since the stub code isn't
mixed in with the "calling" function's assembly, and we no longer
need an instruction to jump over it.

Since these are now in their own section and not embedded inside an
unrelated init function, we unconditionally generate descriptive
symbol names for each stub based on the name of the handler and the
IRQ line.

Example for HPET timer on IRQ #2:

00100440 T _timer_int_handler            <-- driver ISR
00100590 T _timer_int_handler_irq2_stub  <-- generated stub

Change-Id: I49425aef7775edbca8ad7f61d2d4f9c41cb0d39d
Signed-off-by: Andrew Boie <aab045b28152628be6af0e556050d0381fd0a34d@intel.com>

--- include/arch/x86/arch.h
+++ include/arch/x86/arch.h
@@ -175,14 +175,6 @@
 	"pushl %[isr_param]\n\t"
 #endif /* CONFIG_X86_IAMCU */

-#ifdef CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT
-#define _IRQ_STUB_LABEL \
-	" .global %[isr]%P[irq]_stub\n\t" \
-	"%[isr]%P[irq]_stub:\n\t"
-#else
-#define _IRQ_STUB_LABEL
-#endif
-
 /**
  * Code snippets for populating the vector ID and priority into the intList
  *
@@ -216,18 +208,15 @@
  *
  * Internally this function does a few things:
  *
- * 1. There is a block of inline assembly which is completely skipped over
- * at runtime with an initial 'jmp' instruction.
- *
- * 2. There is a declaration of the interrupt parameters in the .intList
+ * 1. There is a declaration of the interrupt parameters in the .intList
  * section, used by gen_idt to create the IDT. This does the same thing
  * as the NANO_CPU_INT_REGISTER() macro, but is done in assembly as we
  * need to populate the .fnc member with the address of the assembly
  * IRQ stub that we generate immediately afterwards.
  *
- * 3. The IRQ stub itself is declared. It doesn't get run in the context
- * of the calling function due to the initial 'jmp' instruction at the
- * beginning of the assembly block, but a pointer to it gets saved in the IDT.
+ * 2. The IRQ stub itself is declared. The code will go in its own named
+ * section .text.irqstubs section (which eventually gets linked into 'text')
+ * and the stub shall be named (isr_name)_irq(irq_line)_stub
  *
  * The stub calls _IntEnt to save interrupted context and switch to the IRQ
  * stack. There is a calling convention specific macro to populate the
@@ -248,21 +237,21 @@
 #define _ARCH_IRQ_CONNECT(irq_p, priority_p, isr_p, isr_param_p, flags_p) \
 ({ \
 	__asm__ __volatile__(							\
-		"jmp 2f\n\t" \
 		".pushsection .intList\n\t" \
-		".long 1f\n\t"			/* ISR_LIST.fnc */ \
+		".long %P[isr]_irq%P[irq]_stub\n\t"	/* ISR_LIST.fnc */ \
 		".long %P[irq]\n\t"		/* ISR_LIST.irq */ \
 		".long %P[priority]\n\t"	/* ISR_LIST.priority */ \
 		".long %P[vector]\n\t"		/* ISR_LIST.vec */ \
 		".long 0\n\t"			/* ISR_LIST.dpl */ \
 		".popsection\n\t" \
-		"1:\n\t" \
-		_IRQ_STUB_LABEL \
+		".pushsection .text.irqstubs\n\t" \
+		".global %P[isr]_irq%P[irq]_stub\n\t" \
+		"%P[isr]_irq%P[irq]_stub:\n\t" \
 		"call _IntEnt\n\t" \
 		_ISR_ARG_ASM \
 		"call %P[isr]\n\t" \
 		"jmp _IntExitWithEoi\n\t" \
-		"2:\n\t" \
+		".popsection\n\t" \
 		: \
 		: [isr] "i" (isr_p), \
 		  [isr_param] "i" (isr_param_p), \


.so name in the "DLL" loafing

.so name in the "DLL" loafing

git-svn-id: 294f12855175db510999321cff72188496f07bec@443 45c5ae6f-87cc-4fd0-92ee-e4f023fd80da

--- Source/MediaInfoDLL/MediaInfoDLL.h
+++ Source/MediaInfoDLL/MediaInfoDLL.h
@@ -29,8 +29,11 @@
 /*-------------------------------------------------------------------------*/
 #if defined (_WIN32) || defined (WIN32)
     #define MEDIAINFODLL_NAME  "MediaInfo.dll"
-#else
-    #define MEDIAINFODLL_NAME  "libMediaInfo.la"
+#elif defined(__APPLE__) && defined(__MACH__)
+    #define MEDIAINFODLL_NAME  "libmediainfo.0.dynlib"
+    #define __stdcall
+#else
+    #define MEDIAINFODLL_NAME  "libmediainfo.0.so"
     #define __stdcall
 #endif //!defined(_WIN32) || defined (WIN32)
 #include <new> //For size_t in MacOS


Clarify comment.

Clarify comment.

--- include/base/auto_ptr.h
+++ include/base/auto_ptr.h
@@ -375,9 +375,8 @@

   /**
    * A "safe" replacement for operator bool () that behaves more like
-   * an explicit conversion operator even in C++98.  Defining an
-   * operator bool() provides forward compatibility with newer smart
-   * pointer types, allowing code like if (!foo) to work with AutoPtr.
+   * an explicit conversion operator even in C++98. This allows code
+   * like if (!foo) to work with AutoPtr.
    */
   bool boolean_test() const
   {


Bluetooth: Shorten LE Conn Param define names

Shorten LE Remote Connection Parameters Request Event
HCI define and struct name.

Change-Id: Ia094b16caa2716f24afd4cc7db57404050fafeef
Signed-off-by: Mariusz Skamra <c73850bd0bf85e95dce44c2ce1418ca55c1b6c5d@tieto.com>

--- include/bluetooth/hci.h
+++ include/bluetooth/hci.h
@@ -424,8 +424,8 @@
 	uint16_t ediv;
 } __packed;

-#define BT_HCI_EVT_LE_REMOTE_CONN_PARAM_REQ	0x06
-struct bt_hci_evt_le_remote_conn_param_req {
+#define BT_HCI_EVT_LE_CONN_PARAM_REQ		0x06
+struct bt_hci_evt_le_conn_param_req {
 	uint16_t handle;
 	uint16_t interval_min;
 	uint16_t interval_max;


Fix pawn promotion bug

Fix pawn promotion bug

--- include/chess/movegen.h
+++ include/chess/movegen.h
@@ -241,7 +241,7 @@
         data_tables::kBackRank<util::opponent<P>()>;

     std::uint64_t advances1 =
-        util::AdvancePawns1<P>(pawns) & kBackRank & vacant & target;
+        util::AdvancePawns1<P>(pawns) & kBackRank & vacant;

     while (advances1) {
         const auto to = static_cast<Square>(util::Msb(advances1));


Defines GLM_FORCE_SIZE_FUNC, per g-truc/glm#245 to prevent accidental usage of vec3::length()

--- include/cinder/Cinder.h
+++ include/cinder/Cinder.h
@@ -28,6 +28,7 @@
 	#endif
 #endif

+#define GLM_FORCE_SIZE_FUNC
 #include "glm/fwd.hpp"

 #include <cstdint>


Added OStreamMem::createRef() static function

--- include/cinder/Stream.h
+++ include/cinder/Stream.h
@@ -272,8 +272,12 @@
 };

+typedef std::shared_ptr<class OStreamMem>		OStreamMemRef;
+
 class OStreamMem : public OStream {
  public:
+	static OStreamMemRef		createRef( size_t bufferSizeHint = 4096 ) { return std::shared_ptr<OStreamMem>( new OStreamMem( bufferSizeHint ) ); }
+
 	~OStreamMem();

 	virtual off_t		tell() const { return static_cast<off_t>( mOffset ); }
@@ -291,8 +295,6 @@
 	size_t			mDataSize;
 	size_t			mOffset;
 };
-
-typedef std::shared_ptr<OStreamMem>		OStreamMemRef;

 // This class is a utility to save and restore a stream's state


Add missing semicolons

Add missing semicolons

--- Sources/Cinput/input.c
+++ Sources/Cinput/input.c
@@ -4,7 +4,7 @@
 #ifdef input_event_sec
     return event.input_event_sec;
 #else
-    return event.time.tv_sec
+    return event.time.tv_sec;
 #endif
 }

@@ -12,6 +12,6 @@
 #ifdef input_event_usec
     return event.input_event_usec;
 #else
-    return event.time.tv_usec
+    return event.time.tv_usec;
 #endif
 }


Revert of Revert of remove unused device::eraseColor (patchset #1 id:1 of https://codereview.chromium.org/777003002/)

Reason for revert:
fix landed in chrome to allow this (I hope)

Original issue's description:
> Revert of remove unused device::eraseColor (patchset #1 id:1 of https://codereview.chromium.org/765643004/)
>
> Reason for revert:
> ../../skia/ext/bitmap_platform_device_cairo.cc:131:13: error: no member named 'eraseColor' in 'skia::BitmapPlatformDevice'
>
>
> Original issue's description:
> > remove unused device::eraseColor
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/b1ab276c3719d6690e58f347c25126d2b8929c5d
>
> TBR=reed@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8b0197ef2e32be9d62e79d58f8b50811975c79c6

TBR=halcanary@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/779543004

--- include/core/SkDevice.h
+++ include/core/SkDevice.h
@@ -165,9 +165,6 @@
      *  Ignores the clip.
      */
     virtual void clear(SkColor color) = 0;
-
-    SK_ATTR_DEPRECATED("use clear() instead")
-    void eraseColor(SkColor eraseColor) { this->clear(eraseColor); }

     /** These are called inside the per-device-layer loop for each draw call.
      When these are called, we have already applied any saveLayer operations,


move setOrigin to protected, as a stop-gap fix for proxy devices. will revert
soon I expect.

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

--- include/core/SkDevice.h
+++ include/core/SkDevice.h
@@ -262,6 +262,11 @@
     virtual void lockPixels();
     virtual void unlockPixels();

+    // just called by SkCanvas when built as a layer
+    // TEMPORARY: promote from private to protected, until we find a better
+    // solution for proxy devices
+    void setOrigin(int x, int y) { fOrigin.set(x, y); }
+
 private:
     friend class SkCanvas;
     friend struct DeviceCM; //for setMatrixClip
@@ -269,8 +274,6 @@
     friend class SkDrawIter;
     friend class SkDeviceFilteredPaint;

-    // just called by SkCanvas when built as a layer
-    void setOrigin(int x, int y) { fOrigin.set(x, y); }
     // just called by SkCanvas for saveLayer
     SkDevice* createCompatibleDeviceForSaveLayer(SkBitmap::Config config,
                                                  int width, int height,


Add SkNVRefCnt::getRefCnt()

Add SkNVRefCnt::getRefCnt()

Used in Blink unit tests.

TBR=mtklein@google.com,humper@google.com

Review URL: https://codereview.chromium.org/746693002

--- include/core/SkRefCnt.h
+++ include/core/SkRefCnt.h
@@ -263,6 +263,8 @@
     void    ref() const { sk_atomic_inc(&fRefCnt); }
     void  unref() const { if (1 == sk_atomic_dec(&fRefCnt)) { SkDELETE((const Derived*)this); } }
     void  deref() const { this->unref(); }  // Chrome prefers to call deref().
+    int32_t getRefCnt() const { return fRefCnt; } // Used by Chrome unit tests.
+
 private:
     mutable int32_t fRefCnt;
 };


Add comment about atomics of error counters

--- include/csp/csp_debug.h
+++ include/csp/csp_debug.h
@@ -9,6 +9,11 @@
  * Based on counters, and error numbers.
  * This gets rid of a lot of verbose debugging strings while
  * still maintaining the same level of debug capabilities.
+ *
+ * NOTE: We choose to ignore atomic access to the counters right now.
+ *   1) Most of the access to these happens single threaded (router task) or within ISR (driver RX)
+ *   2) Having accurate error counters is NOT a priority. They are only there for debugging purposes.
+ *   3) Not all compilers have support for <stdatomic.h> yet.
  *
  */


Make the tick ISR entry function use the __raw attribute in the IAR MSP430X port layer.

git-svn-id: 43aea61533866f88f23079d48f4f5dc2d5288937@1245 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

--- Source/portable/IAR/MSP430X/port.c
+++ Source/portable/IAR/MSP430X/port.c
@@ -197,7 +197,7 @@
 /*-----------------------------------------------------------*/

 #pragma vector=configTICK_VECTOR
-__interrupt void vTickISREntry( void )
+__interrupt __raw void vTickISREntry( void )
 {
 extern void vPortTickISR( void );


encoding  fix

encoding  fix

--- include/detail/buffer.h
+++ include/detail/buffer.h
@@ -1,5 +1,5 @@
 //
-// Created by ŷ��� on 2015/8/11.
+// Created by owent on 2015/8/11.
 //

 #ifndef LIBATBUS_BUFFER_H


[Device Type] Sync TVM device type back (#16)

--- include/dlpack/dlpack.h
+++ include/dlpack/dlpack.h
@@ -41,6 +41,8 @@
   // kCPUPinned = kCPU | kGPU
   kCPUPinned = 3,
   kOpenCL = 4,
+  kMetal = 8,
+  kVPI = 9,
   kROCM = 10,
 } DLDeviceType;


simplified the factory interface just a tiny bit

--- include/ef.gy/factory.h
+++ include/ef.gy/factory.h
@@ -340,52 +340,40 @@
                 }
         };

-        /**\brief Model factory base type helper
-         *
-         * Provides a function that, given a basic geometric type, provides a
-         * with() method that checks if the given parameters apply to that basic
-         * geometric type and dispatches a function call as appropriate.
-         *
-         * \tparam T Model template, e.g. efgy::geometry::cube
-         */
-        template<template <class,unsigned int,class,unsigned int> class T>
-        class factory
-        {
-            public:
-                /**\brief Call template function with class type
-                 *
-                 * Part of the geometric model type factory; called by the
-                 * geometry::with function given a type to check if the type is
-                 * compatible with the given parameters.
-                 *
-                 * \tparam Q    Base datatype for model geometry.
-                 * \tparam func The function to call.
-                 * \tparam d    Maximum number of model dimensions.
-                 * \tparam e    Maximum number of render dimensions.
-                 *
-                 * \param[out] arg   The argument to func::...().
-                 * \param[in]  type  The model to pass to func, or "*" for "all
-                 *                   models".
-                 * \param[in]  dims  The target number of model dimensions.
-                 * \param[in]  rdims The target number of render dimensions.
-                 *
-                 * \returns Whatever func::pass returns.
-                 */
-                template<typename Q,
-                         template<typename, template <class,unsigned int,class,unsigned int> class, unsigned int, unsigned int> class func,
-                         unsigned int d,
-                         unsigned int e>
-                static inline typename func<Q,T,d,e>::output with
-                    (typename func<Q,T,d,e>::argument arg,
-                     const std::string &type,
-                     const unsigned int &dims,
-                     const unsigned int &rdims)
-                    {
-                        return ((type == "*") || (type == T<Q,d,render::null<Q,e>,e>::id()))
-                             ? model<Q,func,T,d,e>::with(arg, dims, rdims)
-                             : func<Q,T,d,e>::pass(arg);
-                    }
-        };
+        /**\brief Call template function with class type
+         *
+         * Part of the geometric model type factory; called by the
+         * geometry::with function given a type to check if the type is
+         * compatible with the given parameters.
+         *
+         * \tparam Q    Base datatype for model geometry.
+         * \tparam func The function to call.
+         * \tparam d    Maximum number of model dimensions.
+         * \tparam e    Maximum number of render dimensions.
+         * \tparam T    Model template, e.g. efgy::geometry::cube
+         *
+         * \param[out] arg   The argument to func::...().
+         * \param[in]  type  The name to check, or "*" which always matches.
+         * \param[in]  dims  The target number of model dimensions.
+         * \param[in]  rdims The target number of render dimensions.
+         *
+         * \returns Whatever func::pass or func::with returns.
+         */
+        template<typename Q,
+                 template<typename, template <class,unsigned int,class,unsigned int> class, unsigned int, unsigned int> class func,
+                 unsigned int d,
+                 unsigned int e,
+                 template <class,unsigned int,class,unsigned int> class T>
+        static inline typename func<Q,T,d,e>::output with
+            (typename func<Q,T,d,e>::argument arg,
+             const std::string &type,
+             const unsigned int &dims,
+             const unsigned int &rdims)
+        {
+            return ((type == "*") || (type == T<Q,d,render::null<Q,e>,e>::id()))
+                 ? model<Q,func,T,d,e>::with(arg, dims, rdims)
+                 : func<Q,T,d,e>::pass(arg);
+        }

         /**\brief Call template function with geometric type(s)
          *
@@ -416,18 +404,18 @@
              const unsigned int &dims,
              const unsigned int &rdims)
         {
-            factory<simplex>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<plane>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<cube>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<sphere>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<torus>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<moebiusStrip>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<kleinBagel>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<kleinBottle>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<sierpinski::gasket>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<sierpinski::carpet>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<randomAffineIFS>::with<Q,func,d,e>(arg,type,dims,rdims);
-            factory<flame::random>::with<Q,func,d,e>(arg,type,dims,rdims);
+            with<Q,func,d,e,simplex>(arg,type,dims,rdims);
+            with<Q,func,d,e,plane>(arg,type,dims,rdims);
+            with<Q,func,d,e,cube>(arg,type,dims,rdims);
+            with<Q,func,d,e,sphere>(arg,type,dims,rdims);
+            with<Q,func,d,e,torus>(arg,type,dims,rdims);
+            with<Q,func,d,e,moebiusStrip>(arg,type,dims,rdims);
+            with<Q,func,d,e,kleinBagel>(arg,type,dims,rdims);
+            with<Q,func,d,e,kleinBottle>(arg,type,dims,rdims);
+            with<Q,func,d,e,sierpinski::gasket>(arg,type,dims,rdims);
+            with<Q,func,d,e,sierpinski::carpet>(arg,type,dims,rdims);
+            with<Q,func,d,e,randomAffineIFS>(arg,type,dims,rdims);
+            with<Q,func,d,e,flame::random>(arg,type,dims,rdims);

             return func<Q,cube,d,e>::pass(arg);
         }


Make certain free functions `inline` in `print.h`

To prevent possible ODR violations.

--- include/floaxie/print.h
+++ include/floaxie/print.h
@@ -35,7 +35,7 @@
 	 *
 	 * Useful for debugging purposes.
 	 */
-	std::string print_binary(double f)
+	std::string inline print_binary(double f)
 	{
 		auto s(std::bitset<64>(type_punning_cast<std::uint64_t>(f)).to_string());
 		s.insert(1, 1, ' ');
@@ -44,13 +44,13 @@
 	}

 	/** \brief Print arbitrary numeric value in binary format. */
-	template<typename NumericType> std::string print_binary(NumericType v)
+	template<typename NumericType> inline std::string print_binary(NumericType v)
 	{
 		return std::bitset<bit_size<NumericType>()>(v).to_string();
 	}

 	/** \brief Print arbitrary numeric value as if it were `double`. */
-	template<typename NumericType> std::string print_double_presentation(NumericType v)
+	template<typename NumericType> inline std::string print_double_presentation(NumericType v)
 	{
 		auto s(std::bitset<64>(v).to_string());
 		s.insert(1, 1, ' ');


forgotten piece of commit

forgotten piece of commit

--- include/frepple/model.h
+++ include/frepple/model.h
@@ -7117,14 +7117,14 @@

     double getQuantityFixed() const
     {
-      return qty_fixed;
+      return qtyfixed;
     }

     void setQuantityFixed(double f)
     {
       if (f < 0)
         throw DataException("OperationResource quantity_fixed can't be negative");
-      qty_fixed = f;
+      qtyfixed = f;
     }

     /** Return the leading load of this group.


Fix the contradictory documentation of svn_mergeinfo_t and
svn_mergeinfo_catalog_t.

* subversion/include/svn_mergeinfo.h
  (svn_mergeinfo_t,
   svn_mergeinfo_catalog_t): Be clear, mergeinfo keys are always absolute
   while mergeinfo catalog keys may be absolute or relative.

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

--- subversion/include/svn_mergeinfo.h
+++ subversion/include/svn_mergeinfo.h
@@ -127,15 +127,14 @@
  *     mergeinfo.
  *
  * (d) @c svn_mergeinfo_catalog_t, called a "mergeinfo catalog".  A hash
- *     mapping paths (@c const char *, starting with slashes) to
- *     @c svn_mergeinfo_t.
+ *     mapping paths (@c const char *) to @c svn_mergeinfo_t.
  *
  * Both @c svn_mergeinfo_t and @c svn_mergeinfo_catalog_t are just
  * typedefs for @c apr_hash_t *; there is no static type-checking, and
  * you still use standard @c apr_hash_t functions to interact with
  * them.
  *
- * Note that while the keys of mergeinfos are always relative to the
+ * Note that while the keys of mergeinfos are always absolute from the
  * repository root, the keys of a catalog may be relative to something
  * else, such as an RA session root.
  */


use empty() instead of comparisons

use empty() instead of comparisons

--- Plugins/LocatePlugin.h
+++ Plugins/LocatePlugin.h
@@ -62,7 +62,7 @@
         //json

 //        JSONParameter = routeParameters.options.Find("jsonp");
-        if("" != routeParameters.jsonpParameter) {
+        if(!routeParameters.jsonpParameter.empty()) {
             reply.content += routeParameters.jsonpParameter;
             reply.content += "(";
         }
@@ -88,7 +88,7 @@
         reply.content += ",\"transactionId\": \"OSRM Routing Engine JSON Locate (v0.3)\"";
         reply.content += ("}");
         reply.headers.resize(3);
-        if("" != routeParameters.jsonpParameter) {
+        if(!routeParameters.jsonpParameter.empty()) {
             reply.content += ")";
             reply.headers[1].name = "Content-Type";
             reply.headers[1].value = "text/javascript";


sync with latest RA interface: add an entry for get_latest_revnum

--- subversion/libsvn_ra_dav/session.c
+++ subversion/libsvn_ra_dav/session.c
@@ -118,9 +118,10 @@
   "(DeltaV) protocol.",
   svn_ra_open,
   svn_ra_close,
+  NULL,         /* ### need get_latest_revnum */
   svn_ra_dav__get_commit_editor,
   svn_ra_dav__checkout,
-  NULL
+  NULL          /* ### need do_update */
 };

 svn_error_t *svn_ra_dav_init(int abi_version,


Use new dirent/URI/path functions to resolve some deprecation warnings.
Also fix a bit of indentation.

* subversion/libsvn_ra_neon/commit.c
  (get_version_url, create_activity, commit_delete_entry, commit_add_dir,
   commit_add_file, commit_close_file): Use `svn_path_url_add_component2()'.
  (add_child): Use `svn_path_url_add_component2()' and `svn_uri_join()'.
  (checkout_resource): Use `svn_relpath_local_style()'.
  (get_child_tokens): Use `svn_uri_is_child()'.

Patch by: Kannan R <kannanr@collab.net>

--- subversion/libsvn_ra_neon/commit.c
+++ subversion/libsvn_ra_neon/commit.c
@@ -204,9 +204,9 @@
          the version resource URL of RSRC. */
       if (parent && parent->vsn_url && parent->revision == rsrc->revision)
         {
-          rsrc->vsn_url = svn_path_url_add_component(parent->vsn_url,
-                                                     rsrc->name,
-                                                     rsrc->pool);
+          rsrc->vsn_url = svn_path_url_add_component2(parent->vsn_url,
+                                                      rsrc->name,
+                                                      rsrc->pool);
           return SVN_NO_ERROR;
         }

@@ -232,7 +232,7 @@
                                              rsrc->revision,
                                              pool));

-      url = svn_path_url_add_component(bc_url.data, bc_relative.data, pool);
+      url = svn_path_url_add_component2(bc_url.data, bc_relative.data, pool);
     }

   /* Get the DAV:checked-in property, which contains the URL of the
@@ -326,8 +326,8 @@
      the activity, and create the activity.  The URL for our activity
      will be ACTIVITY_COLL/UUID */
   SVN_ERR(get_activity_collection(cc, &activity_collection, FALSE, pool));
-  url = svn_path_url_add_component(activity_collection->data,
-                                   uuid_buf, pool);
+  url = svn_path_url_add_component2(activity_collection->data,
+                                    uuid_buf, pool);
   SVN_ERR(svn_ra_neon__simple_request(&code, cc->ras,
                                       "MKACTIVITY", url, NULL, NULL,
                                       201 /* Created */,
@@ -339,8 +339,8 @@
   if (code == 404)
     {
       SVN_ERR(get_activity_collection(cc, &activity_collection, TRUE, pool));
-      url = svn_path_url_add_component(activity_collection->data,
-                                       uuid_buf, pool);
+      url = svn_path_url_add_component2(activity_collection->data,
+                                        uuid_buf, pool);
       SVN_ERR(svn_ra_neon__simple_request(&code, cc->ras,
                                           "MKACTIVITY", url, NULL, NULL,
                                           201, 0, pool));
@@ -374,8 +374,8 @@
   rsrc->pool = pool;
   rsrc->revision = revision;
   rsrc->name = name;
-  rsrc->url = svn_path_url_add_component(parent->url, name, pool);
-  rsrc->local_path = svn_path_join(parent->local_path, name, pool);
+  rsrc->url = svn_path_url_add_component2(parent->url, name, pool);
+  rsrc->local_path = svn_uri_join(parent->local_path, name, pool);

   /* Case 1:  the resource is truly "new".  Either it was added as a
      completely new object, or implicitly created via a COPY.  Either
@@ -383,7 +383,7 @@
      URL by the rules of deltaV:  "copy structure is preserved below
      the WR you COPY to."  */
   if (created || (parent->vsn_url == NULL))
-    rsrc->wr_url = svn_path_url_add_component(parent->wr_url, name, pool);
+    rsrc->wr_url = svn_path_url_add_component2(parent->wr_url, name, pool);

   /* Case 2: the resource is already under version-control somewhere.
      This means it has a VR URL already, and the WR URL won't exist
@@ -499,7 +499,7 @@
         return svn_error_createf
           (err->apr_err, err,
            _("File or directory '%s' is out of date; try updating"),
-           svn_path_local_style(rsrc->local_path, pool));
+           svn_relpath_local_style(rsrc->local_path, pool));
       return err;
     }

@@ -679,7 +679,7 @@
       svn_pool_clear(subpool);
       apr_hash_this(hi, &key, &klen, &val);

-      if (svn_path_is_child(dir, key, subpool))
+      if (svn_uri_is_child(dir, key, subpool))
         apr_hash_set(tokens, key, klen, val);
     }

@@ -715,7 +715,7 @@
   SVN_ERR(checkout_resource(parent->cc, parent->rsrc, TRUE, NULL, pool));

   /* create the URL for the child resource */
-  child = svn_path_url_add_component(parent->rsrc->wr_url, name, pool);
+  child = svn_path_url_add_component2(parent->rsrc->wr_url, name, pool);

   /* Start out assuming that we're deleting a file;  try to lookup the
      path itself in the token-hash, and if found, attach it to the If:
@@ -730,8 +730,8 @@
           const char *token_header_val;
           const char *token_uri;

-          token_uri = svn_path_url_add_component(parent->cc->ras->url->data,
-                                                 path, pool);
+          token_uri = svn_path_url_add_component2(parent->cc->ras->url->data,
+                                                  path, pool);
           token_header_val = apr_psprintf(pool, "<%s> (<%s>)",
                                           token_uri, token);
           extra_headers = apr_hash_make(pool);
@@ -774,7 +774,7 @@

          Note that we're not sending the locks in the If: header, for
          the same reason we're not sending in MERGE's headers: httpd has
-       limits on the amount of data it's willing to receive in headers. */
+         limits on the amount of data it's willing to receive in headers. */

       apr_hash_t *child_tokens = NULL;
       svn_ra_neon__request_t *request;
@@ -889,9 +889,9 @@
          "source" argument to the COPY request.  The "Destination:"
          header given to COPY is simply the wr_url that is already
          part of the child object. */
-      copy_src = svn_path_url_add_component(bc_url.data,
-                                            bc_relative.data,
-                                            workpool);
+      copy_src = svn_path_url_add_component2(bc_url.data,
+                                             bc_relative.data,
+                                             workpool);

       /* Have neon do the COPY. */
       SVN_ERR(svn_ra_neon__copy(parent->cc->ras,
@@ -1089,9 +1089,9 @@
          "source" argument to the COPY request.  The "Destination:"
          header given to COPY is simply the wr_url that is already
          part of the file_baton. */
-      copy_src = svn_path_url_add_component(bc_url.data,
-                                            bc_relative.data,
-                                            workpool);
+      copy_src = svn_path_url_add_component2(bc_url.data,
+                                             bc_relative.data,
+                                             workpool);

       /* Have neon do the COPY. */
       SVN_ERR(svn_ra_neon__copy(parent->cc->ras,
@@ -1289,9 +1289,9 @@
         svn_ra_neon__set_header
           (extra_headers, "If",
            apr_psprintf(pool, "<%s> (<%s>)",
-                        svn_path_url_add_component(cc->ras->url->data,
-                                                   file->rsrc->url,
-                                                   request->pool),
+                        svn_path_url_add_component2(cc->ras->url->data,
+                                                    file->rsrc->url,
+                                                    request->pool),
                         file->token));

       if (pb->base_checksum)


HM_ARRAY now has proper macros

HM_ARRAY now has proper macros

--- include/hammer/macros.h
+++ include/hammer/macros.h
@@ -35,11 +35,53 @@
 #undef HM_SINT
 #undef HM_OBJECT

-#define HM_UINT(x) x
-#define HM_SINT(x) x
-#define HM_OBJECT(x) x*
-#define HM_F_OBJECT(type,field)   HM_F(HM_OBJECT,HM_PTR(type),field,type)
-#define HM_F_OBJECT_OPT(type,field) HM_OPTIONAL(HM_OBJECT,HM_PTR(type), field,type,NULL)
+#include <stddef.h>
+/*This header file should be included multiple times. Depending on defined macros, it defines the
+ * HM_TO* and HM_STRUCT_SEQ, etc macros differently:
+ Here are the possible actions
+ To be included from within the projects header files:
+(nothing): Define structures corresponding to the AST for the grammar.
+ HM_MACROS_ENUM: Define the enum HMacroTokenType
+
+ to be included once per project, in a C file (define HM_MACRO_IMPLEMENT)
+ HM_MACROS_PARSER : define a hammer parser for the grammar
+ HM_MACROS_ACTION : define actions to emit the AST with the above parser
+
+The User API is to write a header file for the grammar, e.g. grammar.h and structure it as follows
+#include <hammer/macros.h>
+GRAMMAR_BEGIN(start_rule)
+HM_STRUCT_SEQ (... - grammar goes here ...)
+GRAMMAR_END(start_rule)
+#include <hammer/macros_end.h>
+#ifdef HM_MACRO_INCLUDE_LOOP
+#include "grammar.h" //include  the file itself here
+#endif
+
+Whereever the AST is supposed to be accessed, include grammar.h as is.
+To produce the functions that create the  AST (in a .c file)
+#define HM_MACRO_IMPLEMENT
+#include "grammar.h"
+*/
+
+#undef HM_MACRO_INCLUDE_LOOP /* To signal the consumer of this header file that it should include itself */
+#undef HM_STRUCT_SEQ
+#undef HM__TO
+#undef HM_F
+#undef HM_F_OBJECT
+#undef HM_UINT
+#undef HM_SINT
+#undef HM_OBJECT
+
+
+#define HM_UINT_TYPE(x) x
+#define HM_SINT_TYPE(x) x
+#define HM_OBJECT_TYPE(x) x*
+#define HM_F_OBJECT(type,field)   HM_F(HM_OBJECT,type,field,type)
+#define HM_F_OBJECT_OPT(type,field) HM_OPTIONAL(HM_OBJECT,type, field,type,NULL)
+
+#define HM_UINT_CAST(type,val) H_CAST_UINT(val)
+#define HM_SINT_CAST(type,val) H_CAST_SINT(val)
+#define HM_OBJECT_CAST(type,val) H_CAST(type,val)

@@ -52,10 +94,27 @@
 #define GRAMMAR_BEGIN(x)
 #define GRAMMAR_END(x)
 #define HM_RULE(name,def)
-#ifndef TOKENPASTE2
+
+#ifndef HM_MACROS_FIRST
+#define HM_MACROS_FIRST
 #define TOKENPASTE(x, y) x ## y  //http://stackoverflow.com/questions/1597007
 #define TOKENPASTE2(x, y) TOKENPASTE(x, y)
-#endif
+
+#define HM_UINT_TYPE(x) x
+#define HM_SINT_TYPE(x) x
+#define HM_OBJECT_TYPE(x) x*
+#define HM_F_OBJECT(type,field)   HM_F(HM_OBJECT,type,field,type)
+#define HM_F_OBJECT_OPT(type,field) HM_OPTIONAL(HM_OBJECT,type, field,type,NULL)
+
+#define HM_UINT_CAST(type,val) H_CAST_UINT(val)
+#define HM_SINT_CAST(type,val) H_CAST_SINT(val)
+#define HM_OBJECT_CAST(type,val) H_CAST(type,val)
+
+#define HM_DO_CAST(cast,type,val) TOKENPASTE2(cast,_CAST)(type,val)
+#define HM_DO_TYPE(cast,val) TOKENPASTE2(cast,_TYPE)(val)
+#endif
+
+

 #ifdef HM_MACRO_IMPLEMENT
 #define HM_MACROS_ACTION
@@ -103,17 +162,11 @@
 /*action*/

 #undef HM_MACROS_ACTION
-#undef HM_UINT
-#undef HM_SINT
-#undef HM_OBJECT
-#define HM_UINT(type,val) H_CAST_UINT(val)
-#define HM_SINT(type,val) H_CAST_SINT(val)
-#define HM_OBJECT(type,val) H_CAST(type,val)
-#define HM_F(cast,type,field,parser) ret->field = cast(type,fields[i]); i++;
+#define HM_F(cast,type,field,parser) ret->field = HM_DO_CAST(cast,type,fields[i]); i++;
 #define HM_ARRAY(cast,type,field,parser) ret->field.count = h_seq_len(fields[i]); \
         do{int j; HParsedToken **seq = h_seq_elements(fields[i]); \
-        ret->field.elem = (type *)h_arena_malloc(p->arena, sizeof(type) * ret->field.count); /*  WARNING, can fail*/ \
-        for(j=0;j<ret->field.count;j++){ret->field.elem[j] = cast(type,seq[j]); } \
+                ret->field.elem = (HM_DO_TYPE(cast,type) *)h_arena_malloc(p->arena, sizeof(HM_DO_TYPE(cast,type)) * ret->field.count); /*  WARNING, can fail*/ \
+        for(j=0;j<ret->field.count;j++){ret->field.elem[j] = HM_DO_CAST(cast,type,seq[j]); } \
         }while(0); i++;
 #define HM_OPTIONAL(cast,type,field,parser,default) if(fields[i]->token_type == TT_NONE){ret->field = default;i++;} else {HM_F(cast,type,field,parser)}
 //#define HM_F_ARRAY(type,field,parser)  ret->field = /* We want an array of type */
@@ -158,7 +211,7 @@

 #define HM_OPTIONAL(cast,type,field,parser,default) HM_F(cast,type,field,parser)
 #define HM_STRUCT_SEQ(...) typedef struct HM_NAME { __VA_ARGS__ } HM_NAME;
-#define HM_F(cast,type,field, parser)  cast(type) field;
+#define HM_F(cast,type,field, parser)  HM_DO_TYPE(cast,type) field;

 #undef GRAMMAR_END
 #define GRAMMAR_END(name) extern const struct name *parse_ ## name(const uint8_t *input, size_t length); \
@@ -166,7 +219,7 @@

-#define HM_ARRAY(cast,type,field,parser)  struct { type *elem; size_t count; } field;
+#define HM_ARRAY(cast,type,field,parser)  struct { HM_DO_TYPE(cast,type) *elem; size_t count; } field;

 /* run again to get the enum */
 #define HM_MACROS_ENUM


Update TLogger.h - Added LogIfEnabled macro.

--- Pod/Internal/TLogger.h
+++ Pod/Internal/TLogger.h
@@ -43,3 +43,9 @@
     // NOTE: Do not call this directly, please use the macros for all calls.
     + (void)log:(Class)callingClass selector:(SEL)selector classInstance: (id) classInstanceOrNil sourceFile:(char *)sourceFile sourceLineNumber:(int)sourceLineNumber logLevel:(LogLevel)level message: (NSString *) message;
 @end
+
+#ifdef DEBUG
+#define LogIfEnabled(clazz,sel,clazzInstanceOrNil,level,...) [TLogger log: clazz selector: sel classInstance: clazzInstanceOrNil sourceFile: __FILE__ sourceLineNumber: __LINE__ logLevel: level message: [NSString stringWithFormat:__VA_ARGS__]]
+#else
+#define LogIfEnabled(clazz,sel,clazzInstanceOrNil,level,...) /* empty */
+#endif


* subversion/libsvn_ra_neon/commit.c   (commit_ctx_t): Correct a doc string.

--- subversion/libsvn_ra_neon/commit.c
+++ subversion/libsvn_ra_neon/commit.c
@@ -88,7 +88,7 @@
   apr_hash_t *revprop_table;

   /* A hash mapping svn_string_t * paths (those which are valid as
-     target in the MERGE response) to svn_node_kind_t kinds. */
+     target in the MERGE response) to (void*)svn_recurse_kind. */
   apr_hash_t *valid_targets;

   /* The (potential) author of this commit. */


ra_serf: fix merge_tests 52 and 54 by adding support for custom properties
containing colons.

* subversion/libsvn_ra_serf/commit.c
  (PROPPATCH_HEADER): define namespace prefixes S: and C:
  (proppatch_walker): when the svn or a custom property property namespace
   is needed, use its namespace prefix instead of the xmlns attribute.

--- subversion/libsvn_ra_serf/commit.c
+++ subversion/libsvn_ra_serf/commit.c
@@ -516,6 +516,7 @@
   serf_bucket_t *tmp_bkt;
   serf_bucket_alloc_t *alloc;
   svn_boolean_t binary_prop;
+  char *prop_name;

   if (svn_xml_is_xml_safe(val->data, val->len))
     {
@@ -525,6 +526,14 @@
     {
       binary_prop = TRUE;
     }
+
+  /* Use the namespace prefix instead of adding the xmlns attribute to support
+     property names containing ':' */
+  if (strcmp(ns, SVN_DAV_PROP_NS_SVN) == 0)
+    prop_name = apr_pstrcat(pool, "S:", name, NULL);
+  else if (strcmp(ns, SVN_DAV_PROP_NS_CUSTOM) == 0)
+    prop_name = apr_pstrcat(pool, "C:", name, NULL);
+  name_len = strlen(prop_name);

   alloc = body_bkt->allocator;

@@ -533,28 +542,20 @@
                                           alloc);
   serf_bucket_aggregate_append(body_bkt, tmp_bkt);

-  tmp_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(name, name_len, alloc);
+  tmp_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(prop_name, name_len, alloc);
   serf_bucket_aggregate_append(body_bkt, tmp_bkt);

-  tmp_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(" xmlns=\"",
-                                          sizeof(" xmlns=\"") - 1,
-                                          alloc);
-  serf_bucket_aggregate_append(body_bkt, tmp_bkt);
-
-  tmp_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(ns, ns_len, alloc);
-  serf_bucket_aggregate_append(body_bkt, tmp_bkt);
-
   if (binary_prop == TRUE)
     {
       tmp_bkt =
-          SERF_BUCKET_SIMPLE_STRING_LEN("\" V:encoding=\"base64",
-                                        sizeof("\" V:encoding=\"base64") - 1,
+          SERF_BUCKET_SIMPLE_STRING_LEN("V:encoding=\"base64\"",
+                                        sizeof("V:encoding=\"base64\"") - 1,
                                         alloc);
       serf_bucket_aggregate_append(body_bkt, tmp_bkt);
     }

-  tmp_bkt = SERF_BUCKET_SIMPLE_STRING_LEN("\">",
-                                          sizeof("\">") - 1,
+  tmp_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(">",
+                                          sizeof(">") - 1,
                                           alloc);
   serf_bucket_aggregate_append(body_bkt, tmp_bkt);

@@ -577,7 +578,7 @@
                                           alloc);
   serf_bucket_aggregate_append(body_bkt, tmp_bkt);

-  tmp_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(name, name_len, alloc);
+  tmp_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(prop_name, name_len, alloc);
   serf_bucket_aggregate_append(body_bkt, tmp_bkt);

   tmp_bkt = SERF_BUCKET_SIMPLE_STRING_LEN(">",
@@ -615,7 +616,11 @@
   return APR_SUCCESS;
 }

-#define PROPPATCH_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propertyupdate xmlns:D=\"DAV:\" xmlns:V=\"" SVN_DAV_PROP_NS_DAV "\">"
+#define PROPPATCH_HEADER "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
+                         "<D:propertyupdate xmlns:D=\"DAV:\" "\
+                         "xmlns:V=\"" SVN_DAV_PROP_NS_DAV "\" "\
+                         "xmlns:C=\"" SVN_DAV_PROP_NS_CUSTOM "\" "\
+                         "xmlns:S=\"" SVN_DAV_PROP_NS_SVN "\">"

 #define PROPPATCH_TRAILER "</D:propertyupdate>"


[svn] update libplayer backend toward latest api changes

--- src/modules/backend/libplayer/enna_module_libplayer.c
+++ src/modules/backend/libplayer/enna_module_libplayer.c
@@ -74,7 +74,7 @@
    args = calloc (1, sizeof (mrl_resource_local_args_t));
    args->location = strdup (uri);

-   mrl = mrl_new (mod->player, PLAYER_MRL_RESOURCE_FILE, args);
+   mrl = mrl_new (mod->player, MRL_RESOURCE_FILE, args);
    if (!mrl)
     return 1;

@@ -110,7 +110,7 @@

 static double _class_length_get()
 {
-   return (double) mrl_get_property (mod->player, NULL, PLAYER_PROPERTY_LENGTH) / 1000.0;
+   return (double) mrl_get_property (mod->player, NULL, MRL_PROPERTY_LENGTH) / 1000.0;
 }

 static Enna_Metadata *_class_metadata_get(void)
@@ -118,14 +118,14 @@
    Enna_Metadata *meta;

    meta = calloc (1, sizeof (Enna_Metadata));
-   meta->title = mrl_get_metadata (mod->player, NULL, PLAYER_METADATA_TITLE);
-   meta->artist = mrl_get_metadata (mod->player, NULL, PLAYER_METADATA_ARTIST);
-   meta->album = mrl_get_metadata (mod->player, NULL, PLAYER_METADATA_ALBUM);
-   meta->year = mrl_get_metadata (mod->player, NULL, PLAYER_METADATA_YEAR);
-   meta->genre = mrl_get_metadata (mod->player, NULL, PLAYER_METADATA_GENRE);
-   meta->comment = mrl_get_metadata (mod->player, NULL, PLAYER_METADATA_COMMENT);
+   meta->title = mrl_get_metadata (mod->player, NULL, MRL_METADATA_TITLE);
+   meta->artist = mrl_get_metadata (mod->player, NULL, MRL_METADATA_ARTIST);
+   meta->album = mrl_get_metadata (mod->player, NULL, MRL_METADATA_ALBUM);
+   meta->year = mrl_get_metadata (mod->player, NULL, MRL_METADATA_YEAR);
+   meta->genre = mrl_get_metadata (mod->player, NULL, MRL_METADATA_GENRE);
+   meta->comment = mrl_get_metadata (mod->player, NULL, MRL_METADATA_COMMENT);
    meta->discid = NULL;
-   meta->track = mrl_get_metadata (mod->player, NULL, PLAYER_METADATA_TRACK);
+   meta->track = mrl_get_metadata (mod->player, NULL, MRL_METADATA_TRACK);

    return meta;
 }


deprecate fit rigid

deprecate fit rigid

--- include/igl/fit_rigid.h
+++ include/igl/fit_rigid.h
@@ -8,6 +8,7 @@
 #ifndef IGL_FIT_RIGID_H
 #define IGL_FIT_RIGID_H

+#warning "Deprecated. Use igl/procrustes.h instead"
 #include "igl_inline.h"
 #include <Eigen/Core>
 #include <Eigen/Geometry>


Fix typo

Fix typo

ok krw@

--- scsi/scsi_base.c
+++ scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: scsi_base.c,v 1.65 2005/04/05 12:13:16 krw Exp $	*/
+/*	$OpenBSD: scsi_base.c,v 1.66 2005/04/17 18:55:45 tom Exp $	*/
 /*	$NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $	*/

 /*
@@ -1165,7 +1165,7 @@
 	{ 0x3B, 0x07, "Failed To Sense Bottom-Of-Form" },
 	{ 0x3B, 0x08, "Reposition Error" },
 	{ 0x3B, 0x09, "Read Past End Of Medium" },
-	{ 0x3B, 0x0A, "Read Past Begining Of Medium" },
+	{ 0x3B, 0x0A, "Read Past Beginning Of Medium" },
 	{ 0x3B, 0x0B, "Position Past End Of Medium" },
 	{ 0x3B, 0x0C, "Position Past Beginning Of Medium" },
 	{ 0x3B, 0x0D, "Medium Destination Element Full" },


Resolve a theoretical error leak in ra_serf's update logic. (Found by review,
not by reproducing)

* subversion/libsvn_ra_serf/update.c
  (finish_report): Don't leak pending errors when the time is up.

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

--- subversion/libsvn_ra_serf/update.c
+++ subversion/libsvn_ra_serf/update.c
@@ -2947,8 +2947,10 @@
          the connection timed out.  */
       if (APR_STATUS_IS_TIMEUP(status))
         {
-          svn_error_clear(err);
-          err = SVN_NO_ERROR;
+          /* If there is a pending error, handle it.
+             Unlikely case, as this should have made serf_context run return
+             an error but we shouldn't ignore true errors */
+          SVN_ERR(err);
           status = 0;

           if (sess->timeout)


Switched to using boost::recursive_mutex.

--- include/kNet/Lockable.h
+++ include/kNet/Lockable.h
@@ -17,13 +17,16 @@
 	@brief The Lock<T> and Lockable<T> template classes. */

 #ifdef KNET_USE_BOOST
-#include <boost/thread/mutex.hpp>
+#include <boost/thread/recursive_mutex.hpp>
 #include <boost/thread/thread.hpp>
 #elif WIN32
 #include <Windows.h>
 #else
 #error No Mutex implementation available!
 #endif
+
+#include "PolledTimer.h"
+#include "NetworkLogging.h"

 namespace kNet
 {
@@ -236,7 +239,7 @@
 	}

 #ifdef KNET_USE_BOOST
-	mutable boost::mutex boostMutex;
+	mutable boost::recursive_mutex boostMutex;
 #elif WIN32
 	mutable CRITICAL_SECTION lockObject;
 #endif


* subversion/libsvn_repos/reporter.c
  (delta_dirs): Follow up to r28022 with a comment fix.

Review by: glasser

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

--- subversion/libsvn_repos/reporter.c
+++ subversion/libsvn_repos/reporter.c
@@ -952,7 +952,8 @@
           if (!name)
             break;

-          /* Invalid revnum means either delete or excluded subpath. */
+          /* Invalid revnum means we should delete, unless this is
+             just an excluded subpath. */
           if (info
               && !SVN_IS_VALID_REVNUM(info->rev)
               && info->depth != svn_depth_exclude)


Should correct ppc compilation failure reported by Glauber de Oliveira Costa. Couldn't test it though on ppc.

--- include/libc-internal.h
+++ include/libc-internal.h
@@ -100,6 +100,9 @@
 # define attribute_relro
 #endif

+/* Pull in things like __attribute_used__ */
+#include <sys/cdefs.h>
+
 /* --- this is added to integrate linuxthreads */
 #define __USE_UNIX98            1


* libsvn_repos/reporter.c

* libsvn_repos/reporter.c

  (svn_repos_delete_path): Oops!  FS functions take c-strings, not
  svn_string_t's.

--- subversion/libsvn_repos/reporter.c
+++ subversion/libsvn_repos/reporter.c
@@ -135,7 +135,8 @@

   /* Remove the file or directory (recursively) from the txn. */
-  SVN_ERR (svn_fs_delete_tree (rbaton->txn_root, delete_path, rbaton->pool));
+  SVN_ERR (svn_fs_delete_tree (rbaton->txn_root, delete_path->data,
+                               rbaton->pool));

   return SVN_NO_ERROR;
 }


dma-buf: remove fallback for !CONFIG_DMA_SHARED_BUFFER

Documentation says that code requiring dma-buf should add it to
select, so inline fallbacks are not going to be used. A link error
will make it obvious what went wrong, instead of silently doing
nothing at runtime.

Signed-off-by: Maarten Lankhorst <743c2818a341d71b99ed2b566f9f80c2fc288f93@canonical.com>
Reviewed-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>
Reviewed-by: Rob Clark <e4b68ba543616fa01f7d35cc4057ddf9f04ce2e6@linaro.org>
Signed-off-by: Sumit Semwal <d6930da0d649c01d063dcca4d796c2ac2cbb68ba@linaro.org>

--- include/linux/dma-buf.h
+++ include/linux/dma-buf.h
@@ -156,7 +156,6 @@
 	get_file(dmabuf->file);
 }

-#ifdef CONFIG_DMA_SHARED_BUFFER
 struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
 							struct device *dev);
 void dma_buf_detach(struct dma_buf *dmabuf,
@@ -184,103 +183,5 @@
 		 unsigned long);
 void *dma_buf_vmap(struct dma_buf *);
 void dma_buf_vunmap(struct dma_buf *, void *vaddr);
-#else
-
-static inline struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
-							struct device *dev)
-{
-	return ERR_PTR(-ENODEV);
-}
-
-static inline void dma_buf_detach(struct dma_buf *dmabuf,
-				  struct dma_buf_attachment *dmabuf_attach)
-{
-	return;
-}
-
-static inline struct dma_buf *dma_buf_export(void *priv,
-					     const struct dma_buf_ops *ops,
-					     size_t size, int flags)
-{
-	return ERR_PTR(-ENODEV);
-}
-
-static inline int dma_buf_fd(struct dma_buf *dmabuf, int flags)
-{
-	return -ENODEV;
-}
-
-static inline struct dma_buf *dma_buf_get(int fd)
-{
-	return ERR_PTR(-ENODEV);
-}
-
-static inline void dma_buf_put(struct dma_buf *dmabuf)
-{
-	return;
-}
-
-static inline struct sg_table *dma_buf_map_attachment(
-	struct dma_buf_attachment *attach, enum dma_data_direction write)
-{
-	return ERR_PTR(-ENODEV);
-}
-
-static inline void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
-			struct sg_table *sg, enum dma_data_direction dir)
-{
-	return;
-}
-
-static inline int dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
-					   size_t start, size_t len,
-					   enum dma_data_direction dir)
-{
-	return -ENODEV;
-}
-
-static inline void dma_buf_end_cpu_access(struct dma_buf *dmabuf,
-					  size_t start, size_t len,
-					  enum dma_data_direction dir)
-{
-}
-
-static inline void *dma_buf_kmap_atomic(struct dma_buf *dmabuf,
-					unsigned long pnum)
-{
-	return NULL;
-}
-
-static inline void dma_buf_kunmap_atomic(struct dma_buf *dmabuf,
-					 unsigned long pnum, void *vaddr)
-{
-}
-
-static inline void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long pnum)
-{
-	return NULL;
-}
-
-static inline void dma_buf_kunmap(struct dma_buf *dmabuf,
-				  unsigned long pnum, void *vaddr)
-{
-}
-
-static inline int dma_buf_mmap(struct dma_buf *dmabuf,
-			       struct vm_area_struct *vma,
-			       unsigned long pgoff)
-{
-	return -ENODEV;
-}
-
-static inline void *dma_buf_vmap(struct dma_buf *dmabuf)
-{
-	return NULL;
-}
-
-static inline void dma_buf_vunmap(struct dma_buf *dmabuf, void *vaddr)
-{
-}
-#endif /* CONFIG_DMA_SHARED_BUFFER */

 #endif /* __DMA_BUF_H__ */


* subversion/libsvn_repos/rev_hunt.c
  (svn_repos_get_committed_info): use sizeof() instead of magic numbers

Suggested by: danielsh

--- subversion/libsvn_repos/rev_hunt.c
+++ subversion/libsvn_repos/rev_hunt.c
@@ -173,10 +173,10 @@
   /* Extract date and author from these revprops. */
   committed_date_s = apr_hash_get(revprops,
                                   SVN_PROP_REVISION_DATE,
-                                  8);
+                                  sizeof(SVN_PROP_REVISION_DATE)-1);
   last_author_s = apr_hash_get(revprops,
                                SVN_PROP_REVISION_AUTHOR,
-                               10);
+                               sizeof(SVN_PROP_REVISION_AUTHOR)-1);

   *committed_date = committed_date_s ? committed_date_s->data : NULL;
   *last_author = last_author_s ? last_author_s->data : NULL;


Missed this bit.

Missed this bit.

--- include/mupdf/content.h
+++ include/mupdf/content.h
@@ -47,6 +47,7 @@
 	/* materials */
 	pdf_material stroke;
 	pdf_material fill;
+	fz_blendkind blendmode;

 	/* text state */
 	float charspace;


* subversion/libsvn_subr/mergeinfo.c
  (svn_mergeinfo__catalog_to_formatted_string): Fix the check for SVN_DEBUG.

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

--- subversion/libsvn_subr/mergeinfo.c
+++ subversion/libsvn_subr/mergeinfo.c
@@ -2359,7 +2359,7 @@
           svn_stringbuf_appendcstr(output_buf, "\n");
         }
     }
-#if SVN_DEBUG
+#ifdef SVN_DEBUG
   else if (!catalog)
     {
       output_buf = svn_stringbuf_create(key_prefix ? key_prefix : "", pool);


Change NDArray function registry to function pointers

--- include/mxnet/ndarray.h
+++ include/mxnet/ndarray.h
@@ -467,10 +467,10 @@
    * \param fsetvalue function body to set
    * \return ref to the registered entry, used to set properties
    */
-  inline NDArrayFunctionReg &set_function(void fsetvalue(const real_t &rhs,
-                                                         NDArray *out)) {
+  inline NDArrayFunctionReg &set_function(void (*fsetvalue)(const real_t &rhs,
+                                                            NDArray *out)) {
     body = [fsetvalue] (NDArray **used_vars, real_t *s, NDArray **mutate_vars) {
-      fsetvalue(s[0], mutate_vars[0]);
+      (*fsetvalue)(s[0], mutate_vars[0]);
     };
     num_mutate_vars = 1; num_scalars = 1;
     this->add_argument("src", "real_t", "Source input to the function.");
@@ -482,12 +482,12 @@
    * \param fbinary function body to set
    * \return ref to the registered entry, used to set properties
    */
-  inline NDArrayFunctionReg &set_function(void fbinary(const NDArray &lhs,
-                                                       const NDArray &rhs,
-                                                       NDArray *out)) {
+  inline NDArrayFunctionReg &set_function(void (*fbinary)(const NDArray &lhs,
+                                                          const NDArray &rhs,
+                                                          NDArray *out)) {
     body = [fbinary] (NDArray **used_vars,
                       real_t *s, NDArray **mutate_vars) {
-      fbinary(*used_vars[0], *used_vars[1], mutate_vars[0]);
+      (*fbinary)(*used_vars[0], *used_vars[1], mutate_vars[0]);
     };
     num_use_vars = 2; num_mutate_vars = 1;
     type_mask = kNDArrayArgBeforeScalar | kAcceptEmptyMutateTarget;
@@ -501,12 +501,12 @@
    * \param fscalar function body to set
    * \return ref to the registered entry, used to set properties
    */
-  inline NDArrayFunctionReg &set_function(void fscalar(const NDArray &lhs,
-                                                       const real_t &rhs,
-                                                       NDArray *out)) {
+  inline NDArrayFunctionReg &set_function(void (*fscalar)(const NDArray &lhs,
+                                                          const real_t &rhs,
+                                                          NDArray *out)) {
     body = [fscalar] (NDArray **used_vars,
                       real_t *s, NDArray **mutate_vars) {
-      fscalar(*used_vars[0], s[0], mutate_vars[0]);
+      (*fscalar)(*used_vars[0], s[0], mutate_vars[0]);
     };
     num_use_vars = 1; num_mutate_vars = 1; num_scalars = 1;
     type_mask = kNDArrayArgBeforeScalar | kAcceptEmptyMutateTarget;
@@ -520,11 +520,11 @@
    * \param funary function body to set
    * \return ref to the registered entry, used to set properties
    */
-  inline NDArrayFunctionReg &set_function(void funary(const NDArray &src,
-                                                      NDArray *out)) {
+  inline NDArrayFunctionReg &set_function(void (*funary)(const NDArray &src,
+                                                         NDArray *out)) {
     body = [funary] (NDArray **used_vars,
                      real_t *s, NDArray **mutate_vars) {
-      funary(*used_vars[0], mutate_vars[0]);
+      (*funary)(*used_vars[0], mutate_vars[0]);
     };
     num_use_vars = 1; num_mutate_vars = 1;
     type_mask = kNDArrayArgBeforeScalar | kAcceptEmptyMutateTarget;


On 'svn-auth-x509' branch: Don't dereference pointers that might be outside the
length of the buffer.

* subversion/libsvn_subr/x509parse.c
  (x509_get_name, x509_get_date, x509_get_sig, x509_get_uid): Don't retrieve
    the tag from the pointer before checking the length, which asn1_get_tag()
    does for us.  It also compares the tag to the one we ask for, so where
    we want to store the tag, store it explicilty rather than from the tag.

Found by: philip

git-svn-id: f69d95e79bd5010e6e46130ecc63a181c542bb30@1635357 13f79535-47bb-0310-9956-ffa450edef68

--- subversion/libsvn_subr/x509parse.c
+++ subversion/libsvn_subr/x509parse.c
@@ -314,12 +314,12 @@
     }

   oid = &cur->oid;
-  oid->tag = **p;

   err = asn1_get_tag(p, end, &oid->len, ASN1_OID);
   if (err)
     return svn_error_create(SVN_ERR_X509_CERT_INVALID_NAME, err, NULL);

+  oid->tag = ASN1_OID;
   oid->p = *p;
   *p += oid->len;

@@ -384,13 +384,16 @@
   apr_time_exp_t xt = { 0 };
   char tz;

-  tag = **p;
   err = asn1_get_tag(p, end, &len, ASN1_UTC_TIME);
   if (err && err->apr_err == SVN_ERR_ASN1_UNEXPECTED_TAG)
     {
       svn_error_clear(err);
-      tag = **p;
       err = asn1_get_tag(p, end, &len, ASN1_GENERALIZED_TIME);
+      tag = ASN1_GENERALIZED_TIME;
+    }
+  else
+    {
+      tag = ASN1_UTC_TIME;
     }
   if (err)
     return svn_error_create(SVN_ERR_X509_CERT_INVALID_DATE, err, NULL);
@@ -493,11 +496,11 @@
   svn_error_t *err;
   ptrdiff_t len;

-  sig->tag = **p;
-
   err = asn1_get_tag(p, end, &len, ASN1_BIT_STRING);
   if (err)
     return svn_error_create(SVN_ERR_X509_CERT_INVALID_SIGNATURE, err, NULL);
+
+  sig->tag = ASN1_BIT_STRING;

   if (--len < 1 || *(*p)++ != 0)
     return svn_error_create(SVN_ERR_X509_CERT_INVALID_SIGNATURE, NULL, NULL);
@@ -521,8 +524,6 @@

   if (*p == end)
     return SVN_NO_ERROR;
-
-  uid->tag = **p;

   err = asn1_get_tag(p, end, &uid->len,
                      ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED | n);
@@ -537,6 +538,7 @@
       return svn_error_trace(err);
     }

+  uid->tag = ASN1_CONTEXT_SPECIFIC | ASN1_CONSTRUCTED | n;
   uid->p = *p;
   *p += uid->len;