Checking whether or not a given string will be painted before we set up the GC (this got lost when we pushed such decision making into paint_string).  This probably would have fixed Woody's bug...

--- message_glyph.c
+++ message_glyph.c
@@ -28,7 +28,7 @@
 ****************************************************************/

 #ifndef lint
-static const char cvsid[] = "$Id: message_glyph.c,v 1.17 1999/09/13 03:52:45 phelps Exp $";
+static const char cvsid[] = "$Id: message_glyph.c,v 1.18 1999/09/13 07:04:41 phelps Exp $";
 #endif /* lint */

 #include <stdio.h>
@@ -295,8 +295,7 @@
 static void paint_string(
     message_glyph_t self,
     Display *display, Drawable drawable, GC gc, XFontStruct *font,
-    int offset, int lbearing, int rbearing, int baseline,
-    int string_width, char *string, int do_underline,
+    int offset, int string_width, int baseline, char *string, int do_underline,
     int x, int y, int width, int height)
 {
     XCharStruct *char_info;
@@ -304,26 +303,6 @@
     unsigned char *last;
     int left, right;

-    /* If the glyph is off to the left of the rectangle then quit */
-    if (offset + rbearing < x)
-    {
-	return;
-    }
-
-    /* If the glyph is off to the right of the rectangle then quit */
-    if (x + width < offset + lbearing)
-    {
-	return;
-    }
-
-#ifdef DEBUG_GLYPH
-    {
-	XGCValues values;
-	values.foreground = random();
-	XChangeGC(display, gc, GCForeground, &values);
-    }
-#endif /* DEBUG */
-
     /* Find the first visible character in the string */
     left = offset;
     first = (unsigned char *)string;
@@ -348,6 +327,14 @@
     }

+#ifdef DEBUG_GLYPH
+    {
+	XGCValues values;
+	values.foreground = random();
+	XChangeGC(display, gc, GCForeground, &values);
+    }
+#endif /* DEBUG */
+
     /* Draw all of the characters of the string */
     XDrawString(display, drawable, gc, left, baseline, first, last - first);

@@ -369,58 +356,70 @@
     int do_underline = message_has_attachment(self -> message);
     int level = self -> fade_level;
     int baseline = y + self -> ascent;
-    int left;
-    int right;
-
-    /* Draw the group string */
-    left = offset;
-    right = left + self -> group_width;
-    paint_string(
-	self, display, drawable, ScGCForGroup(self -> widget, level),
-	ScFontForGroup(self -> widget),
-	left, self -> group_lbearing, self -> group_rbearing, baseline,
-	self -> group_width, message_get_group(self -> message), do_underline,
-	x, y, width, height);
+    int left = offset;
+
+    /* Draw the group string if appropriate */
+    if ((x <= left + self -> group_rbearing) && (left + self -> group_lbearing <= x + width))
+    {
+	paint_string(
+	    self, display, drawable, ScGCForGroup(self -> widget, level),
+	    ScFontForGroup(self -> widget),
+	    left, self -> group_width, baseline,
+	    message_get_group(self -> message), do_underline,
+	    x, y, width, height);
+    }
+
+    left += self -> group_width;
+
+    /* Draw the separator if appropriate*/
+    if ((x <= left + self -> separator_rbearing) && (left + self -> separator_lbearing <= x + width))
+    {
+	paint_string(
+	    self, display, drawable, ScGCForSeparator(self -> widget, level),
+	    ScFontForSeparator(self -> widget),
+	    left, self -> separator_width, baseline,
+	    SEPARATOR, do_underline,
+	    x, y, width, height);
+    }
+
+    left += self -> separator_width;
+
+    /* Draw the user string */
+    if ((x <= left + self -> user_rbearing) && (left + self -> user_lbearing <= x + width))
+    {
+	paint_string(
+	    self, display, drawable, ScGCForUser(self -> widget, level),
+	    ScFontForUser(self -> widget),
+	    left, self -> user_width, baseline,
+	    message_get_user(self -> message), do_underline,
+	    x, y, width, height);
+    }
+
+    left += self -> user_width;

     /* Draw the separator */
-    left = right;
-    right = left + self -> separator_width;
-    paint_string(
-	self, display, drawable, ScGCForSeparator(self -> widget, level),
-	ScFontForSeparator(self -> widget),
-	left, self -> separator_lbearing, self -> separator_rbearing, baseline,
-	self -> separator_width, SEPARATOR, do_underline,
-	x, y, width, height);
-
-    /* Draw the user string */
-    left = right;
-    right = left + self -> user_width;
-    paint_string(
-	self, display, drawable, ScGCForUser(self -> widget, level),
-	ScFontForUser(self -> widget),
-	left, self -> user_lbearing, self -> user_rbearing, baseline,
-	self -> user_width, message_get_user(self -> message), do_underline,
-	x, y, width, height);
-
-    /* Draw the separator */
-    left = right;
-    right = left + self -> separator_width;
-    paint_string(
-	self, display, drawable, ScGCForSeparator(self -> widget, level),
-	ScFontForSeparator(self -> widget),
-	left, self -> separator_lbearing, self -> separator_rbearing, baseline,
-	self -> separator_width, SEPARATOR, do_underline,
-	x, y, width, height);
+    if ((x <= left + self -> separator_rbearing) && (left + self -> separator_lbearing <= x + width))
+    {
+	paint_string(
+	    self, display, drawable, ScGCForSeparator(self -> widget, level),
+	    ScFontForSeparator(self -> widget),
+	    left, self -> separator_width, baseline,
+	    SEPARATOR, do_underline,
+	    x, y, width, height);
+    }
+
+    left += self -> separator_width;

     /* Draw the message */
-    left = right;
-    right = left + self -> string_width;
-    paint_string(
-	self, display, drawable, ScGCForString(self -> widget, level),
-	ScFontForString(self -> widget),
-	left, self -> string_lbearing, self -> string_rbearing, baseline,
-	self -> string_width, message_get_string(self -> message), do_underline,
-	x, y, width, height);
+    if ((x <= left + self -> string_rbearing) && (left + self -> separator_lbearing <= x + width))
+    {
+	paint_string(
+	    self, display, drawable, ScGCForString(self -> widget, level),
+	    ScFontForString(self -> widget),
+	    left, self -> string_width, baseline,
+	    message_get_string(self -> message), do_underline,
+	    x, y, width, height);
+    }
 }

 /* Answers True if the receiver has [been] expired */


perf stat: Use perf_evsel__read_cb in read_counter

Replacing __perf_evsel__read_on_cpu function with perf_evsel__read_cb
function. The read_cb callback will be used later for global aggregation
counter values as well.

Signed-off-by: Jiri Olsa <2c6594f608aa3d41e98d48846a6328831f7084ad@kernel.org>
Cc: Andi Kleen <0474aee45985f5ae829f53849df476200e876990@linux.intel.com>
Cc: Corey Ashford <d8c6f216c17042adc228efa9f1d34ca50bd37e4b@linux.vnet.ibm.com>
Cc: David Ahern <b80c1600f604d3b0d768f26f90a76757e76005dd@gmail.com>
Cc: Frederic Weisbecker <e8a1bf9163cb25e93cfd6540f223b3872ea7ee55@gmail.com>
Cc: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>
Cc: Matt Fleming <b02f0790d66a0f0a6b369873bf6df37420fbe5dd@intel.com>
Cc: Namhyung Kim <5c915a589b3ddf58cebf14bec41bcc143b37ac3c@kernel.org>
Cc: Paul Mackerras <19a0ba370c443ba08d20b5061586430ab449ee8c@samba.org>
Cc: Peter Zijlstra <645ca7d3a8d3d4f60557176cd361ea8351edc32b@chello.nl>
Cc: Stephane Eranian <f199ae9781930a5b94b284ca2f471140752002a7@google.com>
Link: http://lkml.kernel.org/r/1416562275-12404-5-git-send-email-2c6594f608aa3d41e98d48846a6328831f7084ad@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <293abb6b76d7791c0732cc517d38c4b5c734b87f@redhat.com>


drm/nv108/gr: enable acceleration with our chsw ucode

Signed-off-by: Ben Skeggs <d9f27fb07c1e9f131223ad827fa5179f3846c30b@redhat.com>


ixgbevf: add wait for Rx queue disable

ixgbevf: add wait for Rx queue disable

New function was added to wait for Rx queues to be disabled before
disabling NAPI. This function also allows us to  modify
ixgbevf_rx_desc_queue_enable() to better match ixgbe.  I also cleaned up
some msleep calls to usleep_range while I was in this code anyway.

Signed-off-by: Alexander Duyck <af56634f9be8457194a3461ec96c497f138af4ff@intel.com>
Signed-off-by: Don Skidmore <db552506339f77ba9019f0c6d9084f81cf1d1757@intel.com>
Tested-by: Stephen Ko <62e072d38818c16b5fb04a74a1e79fd680cb696e@intel.com>
Signed-off-by: Jeff Kirsher <87e35f5be20bb3e67f4ba6b86f5f6be3085b1b3a@intel.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1302,27 +1302,51 @@
 	}
 }

-#define IXGBE_MAX_RX_DESC_POLL 10
-static inline void ixgbevf_rx_desc_queue_enable(struct ixgbevf_adapter *adapter,
-						int rxr)
+#define IXGBEVF_MAX_RX_DESC_POLL 10
+static void ixgbevf_rx_desc_queue_enable(struct ixgbevf_adapter *adapter,
+					 int rxr)
 {
 	struct ixgbe_hw *hw = &adapter->hw;
+	int wait_loop = IXGBEVF_MAX_RX_DESC_POLL;
+	u32 rxdctl;
 	int j = adapter->rx_ring[rxr].reg_idx;
-	int k;
-
-	for (k = 0; k < IXGBE_MAX_RX_DESC_POLL; k++) {
-		if (IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j)) & IXGBE_RXDCTL_ENABLE)
-			break;
-		else
-			msleep(1);
-	}
-	if (k >= IXGBE_MAX_RX_DESC_POLL) {
-		hw_dbg(hw, "RXDCTL.ENABLE on Rx queue %d "
-		       "not set within the polling period\n", rxr);
-	}
-
-	ixgbevf_release_rx_desc(hw, &adapter->rx_ring[rxr],
-				adapter->rx_ring[rxr].count - 1);
+
+	do {
+		usleep_range(1000, 2000);
+		rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j));
+	} while (--wait_loop && !(rxdctl & IXGBE_RXDCTL_ENABLE));
+
+	if (!wait_loop)
+		hw_dbg(hw, "RXDCTL.ENABLE queue %d not set while polling\n",
+		       rxr);
+
+	ixgbevf_release_rx_desc(&adapter->hw, &adapter->rx_ring[rxr],
+				(adapter->rx_ring[rxr].count - 1));
+}
+
+static void ixgbevf_disable_rx_queue(struct ixgbevf_adapter *adapter,
+				     struct ixgbevf_ring *ring)
+{
+	struct ixgbe_hw *hw = &adapter->hw;
+	int wait_loop = IXGBEVF_MAX_RX_DESC_POLL;
+	u32 rxdctl;
+	u8 reg_idx = ring->reg_idx;
+
+	rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(reg_idx));
+	rxdctl &= ~IXGBE_RXDCTL_ENABLE;
+
+	/* write value back with RXDCTL.ENABLE bit cleared */
+	IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(reg_idx), rxdctl);
+
+	/* the hardware may take up to 100us to really disable the rx queue */
+	do {
+		udelay(10);
+		rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(reg_idx));
+	} while (--wait_loop && (rxdctl & IXGBE_RXDCTL_ENABLE));
+
+	if (!wait_loop)
+		hw_dbg(hw, "RXDCTL.ENABLE queue %d not cleared while polling\n",
+		       reg_idx);
 }

 static void ixgbevf_save_reset_stats(struct ixgbevf_adapter *adapter)
@@ -1654,7 +1678,10 @@

 	/* signal that we are down to the interrupt handler */
 	set_bit(__IXGBEVF_DOWN, &adapter->state);
-	/* disable receives */
+
+	/* disable all enabled rx queues */
+	for (i = 0; i < adapter->num_rx_queues; i++)
+		ixgbevf_disable_rx_queue(adapter, &adapter->rx_ring[i]);

 	netif_tx_disable(netdev);


tools/tpm2_nvreadpublic: Fix resource leak

Signed-off-by: Imran Desai <d01faadd01d89088a38277c634ffb396f2b368f8@intel.com>

--- tools/tpm2_nvreadpublic.c
+++ tools/tpm2_nvreadpublic.c
@@ -41,6 +41,7 @@
     rc = tpm2_tr_get_name(context, tr_handle,
             &name);
     if (rc != tool_rc_success) {
+        free(attrs);
         return rc;
     }


Fix comments of encoded image buffer

Fix comments of encoded image buffer

Remove some uneccessary comments of encoded image buffer
and note that raw buffer will be copied inside.

Change-Id: Ia9527f55790064ef039f573e3b7ef35fdfd26224
Signed-off-by: Eunki Hong <301831f1139537c1cbbc3eb529a9eda692d8c1bb@samsung.com>

