cfg80211: use the correct macro to check for active monitor support

Use MONITOR_FLAG_ACTIVE, which is a flag mask, instead of
NL80211_MNTR_FLAG_ACTIVE, which is a flag index, when checking if the
hardware supports active monitoring.

Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Signed-off-by: Luciano Coelho <48024ebf6407f04843f8b4062a045f41623c6d61@intel.com>
Signed-off-by: Johannes Berg <bff32994ff0f8d048f262a8388145a71b6071bfe@intel.com>

--- net/wireless/nl80211.c
+++ net/wireless/nl80211.c
@@ -2421,7 +2421,7 @@
 		change = true;
 	}

-	if (flags && (*flags & NL80211_MNTR_FLAG_ACTIVE) &&
+	if (flags && (*flags & MONITOR_FLAG_ACTIVE) &&
 	    !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR))
 		return -EOPNOTSUPP;

@@ -2483,7 +2483,7 @@
 				  info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL,
 				  &flags);

-	if (!err && (flags & NL80211_MNTR_FLAG_ACTIVE) &&
+	if (!err && (flags & MONITOR_FLAG_ACTIVE) &&
 	    !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR))
 		return -EOPNOTSUPP;


fix unloaded ino_extras crash

fix unloaded ino_extras crash

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@20561 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/mds.c
+++ slashd/mds.c
@@ -1158,11 +1158,7 @@
 	 * match is found then verify the sequence number matches.
 	 */
 	if ((bml->bml_flags & BML_WRITE) && !bmi->bmdsi_writers) {
-		sl_replica_t iosv[SL_MAX_REPLICAS];
-		struct slm_update_data *upd;
-		struct bmap_ios_assign bia;
 		int retifset[NBREPLST];
-		unsigned j;

 		if (b->bcm_flags & BMAP_MDS_NOION) {
 			psc_assert(!bmi->bmdsi_assign);
@@ -1178,6 +1174,8 @@
 			goto out;

 		if (!(bml->bml_flags & BML_RECOVERFAIL)) {
+			struct bmap_ios_assign bia;
+
 			rc = mds_odtable_getitem(mdsBmapAssignTable,
 			    bmi->bmdsi_assign, &bia, sizeof(bia));
 			psc_assert(!rc && bia.bia_seq == bmi->bmdsi_seq);
@@ -1192,22 +1190,47 @@
 		bmi->bmdsi_wr_ion = NULL;

 		/*
-		 * Lease has been released; requeue any replication work
-		 * involving this bmap.
+		 * Check if any replication work is ready and queue it
+		 * up.
 		 */
 		brepls_init(retifset, 0);
 		retifset[BREPLST_REPL_QUEUED] = 1;
 		retifset[BREPLST_TRUNCPNDG] = 1;
-//		retifset[BREPLST_GARBAGE] = 1;
 		if (mds_repl_bmap_walk_all(b, NULL, retifset,
 		    REPL_WALKF_SCIRCUIT)) {
+			sl_replica_t iosv[SL_MAX_REPLICAS];
+			struct slm_update_data *upd;
+			int k, off, val;
+			unsigned j, nr;
+
+			if (!FCMH_HAS_BUSY(f))
+				BMAP_ULOCK(b);
+			FCMH_WAIT_BUSY(f);
+			BMAP_WAIT_BUSY(b);
+
 			upd = &bmi->bmi_upd;
 			UPD_WAIT(upd);
-			for (j = 0; j < fcmh_2_nrepls(f); j++)
-				iosv[j].bs_id = fcmh_getrepl(f,
-				    j).bs_id;
-			upsch_enqueue(upd, iosv, fcmh_2_nrepls(f));
+			nr = fcmh_2_nrepls(f);
+			for (j = k = 0; j < nr;
+			    j++, off += SL_BITS_PER_REPLICA) {
+				val = SL_REPL_GET_BMAP_IOS_STAT(
+				    b->bcm_repls, off);
+				if (val == BREPLST_REPL_QUEUED ||
+				    val == BREPLST_TRUNCPNDG) {
+					if (j >= SL_DEF_REPLICAS)
+						mds_inox_ensure_loaded(
+						    fcmh_2_inoh(f));
+					iosv[k++].bs_id =
+					    fcmh_getrepl(f, j).bs_id;
+				}
+			}
+			if (k)
+				upsch_enqueue(upd, iosv, k);
 			UPD_UNBUSY(upd);
+			BMAP_UNBUSY(b);
+			FCMH_UNBUSY(f);
+
+			BMAP_LOCK(b);
 		}
 	}

@@ -1220,7 +1243,7 @@
 		key = odtr->odtr_key;
 		elem = odtr->odtr_elem;
 		rc = mds_odtable_freeitem(mdsBmapAssignTable, odtr);
-		DEBUG_BMAP(PLL_NOTIFY, b, "odtable remove seq=%"PRId64" "
+		DEBUG_BMAP(PLL_DIAG, b, "odtable remove seq=%"PRId64" "
 		    "key=%#"PRIx64" rc=%d", bml->bml_seq, key, rc);
 		bmap_op_done_type(b, BMAP_OPCNT_IONASSIGN);


Make StateRef operator bool() conversion explicit

This means a lot of casts to 'basic types' (e.g. ints) would succeed via
'bool', which is clearly wrong.

--- game/state/stateobject.h
+++ game/state/stateobject.h
@@ -115,7 +115,7 @@
 		resolve();
 		return obj;
 	}
-	operator const bool() const
+	explicit operator const bool() const
 	{
 		resolve();
 		return !!obj;
@@ -165,12 +165,12 @@
 		id = newId;
 		return *this;
 	}
-
 	sp<T> getSp() const
 	{
 		resolve();
 		return obj;
 	}
+	const bool operator<(const StateRef<T> other) const { return this->id < other.id; }
 };

 } // namespace OpenApoc


Fix some warnings

Fix some warnings

--- m-c-mempool.h
+++ m-c-mempool.h
@@ -578,7 +578,7 @@
 } m_gc_t[1];

 static inline void
-m_gc_init(m_gc_t gc_mem, unsigned long max_thread)
+m_gc_init(m_gc_t gc_mem, size_t max_thread)
 {
   assert(gc_mem != NULL);
   assert(max_thread > 0 && max_thread < INT_MAX);
@@ -752,7 +752,7 @@
 static inline void
 m_vlapool_init(m_vlapool_t mem, m_gc_t gc_mem)
 {
-  const unsigned long max_thread =  gc_mem->max_thread;
+  const size_t max_thread =  gc_mem->max_thread;

   /* Initialize the thread data of the vlapool */
   mem->thread_data = M_MEMORY_REALLOC(m_vlapool_lfmp_thread_t, NULL, max_thread);


Fix tab

Fix tab


include F1HD in FSMC setup. #64

include F1HD in FSMC setup. #64

--- lib/include/display/graphic/tft/ssd1963/SSD1963.h
+++ lib/include/display/graphic/tft/ssd1963/SSD1963.h
@@ -73,7 +73,7 @@

       // slow down the device for the register setup

-#if defined (STM32F40_41xxx)
+#if defined (STM32F40_41xxx) || defined(STM32PLUS_F1_HD)
       FSMC_Bank1->BTCR[FSMC_Bank+1] = FSMC_BTR1_ADDSET_0 | FSMC_BTR1_DATAST_2 | FSMC_BTR1_BUSTURN_0 ;
       FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
 #endif


pipe: update IO-related system calls to support pipe() emulation

Signed-off-by: Joey Pabalinas <1140aba59ea685f414bfdf5c263f34bcec3b5f4c@gmail.com>

--- src/trusted/service_runtime/nacl_syscall_common.c
+++ src/trusted/service_runtime/nacl_syscall_common.c
@@ -856,18 +856,24 @@
            "%"NACL_PRIdS"[0x%"NACL_PRIxS"])\n",
           (uintptr_t) natp, d, (uintptr_t) buf, count, count);

+  /* check for closed fds */
+  if (fd < 0) {
+    retval = -NACL_ABI_EBADF;
+    goto out;
+  }
+
   ndp = NaClGetDesc(nap, fd);
   NaClLog(2, " ndp = %"NACL_PRIxPTR"\n", (uintptr_t) ndp);
   if (!ndp) {
     retval = -NACL_ABI_EBADF;
-    goto cleanup;
+    goto out;
   }

   sysaddr = NaClUserToSysAddrRange(nap, (uintptr_t) buf, count);
   if (kNaClBadAddress == sysaddr) {
     NaClDescUnref(ndp);
     retval = -NACL_ABI_EFAULT;
-    goto cleanup;
+    goto out;
   }

   /*
@@ -883,13 +889,39 @@
                     (uint32_t) (uintptr_t) buf,
                     (uint32_t) (((uintptr_t) buf) + count - 1));
   read_result = ((struct NaClDescVtbl const *)ndp->base.vtbl)->Read(ndp, (void *)sysaddr, count);
+
   /* special case for pipe() */
   if (read_result == -NACL_ABI_ENOSYS) {
-    read_result = read(fd, (void *)sysaddr, count);
-    if (read_result < 0) {
-      read_result = -errno;
-    }
-  }
+    read_result = 0;
+    NaClFastMutexLock(&pipe_table[fd].mu);
+    pipe_table[fd].xfer_done = false;
+    if (pipe_table[fd].is_closed) {
+        read_result = -NACL_ABI_EBADFD;
+        goto fd_closed;
+    }
+    NaClFastMutexUnlock(&pipe_table[fd].mu);
+    for (;;) {
+      ssize_t ret;
+      if ((ret = read(fd, (void *)sysaddr, count - read_result)) < 0) {
+        if (errno == EINTR || errno == EAGAIN) {
+          continue;
+        }
+        /* error during write() */
+        read_result = -errno;
+        break;
+      }
+      /* done reading */
+      if (!ret) {
+        break;
+      }
+      read_result += ret;
+    }
+    NaClFastMutexLock(&pipe_table[fd].mu);
+fd_closed:
+    pipe_table[fd].xfer_done = true;
+    NaClFastMutexUnlock(&pipe_table[fd].mu);
+  }
+
   NaClVmIoHasEnded(nap,
                     (uint32_t) (uintptr_t) buf,
                     (uint32_t) (((uintptr_t) buf) + count - 1));
@@ -915,7 +947,7 @@

   /* This cast is safe because we clamped count above.*/
   retval = (int32_t) read_result;
-cleanup:
+out:
   return retval;
 }

@@ -941,14 +973,14 @@
   NaClLog(2, " ndp = %"NACL_PRIxPTR"\n", (uintptr_t) ndp);
   if (!ndp) {
     retval = -NACL_ABI_EBADF;
-    goto cleanup;
+    goto out;
   }

   sysaddr = NaClUserToSysAddrRange(nap, (uintptr_t) buf, count);
   if (kNaClBadAddress == sysaddr) {
     NaClDescUnref(ndp);
     retval = -NACL_ABI_EFAULT;
-    goto cleanup;
+    goto out;
   }

   /*
@@ -975,13 +1007,39 @@
                     (uint32_t)(uintptr_t)buf,
                     (uint32_t)(((uintptr_t)buf) + count - 1));
   write_result = ((struct NaClDescVtbl const *)ndp->base.vtbl)->Write(ndp, (void *)sysaddr, count);
+
   /* special case for pipe() */
   if (write_result == -NACL_ABI_ENOSYS) {
-    write_result = write(fd, (void *)sysaddr, count);
-    if (write_result < 0) {
-      write_result = -errno;
-    }
-  }
+    write_result = 0;
+    NaClFastMutexLock(&pipe_table[fd].mu);
+    pipe_table[fd].xfer_done = false;
+    if (pipe_table[fd].is_closed) {
+        write_result = -NACL_ABI_EBADFD;
+        goto fd_closed;
+    }
+    NaClFastMutexUnlock(&pipe_table[fd].mu);
+    for (;;) {
+      ssize_t ret;
+      if ((ret = write(fd, (void *)sysaddr, count - write_result)) < 0) {
+        if (errno == EINTR || errno == EAGAIN) {
+          continue;
+        }
+        /* error during write() */
+        write_result = -errno;
+        break;
+      }
+      /* done writing */
+      if (!ret) {
+        break;
+      }
+      write_result += ret;
+    }
+    NaClFastMutexLock(&pipe_table[fd].mu);
+fd_closed:
+    pipe_table[fd].xfer_done = true;
+    NaClFastMutexUnlock(&pipe_table[fd].mu);
+  }
+
   NaClVmIoHasEnded(nap,
                    (uint32_t)(uintptr_t)buf,
                    (uint32_t)(((uintptr_t)buf) + count - 1));
@@ -991,7 +1049,7 @@
   /* This cast is safe because we clamped count above.*/
   retval = (int32_t)write_result;

-cleanup:
+out:
   return retval;
 }

@@ -1016,15 +1074,21 @@

   fd = fd_cage_table[nap->cage_id][d];

+  /* check for closed fds */
+  if (fd < 0) {
+    retval = -NACL_ABI_EBADF;
+    goto out;
+  }
+
   ndp = NaClGetDesc(nap, fd);
   if (!ndp) {
     retval = -NACL_ABI_EBADF;
-    goto cleanup;
+    goto out;
   }

   if (!NaClCopyInFromUser(nap, &offset, (uintptr_t) offp, sizeof offset)) {
     retval = -NACL_ABI_EFAULT;
-    goto cleanup_unref;
+    goto out_unref;
   }
   NaClLog(4, "offset 0x%08"NACL_PRIxNACL_OFF"\n", offset);

@@ -1040,9 +1104,9 @@
               "NaClSysLseek: in/out ptr became invalid at copyout?\n");
     }
   }
-cleanup_unref:
+out_unref:
   NaClDescUnref(ndp);
-cleanup:
+out:
   return retval;
 }

@@ -1077,6 +1141,12 @@

   fd = fd_cage_table[nap->cage_id][d];

+  /* check for closed fds */
+  if (fd < 0) {
+    retval = -NACL_ABI_EBADF;
+    goto cleanup;
+  }
+
   ndp = NaClGetDesc(nap, fd);
   if (!ndp) {
     NaClLog(2, "%s\n", "bad desc");
@@ -1128,6 +1198,12 @@
           sizeof *nasp, sizeof *nasp);

   fd = fd_cage_table[nap->cage_id][d];
+
+  /* check for closed fds */
+  if (fd < 0) {
+    retval = -NACL_ABI_EBADF;
+    goto cleanup;
+  }

   ndp = NaClGetDesc(nap, fd);
   if (!ndp) {
@@ -3862,11 +3938,15 @@
       ret = -NACL_ABI_EFAULT;
       goto out;
     }
+
+    /* setup pipe table entry */
+    NaClFastMutexLock(&pipe_table[pipe_fds[i]].mu);
+    pipe_table[pipe_fds[i]].is_closed = false;
     ndp = NaClDescIoDescFromDescAllocCtor(pipe_fds[i], flags);
     NaClSetDesc(nap, pipe_fds[i], ndp);
     fd_cage_table[nap->cage_id][nap->fd] = pipe_fds[i];
-    nacl_fds[i] = nap->fd;
-    nap->fd++;
+    nacl_fds[i] = nap->fd++;
+    NaClFastMutexUnlock(&pipe_table[pipe_fds[i]].mu);
   }

   /* copy out sanitized fds */


net: Set the ll src and dst addresses in ethernet l2 driver

When packet is received, we set the pointers to ethernet
source and destination addresses.

Change-Id: Ia8795849d8be30e8230e27b1a8d95dd7f334427a
Signed-off-by: Jukka Rissanen <f9f077d1da4c7aa947f9864fa5a28c3588f6a45d@linux.intel.com>

--- net/yaip/l2/ethernet.c
+++ net/yaip/l2/ethernet.c
@@ -23,6 +23,7 @@
 				      struct net_buf *buf)
 {
 	struct net_eth_hdr *hdr = NET_ETH_BUF(buf);
+	struct net_linkaddr *lladdr;

 	switch (ntohs(hdr->type)) {
 	case NET_ETH_PTYPE_IP:
@@ -33,6 +34,15 @@
 		net_nbuf_family(buf) = AF_INET6;
 		break;
 	}
+
+	/* Set the pointers to ll src and dst addresses */
+	lladdr = net_nbuf_ll_src(buf);
+	lladdr->addr = ((struct net_eth_hdr *)net_nbuf_ll(buf))->src.addr;
+	lladdr->len = sizeof(struct net_eth_hdr);
+
+	lladdr = net_nbuf_ll_dst(buf);
+	lladdr->addr = ((struct net_eth_hdr *)net_nbuf_ll(buf))->dst.addr;
+	lladdr->len = sizeof(struct net_eth_hdr);

 #ifdef CONFIG_NET_ARP
 	if (net_nbuf_family(buf) == AF_INET &&


Remove replication queuing logic in the bmap release logic.

--- slashd/mds.c
+++ slashd/mds.c
@@ -1235,8 +1235,6 @@
 	 * match is found then verify the sequence number matches.
 	 */
 	if ((bml->bml_flags & BML_WRITE) && !bmi->bmi_writers) {
-		int retifset[NBREPLST];
-
 		if (bmi->bmi_assign) {
 			struct bmap_ios_assign *bia;

@@ -1264,31 +1262,6 @@
 		if (bmi->bmi_wr_ion) {
 			psc_atomic32_dec(&bmi->bmi_wr_ion->rmmi_refcnt);
 			bmi->bmi_wr_ion = NULL;
-		}
-
-		/*
-		 * Check if any replication work is ready and queue it
-		 * up.
-		 */
-		brepls_init(retifset, 0);
-		retifset[BREPLST_REPL_QUEUED] = 1;
-		retifset[BREPLST_TRUNC_QUEUED] = 1;
-
-		if (mds_repl_bmap_walk_all(b, NULL, retifset,
-		    REPL_WALKF_SCIRCUIT)) {
-			struct slm_update_data *upd;
-			int qifset[NBREPLST];
-
-			if (fcmh_2_nrepls(f) > SL_DEF_REPLICAS)
-				mds_inox_ensure_loaded(fcmh_2_inoh(f));
-			brepls_init(qifset, 0);
-			qifset[BREPLST_REPL_QUEUED] = 1;
-			qifset[BREPLST_TRUNC_QUEUED] = 1;
-
-			upd = &bmi->bmi_upd;
-			if (mds_repl_bmap_walk_all(b, NULL, qifset,
-			    REPL_WALKF_SCIRCUIT))
-				upsch_enqueue(upd);
 		}
 	}


Fix incorrect calling convention for wglGetProcAddress

--- lib/Remotery.c
+++ lib/Remotery.c
@@ -6032,12 +6032,12 @@
     #if defined(RMT_PLATFORM_WINDOWS)
     {
         // Get OpenGL extension-loading function for each call
-        typedef void* (*wglGetProcAddressFn)(LPCSTR);
+		typedef PROC(WINAPI * wglGetProcAddressFn)(LPCSTR);
         {
             assert(opengl != NULL);
             wglGetProcAddressFn wglGetProcAddress = (wglGetProcAddressFn)rmtGetProcAddress(opengl->dll_handle, "wglGetProcAddress");
             if (wglGetProcAddress != NULL)
-                return wglGetProcAddress(symbol);
+                return (void*)wglGetProcAddress(symbol);
         }
     }


convert slashid -> zfs id in opendir().  Also don't try to convert root slash id - map it to ZFS root directly

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@10533 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- slashd/rmc.c
+++ slashd/rmc.c
@@ -446,11 +446,21 @@
 	struct srm_opendir_req *mq;
 	struct srm_opendir_rep *mp;
 	struct cfdent *cfd = NULL;
+	struct fidc_membh *fcmh;
 	struct slash_fidgen fg;
 	void *mdsio_data;

 	RSX_ALLOCREP(rq, mq, mp);
-	mp->rc = mdsio_opendir(mq->fid, &mq->creds, &fg, &mp->attr,
+
+	fg.fg_fid = mq->fid;
+	fg.fg_gen = FIDGEN_ANY;
+	mp->rc = fidc_lookup(&fg, FIDC_LOOKUP_CREATE |
+	    FIDC_LOOKUP_LOAD, NULL, FCMH_SETATTRF_NONE,
+	    &mq->creds, &fcmh);
+	if (mp->rc)
+		return (0);
+
+	mp->rc = mdsio_opendir(fcmh_2_fmi(fcmh)->fmi_mdsio_fid, &mq->creds, &fg, &mp->attr,
 	    &mdsio_data);
 	psc_info("mdsio_opendir rc=%d data=%p", mp->rc, mdsio_data);
 	if (mp->rc)


Removed 'unused varaible' warning for countThreads when building with RMT_USE_POSIX_THREADNAMES.

--- lib/Remotery.c
+++ lib/Remotery.c
@@ -3750,8 +3750,6 @@

 } ThreadSampler;

-static rmtS32 countThreads = 0;
-
 static rmtError ThreadSampler_Constructor(ThreadSampler* thread_sampler)
 {
     rmtError error;
@@ -3769,6 +3767,7 @@
     #if defined(RMT_PLATFORM_LINUX) && RMT_USE_POSIX_THREADNAMES
     prctl(PR_GET_NAME,thread_sampler->name,0,0,0);
     #else
+    static rmtS32 countThreads = 0;
     strncat_s(thread_sampler->name, sizeof(thread_sampler->name), "Thread", 6);
     itoahex_s(thread_sampler->name + 6, sizeof(thread_sampler->name) - 6, AtomicAdd(&countThreads, 1));
     #endif


Android: dont loose the nanoseconds

Android: dont loose the nanoseconds

--- lib/Remotery.c
+++ lib/Remotery.c
@@ -293,7 +293,7 @@

         struct timespec tv;
         clock_gettime(CLOCK_REALTIME, &tv);
-        timer->counter_start = (rmtU64)(tv.tv_sec * 1000000 + tv.tv_nsec * 0.001);
+        timer->counter_start = (rmtU64)(tv.tv_sec * 1000000) + (rmtU64)(tv.tv_nsec * 0.001);

     #endif
 }
@@ -319,7 +319,7 @@

         struct timespec tv;
         clock_gettime(CLOCK_REALTIME, &tv);
-        return (rmtU64)(tv.tv_sec * 1000000 + tv.tv_nsec * 0.001) - timer->counter_start;
+        return  ((rmtU64)(tv.tv_sec * 1000000) + (rmtU64)(tv.tv_nsec * 0.001)) - timer->counter_start;

     #endif
 }


ints to uints to fix warnings

ints to uints to fix warnings

--- p2core/pel_vm.h
+++ p2core/pel_vm.h
@@ -42,7 +42,7 @@
   std::stack<TupleFieldRef> st;
   const Pel_Program	*prg;
   Error		 error;
-  int		 pc;
+  uint		 pc;
   TuplePtr	 result;
   TuplePtr	 operand;


do not forward packet back into point-to-point link, if the packet has destination address that matches the p2p interface.  this would lead us to pingpong (= chews bandwidth, can be attacked from remote).

--- netinet6/ip6_forward.c
+++ netinet6/ip6_forward.c
@@ -1,5 +1,5 @@
-/*	$OpenBSD: ip6_forward.c,v 1.14 2001/06/09 06:43:38 angelos Exp $	*/
-/*	$KAME: ip6_forward.c,v 1.67 2001/03/29 05:34:31 itojun Exp $	*/
+/*	$OpenBSD: ip6_forward.c,v 1.15 2001/06/22 12:30:34 itojun Exp $	*/
+/*	$KAME: ip6_forward.c,v 1.74 2001/06/12 23:54:55 itojun Exp $	*/

 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -412,8 +412,25 @@
 	 * modified by a redirect.
 	 */
 	if (rt->rt_ifp == m->m_pkthdr.rcvif && !srcrt &&
-	    (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0)
+	    (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) {
+		if ((rt->rt_ifp->if_flags & IFF_POINTOPOINT) != 0) {
+			/*
+			 * If the incoming interface is equal to the outgoing
+			 * one, and the link attached to the interface is
+			 * point-to-point, then it will be highly probable
+			 * that a routing loop occurs. Thus, we immediately
+			 * drop the packet and send an ICMPv6 error message.
+			 *
+			 * type/code is based on suggestion by Rich Draves.
+			 * not sure if it is the best pick.
+			 */
+			icmp6_error(mcopy, ICMP6_DST_UNREACH,
+				    ICMP6_DST_UNREACH_ADDR, 0);
+			m_freem(m);
+			return;
+		}
 		type = ND_REDIRECT;
+	}

 	/*
 	 * Fake scoped addresses. Note that even link-local source or


Make handle_bind_match_data override private.

--- searchlib/src/vespa/searchlib/fef/featureoverrider.h
+++ searchlib/src/vespa/searchlib/fef/featureoverrider.h
@@ -25,6 +25,7 @@
     FeatureHandle       _handle;
     feature_t           _value;

+    virtual void handle_bind_match_data(MatchData &md) override;
 public:
     /**
      * Create a feature overrider that will override the given output
@@ -39,7 +40,6 @@
     void outputs_done() override;
     bool isPure() override;
     void execute(MatchData &data) override;
-    virtual void handle_bind_match_data(MatchData &md) override;
 };

 } // namespace fef


Fix the test-inc-split bug (fingerprints gone wild...).  Fixes #642.

git-svn-id: 4b2652e19d8125fd9d24eff55f31fd1beb5a42e7@3264 c7de825b-a66e-492c-adef-691d508d4ae1

--- newbrt/brt-test-helpers.c
+++ newbrt/brt-test-helpers.c
@@ -73,6 +73,7 @@
 				    toku_brtnode_flush_callback, toku_brtnode_fetch_callback, brt);
     if (r!=0) return r;
     BRTNODE node=node_v;
+    toku_verify_counts(node);
     assert(node->height==0);

     struct kv_pair *kv = brtnode_malloc_kv_pair(node->u.l.buffer, &node->u.l.buffer_mempool, key, keylen, val, vallen);
@@ -85,7 +86,7 @@
     if (r==0) {
 	// It's already there.  So now we have to remove it and put the new one back in.
 	node->u.l.n_bytes_in_buffer -= PMA_ITEM_OVERHEAD + storedlen;
-	node->local_fingerprint     -= toku_crc32(toku_null_crc, storeddata, storedlen);
+	node->local_fingerprint     -= node->rand4fingerprint*toku_calccrc32_kvpair_struct(storeddata);
 	toku_mempool_mfree(&node->u.l.buffer_mempool, storeddata, storedlen);
 	// Now put the new kv in.
 	toku_gpma_set_at_index(node->u.l.buffer, idx, kv_pair_size(kv), kv);
@@ -95,10 +96,13 @@
     }

     node->u.l.n_bytes_in_buffer += PMA_ITEM_OVERHEAD + kv_pair_size(kv);
-    node->local_fingerprint += toku_crc32(toku_null_crc, kv, kv_pair_size(kv));
+    node->local_fingerprint += node->rand4fingerprint*toku_calccrc32_kvpair_struct(kv);

     node->dirty=1;
     *subtree_fingerprint = node->local_fingerprint;
+
+    toku_verify_counts(node);
+
     r = toku_unpin_brtnode(brt, node_v);
     return r;
 }


evas/fonts: Remove warning.

evas/fonts: Remove warning.

git-svn-id: 6d771e449150288cc513807b7f4d2af31e9482bd@72702 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/lib/engines/common/evas_font_draw.c
+++ src/lib/engines/common/evas_font_draw.c
@@ -46,12 +46,10 @@
    length = eina_binbuf_length_get(text_props->bin) / sizeof (Evas_Glyph);
    for (it = 0; it < length; ++it)
      {
-        FT_UInt idx;
         RGBA_Font_Glyph *fg;
         int chr_x, chr_y;

         fg = glyphs[it].fg;
-        idx = glyphs[it].idx;

         glyphs[it].coord.w = fg->glyph_out->bitmap.width;
         glyphs[it].coord.h = fg->glyph_out->bitmap.rows;


Evas font-engine: Fixed ot face loading when loading fonts from memory.

git-svn-id: 24a995eca3b83137dd7eab3408044d7832e202f7@56523 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/lib/engines/common/evas_font_load.c
+++ src/lib/engines/common/evas_font_load.c
@@ -138,6 +138,12 @@
       free(fs);
       return NULL;
     }
+#ifdef OT_SUPPORT
+   if (evas_common_font_ot_is_enabled())
+     {
+        evas_common_font_ot_load_face(fs);
+     }
+#endif
    FTUNLOCK();
    fs->ft.orig_upem = fs->ft.face->units_per_EM;
    fs->references = 1;


Define INITGUID only for mingw.org compiler

Defining INITGUID causes a build failure with mingw-w64 > r5589.

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

--- gdk/win32/gdkdnd-win32.c
+++ gdk/win32/gdkdnd-win32.c
@@ -68,7 +68,11 @@
  *
  */

+/* The mingw.org compiler does not export GUIDS in it's import library. To work
+ * around that, define INITGUID to have the GUIDS declared. */
+#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
 #define INITGUID
+#endif

 #include "gdkdnd.h"
 #include "gdkproperty.h"


fix a bug in LocalSubscriptionOpLoad

fix a bug in LocalSubscriptionOpLoad

--- src/lib/wsman-subscription-repository.c
+++ src/lib/wsman-subscription-repository.c
@@ -115,7 +115,7 @@
 	char *buf = NULL;
 	if(LocalSubscriptionInitFlag == 0) return -1;
 	if(subscription_list == NULL)
-		subscription_list = list_create(LISTCOUNT_T_MAX);
+		return -1;
 	if (0 > (n = scandir (uri_repository, &namelist, 0, alphasort)))
     	{
        	 return -1;
@@ -129,7 +129,6 @@
 			}
 			char *subs_path = u_strdup_printf ("%s/%s", uri_repository, namelist[n]->d_name);
 			FILE *subs = fopen(subs_path, "r");
-			debug("subs_path = %s",subs_path);
 			u_free(subs_path);
 			count = 0;
 			buf = NULL;
@@ -137,15 +136,12 @@
 				memset(block, 0, 512);
 				m = fread(block, 1, 511, subs);
 				if(m > 0) {
-					debug("read [%s] from file, len = %d",block, m);
 					count += m;
-					debug("buf = %0x, count = %d", buf, count);
+					if(count - m == 0)
+						count++;
 					buf = u_realloc(buf, count);
-					if(count - m == 0) {
-						count++;
+					if(count - m == 1)
 						memset(buf, 0, count);
-					}
-					debug("buf = %0x",buf);
 					strcat(buf, block);
 				}
 			}


Bug 597622: map more libpkix errors to SEC_ERROR_BAD_INFO_ACCESS_LOCATION. r=alexei.

--- security/nss/lib/libpkix/include/pkix_errorstrings.h
+++ security/nss/lib/libpkix/include/pkix_errorstrings.h
@@ -610,8 +610,8 @@
 PKIX_ERRORENTRY(INFOACCESSGETLOCATIONFAILED,PKIX_PL_InfoAccess_GetLocation failed,0),
 PKIX_ERRORENTRY(INFOACCESSGETLOCATIONTYPEFAILED,PKIX_PL_InfoAccess_GetLocationType failed,0),
 PKIX_ERRORENTRY(INFOACCESSGETMETHODFAILED,PKIX_PL_InfoAccess_GetMethod failed,0),
-PKIX_ERRORENTRY(INFOACCESSPARSELOCATIONFAILED,pkix_pl_InfoAccess_ParseLocation failed,0),
-PKIX_ERRORENTRY(INFOACCESSPARSETOKENSFAILED,pkix_pl_InfoAccess_ParseTokens failed,0),
+PKIX_ERRORENTRY(INFOACCESSPARSELOCATIONFAILED,pkix_pl_InfoAccess_ParseLocation failed,SEC_ERROR_BAD_INFO_ACCESS_LOCATION),
+PKIX_ERRORENTRY(INFOACCESSPARSETOKENSFAILED,pkix_pl_InfoAccess_ParseTokens failed,SEC_ERROR_BAD_INFO_ACCESS_LOCATION),
 PKIX_ERRORENTRY(INITIALIZECHECKERSFAILED,pkix_InitializeCheckers failed,0),
 PKIX_ERRORENTRY(INITIALIZEFAILED,PKIX_PL_Initialize failed,0),
 PKIX_ERRORENTRY(INPUTLISTMUSTBEHEADER,Input List must be header,SEC_ERROR_INVALID_ARGS),
@@ -732,7 +732,7 @@
 PKIX_ERRORENTRY(NOTARGETCERTSUPPLIED,No target cert supplied,SEC_ERROR_INVALID_ARGS),
 PKIX_ERRORENTRY(NOTCONFORMINGCRLDP,Cert CRL DP does not conform to the rfc, 0),
 PKIX_ERRORENTRY(NOTDERPACKAGE,Not a DER package,0),
-PKIX_ERRORENTRY(NOTENOUGHNAMECOMPONENTSINGENERALNAME,Not enough name components in GeneralName,0),
+PKIX_ERRORENTRY(NOTENOUGHNAMECOMPONENTSINGENERALNAME,Not enough name components in GeneralName,SEC_ERROR_BAD_INFO_ACCESS_LOCATION),
 PKIX_ERRORENTRY(NSSCERTIFICATEUSAGETOPKIXKUANDEKUFAILED,Failed to convert nss certificate usage to pkix ku and eku data structures,0),
 PKIX_ERRORENTRY(NSSCONTEXTCREATEFAILED,PKIX_PL_NssContext_Create failed,0),
 PKIX_ERRORENTRY(NSSCONTEXTDESTROYFAILED,PKIX_PL_NssContext_Destroy failed,0),


fix reference count decreasing

fix reference count decreasing

--- cvmfs/glue_buffer.h
+++ cvmfs/glue_buffer.h
@@ -210,7 +210,7 @@
       atomic_inc64(&statistics_.num_removes);
     }
     Unlock();
-    atomic_xadd64(&statistics_.num_references, -by);
+    atomic_xadd64(&statistics_.num_references, -int32_t(by));
   }

   bool FindPath(const uint64_t inode, PathString *path) {


32 bit port

32 bit port

git-svn-id: 4b2652e19d8125fd9d24eff55f31fd1beb5a42e7@3494 c7de825b-a66e-492c-adef-691d508d4ae1

--- newbrt/brt-serialize.c
+++ newbrt/brt-serialize.c
@@ -200,7 +200,7 @@
     {
 	ssize_t r=pwrite(fd, w.buf, (size_t)node->nodesize, off); // write the whole buffer, including the zeros
 	if (r<0) printf("r=%ld errno=%d\n", (long)r, errno);
-	assert(r==node->nodesize);
+	assert(r==(ssize_t)node->nodesize);
     }

     if (calculated_size!=w.ndone)


branches/zip: Add detailed debugging output to page_zip_compress().

--- page/page0zip.c
+++ page/page0zip.c
@@ -510,6 +510,36 @@
 	return(ut_free(address));
 }