--- dali/public-api/adaptor-framework/encoded-image-buffer.h
+++ dali/public-api/adaptor-framework/encoded-image-buffer.h
@@ -34,10 +34,7 @@
 /**
  * @brief EncodedImageBuffer contains the large encoded raw buffer informations.
  *
- * We can upload this buffer by generated url.
- * The images are loaded by a worker thread to avoid blocking the main event thread.
- * @note cannot change raw buffer after make handle.
- * @note only regular image upload support now.
+ * @note Object will copy raw buffer data.
  */
 class DALI_ADAPTOR_API EncodedImageBuffer : public BaseHandle
 {


Staging: lustre: Fixed syntax errors reported by checkpatch.pl script for file types.h

Added space after ',' and moved '{' to same line as struct as instructed by checkpatch.pl script.

Signed-off-by: Joshua Baldock <71ea65c906ec824a38b0fdff469f7c961a49ecf7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


Add DependencyObject for Enum Macro.

Add DependencyObject for Enum Macro.

--- Mntone.Xamcc/Mntone.Xamcc.Shared/include/DependencyObjectPreprocessor.h
+++ Mntone.Xamcc/Mntone.Xamcc.Shared/include/DependencyObjectPreprocessor.h
@@ -10,6 +10,8 @@
 #define __IMPL_DP_SET(__CLASS__, __TYPE__, __NAME__) void __CLASS__::__NAME__::set(__TYPE__^ value){SetValue(__IMPL_DP_PROP(__NAME__),value);}
 #define __IMPL_DP_VALUE_GET(__CLASS__, __TYPE__, __NAME__) __TYPE__ __CLASS__::__NAME__::get(){return static_cast<__TYPE__>(GetValue(__IMPL_DP_PROP(__NAME__)));}
 #define __IMPL_DP_VALUE_SET(__CLASS__, __TYPE__, __NAME__) void __CLASS__::__NAME__::set(__TYPE__ value){SetValue(__IMPL_DP_PROP(__NAME__),value);}
+#define __IMPL_DP_ENUM_GET(__CLASS__, __TYPE__, __NAME__) __TYPE__ __CLASS__::__NAME__::get(){auto intValue = dynamic_cast<::Platform::IBox<int32>^>(GetValue(__IMPL_DP_PROP(__NAME__)));return intValue ? static_cast<__TYPE__>(intValue->Value) : static_cast<__TYPE__>(0);}
+#define __IMPL_DP_ENUM_SET(__CLASS__, __TYPE__, __NAME__) void __CLASS__::__NAME__::set(__TYPE__ value){SetValue(__IMPL_DP_PROP(__NAME__),static_cast<int32>(value));}

 #define __IMPL_DP_REG_BEGIN(__CLASS__, __TYPE__, __NAME__) \
 Windows::UI::Xaml::DependencyProperty^ __CLASS__::__IMPL_DP_PROP(__NAME__) = Windows::UI::Xaml::DependencyProperty::Register( \
@@ -42,4 +44,17 @@
 	__IMPL_DP_VALUE_GET(__CLASS__, __TYPE__, __NAME__) \
 	__IMPL_DP_VALUE_SET(__CLASS__, __TYPE__, __NAME__) \
 	__IMPL_DP_REG(__CLASS__, __TYPE__, __NAME__, __PM__)
+
+#define IMPL_DP_ENUM_GET(__CLASS__, __TYPE__, __NAME__, __PM__) \
+	__IMPL_DP_ENUM_GET(__CLASS__, __TYPE__, __NAME__) \
+	__IMPL_DP_REG(__CLASS__, int, __NAME__, __PM__)
+
+#define IMPL_DP_ENUM_SET(__CLASS__, __TYPE__, __NAME__, __PM__) \
+	__IMPL_DP_ENUM_SET(__CLASS__, __TYPE__, __NAME__) \
+	__IMPL_DP_REG(__CLASS__, int, __NAME__, __PM__)
+
+#define IMPL_DP_ENUM_GETSET(__CLASS__, __TYPE__, __NAME__, __PM__) \
+	__IMPL_DP_ENUM_GET(__CLASS__, __TYPE__, __NAME__) \
+	__IMPL_DP_ENUM_SET(__CLASS__, __TYPE__, __NAME__) \
+	__IMPL_DP_REG(__CLASS__, int, __NAME__, __PM__)
 #endif


staging: rtl8723au: osdep_service.h: Reduce excessive header inclusion

Signed-off-by: Jes Sorensen <0e1e349bdba396f044a06b01fef702e072aa66d3@redhat.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


ENH: Add itkBSplineControlPointImageFilter RTTI.

Add missing RTTI for itkBSplineControlPointImageFilter.

Change-Id: Ib74d899cf91263753261028dbe3651f5ff536bfc

--- Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.h
+++ Modules/Filtering/ImageGrid/include/itkBSplineControlPointImageFilter.h
@@ -68,6 +68,9 @@

   /** Method for creation through the object factory. */
   itkNewMacro(Self);
+
+  /** Run-time type information (and related methods). */
+  itkTypeMacro(BSplineControlPointImageFilter, ImageToImageFilter);

   /** Extract dimension from input image. */
   itkStaticConstMacro( ImageDimension, unsigned int,


staging: rtl8723au: rtw_cfg80211_ap_set_encryption(): Use key len from struct key_params

Signed-off-by: Jes Sorensen <0e1e349bdba396f044a06b01fef702e072aa66d3@redhat.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


staging: wilc1000: remove USE_SUPPLICANT_GO_INTENT

This patch removes USE_SUPPLICANT_GO_INTENT macro that is commented.

Signed-off-by: Chaehyun Lim <cbe9b9d6f673cb1ece7082f467dd3b6acd0f8185@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


Clean up folder sync MessageComplete some more

There's no need to have two separate variables for errors when all we're
going to do is assign one to the other immediately.

--- eas-daemon/libeas/eas-sync-folder-hierarchy-req.c
+++ eas-daemon/libeas/eas-sync-folder-hierarchy-req.c
@@ -242,29 +242,22 @@
  * @param error any error that occured (or NULL) [full transfer]
  */
 gboolean
-eas_sync_folder_hierarchy_req_MessageComplete (EasSyncFolderHierarchyReq* self, xmlDoc *doc, GError* error_in)
-{
-    GError *error = NULL;
+eas_sync_folder_hierarchy_req_MessageComplete (EasSyncFolderHierarchyReq* self, xmlDoc *doc, GError* error)
+{
     EasSyncFolderHierarchyReqPrivate* priv = self->priv;
-    gboolean ret;
 	GSList* added_folders = NULL;
 	GSList* updated_folders  = NULL;
 	GSList* deleted_folders  = NULL;
 	const gchar *ret_sync_key = NULL;

     // if an error occurred, store it and signal daemon
-    if (error_in)
-    {
-        ret = FALSE;
-        error = error_in;
-        goto finish;
-    }
+    if (error)
+        goto finish;

     g_debug ("eas_sync_folder_hierarchy_req_MessageComplete++");

     // if an error occurs when parsing, store it
-    ret = eas_sync_folder_msg_parse_response (priv->syncFolderMsg, doc, &error);
-    if (!ret)
+    if (!eas_sync_folder_msg_parse_response (priv->syncFolderMsg, doc, &error))
     {
         g_assert (error != NULL);
         goto finish;


Turn on advanced MP api for unix build

Turn on advanced MP api for unix build

--- ports/unix/mpconfigport.h
+++ ports/unix/mpconfigport.h
@@ -60,6 +60,7 @@
 #define MICROPY_MALLOC_USES_ALLOCATED_SIZE (1)
 #define MICROPY_MEM_STATS           (1)
 #define MICROPY_DEBUG_PRINTERS      (1)
+#define CIRCUITPY_MICROPYTHON_ADVANCED (1)
 // Printing debug to stderr may give tests which
 // check stdout a chance to pass, etc.
 #define MICROPY_DEBUG_PRINTER       (&mp_stderr_print)


Added Plain Text resource type

Added Plain Text resource type

--- Runtime/Resource/Resource.h
+++ Runtime/Resource/Resource.h
@@ -1,6 +1,8 @@
 #pragma once

 #include "Core/SubSystem.h"
+#include <fstream>
+#include <string>

 namespace Mile
 {
@@ -14,7 +16,8 @@
         RT_Material,
         RT_Shader,
         RT_Audio,
-        RT_Script
+        RT_Script,
+        RT_PlainText
     };

     class MEAPI Resource
@@ -33,6 +36,8 @@
         static std::string GetFileNameFromPath( const std::string& filePath );
         static std::string GetFolderFromPath( const std::string& filePath );

+        virtual bool Save( ) { return false; }
+
     protected:
         std::string     m_path;
         std::string     m_name;


Bugzilla bug #41832: set the error codes if pthread_cond_wait or pthread_cond_timedwait fails.

--- pr/src/pthreads/ptsynch.c
+++ pr/src/pthreads/ptsynch.c
@@ -256,7 +256,8 @@

     /* NSPR doesn't report timeouts */
 #ifdef _PR_DCETHREADS
-    return (rv == -1 && errno == EAGAIN) ? 0 : rv;
+    if (rv == -1) return (errno == EAGAIN) ? 0 : errno;
+    else return rv;
 #else
     return (rv == ETIMEDOUT) ? 0 : rv;
 #endif
@@ -384,7 +385,12 @@
     PR_ASSERT(0 == cvar->lock->notified.length);
     thred->waiting = NULL;  /* and now we're not */
     if (_PT_THREAD_INTERRUPTED(thred)) goto aborted;
-    return (rv == 0) ? PR_SUCCESS : PR_FAILURE;
+    if (rv != 0)
+    {
+        _PR_MD_MAP_DEFAULT_ERROR(rv);
+        return PR_FAILURE;
+    }
+    return PR_SUCCESS;

 aborted:
     PR_SetError(PR_PENDING_INTERRUPT_ERROR, 0);
@@ -1081,7 +1087,12 @@
         rv = pthread_cond_wait(&cvar->cv, &ml->mutex);
     else
         rv = pt_TimedWait(&cvar->cv, &ml->mutex, timeout);
-    return (rv == 0) ? PR_SUCCESS : PR_FAILURE;
+    if (rv != 0)
+    {
+        _PR_MD_MAP_DEFAULT_ERROR(rv);
+        return PR_FAILURE;
+    }
+    return PR_SUCCESS;
 }  /* PRP_NakedWait */

 PR_IMPLEMENT(PRStatus) PRP_NakedNotify(PRCondVar *cvar)


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

--- seqan/projects/library/seqan/store/store_io_sam.h
+++ seqan/projects/library/seqan/store/store_io_sam.h
@@ -324,7 +324,8 @@
 				// if the read is in the store and paired
 				// check the mate pair store if it is the same mate of the pair
 				// assuming that only one flag 0x040 or 0x0080 is 1
-				int inPair = (flag & 0x80) >> 7;
+				int inPair = 1 - ((flag & 0x40) >> 6);	// bit 7 is set => inPair = 0
+														// else inPair = 1 (even if bits 6 and 7 are not set)

 				TId matePairId = fragStore.readStore[readId].matePairId;
 				if (matePairId != TMatePairElement::INVALID_ID)


hts221: examples updated

hts221: examples updated

 - updated   platform functions in SPC584B_DIS case

--- hts221_STdC/example/hts221_read_data_polling.c
+++ hts221_STdC/example/hts221_read_data_polling.c
@@ -277,20 +277,21 @@
 }

 /*
- * @brief  Send buffer to console (platform dependent)
- *
- * @param  tx_buffer     buffer to trasmit
+ * @brief  Write generic device register (platform dependent)
+ *
+ * @param  tx_buffer     buffer to transmit
  * @param  len           number of byte to send
  *
  */
 static void tx_com(uint8_t *tx_buffer, uint16_t len)
 {
-  #ifdef NUCLEO_F411RE
+#if defined(NUCLEO_F411RE)
   HAL_UART_Transmit(&huart2, tx_buffer, len, 1000);
-  #endif
-  #ifdef STEVAL_MKI109V3
+#elif defined(STEVAL_MKI109V3)
   CDC_Transmit_FS(tx_buffer, len);
-  #endif
+#elif defined(SPC584B_DIS)
+  sd_lld_write(&SD2, tx_buffer, len);
+#endif
 }

 /*
@@ -301,7 +302,11 @@
  */
 static void platform_delay(uint32_t ms)
 {
+#if defined(NUCLEO_F411RE) | defined(STEVAL_MKI109V3)
   HAL_Delay(ms);
+#elif defined(SPC584B_DIS)
+  osalThreadDelayMilliseconds(ms);
+#endif
 }

 /*


SourceLevelDebugPkg/SmmDebugAgent: Initialize Local APIC Timer

Now Debug Agent library uses Local APIC Timer to implement time-out mechanism.
In SMM, SMM BSP maybe not be the one in DXE phase, its local APIC timer may not
work. This fix is to initialize Local APIC timer if it doesn't work as expected
at SMM entry.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: 3158a46dfd52e07d1fda3e32e1ab2e353a00b20f@17500 6f19259b-4bc3-4df7-8a09-765794883524

--- SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
+++ SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgent/SmmDebugAgentLib.c
@@ -190,6 +190,8 @@
   DEBUG_AGENT_MAILBOX           *Mailbox;
   UINT64                        *MailboxLocation;
   UINT32                        DebugTimerFrequency;
+  BOOLEAN                       PeriodicMode;
+  UINTN                         TimerCycle;

   switch (InitFlag) {
   case DEBUG_AGENT_INIT_SMM:
@@ -275,7 +277,15 @@
   case DEBUG_AGENT_INIT_ENTER_SMI:
     SaveDebugRegister ();
     InitializeDebugIdt ();
-
+    //
+    // Check if CPU APIC Timer is working, otherwise initialize it.
+    //
+    GetApicTimerState (NULL, &PeriodicMode, NULL);
+    TimerCycle = GetApicTimerInitCount ();
+    if (PeriodicMode != TRUE || TimerCycle == 0) {
+      InitializeDebugTimer (NULL);
+      DisableApicTimerInterrupt ();
+    }
     Mailbox = GetMailboxPointer ();
     if (GetDebugFlag (DEBUG_AGENT_FLAG_AGENT_IN_PROGRESS) == 1) {
       //


syscall call properly

syscall call properly

--- hw3/syscall/check_space_and_get_measurements.c
+++ hw3/syscall/check_space_and_get_measurements.c
@@ -1,14 +1,13 @@
 #include <stdio.h>
 #include "syscall_wrapper.h"
-

 int main(int argc, char* argv[] ) {

 	//Print Allocated Memory
-	printf("Average memory which is allocated: %lu \n",slob_get_total_alloc_mem());
+	printf("Average memory which is allocated: %lu \n",get_total_alloc_mem_syscall_wrapper());

 	//Print Free Memory
-	printf("Average memory which is free: %lu \n", slob_get_total_free_mem());
+	printf("Average memory which is free: %lu \n", get_total_free_mem_syscall_wrapper());

 	return 0;
-}+}


DEBUG is either defined or not defined for the 'calender' sources, so use #ifdef and not just #if -- both to be semantically correct and also to be aligned with the rest of the 'calendar' sources

--- usr.bin/calendar/ostern.c
+++ usr.bin/calendar/ostern.c
@@ -87,7 +87,7 @@
 	else
 		return (0);

-#if DEBUG
+#ifdef DEBUG
 	printf("%s %d %d\n", s, year, EASTERNAMELEN);
 #endif


Once in a month, when the moon is full, killall mistakenly considers
living process as a zombie and refuses to kill it. The cause is that
the code masks ki_stat with SZOMB to compare with SZOMB, but ki_stat
is not a mask.

Possibly reported by:	cperciva
MFC after:	3 days

--- usr.bin/killall/killall.c
+++ usr.bin/killall/killall.c
@@ -319,7 +319,7 @@
 	mypid = getpid();

 	for (i = 0; i < nprocs; i++) {
-		if ((procs[i].ki_stat & SZOMB) == SZOMB && !zflag)
+		if (procs[i].ki_stat == SZOMB && !zflag)
 			continue;
 		thispid = procs[i].ki_pid;
 		strlcpy(thiscmd, procs[i].ki_comm, sizeof(thiscmd));


Fix an issue of khttpdctl 'load' command.

--- usr.sbin/khttpdctl/main.c
+++ usr.sbin/khttpdctl/main.c
@@ -84,8 +84,10 @@
 	ssize_t rsize;
 	int fd;

-	if (argc <= 1 || 2 < argc)
-		err(EX_USAGE, "usage) %s load file", argv[0]);
+	if (argc != 3) {
+		fprintf(stderr, "usage) %s load file\n", argv[0]);
+		exit(EX_USAGE);
+	}

 	config = argv[2];

@@ -197,15 +199,16 @@
 main(int argc, char **argv)
 {
 	struct command *cmd;
-	int i;

 	dev_fd = open("/dev/khttpd", O_RDWR);
 	if (dev_fd == -1)
 		err(EX_CONFIG, "Can't find /dev/khttpd.  Is khttpd running?");

 	cmd = find_command(argv[1]);
-	if (cmd == NULL)
-		err(EX_USAGE, "Unknown command \"%s\"", argv[1]);
+	if (cmd == NULL) {
+		fprintf(stderr, "Unknown command \"%s\"\n", argv[1]);
+		exit(EX_USAGE);
+	}

 	cmd->handler(argc, argv);


Fix to output error message when wd_escalation_command fails with code other than 0

--- src/watchdog/wd_packet.c
+++ src/watchdog/wd_packet.c
@@ -931,7 +931,17 @@
 	/* execute escalation command */
 	if (strlen(pool_config->wd_escalation_command))
 	{
-		system(pool_config->wd_escalation_command);
+		int r;
+		r = system(pool_config->wd_escalation_command);
+		if (WIFEXITED(r))
+		{
+			if (WEXITSTATUS(r) == EXIT_SUCCESS)
+				pool_log("wd_escalation: escalation command succeeded");
+			else
+				pool_error("wd_escalation: escalation command failed. exit status: %d", WEXITSTATUS(r));
+		}
+		else
+				pool_error("wd_escalation: escalation command exit abnormally");
 	}

 	/* interface up as delegate IP */


Simplify layout code

Simplify layout code

--- src/watchface-tutorial.c
+++ src/watchface-tutorial.c
@@ -34,29 +34,13 @@
   s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BACKGROUND);

   // Create BitmapLayer to display the GBitmap
-#if defined(PBL_SDK_2)
   s_background_layer = bitmap_layer_create(bounds);
-#elif defined(PBL_SDK_3)
-  GRect bitmap_bounds = gbitmap_get_bounds(s_background_bitmap);
-
-  // Inset the window bounds to center the image
-  const GEdgeInsets bitmap_insets = GEdgeInsets(
-    (bounds.size.h - bitmap_bounds.size.h) / 2,
-    (bounds.size.w - bitmap_bounds.size.w) / 2);
-  s_background_layer = bitmap_layer_create(grect_inset(bounds, bitmap_insets));
-#endif
-
   bitmap_layer_set_bitmap(s_background_layer, s_background_bitmap);
   layer_add_child(window_layer, bitmap_layer_get_layer(s_background_layer));

   // Create time TextLayer
-#if defined(PBL_SDK_2)
-  s_time_layer = text_layer_create(GRect(5, 52, 139, 50));
-#elif defined(PBL_SDK_3)
-  const int text_height = 65;
-  const GEdgeInsets text_insets = GEdgeInsets((bounds.size.h - text_height) / 2, 0);
-  s_time_layer = text_layer_create(grect_inset(bounds, text_insets));
-#endif
+  s_time_layer = text_layer_create(
+    GRect(0, PBL_IF_ROUND_ELSE(58, 52), bounds.size.w, 50));
   text_layer_set_background_color(s_time_layer, GColorClear);
   text_layer_set_text_color(s_time_layer, GColorBlack);
   text_layer_set_text(s_time_layer, "00:00");
@@ -70,15 +54,8 @@
   layer_add_child(window_layer, text_layer_get_layer(s_time_layer));

   // Create temperature Layer
-#if defined(PBL_SDK_2)
-  s_weather_layer = text_layer_create(GRect(0, 120, 144, 25));
-#elif defined(PBL_SDK_3)
-  const int weather_text_margin_top = 50;
-  const GEdgeInsets weather_insets = {
-    .top = bounds.size.h - weather_text_margin_top };
-
-  s_weather_layer = text_layer_create(grect_inset(bounds, weather_insets));
-#endif
+  s_weather_layer = text_layer_create(
+    GRect(0, PBL_IF_ROUND_ELSE(125, 120), bounds.size.w, 25));
   text_layer_set_background_color(s_weather_layer, GColorClear);
   text_layer_set_text_color(s_weather_layer, GColorWhite);
   text_layer_set_text_alignment(s_weather_layer, GTextAlignmentCenter);


Changed to use region contraction. Appears to be working much better.

--- despot2_main.c
+++ despot2_main.c
@@ -39,7 +39,6 @@
 	//**************************************************************************
 	// Argument Processing
 	//**************************************************************************
-	fprintf(stdout, "YAH");
 	if (argc < 4)
 	{
 		fprintf(stderr, "%s", usage);
@@ -124,12 +123,12 @@
 	// Need to write a full file of zeros first otherwise per-plane writing
 	// won't produce a complete image.
 	//**************************************************************************
-	#define NR 4
+	#define NR 3
 	nifti_image **resultsHeaders = malloc(NR * sizeof(nifti_image *));
 	int outDims[8] = {3, ssfpFiles[0]->nx, ssfpFiles[0]->ny, ssfpFiles[0]->nz, 1, 1, 1, 1};
 	float *blank = calloc(totalVoxels, sizeof(float));
 	float **resultsSlices = malloc(NR * sizeof(float*));
-	char *names[NR] = { "_M0", "_T2", "_B0", "_res" };
+	char *names[NR] = { "_T2", "_B0", "_res" };
 	char outName[strlen(outPrefix) + 12];
 	for (int r = 0; r < NR; r++)
 	{
@@ -199,6 +198,7 @@
 					signals[p] = malloc(nSSFP[p] * sizeof(double));
 					for (int img = 0; img < nSSFP[p]; img++)
 						signals[p][img] = (double)ssfpData[p][voxelsPerSlice * img + vox];
+					arrayScale(signals[p], signals[p], 1. / arrayMean(signals[p], nSSFP[p]), nSSFP[p]);
 					consts[p] = arrayAlloc(4);
 					consts[p][0] = ssfpTR;
 					consts[p][1] = T1;
@@ -207,64 +207,15 @@

 					fs[p] = &a1cSSFP;
 				}
-
-				// Find the phase that gives lowest residual from classic DESPOT2
-				params[3] = NUM_MAX; // 3 = residual
-				for (int p = 0; p < nPhases; p++)
-				{
-					double tempParams[2];
-					classicDESPOT2(ssfpAngles[p], signals[p],
-				                   nSSFP[p], ssfpTR, T1, B1, tempParams);
-					double tempRes = calcAResiduals(tempParams, consts[p], ssfpAngles[p], signals[p], nSSFP[p], a1cSSFP, NULL, FALSE);
-
-					if (tempRes < params[3])
-					{
-						params[3] = tempRes;
-						arrayCopy(params, tempParams, 2);
-					}
-				}
-
-				if (nPhases > 1)
-				{
-					// If classic DESPOT gives rubbish, just try a really short T2
-					if (params[1] < 1.)
-						params[1] = 1.;
-
-					for (int p = 0; p < nPhases; p++)
-						arrayScale(signals[p], signals[p], 1. / arrayMean(signals[p], nSSFP[p]), nSSFP[p]);
-					// Try fits with different B0 start and take lowest res
-					extern int MATH_DEBUG;
-					MATH_DEBUG = 0;
-					double T2guess = params[1];
-					for (int i = 0; i < 20; i++)
-					{
-						double tempParams[2] = { T2guess, (2 * M_PI) * i / 20. }, tempRes;
-						double loBounds[2] = {1., -INFINITY};
-						double *hiBounds = NULL;
-						extern int MATH_DEBUG;
-						//MATH_DEBUG = 1;
-						levMar(tempParams, 2, consts, ssfpAngles, signals, fs,
-							   NULL, nSSFP, nPhases, loBounds, hiBounds,
-							   true, &tempRes);
-						//MATH_DEBUG = 0;
-						if (tempRes < params[3])
-						{
-							params[3] = tempRes;
-							params[1] = tempParams[0];
-							params[2] = tempParams[1];
-						}
-					}
-				}
-
-				if (params[0] < 0.) params[0] = 0.;
-				if (params[1] < 1.) params[1] = 1.;
-				if (params[1] > 150.) params[1] = 150.;
-				params[2] = fabs(fmod(params[2], 2 * M_PI));
-				/*if (params[2] < -M_PI)
-					params[2] += 2 * M_PI;
-				if (params[2] >  M_PI)
-					params[2] -= 2 * M_PI;*/
-				//params[2] *= 1.e3;           // Convert B0 to Hz
+
+				double loBounds[2] = { 1., 0. };
+				double hiBounds[2] = { 150., 2. * M_PI };
+				double *bounds[2] = { loBounds, hiBounds };
+				bool loC[2] = { TRUE, FALSE }, hiC[2] = { FALSE, FALSE };
+				bool *constrained[2] = { loC, hiC };
+
+				regionContraction(params, 2, consts, nPhases, ssfpAngles, signals, nSSFP, TRUE, fs, bounds, constrained, 2000, 20, 10, 0.05, 0.05, &(params[2]));
+				params[1] = fabs(fmod(params[1], 2 * M_PI));

 				// Clean up memory
 				for (int p = 0; p < nPhases; p++)


Closes #6: Don't use static sf::Textures

--- SFML/imgui-rendering-SFML.h
+++ SFML/imgui-rendering-SFML.h
@@ -5,12 +5,13 @@
 #include <SFML/Graphics/Texture.hpp>
 #include <SFML/Graphics/RenderTarget.hpp>
 #include <iostream>
+#include <memory>
 namespace ImGui
 {
     namespace ImImpl
     {
         static sf::RenderTarget* ImImpl_rtarget;
-        static sf::Texture ImImpl_fontTex;
+        static std::shared_ptr<sf::Texture> ImImpl_fontTex;

         static void ImImpl_RenderDrawLists(ImDrawData* draw_data)
         {
@@ -63,7 +64,7 @@
                     else
                     {
                         sf::Vector2u win_size = ImImpl_rtarget->getSize();
-                        sf::Texture::bind(&ImImpl::ImImpl_fontTex);
+                        sf::Texture::bind(ImImpl::ImImpl_fontTex.get());
                         glScissor((int)pcmd->ClipRect.x, (int)(win_size.y - pcmd->ClipRect.w), (int)(pcmd->ClipRect.z - pcmd->ClipRect.x), (int)(pcmd->ClipRect.w - pcmd->ClipRect.y));
                         glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, GL_UNSIGNED_SHORT, idx_buffer);
                     }
@@ -97,8 +98,9 @@
             unsigned char* pixels;
             int width, height;
             io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
-            ImImpl::ImImpl_fontTex.create(width, height);
-            ImImpl::ImImpl_fontTex.update(pixels);
+            ImImpl::ImImpl_fontTex = std::make_shared<sf::Texture>();
+            ImImpl::ImImpl_fontTex->create(width, height);
+            ImImpl::ImImpl_fontTex->update(pixels);
             io.Fonts->TexID = (void*)&ImImpl::ImImpl_fontTex;
             io.Fonts->ClearInputData();
             io.Fonts->ClearTexData();


Aligned comments

Aligned comments

--- SPLIT/correlation_control.c
+++ SPLIT/correlation_control.c
@@ -1,14 +1,14 @@
 /**
- *	File: correlationCPUCode.c
- *	Purpose: calling correlationSAPI.h for correlation.max
+ * File: correlationCPUCode.c
+ * Purpose: calling correlationSAPI.h for correlation.max
  *
- *	Correlation formula:
- *		scalar r(x,y) = (n*SUM(x,y) - SUM(x)*SUM(y))*SQRT_INVERSE(x)*SQRT_INVERSE(y)
- *		where:
- *			x,y,... 		- Time series data to be correlated
- *			n 			- window for correlation (minimum size of 2)
- *			SUM(x) 			- sum of all elements inside a window
- *			SQRT_INVERSE(x)		- 1/sqrt(n*SUM(x^2)- (SUM(x)^2))
+ * Correlation formula:
+ *	scalar r(x,y) = (n*SUM(x,y) 	- SUM(x)*SUM(y))*SQRT_INVERSE(x)*SQRT_INVERSE(y)
+ *	where:
+ *		x,y,... 		- Time series data to be correlated
+ *		n 			- window for correlation (minimum size of 2)
+ *		SUM(x) 			- sum of all elements inside a window
+ *		SQRT_INVERSE(x)		- 1/sqrt(n*SUM(x^2)- (SUM(x)^2))
  *
  */


event: add sticky custom quark

event: add sticky custom quark

--- gst/gstevent.c
+++ gst/gstevent.c
@@ -122,6 +122,7 @@
   {GST_EVENT_CUSTOM_UPSTREAM, "custom-upstream", 0},
   {GST_EVENT_CUSTOM_DOWNSTREAM, "custom-downstream", 0},
   {GST_EVENT_CUSTOM_DOWNSTREAM_OOB, "custom-downstream-oob", 0},
+  {GST_EVENT_CUSTOM_DOWNSTREAM_STICKY, "custom-downstream-sticky", 0},
   {GST_EVENT_CUSTOM_BOTH, "custom-both", 0},
   {GST_EVENT_CUSTOM_BOTH_OOB, "custom-both-oob", 0},


Small fixes

Small fixes

--- gstcerevoice.c
+++ gstcerevoice.c
@@ -28,7 +28,7 @@
   if (g_once_init_enter(&global_engine)) {
     CPRCEN_engine *e = CPRCEN_engine_new();
     if (!e)
-    ret = FALSE;
+	    ret = FALSE;
     g_once_init_leave(&global_engine, e);
   }
   return ret;
@@ -148,7 +148,6 @@
 {
   gboolean ret = TRUE;
   CPRCEN_channel_handle chan = 0;
-  //int rate;

   if (self->voice_file) {
     /* Acquire a lock to ensure other threads can't load a voice until we've
@@ -330,7 +329,7 @@
       ret = gst_pad_event_default(pad, parent, event);
     } else {
       /* Caps haven't been negotiated, so just save the segment event. It
-         will be sent by the source pad chain function. */
+         will be sent by the sink pad chain function. */
       gst_event_replace(&self->segment_event, event);
       gst_event_unref(event);
     }


GtkEntry: Support baselines

GtkEntry: Support baselines

--- gtk/gtkentry.c
+++ gtk/gtkentry.c
@@ -367,6 +367,12 @@
 static void   gtk_entry_get_preferred_height (GtkWidget        *widget,
                                               gint             *minimum,
                                               gint             *natural);
+static void  gtk_entry_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
+                                                                    gint       width,
+                                                                    gint      *minimum_height,
+                                                                    gint      *natural_height,
+                                                                    gint      *minimum_baseline,
+                                                                    gint      *natural_baseline);
 static void   gtk_entry_size_allocate        (GtkWidget        *widget,
 					      GtkAllocation    *allocation);
 static void   gtk_entry_draw_frame           (GtkWidget        *widget,
@@ -682,6 +688,7 @@
   widget_class->unrealize = gtk_entry_unrealize;
   widget_class->get_preferred_width = gtk_entry_get_preferred_width;
   widget_class->get_preferred_height = gtk_entry_get_preferred_height;
+  widget_class->get_preferred_height_and_baseline_for_width = gtk_entry_get_preferred_height_and_baseline_for_width;
   widget_class->size_allocate = gtk_entry_size_allocate;
   widget_class->draw = gtk_entry_draw;
   widget_class->enter_notify_event = gtk_entry_enter_notify;
@@ -3305,36 +3312,58 @@
 }

 static void
+gtk_entry_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
+						       gint       width,
+						       gint      *minimum,
+						       gint      *natural,
+						       gint      *minimum_baseline,
+						       gint      *natural_baseline)
+{
+  GtkEntry *entry = GTK_ENTRY (widget);
+  GtkEntryPrivate *priv = entry->priv;
+  PangoFontMetrics *metrics;
+  GtkBorder borders;
+  PangoContext *context;
+  gint height, baseline;
+  PangoLayout *layout;
+
+  layout = gtk_entry_ensure_layout (entry, TRUE);
+  context = gtk_widget_get_pango_context (widget);
+
+  metrics = pango_context_get_metrics (context,
+                                       pango_context_get_font_description (context),
+				       pango_context_get_language (context));
+
+  priv->ascent = pango_font_metrics_get_ascent (metrics);
+  priv->descent = pango_font_metrics_get_descent (metrics);
+  pango_font_metrics_unref (metrics);
+
+  _gtk_entry_get_borders (entry, &borders);
+  pango_layout_get_pixel_size (layout, NULL, &height);
+
+  height += borders.top + borders.bottom;
+
+  baseline = pango_layout_get_baseline (layout) / PANGO_SCALE;
+  baseline += borders.top;
+
+  *minimum = height;
+  *natural = height;
+  if (minimum_baseline)
+    *minimum_baseline = baseline;
+  if (natural_baseline)
+    *natural_baseline = baseline;
+}
+
+static void
 gtk_entry_get_preferred_height (GtkWidget *widget,
                                 gint      *minimum,
                                 gint      *natural)
 {
-  GtkEntry *entry = GTK_ENTRY (widget);
-  GtkEntryPrivate *priv = entry->priv;
-  PangoFontMetrics *metrics;
-  GtkBorder borders;
-  PangoContext *context;
-  gint height;
-  PangoLayout *layout;
-
-  layout = gtk_entry_ensure_layout (entry, TRUE);
-  context = gtk_widget_get_pango_context (widget);
-
-  metrics = pango_context_get_metrics (context,
-                                       pango_context_get_font_description (context),
-				       pango_context_get_language (context));
-
-  priv->ascent = pango_font_metrics_get_ascent (metrics);
-  priv->descent = pango_font_metrics_get_descent (metrics);
-  pango_font_metrics_unref (metrics);
-
-  _gtk_entry_get_borders (entry, &borders);
-  pango_layout_get_pixel_size (layout, NULL, &height);
-
-  height += borders.top + borders.bottom;
-
-  *minimum = height;
-  *natural = height;
+  gtk_entry_get_preferred_height_and_baseline_for_width (widget,
+                                                         -1,
+                                                         minimum,
+                                                         natural,
+                                                         NULL, NULL);
 }

 static void
@@ -3452,13 +3481,17 @@
   GtkAllocation allocation;
   GtkRequisition requisition;
   GtkWidget *widget = GTK_WIDGET (entry);
+  gint area_height, y_pos;
+  gint baseline;
   gint req_height;
+  GtkBorder borders;

   gtk_widget_get_preferred_size (widget, &requisition, NULL);

   req_height = requisition.height - gtk_widget_get_margin_top (widget) - gtk_widget_get_margin_bottom (widget);

   gtk_widget_get_allocation (widget, &allocation);
+  baseline = gtk_widget_get_allocated_baseline (widget);

   if (x)
     *x = allocation.x;
@@ -3468,7 +3501,17 @@
       if (priv->is_cell_renderer)
         *y = 0;
       else
-        *y = (allocation.height - req_height) / 2;
+        {
+          if (baseline == -1)
+            *y = (allocation.height - req_height) / 2;
+          else
+            {
+              _gtk_entry_get_borders (entry, &borders);
+              area_height = req_height - borders.top - borders.bottom;
+              y_pos = ((area_height * PANGO_SCALE - priv->ascent - priv->descent) / 2 + priv->ascent) / PANGO_SCALE;
+              *y = baseline - y_pos - borders.top;
+            }
+        }

       *y += allocation.y;
     }


Add functions

Add functions

--- lib/node_modules/@stdlib/strided/common/src/binary.c
+++ lib/node_modules/@stdlib/strided/common/src/binary.c
@@ -166,6 +166,41 @@
 	STDLIB_BINARY_LOOP_CLBK( int16_t, int16_t )
 }

+void stdlib_strided_hh_d( uint8_t *arrays[], int64_t *dims, int64_t *strides, void *fcn ) {
+	BinaryFcnInt16 *f = (BinaryFcnInt16 *)fcn;
+	STDLIB_BINARY_LOOP_CLBK( int16_t, double )
+}
+
+void stdlib_strided_hh_f( uint8_t *arrays[], int64_t *dims, int64_t *strides, void *fcn ) {
+	BinaryFcnInt16 *f = (BinaryFcnInt16 *)fcn;
+	STDLIB_BINARY_LOOP_CLBK( int16_t, float )
+}
+
+void stdlib_strided_hh_i( uint8_t *arrays[], int64_t *dims, int64_t *strides, void *fcn ) {
+	BinaryFcnInt16 *f = (BinaryFcnInt16 *)fcn;
+	STDLIB_BINARY_LOOP_CLBK( int16_t, int32_t )
+}
+
+void stdlib_strided_hh_d_as_dd_d( uint8_t *arrays[], int64_t *dims, int64_t *strides, void *fcn ) {
+	BinaryFcnFloat64 *f = (BinaryFcnFloat64 *)fcn;
+	STDLIB_BINARY_LOOP_CLBK_ARG_CAST( int16_t, double, double )
+}
+
+void stdlib_strided_hh_f_as_dd_d( uint8_t *arrays[], int64_t *dims, int64_t *strides, void *fcn ) {
+	BinaryFcnFloat64 *f = (BinaryFcnFloat64 *)fcn;
+	STDLIB_BINARY_LOOP_CLBK_ARG_CAST( int16_t, float, double )
+}
+
+void stdlib_strided_hh_f_as_ff_f( uint8_t *arrays[], int64_t *dims, int64_t *strides, void *fcn ) {
+	BinaryFcnFloat32 *f = (BinaryFcnFloat32 *)fcn;
+	STDLIB_BINARY_LOOP_CLBK_ARG_CAST( int16_t, float, float )
+}
+
+void stdlib_strided_hh_i_as_ii_i( uint8_t *arrays[], int64_t *dims, int64_t *strides, void *fcn ) {
+	BinaryFcnInt32 *f = (BinaryFcnInt32 *)fcn;
+	STDLIB_BINARY_LOOP_CLBK_ARG_CAST( int16_t, int32_t, int32_t )
+}
+
 void stdlib_strided_BB_B( uint8_t *arrays[], int64_t *dims, int64_t *strides, void *fcn ) {
 	BinaryFcnUint8 *f = (BinaryFcnUint8 *)fcn;
 	STDLIB_BINARY_LOOP_CLBK( uint8_t, uint8_t )


Oops I had broken the camera example. Fixed now.

--- samples/camera/source/main.c
+++ samples/camera/source/main.c
@@ -198,7 +198,7 @@
 	image = malloc(cinfo.output_width * cinfo.output_height * 3);
 	for(int i=0; i < cinfo.output_height; i++)
 	{
-	 ptr = image + i * 3 * cinfo.output_width;
+		ptr = image + i * 3 * cinfo.output_width;
 		jpeg_read_scanlines(&cinfo, &ptr, 1);
 	}

@@ -309,7 +309,7 @@
 				cameraReset(0);
 				cameraStart(0);
 			}else if (ret == 0 && readcount!=0 ){
-				u8 * buf = (u8*)(u64)cameraInfo.buffer
+				u8 * buf = (u8*)(u64)cameraInfo.buffer;
 				if(type == CAM_TYPE_PLAYSTATION_EYE){
 					for(i=0;i<cameraInfo.height; i++){
 						for(j=0;j<cameraInfo.width; j += 2){


the assertion says state is not NULL. When state is not NULL, getState()
returns state. So simplify the predicate.

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

--- include/clang/Analysis/PathSensitive/Checker.h
+++ include/clang/Analysis/PathSensitive/Checker.h
@@ -126,8 +126,7 @@

   void addTransition(const GRState *state) {
     assert(state);
-    if (state != getState() ||
-        (state && state != B.GetState(Pred)))
+    if (state != B.GetState(Pred))
       GenerateNode(state, true);
     else
       Dst.Add(Pred);


OvmfPkg/PlatformBootManagerLib: wrap overlong lines in "BdsPlatform.c"

No functional changes.

Cc: Ard Biesheuvel <66d3c5fdaeea7ff1f996ad04f2c45e08ab38e2f5@linaro.org>
Cc: Jordan Justen <a79006884ba9cf5f4f7fcbb92a15b208780d8c97@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <7437296077edea1cb64451c122c4dac071f0cfbc@redhat.com>
Reviewed-by: Ard Biesheuvel <66d3c5fdaeea7ff1f996ad04f2c45e08ab38e2f5@linaro.org>
Tested-by: Gabriel Somlo <d0c2f4d05face87728371216d88c0cb4d74f917a@gmail.com>

--- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -2,13 +2,13 @@
   Platform BDS customizations.

   Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
-  This program and the accompanying materials
-  are licensed and made available under the terms and conditions of the BSD License
-  which accompanies this distribution.  The full text of the license may be found at
+  This program and the accompanying materials are licensed and made available
+  under the terms and conditions of the BSD License which accompanies this
+  distribution.  The full text of the license may be found at
   http://opensource.org/licenses/bsd-license.php

-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+  WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

 **/

@@ -390,7 +390,8 @@
   ASSERT_EFI_ERROR (Status);

   //
-  // Dispatch deferred images after EndOfDxe event and ReadyToLock installation.
+  // Dispatch deferred images after EndOfDxe event and ReadyToLock
+  // installation.
   //
   EfiBootManagerDispatchDeferredImages ();

@@ -470,7 +471,8 @@
   //
   // Register Keyboard
   //
-  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gPnpPs2KeyboardDeviceNode);
+  DevicePath = AppendDevicePathNode (DevicePath,
+                 (EFI_DEVICE_PATH_PROTOCOL *)&gPnpPs2KeyboardDeviceNode);

   EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);

@@ -480,9 +482,12 @@
   DevicePath = TempDevicePath;
   gPnp16550ComPortDeviceNode.UID = 0;

-  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gPnp16550ComPortDeviceNode);
-  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode);
-  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);
+  DevicePath = AppendDevicePathNode (DevicePath,
+                 (EFI_DEVICE_PATH_PROTOCOL *)&gPnp16550ComPortDeviceNode);
+  DevicePath = AppendDevicePathNode (DevicePath,
+                 (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode);
+  DevicePath = AppendDevicePathNode (DevicePath,
+                 (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);

   //
   // Print Device Path
@@ -509,9 +514,12 @@
   DevicePath = TempDevicePath;
   gPnp16550ComPortDeviceNode.UID = 1;

-  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gPnp16550ComPortDeviceNode);
-  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode);
-  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);
+  DevicePath = AppendDevicePathNode (DevicePath,
+                 (EFI_DEVICE_PATH_PROTOCOL *)&gPnp16550ComPortDeviceNode);
+  DevicePath = AppendDevicePathNode (DevicePath,
+                 (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode);
+  DevicePath = AppendDevicePathNode (DevicePath,
+                 (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);

   //
   // Print Device Path
@@ -588,7 +596,8 @@
     // Add all the child handles as possible Console Device
     //
     for (Index = 0; Index < GopHandleCount; Index++) {
-      Status = gBS->HandleProtocol (GopHandleBuffer[Index], &gEfiDevicePathProtocolGuid, (VOID*)&TempDevicePath);
+      Status = gBS->HandleProtocol (GopHandleBuffer[Index],
+                      &gEfiDevicePathProtocolGuid, (VOID*)&TempDevicePath);
       if (EFI_ERROR (Status)) {
         continue;
       }
@@ -607,8 +616,8 @@
         *GopDevicePath = TempDevicePath;

         //
-        // Delete the PCI device's path that added by GetPlugInPciVgaDevicePath()
-        // Add the integrity GOP device path.
+        // Delete the PCI device's path that added by
+        // GetPlugInPciVgaDevicePath(). Add the integrity GOP device path.
         //
         EfiBootManagerUpdateConsoleVariable (ConOutDev, NULL, PciDevicePath);
         EfiBootManagerUpdateConsoleVariable (ConOutDev, TempDevicePath, NULL);
@@ -700,8 +709,10 @@
     return Status;
   }

-  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode);
-  DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);
+  DevicePath = AppendDevicePathNode (DevicePath,
+                 (EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceNode);
+  DevicePath = AppendDevicePathNode (DevicePath,
+                 (EFI_DEVICE_PATH_PROTOCOL *)&gTerminalTypeDeviceNode);

   EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL);
   EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL);
@@ -817,7 +828,8 @@
   @param[in]  PciIo - PCI IO protocol instance
   @param[in]  Pci - PCI Header register block

-  @retval EFI_SUCCESS - PCI Device check and Console variable update successfully.
+  @retval EFI_SUCCESS - PCI Device check and Console variable update
+                        successfully.
   @retval EFI_STATUS - PCI Device check or Console variable update fail.

 **/
@@ -891,7 +903,8 @@

   @param[in]  DetectVgaOnly - Only detect VGA device if it's TRUE.

-  @retval EFI_SUCCESS - PCI Device check and Console variable update successfully.
+  @retval EFI_SUCCESS - PCI Device check and Console variable update
+                        successfully.
   @retval EFI_STATUS - PCI Device check or Console variable update fail.

 **/
@@ -928,12 +941,14 @@
   //
   // Connect RootBridge
   //
-  GetEfiGlobalVariable2 (EFI_CON_OUT_VARIABLE_NAME, (VOID **) &VarConout, NULL);
+  GetEfiGlobalVariable2 (EFI_CON_OUT_VARIABLE_NAME, (VOID **) &VarConout,
+    NULL);
   GetEfiGlobalVariable2 (EFI_CON_IN_VARIABLE_NAME, (VOID **) &VarConin, NULL);

   if (VarConout == NULL || VarConin == NULL) {
     //
-    // Do platform specific PCI Device check and add them to ConOut, ConIn, ErrOut
+    // Do platform specific PCI Device check and add them to ConOut, ConIn,
+    // ErrOut
     //
     DetectAndPreparePlatformPciDevicePaths (FALSE);

@@ -947,13 +962,16 @@
       // Update the console variable with the connect type
       //
       if ((PlatformConsole[Index].ConnectType & CONSOLE_IN) == CONSOLE_IN) {
-        EfiBootManagerUpdateConsoleVariable (ConIn, PlatformConsole[Index].DevicePath, NULL);
+        EfiBootManagerUpdateConsoleVariable (ConIn,
+          PlatformConsole[Index].DevicePath, NULL);
       }
       if ((PlatformConsole[Index].ConnectType & CONSOLE_OUT) == CONSOLE_OUT) {
-        EfiBootManagerUpdateConsoleVariable (ConOut, PlatformConsole[Index].DevicePath, NULL);
+        EfiBootManagerUpdateConsoleVariable (ConOut,
+          PlatformConsole[Index].DevicePath, NULL);
       }
       if ((PlatformConsole[Index].ConnectType & STD_ERROR) == STD_ERROR) {
-        EfiBootManagerUpdateConsoleVariable (ErrOut, PlatformConsole[Index].DevicePath, NULL);
+        EfiBootManagerUpdateConsoleVariable (ErrOut,
+          PlatformConsole[Index].DevicePath, NULL);
       }
     }
   } else {
@@ -1237,7 +1255,10 @@
       DEBUG((
         EFI_D_INFO,
         "Found %s device: %s\n",
-        IS_CLASS1 (PciHeader, PCI_CLASS_MASS_STORAGE) ? L"Mass Storage" : L"Xen",
+        (IS_CLASS1 (PciHeader, PCI_CLASS_MASS_STORAGE) ?
+         L"Mass Storage" :
+         L"Xen"
+         ),
         DevPathStr
         ));
       FreePool(DevPathStr);
@@ -1531,7 +1552,8 @@
     //
     // Get the DevicePath protocol on that handle
     //
-    Status = gBS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID **)&DevPathNode);
+    Status = gBS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid,
+                    (VOID **)&DevPathNode);
     ASSERT_EFI_ERROR (Status);

     while (!IsDevicePathEnd (DevPathNode)) {
@@ -1581,7 +1603,8 @@
 }

 /**
-  This function is called each second during the boot manager waits the timeout.
+  This function is called each second during the boot manager waits the
+  timeout.

   @param TimeoutRemain  The remaining timeout.
 **/