+#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
+/* Set this variable in a debugger to enable
+excessive logging in page_zip_compress(). */
+ibool	page_zip_compress_dbg;
+
+/**************************************************************************
+Wrapper for deflate().  Log the operation if page_zip_compress_dbg is set. */
+static
+ibool
+page_zip_compress_deflate(
+/*======================*/
+	z_streamp	strm,	/* in/out: compressed stream for deflate() */
+	int		flush)	/* in: deflate() flushing method */
+{
+	int	status;
+	if (UNIV_UNLIKELY(page_zip_compress_dbg)) {
+		ut_print_buf(stderr, strm->next_in, strm->avail_in);
+	}
+	status = deflate(strm, flush);
+	if (UNIV_UNLIKELY(page_zip_compress_dbg)) {
+		fprintf(stderr, " -> %d\n", status);
+	}
+	return(status);
+}
+
+/* Redefine deflate(). */
+# undef deflate
+# define deflate page_zip_compress_deflate
+#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
+
 /**************************************************************************
 Compress a page. */

@@ -566,6 +596,14 @@

 	/* The dense directory excludes the infimum and supremum records. */
 	n_dense = page_dir_get_n_heap((page_t*) page) - 2;
+#if defined UNIV_DEBUG || defined UNIV_ZIP_DEBUG
+	if (UNIV_UNLIKELY(page_zip_compress_dbg)) {
+		fprintf(stderr, "compress %p %p %lu %lu %lu\n",
+			(void*) page_zip, (void*) page,
+			page_is_leaf(page),
+			n_fields, n_dense);
+	}
+#endif /* UNIV_DEBUG || UNIV_ZIP_DEBUG */
 	if (UNIV_UNLIKELY(n_dense * PAGE_ZIP_DIR_SLOT_SIZE
 					>= page_zip->size)) {
 		return(FALSE);


bugfix

bugfix

--- ngx_http_gray_module.c
+++ ngx_http_gray_module.c
@@ -200,6 +200,9 @@
     curl_easy_setopt(curl, CURLOPT_URL, URL);
     curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, callback);
     res = curl_easy_perform(curl);
+    if (res) {
+      //
+    }
     curl_easy_cleanup(curl);
     curl_global_cleanup();
     return 0;


Rename the static page_zip_alloc() to page_zip_malloc() to resolve a clash.

--- page/page0zip.c
+++ page/page0zip.c
@@ -475,8 +475,8 @@
 Allocate memory for zlib. */
 static
 void*
-page_zip_alloc(
-/*===========*/
+page_zip_malloc(
+/*============*/
 	void*	opaque __attribute__((unused)),
 	uInt	items,
 	uInt	size)
@@ -571,7 +571,7 @@
 	buf_end = buf + page_zip->size - PAGE_DATA;

 	/* Compress the data payload. */
-	c_stream.zalloc = page_zip_alloc;
+	c_stream.zalloc = page_zip_malloc;
 	c_stream.zfree = page_zip_free;
 	c_stream.opaque = (voidpf) 0;

@@ -1425,7 +1425,7 @@
 	memcpy(page + (PAGE_NEW_SUPREMUM - REC_N_NEW_EXTRA_BYTES + 1),
 		     supremum_extra_data, sizeof supremum_extra_data);

-	d_stream.zalloc = page_zip_alloc;
+	d_stream.zalloc = page_zip_malloc;
 	d_stream.zfree = page_zip_free;
 	d_stream.opaque = (voidpf) 0;


mist::euclidean::thinning -> mist::euclidean::thinning8 に名前を変更．

git-svn-id: 3507153f7f2a502978d43a270f21b34bb2e07470@898 b31369ee-dac5-0310-8161-cccb92f82ee5

--- mist/filter/thinning.h
+++ mist/filter/thinning.h
@@ -134,7 +134,7 @@
 	// C. J. Hilditch, ``Linear Skeleton from Square Cupboards,'' In: Machine Intelligence 6, B. Meltzer and D. Michie eds., Edinburgh Univ. Press, pp.403?420, 1969
 	// eY, ``摜̂߂̃fBW^摜kIIlC'' WCpp.56-59C1988
 	template < class T, class Allocator >
-	void thinning_( array2< T, Allocator > &ia )
+	void thinning( array2< T, Allocator > &ia )
 	{
 		typedef typename array2< T, Allocator >::size_type size_type;
 		typedef typename array2< T, Allocator >::value_type value_type;
@@ -365,7 +365,7 @@
 	//   - ؒq, \, ``ϊ̌ʂ𗘗pl摜̒א,'' dqʐMw_D, vol.68-D, no.4, pp.473-480, 1985.
 	//
 	template < class T, class Allocator >
-	void thinning_( array2< T, Allocator > &ia )
+	void thinning( array2< T, Allocator > &ia )
 	{
 		typedef typename array2< T, Allocator >::size_type size_type;
 		typedef typename array2< T, Allocator >::value_type value_type;
@@ -1317,7 +1317,7 @@
 	}

 	template < class T, class Allocator, class Neighbor >
-	void thinning_( array3< T, Allocator > &in, Neighbor __dmy__ )
+	void thinning( array3< T, Allocator > &in, Neighbor __dmy__ )
 	{
 		typedef typename array3< T, Allocator >::size_type size_type;
 		typedef typename array3< T, Allocator >::difference_type difference_type;
@@ -1987,6 +1987,9 @@
 	//!
 	//! אʂ8AƂȂ
 	//!
+	//! @attention ͂Əo͂摜IuWFNgłאsƂ\ł
+	//! @attention 3摜ɑ΂ēKpꍇ̌ʂ͐Ȃ̂ŒӂKvł
+	//!
 	//! - Ql
 	//!   - C. J. Hilditch, ``Linear Skeleton from Square Cupboards,'' In: Machine Intelligence 6, B. Meltzer and D. Michie eds., Edinburgh Univ. Press, pp.403?420, 1969
 	//!   - eY, ``摜̂߂̃fBW^摜kIIlC'' WCpp.56-59C1988
@@ -2009,7 +2012,7 @@
 			out[ i ] = in[ i ] > 0 ? 1 : 0;
 		}

-		__thinning_controller__::thinning_( out );
+		__thinning_controller__::thinning( out );
 	}

 	/// @}
@@ -2041,7 +2044,7 @@
 	//! @param[out] out c o͉摜
 	//!
 	template < class T1, class T2, class Allocator1, class Allocator2 >
-	void thinning( const array2< T1, Allocator1 > &in, array2< T2, Allocator2 > &out )
+	void thinning8( const array2< T1, Allocator1 > &in, array2< T2, Allocator2 > &out )
 	{
 		typedef typename array2< T2, Allocator2 >::size_type size_type;
 		typedef typename array2< T2, Allocator2 >::value_type value_type;
@@ -2055,7 +2058,7 @@
 			out[ i ] = in[ i ] > 0 ? 1 : 0;
 		}

-		__euclidean_utility__::thinning_( out );
+		__euclidean_utility__::thinning( out );
 	}