fix serial plugin API to use pointer types where appropriate

git-svn-id: http://squeakvm.org/svn/squeak/trunk@2078 fa1542d4-bde8-0310-ad64-8ed1123d492a

Former-commit-id: 81e46e1a02ed745e2ce3a86cfe74a32c7edcded2

--- SerialPlugin/SerialPlugin.h
+++ SerialPlugin/SerialPlugin.h
@@ -7,9 +7,10 @@
 #pragma export on
 int serialPortClose(int portNum);
 int serialPortCount(void);
-int serialPortOpen(
-  int portNum, int baudRate, int stopBitsType, int parityType, int dataBits,
-  int inFlowCtrl, int outFlowCtrl, int xOnChar, int xOffChar);
-int serialPortReadInto(int portNum, int count, int bufferPtr);
-int serialPortWriteFrom(int portNum, int count, int bufferPtr);
+int serialPortOpen(int portNum, int baudRate, int stopBitsType, int parityType, int dataBits,
+		   int inFlowCtrl, int outFlowCtrl, int xOnChar, int xOffChar);
+int serialPortReadInto(int portNum, int count, void *bufferPtr);
+int serialPortReadIntoByName(const char *portName, int count, void *bufferPtr);
+int serialPortWriteFrom(int portNum, int count, void *bufferPtr);
+int serialPortWriteFromByName(const char *portName, int count, void *bufferPtr);
 #pragma export off