@@ -2144,7 +2147,7 @@
 		{
 			out[ i ] = in[ i ] > 0 ? 1 : 0;
 		}
-		__euclidean_utility__::thinning_( out, __euclidean_utility__::neighbor< 6 >( ) );
+		__euclidean_utility__::thinning( out, __euclidean_utility__::neighbor< 6 >( ) );
 	}

@@ -2179,7 +2182,7 @@
 		{
 			out[ i ] = in[ i ] > 0 ? 1 : 0;
 		}
-		__euclidean_utility__::thinning_( out, __euclidean_utility__::neighbor< 26 >( ) );
+		__euclidean_utility__::thinning( out, __euclidean_utility__::neighbor< 26 >( ) );
 	}

 	/// @brief [Nbhp3摜ɑ΂锖ʉASY


add upstream

add upstream

--- ngx_http_gray_module.c
+++ ngx_http_gray_module.c
@@ -46,6 +46,9 @@
 static ngx_int_t gray_upstream_process_header(ngx_http_request_t *r);

 static void gray_upstream_finalize_request(ngx_http_request_t *r, ngx_int_t rc);
+
+static ngx_int_t
+ngx_http_gray_upstream_input_filter(void *data, ssize_t bytes);

 static ngx_str_t  ngx_http_proxy_hide_headers[] =
@@ -327,6 +330,24 @@
   ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, "gray_upstream_finalize_request");
 }

+static ngx_int_t
+ngx_http_gray_upstream_input_filter(void *data, ssize_t bytes)
+{
+    ngx_http_enhanced_memcached_ctx_t  *ctx = data;
+
+    ngx_buf_t            *b;
+    ngx_http_upstream_t  *u;
+
+    u = ctx->request->upstream;
+    b = &u->buffer;
+
+    if (b) {
+      //
+    }
+
+    return NGX_OK;
+}
+
 /**
  * init gray模块
  * @param cf
@@ -404,6 +425,8 @@
   u->create_request = gray_upstream_create_request;
   u->process_header = gray_process_status_line;
   u->finalize_request = gray_upstream_finalize_request;
+  u->input_filter = ngx_http_gray_upstream_input_filter;
+
   r->main->count++;
   ngx_http_upstream_init(r);


gnoe-shell-client: provide keybinding modes

Signed-off-by: Marc-Antoine Perennou <07f76cf0511c79b361712839686f3cee8c75791c@Perennou.com>

--- libgpaste/gnome-shell-client/gpaste-gnome-shell-client.h
+++ libgpaste/gnome-shell-client/gpaste-gnome-shell-client.h
@@ -24,6 +24,45 @@

 G_BEGIN_DECLS

+/* ShellKeyBindingMode stolen from gnome-shell */
+/**
+ * GPasteGnomeShellKeyBindingMode:
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_NONE: block keybinding
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_NORMAL: allow keybinding when in window mode,
+ *     e.g. when the focus is in an application window
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_OVERVIEW: allow keybinding while the overview
+ *     is active
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_LOCK_SCREEN: allow keybinding when the screen
+ *     is locked, e.g. when the screen shield is shown
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_UNLOCK_SCREEN: allow keybinding in the unlock
+ *     dialog
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_LOGIN_SCREEN: allow keybinding in the login screen
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_MESSAGE_TRAY: allow keybinding while the message
+ *     tray is popped up
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_SYSTEM_MODAL: allow keybinding when a system modal
+ *     dialog (e.g. authentification or session dialogs) is open
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_LOOKING_GLASS: allow keybinding in looking glass
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_TOPBAR_POPUP: allow keybinding while a top bar menu
+ *     is open
+ * @G_PASTE_GNOME_SHELL_KEYBINDING_MODE_ALL: always allow keybinding
+ *
+ * Controls in which GNOME Shell states a keybinding should be handled.
+*/
+typedef enum {
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_NONE          = 0,
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_NORMAL        = 1 << 0,
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_OVERVIEW      = 1 << 1,
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_LOCK_SCREEN   = 1 << 2,
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_UNLOCK_SCREEN = 1 << 3,
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_LOGIN_SCREEN  = 1 << 4,
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_MESSAGE_TRAY  = 1 << 5,
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_SYSTEM_MODAL  = 1 << 6,
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_LOOKING_GLASS = 1 << 7,
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_TOPBAR_POPUP  = 1 << 8,
+
+  G_PASTE_GNOME_SHELL_KEYBINDING_MODE_ALL = ~0,
+} GPasteGnomeShellKeyBindingMode;
+
 #define G_PASTE_TYPE_GNOME_SHELL_CLIENT            (g_paste_gnome_shell_client_get_type ())
 #define G_PASTE_GNOME_SHELL_CLIENT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_PASTE_TYPE_GNOME_SHELL_CLIENT, GPasteGnomeShellClient))
 #define G_PASTE_IS_GNOME_SHELL_CLIENT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_PASTE_TYPE_GNOME_SHELL_CLIENT))
@@ -36,8 +75,8 @@

 typedef struct
 {
-    gchar  *accelerator;
-    guint32 flags; // TODO: provide flags
+    const gchar                   *accelerator;
+    GPasteGnomeShellKeyBindingMode flags;
 } GPasteGnomeShellAccelerator;

 G_PASTE_VISIBLE


git-svn-id: http://svn.seqan.de/seqan/trunk@199 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/projects/library/seqan/index/index_esa_stree.h
+++ seqan/projects/library/seqan/index/index_esa_stree.h
@@ -1052,7 +1052,7 @@
 		TIndex const &index = container(it);

 		return (getSeqOffset(pos, stringSetLimits(index)) + repLength(it)
-			== sequenceLength(getSeqNo(pos, stringSetLimits(index)), container(it)));
+			== sequenceLength(getSeqNo(pos, stringSetLimits(index)), index));
 	}

 /**


add arguments

add arguments

--- ngx_http_gray_module.c
+++ ngx_http_gray_module.c
@@ -14,7 +14,7 @@
 typedef struct {
   ngx_str_t    redis_key;
   ngx_str_t    redis_host;
-  ngx_int_t   redis_port;
+  ngx_int_t    redis_port;
 } ngx_http_gray_loc_conf_t;

 ngx_uint_t isGray = 0;
@@ -193,10 +193,8 @@

   redisContext *c;
   redisReply *reply;
-  char *hostname = DEFAULT_REDIS_HOST;
-  hostname = elcf->redis_host.data;
-  int port = DEFAULT_REDIS_PORT;
-  port = elcf->redis_port;
+  const char *hostname = DEFAULT_REDIS_HOST;
+  int port = elcf->redis_port;
   struct timeval timeout = { 1, 500000 }; // 1.5 seconds
   c = redisConnectWithTimeout(hostname, port, timeout);
   if (c == NULL || c->err) {


fixed: assert not defined

fixed: assert not defined

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

--- seqan/projects/library/seqan/sequence/string_alloc.h
+++ seqan/projects/library/seqan/sequence/string_alloc.h
@@ -51,7 +51,7 @@
 	size_t data_capacity;

     void _checkMembers() const {
-        assert(data_begin <= data_end);
+        SEQAN_ASSERT_LEQ(data_begin, data_end, "String end is before begin!");
     }

 //____________________________________________________________________________


Allow more than one option to 'listen'

Allow more than one option to 'listen'

Without this patch, you wouldn't be able to specify e.g.
both so_keepalive and ipv6only, in conflict with the docs.

--- ngx_rtmp_core_module.c
+++ ngx_rtmp_core_module.c
@@ -45,7 +45,7 @@
       NULL },

     { ngx_string("listen"),
-      NGX_RTMP_SRV_CONF|NGX_CONF_TAKE12,
+      NGX_RTMP_SRV_CONF|NGX_CONF_1MORE,
       ngx_rtmp_core_listen,
       NGX_RTMP_SRV_CONF_OFFSET,
       0,


Fix build error on non SSE 4.2 environment (#784)

This will fix following error.

```
compiling ../../../../ext/oj/parse.c
../../../../ext/oj/parse.c:366:28: error: too many arguments to function call, expected single argument 'pi', have 2 arguments
    scan_string_noSIMD(pi, str);
    ~~~~~~~~~~~~~~~~~~     ^~~
../../../../ext/oj/parse.c:330:20: note: 'scan_string_noSIMD' declared here
static inline void scan_string_noSIMD(ParseInfo pi) {
```

--- ext/oj/parse.c
+++ ext/oj/parse.c
@@ -363,7 +363,7 @@
 #if defined(OJ_USE_SSE4_2)
     scan_string_SIMD(pi);
 #else
-    scan_string_noSIMD(pi, str);
+    scan_string_noSIMD(pi);
 #endif
     if (RB_UNLIKELY(pi->end <= pi->cur)) {
         oj_set_error_at(pi,


[fix] fix some memory leak bugs.

[fix] fix some memory leak bugs.

--- ngx_rtmp_live_module.c
+++ ngx_rtmp_live_module.c
@@ -797,7 +797,6 @@
     ngx_rtmp_codec_ctx_t           *codec_ctx;
     ngx_chain_t                    *header, *coheader, *meta,
                                    *apkt, *acopkt, *rpkt;
-    ngx_rtmp_core_srv_conf_t       *cscf;
     ngx_rtmp_live_app_conf_t       *lacf;
     ngx_rtmp_session_t             *ss;
     ngx_rtmp_header_t               ch, lh, clh;
@@ -863,8 +862,6 @@
     prio = (h->type == NGX_RTMP_MSG_VIDEO ?
             ngx_rtmp_get_video_frame_type(in) : 0);

-    cscf = ngx_rtmp_get_module_srv_conf(s, ngx_rtmp_core_module);
-
     csidx = !(lacf->interleave || h->type == NGX_RTMP_MSG_VIDEO);

     cs  = &ctx->cs[csidx];
@@ -950,16 +947,6 @@
         cs = &pctx->cs[csidx];

         handler = ngx_rtmp_process_handlers[pctx->protocol];
-
-        if (rpkt) {
-            ngx_rtmp_free_shared_chain(cscf, rpkt);
-        }
-
-        rpkt = handler->append_message_pt(ss, &ch, &lh, in);
-        if (rpkt == NULL) {
-            /* request from http closed */
-            continue;
-        }

         /* send metadata */

@@ -969,7 +956,6 @@
                 if (r == NULL
                     || (r->connection && r->connection->destroyed))
                 {
-                    ngx_rtmp_free_shared_chain(cscf, rpkt);
                     continue;
                 }

@@ -979,7 +965,6 @@
                     if ((!codec_ctx->has_video || !codec_ctx->has_audio)
                         && !codec_ctx->pure_audio)
                     {
-                        ngx_rtmp_free_shared_chain(cscf, rpkt);
                         continue;
                     }

@@ -1001,7 +986,7 @@
                 pctx->meta_version = meta_version;
             }

-            handler->free_message_pt(s, meta);
+            handler->free_message_pt(ss, meta);
             meta = NULL;
         }

@@ -1056,6 +1041,11 @@

                     rc = handler->send_message_pt(ss, apkt, 0);
                     if (rc != NGX_OK) {
+                        if (apkt) {
+                            handler->free_message_pt(ss, apkt);
+                            apkt = NULL;
+                        }
+
                         continue;
                     }
                 }
@@ -1067,6 +1057,11 @@

                     rc = handler->send_message_pt(ss, acopkt, 0);
                     if (rc != NGX_OK) {
+                        if (acopkt) {
+                            handler->free_message_pt(ss, acopkt);
+                            acopkt = NULL;
+                        }
+
                         continue;
                     }

@@ -1090,6 +1085,11 @@

                 rc = handler->send_message_pt(ss, apkt, prio);
                 if (rc != NGX_OK) {
+                    if (apkt) {
+                        handler->free_message_pt(ss, apkt);
+                        apkt = NULL;
+                    }
+
                     continue;
                 }

@@ -1103,6 +1103,12 @@
             }
         }