Avoid spurious notifications from GtkEntry

Using gtk_entry_set_buffer() in dispose() causes problematic
notifications, so just get rid of the buffer manually. See bug 613241.

--- gtk/gtkentry.c
+++ gtk/gtkentry.c
@@ -2463,12 +2463,19 @@
 gtk_entry_dispose (GObject *object)
 {
   GtkEntry *entry = GTK_ENTRY (object);
+  GtkEntryPrivate *priv = GTK_ENTRY_GET_PRIVATE (entry);

   gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_PRIMARY, NULL);
   gtk_entry_set_icon_tooltip_markup (entry, GTK_ENTRY_ICON_PRIMARY, NULL);
   gtk_entry_set_icon_from_pixbuf (entry, GTK_ENTRY_ICON_SECONDARY, NULL);
   gtk_entry_set_icon_tooltip_markup (entry, GTK_ENTRY_ICON_SECONDARY, NULL);
-  gtk_entry_set_buffer (entry, NULL);
+
+  if (priv->buffer)
+    {
+      buffer_disconnect_signals (entry);
+      g_object_unref (priv->buffer);
+      priv->buffer = NULL;
+    }

   G_OBJECT_CLASS (gtk_entry_parent_class)->dispose (object);
 }


Add 1-character read to raw_istream.