+        rpkt = handler->append_message_pt(ss, &ch, &lh, in);
+        if (rpkt == NULL) {
+            /* request from http closed */
+            continue;
+        }
+
         /* send relative packet */

         ngx_log_debug2(NGX_LOG_DEBUG_RTMP, ss->connection->log, 0,
@@ -1113,6 +1119,16 @@
             ++pctx->ndropped;

             cs->dropped += delta;
+
+            if (apkt) {
+                handler->free_message_pt(ss, apkt);
+                apkt = NULL;
+            }
+
+            if (acopkt) {
+                handler->free_message_pt(ss, acopkt);
+                acopkt = NULL;
+            }

             if (mandatory) {
                 ngx_log_debug0(NGX_LOG_DEBUG_RTMP, ss->connection->log, 0,
@@ -1126,18 +1142,21 @@
         cs->timestamp += delta;
         ++peers;
         ss->current_time = cs->timestamp;
-    }
-
-    if (rpkt) {
-        ngx_rtmp_free_shared_chain(cscf, rpkt);
-    }
-
-    if (apkt) {
-        ngx_rtmp_free_shared_chain(cscf, apkt);
-    }
-
-    if (acopkt) {
-        ngx_rtmp_free_shared_chain(cscf, acopkt);
+
+        if (rpkt) {
+            handler->free_message_pt(ss, rpkt);
+            rpkt = NULL;
+        }
+
+        if (apkt) {
+            handler->free_message_pt(ss, apkt);
+            apkt = NULL;
+        }
+
+        if (acopkt) {
+            handler->free_message_pt(ss, acopkt);
+            acopkt = NULL;
+        }
     }

     ngx_rtmp_update_bandwidth(&ctx->stream->bw_in, h->mlen);


metadata. infinite loop. #145

metadata. infinite loop. #145

--- ngx_rtmp_live_module.c
+++ ngx_rtmp_live_module.c
@@ -1142,7 +1142,7 @@
         ngx_rtmp_free_shared_chain(cscf, data);
     }

-    if (rpkt) {
+    if (rpkt && !data) {
         ngx_rtmp_free_shared_chain(cscf, rpkt);
     }


randombytes_buf() returns void.

randombytes_buf() returns void.

--- src/libsodium/randombytes/randombytes.c
+++ src/libsodium/randombytes/randombytes.c
@@ -47,7 +47,7 @@
 void
 randombytes_buf(void * const buf, const size_t size)
 {
-    return implementation->buf(buf, size);
+    implementation->buf(buf, size);
 }

 int


tweak assert: if faulting, then the data is not ready

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@8902 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- sliod/slvr.c
+++ sliod/slvr.c
@@ -363,9 +363,9 @@
 		 *   that the sliver isn't freed from under us.
 		 * Note that SLVR_WAIT() regains the lock.
 		 */
+		psc_assert(!(s->slvr_flags & SLVR_DATARDY));
 		SLVR_WAIT(s);
 		psc_assert(s->slvr_flags & SLVR_DATARDY);
-		psc_assert(s->slvr_flags & SLVR_PINNED);

 		psc_assert(psclist_conjoint(&s->slvr_lentry));
 		goto out;


* scoreboard: more information about last stream handled.

--- mod_http2/h2_session.c
+++ mod_http2/h2_session.c
@@ -1240,7 +1240,6 @@
                 goto cleanup;
             }
         }
-        update_child_status(session, SERVER_BUSY_WRITE, "write", NULL);
         rv = h2_c1_io_pass(&session->io);
     }
 cleanup:
@@ -1303,6 +1302,7 @@
         /* we dont poll output of stream 0, this should not be called */
         return APR_SUCCESS;
     }
+    update_child_status(session, SERVER_BUSY_WRITE, "write", stream);
     return h2_stream_read_output(stream);
 }

@@ -1608,6 +1608,7 @@
             ev_stream_closed(session, stream);
             break;
         case H2_SS_CLEANUP:
+            update_child_status(session, SERVER_BUSY_WRITE, "done", stream);
             nghttp2_session_set_stream_user_data(session->ngh2, stream->id, NULL);
             h2_mplx_c1_stream_cleanup(session->mplx, stream, &session->open_streams);
             if (session->open_streams == 0) {


remove unused args: off, len, and blk

remove unused args: off, len, and blk

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@22916 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- sliod/slvr.c
+++ sliod/slvr.c
@@ -622,11 +622,9 @@
  * @s: the sliver.
  */
 ssize_t
-slvr_fsbytes_rio(struct slvr *s, uint32_t off, uint32_t len,
-	struct sli_aiocb_reply **aiocbr)
+slvr_fsbytes_rio(struct slvr *s, struct sli_aiocb_reply **aiocbr)
 {
 	ssize_t rc = 0;
-	int blk;

 	rc = slvr_fsio(s, 0, SLASH_SLVR_SIZE, SL_READ, aiocbr);

@@ -779,7 +777,7 @@
 	/* Execute read to fault in needed blocks after dropping
 	 *   the lock.  All should be protected by the FAULTING bit.
 	 */
-	if ((rc = slvr_fsbytes_rio(s, off, len, aiocbr)))
+	if ((rc = slvr_fsbytes_rio(s, aiocbr)))
 		return (rc);

 	if (rw == SL_READ) {


fix some nasty bugs which were preventing the filesize from being correct.
	. off by one casused by invalid bitmask
	. wasn't inverting the bitfield when datardy was set (this was causing all blocks except
	the dirty blocks from being written (whoops).

manage unaligned writes correctly.

git-svn-id: ae92b08b608af1c8cefa3e10d2325ea527204e07@8089 3eda493b-6a19-0410-b2e0-ec8ea4dd8fda

--- sliod/slvr.c
+++ sliod/slvr.c
@@ -309,12 +309,11 @@
 int
 slvr_io_prep(struct slvr_ref *s, uint32_t offset, uint32_t size, int rw)
 {
-	int blks, rc;
+	int blks, rc, unaligned[2] = {0,0};
 	size_t i;

 	SLVR_LOCK(s);
         psc_assert(s->slvr_flags & SLVR_PINNED);
-

 	//if (psclist_conjoint(&s->slvr_lentry))
 	//	psc_assert(!(s->slvr_flags & SLVR_LRU));
@@ -383,8 +382,10 @@
 		/* Unaffected blocks at the beginning of the sliver.
 		 */
 		blks = (offset / SLASH_SLVR_BLKSZ);
-		if (offset & SLASH_SLVR_BLKMASK)
-			++blks;
+		if (offset & SLASH_SLVR_BLKMASK) {
+			unaligned[0] = blks;
+			blks++;
+		}

 		for (i=0; (ssize_t)i < blks; i++)
 			vbitmap_set(s->slvr_slab->slb_inuse, i);
@@ -392,13 +393,17 @@
 	/* Mark any blocks at the end.
 	 */
 	if ((offset + size) < SLASH_SLVR_SIZE) {
+		int j;
+
 		blks = ((SLASH_SLVR_SIZE - (offset + size)) /
 			SLASH_SLVR_BLKSZ);

-		if ((offset + size) & SLASH_SLVR_BLKMASK)
-			++blks;
-
-		for (i=SLASH_BLKS_PER_SLVR-1; blks--; i--)
+		if ((offset + size) & SLASH_SLVR_BLKMASK) {
+			blks++;
+			unaligned[1] = SLASH_BLKS_PER_SLVR - blks;
+		}
+
+		for (i=SLASH_BLKS_PER_SLVR-1, j=blks; j > 0; i--, j--)
 			vbitmap_set(s->slvr_slab->slb_inuse, i);
 	}
 	/* We must have found some work to do.
@@ -409,7 +414,7 @@
 	psc_info("vbitmap_nfree() = %d", vbitmap_nfree(s->slvr_slab->slb_inuse));

 	if (s->slvr_flags & SLVR_DATARDY)
-                goto out;
+                goto invert;

  do_read:
 	SLVR_ULOCK(s);
@@ -426,7 +431,13 @@
 		 *  the rpc.
 		 */
 		SLVR_LOCK(s);
-		vbitmap_invert(s->slvr_slab->slb_inuse);
+	invert:
+		vbitmap_invert(s->slvr_slab->slb_inuse);
+		if (unaligned[0])
+			vbitmap_set(s->slvr_slab->slb_inuse, unaligned[0]);
+
+		if (unaligned[1])
+			vbitmap_set(s->slvr_slab->slb_inuse, unaligned[1]);
 	out:
 		SLVR_ULOCK(s);
 	}


nimble/gap: Reset GAP UPDATE timeout on fallback to L2CAP

In case LL Update failed but took already some time, make sure we give
more time for the connection update procedure over L2CAP

--- nimble/host/src/ble_gap.c
+++ nimble/host/src/ble_gap.c
@@ -1128,6 +1128,8 @@
             entry = ble_gap_update_entry_find(evt->connection_handle, NULL);
             if (entry != NULL && !(conn->bhc_flags & BLE_HS_CONN_F_MASTER)) {
                 ble_gap_update_to_l2cap(&entry->params, &l2cap_params);
+                entry->exp_os_ticks = ble_npl_time_get() +
+                                      ble_npl_time_ms_to_ticks32(BLE_GAP_UPDATE_TIMEOUT_MS);
             }
             break;


fixes to compiler warnings being thrown.

(Logical change 1.316)

--- setools/libapol/binpol/binpol.c
+++ setools/libapol/binpol/binpol.c
@@ -194,7 +194,7 @@
 	size_t len, nel;
 	unsigned char *kbuf, *key;
 	__u32 *buf, val;
-	int rt, idx;
+	int rt, idx = -1;
 	bool_t keep = FALSE;

 	INTERNAL_ASSERTION
@@ -249,8 +249,8 @@
 {
 	size_t len, len2, nel, ncons, nexpr;
 	unsigned char *kbuf, *key, *cbuf;
-	__u32 *buf, expr_type, val, i, j, num_cp = 0, cp_val;
-	int rt, idx, idx2 = -1;		/* idx2 (common perm idx) must ne init'd to -1 for load_perms */
+	__u32 *buf, expr_type, val, i, j, num_cp = 0, cp_val = -1;
+	int rt, idx = -1, idx2 = -1;		/* idx2 (common perm idx) must ne init'd to -1 for load_perms */
 	bool_t keep = FALSE;

 	INTERNAL_ASSERTION
@@ -389,7 +389,7 @@
 	__u32 *buf, val;
 	size_t len;
 	unsigned char *kbuf, *key;
-	int idx, rt;
+	int idx = -1, rt;
 	bool_t keep = FALSE;

 	INTERNAL_ASSERTION
@@ -513,7 +513,7 @@
 	size_t len;
 	unsigned char *kbuf, *key;
 	bool_t keep = FALSE;
-	user_item_t *u;
+	user_item_t *u = NULL;
 	int i, rt;
 	ebitmap_t e;

@@ -1030,7 +1030,7 @@
 	bool_t is_cond, enabled;

 	assert(avdatum != NULL && avkey != NULL && bm != NULL && policy != NULL);
-
+	src = tgt = cls = dflt = rule_idx = -1;
 	is_cond = (r_list != NULL);
 	enabled = (is_cond ? binpol_enabled(avdatum->specified) : TRUE);


Bug 690279 - broken relocation of modules

Fix OS X relocation.

--- pango/modules.c
+++ pango/modules.c
@@ -450,7 +450,13 @@
 	  switch (i)
 	    {
 	    case 0:
-	      if (!g_path_is_absolute (tmp_buf->str))
+	      if (!g_path_is_absolute (tmp_buf->str)
+#ifdef __APPLE__
+	          && strncmp (tmp_buf->str, "@executable_path/", 17)
+	          && strncmp (tmp_buf->str, "@loader_path/", 13)
+	          && strncmp (tmp_buf->str, "@rpath/", 7)
+#endif
+	         )
 		{
 		  const gchar *lib_dir = pango_get_lib_subdirectory ();
 		  const gchar *abs_file_name = g_build_filename (lib_dir,


Bit 16 and 19 are still set when the time zone change respectively leap second happen, so:

- do not reject 01:00 UTC
- adjust for utchour and bit 17/18 changes during the time zone change

At 23:00 UTC the local time is at least 00:00 so we must use the first day
of the next local month instead.

--- decode_time.c
+++ decode_time.c
@@ -218,18 +218,23 @@
 	/* h==0 (UTC) because sz->wz -> h==2 and wz->sz -> h==1,
 	 * last Sunday of month (reference?) */
 	if (buffer[16] == 1 && ok) {
-		if (time->tm_min > 0 && utchour == 0 && time->tm_wday == 7 &&
-		    time->tm_mday > lastday(*time) - 7)
+		if ((time->tm_wday == 7 && time->tm_mday > lastday(*time) - 7) &&
+		    ((time->tm_min > 0 && utchour == 0) ||
+		    (time->tm_min == 0 && utchour == 1 + buffer[17] - buffer[18]))) {
 			announce |= ANN_CHDST; /* TODO check month */
-		else
+			if (time->tm_min == 0)
+				utchour = 1; /* time zone just changed */
+		} else
 			rval |= DT_CHDSTERR;
 	}

-	/* h==23 (UTC), last day of month according to IERS Bulletin C */
+	/* h==23, last day of month (UTC) or h==0, first day of next month (UTC)
+	 * according to IERS Bulletin C */
 	if (buffer[19] == 1 && ok) {
-		if (time->tm_min > 0 && utchour == 23 &&
-		    time->tm_mday == lastday(*time))
-			announce |= ANN_LEAP; /* TODO check month */
+		if (time->tm_mday == 1 &&
+		    ((time->tm_min > 0 && utchour == 23) ||
+		    (time->tm_min == 0 && utchour == 0)))
+			announce |= ANN_LEAP; /* TODO check month-1 */
 		else
 			rval |= DT_LEAPERR;
 	}


run uncrustify

run uncrustify

--- shared-bindings/bitbangio/SPI.c
+++ shared-bindings/bitbangio/SPI.c
@@ -260,7 +260,7 @@
         return mp_const_none;
     }

-    bool ok = shared_module_bitbangio_spi_read(self, ((uint8_t*)bufinfo.buf) + start, length, args[ARG_write_value].u_int);
+    bool ok = shared_module_bitbangio_spi_read(self, ((uint8_t *)bufinfo.buf) + start, length, args[ARG_write_value].u_int);
     if (!ok) {
         mp_raise_OSError(MP_EIO);
     }


Set cdio log routine.

Set cdio log routine.

--- modules/access/cddax.c
+++ modules/access/cddax.c
@@ -2,7 +2,7 @@
  * cddax.c : CD digital audio input module for vlc using libcdio
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: cddax.c,v 1.5 2003/11/24 00:39:01 fenrir Exp $
+ * $Id: cddax.c,v 1.6 2003/11/24 00:41:19 rocky Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -274,6 +274,8 @@
     }

     /* Open CDDA */
+    cdio_log_set_handler ( cdio_log_handler );
+
     if( !(p_cddev = ioctl_Open( p_this, psz_source )) )
     {
         msg_Warn( p_input, "could not open %s", psz_source );


Optimized matrix squaring for matrix of dimension greater than 2


tremor: decode to S32N

tremor: decode to S32N

--- modules/codec/vorbis.c
+++ modules/codec/vorbis.c
@@ -253,7 +253,7 @@
     /* Set output properties */
     p_dec->fmt_out.i_cat = AUDIO_ES;
 #ifdef MODULE_NAME_IS_tremor
-    p_dec->fmt_out.i_codec = VLC_CODEC_FI32;
+    p_dec->fmt_out.i_codec = VLC_CODEC_S32N;
 #else
     p_dec->fmt_out.i_codec = VLC_CODEC_FL32;
 #endif
@@ -475,11 +475,11 @@
 {
     for( int j = 0; j < i_samples; j++ )
         for( int i = 0; i < i_nb_channels; i++ )
-            p_out[j * i_nb_channels + pi_chan_table[i]] = pp_in[i][j]
 #ifdef MODULE_NAME_IS_tremor
-                * (FIXED32_ONE >> 24)
+            p_out[j * i_nb_channels + pi_chan_table[i]] = pp_in[i][j] << 8;
+#else
+            p_out[j * i_nb_channels + pi_chan_table[i]] = pp_in[i][j];
 #endif
-            ;
 }

 /*****************************************************************************


storage: scsi: invert logic in createVport

Check whether the alloc result is negative (which is
cannot happen with current code) to reduce churn in
the following commit.

Signed-off-by: Ján Tomko <4cab11cfb98d3c937327354a78eb07dbb6ee2bc6@redhat.com>
Reviewed-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>

--- src/storage/storage_backend_scsi.c
+++ src/storage/storage_backend_scsi.c
@@ -329,16 +329,17 @@
      * retry logic set to true. If the thread isn't created, then no big
      * deal since it's still possible to refresh the pool later.
      */
-    if (VIR_ALLOC(cbdata) == 0) {
-        memcpy(cbdata->pool_uuid, def->uuid, VIR_UUID_BUFLEN);
-        cbdata->fchost_name = g_steal_pointer(&name);
-
-        if (virThreadCreateFull(&thread, false, virStoragePoolFCRefreshThread,
-                                "scsi-refresh", false, cbdata) < 0) {
-            /* Oh well - at least someone can still refresh afterwards */
-            VIR_DEBUG("Failed to create FC Pool Refresh Thread");
-            virStoragePoolFCRefreshDataFree(cbdata);
-        }
+    if (VIR_ALLOC(cbdata) < 0)
+        return -1;
+
+    memcpy(cbdata->pool_uuid, def->uuid, VIR_UUID_BUFLEN);
+    cbdata->fchost_name = g_steal_pointer(&name);
+
+    if (virThreadCreateFull(&thread, false, virStoragePoolFCRefreshThread,
+                            "scsi-refresh", false, cbdata) < 0) {
+        /* Oh well - at least someone can still refresh afterwards */
+        VIR_DEBUG("Failed to create FC Pool Refresh Thread");
+        virStoragePoolFCRefreshDataFree(cbdata);
     }

     return 0;


make_logger.c: add comment - usage example

--- make_logger.c
+++ make_logger.c
@@ -7,9 +7,16 @@
  */
 /*
  * usage:
+ *    Example 1
  *     $ export MAKE_LOGGER_LOG=`pwd`/logfile.txt
  *     $ make_logger <make command arguments>...
  *     $ cat logfile.txt
+ *
+ *    Example 2 (realtime watching)
+ *     $ export MAKE_LOGGER_LOG=`pwd`/logfile.txt
+ *     $ touch $MAKE_LOGGER_LOG
+ *     $ xterm -e tail -f $MAKE_LOGGER_LOG &
+ *     $ make_logger <make command arguments>...
  *
  *  environment variable
  *     MAKE_LOGGER_LOG  -- log file name (full path)


Added a note about the lack of thread safety.

--- include/IECore/Interned.h
+++ include/IECore/Interned.h
@@ -52,6 +52,8 @@
 /// much more flexible. However, without using intermodule_holder
 /// we get crashes at program termination, and using it we get gcc
 /// crashes during compilation (with gcc 4.0.2).
+/// \threading Constructing an instance of Interned is not threadsafe,
+/// this really needs to be addressed.
 template<typename T, typename Hash=Hash<T> >
 class Interned
 {


Doc fix

Doc fix

--- include/PSPL/PSPLCommon.h
+++ include/PSPL/PSPLCommon.h
@@ -258,7 +258,6 @@
 #   endif
 } pspl_platform_t;

-/** @} */

 /* Windows Support */
 #ifdef _WIN32
@@ -269,4 +268,7 @@

 #endif

+/** @} */
+
+
 #endif


[PATCH] ppc32: fix ppc440 pagetable attributes

This patch fixes a bug in the PPC440 pagetable attributes that breaks swap
support.  It also adds some notes on the PPC440 attribute fields.

Signed-off-by: Geoff Levand <058b6ffe73540731b6df5cbcf27480d0bdbf7afb@am.sony.com> for CELF
Signed-off-by: Matt Porter <c1d287ff3802a4aab0e3770389ea24a33314618b@kernel.crashing.org>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- include/asm-ppc/pgtable.h
+++ include/asm-ppc/pgtable.h
@@ -202,18 +202,64 @@
  *
  * Note that these bits preclude future use of a page size
  * less than 4KB.
- */
+ *
+ *
+ * PPC 440 core has following TLB attribute fields;
+ *
+ *   TLB1:
+ *   0  1  2  3  4  ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
+ *   RPN.................................  -  -  -  -  -  - ERPN.......
+ *
+ *   TLB2:
+ *   0  1  2  3  4  ... 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
+ *   -  -  -  -  -    - U0 U1 U2 U3 W  I  M  G  E   - UX UW UR SX SW SR
+ *
+ * There are some constrains and options, to decide mapping software bits
+ * into TLB entry.
+ *
+ *   - PRESENT *must* be in the bottom three bits because swap cache
+ *     entries use the top 29 bits for TLB2.
+ *
+ *   - FILE *must* be in the bottom three bits because swap cache
+ *     entries use the top 29 bits for TLB2.
+ *
+ *   - CACHE COHERENT bit (M) has no effect on PPC440 core, because it
+ *     doesn't support SMP. So we can use this as software bit, like
+ *     DIRTY.
+ *
+ * PPC Book-E Linux implementation uses PPC HW PTE bit field definition,
+ * even it doesn't have HW PTE. 0-11th LSB of PTE stand for memory
+ * protection-related function. (See PTE structure in include/asm-ppc/mmu.h)
+ * Definition of _PAGE_XXX in "include/asm-ppc/pagetable.h" stands for
+ * above bits. Note that those bits values are CPU dependent, not
+ * architecture.
+ *
+ * Kernel PTE entry holds arch-dependent swp_entry structure under certain
+ * situation. In other words, in such situation, some portion of PTE bits
+ * are used as swp_entry. In PPC implementation, 3-24th LSB are shared with
+ * swp_entry, however 0-2nd three LSB still hold protection values.
+ * That means three protection bits are reserved for both PTE and SWAP
+ * entry at the most three LSBs.
+ *
+ * There are three protection bits available for SWAP entry;
+ *	_PAGE_PRESENT
+ *	_PAGE_FILE
+ *	_PAGE_HASHPTE (if HW has)
+ *
+ * So those three bits have to be inside of 0-2nd LSB of PTE.
+ *
+ */
+
 #define _PAGE_PRESENT	0x00000001		/* S: PTE valid */
 #define	_PAGE_RW	0x00000002		/* S: Write permission */
-#define	_PAGE_DIRTY	0x00000004		/* S: Page dirty */
+#define _PAGE_FILE	0x00000004		/* S: nonlinear file mapping */
 #define _PAGE_ACCESSED	0x00000008		/* S: Page referenced */
 #define _PAGE_HWWRITE	0x00000010		/* H: Dirty & RW */
 #define _PAGE_HWEXEC	0x00000020		/* H: Execute permission */
 #define	_PAGE_USER	0x00000040		/* S: User page */
 #define	_PAGE_ENDIAN	0x00000080		/* H: E bit */
 #define	_PAGE_GUARDED	0x00000100		/* H: G bit */
-#define	_PAGE_COHERENT	0x00000200		/* H: M bit */
-#define _PAGE_FILE	0x00000400		/* S: nonlinear file mapping */
+#define	_PAGE_DIRTY	0x00000200		/* S: Page dirty */
 #define	_PAGE_NO_CACHE	0x00000400		/* H: I bit */
 #define	_PAGE_WRITETHRU	0x00000800		/* H: W bit */


[axl_g] added defines and detection for ARM32/64

--- include/axl_g/axl_g_Pch.h
+++ include/axl_g/axl_g_Pch.h
@@ -64,12 +64,20 @@
 #		define _AXL_CPU_X86 1
 #	elif (defined _M_AMD64)
 #		define _AXL_CPU_AMD64 1
+#	elif (defined _M_ARM)
+#		define _AXL_CPU_ARM32 1
+#	elif (defined _M_ARM64)
+#		define _AXL_CPU_ARM64 1
 #	endif
 #elif (_AXL_CPP_GCC)
 #	if defined __i386__
 #		define _AXL_CPU_X86 1
 #	elif (defined __amd64__)
 #		define _AXL_CPU_AMD64 1
+#	elif (defined __arm__)
+#		define _AXL_CPU_ARM32 1
+#	elif (defined __aarch64__)
+#		define _AXL_CPU_ARM64 1
 #	endif
 #endif

@@ -78,6 +86,12 @@
 #	define AXL_PTR_SIZE    4
 #elif (_AXL_CPU_AMD64)
 #	define AXL_CPU_STRING  "amd64"
+#	define AXL_PTR_SIZE    8
+#elif (_AXL_CPU_ARM32)
+#	define AXL_CPU_STRING  "arm32"
+#	define AXL_PTR_SIZE    4
+#elif (_AXL_CPU_ARM64)
+#	define AXL_CPU_STRING  "arm64"
 #	define AXL_PTR_SIZE    8
 #else
 #	error unsupported CPU architecture


Fix to DofObject _idx_buf documentation

Fix to DofObject _idx_buf documentation

This is about to get more complicated and the off-by-one error wasn't
a good starting place.

--- include/base/dof_object.h
+++ include/base/dof_object.h
@@ -456,10 +456,10 @@
    * DoF index information.  This is packed into a contiguous buffer of the following format:
    *
    * \verbatim
-   * [ns end_0 end_1 ... end_{ns-1} (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_0
+   * [ns end_0 end_1 ... end_{ns-2} (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_0
    *                                (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_1
    *                                ...
-   *                                (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_ns ]
+   *                                (ncv_0 idx_0 ncv_1 idx_1 ... ncv_nv idx_nv)_{ns-2} ]
    * \endverbatim
    *
    * where 'end_s' is the index past the end of the variable group storage for system \p s.


When deprecated code is not enabled, protect old_dof_object

--- include/base/dof_object.h
+++ include/base/dof_object.h
@@ -77,8 +77,14 @@
   /**
    * This object on the last mesh.  Useful for projecting
    * solutions from one mesh to another.
-   */
+   *
+   * Public access to old_dof_object is now officially deprecated and will
+   * be removed in future libMesh versions.  Use the \p get_old_dof_object()
+   * accessor instead.
+   */
+#ifndef LIBMESH_ENABLE_DEPRECATED
 protected:
+#endif
   std::unique_ptr<DofObject> old_dof_object;

 public:


Changed private to protected

Changed private to protected

--- src/render/entity/DefaultEntityRender.h
+++ src/render/entity/DefaultEntityRender.h
@@ -20,7 +20,7 @@
     ~DefaultEntityRender();
     virtual void render(const Entity *const entity, glm::mat4 projectionMatrix, glm::mat4 viewMatrix, double scale) override;

-private:
+protected:
     const unsigned int atlasSize = 8;
     float vertices[12];
     GLuint vbo[2];


SD bench: Retain atomic operation.;

SD bench: Retain atomic operation.;

--- src/systemcmds/sd_bench/sd_bench.c
+++ src/systemcmds/sd_bench/sd_bench.c
@@ -157,7 +157,7 @@
 {
 	hrt_abstime fsync_start = hrt_absolute_time();
 	fsync(fd);
-	return hrt_elapsed_time(&fsync_start) / 1000;
+	return hrt_elapsed_time_atomic(&fsync_start) / 1000;
 }

 void write_test(int fd, uint8_t *block, int block_size)


Bluetooth: L2CAP: Document behavior of alloc_buf

Channel that requires segmentation must set alloc_buf in order for the
stack to be able to reassemble segments of an SDU.

Signed-off-by: Luiz Augusto von Dentz <8530c5ea66a1bdbc08f98bfcf183c8be901b5990@intel.com>

--- include/bluetooth/l2cap.h
+++ include/bluetooth/l2cap.h
@@ -219,7 +219,8 @@
 	/** @brief Channel alloc_buf callback
 	 *
 	 *  If this callback is provided the channel will use it to allocate
-	 *  buffers to store incoming data.
+	 *  buffers to store incoming data. Channels that requires segmentation
+	 *  must set this callback.
 	 *
 	 *  @param chan The channel requesting a buffer.
 	 *


moved actual definition of cddb_track_t structure to cddb_ni.h converted #defined functions to regular functions

--- include/cddb/cddb_track.h
+++ include/cddb/cddb_track.h
@@ -1,5 +1,5 @@
 /*
-    $Id: cddb_track.h,v 1.18 2005/03/11 21:29:29 airborne Exp $
+    $Id: cddb_track.h,v 1.19 2005/07/09 08:31:32 airborne Exp $

     Copyright (C) 2003, 2004, 2005 Kris Verbeeck <airborne@advalvas.be>

@@ -27,26 +27,12 @@
 #endif

-/* Forward declaration of the disc structure. */
-struct cddb_disc_c;
-
 /**
  * The CDDB track structure.  Contains all information associated with
  * a single CD track.  This structure will be used to populate the
  * tracks linked list of the cddb_disc_s structure.
  */
-typedef struct cddb_track_s
-{
-    int num;                    /**< track number on the disc */
-    int frame_offset;           /**< frame offset of the track on the disc */
-    int length;                 /**< track length in seconds */
-    char *title;                /**< track title */
-    char *artist;               /**< (optional) track artist */
-    char *ext_data;             /**< (optional) extended disc data */
-    struct cddb_track_s *prev;  /**< pointer to previous track, or NULL */
-    struct cddb_track_s *next;  /**< pointer to next track, or NULL */
-    struct cddb_disc_s *disc;   /**< disc of which this is a track */
-} cddb_track_t;
+typedef struct cddb_track_s cddb_track_t;

 /* --- construction / destruction */
@@ -74,7 +60,7 @@
  *
  * @param track The CDDB track structure.
  */
-cddb_track_t *cddb_track_clone(cddb_track_t *track);
+cddb_track_t *cddb_track_clone(const cddb_track_t *track);

 /* --- getters & setters --- */
@@ -82,20 +68,22 @@

 /**
  * Get the number of this track.  This track number starts counting at
- * 1.  If the track number is not defined -1 will be returned.
+ * 1.  If the track is invalid or the track number is not defined -1
+ * will be returned.
  *
  * @param track The CDDB track structure.
  * @return The track number.
  */
-#define cddb_track_get_number(track) (track)->num
-
-/**
- * Get the frame offset of this track on the disc.
+int cddb_track_get_number(const cddb_track_t *track);
+
+/**
+ * Get the frame offset of this track on the disc.  If the track is
+ * invalid -1 will be returned.
  *
  * @param track The CDDB track structure.
  * @return The frame offset.
  */
-#define cddb_track_get_frame_offset(track) (track)->frame_offset
+int cddb_track_get_frame_offset(const cddb_track_t *track);

 /**
  * Set the frame offset of this track on the disc.
@@ -104,7 +92,7 @@
  * @param offset The frame offset.
  * @return The frame offset.
  */
-#define cddb_track_set_frame_offset(track, offset) (track)->frame_offset = offset
+void cddb_track_set_frame_offset(cddb_track_t *track, int offset);

 /**
  * Get the length of the track in seconds.  If the track length is not
@@ -131,13 +119,13 @@
 void cddb_track_set_length(cddb_track_t *track, int length);

 /**
- * Get the track title.  If no title is set for this track then NULL
- * will be returned.
+ * Get the track title.  If the track is invalid or no title is set
+ * for this track then NULL will be returned.
  *
  * @param track The CDDB track structure.
  * @return The track title.
  */
-#define cddb_track_get_title(track) (track)->title
+const char *cddb_track_get_title(const cddb_track_t *track);

 /**
  * Set the track title.  If the track already had a title, then the
@@ -197,7 +185,7 @@
  * @param track The CDDB track structure.
  * @return The extended data.
  */
-#define cddb_track_get_ext_data(track) (track)->ext_data
+        const char *cddb_track_get_ext_data(cddb_track_t *track);

 /**
  * Set the extended data for the track.  If the track already had


Remove superfluous comment

Remove superfluous comment

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

--- include/clang/Lex/Token.h
+++ include/clang/Lex/Token.h
@@ -63,9 +63,7 @@

   /// Kind - The actual flavor of token this is.
   ///
-  unsigned short Kind; // DON'T make Kind a 'tok::TokenKind';
-                       // MSVC will treat it as a signed char and
-                       // TokenKinds > 127 won't be handled correctly.
+  unsigned short Kind;

   /// Flags - Bits we track about this token, members of the TokenFlags enum.
   unsigned char Flags;


ok now, let's fix that MSVC warning for real.

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

--- include/clang/Sema/Sema.h
+++ include/clang/Sema/Sema.h
@@ -630,7 +630,7 @@

     bool hasConstParamMatch() const { return Pair.getInt() & 0x2; }
     void setConstParamMatch(bool B) {
-      Pair.setInt(unsigned(B) << 1 | hasSuccess());
+      Pair.setInt(B << 1 | unsigned(hasSuccess()));
     }
   };


Correct indentation

Correct indentation

--- include/client/registry.h
+++ include/client/registry.h
@@ -31,17 +31,17 @@
 };

 struct output_state {
-        struct wl_output *output;
-        uint32_t flags;
-        uint32_t width, height;
-		uint32_t scale;
+	struct wl_output *output;
+	uint32_t flags;
+	uint32_t width, height;
+	uint32_t scale;
 };

 struct xkb {
-        struct xkb_state *state;
-        struct xkb_context *context;
-        struct xkb_keymap *keymap;
-        xkb_mod_mask_t masks[MASK_LAST];
+	struct xkb_state *state;
+	struct xkb_context *context;
+	struct xkb_keymap *keymap;
+	xkb_mod_mask_t masks[MASK_LAST];
 };

 struct input {
@@ -56,17 +56,17 @@
 };

 struct registry {
-        struct wl_compositor *compositor;
-        struct wl_display *display;
-        struct wl_pointer *pointer;
-        struct wl_keyboard *keyboard;
-        struct wl_seat *seat;
-        struct wl_shell *shell;
-        struct wl_shm *shm;
-        struct desktop_shell *desktop_shell;
-        struct lock *swaylock;
-        struct input *input;
-        list_t *outputs;
+	struct wl_compositor *compositor;
+	struct wl_display *display;
+	struct wl_pointer *pointer;
+	struct wl_keyboard *keyboard;
+	struct wl_seat *seat;
+	struct wl_shell *shell;
+	struct wl_shm *shm;
+	struct desktop_shell *desktop_shell;
+	struct lock *swaylock;
+	struct input *input;
+	list_t *outputs;
 };

 struct registry *registry_poll(void);


Document some server parts with doxygen comments

--- include/core/httpserver.h
+++ include/core/httpserver.h
@@ -109,23 +109,72 @@
 		m_handlers[method][url] = hdl;
 	}

-	uint16_t get_port() const
-	{ return m_http_port; }
+	/**
+	 * @return current server listening port
+	 */
+	uint16_t get_port() const { return m_http_port; }

 private:
+	/**
+	 * Loop iteration which copy header key and value to HTTPQuery object
+	 * @param cls
+	 * @param kind
+	 * @param key
+	 * @param value
+	 * @return
+	 */
 	static int mhd_iter_headers(void *cls, MHD_ValueKind kind, const char *key,
 		const char *value);

+	/**
+	 * Loop iteration which copy GET parameter key and value to HTTPQuery object
+	 * @param cls
+	 * @param kind
+	 * @param key
+	 * @param value
+	 * @return MHD_YES
+	 */
 	static int mhd_iter_getargs(void *cls, MHD_ValueKind kind, const char *key,
 		const char *value);

+	/**
+	 * Route requests from libmicrohttpd to WinterWind handlers
+	 *
+	 * @param http_server
+	 * @param connection
+	 * @param url
+	 * @param method
+	 * @param version
+	 * @param upload_data
+	 * @param upload_data_size
+	 * @param ptr
+	 * @return MHD_YES if success, MHD_NO if request was in error
+	 */
 	static int request_handler(void *http_server, MHD_Connection *connection,
 		const char *url, const char *method, const char *version, const char *upload_data,
 		size_t *upload_data_size, void **ptr);

+	/**
+	 * Callback called when a request is complete
+	 * Currently does nothing
+	 *
+	 * @param cls Session object
+	 * @param connection
+	 * @param con_cls
+	 * @param toe
+	 *
+	 */
 	static void request_completed(void *cls, struct MHD_Connection *connection,
 		void **con_cls, MHD_RequestTerminationCode toe);

+	/**
+	 * Read post data and copy key,values to HTTPFormQuery object
+	 * This applies only for application/x-www-form-urlencoded content type
+	 *
+	 * @param data
+	 * @param qf
+	 * @return parsing success status
+	 */
 	bool parse_post_data(const std::string &data, HTTPFormQuery *qf);

 	bool handle_query(Method m, MHD_Connection *conn, const std::string &url,


Another attempt to appease SOLARIS

Another attempt to appease SOLARIS

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

--- include/csterr/ddgsplay.h
+++ include/csterr/ddgsplay.h
@@ -37,17 +37,10 @@
         unsigned int _value;
         /// The value broken into pieces.
         struct {
-#if (defined(OS_SOLARIS))
-            /// Triangle index.
-	        unsigned short _index;
-            /// The tree index.
-            unsigned short _tree;
-#else
             /// The tree index.
             unsigned short _tree;
             /// Triangle index.
 	        unsigned short _index;
-#endif
         } _ti;
     };

@@ -65,8 +58,15 @@
 	{
 		if (_key < sk._key) return -1;
 		if (_key > sk._key) return 1;
+#if (defined(OS_SOLARIS))
+		if (_tree < sk._tree) return -1;
+		if (_tree > sk._tree) return 1;
+		if (_index < sk._index) return -1;
+		if (_index > sk._index) return 1;
+#else
 		if (_value < sk._value) return -1;
 		if (_value > sk._value) return 1;
+#endif
 		// They are equal.
 		return 0;
 	}


removed old file

removed old file

--- include/darc/timer/list.h
+++ include/darc/timer/list.h
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2011, Prevas A/S
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in the
- *       documentation and/or other materials provided with the distribution.
- *     * Neither the name of Prevas A/S nor the names of its
- *       contributors may be used to endorse or promote products derived from
- *       this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/**
- * DARC List class
- *
- * \author Morten Kjaergaard
- */
-
-#pragma once
-
-#include <vector>
-#include <darc/enable_safe_weak_ptr.h>
-#include <darc/timer/periodic_timer_impl.h>
-
-namespace darc
-{
-namespace timer
-{
-
-class List : public EnableSafeWeakPtr<List>
-{
-  friend class TimerListCtrlHandle;
-
-protected:
-  typedef std::vector<PeriodicTimerImplPtr> PeriodicTimerListType;
-
-  PeriodicTimerListType periodic_timer_list_;
-
-public:
-  void addPeriodicTimer( PeriodicTimerImplPtr timer )
-  {
-    periodic_timer_list_.push_back(timer);
-  }
-
-};
-
-typedef boost::shared_ptr<List> ListPtr;
-
-}
-}


refactor

refactor

--- include/fakeit/Stubbing.h
+++ include/fakeit/Stubbing.h
@@ -118,7 +118,9 @@

 	FirstFunctionStubbingProgress<R, arglist...>&
 	Return(const Quantifier<R>& q) {
-		return Do([&q](const arglist&...)->R {return q.value;});
+		auto method = [&q](const arglist&...)->R {return q.value; };
+		std::shared_ptr<BehaviorMock<R, arglist...>> doMock{ new DoMock<R, arglist...>(method) };
+		return DoImpl(doMock);
 	}

 	template<typename first, typename second, typename ... tail>
@@ -188,6 +190,13 @@
 	void AlwaysReturn() {
 		return AlwaysDo([](const arglist&...)->R {return DefaultValue::value<R>();});
 	}
+
+	FirstProcedureStubbingProgress<R, arglist...>&
+		Return(const Quantifier<R>& q) {
+			auto method = [&q](const arglist&...)->R {return; };
+			std::shared_ptr<BehaviorMock<R, arglist...>> doMock{ new DoMock<R, arglist...>(method) };
+			return DoImpl(doMock);
+		}

 	template<typename E>
 	FirstProcedureStubbingProgress<R, arglist...>& Throw(const E e) {


Move the formatxx types' data members to the end of the type, per the usual C++ conventions.

--- include/formatxx/format.h
+++ include/formatxx/format.h
@@ -55,20 +55,21 @@
 /// Describes a format string.
 class formatxx::string_view
 {
-	char const* begin = nullptr;
-	char const* end = nullptr;
-
-public:
-	string_view(char const* first, char const* last) : begin(first), end(last) {}
+public:
+	string_view(char const* first, char const* last) : _begin(first), _end(last) {}
 	string_view(char const* nstr, std::size_t length) : string_view(nstr, nstr + length) {}
 	string_view(char const* zstr) : string_view(zstr, std::strlen(zstr)) {}

 	// hmm, this may be a bad idea, it'll bind to over-long character buffers
 	template <size_t N> string_view(char (&str)[N]) : string_view(str, N) {}

-	char const* data() const { return begin; }
-	std::size_t size() const { return end - begin; }
-	bool empty() const { return begin != end; }
+	char const* data() const { return _begin; }
+	std::size_t size() const { return _end - _begin; }
+	bool empty() const { return _begin != _end; }
+
+private:
+	char const* _begin = nullptr;
+	char const* _end = nullptr;
 };

 /// Interface for any buffer that the format library can write into.
@@ -86,54 +87,57 @@
 template <typename StringT>
 class formatxx::string_writer : public format_writer
 {
-	StringT _string;
-
-public:
-	void write(string_view str) override { _string.append(str.begin, str.end - str.begin); }
+public:
+	void write(string_view str) override { _string.append(str._begin, str._end - str._begin); }

 	StringT const& str() const& { return _string; }
 	StringT&& str() && { return std::move(_string); }

 	std::size_t size() const { return _string.size(); }
 	char const* c_str() const { return _string.c_str(); }
+
+private:
+	StringT _string;
 };

 /// A writer with a fixed buffer that will never allocate.
 template <std::size_t SizeN = 512>
 class formatxx::fixed_writer : public format_writer
 {
+public:
+	void write(string_view str) override;
+
+	std::size_t size() const { return _length; }
+	char const* c_str() const { return _buffer; }
+
+private:
 	std::size_t _length = 0;
 	char _buffer[SizeN] = {'\0',};
-
-public:
+};
+
+/// A writer with a fixed buffer that will allocate when the buffer is exhausted.
+template <std::size_t SizeN, typename AllocatorT>
+class formatxx::buffered_writer : public format_writer, private AllocatorT
+{
+public:
+	buffered_writer() = default;
+	~buffered_writer();
+
+	buffered_writer(buffered_writer const&) = delete;
+	buffered_writer& operator=(buffered_writer const&) = delete;
+
 	void write(string_view str) override;

 	std::size_t size() const { return _length; }
 	char const* c_str() const { return _buffer; }
-};
-
-/// A writer with a fixed buffer that will allocate when the buffer is exhausted.
-template <std::size_t SizeN, typename AllocatorT>
-class formatxx::buffered_writer : public format_writer, private AllocatorT
-{
+
+private:
+	void _grow(std::size_t amount);
+
 	std::size_t _length = 0;
 	std::size_t _capacity = SizeN;
 	char* _buffer = _fixed;
 	char _fixed[SizeN] = {'\0',};
-
-	void _grow(std::size_t amount);
-
-public:
-	buffered_writer() = default;
-	~buffered_writer();
-
-	buffered_writer(buffered_writer const&) = delete;
-	buffered_writer& operator=(buffered_writer const&) = delete;
-
-	void write(string_view str) override;
-
-	std::size_t size() const { return _length; }
-	char const* c_str() const { return _buffer; }
 };

 /// Extra formatting specifications.


vector trunc & frac

vector trunc & frac

--- include/leap/lml/vector.h
+++ include/leap/lml/vector.h
@@ -368,6 +368,28 @@
   }

+  //|///////////////////// trunc ////////////////////////////////////////////
+  /// elementwise ceil
+  template<typename Vector, typename T, size_t... Indices>
+  constexpr Vector trunc(VectorView<Vector, T, Indices...> const &v)
+  {
+    using std::trunc;
+
+    return { trunc(v[Indices])... };
+  }
+
+
+  //|///////////////////// frac /////////////////////////////////////////////
+  /// elementwise frac
+  template<typename Vector, typename T, size_t... Indices>
+  constexpr Vector frac(VectorView<Vector, T, Indices...> const &v)
+  {
+    using std::trunc;
+
+    return { (v[Indices] - trunc(v[Indices]))... };
+  }
+
+
   //|///////////////////// clamp ////////////////////////////////////////////
   /// elementwise clamp
   template<typename Vector, typename T, size_t... Indices>


translate

translate

--- include/libfirm/irgraph.h
+++ include/libfirm/irgraph.h
@@ -341,7 +341,7 @@
 	/**
 	 * Allows localopts to remove edges to unreachable code.
 	 * Warning: It is only safe to enable this when you are sure that you
-	 * apply all localopts to the fixpunkt. (=in optimize_graph_df)
+	 * apply all localopts to the fixpoint. (=in optimize_graph_df)
 	 */
 	IR_GRAPH_CONSTRAINT_OPTIMIZE_UNREACHABLE_CODE = 1U << 3,
 	/**


mmc: Add status IRQ and status callback function to mmc platform data

Signed-off-by: San Mehat <b23d0c7bb708db91c8b9415ae7caad6fe333f717@google.com>

--- include/linux/amba/mmci.h
+++ include/linux/amba/mmci.h
@@ -73,6 +73,8 @@
 	bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
 	void *dma_rx_param;
 	void *dma_tx_param;
+	unsigned int status_irq;
+	int (*register_status_notify)(void (*callback)(int card_present, void *dev_id), void *dev_id);
 };

 #endif


dmaengine: clarify the meaning of the DMA_CTRL_ACK flag

DMA_CTRL_ACK's description applies to its clear state, not to its set state.

Signed-off-by: Guennadi Liakhovetski <50875182aae23d69ca7738697596f18a14e926fc@gmx.de>
Signed-off-by: Dan Williams <24ee2bf0bd8ac766c348bf1f0639943bac1535c6@intel.com>

--- include/linux/dmaengine.h
+++ include/linux/dmaengine.h
@@ -74,7 +74,7 @@
  *  control completion, and communicate status.
  * @DMA_PREP_INTERRUPT - trigger an interrupt (callback) upon completion of
  *  this transaction
- * @DMA_CTRL_ACK - the descriptor cannot be reused until the client
+ * @DMA_CTRL_ACK - if clear, the descriptor cannot be reused until the client
  *  acknowledges receipt, i.e. has has a chance to establish any dependency
  *  chains
  * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s)


Remove ifdef'd code.

Remove ifdef'd code.

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

--- include/llvm/Attributes.h
+++ include/llvm/Attributes.h
@@ -144,44 +144,6 @@
 class Attributes {
   // Currently, we need less than 64 bits.
   AttributesImpl Attrs;
-#if 0
-  enum Attribute {
-    None            = 0,        ///< No attributes have been set
-    ZExt            = 1 << 0,   ///< Zero extended before/after call
-    SExt            = 1 << 1,   ///< Sign extended before/after call
-    NoReturn        = 1 << 2,   ///< Mark the function as not returning
-    InReg           = 1 << 3,   ///< Force argument to be passed in register
-    StructRet       = 1 << 4,   ///< Hidden pointer to structure to return
-    NoUnwind        = 1 << 5,   ///< Function doesn't unwind stack
-    NoAlias         = 1 << 6,   ///< Considered to not alias after call
-    ByVal           = 1 << 7,   ///< Pass structure by value
-    Nest            = 1 << 8,   ///< Nested function static chain
-    ReadNone        = 1 << 9,   ///< Function does not access memory
-    ReadOnly        = 1 << 10,  ///< Function only reads from memory
-    NoInline        = 1 << 11,  ///< inline=never
-    AlwaysInline    = 1 << 12,  ///< inline=always
-    OptimizeForSize = 1 << 13,  ///< opt_size
-    StackProtect    = 1 << 14,  ///< Stack protection.
-    StackProtectReq = 1 << 15,  ///< Stack protection required.
-    Alignment       = 31 << 16, ///< Alignment of parameter (5 bits)
-                                ///< stored as log2 of alignment with +1 bias
-                                ///< 0 means unaligned different from align 1
-    NoCapture       = 1 << 21,  ///< Function creates no aliases of pointer
-    NoRedZone       = 1 << 22,  ///< Disable redzone
-    NoImplicitFloat = 1 << 23,  ///< Disable implicit floating point insts
-    Naked           = 1 << 24,  ///< Naked function
-    InlineHint      = 1 << 25,  ///< Source said inlining was desirable
-    StackAlignment  = 7 << 26,  ///< Alignment of stack for function (3 bits)
-                                ///< stored as log2 of alignment with +1 bias 0
-                                ///< means unaligned (different from
-                                ///< alignstack={1))
-    ReturnsTwice    = 1 << 29,  ///< Function can return twice
-    UWTable         = 1 << 30,  ///< Function must be in a unwind table
-    NonLazyBind     = 1U << 31, ///< Function is called early and/or
-                                ///< often, so lazy binding isn't worthwhile
-    AddressSafety   = 1ULL << 32 ///< Address safety checking is on.
-  };
-#endif
   explicit Attributes(AttributesImpl *A);
 public:
   Attributes() : Attrs(0) {}


Make a comment less terse.

Make a comment less terse.

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

--- include/llvm/BasicBlock.h
+++ include/llvm/BasicBlock.h
@@ -103,7 +103,8 @@
         Function *getParent()       { return Parent; }

   /// use_back - Specialize the methods defined in Value, as we know that an
-  /// BasicBlock can only be used by Instructions (specifically PHI and terms).
+  /// BasicBlock can only be used by Instructions (specifically PHI nodes and
+  /// terminators).
   Instruction       *use_back()       { return cast<Instruction>(*use_begin());}
   const Instruction *use_back() const { return cast<Instruction>(*use_begin());}


remove legacy interfaces

remove legacy interfaces

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

--- include/llvm/InstrTypes.h
+++ include/llvm/InstrTypes.h
@@ -242,53 +242,6 @@
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
   }
-
-  /// Backward-compatible interfaces
-  /// @deprecated in 2.4, do not use, will disappear soon
-  static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
-                                const std::string &Name = "",
-                                Instruction *InsertBefore = 0) {
-    return Create(Op, S1, S2, Name, InsertBefore);
-  }
-  static BinaryOperator *create(BinaryOps Op, Value *S1, Value *S2,
-                                const std::string &Name,
-                                BasicBlock *InsertAtEnd) {
-    return Create(Op, S1, S2, Name, InsertAtEnd);
-  }
-#define HANDLE_BINARY_INST(N, OPC, CLASS) \
-  static BinaryOperator *create##OPC(Value *V1, Value *V2, \
-                                     const std::string &Name = "") {\
-    return Create(Instruction::OPC, V1, V2, Name);\
-  }
-#include "llvm/Instruction.def"
-#define HANDLE_BINARY_INST(N, OPC, CLASS) \
-  static BinaryOperator *create##OPC(Value *V1, Value *V2, \
-                                     const std::string &Name, BasicBlock *BB) {\
-    return Create(Instruction::OPC, V1, V2, Name, BB);\
-  }
-#include "llvm/Instruction.def"
-#define HANDLE_BINARY_INST(N, OPC, CLASS) \
-  static BinaryOperator *create##OPC(Value *V1, Value *V2, \
-                                     const std::string &Name, Instruction *I) {\
-    return Create(Instruction::OPC, V1, V2, Name, I);\
-  }
-#include "llvm/Instruction.def"
-  static BinaryOperator *createNeg(Value *Op, const std::string &Name = "",
-                                   Instruction *InsertBefore = 0) {
-    return CreateNeg(Op, Name, InsertBefore);
-  }
-  static BinaryOperator *createNeg(Value *Op, const std::string &Name,
-                                   BasicBlock *InsertAtEnd) {
-    return CreateNeg(Op, Name, InsertAtEnd);
-  }
-  static BinaryOperator *createNot(Value *Op, const std::string &Name = "",
-                                   Instruction *InsertBefore = 0) {
-    return CreateNot(Op, Name, InsertBefore);
-  }
-  static BinaryOperator *createNot(Value *Op, const std::string &Name,
-                                   BasicBlock *InsertAtEnd) {
-    return CreateNot(Op, Name, InsertAtEnd);
-  }
 };

 template <>
@@ -534,40 +487,6 @@
   }
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
-  }
-  /// Backward-compatible interfaces
-  /// @deprecated in 2.4, do not use, will disappear soon
-  static CastInst *create(Instruction::CastOps Op,Value *S,const Type *Ty,
-    const std::string &Name = "",Instruction *InsertBefore = 0) {
-    return Create(Op,S,Ty,Name,InsertBefore);
-  }
-  static CastInst *create(Instruction::CastOps Op,Value *S,const Type *Ty,
-    const std::string &Name,BasicBlock *InsertAtEnd) {
-    return Create(Op,S,Ty,Name,InsertAtEnd);
-  }
-
-#define DEFINE_CASTINST_DEPRECATED(OP)                                  \
-  static CastInst *create ## OP ## Cast(Value *S, const Type *Ty,       \
-    const std::string &Name = "", Instruction *InsertBefore = 0) {      \
-    return Create ## OP ## Cast(S, Ty, Name, InsertBefore);             \
-  }                                                                     \
-  static CastInst *create ## OP ## Cast(Value *S, const Type *Ty,       \
-    const std::string &Name, BasicBlock *InsertAtEnd) {                 \
-    return Create ## OP ## Cast(S, Ty, Name, InsertAtEnd);              \
-  }
-  DEFINE_CASTINST_DEPRECATED(ZExtOrBit)
-  DEFINE_CASTINST_DEPRECATED(SExtOrBit)
-  DEFINE_CASTINST_DEPRECATED(Pointer)
-  DEFINE_CASTINST_DEPRECATED(FP)
-  DEFINE_CASTINST_DEPRECATED(TruncOrBit)
-#undef DEFINE_CASTINST_DEPRECATED
-  static CastInst *createIntegerCast(Value *S, const Type *Ty, bool isSigned,
-    const std::string &Name = "", Instruction *InsertBefore = 0) {
-    return CreateIntegerCast(S, Ty, isSigned, Name, InsertBefore);
-  }
-  static CastInst *createIntegerCast(Value *S, const Type *Ty, bool isSigned,
-    const std::string &Name, BasicBlock *InsertAtEnd) {
-    return CreateIntegerCast(S, Ty, isSigned, Name, InsertAtEnd);
   }
 };

@@ -740,18 +659,6 @@
     }
     return Type::Int1Ty;
   }
-  /// Backward-compatible interfaces
-  /// @deprecated in 2.4, do not use, will disappear soon
-  static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1,
-                         Value *S2, const std::string &Name = "",
-                         Instruction *InsertBefore = 0) {
-    return Create(Op, predicate, S1, S2, Name, InsertBefore);
-  }
-  static CmpInst *create(OtherOps Op, unsigned short predicate, Value *S1,
-                         Value *S2, const std::string &Name,
-                         BasicBlock *InsertAtEnd) {
-    return Create(Op, predicate, S1, S2, Name, InsertAtEnd);
-  }
 };


Use the opcode predicates, instead of duplicating the code.

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

--- include/llvm/InstrTypes.h
+++ include/llvm/InstrTypes.h
@@ -73,7 +73,7 @@
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const TerminatorInst *) { return true; }
   static inline bool classof(const Instruction *I) {
-    return I->getOpcode() >= TermOpsBegin && I->getOpcode() < TermOpsEnd;
+    return I->isTerminator();
   }
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
@@ -237,7 +237,7 @@
   // Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const BinaryOperator *) { return true; }
   static inline bool classof(const Instruction *I) {
-    return I->getOpcode() >= BinaryOpsBegin && I->getOpcode() < BinaryOpsEnd;
+    return I->isBinaryOp();
   }
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));
@@ -483,7 +483,7 @@
   /// @brief Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const CastInst *) { return true; }
   static inline bool classof(const Instruction *I) {
-    return I->getOpcode() >= CastOpsBegin && I->getOpcode() < CastOpsEnd;
+    return I->isCast();
   }
   static inline bool classof(const Value *V) {
     return isa<Instruction>(V) && classof(cast<Instruction>(V));