Add 1-character read to raw_istream.

--- wpiutil/include/support/raw_istream.h
+++ wpiutil/include/support/raw_istream.h
@@ -16,6 +16,21 @@
  public:
   raw_istream() = default;
   virtual ~raw_istream() = default;
+
+  raw_istream& read(char& c) {
+    read_impl(&c, 1);
+    return *this;
+  }
+
+  raw_istream& read(unsigned char& c) {
+    read_impl(&c, 1);
+    return *this;
+  }
+
+  raw_istream& read(signed char& c) {
+    read_impl(&c, 1);
+    return *this;
+  }

   raw_istream& read(void* data, std::size_t len) {
     read_impl(data, len);


reuse JsObject

reuse JsObject

--- include/libnode/detail/http/outgoing_message.h
+++ include/libnode/detail/http/outgoing_message.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012-2013 Plenluno All rights reserved.
+// Copyright (c) 2012-2014 Plenluno All rights reserved.

 #ifndef LIBNODE_DETAIL_HTTP_OUTGOING_MESSAGE_H_
 #define LIBNODE_DETAIL_HTTP_OUTGOING_MESSAGE_H_
@@ -158,7 +158,7 @@
     }

     String::CPtr getHeader(String::CPtr name) const {
-        if (name && headers_) {
+        if (name) {
             return headers_->getCPtr<String>(
                 scanHeaderField<Char>(name->data(), name->length()));
         } else {
@@ -170,12 +170,6 @@
         if (header_) return false;
         if (!name || !value) return false;

-        if (!headers_) {
-            assert(!headerNames_);
-            headers_ = libj::JsObject::create();
-            headerNames_ = libj::JsObject::create();
-        }
-
         String::CPtr key = scanHeaderField<Char>(name->data(), name->length());
         headers_->put(key, value);
         headerNames_->put(key, name);
@@ -184,7 +178,7 @@

     Boolean removeHeader(String::CPtr name) {
         if (header_) return false;
-        if (!name || !headers_) return false;
+        if (!name) return false;

         String::CPtr key = scanHeaderField<Char>(name->data(), name->length());
         headers_->remove(key);
@@ -229,7 +223,8 @@
             node::http::Status::create(statusCode, reasonPhrase);

         libj::JsObject::CPtr headers;
-        if (obj && headers_) {
+        Boolean empty = headers_->isEmpty();
+        if (obj && !empty) {
             libj::JsObject::Ptr hs = renderHeaders();
             typedef libj::JsObject::Entry Entry;
             TypedSet<Entry::CPtr>::CPtr entrys = obj->entrySet();
@@ -239,7 +234,7 @@
                 hs->put(entry->getKey(), entry->getValue());
             }
             headers = hs;
-        } else if (headers_) {
+        } else if (!empty) {
             headers = renderHeaders();
         } else {
             headers = obj;
@@ -607,7 +602,7 @@

     libj::JsObject::Ptr renderHeaders() {
         if (header_) return libj::JsObject::null();
-        if (!headers_) return libj::JsObject::create();
+        if (headers_->isEmpty()) return libj::JsObject::create();

         libj::JsObject::Ptr headers = libj::JsObject::create();
         typedef libj::JsObject::Entry Entry;
@@ -679,8 +674,8 @@
         path_ = String::null();
         header_ = String::null();
         trailer_ = String::create();
-        headers_ = libj::JsObject::null();
-        headerNames_ = libj::JsObject::null();
+        headers_->clear();
+        headerNames_->clear();
         output_->clear();
         outputEncodings_->clear();
         parser_ = NULL;
@@ -1244,8 +1239,8 @@
         , path_(String::null())
         , header_(String::null())
         , trailer_(String::create())
-        , headers_(libj::JsObject::null())
-        , headerNames_(libj::JsObject::null())
+        , headers_(libj::JsObject::create())
+        , headerNames_(libj::JsObject::create())
         , output_(LinkedList::create())
         , outputEncodings_(EncodingList::create())
         , parser_(NULL)


Removed an initialization that wasn't needed.

git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@137533 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/lldb/Expression/ProcessDataAllocator.h
+++ include/lldb/Expression/ProcessDataAllocator.h
@@ -46,8 +46,6 @@
         if (m_allocation)
             m_process.DeallocateMemory(m_allocation);

-        m_allocation = 0;
-
         m_allocation = m_process.AllocateMemory(m_stream_string.GetSize(), lldb::ePermissionsReadable | lldb::ePermissionsWritable, err);

         if (!err.Success())


blockfreq: Rename BlockProbInfoT to BranchProbabilityInfoT

No functionality change.

<rdar://problem/14292693>

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

--- include/llvm/Analysis/BlockFrequencyInfoImpl.h
+++ include/llvm/Analysis/BlockFrequencyInfoImpl.h
@@ -39,12 +39,12 @@
 template <> struct TypeMap<BasicBlock> {
   typedef BasicBlock BlockT;
   typedef Function FunctionT;
-  typedef BranchProbabilityInfo BlockProbInfoT;
+  typedef BranchProbabilityInfo BranchProbabilityInfoT;
 };
 template <> struct TypeMap<MachineBasicBlock> {
   typedef MachineBasicBlock BlockT;
   typedef MachineFunction FunctionT;
-  typedef MachineBranchProbabilityInfo BlockProbInfoT;
+  typedef MachineBranchProbabilityInfo BranchProbabilityInfoT;
 };
 }

@@ -57,11 +57,12 @@
 class BlockFrequencyInfoImpl {
   typedef typename bfi_detail::TypeMap<BT>::BlockT BlockT;
   typedef typename bfi_detail::TypeMap<BT>::FunctionT FunctionT;
-  typedef typename bfi_detail::TypeMap<BT>::BlockProbInfoT BlockProbInfoT;
+  typedef typename bfi_detail::TypeMap<BT>::BranchProbabilityInfoT
+  BranchProbabilityInfoT;

   DenseMap<const BlockT *, BlockFrequency> Freqs;

-  BlockProbInfoT *BPI;
+  BranchProbabilityInfoT *BPI;

   FunctionT *Fn;

@@ -288,7 +289,7 @@

   BlockFrequencyInfoImpl() { }

-  void doFunction(FunctionT *fn, BlockProbInfoT *bpi) {
+  void doFunction(FunctionT *fn, BranchProbabilityInfoT *bpi) {
     Fn = fn;
     BPI = bpi;


Multilines crammed enum in SideEffectAnalysis. NFC

--- include/swift/SILAnalysis/SideEffectAnalysis.h
+++ include/swift/SILAnalysis/SideEffectAnalysis.h
@@ -29,7 +29,11 @@

 /// An enum to represent the kind of scan we perform when we calculate
 /// side effects.
-enum class RetainObserveKind {ObserveRetains, IgnoreRetains, RetainObserveKindEnd};
+enum class RetainObserveKind {
+  ObserveRetains,
+  IgnoreRetains,
+  RetainObserveKindEnd
+};

 /// The SideEffectAnalysis provides information about side-effects of SIL
 /// functions. Side-effect information is provided per function and includes:


Fix typo: cacheing → caching

Fix typo: cacheing → caching

--- include/swift/SILOptimizer/Analysis/Analysis.h
+++ include/swift/SILOptimizer/Analysis/Analysis.h
@@ -132,7 +132,7 @@
     static void verifyFunction(SILFunction *F);
   };

-  /// An abstract base class that implements the boiler plate of cacheing and
+  /// An abstract base class that implements the boiler plate of caching and
   /// invalidating analysis for specific functions.
   template<typename AnalysisTy>
   class FunctionAnalysisBase : public SILAnalysis {


ECDSA: Add mbedtls_ecdsa_can_do

ECDSA: Add mbedtls_ecdsa_can_do

--- programs/test/benchmark.c
+++ programs/test/benchmark.c
@@ -835,6 +835,9 @@
              curve_info->grp_id != MBEDTLS_ECP_DP_NONE;
              curve_info++ )
         {
+            if( mbedtls_ecdsa_can_do( curve_info->grp_id ) == 0 )
+                continue;
+
             mbedtls_ecdsa_init( &ecdsa );

             if( mbedtls_ecdsa_genkey( &ecdsa, curve_info->grp_id, myrand, NULL ) != 0 )
@@ -854,6 +857,9 @@
              curve_info->grp_id != MBEDTLS_ECP_DP_NONE;
              curve_info++ )
         {
+            if( mbedtls_ecdsa_can_do( curve_info->grp_id ) == 0 )
+                continue;
+
             mbedtls_ecdsa_init( &ecdsa );

             if( mbedtls_ecdsa_genkey( &ecdsa, curve_info->grp_id, myrand, NULL ) != 0 ||


progs/glsl: Silence uninitialized variable warning.

--- progs/glsl/convolutions.c
+++ progs/glsl/convolutions.c
@@ -182,7 +182,7 @@
 static void setupConvolution()
 {
    GLint *kernel = (GLint*)malloc(sizeof(GLint) * 9);
-   GLfloat scale;
+   GLfloat scale = 0.0;
    GLfloat *vecKer = (GLfloat*)malloc(sizeof(GLfloat) * 9 * 4);
    GLuint loc;
    GLuint i;


regen

regen

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

--- utils/typedump/typedump.c
+++ utils/typedump/typedump.c
@@ -672,6 +672,7 @@
 	PRVAL(SLC_OPST_SLC_FCMH_DTOR);
 	PRVAL(SLC_OPST_SRMT_WRITE);
 	PRVAL(SLC_OPST_UNLINK);
+	PRVAL(SLC_OPST_VERSION);
 	PRVAL(SLC_OPST_WRITE);
 	PRVAL(SLC_OPST_WRITE_COALESCE);
 	PRVAL(SLC_OPST_WRITE_COALESCE_MAX);


Do not loop forever if the keyboard send a BAT (Basic Assurance Test)
fault code, but handle this code like ``Resend'' or  ``BAT success''
instead.

Fix a problem reported by Kent Fritz and analyzed by stsp@.

ok shadchin@

--- dev/ic/pckbc.c
+++ dev/ic/pckbc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pckbc.c,v 1.31 2012/10/17 19:16:10 deraadt Exp $ */
+/* $OpenBSD: pckbc.c,v 1.32 2013/02/15 08:37:09 mpi Exp $ */
 /* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */

 /*
@@ -48,6 +48,12 @@
 #include <dev/pckbc/pckbdvar.h>
 #endif

+#ifdef PCKBCDEBUG
+#define DPRINTF(x...)	do { printf(x); } while (0);
+#else
+#define DPRINTF(x...)
+#endif
+
 /* descriptor for one device command */
 struct pckbc_devcmd {
 	TAILQ_ENTRY(pckbc_devcmd) next;
@@ -102,9 +108,10 @@

 const char *pckbc_slot_names[] = { "kbd", "aux" };

-#define KBC_DEVCMD_ACK 0xfa
-#define KBC_DEVCMD_RESEND 0xfe
-#define KBC_DEVCMD_BAT 0xaa
+#define KBC_DEVCMD_ACK		0xfa
+#define KBC_DEVCMD_RESEND	0xfe
+#define KBC_DEVCMD_BAT_DONE	0xaa
+#define KBC_DEVCMD_BAT_FAIL	0xfc

 #define	KBD_DELAY	DELAY(8)

@@ -587,39 +594,32 @@
 				break;
 		}

-		if (c == KBC_DEVCMD_ACK) {
+		switch (c) {
+		case KBC_DEVCMD_ACK:
 			cmd->cmdidx++;
 			continue;
-		}
 		/*
 		 * Some legacy free PCs keep returning Basic Assurance Test
 		 * (BAT) instead of something usable, so fail gracefully.
 		 */
-		if (c == KBC_DEVCMD_RESEND || c == KBC_DEVCMD_BAT) {
-#ifdef PCKBCDEBUG
-			printf("pckbc_cmd: %s\n",
+		case KBC_DEVCMD_RESEND:
+		case KBC_DEVCMD_BAT_DONE:
+		case KBC_DEVCMD_BAT_FAIL:
+			DPRINTF("pckbc_cmd: %s\n",
 			    c == KBC_DEVCMD_RESEND ? "RESEND": "BAT");
-#endif
 			if (cmd->retries++ < 5)
 				continue;
-			else {
-#ifdef PCKBCDEBUG
-				printf("pckbc: cmd failed\n");
-#endif
-				cmd->status = ENXIO;
-				return;
-			}
-		}
-		if (c == -1) {
-#ifdef PCKBCDEBUG
-			printf("pckbc_cmd: timeout\n");
-#endif
+
+			DPRINTF("pckbc_cmd: cmd failed\n");
+			cmd->status = ENXIO;
+			return;
+		case -1:
+			DPRINTF("pckbc_cmd: timeout\n");
 			cmd->status = EIO;
 			return;
-		}
-#ifdef PCKBCDEBUG
-		printf("pckbc_cmd: lost 0x%x\n", c);
-#endif
+		default:
+			DPRINTF("pckbc_cmd: lost 0x%x\n", c);
+		}
 	}

 	while (cmd->responseidx < cmd->responselen) {


Return Long integer on size only if necessary.

--- scipy/base/src/arrayobject.c
+++ scipy/base/src/arrayobject.c
@@ -3692,7 +3692,6 @@
 	else
 		return PyInt_FromLong((long) size);
 }
-

 static PyObject *


Fix key repeat in Wayland

Fix key repeat in Wayland

--- uwac/libuwac/uwac-input.c
+++ uwac/libuwac/uwac-input.c
@@ -168,6 +168,7 @@

 		key->window = window;
 		key->sym = input->repeat_sym;
+		key->raw_key = input->repeat_key;
 		key->pressed = true;
 	}
 }


Fix definition of XL_PME_EN.

Fix definition of XL_PME_EN.

ok stsp@

--- dev/ic/xlreg.h
+++ dev/ic/xlreg.h
@@ -1,4 +1,4 @@
-/*	$OpenBSD: xlreg.h,v 1.27 2011/04/17 20:52:43 stsp Exp $	*/
+/*	$OpenBSD: xlreg.h,v 1.28 2011/10/13 13:07:13 kettenis Exp $	*/

 /*
  * Copyright (c) 1997, 1998
@@ -747,7 +747,7 @@
 #define XL_PSTATE_D1		0x0002
 #define XL_PSTATE_D2		0x0002
 #define XL_PSTATE_D3		0x0003
-#define XL_PME_EN		0x0010
+#define XL_PME_EN		0x0100
 #define XL_PME_STATUS		0x8000

 /* Bits in the XL_PCI_PWRMGMTCAP register */


WIP parser

WIP parser

--- sexpr-wasm.c
+++ sexpr-wasm.c
@@ -1,5 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>

 #define TABS_TO_SPACES 8

@@ -198,6 +199,222 @@
   return result;
 }

+static void rewind_token(Tokenizer* tokenizer, Token t) {
+  tokenizer->loc = t.range.start;
+}
+
+#if 0
+static void print_tokens(Tokenizer* tokenizer) {
+  while (1) {
+    Token token = read_token(&tokenizer);
+    fprintf(stderr, "[%d:%d]:[%d:%d]: ", token.range.start.line,
+            token.range.start.col, token.range.end.line, token.range.end.col);
+    switch (token.type) {
+      case TOKEN_TYPE_EOF:
+        fprintf(stderr, "EOF\n");
+        return;
+
+      case TOKEN_TYPE_OPEN_PAREN:
+        fprintf(stderr, "OPEN_PAREN\n");
+        break;
+
+      case TOKEN_TYPE_CLOSE_PAREN:
+        fprintf(stderr, "CLOSE_PAREN\n");
+        break;
+
+      case TOKEN_TYPE_ATOM:
+        fprintf(stderr, "ATOM: %.*s\n",
+                (int)(token.range.end.pos - token.range.start.pos),
+                token.range.start.pos);
+        break;
+
+      case TOKEN_TYPE_STRING:
+        fprintf(stderr, "STRING: %.*s\n",
+                (int)(token.range.end.pos - token.range.start.pos),
+                token.range.start.pos);
+        break;
+    }
+  }
+}
+#endif
+
+#if 0
+static void expect_open(Token t) {
+  if (t.type != TOKEN_TYPE_OPEN_PAREN) {
+    fprintf(stderr, "%d:%d: expected '(', not \"%.*s\"\n", t.range.start.line,
+            t.range.start.col, (int)(t.range.end.pos - t.range.start.pos),
+            t.range.start.pos);
+    exit(1);
+  }
+}
+#endif
+
+static void expect_close(Token t) {
+  if (t.type != TOKEN_TYPE_CLOSE_PAREN) {
+    fprintf(stderr, "%d:%d: expected ')', not \"%.*s\"\n", t.range.start.line,
+            t.range.start.col, (int)(t.range.end.pos - t.range.start.pos),
+            t.range.start.pos);
+    exit(1);
+  }
+}
+
+
+static void expect_atom(Token t) {
+  if (t.type != TOKEN_TYPE_ATOM) {
+    fprintf(stderr, "%d:%d: expected ATOM, not \"%.*s\"\n", t.range.start.line,
+            t.range.start.col, (int)(t.range.end.pos - t.range.start.pos),
+            t.range.start.pos);
+    exit(1);
+  }
+}
+
+static int match_atom(Token t, const char* s) {
+  return strncmp(t.range.start.pos, s, t.range.end.pos - t.range.start.pos) ==
+         0;
+}
+
+static void unexpected_token(Token t) {
+  fprintf(stderr, "%d:%d: unexpected token \"%.*s\"\n", t.range.start.line,
+          t.range.start.col, (int)(t.range.end.pos - t.range.start.pos),
+          t.range.start.pos);
+  exit(1);
+}
+
+static void parse_generic(Tokenizer* tokenizer) {
+  int nesting = 1;
+  while (nesting > 0) {
+    Token t = read_token(tokenizer);
+    if (t.type == TOKEN_TYPE_OPEN_PAREN) {
+      nesting++;
+    } else if (t.type == TOKEN_TYPE_CLOSE_PAREN) {
+      nesting--;
+    } else if (t.type == TOKEN_TYPE_EOF) {
+      fprintf(stderr, "unexpected eof.\n");
+      exit(1);
+    }
+  }
+}
+
+static void parse_expr(Tokenizer* tokenizer) {
+  parse_generic(tokenizer);
+}
+
+static void parse_param(Tokenizer* tokenizer) {
+  expect_atom(read_token(tokenizer));
+  Token t = read_token(tokenizer);
+  if (t.type == TOKEN_TYPE_CLOSE_PAREN)
+    return;
+  expect_atom(t);
+  expect_close(read_token(tokenizer));
+}
+
+static void parse_result(Tokenizer* tokenizer) {
+  expect_atom(read_token(tokenizer));
+  expect_close(read_token(tokenizer));
+}
+
+static void parse_local(Tokenizer* tokenizer) {
+  expect_atom(read_token(tokenizer));
+  Token t = read_token(tokenizer);
+  if (t.type == TOKEN_TYPE_CLOSE_PAREN)
+    return;
+  expect_atom(t);
+  expect_close(read_token(tokenizer));
+}
+
+static void parse_func(Tokenizer* tokenizer) {
+  Token t = read_token(tokenizer);
+  if (t.type == TOKEN_TYPE_ATOM) {
+    /* named function */
+    t = read_token(tokenizer);
+  }
+
+  while (1) {
+    if (t.type == TOKEN_TYPE_OPEN_PAREN) {
+      t = read_token(tokenizer);
+      if (t.type == TOKEN_TYPE_ATOM) {
+        if (match_atom(t, "param")) {
+          parse_param(tokenizer);
+        } else if (match_atom(t, "result")) {
+          parse_result(tokenizer);
+        } else if (match_atom(t, "local")) {
+          parse_local(tokenizer);
+        } else {
+          rewind_token(tokenizer, t);
+          parse_expr(tokenizer);
+        }
+      } else {
+        unexpected_token(t);
+      }
+      t = read_token(tokenizer);
+    } else if (t.type == TOKEN_TYPE_CLOSE_PAREN) {
+      break;
+    } else {
+      unexpected_token(t);
+    }
+  }
+}
+
+static void parse_module(Tokenizer* tokenizer) {
+  Token t = read_token(tokenizer);
+  while (1) {
+    if (t.type == TOKEN_TYPE_OPEN_PAREN) {
+      t = read_token(tokenizer);
+      if (t.type == TOKEN_TYPE_ATOM) {
+        if (match_atom(t, "func")) {
+          parse_func(tokenizer);
+        } else if (match_atom(t, "global")) {
+          parse_generic(tokenizer);
+        } else if (match_atom(t, "export")) {
+          parse_generic(tokenizer);
+        } else if (match_atom(t, "table")) {
+          parse_generic(tokenizer);
+        } else if (match_atom(t, "memory")) {
+          parse_generic(tokenizer);
+        } else {
+          unexpected_token(t);
+        }
+      } else {
+        unexpected_token(t);
+      }
+      t = read_token(tokenizer);
+    } else if (t.type == TOKEN_TYPE_CLOSE_PAREN) {
+      break;
+    } else {
+      unexpected_token(t);
+    }
+  }
+}
+
+static void parse(Tokenizer* tokenizer) {
+  Token t = read_token(tokenizer);
+  while (1) {
+    if (t.type == TOKEN_TYPE_OPEN_PAREN) {
+      t = read_token(tokenizer);
+      if (t.type == TOKEN_TYPE_ATOM) {
+        if (match_atom(t, "module")) {
+          parse_module(tokenizer);
+        } else if (match_atom(t, "asserteq")) {
+          parse_generic(tokenizer);
+        } else if (match_atom(t, "invoke")) {
+          parse_generic(tokenizer);
+        } else if (match_atom(t, "assertinvalid")) {
+          parse_generic(tokenizer);
+        } else {
+          unexpected_token(t);
+        }
+      } else {
+        unexpected_token(t);
+      }
+      t = read_token(tokenizer);
+    } else if (t.type == TOKEN_TYPE_EOF) {
+      break;
+    } else {
+      unexpected_token(t);
+    }
+  }
+}
+
 int main(int argc, char** argv) {
   if (argc < 2) {
     fprintf(stderr, "usage: %s [file.wasm]\n", argv[0]);
@@ -235,37 +452,6 @@
   tokenizer.loc.line = 1;
   tokenizer.loc.col = 1;

-  while (1) {
-    Token token = read_token(&tokenizer);
-    fprintf(stderr, "[%d:%d]:[%d:%d]: ", token.range.start.line,
-            token.range.start.col, token.range.end.line, token.range.end.col);
-    switch (token.type) {
-      case TOKEN_TYPE_EOF:
-        fprintf(stderr, "EOF\n");
-        goto done;
-
-      case TOKEN_TYPE_OPEN_PAREN:
-        fprintf(stderr, "OPEN_PAREN\n");
-        break;
-
-      case TOKEN_TYPE_CLOSE_PAREN:
-        fprintf(stderr, "CLOSE_PAREN\n");
-        break;
-
-      case TOKEN_TYPE_ATOM:
-        fprintf(stderr, "ATOM: %.*s\n",
-                (int)(token.range.end.pos - token.range.start.pos),
-                token.range.start.pos);
-        break;
-
-      case TOKEN_TYPE_STRING:
-        fprintf(stderr, "STRING: %.*s\n",
-                (int)(token.range.end.pos - token.range.start.pos),
-                token.range.start.pos);
-        break;
-    }
-  }
-done:
-
+  parse(&tokenizer);
   return 0;
 }


add two new socket routine declarations - see end of file

git-svn-id: 5c8b60fcb9320cccfd2f497bdea85b37ac3f2028@1441 fa1542d4-bde8-0310-ad64-8ed1123d492a

--- SocketPlugin/SocketPlugin.h
+++ SocketPlugin/SocketPlugin.h
@@ -1,4 +1,4 @@
-/* squeak socket record; see sqMacNetwork.c for details */
+/* squeak socket support header file */

 /* module initialization/shutdown */
 sqInt socketInit(void);
@@ -49,3 +49,6 @@
 sqInt sqSockettoHostportSendDataBufCount(SocketPtr s, sqInt address, sqInt port, char *buf, sqInt bufSize);
 sqInt sqSocketSetOptionsoptionNameStartoptionNameSizeoptionValueStartoptionValueSizereturnedValue(SocketPtr s, char *optionName, sqInt optionNameSize, char *optionValue, sqInt optionValueSize, sqInt *result);
 sqInt sqSocketGetOptionsoptionNameStartoptionNameSizereturnedValue(SocketPtr s, char *optionName, sqInt optionNameSize, sqInt *result);
+/* tpr 4/12/06 add declarations for two new socket routines */
+void sqSocketBindToPort(SocketPtr s, int addr, int port);
+void sqSocketSetReusable(SocketPtr s);


making sure CWSerialBlockQueue comments adhere to the conventions

--- Source/CWSerialBlockQueue.h
+++ Source/CWSerialBlockQueue.h
@@ -31,7 +31,7 @@

 @interface CWSerialBlockOperation : NSObject
 /**
- Returns a new CWSerialBlockOperation object that executes block when it is dequeued
+ Returns a new CWSerialBlockOperation object that executes block when dequeued

  @param block a dispatch_block_t block that must not be NULL
  @return a new CWSerialBlockOperation object
@@ -49,17 +49,17 @@
 - (id)init;

 /**
- Returns a new CWSerialBlockQueue with the given label or a uniquely generated one
+ Returns a new CWSerialBlockQueue with the given label or a unique one

- @return a new CWSerialBlockQueue queue that is immediately beginning to execute blockOperations
+ @return a new CWSerialBlockQueue queue
  */
 -(id)initWithLabel:(NSString *)qlabel;

 /**
- Returns a new CWSerialBlockQueue that immediately submits all operation objects in blockOperations for execution
+ Returns new CWSerialBlockQueue which immmediately begins dequeueing operations

  @param blockOperations a NSArray of CWSerialBlockOperatiom objects
- @return a new CWSerialBlockQueue queue that is immediately beginning to execute blockOperations
+ @return a new CWSerialBlockQueue queue starting to dequeue operations
  */
 -(id)initWithLabel:(NSString *)qlabel andBlockOperationObjects:(NSArray *)blockOperations;

@@ -80,7 +80,7 @@
 /**
  Adds the block operation to the receiver for execution

- @param operation a CWSerialBlockOperation object if this is nil this method does nothing
+ @param operation a CWSerialBlockOperation object, if nil this does nothing
  */
 -(void)addBlockOperation:(CWSerialBlockOperation *)operation;

@@ -114,9 +114,9 @@
 -(void)waitUntilAllBlocksHaveProcessed;

 /**
- Asynchronously waits for all currently enqued blocks to finish and then executes block
+ Asynchronously waits for all enqued blocks to finish and then executes block

- @param block the block to be executed once all operation opjects are finished executing
+ @param block the block to be executed once all operation opjects are finished
  */
 -(void)executeWhenAllBlocksHaveFinished:(dispatch_block_t)block;
 @end


recovered method deleted from merge

recovered method deleted from merge

--- BaasBox-iOS-SDK/BAAClient.h
+++ BaasBox-iOS-SDK/BAAClient.h
@@ -46,6 +46,9 @@
 - (void) loadObject:(BAAObject *)object completion:(BAAObjectResultBlock)completionBlock;
 - (void) loadCollection:(BAAObject *)object completion:(BAAArrayResultBlock)completionBlock;
 - (void) loadCollection:(BAAObject *)object withParams:(NSDictionary *)parameters completion:(BAAArrayResultBlock)completionBlock;
+- (void)loadDictionaryObjectsFromCollection:(NSString *)collectionName
+                                 withParams:(NSDictionary *)parameters
+                                 completion:(BAAArrayResultBlock)completionBlock;

 // saving
 - (void) createObject:(BAAObject *)object completion:(BAAObjectResultBlock)completionBlock;


Removing UIKit from the bridging header.

--- BitcoinSwift/BitcoinSwift.h
+++ BitcoinSwift/BitcoinSwift.h
@@ -5,8 +5,6 @@
 //  Created by Kevin Greene on 6/19/14.
 //  Copyright (c) 2014 DoubleSha. All rights reserved.
 //
-
-#import <UIKit/UIKit.h>

 //! Project version number for BitcoinSwift.
 FOUNDATION_EXPORT double BitcoinSwiftVersionNumber;


Use memcpy() instead of a cast

Use memcpy() instead of a cast

--- src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c
+++ src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c
@@ -605,8 +605,8 @@
     _mm_storeu_si128((xmmi *)(void *)st + 6, _mm_setzero_si128());
     _mm_storeu_si128((xmmi *)(void *)st + 7, _mm_setzero_si128());

-    *(uint64_t *)(void *)(mac + 0) = h0;
-    *(uint64_t *)(void *)(mac + 8) = h1;
+    memcpy(&mac[0], &h0, 8);
+    memcpy(&mac[8], &h1, 8);

     sodium_memzero((void *)st, sizeof *st);
 }


Fix for multi packet source responses. It appears that the current documentation
is wrong.

git-svn-id: 799001c4292c71bc513a6d33c97ab5ebe661e4c7@195 bac25679-d237-0410-bec6-f8029acc7ebe

--- qstat2/a2s.c
+++ qstat2/a2s.c
@@ -155,10 +155,18 @@
 		pkt += 4;

 		// packetId
-		pkt_max = ((unsigned char)*pkt) & 15;
-		pkt_index = ((unsigned char)*pkt) >> 4;
+		// According to:
+		// http://developer.valvesoftware.com/wiki/Source_Server_Queries
+		// the following is right but by experience its not
+		// The next two bytes are:
+		// 1. the max packets sent
+		// 2. the index of this packet starting from 0
+		// pkt_max = ((unsigned char)*pkt) & 15;
+		// pkt_index = ((unsigned char)*pkt) >> 4;
+		pkt_max = ((unsigned char)*pkt);
+		pkt_index = ((unsigned char)*(pkt+1));
 		debug( 3, "packetid: 0x%hhx => idx: %hhu, max: %hhu", *pkt, pkt_index, pkt_max );
-		pkt++;
+		pkt+=2;

 		pktlen -= 9;


Add hack of explicitly locking stdout

Add hack of explicitly locking stdout

This shouldn't be necessary as stdout is already locked by libc (see
comment.) Not sure which part isn't working.

--- components/esp32/syscalls.c
+++ components/esp32/syscalls.c
@@ -138,6 +138,13 @@
 ssize_t _write_r(struct _reent *r, int fd, const void * data, size_t size) {
     const char* p = (const char*) data;
     if (fd == STDOUT_FILENO) {
+        /* THIS IS A HACK!!! The stdout "file" should be locked while
+           this code is called (it's locked fflush.c:280 before
+           __sflush_r is called.) It shouldn't be necessary to
+           re-lock, but due to some unknown bug it is...
+        */
+        static _lock_t stdout_lock;
+        _lock_acquire_recursive(&stdout_lock);
         while(size--) {
 #if CONFIG_NEWLIB_STDOUT_ADDCR
             if (*p=='\n') {
@@ -147,6 +154,7 @@
             uart_tx_one_char(*p);
             ++p;
         }
+        _lock_release_recursive(&stdout_lock);
     }
     return size;
 }


Document that completed/error invalidate subscribers

--- ReactiveCocoaFramework/ReactiveCocoa/RACSubscriber.h
+++ ReactiveCocoaFramework/ReactiveCocoa/RACSubscriber.h
@@ -30,12 +30,14 @@
 //
 // error - The error to send. This can be `nil`.
 //
-// This terminates the subscription.
+// This terminates the subscription, and invalidates the subscriber (such that
+// it cannot subscribe to anything else in the future).
 - (void)sendError:(NSError *)error;

 // Send completed to subscribers.
 //
-// This terminates the subscription.
+// This terminates the subscription, and invalidates the subscriber (such that
+// it cannot subscribe to anything else in the future).
 - (void)sendCompleted;

 // Sends the subscriber a disposable that represents one of its subscriptions.


- remove unnecessary code

- remove unnecessary code

--- misc/bxcommit.c
+++ misc/bxcommit.c
@@ -1,6 +1,6 @@
 /*
  * misc/bximage.c
- * $Id: bxcommit.c,v 1.5 2003/10/02 10:22:46 bdenney Exp $
+ * $Id: bxcommit.c,v 1.6 2004/04/28 17:56:47 cbothamy Exp $
  *
  * Commits a redolog file in a flat file for bochs images.
  *
@@ -35,7 +35,7 @@
 #include "../iodev/harddrv.h"

 char *EOF_ERR = "ERROR: End of input";
-char *rcsid = "$Id: bxcommit.c,v 1.5 2003/10/02 10:22:46 bdenney Exp $";
+char *rcsid = "$Id: bxcommit.c,v 1.6 2004/04/28 17:56:47 cbothamy Exp $";
 char *divider = "========================================================================";

 void myexit (int code)
@@ -345,8 +345,6 @@
   char redologname[256];
   int  remove;

-  int (*commit_function)(FILE*, Bit64u)=NULL;
-
   print_banner ();
   filename[0] = 0;
   redologname[0] = 0;


MainWindow: clarify headers

MainWindow: clarify headers

This could have been part of 42e350319528d465c4679175f6e0532a06adb970.

This isn't necessary right now, because we're getting the definition of
QUrl from one of the *TabWidget headers.  However, once we finish
pointerifying "mainwindow.h", we would be left without a necessary
definition.

--- src/widgets/mainwindow.h
+++ src/widgets/mainwindow.h
@@ -8,6 +8,7 @@
 #include <QMap>
 #include <QObject>
 #include <QString>
+#include <QUrl>
 #include <QUuid>
 #include <QVector>
 #include <QWidget>
@@ -37,7 +38,6 @@
 class BaseTask;
 class QEvent;
 class QMenuBar;
-class QUrl;
 struct LogEntry;

 /*!


空フィールドが終端にある DICOM データ解析時の不具合を修正．

空フィールドが終端にある DICOM データ解析時の不具合を修正．

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

--- mist/io/dicom.h
+++ mist/io/dicom.h
@@ -196,7 +196,7 @@
 	//!
 	inline unsigned char *read_dicom_tag( unsigned char *p, unsigned char *e, dicom_tag &tag, difference_type &numBytes, bool from_little_endian = true )
 	{
-		if( p == NULL || p + 8 >= e )
+		if( p == NULL || p + 8 > e )
 		{
 			numBytes = -1;
 			return( e );


memcg: Simplify mem_cgroup_force_empty_list error handling

mem_cgroup_force_empty_list currently tries to remove all pages from
the given LRU. To prevent from temoporary failures (EBUSY returned by
mem_cgroup_move_parent) it uses a margin to the current LRU pages and
returns the true if there are still some pages left on the list.

If we consider that mem_cgroup_move_parent fails only when it is racing
with somebody else removing (uncharging) the page or when the page is
migrated then it is obvious that all those failures are only temporal
and so we can safely retry later.
Let's get rid of the safety margin and make the loop really wait for
the empty LRU. The caller should still make sure that all charges have
been removed from the res_counter because mem_cgroup_replace_page_cache
might add a page to the LRU after the list_empty check (it doesn't touch
res_counter though).
This catches most of the cases except for shmem which might call
mem_cgroup_replace_page_cache with a page which is not charged and on
the LRU yet but this was the case also without this patch. In order to
fix this we need a guarantee that try_get_mem_cgroup_from_page falls
back to the current mm's cgroup so it needs css_tryget to fail. This
will be fixed up in a later patch because it needs a help from cgroup
core (pre_destroy has to be called after css is cleared).

Although mem_cgroup_pre_destroy can still fail (if a new task or a new
sub-group appears) there is no reason to retry pre_destroy callback from
the cgroup core. This means that __DEPRECATED_clear_css_refs has lost
its meaning and it can be removed.

Changes since v2
- remove __DEPRECATED_clear_css_refs

Changes since v1
- use kerndoc
- be more specific about mem_cgroup_move_parent possible failures

Signed-off-by: Michal Hocko <829500b200af6c2a0eca4dfd5c388e6b8fbe8dc6@suse.cz>
Reviewed-by: Tejun Heo <546b05909706652891a87f7bfe385ae147f61f91@kernel.org>
Reviewed-by: Glauber Costa <f8b79557d19b40666ebe336545a0b6178af65685@parallels.com>
Signed-off-by: Tejun Heo <546b05909706652891a87f7bfe385ae147f61f91@kernel.org>

--- mm/memcontrol.c
+++ mm/memcontrol.c
@@ -2702,10 +2702,27 @@
 	return ret;
 }

-/*
- * move charges to its parent.
- */
-
+/**
+ * mem_cgroup_move_parent - moves page to the parent group
+ * @page: the page to move
+ * @pc: page_cgroup of the page
+ * @child: page's cgroup
+ *
+ * move charges to its parent or the root cgroup if the group has no
+ * parent (aka use_hierarchy==0).
+ * Although this might fail (get_page_unless_zero, isolate_lru_page or
+ * mem_cgroup_move_account fails) the failure is always temporary and
+ * it signals a race with a page removal/uncharge or migration. In the
+ * first case the page is on the way out and it will vanish from the LRU
+ * on the next attempt and the call should be retried later.
+ * Isolation from the LRU fails only if page has been isolated from
+ * the LRU since we looked at it and that usually means either global
+ * reclaim or migration going on. The page will either get back to the
+ * LRU or vanish.
+ * Finaly mem_cgroup_move_account fails only if the page got uncharged
+ * (!PageCgroupUsed) or moved to a different group. The page will
+ * disappear in the next attempt.
+ */
 static int mem_cgroup_move_parent(struct page *page,
 				  struct page_cgroup *pc,
 				  struct mem_cgroup *child)
@@ -2732,8 +2749,10 @@
 	if (!parent)
 		parent = root_mem_cgroup;

-	if (nr_pages > 1)
+	if (nr_pages > 1) {
+		VM_BUG_ON(!PageTransHuge(page));
 		flags = compound_lock_irqsave(page);
+	}

 	ret = mem_cgroup_move_account(page, nr_pages,
 				pc, child, parent);
@@ -3683,17 +3702,22 @@
 	return nr_reclaimed;
 }

-/*
+/**
+ * mem_cgroup_force_empty_list - clears LRU of a group
+ * @memcg: group to clear
+ * @node: NUMA node
+ * @zid: zone id
+ * @lru: lru to to clear
+ *
  * Traverse a specified page_cgroup list and try to drop them all.  This doesn't
- * reclaim the pages page themselves - it just removes the page_cgroups.
- * Returns true if some page_cgroups were not freed, indicating that the caller
- * must retry this operation.
- */
-static bool mem_cgroup_force_empty_list(struct mem_cgroup *memcg,
+ * reclaim the pages page themselves - pages are moved to the parent (or root)
+ * group.
+ */
+static void mem_cgroup_force_empty_list(struct mem_cgroup *memcg,
 				int node, int zid, enum lru_list lru)
 {
 	struct mem_cgroup_per_zone *mz;
-	unsigned long flags, loop;
+	unsigned long flags;
 	struct list_head *list;
 	struct page *busy;
 	struct zone *zone;
@@ -3702,11 +3726,8 @@
 	mz = mem_cgroup_zoneinfo(memcg, node, zid);
 	list = &mz->lruvec.lists[lru];

-	loop = mz->lru_size[lru];
-	/* give some margin against EBUSY etc...*/
-	loop += 256;
 	busy = NULL;
-	while (loop--) {
+	do {
 		struct page_cgroup *pc;
 		struct page *page;

@@ -3732,8 +3753,7 @@
 			cond_resched();
 		} else
 			busy = NULL;
-	}
-	return !list_empty(list);
+	} while (!list_empty(list));
 }

 /*
@@ -3747,7 +3767,6 @@
 {
 	struct cgroup *cgrp = memcg->css.cgroup;
 	int node, zid;
-	int ret;

 	do {
 		if (cgroup_task_count(cgrp) || !list_empty(&cgrp->children))
@@ -3755,28 +3774,30 @@
 		/* This is for making all *used* pages to be on LRU. */
 		lru_add_drain_all();
 		drain_all_stock_sync(memcg);
-		ret = 0;
 		mem_cgroup_start_move(memcg);
 		for_each_node_state(node, N_HIGH_MEMORY) {
-			for (zid = 0; !ret && zid < MAX_NR_ZONES; zid++) {
+			for (zid = 0; zid < MAX_NR_ZONES; zid++) {
 				enum lru_list lru;
 				for_each_lru(lru) {
-					ret = mem_cgroup_force_empty_list(memcg,
+					mem_cgroup_force_empty_list(memcg,
 							node, zid, lru);
-					if (ret)
-						break;
 				}
 			}
-			if (ret)
-				break;
 		}
 		mem_cgroup_end_move(memcg);
 		memcg_oom_recover(memcg);
 		cond_resched();
-	/* "ret" should also be checked to ensure all lists are empty. */
-	} while (res_counter_read_u64(&memcg->res, RES_USAGE) > 0 || ret);
-
-	return ret;
+
+		/*
+		 * This is a safety check because mem_cgroup_force_empty_list
+		 * could have raced with mem_cgroup_replace_page_cache callers
+		 * so the lru seemed empty but the page could have been added
+		 * right after the check. RES_USAGE should be safe as we always
+		 * charge before adding to the LRU.
+		 */
+	} while (res_counter_read_u64(&memcg->res, RES_USAGE) > 0);
+
+	return 0;
 }

 /*
@@ -5618,7 +5639,6 @@
 	.base_cftypes = mem_cgroup_files,
 	.early_init = 0,
 	.use_id = 1,
-	.__DEPRECATED_clear_css_refs = true,
 };

 #ifdef CONFIG_MEMCG_SWAP


mark the ccb used for error handling as complete when it completes. this prevents dmesg spam when we return this ccb to the free list.

--- dev/pci/ahci.c
+++ dev/pci/ahci.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: ahci.c,v 1.115 2007/04/22 05:03:04 dlg Exp $ */
+/*	$OpenBSD: ahci.c,v 1.116 2007/04/22 05:08:34 dlg Exp $ */

 /*
  * Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -2419,5 +2419,5 @@
 void
 ahci_empty_done(struct ahci_ccb *ccb)
 {
-	/* do nothing */
-}
+	ccb->ccb_xa.state = ATA_S_COMPLETE;
+}


Correct some minor whitespace issues.

Correct some minor whitespace issues.

--- dev/pci/ahci.c
+++ dev/pci/ahci.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: ahci.c,v 1.103 2007/03/28 06:40:19 pascoe Exp $ */
+/*	$OpenBSD: ahci.c,v 1.104 2007/03/29 02:35:41 pascoe Exp $ */

 /*
  * Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -931,7 +931,7 @@
 			    port);
 			break;
 		default:
-			DPRINTF(AHCI_D_VERBOSE, "%s: no device detected"
+			DPRINTF(AHCI_D_VERBOSE, "%s: no device detected "
 			    "on port %d\n", DEVNAME(sc), port);
 			break;
 		}
@@ -970,8 +970,8 @@

 	/* Enable port interrupts */
 	ahci_pwrite(ap, AHCI_PREG_IE, AHCI_PREG_IE_TFEE | AHCI_PREG_IE_HBFE |
-	     AHCI_PREG_IE_IFE | AHCI_PREG_IE_OFE | AHCI_PREG_IE_DPE |
-	     AHCI_PREG_IE_UFE | AHCI_PREG_IE_SDBE | AHCI_PREG_IE_DHRE);
+	    AHCI_PREG_IE_IFE | AHCI_PREG_IE_OFE | AHCI_PREG_IE_DPE |
+	    AHCI_PREG_IE_UFE | AHCI_PREG_IE_SDBE | AHCI_PREG_IE_DHRE);

 freeport:
 	if (rc != 0)
@@ -1808,14 +1808,14 @@
 	ap->ap_err_saved_active_cnt = ap->ap_active_cnt;
 	ap->ap_err_saved_sactive = ap->ap_sactive;

-	/*
+	/*
 	 * Pretend we have no commands outstanding, so that completions won't
 	 * run prematurely.
 	 */
 	ap->ap_active = ap->ap_active_cnt = ap->ap_sactive = 0;

 	/*
-	 * Grab a CCB to use for error recovery.  This should never fail, as
+	 * Grab a CCB to use for error recovery.  This should never fail, as
 	 * we ask atascsi to reserve one for us at init time.
 	 */
 	err_ccb = ahci_get_ccb(ap);


expose HT mixer; since neither the digital mixer nor codec sub-mixers are implemented, it's empty.

--- dev/pci/envy.c
+++ dev/pci/envy.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: envy.c,v 1.21 2009/05/08 14:56:03 ratchov Exp $	*/
+/*	$OpenBSD: envy.c,v 1.22 2009/05/08 15:17:41 ratchov Exp $	*/
 /*
  * Copyright (c) 2007 Alexandre Ratchov <alex@caoua.org>
  *
@@ -109,6 +109,7 @@

 void unkenvy_init(struct envy_softc *);
 void unkenvy_ak_write(struct envy_softc *, int, int, int);
+int unkenvy_codec_ndev(struct envy_softc *);

 int ak4524_dac_ndev(struct envy_softc *);
 void ak4524_dac_devinfo(struct envy_softc *, struct mixer_devinfo *, int);
@@ -191,7 +192,7 @@
 }, ak4524_adc = {
 	"ak4524 adc", ak4524_adc_ndev, ak4524_adc_devinfo, ak4524_adc_get, ak4524_adc_set
 }, unkenvy_codec = {
-	"unknown codec", 0, NULL, NULL, NULL
+	"unknown codec", unkenvy_codec_ndev, NULL, NULL, NULL
 };

 /*
@@ -314,6 +315,12 @@
 void
 unkenvy_ak_write(struct envy_softc *sc, int dev, int addr, int data)
 {
+}
+
+int
+unkenvy_codec_ndev(struct envy_softc *sc)
+{
+	return 0;
 }

 /*
@@ -1228,8 +1235,6 @@
 		AudioCinputs, AudioCoutputs, AudioCmonitor
 	};

-	if (sc->isht)		/* no mixer yet */
-		return ENXIO;
 	if (dev->index < 0)
 		return ENXIO;

@@ -1251,7 +1256,7 @@
 	/*
 	 * output.lineX_source
 	 */
-	ndev = sc->card->noch;
+	ndev = sc->isht ? 0 : sc->card->noch;
 	if (idx < ndev) {
 		n = 0;
 		dev->type = AUDIO_MIXER_ENUM;
@@ -1279,7 +1284,7 @@
 	/*
 	 * envy monitor level
 	 */
-	ndev = ENVY_MIX_NMONITOR;
+	ndev = sc->isht ? 0 : ENVY_MIX_NMONITOR;
 	if (idx < ndev) {
 		dev->type = AUDIO_MIXER_VALUE;
 		dev->mixer_class = ENVY_MIX_CLASSMON;
@@ -1319,14 +1324,12 @@
 	struct envy_softc *sc = (struct envy_softc *)self;
 	int val, idx, ndev;

-	if (sc->isht)	/* no mixer yet */
-		return EINVAL;
 	if (ctl->dev < ENVY_MIX_NCLASS) {
 		return EINVAL;
 	}

 	idx = ctl->dev - ENVY_MIX_NCLASS;
-	ndev = sc->card->noch;
+	ndev = sc->isht ? 0 : sc->card->noch;
 	if (idx < ndev) {
 		ctl->un.ord = envy_lineout_getsrc(sc, idx);
 		if (ctl->un.ord >= ENVY_MIX_NOUTSRC)
@@ -1334,7 +1337,7 @@
 		return 0;
 	}
 	idx -= ndev;
-	ndev = ENVY_MIX_NMONITOR;
+	ndev = sc->isht ? 0 : ENVY_MIX_NMONITOR;
 	if (idx < ndev) {
 		envy_mon_getvol(sc, idx / 2, idx % 2, &val);
 		ctl->un.value.num_channels = 1;
@@ -1362,14 +1365,12 @@
 	struct envy_softc *sc = (struct envy_softc *)self;
 	int maxsrc, val, idx, ndev;

-	if (sc->isht)	/* no mixer yet */
-		return EINVAL;
 	if (ctl->dev < ENVY_MIX_NCLASS) {
 		return EINVAL;
 	}

 	idx = ctl->dev - ENVY_MIX_NCLASS;
-	ndev = sc->card->noch;
+	ndev = sc->isht ? 0 : sc->card->noch;
 	if (idx < ndev) {
 		maxsrc = sc->card->nich + 1;
 		if (idx < 2)
@@ -1382,7 +1383,7 @@
 		return 0;
 	}
 	idx -= ndev;
-	ndev = ENVY_MIX_NMONITOR;
+	ndev = sc->isht ? 0 : ENVY_MIX_NMONITOR;
 	if (idx < ndev) {
 		if (ctl->un.value.num_channels != 1) {
 			return EINVAL;


Do not set USBD_NO_COPY for interrupt transfers, only bulk transfers
are converted for the moment.

From Grant Czajkowski.

--- dev/usb/ugen.c
+++ dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: ugen.c,v 1.87 2015/09/04 08:59:43 mpi Exp $ */
+/*	$OpenBSD: ugen.c,v 1.88 2015/09/07 19:58:42 mpi Exp $ */
 /*	$NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $	*/

@@ -667,7 +667,7 @@
 		return (EIO);
 	}
 #endif
-	flags = USBD_SYNCHRONOUS | USBD_NO_COPY;
+	flags = USBD_SYNCHRONOUS;
 	if (sce->timeout == 0)
 		flags |= USBD_CATCH;

@@ -685,6 +685,7 @@
 			error = uiomovei(ptr, n, uio);
 			if (error)
 				goto done;
+			flags |= USBD_NO_COPY;
 			DPRINTFN(1, ("ugenwrite: transfer %d bytes\n", n));
 			usbd_setup_xfer(xfer, sce->pipeh, 0, NULL, n,
 			    flags, sce->timeout, NULL);


from netbsd, uhci.c revision 1.180

from netbsd, uhci.c revision 1.180

hcpriv is not actually used here.  Remove references to it.


Make Sun type 6 USB keyboards return extended keycodes for 'L' keys ok deraadt@.


Clang-Tidy - modernize-pass-by-value.

Clang-Tidy - modernize-pass-by-value.

--- Source/Urho3D/Core/Object.h
+++ Source/Urho3D/Core/Object.h
@@ -25,6 +25,7 @@
 #include "../Container/LinkedList.h"
 #include "../Core/Variant.h"
 #include <functional>
+#include <utility>

 namespace Urho3D
 {
@@ -331,7 +332,7 @@
     /// Construct with receiver and function pointers and userdata.
     EventHandler11Impl(std::function<void(StringHash, VariantMap&)> function, void* userData = nullptr) :
         EventHandler(nullptr, userData),
-        function_(function)
+        function_(std::move(function))
     {
         assert(function_);
     }


use the proper GLX_ constant macros instead of the raw values

--- glx_hook.c
+++ glx_hook.c
@@ -1115,16 +1115,16 @@
 			int value = attribs[2*count + 1];
 			GH_verbose(GH_MSG_INFO, "originally requested attrib: 0x%x = %d\n", name, value);
 			switch(name) {
-				case 0x2091: /* GLX_CONTEXT_MAJOR_VERSION_ARB */
+				case GLX_CONTEXT_MAJOR_VERSION_ARB:
 					req_version[0] = value;
 					break;
-				case 0x2092: /* GLX_CONTEXT_MINOR_VERSION_ARB */
+				case GLX_CONTEXT_MINOR_VERSION_ARB:
 					req_version[1] = value;
 					break;
-				case 0x9126: /* GLX_CONTEXT_PROFILE_MASK_ARB */
+				case GLX_CONTEXT_PROFILE_MASK_ARB:
 					req_profile_mask = value;
 					break;
-				case 0x2094: /* GLX_CONTEXT_FLAGS_ARB */
+				case GLX_CONTEXT_FLAGS_ARB:
 					req_flags = value;
 					break;
 				default:
@@ -1162,23 +1162,23 @@
 		return NULL;
 	}

-	attr_override[pos++] = 0x2091; /* GLX_CONTEXT_MAJOR_VERSION_ARB*/
+	attr_override[pos++] = GLX_CONTEXT_MAJOR_VERSION_ARB;
 	attr_override[pos++] = req_version[0];
-	attr_override[pos++] = 0x2092; /* GLX_CONTEXT_MINOR_VERSION_ARB*/
+	attr_override[pos++] = GLX_CONTEXT_MINOR_VERSION_ARB;
 	attr_override[pos++] = req_version[1];
-	attr_override[pos++] = 0x9126; /* GLX_CONTEXT_PROFILE_MASK_ARB*/
+	attr_override[pos++] = GLX_CONTEXT_PROFILE_MASK_ARB;
 	attr_override[pos++] = req_profile_mask;
-	attr_override[pos++] = 0x2094; /* GLX_CONTEXT_FLAGS_ARB*/
+	attr_override[pos++] = GLX_CONTEXT_FLAGS_ARB;
 	attr_override[pos++] = req_flags;

 	for (i=0; i<count; i++) {
 		unsigned int name = (unsigned)attribs[2*i];
 		int value = attribs[2*i+1];
 		switch (name) {
-			case 0x2091: /* GLX_CONTEXT_MAJOR_VERSION_ARB */
-			case 0x2092: /* GLX_CONTEXT_MINOR_VERSION_ARB */
-			case 0x9126: /* GLX_CONTEXT_PROFILE_MASK_ARB */
-			case 0x2094: /* GLX_CONTEXT_FLAGS_ARB */
+			case GLX_CONTEXT_MAJOR_VERSION_ARB:
+			case GLX_CONTEXT_MINOR_VERSION_ARB:
+			case GLX_CONTEXT_PROFILE_MASK_ARB:
+			case GLX_CONTEXT_FLAGS_ARB:
 				(void)0;
 				break;
 			default: