Show Print background images option in print dialog

--- midori/midori-view.c
+++ midori/midori-view.c
@@ -1614,6 +1614,17 @@
     return TRUE;
 }

+#if WEBKIT_CHECK_VERSION (1, 1, 5)
+static gboolean
+midori_view_web_view_print_requested_cb (GtkWidget*      web_view,
+                                         WebKitWebFrame* web_frame,
+                                         MidoriView*     view)
+{
+    midori_view_print (view);
+    return TRUE;
+}
+#endif
+
 static void
 webkit_web_view_window_object_cleared_cb (GtkWidget*      web_view,
                                           WebKitWebFrame* web_frame,
@@ -2062,6 +2073,10 @@
                       "signal::download-requested",
                       webkit_web_view_download_requested_cb, view,
                       #endif
+                      #if WEBKIT_CHECK_VERSION (1, 1, 5)
+                      "signal::print-requested",
+                      midori_view_web_view_print_requested_cb, view,
+                      #endif
                       #if WEBKIT_CHECK_VERSION (1, 1, 6)
                       "signal::load-error",
                       webkit_web_view_load_error_cb, view,
@@ -3113,6 +3128,43 @@
     webkit_web_view_go_forward (WEBKIT_WEB_VIEW (view->web_view));
 }

+#if WEBKIT_CHECK_VERSION (1, 1, 5)
+static GtkWidget*
+midori_view_print_create_custom_widget_cb (GtkPrintOperation* operation,
+                                           MidoriView*        view)
+{
+    GtkWidget* box;
+    GtkWidget* button;
+
+    box = gtk_vbox_new (FALSE, 0);
+    gtk_container_set_border_width (GTK_CONTAINER (box), 4);
+    button = gtk_check_button_new ();
+    g_object_set_data (G_OBJECT (operation), "print-backgrounds", button);
+    gtk_button_set_label (GTK_BUTTON (button), _("Print background images"));
+    gtk_widget_set_tooltip_text (button, _("Whether background images should be printed"));
+    if (katze_object_get_boolean (view->settings, "print-backgrounds"))
+        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+    gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
+    gtk_widget_show_all (box);
+
+    return box;
+}
+
+static void
+midori_view_print_custom_widget_apply_cb (GtkPrintOperation* operation,
+                                          GtkWidget*         widget,
+                                          MidoriView*        view)
+{
+    GtkWidget* button;
+
+    button = g_object_get_data (G_OBJECT (operation), "print-backgrounds");
+    g_object_set (view->settings,
+        "print-backgrounds",
+        gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)),
+        NULL);
+}
+#endif
+
 /**
  * midori_view_print
  * @view: a #MidoriView
@@ -3122,10 +3174,43 @@
 void
 midori_view_print (MidoriView* view)
 {
+    WebKitWebFrame* frame;
+    #if WEBKIT_CHECK_VERSION (1, 1, 5)
+    GtkPrintOperation* operation;
+    GError* error;
+    #endif
+
     g_return_if_fail (MIDORI_IS_VIEW (view));

-    webkit_web_frame_print (webkit_web_view_get_main_frame (
-        WEBKIT_WEB_VIEW (view->web_view)));
+    frame = webkit_web_view_get_main_frame (WEBKIT_WEB_VIEW (view->web_view));
+    #if WEBKIT_CHECK_VERSION (1, 1, 5)
+    operation = gtk_print_operation_new ();
+    gtk_print_operation_set_custom_tab_label (operation, _("Features"));
+    g_signal_connect (operation, "create-custom-widget",
+        G_CALLBACK (midori_view_print_create_custom_widget_cb), view);
+    g_signal_connect (operation, "custom-widget-apply",
+        G_CALLBACK (midori_view_print_custom_widget_apply_cb), view);
+    error = NULL;
+    webkit_web_frame_print_full (frame, operation,
+        GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, &error);
+    g_object_unref (operation);
+
+    if (error)
+    {
+        GtkWidget* window = gtk_widget_get_toplevel (GTK_WIDGET (view));
+        GtkWidget* dialog = gtk_message_dialog_new (
+            GTK_WIDGET_TOPLEVEL (window) ? GTK_WINDOW (window) : NULL,
+            GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR,
+            GTK_BUTTONS_CLOSE, "%s", error->message);
+        g_error_free (error);
+
+        g_signal_connect (dialog, "response",
+                          G_CALLBACK (gtk_widget_destroy), NULL);
+        gtk_widget_show (dialog);
+    }
+    #else
+    webkit_web_frame_print (frame);
+    #endif
 }

 /**


net/virtio-user: fix Rx interrupts with multi-queue

The callfds[] array stores eventfds sequentially for Rx and Tx vq.

Fixes: 3d4fb6fd2505 ("net/virtio-user: support Rx interrupt")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <f28529695cfa9e3e1eb84e7072aa626af4abb18e@redhat.com>
Reviewed-by: Maxime Coquelin <9a2667dee3b90866bbc9c2696cff2b7d5616c95a@redhat.com>

--- drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -416,7 +416,7 @@
 	}

 	for (i = 0; i < dev->max_queue_pairs; ++i)
-		eth_dev->intr_handle->efds[i] = dev->callfds[i];
+		eth_dev->intr_handle->efds[i] = dev->callfds[2 * i];
 	eth_dev->intr_handle->nb_efd = dev->max_queue_pairs;
 	eth_dev->intr_handle->max_intr = dev->max_queue_pairs + 1;
 	eth_dev->intr_handle->type = RTE_INTR_HANDLE_VDEV;


Remove warnings #6992

Remove warnings #6992

--- src/condor_utils/condor_claimid_parser.h
+++ src/condor_utils/condor_claimid_parser.h
@@ -37,7 +37,7 @@
 	ClaimIdParser(char const *session_id,char const *session_info,char const *session_key):
 		m_suppress_session(false)
 	{
-		m_claim_id.formatstr("%s#%s%s",
+		formatstr(m_claim_id,"%s#%s%s",
 						   session_id ? session_id : "",
 						   session_info ? session_info : "",
 						   session_key ? session_key : "");
@@ -50,11 +50,11 @@
 		m_public_part = "";
 	}
 	char const *claimId() {
-		return m_claim_id.Value();
+		return m_claim_id.c_str();
 	}
 	char const *startdSinfulAddr() {
-		if( m_sinful_part.IsEmpty() ) {
-			char const *str = m_claim_id.Value();
+		if( m_sinful_part.empty() ) {
+			char const *str = m_claim_id.c_str();
 			char const *end;
 			if ( str[0] == '<' ) {
 				end = strchr(str, '>');
@@ -64,19 +64,20 @@
 			} else {
 				end = strchr(str, '#');
 			}
-			int length = end ? end - str : 0;
-			m_sinful_part.formatstr("%.*s",length,str);
+			if (end) m_sinful_part.assign(str,end);
 		}
-		return m_sinful_part.Value();
+		return m_sinful_part.c_str();
 	}
 	char const *publicClaimId() {
-		if( m_public_part.IsEmpty() ) {
-			char const *str = m_claim_id.Value();
+		if( m_public_part.empty() ) {
+			char const *str = m_claim_id.c_str();
 			char const *end = strrchr(str,'#');
-			int length = end ? end - str : 0;
-			m_public_part.formatstr("%.*s#...",length,str);
+			if (end) {
+				m_public_part.assign(str,end);
+				m_public_part += "#...";
+			}
 		}
-		return m_public_part.Value();
+		return m_public_part.c_str();
 	}

 	char const *secSessionId(bool ignore_session_info=false) {
@@ -93,17 +94,16 @@
 				// startCommand().
 			return NULL;
 		}
-		if( m_session_id.IsEmpty() ) {
-			char const *str = m_claim_id.Value();
+		if( m_session_id.empty() ) {
+			char const *str = m_claim_id.c_str();
 			char const *end = strrchr(str,'#');
-			int length = end ? end - str : 0;
-			m_session_id.formatstr("%.*s",length,str);
+			if (end) m_session_id.assign(str,end);
 		}
-		return m_session_id.Value();
+		return m_session_id.c_str();
 	}
 	char const *secSessionKey() {
 			// expected format: blah#blah#...#[session_info]SESSION_KEY
-		char const *str = m_claim_id.Value();
+		char const *str = m_claim_id.c_str();
 		char const *ptr = strrchr(str,'#');
 		if(ptr) {
 			ptr+=1;
@@ -120,8 +120,8 @@
 	}
 	char const *secSessionInfo() {
 			// expected format: blah#blah#...#[session_info]SESSION_KEY
-		if( m_session_info.IsEmpty() ) {
-			char const *str = m_claim_id.Value();
+		if( m_session_info.empty() ) {
+			char const *str = m_claim_id.c_str();
 			char const *ptr = strrchr(str,'#');
 			char const *endptr;
 			if( !ptr ) {
@@ -135,14 +135,14 @@
 			if(!endptr || endptr < ptr) {
 				return NULL;
 			}
-			m_session_info.formatstr("%.*s",(int)(endptr+1-ptr),ptr);
+			m_session_info.assign(ptr,endptr+1);
 		}

-		if( m_session_info.IsEmpty() ) {
+		if( m_session_info.empty() ) {
 				// returning NULL here is a convenience for call sites
 			return NULL;
 		}
-		return m_session_info.Value();
+		return m_session_info.c_str();
 	}
 	void setSecSessionInfo(char const *session_info) {
 		if(session_info) {
@@ -151,29 +151,28 @@
 			ASSERT(strchr(session_info,'#') == NULL);
 		}

-		MyString new_claim_id = secSessionId(true);
+		std::string new_claim_id(secSessionId(true));
 		char const *session_key = secSessionKey();
-		new_claim_id.formatstr_cat("#%s%s",
+		formatstr_cat(new_claim_id,"#%s%s",
 			session_info ? session_info : "",
 			session_key ? session_key : "");

 			// reset everything using the new claim id
-		*this = ClaimIdParser(new_claim_id.Value());
+		*this = ClaimIdParser(new_claim_id.c_str());
 	}
 	void suppressSecSession( bool toggle ) {
 		m_suppress_session = toggle;
 	}

  private:
-	MyString m_claim_id;
-	MyString m_public_part;
-	MyString m_sinful_part;
+	std::string m_claim_id;
+	std::string m_public_part;
+	std::string m_sinful_part;

 		// The following fields are for SEC_ENABLE_MATCH_PASSWORD_AUTHENTICATION
 	bool m_suppress_session; // if true, secSessionId() always returns NULL
-	MyString m_session_id;
-	MyString m_session_key;
-	MyString m_session_info;
+	std::string m_session_id;
+	std::string m_session_info;
 };

 #endif


Fix a few issues resulting from m_getfld() API changes.

--- uip/fmttest.c
+++ uip/fmttest.c
@@ -496,6 +496,8 @@
     struct msgs *mp;
     struct comp *c;
     FILE *in;
+    m_getfld_state_t gstate = 0;
+    int bufsz;

     if (! folder)
     	folder = getfolder(1);
@@ -585,29 +587,33 @@
 	     */

 	    for (state = FLD;;) {
-	    	state = m_getfld(state, name, rbuf, sizeof(rbuf), in);
+	    	bufsz = sizeof(rbuf);
+	    	state = m_getfld(&gstate, name, rbuf, &bufsz, in);
 		switch (state) {
 		case FLD:
 		case FLDPLUS:
 		    i = fmt_addcomptext(name, rbuf);
 		    if (i != -1) {
 		    	while (state == FLDPLUS) {
-			    state = m_getfld(state, name, rbuf,
-			    		     sizeof(rbuf), in);
+			    bufsz = sizeof(rbuf);
+			    state = m_getfld(&gstate, name, rbuf, &bufsz, in);
 			    fmt_appendcomp(i, name, rbuf);
 			}
 		    }

-		    while (state == FLDPLUS)
-		    	state = m_getfld(state, name, rbuf,
-					 sizeof(rbuf), in);
+		    while (state == FLDPLUS) {
+		    	bufsz = sizeof(rbuf);
+		    	state = m_getfld(&gstate, name, rbuf, &bufsz, in);
+		    }
 		    break;

 		case BODY:
 		    if (fmt_findcomp("body")) {
-			if ((i = strlen(rbuf)) < outwidth)
-			    state = m_getfld(state, name, rbuf + i,
-			    		     outwidth - 1, in);
+			if ((i = strlen(rbuf)) < outwidth) {
+			    bufsz = outwidth - 1;
+			    state = m_getfld(&gstate, name, rbuf + i,
+			    		     &bufsz, in);
+			}

 			fmt_addcomptext("body", rbuf);
 		    }
@@ -619,6 +625,7 @@
 	    }
 finished:
 	    fclose(in);
+	    m_getfld_state_destroy(&gstate);

 	    /*
 	     * Do this now to override any components in the original message


Add missing "const" in operator bool()

Add missing "const" in operator bool()

--- plugin/amxdebuginfo.h
+++ plugin/amxdebuginfo.h
@@ -106,7 +106,7 @@
     std::string GetName() const    { return file_->name; }
     cell        GetAddress() const { return file_->address; }

-    operator bool() { return file_ != 0; }
+    operator bool() const { return file_ != 0; }

    private:
     const AMX_DBG_FILE *file_;
@@ -120,7 +120,7 @@
     int32_t GetNumber() const  { return line_.line; }
     cell    GetAddress() const { return line_.address; }

-    operator bool() { return line_.address != 0; }
+    operator bool() const { return line_.address != 0; }

    private:
     AMX_DBG_LINE line_;
@@ -134,7 +134,7 @@
     int32_t     GetID() const   { return tag_->tag; }
     std::string GetName() const { return tag_->name; }

-    operator bool() { return tag_ != 0; }
+    operator bool() const { return tag_ != 0; }

    private:
     const AMX_DBG_TAG *tag_;
@@ -149,7 +149,7 @@
      cell        GetAddress() const   { return automaton_->address; }
      std::string GetName() const      { return automaton_->name; }

-     operator bool() { return automaton_ != 0; }
+     operator bool() const { return automaton_ != 0; }

    private:
     const AMX_DBG_MACHINE *automaton_;
@@ -164,7 +164,7 @@
      int16_t     GetAutomaton() const { return state_->automaton; }
      std::string GetName() const      { return state_->name; }

-     operator bool() { return state_ != 0; }
+     operator bool() const { return state_ != 0; }

    private:
      const AMX_DBG_STATE *state_;
@@ -217,7 +217,7 @@

     std::vector<SymbolDim> GetDims() const;

-    operator bool() { return symbol_ != 0; }
+    operator bool() const { return symbol_ != 0; }

    private:
     const AMX_DBG_SYMBOL *symbol_;
@@ -231,7 +231,7 @@
     int16_t GetTag() const  { return symdim_->tag; }
     cell    GetSize() const { return symdim_->size; }

-    operator bool() { return symdim_ != 0; }
+    operator bool() const { return symdim_ != 0; }

    private:
     const AMX_DBG_SYMDIM *symdim_;


Use grn_bool

Use grn_bool

--- lib/tokenizers.c
+++ lib/tokenizers.c
@@ -243,12 +243,12 @@
 typedef struct {
   grn_tokenizer_token token;
   grn_tokenizer_query *query;
-  uint8_t uni_alpha;
-  uint8_t uni_digit;
-  uint8_t uni_symbol;
+  grn_bool uni_alpha;
+  grn_bool uni_digit;
+  grn_bool uni_symbol;
   uint8_t ngram_unit;
-  uint8_t ignore_blank;
-  uint8_t overlap;
+  grn_bool ignore_blank;
+  grn_bool overlap;
   int32_t pos;
   uint32_t skip;
   const unsigned char *next;
@@ -264,10 +264,10 @@
                grn_obj **args,
                grn_user_data *user_data,
                uint8_t ngram_unit,
-               uint8_t uni_alpha,
-               uint8_t uni_digit,
-               uint8_t uni_symbol,
-               uint8_t ignore_blank)
+               grn_bool uni_alpha,
+               grn_bool uni_digit,
+               grn_bool uni_symbol,
+               grn_bool ignore_blank)
 {
   unsigned int normalize_flags =
     GRN_STRING_REMOVE_BLANK |
@@ -319,50 +319,120 @@

 static grn_obj *
 unigram_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 1, 1, 1, 1, 0); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        1,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_FALSE);
+}

 static grn_obj *
 bigram_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 2, 1, 1, 1, 0); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        2,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_FALSE);
+}

 static grn_obj *
 trigram_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 3, 1, 1, 1, 0); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        3,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_FALSE);
+}

 static grn_obj *
 bigrams_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 2, 1, 1, 0, 0); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        2,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_FALSE,
+                        GRN_FALSE);
+}

 static grn_obj *
 bigramsa_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 2, 0, 1, 0, 0); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        2,
+                        GRN_FALSE,
+                        GRN_TRUE,
+                        GRN_FALSE,
+                        GRN_FALSE);
+}

 static grn_obj *
 bigramsad_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 2, 0, 0, 0, 0); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        2,
+                        GRN_FALSE,
+                        GRN_FALSE,
+                        GRN_FALSE,
+                        GRN_FALSE);
+}

 static grn_obj *
 bigrami_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 2, 1, 1, 1, 1); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        2,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_TRUE);
+}

 static grn_obj *
 bigramis_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 2, 1, 1, 0, 1); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        2,
+                        GRN_TRUE,
+                        GRN_TRUE,
+                        GRN_FALSE,
+                        GRN_TRUE);
+}

 static grn_obj *
 bigramisa_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 2, 0, 1, 0, 1); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        2,
+                        GRN_FALSE,
+                        GRN_TRUE,
+                        GRN_FALSE,
+                        GRN_TRUE);
+}

 static grn_obj *
 bigramisad_init(grn_ctx *ctx, int nargs, grn_obj **args, grn_user_data *user_data)
-{ return ngram_init_raw(ctx, nargs, args, user_data, 2, 0, 0, 0, 1); }
+{
+  return ngram_init_raw(ctx, nargs, args, user_data,
+                        2,
+                        GRN_FALSE,
+                        GRN_FALSE,
+                        GRN_FALSE,
+                        GRN_TRUE);
+}

 typedef struct {
   uint8_t unit;
-  uint8_t uni_alpha;
-  uint8_t uni_digit;
-  uint8_t uni_symbol;
-  uint8_t ignore_blank;
+  grn_bool uni_alpha;
+  grn_bool uni_digit;
+  grn_bool uni_symbol;
+  grn_bool ignore_blank;
 } ngram_options;

 static void *
@@ -379,10 +449,10 @@
   }

   options->unit = 2;
-  options->uni_alpha = 1;
-  options->uni_digit = 1;
-  options->uni_symbol = 1;
-  options->ignore_blank = 0;
+  options->uni_alpha = GRN_TRUE;
+  options->uni_digit = GRN_TRUE;
+  options->uni_symbol = GRN_TRUE;
+  options->ignore_blank = GRN_FALSE;

   GRN_OPTION_VALUES_EACH_BEGIN(ctx, raw_options, i, name, name_length) {
     grn_raw_string name_raw;


fs/char_dev.c: fix incorrect documentation for unregister_chrdev_region

The current documentation for unregister_chrdev_region says that it return
a range of device numbers which is incorrect.  Instead it unregister a
range of device numbers.  Fix the documentation to make this clear.

Signed-off-by: Partha Pratim Mukherjee <8db5615b6b89c5c32d59e212ff72b8010e14b992@gmail.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- fs/char_dev.c
+++ fs/char_dev.c
@@ -274,7 +274,7 @@
 }

 /**
- * unregister_chrdev_region() - return a range of device numbers
+ * unregister_chrdev_region() - unregister a range of device numbers
  * @from: the first in the range of numbers to unregister
  * @count: the number of device numbers to unregister
  *


Made spider.c look even better

Made spider.c look even better

* Added some parentheses for readability

--- polyorcspider/spider.c
+++ polyorcspider/spider.c
@@ -178,7 +178,7 @@

     /* Do the timeout action */
     rc = curl_multi_socket_action(global->multi, CURL_SOCKET_TIMEOUT, 0,
-                                  &global->still_running);
+                                  &(global->still_running));
     mcode_or_die("socket_action_timer_cb: curl_multi_socket_action", rc);
     check_multi_info(global);
 }
@@ -186,13 +186,13 @@
 /* Update the event timer ("wait for socket actions") after curl_multi library
    calls */
 static int multi_timer_cb(CURLM *multi, long timeout_ms, global_info *global) {
-    ev_timer_stop(global->loop, &global->timer_event);
+    ev_timer_stop(global->loop, &(global->timer_event));
     if (timeout_ms > 0) {
         double  t = timeout_ms / 1000;
-        ev_timer_init(&global->timer_event, socket_action_timer_cb, t, 0.);
-        ev_timer_start(global->loop, &global->timer_event);
+        ev_timer_init(&(global->timer_event), socket_action_timer_cb, t, 0.);
+        ev_timer_start(global->loop, &(global->timer_event));
     } else {
-        socket_action_timer_cb(global->loop, &global->timer_event, 0);
+        socket_action_timer_cb(global->loop, &(global->timer_event), 0);
     }
     return 0;
 }
@@ -205,12 +205,12 @@
     int action = (revents & EV_READ ? CURL_POLL_IN : 0) |
           (revents & EV_WRITE ? CURL_POLL_OUT : 0);
     rc = curl_multi_socket_action(global->multi, event_io->fd, action,
-                                  &global->still_running);
+                                  &(global->still_running));
     mcode_or_die("event_cb: curl_multi_socket_action", rc);
     check_multi_info(global);
     if (global->still_running <= 0) {
         printf("last transfer done, kill timeout\n");
-        ev_timer_stop(global->loop, &global->timer_event);
+        ev_timer_stop(global->loop, &(global->timer_event));
     }
 }

@@ -218,7 +218,7 @@
 static void remsock(sock_info *soc, global_info *global) {
     if (soc) {
         if (soc->evset) {
-            ev_io_stop(global->loop, &soc->ev);
+            ev_io_stop(global->loop, &(soc->ev));
         }
         free(soc);
     }
@@ -235,12 +235,12 @@
     soc->action = action;
     soc->easy = handle;
     if (soc->evset) {
-        ev_io_stop(global->loop, &soc->ev);
-    }
-    ev_io_init(&soc->ev, event_cb, soc->sockfd, kind);
+        ev_io_stop(global->loop, &(soc->ev));
+    }
+    ev_io_init(&(soc->ev), event_cb, soc->sockfd, kind);
     soc->ev.data = global;
     soc->evset = 1;
-    ev_io_start(global->loop, &soc->ev);
+    ev_io_start(global->loop, &(soc->ev));
 }

 /* Initialize a new SockInfo structure */
@@ -370,7 +370,7 @@

     new_conn(arg->url, &global);

-    /* Lets loop */
+    /* Lets find some urls */
     ev_loop(global.loop, 0);

     /* Cleanups after looping */


Added debug and error messsages to dfb_layer_context_set_configuration().

--- src/core/layer_context.c
+++ src/core/layer_context.c
@@ -575,6 +575,8 @@

      D_DEBUG_AT( Core_Layers, "%s (%p, %p)\n", __FUNCTION__, context, config );

+     D_DEBUG_AT( Core_Layers, "%s (%p, %p)\n", __FUNCTION__, context, config );
+
      D_ASSERT( context != NULL );
      D_ASSERT( config != NULL );


isl_test.c: avoid NULL pointer dereference

--- isl_test.c
+++ isl_test.c
@@ -152,7 +152,7 @@
 	isl_constraint_set_coefficient(c, isl_dim_div, pos, v);
 	bset = isl_basic_set_add_constraint(bset, c);

-	assert(bset->n_div == 1);
+	assert(bset && bset->n_div == 1);
 	isl_basic_set_free(bset);

 	/* test 2 */
@@ -181,7 +181,7 @@
 	isl_constraint_set_coefficient(c, isl_dim_div, pos, v);
 	bset = isl_basic_set_add_constraint(bset, c);

-	assert(bset->n_div == 1);
+	assert(bset && bset->n_div == 1);
 	isl_basic_set_free(bset);

 	/* test 3 */
@@ -210,7 +210,7 @@
 	isl_constraint_set_coefficient(c, isl_dim_div, pos, v);
 	bset = isl_basic_set_add_constraint(bset, c);

-	assert(bset->n_div == 1);
+	assert(bset && bset->n_div == 1);
 	isl_basic_set_free(bset);

 	/* test 4 */
@@ -262,7 +262,7 @@
 	isl_constraint_set_coefficient(c, isl_dim_set, 1, v);
 	bset = isl_basic_set_add_constraint(bset, c);

-	assert(bset->n_div == 0);
+	assert(bset && bset->n_div == 0);
 	isl_basic_set_free(bset);

 	/* test 6 */
@@ -285,7 +285,7 @@
 	isl_constraint_set_coefficient(c, isl_dim_set, 1, v);
 	bset = isl_basic_set_add_constraint(bset, c);

-	assert(bset->n_div == 1);
+	assert(bset && bset->n_div == 1);
 	isl_basic_set_free(bset);

 	/* test 7 */
@@ -316,7 +316,7 @@

 	/* Test disabled for now */
 	/*
-	assert(bset->n_div == 1);
+	assert(bset && bset->n_div == 1);
 	*/
 	isl_basic_set_free(bset);

@@ -348,7 +348,7 @@

 	/* Test disabled for now */
 	/*
-	assert(bset->n_div == 1);
+	assert(bset && bset->n_div == 1);
 	*/
 	isl_basic_set_free(bset);


Finish simple provider changes from r17616 on a couple of
Win32 only functions.

* subversion/libsvn_subr/simple_providers.c
  (windows_password_encrypter, windows_password_decrypter):
  Pass the new non_interactive flag on.


Liberalize the YUV4MPEG frame header parsing. The spec allows for some
informational tags separated by spaces between the 'FRAME' magic and the
'\n'. Also ffmpeg apparently always inserts a space based on incorrect
documentation shipped with the mjpegtools, so we need to handle that.

This code just scans for the first newline within 79 bytes of the magic
string, ignoring anything in between. According the mjpegtools source,
the maximum allowed header line is 256 bytes, but I stuck with the more
conservative value monty used for the file header.

git-svn-id: 8dbf393e6e9ab8d4979d29f9a341a98016792aa6@4948 0101bb08-14d6-0310-b084-bc0e0c8e3800

--- examples/encoder_example.c
+++ examples/encoder_example.c
@@ -12,7 +12,7 @@

   function: example encoder application; makes an Ogg Theora/Vorbis
             file from YUV4MPEG2 and WAV input
-  last mod: $Id: encoder_example.c,v 1.22 2003/06/10 11:42:45 giles Exp $
+  last mod: $Id: encoder_example.c,v 1.23 2003/06/14 01:08:10 giles Exp $

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

@@ -372,13 +372,23 @@
          always be full when we get here */

       for(i=state;i<2;i++){
-        char frame[6];
+        char c,frame[6];
         int ret=fread(frame,1,6,video);

+	/* match and skip the frame header */
         if(ret<6)break;
-        if(memcmp(frame,"FRAME\n",6)){
+        if(memcmp(frame,"FRAME",5)){
           fprintf(stderr,"Loss of framing in YUV input data\n");
           exit(1);
+        }
+        if(frame[5]!='\n'){
+          int j;
+          for(j=0;j<79;j++)
+            if(fread(&c,1,1,video)&&c=='\n')break;
+          if(j==79){
+            fprintf(stderr,"Error parsing YUV frame header\n");
+            exit(1);
+          }
         }

         /* read the Y plane into our frame buffer with centering */


Fix miniRPC to send large blobs correctly

--- src/lib/transport/socket/storagestub/sstub_conn.c
+++ src/lib/transport/socket/storagestub/sstub_conn.c
@@ -69,6 +69,9 @@
 		printf("failed to initialize minirpc disconnect function\n");
 		goto err_out;
 	}
+
+	/* allow for very large incoming packets */
+	mrpc_set_max_buf_len(conn_set, UINT_MAX);

 	return 0;


Created Node struct to be used on binary tree.

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

--- include/node.h
+++ include/node.h
@@ -0,0 +1,10 @@
+#include <iostream>
+#include "flight.h"
+
+#pragma once
+
+struct Node {
+  Node    *left, *right;
+  Flight  flight;
+};
+


Copyright update.  Yes, it's a test!!

Copyright update.  Yes, it's a test!!

--- cegui/include/CEGUISystem.h
+++ cegui/include/CEGUISystem.h
@@ -6,7 +6,7 @@
 	purpose:	Defines interface for main GUI system class
 *************************************************************************/
 /***************************************************************************
- *   Copyright (C) 2004 - 2009 Paul D Turner & The CEGUI Development Team
+ *   Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
  *
  *   Permission is hereby granted, free of charge, to any person obtaining
  *   a copy of this software and associated documentation files (the


[libsandbox]fix some key define

[libsandbox]fix some key define

--- src/arch/x64/mach-sandbox/libsandbox/sandbox-sdl-event.c
+++ src/arch/x64/mach-sandbox/libsandbox/sandbox-sdl-event.c
@@ -46,80 +46,56 @@

 	switch(code)
 	{
+	case SDLK_POWER:
+		key = 1;
+		break;
+	case SDLK_UP:
+		key = 2;
+		break;
+	case SDLK_DOWN:
+		key = 3;
+		break;
+	case SDLK_LEFT:
+		key = 4;
+		break;
+	case SDLK_RIGHT:
+		key = 5;
+		break;
+	case SDLK_VOLUMEDOWN:
+		key = 6;
+		break;
+	case SDLK_VOLUMEUP:
+		key = 7;
+		break;
+	case SDLK_ESCAPE:
+		key = 8;
+		break;
+	case SDLK_TAB:
+		key = 9;
+		break;
+	case SDLK_DELETE:
+		key = 10;
+		break;
+	case SDLK_RETURN:
+		key = 11;
+		break;
 	case SDLK_LCTRL:
-		key = 0x80;
+		key = 12;
 		break;
 	case SDLK_RCTRL:
-		key = 0x81;
+		key = 13;
 		break;
 	case SDLK_LALT:
-		key = 0x82;
+		key = 14;
 		break;
 	case SDLK_RALT:
-		key = 0x83;
+		key = 15;
 		break;
 	case SDLK_LSHIFT:
-		key = 0x84;
+		key = 16;
 		break;
 	case SDLK_RSHIFT:
-		key = 0x85;
-		break;
-	case SDLK_CAPSLOCK:
-		key = 0x86;
-		break;
-	case SDLK_NUMLOCKCLEAR:
-		key = 0x87;
-		break;
-	case SDLK_SCROLLLOCK:
-		key = 0x88;
-		break;
-	case SDLK_DELETE:
-		key = 0x90;
-		break;
-	case SDLK_TAB:
-		key = 0x91;
-		break;
-	case SDLK_RETURN:
-		key = 0x92;
-		break;
-	case SDLK_UP:
-		key = 0x93;
-		break;
-	case SDLK_DOWN:
-		key = 0x94;
-		break;
-	case SDLK_LEFT:
-		key = 0x95;
-		break;
-	case SDLK_RIGHT:
-		key = 0x96;
-		break;
-	case SDLK_PAGEUP:
-		key = 0x97;
-		break;
-	case SDLK_PAGEDOWN:
-		key = 0x98;
-		break;
-	case SDLK_HOME:
-		key = 0x99;
-		break;
-	case SDLK_END:
-		key = 0x9a;
-		break;
-	case SDLK_VOLUMEUP:
-		key = 0x9b;
-		break;
-	case SDLK_VOLUMEDOWN:
-		key = 0x9c;
-		break;
-	case SDLK_MENU:
-		key = 0x9d;
-		break;
-	case SDLK_ESCAPE:
-		key = 0x9e;
-		break;
-	case SDLK_POWER:
-		key = 0x9f;
+		key = 17;
 		break;
 	default:
 		key = code;


Make 'Inspect Element' always show the inspector

Without scripts enabled, this doesn't happen implicitly.

--- midori/midori-view.c
+++ midori/midori-view.c
@@ -1872,6 +1872,7 @@
     x = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "x"));
     y = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), "y"));
     webkit_web_inspector_inspect_coordinates (inspector, x, y);
+    webkit_web_inspector_show (inspector);
 }
 #endif


staging: comedi: ni_labpc_common: use DIV_ROUND_CLOSEST to round divisor values

Use the DIV_ROUND_CLOSEST macro to clarify the (((x) + ((divisor) / 2)) / (divisor))
calculations.

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

--- drivers/staging/comedi/drivers/ni_labpc_common.c
+++ drivers/staging/comedi/drivers/ni_labpc_common.c
@@ -400,10 +400,10 @@
 		switch (cmd->flags & CMDF_ROUND_MASK) {
 		default:
 		case CMDF_ROUND_NEAREST:
-			devpriv->divisor_a0 =
-			    (convert_period + (base_period / 2)) / base_period;
-			devpriv->divisor_b1 =
-			    (scan_period + (base_period / 2)) / base_period;
+			devpriv->divisor_a0 = DIV_ROUND_CLOSEST(convert_period,
+								base_period);
+			devpriv->divisor_b1 = DIV_ROUND_CLOSEST(scan_period,
+								base_period);
 			break;
 		case CMDF_ROUND_UP:
 			devpriv->divisor_a0 = DIV_ROUND_UP(convert_period,


uip/scansbr.c: Add PUTC() macro, similar to FPUTS().

FPUTS() exists, but all the putc(3) checks for error were written
alongside in longhand.  May as well have a PUTC() to match, though
perhaps just the existing check of the FILE's sticky error state with
ferror(3) is sufficient and neither macro is required.

--- uip/scansbr.c
+++ uip/scansbr.c
@@ -25,6 +25,10 @@
 static m_getfld_state_t gstate;		/* for accessor functions below    */

 #define DIEWRERR() adios (scnmsg, "write error on")
+
+#define PUTC(c) \
+    if (putc((c), scnout) == EOF) \
+        DIEWRERR();

 #define FPUTS(buf) {\
 		if (fputs(buf,scnout) == EOF)\
@@ -169,7 +173,7 @@
 		compnum++;
 		if (scnout) {
 		    FPUTS (name);
-		    if ( putc (':', scnout) == EOF) DIEWRERR();
+		    PUTC(':');
 		    FPUTS (tmpbuf);
 		}
 		/*
@@ -218,7 +222,7 @@
 		    goto finished;
 		}
                 if (scnout) {
-                    if (putc ('\n', scnout) == EOF) DIEWRERR();
+                    PUTC('\n');
                     FPUTS (tmpbuf);
                 }
 		/*
@@ -264,7 +268,7 @@
 		if (scnout) {
 		    FPUTS ("\n\nBAD MSG:\n");
 		    FPUTS (name);
-		    if (putc ('\n', scnout) == EOF) DIEWRERR();
+		    PUTC('\n');
 		    state = BODY;
 		    goto body;
 		}


ext4 crypto: make sure the encryption info is initialized on opendir(2)

Signed-off-by: Theodore Ts'o <4ed386e0495d3e109932df055831d9ec2f824927@mit.edu>

--- fs/ext4/dir.c
+++ fs/ext4/dir.c
@@ -593,6 +593,13 @@
 	return 0;
 }

+static int ext4_dir_open(struct inode * inode, struct file * filp)
+{
+	if (ext4_encrypted_inode(inode))
+		return ext4_get_encryption_info(inode) ? -EACCES : 0;
+	return 0;
+}
+
 static int ext4_release_dir(struct inode *inode, struct file *filp)
 {
 	if (filp->private_data)
@@ -635,5 +642,6 @@
 	.compat_ioctl	= ext4_compat_ioctl,
 #endif
 	.fsync		= ext4_sync_file,
+	.open		= ext4_dir_open,
 	.release	= ext4_release_dir,
 };


Fix mutex bug

Fix mutex bug

--- src/core/surface/secure_channel_create.c
+++ src/core/surface/secure_channel_create.c
@@ -197,6 +197,7 @@
   memset(c, 0, sizeof(*c));
   c->base.vtable = &connector_vtable;
   c->security_connector = f->security_connector;
+  gpr_mu_init(&c->mu);
   gpr_ref_init(&c->refs, 1);
   args->mdctx = f->mdctx;
   args->args = final_args;


Update of three badly terminated macro definitions (#555)

* Update of three badly terminated macro definitions
- vTaskDelayUntil() to conform to usual pattern do { ... } while(0)
- vTaskNotifyGiveFromISR() and
- vTaskGenericNotifyGiveFromISR() to remove extra terminating semicolons
- This PR addresses issues #553 and #554

* Adjust formatting of task.h

Co-authored-by: Paul Bartell <356dec3940f9f4a5b30f1dc505dbad17bdaff0ed@amazon.com>

--- include/task.h
+++ include/task.h
@@ -866,9 +866,9 @@
  * return a value.
  */
 #define vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement )                   \
-    {                                                                           \
+    do {                                                                        \
         ( void ) xTaskDelayUntil( ( pxPreviousWakeTime ), ( xTimeIncrement ) ); \
-    }
+    } while( 0 )

 /**
@@ -2531,9 +2531,9 @@
                                     UBaseType_t uxIndexToNotify,
                                     BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
 #define vTaskNotifyGiveFromISR( xTaskToNotify, pxHigherPriorityTaskWoken ) \
-    vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( pxHigherPriorityTaskWoken ) );
+    vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( pxHigherPriorityTaskWoken ) )
 #define vTaskNotifyGiveIndexedFromISR( xTaskToNotify, uxIndexToNotify, pxHigherPriorityTaskWoken ) \
-    vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( pxHigherPriorityTaskWoken ) );
+    vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( pxHigherPriorityTaskWoken ) )

 /**
  * task. h


reorganise parse protocol command, prepare central message sendings


Take care to not leak speed dial markup

Take care to not leak speed dial markup

--- midori/midori-view.c
+++ midori/midori-view.c
@@ -3905,6 +3905,7 @@
             gchar* res_root;
             gchar* speed_dial_head;
             gchar* speed_dial_body;
+            gchar* speed_dial_markup;
             gchar* stock_root;
             gchar* filepath;
             #ifdef G_ENABLE_DEBUG
@@ -3958,16 +3959,17 @@
             #endif

             speed_dial_body = prepare_speed_dial_html (view);
-            data = g_strdup_printf ("%s\n%s", data, prepare_speed_dial_html (view));
+            speed_dial_markup = g_strdup_printf ("%s\n%s", data, speed_dial_body);

             midori_view_load_alternate_string (view,
-                data, res_root, "about:blank", NULL);
+                speed_dial_markup, res_root, "about:blank", NULL);

             g_free (res_root);
             g_free (stock_root);
             g_free (data);
             g_free (speed_dial_head);
             g_free (speed_dial_body);
+            g_free (speed_dial_markup);
         }
         /* This is not prefectly elegant, but creating
            special pages inline is the simplest solution. */


Added Envelope-From and Sender support to sendfrom.

--- uip/sendsbr.c
+++ uip/sendsbr.c
@@ -834,18 +834,34 @@
         return NOTOK;
     }

-    if ((in = fopen(filename, "r")) != NULL) {
-        char *addrformat = "%(addr{from})", *hostformat = "%(host{from})";
-
-        if ((*addr = get_message_header_info(in, addrformat)) == NULL) {
-            *message = "unable to find From: address in";
-            return NOTOK;
-        }
-        rewind(in);
-
+    if ((in = fopen (filename, "r")) != NULL) {
+        /* There must be a non-blank Envelope-From or {Resent-}Sender or
+           {Resent-}From header. */
+        char *addrformat = "%(addr{Envelope-From})";
+        char *hostformat = "%(host{Envelope-From})";
+
+        if ((*addr = get_message_header_info (in, addrformat)) == NULL  ||
+            strlen (*addr) == 0) {
+            addrformat = distfile == NULL  ?  "%(addr{Sender})"  :  "%(addr{Resent-Sender})";
+            hostformat = distfile == NULL  ?  "%(host{Sender})"  :  "%(host{Resent-Sender})";
+
+            if ((*addr = get_message_header_info (in, addrformat)) == NULL) {
+                addrformat = distfile == NULL  ?  "%(addr{From})"  :  "%(addr{Resent-From})";
+                hostformat = distfile == NULL  ?  "%(host{From})"  :  "%(host{Resent-From})";
+
+                if ((*addr = get_message_header_info (in, addrformat)) == NULL) {
+                    *message = "unable to find sender address in";
+                    fclose(in);
+                    return NOTOK;
+                }
+            }
+        }
+
+        /* Use the hostformat that corresponds to the successful addrformat. */
         if ((*host = get_message_header_info(in, hostformat)) == NULL) {
             fclose(in);
-            *message = "unable to find From: host in";
+            *message = "unable to find sender host in";
+            fclose(in);
             return NOTOK;
         }
         fclose(in);
@@ -883,6 +899,7 @@
     /*
      * Read in the message and process the header.
      */
+    rewind (in);
     parsing_header = 1;
     do {
         char name[NAMESZ], rbuf[NMH_BUFSIZ];
@@ -920,8 +937,12 @@
     /* Trim trailing newline, if any. */
     retval = rtrim(charstring_buffer_copy((buffer)));
     charstring_free(buffer);
-
-    return retval;
+    if (strlen (retval) > 0) {
+        return retval;
+    } else {
+        free (retval);
+        return NULL;
+    }
 }


fs: nfs: inform the VM about pages being committed or unstable

VM page reclaim uses dirty and writeback page states to determine if
flushers are cleaning pages too slowly and that page reclaim should
stall waiting on flushers to catch up.  Page state in NFS is a bit more
complex and a clean page can be unreclaimable due to being unstable
which is effectively "dirty" from the perspective of the VM from reclaim
context.  Similarly, if the inode is currently being committed then it's
similar to being under writeback.

This patch adds a is_dirty_writeback() handled for NFS that checks if a
pages backing inode is being committed and should be accounted as
writeback and if a page has private state indicating that it is
effectively dirty.

Signed-off-by: Mel Gorman <39ea6a09710987173e32e37c86918024a0f441c1@suse.de>
Cc: Johannes Weiner <331be22c6b63ca3e0a03d408c2d906b1b02cd5f2@cmpxchg.org>
Cc: Michal Hocko <829500b200af6c2a0eca4dfd5c388e6b8fbe8dc6@suse.cz>
Cc: Rik van Riel <a21938f5d463ddf41aa718934c205ca2cce8ebbc@redhat.com>
Cc: KAMEZAWA Hiroyuki <634f508bd7c47cf0ee4126243675c3e598920fbc@jp.fujitsu.com>
Cc: Jiri Slaby <dfbf39eb5bf303a3db5454d815cb8c8888cbadf9@suse.cz>
Cc: Valdis Kletnieks <183bdd1d6873c97a167cc4b441324ddf7a94dd06@vt.edu>
Cc: Zlatko Calusic <5d15f7dce45fe0e68f7200796c13242a711c1eff@bitsync.net>
Cc: dormando <02181ee7ffaa1b96f52f8dc1a69b9850d75a1cf0@rydia.net>
Cc: Trond Myklebust <cc958843532c615cbd4920e868f78c7985331a5a@fys.uio.no>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- fs/nfs/file.c
+++ fs/nfs/file.c
@@ -495,6 +495,35 @@
 	return nfs_fscache_release_page(page, gfp);
 }

+static void nfs_check_dirty_writeback(struct page *page,
+				bool *dirty, bool *writeback)
+{
+	struct nfs_inode *nfsi;
+	struct address_space *mapping = page_file_mapping(page);
+
+	if (!mapping || PageSwapCache(page))
+		return;
+
+	/*
+	 * Check if an unstable page is currently being committed and
+	 * if so, have the VM treat it as if the page is under writeback
+	 * so it will not block due to pages that will shortly be freeable.
+	 */
+	nfsi = NFS_I(mapping->host);
+	if (test_bit(NFS_INO_COMMIT, &nfsi->flags)) {
+		*writeback = true;
+		return;
+	}
+
+	/*
+	 * If PagePrivate() is set, then the page is not freeable and as the
+	 * inode is not being committed, it's not going to be cleaned in the
+	 * near future so treat it as dirty
+	 */
+	if (PagePrivate(page))
+		*dirty = true;
+}
+
 /*
  * Attempt to clear the private state associated with a page when an error
  * occurs that requires the cached contents of an inode to be written back or
@@ -542,6 +571,7 @@
 	.direct_IO = nfs_direct_IO,
 	.migratepage = nfs_migrate_page,
 	.launder_page = nfs_launder_page,
+	.is_dirty_writeback = nfs_check_dirty_writeback,
 	.error_remove_page = generic_error_remove_page,
 #ifdef CONFIG_NFS_SWAP
 	.swap_activate = nfs_swap_activate,


add RTS_PRIVATE attribute

add RTS_PRIVATE attribute

--- includes/Rts.h
+++ includes/Rts.h
@@ -47,6 +47,11 @@
 #else
 #define ATTRIBUTE_ALIGNED(n) /*nothing*/
 #endif
+
+// Symbols that are extern, but private to the RTS, are declared
+// with visibility "hidden" to hide them outside the RTS shared
+// library.
+#define RTS_PRIVATE  GNUC3_ATTRIBUTE(visibility("hidden"))

 /* Fix for mingw stat problem (done here so it's early enough) */
 #ifdef mingw32_HOST_OS


[nrf][timer] improve time keeping in RTC

Improve accuracy of current_time and current_time_highres.

--- platform/nrf52xxx/timer.c
+++ platform/nrf52xxx/timer.c
@@ -20,21 +20,24 @@
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
+#include <assert.h>
+#include <debug.h>
 #include <err.h>
-#include <debug.h>
-#include <trace.h>
+#include <platform.h>
+//#include <trace.h>
 #include <arch/arm/cm.h>
-#include <platform.h>
 #include <platform/nrf52.h>
 #include <platform/system_nrf52.h>
 #include <platform/timer.h>
 #include <sys/types.h>

+//base counter is total number of clock cycles elapsed
+static volatile uint64_t base_counter = 0;

-static volatile uint64_t ticks;
-static uint32_t tick_rate = 0;
-static uint32_t tick_rate_mhz = 0;
-static lk_time_t tick_interval_ms;
+static uint32_t clock_rate = 0;
+
+//cycles of our clock per tick interval
+static uint32_t cycles_per_tick = 0;

 static platform_timer_callback cb;
 static void *cb_args;
@@ -43,49 +46,67 @@

 status_t platform_set_periodic_timer(platform_timer_callback callback, void *arg, lk_time_t interval)
 {
+    ASSERT(clock_rate > 0);

     cb = callback;
     cb_args = arg;

-    tick_interval_ms = interval;
-
-    uint32_t ticks = tick_rate / ( 1000 / interval );
+    cycles_per_tick = clock_rate * interval / 1000 ;

     NRF_CLOCK->LFCLKSRC =  CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos;
     NRF_CLOCK->TASKS_LFCLKSTART = 1;

-    NRF_RTC1->PRESCALER = ticks;
-    NRF_RTC1->INTENSET  = RTC_INTENSET_TICK_Enabled << RTC_INTENSET_TICK_Pos;
+    NRF_RTC1->CC[0] = 0x00ffffff & (base_counter + cycles_per_tick);
+
+    NRF_RTC1->PRESCALER = 0;
+
+    NRF_RTC1->INTENSET  = RTC_INTENSET_COMPARE0_Enabled << RTC_INTENSET_COMPARE0_Pos;

     NRF_RTC1->EVENTS_TICK = 0;
+    NRF_RTC1->EVENTS_COMPARE[0] = 0;
     NRF_RTC1->TASKS_START = 1;
     NVIC_EnableIRQ(RTC1_IRQn);

     return NO_ERROR;
 }

+// time in msec
 lk_time_t current_time(void)
 {
     uint64_t t;

     do {
-        t = ticks;
-    } while (ticks != t);
+        t = base_counter;
+    } while (base_counter != t);

-    return t * tick_interval_ms;
+    return t * 1000 / clock_rate;
 }

+// time in usec
 lk_bigtime_t current_time_hires(void)
 {
-    return current_time() * 1000;
+    uint64_t t;
+
+    do {
+        t = base_counter;
+    } while (base_counter != t);
+
+    // base_counter only gets updated once every tick, regain extra
+    //  precision by adding in elapsed counts since last tick interrupt
+    //  Note: counter is only 24 bits
+    t = (t + (NRF_RTC1->COUNTER - (t & 0x00ffffff))) & 0x00ffffff;
+    return (t * 1000000 / clock_rate);
 }

 void nrf52_RTC1_IRQ(void)
 {
-    ticks++;
+    // update to this point in time
+    base_counter += cycles_per_tick;
     arm_cm_irq_entry();

-    NRF_RTC1->EVENTS_TICK = 0;
+    NRF_RTC1->EVENTS_COMPARE[0] = 0;
+    // calculate time of next interrupt
+    NRF_RTC1->CC[0] = 0x00ffffff & (base_counter + cycles_per_tick);

     bool resched = false;
     if (cb) {
@@ -96,9 +117,8 @@
     arm_cm_irq_exit(resched);
 }

-void arm_cm_systick_init(uint32_t mhz)
+void arm_cm_systick_init(uint32_t hz)
 {
-    tick_rate = mhz;
-    tick_rate_mhz = mhz / 1000000;
+    clock_rate = hz;
 }


libtracker-data: Remove useless calls before exit on database corruption

--- src/libtracker-data/tracker-db-interface-sqlite.c
+++ src/libtracker-data/tracker-db-interface-sqlite.c
@@ -1387,9 +1387,6 @@
 			            sqlite3_errmsg (interface->db),
 			            g_strerror (errno));

-			sqlite3_finalize (stmt);
-			sqlite3_close (interface->db);
-
 			g_unlink (interface->filename);

 			g_error ("SQLite experienced an error with file:'%s'. "


Count link labels separately from actual elements

Not all link elements will have visible labels.

--- midori/midori-view.c
+++ midori/midori-view.c
@@ -1885,12 +1885,14 @@
                 " border:1px solid gray; padding:0 0.1em !important;"
                 " position:absolute; display:inline !important; }');"
                 "var links = document.getElementsByTagName ('a');"
+                "var label_count = 0;"
                 "for (i in links) {"
-                "  var child = document.createElement ('span');"
-                "  child.setAttribute ('class', 'midoriHKD87346');"
-                "  child.appendChild (document.createTextNode (i));"
-                "  if (links[i].insertBefore && links[i].href)"
-                "    links[i].insertBefore (child); }",
+                "  if (links[i].insertBefore && links[i].href) { "
+                "    var child = document.createElement ('span');"
+                "    child.setAttribute ('class', 'midoriHKD87346');"
+                "    child.appendChild (document.createTextNode (label_count));"
+                "    links[i].insertBefore (child);"
+                "    label_count++; } }",
                 NULL);
             view->find_links = 0;
         }


Call readconfig() on mhn.defaults so we get default entries in for use with attach.

--- uip/sendsbr.c
+++ uip/sendsbr.c
@@ -192,6 +192,7 @@
     int			has_body;		/* draft has a message body */
     int			length;			/* length of attachment header field name */
     char		*p;			/* miscellaneous string pointer */
+    FILE		*fp;			/* pointer for mhn.defaults */

     /*
      *	Open up the draft file.
@@ -300,6 +301,11 @@
      *	Now, go back to the beginning of the draft file and look for header fields
      *	that specify attachments.  Add a mhbuild MIME composition file for each.
      */
+
+    if ((fp = fopen (p = etcpath ("mhn.defaults"), "r"))) {
+    	readconfig ((struct node **) NULL, fp, p, 0);
+	fclose(fp);
+    }

     rewind(draft_file);


add a store/load memory barrier

add a store/load memory barrier

--- includes/SMP.h
+++ includes/SMP.h
@@ -59,6 +59,11 @@
  * direction.
  */
 EXTERN_INLINE void write_barrier(void);
+
+/*
+ * Prevents loads from moving before earlier stores.
+ */
+EXTERN_INLINE void store_load_barrier(void);

 /* ----------------------------------------------------------------------------
    Implementations
@@ -180,10 +185,30 @@
 #endif
 }

+EXTERN_INLINE void
+store_load_barrier(void) {
+#if i386_HOST_ARCH
+    __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory");
+#elif x86_64_HOST_ARCH
+    __asm__ __volatile__ ("lock; addq $0,0(%%rsp)" : : : "memory");
+#elif powerpc_HOST_ARCH
+    __asm__ __volatile__ ("msync" : : : "memory");
+#elif sparc_HOST_ARCH
+    /* Sparc in TSO mode does not require write/write barriers. */
+    __asm__ __volatile__ ("membar" : : : "memory");
+#elif !defined(WITHSMP)
+    return;
+#else
+#error memory barriers unimplemented on this architecture
+#endif
+}
+
 /* ---------------------------------------------------------------------- */
 #else /* !THREADED_RTS */

 #define write_barrier() /* nothing */
+
+#define store_load_barrier() /* nothing */

 INLINE_HEADER StgWord
 xchg(StgPtr p, StgWord w)


gnrc_ipv6_nib: fix ltime > MAX / 1000 corner case in NDP PIOs as well

--- sys/net/gnrc/network_layer/ipv6/nib/nib.c
+++ sys/net/gnrc/network_layer/ipv6/nib/nib.c
@@ -1258,15 +1258,15 @@
         if (valid_ltime < UINT32_MAX) { /* UINT32_MAX means infinite lifetime */
             /* the valid lifetime is given in seconds, but our timers work in
              * microseconds, so we have to scale down to the smallest possible
-             * value (UINT32_MAX). This is however alright since we ask for a
-             * new router advertisement before this timeout expires */
+             * value (UINT32_MAX - 1). This is however alright since we ask for
+             * a new router advertisement before this timeout expires */
             valid_ltime = (valid_ltime > (UINT32_MAX / MS_PER_SEC)) ?
-                          UINT32_MAX : valid_ltime * MS_PER_SEC;
+                          (UINT32_MAX - 1) : valid_ltime * MS_PER_SEC;
         }
         if (pref_ltime < UINT32_MAX) { /* UINT32_MAX means infinite lifetime */
             /* same treatment for pref_ltime */
             pref_ltime = (pref_ltime > (UINT32_MAX / MS_PER_SEC)) ?
-                         UINT32_MAX : pref_ltime * MS_PER_SEC;
+                         (UINT32_MAX - 1) : pref_ltime * MS_PER_SEC;
         }
         if ((pfx = _nib_pl_add(netif->pid, &pio->prefix, pio->prefix_len,
                                valid_ltime, pref_ltime))) {


Added two missed diassembler table entries

--- disasm/dis_tables.h
+++ disasm/dis_tables.h
@@ -1613,6 +1613,7 @@
   // D8 (modrm is outside 00h - BFh) (mod == 11)
   /* D8 C0 */  { "fadd",      0, ST0, STj, XX },
   /* D8 C1 */  { "fadd",      0, ST0, STj, XX },
+  /* D8 C2 */  { "fadd",      0, ST0, STj, XX },
   /* D8 C3 */  { "fadd",      0, ST0, STj, XX },
   /* D8 C4 */  { "fadd",      0, ST0, STj, XX },
   /* D8 C5 */  { "fadd",      0, ST0, STj, XX },
@@ -1808,37 +1809,38 @@
   /* DA FF */  { "(invalid)", 0,  XX,  XX, XX },

   // DB (modrm is outside 00h - BFh) (mod == 11)
-  /* DA C1 */  { "fcmovnb",   0, STj, STj, XX },
-  /* DA C2 */  { "fcmovnb",   0, STj, STj, XX },
-  /* DA C3 */  { "fcmovnb",   0, STj, STj, XX },
-  /* DA C4 */  { "fcmovnb",   0, STj, STj, XX },
-  /* DA C5 */  { "fcmovnb",   0, STj, STj, XX },
-  /* DA C6 */  { "fcmovnb",   0, STj, STj, XX },
-  /* DA C7 */  { "fcmovnb",   0, STj, STj, XX },
-  /* DA C8 */  { "fcmovne",   0, STj, STj, XX },
-  /* DA C9 */  { "fcmovne",   0, STj, STj, XX },
-  /* DA CA */  { "fcmovne",   0, STj, STj, XX },
-  /* DA CB */  { "fcmovne",   0, STj, STj, XX },
-  /* DA CC */  { "fcmovne",   0, STj, STj, XX },
-  /* DA CD */  { "fcmovne",   0, STj, STj, XX },
-  /* DA CE */  { "fcmovne",   0, STj, STj, XX },
-  /* DA CF */  { "fcmovne",   0, STj, STj, XX },
-  /* DA D0 */  { "fcmovnbe",  0, STj, STj, XX },
-  /* DA D1 */  { "fcmovnbe",  0, STj, STj, XX },
-  /* DA D2 */  { "fcmovnbe",  0, STj, STj, XX },
-  /* DA D3 */  { "fcmovnbe",  0, STj, STj, XX },
-  /* DA D4 */  { "fcmovnbe",  0, STj, STj, XX },
-  /* DA D5 */  { "fcmovnbe",  0, STj, STj, XX },
-  /* DA D6 */  { "fcmovnbe",  0, STj, STj, XX },
-  /* DA D7 */  { "fcmovnbe",  0, STj, STj, XX },
-  /* DA D8 */  { "fcmovnu",   0, STj, STj, XX },
-  /* DA D9 */  { "fcmovnu",   0, STj, STj, XX },
-  /* DA DA */  { "fcmovnu",   0, STj, STj, XX },
-  /* DA DB */  { "fcmovnu",   0, STj, STj, XX },
-  /* DA DC */  { "fcmovnu",   0, STj, STj, XX },
-  /* DA DD */  { "fcmovnu",   0, STj, STj, XX },
-  /* DA DE */  { "fcmovnu",   0, STj, STj, XX },
-  /* DA DF */  { "fcmovnu",   0, STj, STj, XX },
+  /* DB C0 */  { "fcmovnb",   0, STj, STj, XX },
+  /* DB C1 */  { "fcmovnb",   0, STj, STj, XX },
+  /* DB C2 */  { "fcmovnb",   0, STj, STj, XX },
+  /* DB C3 */  { "fcmovnb",   0, STj, STj, XX },
+  /* DB C4 */  { "fcmovnb",   0, STj, STj, XX },
+  /* DB C5 */  { "fcmovnb",   0, STj, STj, XX },
+  /* DB C6 */  { "fcmovnb",   0, STj, STj, XX },
+  /* DB C7 */  { "fcmovnb",   0, STj, STj, XX },
+  /* DB C8 */  { "fcmovne",   0, STj, STj, XX },
+  /* DB C9 */  { "fcmovne",   0, STj, STj, XX },
+  /* DB CA */  { "fcmovne",   0, STj, STj, XX },
+  /* DB CB */  { "fcmovne",   0, STj, STj, XX },
+  /* DB CC */  { "fcmovne",   0, STj, STj, XX },
+  /* DB CD */  { "fcmovne",   0, STj, STj, XX },
+  /* DB CE */  { "fcmovne",   0, STj, STj, XX },
+  /* DB CF */  { "fcmovne",   0, STj, STj, XX },
+  /* DB D0 */  { "fcmovnbe",  0, STj, STj, XX },
+  /* DB D1 */  { "fcmovnbe",  0, STj, STj, XX },
+  /* DB D2 */  { "fcmovnbe",  0, STj, STj, XX },
+  /* DB D3 */  { "fcmovnbe",  0, STj, STj, XX },
+  /* DB D4 */  { "fcmovnbe",  0, STj, STj, XX },
+  /* DB D5 */  { "fcmovnbe",  0, STj, STj, XX },
+  /* DB D6 */  { "fcmovnbe",  0, STj, STj, XX },
+  /* DB D7 */  { "fcmovnbe",  0, STj, STj, XX },
+  /* DB D8 */  { "fcmovnu",   0, STj, STj, XX },
+  /* DB D9 */  { "fcmovnu",   0, STj, STj, XX },
+  /* DB DA */  { "fcmovnu",   0, STj, STj, XX },
+  /* DB DB */  { "fcmovnu",   0, STj, STj, XX },
+  /* DB DC */  { "fcmovnu",   0, STj, STj, XX },
+  /* DB DD */  { "fcmovnu",   0, STj, STj, XX },
+  /* DB DE */  { "fcmovnu",   0, STj, STj, XX },
+  /* DB DF */  { "fcmovnu",   0, STj, STj, XX },
   /* DB E0 */  { "feni   (287 only)", 0, XX, XX, XX },
   /* DB E1 */  { "fdisi  (287 only)", 0, XX, XX, XX },
   /* DB E2 */  { "fnclex",    0,  XX,  XX, XX },
@@ -1847,22 +1849,22 @@
   /* DB E5 */  { "(invalid)", 0,  XX,  XX, XX },
   /* DB E6 */  { "(invalid)", 0,  XX,  XX, XX },
   /* DB E7 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DA E8 */  { "fucomi",    0, STj, STj, XX },
-  /* DA E9 */  { "fucomi",    0, STj, STj, XX },
-  /* DA EA */  { "fucomi",    0, STj, STj, XX },
-  /* DA EB */  { "fucomi",    0, STj, STj, XX },
-  /* DA EC */  { "fucomi",    0, STj, STj, XX },
-  /* DA ED */  { "fucomi",    0, STj, STj, XX },
-  /* DA EE */  { "fucomi",    0, STj, STj, XX },
-  /* DA EF */  { "fucomi",    0, STj, STj, XX },
-  /* DA F0 */  { "fcomi",     0, STj, STj, XX },
-  /* DA F1 */  { "fcomi",     0, STj, STj, XX },
-  /* DA F2 */  { "fcomi",     0, STj, STj, XX },
-  /* DA F3 */  { "fcomi",     0, STj, STj, XX },
-  /* DA F4 */  { "fcomi",     0, STj, STj, XX },
-  /* DA F5 */  { "fcomi",     0, STj, STj, XX },
-  /* DA F6 */  { "fcomi",     0, STj, STj, XX },
-  /* DA F7 */  { "fcomi",     0, STj, STj, XX },
+  /* DB E8 */  { "fucomi",    0, STj, STj, XX },
+  /* DB E9 */  { "fucomi",    0, STj, STj, XX },
+  /* DB EA */  { "fucomi",    0, STj, STj, XX },
+  /* DB EB */  { "fucomi",    0, STj, STj, XX },
+  /* DB EC */  { "fucomi",    0, STj, STj, XX },
+  /* DB ED */  { "fucomi",    0, STj, STj, XX },
+  /* DB EE */  { "fucomi",    0, STj, STj, XX },
+  /* DB EF */  { "fucomi",    0, STj, STj, XX },
+  /* DB F0 */  { "fcomi",     0, STj, STj, XX },
+  /* DB F1 */  { "fcomi",     0, STj, STj, XX },
+  /* DB F2 */  { "fcomi",     0, STj, STj, XX },
+  /* DB F3 */  { "fcomi",     0, STj, STj, XX },
+  /* DB F4 */  { "fcomi",     0, STj, STj, XX },
+  /* DB F5 */  { "fcomi",     0, STj, STj, XX },
+  /* DB F6 */  { "fcomi",     0, STj, STj, XX },
+  /* DB F7 */  { "fcomi",     0, STj, STj, XX },
   /* DB F8 */  { "(invalid)", 0,  XX,  XX, XX },
   /* DB F9 */  { "(invalid)", 0,  XX,  XX, XX },
   /* DB FA */  { "(invalid)", 0,  XX,  XX, XX },
@@ -1889,22 +1891,22 @@
   /* DC CD */  { "fmul",      0, STj, STj, XX },
   /* DC CE */  { "fmul",      0, STj, STj, XX },
   /* DC CF */  { "fmul",      0, STj, STj, XX },
-  /* DB D0 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB D1 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB D2 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB D3 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB D4 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB D5 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB D6 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB D7 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB D8 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB D9 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB DA */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB DB */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB DC */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB DD */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB DE */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DB DF */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D0 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D1 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D2 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D3 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D4 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D5 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D6 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D7 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D8 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC D9 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC DA */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC DB */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC DC */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC DD */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC DE */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DC DF */  { "(invalid)", 0,  XX,  XX, XX },
   /* DC E0 */  { "fsubr",     0, STj, STj, XX },
   /* DC E1 */  { "fsubr",     0, STj, STj, XX },
   /* DC E2 */  { "fsubr",     0, STj, STj, XX },
@@ -2071,46 +2073,46 @@
   /* DE FF */  { "fdivp",     0, STj, STj, XX },

   // DF (modrm is outside 00h - BFh) (mod == 11)
-  /* DE C0 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE C1 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE C2 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE C3 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE C4 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE C5 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE C6 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE C7 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE C8 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE C9 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE CA */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE CB */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE CC */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE CD */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE CE */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE CF */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D0 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D1 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D2 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D3 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D4 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D5 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D6 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D7 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D8 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE D9 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE DA */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE DB */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE DC */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE DD */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE DE */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE DF */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C0 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C1 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C2 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C3 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C4 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C5 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C6 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C7 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C8 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF C9 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF CA */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF CB */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF CC */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF CD */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF CE */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF CF */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D0 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D1 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D2 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D3 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D4 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D5 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D6 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D7 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D8 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF D9 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF DA */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF DB */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF DC */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF DD */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF DE */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF DF */  { "(invalid)", 0,  XX,  XX, XX },
   /* DF E0 */  { "fnstsw",    0,  AX,  XX, XX },
-  /* DE E1 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE E2 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE E3 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE E4 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE E5 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE E6 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE E7 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF E1 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF E2 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF E3 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF E4 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF E5 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF E6 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF E7 */  { "(invalid)", 0,  XX,  XX, XX },
   /* DF E8 */  { "fucomip",   0, STj, STj, XX },
   /* DF E9 */  { "fucomip",   0, STj, STj, XX },
   /* DF EA */  { "fucomip",   0, STj, STj, XX },
@@ -2127,14 +2129,14 @@
   /* DF F5 */  { "fcomip",    0, STj, STj, XX },
   /* DF F6 */  { "fcomip",    0, STj, STj, XX },
   /* DF F7 */  { "fcomip",    0, STj, STj, XX },
-  /* DE F8 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE F9 */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE FA */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE FB */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE FC */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE FD */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE FE */  { "(invalid)", 0,  XX,  XX, XX },
-  /* DE FF */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF F8 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF F9 */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF FA */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF FB */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF FC */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF FD */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF FE */  { "(invalid)", 0,  XX,  XX, XX },
+  /* DF FF */  { "(invalid)", 0,  XX,  XX, XX },
   };

 static BxDisasmOpcodeInfo_t BxDisasmOpcodes[256*2] = {


It work ft_strsplit

It work ft_strsplit


Present an infobar when an HTML5 database is saved

The infobar code is refactored into midori_view_add_info_bar

--- midori/midori-view.c
+++ midori/midori-view.c
@@ -1125,97 +1125,150 @@
 }
 #endif

-#if WEBKIT_CHECK_VERSION (1, 1, 23)
-static void
-midori_view_location_response_cb (GtkWidget*                       infobar,
-                                  gint                             response,
-                                  WebKitGeolocationPolicyDecision* decision)
-{
-    MidoriView* view = g_object_get_data (G_OBJECT (decision), "midori-view");
-    g_return_if_fail (MIDORI_IS_VIEW (view));
-
-    if (response == GTK_RESPONSE_ACCEPT)
-        webkit_geolocation_policy_allow (decision);
-    else
-        webkit_geolocation_policy_deny (decision);
+#define HAVE_GTK_INFO_BAR GTK_CHECK_VERSION (2, 18, 0)
+
+#if HAVE_GTK_INFO_BAR
+static void
+midori_view_infobar_response_cb (GtkWidget* infobar,
+                                 gint       response,
+                                 gpointer   data_object)
+{
+    void (*response_cb) (GtkWidget*, gint, gpointer);
+    response_cb = g_object_get_data (G_OBJECT (infobar), "midori-infobar-cb");
+    response_cb (infobar, response, data_object);
     gtk_widget_destroy (infobar);
 }
-
-#define HAVE_GTK_INFO_BAR GTK_CHECK_VERSION (2, 18, 0)
-
-#if !HAVE_GTK_INFO_BAR
-static void
-midori_view_location_button_cb (GtkWidget* button,
-                                WebKitGeolocationPolicyDecision* decision)
+#else
+static void
+midori_view_info_bar_button_cb (GtkWidget* button,
+                                gpointer   data_object)
 {
     GtkWidget* infobar = gtk_widget_get_parent (gtk_widget_get_parent (button));
-    const gchar* label = gtk_button_get_label (GTK_BUTTON (button));
-    gint response = g_str_equal (label, _("_Accept")) ? GTK_RESPONSE_ACCEPT : 0;
-    midori_view_location_response_cb (infobar, response, decision);
+    gint response = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (button), "midori-infobar-response"));
+    void (*response_cb) (GtkWidget*, gint, gpointer);
+    response_cb = g_object_get_data (G_OBJECT (infobar), "midori-infobar-cb");
+    response_cb (infobar, response, data_object);
+    gtk_widget_destroy (infobar);
 }
 #endif

-static gboolean
-midori_view_web_view_geolocation_decision_cb (WebKitWebView*                   web_view,
-                                              WebKitWebFrame*                  web_frame,
-                                              WebKitGeolocationPolicyDecision* decision,
-                                              MidoriView*                      view)
-{
-    const gchar* uri = webkit_web_frame_get_uri (web_frame);
-    gchar* path;
-    const gchar* hostname = sokoke_hostname_from_uri (uri, &path);
-    gchar* message;
+static GtkWidget*
+midori_view_add_info_bar (MidoriView*    view,
+                          GtkMessageType message_type,
+                          const gchar*   message,
+                          const gchar*   button_text1,
+                          gint           response_id1,
+                          const gchar*   button_text2,
+                          gint           response_id2,
+                          GCallback      response_cb,
+                          gpointer       data_object)
+{
     GtkWidget* infobar;
     GtkWidget* action_area;
     #if !HAVE_GTK_INFO_BAR
     GtkWidget* button;
     #endif
     GtkWidget* content_area;
-    GtkWidget* label;
-
-    if (!(hostname && *hostname))
-        hostname = uri;
-    message = g_strdup_printf (_("%s wants to know your location."), hostname);
-    label = gtk_label_new (message);

     #if HAVE_GTK_INFO_BAR
-    infobar = gtk_info_bar_new_with_buttons (_("_Deny"), GTK_RESPONSE_REJECT,
-                                             _("_Allow"), GTK_RESPONSE_ACCEPT,
-                                             NULL);
-    gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), GTK_MESSAGE_QUESTION);
+    infobar = gtk_info_bar_new_with_buttons (button_text1, response_id1,
+                                             button_text2, response_id2, NULL);
+    gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), message_type);
     content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar));
     action_area = gtk_info_bar_get_action_area (GTK_INFO_BAR (infobar));
     gtk_orientable_set_orientation (GTK_ORIENTABLE (action_area), GTK_ORIENTATION_HORIZONTAL);
     g_signal_connect (infobar, "response",
-                      G_CALLBACK (midori_view_location_response_cb), decision);
+                      G_CALLBACK (midori_view_infobar_response_cb), data_object);
     #else
     infobar = gtk_hbox_new (FALSE, 0);
     gtk_container_set_border_width (GTK_CONTAINER (infobar), 4);
     content_area = gtk_hbox_new (FALSE, 0);
     gtk_box_pack_start (GTK_BOX (infobar), content_area, TRUE, TRUE, 0);
-    action_area = gtk_hbox_new (TRUE, 0);
-    button = gtk_button_new_with_mnemonic (_("_Deny"));
+    action_area = gtk_hbox_new (TRUE, 4);
+    button = gtk_button_new_with_mnemonic (button_text1);
+    g_object_set_data (G_OBJECT (button), "midori-infobar-response",
+                       GINT_TO_POINTER (response_id1));
     g_signal_connect (button, "clicked",
-                      G_CALLBACK (midori_view_location_button_cb), decision);
+                      G_CALLBACK (midori_view_info_bar_button_cb), data_object);
     gtk_box_pack_start (GTK_BOX (action_area), button, FALSE, FALSE, 0);
-    button = gtk_button_new_with_mnemonic (_("_Accept"));
+    button = gtk_button_new_with_mnemonic (button_text2);
+    g_object_set_data (G_OBJECT (button), "midori-infobar-response",
+                       GINT_TO_POINTER (response_id2));
     g_signal_connect (button, "clicked",
-                      G_CALLBACK (midori_view_location_button_cb), decision);
+                      G_CALLBACK (midori_view_info_bar_button_cb), data_object);
     gtk_box_pack_start (GTK_BOX (action_area), button, FALSE, FALSE, 0);
-
     gtk_box_pack_start (GTK_BOX (infobar), action_area, FALSE, FALSE, 0);
     #endif

-    gtk_container_add (GTK_CONTAINER (content_area), label);
+    gtk_container_add (GTK_CONTAINER (content_area), gtk_label_new (message));
     gtk_widget_show_all (infobar);
     gtk_box_pack_start (GTK_BOX (view), infobar, FALSE, FALSE, 0);
     gtk_box_reorder_child (GTK_BOX (view), infobar, 0);
-
+    g_object_set_data (G_OBJECT (infobar), "midori-infobar-cb", response_cb);
+    return infobar;
+}
+
+#if WEBKIT_CHECK_VERSION (1, 1, 14)
+static void
+midori_view_database_response_cb (GtkWidget*         infobar,
+                                  gint               response,
+                                  WebKitWebDatabase* database)
+{
+    if (response != GTK_RESPONSE_ACCEPT)
+    {
+        WebKitSecurityOrigin* origin = webkit_web_database_get_security_origin (database);
+        webkit_security_origin_set_web_database_quota (origin, 0);
+        webkit_web_database_remove (database);
+    }
+    /* TODO: Remember the decision */
+}
+
+static void
+midori_view_web_view_database_quota_exceeded_cb (WebKitWebView*     web_view,
+                                                 WebKitWebFrame*    web_frame,
+                                                 WebKitWebDatabase* database,
+                                                 MidoriView*        view)
+{
+    const gchar* uri = webkit_web_frame_get_uri (web_frame);
+    const gchar* hostname = sokoke_hostname_from_uri (uri, NULL);
+    gchar* message = g_strdup_printf (_("%s wants to save an HTML5 database."),
+                                      hostname && *hostname ? hostname : uri);
+    midori_view_add_info_bar (view, GTK_MESSAGE_QUESTION, message,
+        _("_Deny"), GTK_RESPONSE_REJECT, _("_Allow"), GTK_RESPONSE_ACCEPT,
+        G_CALLBACK (midori_view_database_response_cb), database);
+    g_free (message);
+}
+#endif
+
+#if WEBKIT_CHECK_VERSION (1, 1, 23)
+static void
+midori_view_location_response_cb (GtkWidget*                       infobar,
+                                  gint                             response,
+                                  WebKitGeolocationPolicyDecision* decision)
+{
+    if (response == GTK_RESPONSE_ACCEPT)
+        webkit_geolocation_policy_allow (decision);
+    else
+        webkit_geolocation_policy_deny (decision);
+}
+
+static gboolean
+midori_view_web_view_geolocation_decision_cb (WebKitWebView*                   web_view,
+                                              WebKitWebFrame*                  web_frame,
+                                              WebKitGeolocationPolicyDecision* decision,
+                                              MidoriView*                      view)
+{
+    const gchar* uri = webkit_web_frame_get_uri (web_frame);
+    const gchar* hostname = sokoke_hostname_from_uri (uri, NULL);
+    gchar* message = g_strdup_printf (_("%s wants to know your location."),
+                                     hostname && *hostname ? hostname : uri);
+    GtkWidget* infobar = midori_view_add_info_bar (view, GTK_MESSAGE_QUESTION, message,
+        _("_Deny"), GTK_RESPONSE_REJECT, _("_Allow"), GTK_RESPONSE_ACCEPT,
+        G_CALLBACK (midori_view_location_response_cb), decision);
     g_free (message);
     view->infobar_location = infobar;
     g_signal_connect (infobar, "destroy",
                       G_CALLBACK (gtk_widget_destroyed), &view->infobar_location);
-    g_object_set_data (G_OBJECT (decision), "midori-view", view);
     return TRUE;
 }
 #endif
@@ -3414,6 +3467,10 @@
                       #if WEBKIT_CHECK_VERSION (1, 1, 14)
                       "signal::resource-request-starting",
                       midori_view_web_view_resource_request_cb, view,
+                      #endif
+                      #if WEBKIT_CHECK_VERSION (1, 1, 14)
+                      "signal::database-quota-exceeded",
+                      midori_view_web_view_database_quota_exceeded_cb, view,
                       #endif
                       #if WEBKIT_CHECK_VERSION (1, 1, 23)
                       "signal::geolocation-policy-decision-requested",


Fix comment formatting error

Fix comment formatting error

--- eas-daemon/libeas/eas-get-email-attachment-req.h
+++ eas-daemon/libeas/eas-get-email-attachment-req.h
@@ -73,7 +73,8 @@
  * Called from the Soup thread when we have the final response from the server.
  *
  * Responsible for parsing the server response with the help of the message and
- * then returning the results across the dbus to the client *
+ * then returning the results across the dbus to the client
+ *
  * @param[in] self
  *	  The EasGetEmailAttachmentReq GObject instance whose messages are complete.
  * @param[in] doc
@@ -81,6 +82,7 @@
  *	  xmlFreeDoc(). [full transfer]
  * @param[in] error
  *	  A GError code that has been propagated from the server response.
+ *
  * @return TRUE if finished and needs unreffing, FALSE otherwise
  */
 gboolean


Should hopefully fix Win32 build

Should hopefully fix Win32 build

--- src/condor_c++_util/Set.h
+++ src/condor_c++_util/Set.h
@@ -223,7 +223,7 @@
     else Head=N->Next;
     if (N->Next) N->Next->Prev=N->Prev;
   }
-  delete N;
+  delete const_cast<SetElem<KeyType>*>(N);
   return true;
 }


Patas Plugin: fix head for next target node

--- plugins/patas/patas.c
+++ plugins/patas/patas.c
@@ -374,13 +374,11 @@
     pthread_mutex_lock(&mutex_patas_target);

     if (!mk_patas_nodes_head) {
-        node = mk_list_entry_first(mk_patas_nodes_list, struct mk_patas_node, _head);
-        mk_patas_nodes_head = mk_patas_nodes_list->next;
-    }
-    else {
-        node = mk_list_entry_next(mk_patas_nodes_head, struct mk_patas_node,
-                                  _head, mk_patas_nodes_list);
-    }
+        mk_patas_nodes_head = mk_patas_nodes_list;
+    }
+
+    node = mk_list_entry_next(mk_patas_nodes_head, struct mk_patas_node, _head,
+                              mk_patas_nodes_list);

     /* Mutex unlock */
     pthread_mutex_unlock(&mutex_patas_target);


Use no border (shadow) on views by default

--- midori/midori-view.c
+++ midori/midori-view.c
@@ -2903,7 +2903,7 @@
     /* Adjustments are not created initially, but overwritten later */
     view->scrolled_window = katze_scrolled_new (NULL, NULL);
     gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (view->scrolled_window),
-                                         GTK_SHADOW_ETCHED_OUT);
+                                         GTK_SHADOW_NONE);
     gtk_container_add (GTK_CONTAINER (view), view->scrolled_window);

     g_signal_connect (view->scrolled_window, "notify::hadjustment",


not passing weight arg to perm

not passing weight arg to perm

git-svn-id: b6c97393e82be3812a607970066d172a5388f86f@109 df83fd30-4cca-4c36-ab9d-e8b5583ccbd1

--- swift/perm.c
+++ swift/perm.c
@@ -119,7 +119,7 @@
   return last;
   }

-void Perm(int size, int connections, int idata[], int recentdata[], int rowcol, float weight) {
+void Perm(int size, int connections, int idata[], int recentdata[], int rowcol) {

   int i,j,c,m,n,p,q,scount;
   int k = 0;
@@ -193,12 +193,11 @@
     }
 }

-int run_perm(int *con, int *sz, int *nc, float *wt) {
+int run_perm(int *con, int *sz, int *nc) {
   int numcol = nc[0];
   int connections = con[0];
   int size = sz[0];
   int idata[size];
-  float weight = wt[0];
   int recentdata[size];
   /* will use later when symm conn's not
      on the diag are permitted */
@@ -221,7 +220,7 @@
   printf("size: %i\n",size);

   printf("Permutations of %u items:\n\n", connections);
-  Perm(size, connections, idata, recentdata, numcol, weight);
+  Perm(size, connections, idata, recentdata, numcol);

   printf("\n%d permutations in all.\n", count);
   FreeData();


[led] Do not poll datapipes. JB#35137

[led] Do not poll datapipes. JB#35137

As a general rule, polling datapipes should be avoided.

Track and cache status of all datapipes that are relevant to the led
plugin. Use of table driven bindings also ensures that initial states
are correctly set up even if plugin load order should change later on.

To ease debugging, log datapipe state changes on verbose mode.

--- modules/led.c
+++ modules/led.c
@@ -291,6 +291,15 @@
 static gchar *engine2_leds_path = NULL;
 /** Path to engine 3 leds */
 static gchar *engine3_leds_path = NULL;
+
+/** Cached display state */
+static display_state_t display_state = MCE_DISPLAY_UNDEF;
+
+/** Cached system state */
+static system_state_t system_state = MCE_STATE_UNDEF;
+
+/** Cached led brightness */
+static gint led_brightness = 0;

 /** Maximum LED brightness
  *
@@ -1407,8 +1416,6 @@
  */
 static void led_update_active_pattern(void)
 {
-	display_state_t display_state = display_state_get();
-	system_state_t system_state = datapipe_get_gint(system_state_pipe);
 	pattern_struct *new_active_pattern = 0;

 	if( !pattern_stack )
@@ -1668,9 +1675,20 @@
  */
 static void system_state_trigger(gconstpointer data)
 {
-	(void)data;
+	system_state_t prev = system_state;
+	system_state = GPOINTER_TO_INT(data);
+
+	if( prev == system_state )
+		goto EXIT;
+
+	mce_log(LL_DEBUG, "system_state: %s -> %s",
+		system_state_repr(prev),
+		system_state_repr(system_state));

 	led_update_active_pattern();
+
+EXIT:
+	return;
 }

 /** Monotonic time stamp helper
@@ -1775,7 +1793,7 @@
 {
 	(void)data; // the data is irrelevant

-	if( display_state_get() == MCE_DISPLAY_ON )
+	if( display_state == MCE_DISPLAY_ON )
 		led_pattern_op(type6_revert_cb);
 	get_monotime(&activity_time);
 }
@@ -1787,12 +1805,17 @@
  */
 static void display_state_trigger(gconstpointer data)
 {
-	static display_state_t old_display_state = MCE_DISPLAY_UNDEF;
-	display_state_t display_state = GPOINTER_TO_INT(data);
+	display_state_t prev = display_state;
+	display_state = GPOINTER_TO_INT(data);
+
 	struct timeval tv;

-	if (old_display_state == display_state)
-		goto EXIT;
+	if (prev == display_state)
+		goto EXIT;
+
+	mce_log(LL_DEBUG, "display_state: %s -> %s",
+		display_state_repr(prev),
+		display_state_repr(display_state));

 	get_monotime(&tv);
 	timersub(&tv, &activity_time, &tv);
@@ -1823,7 +1846,6 @@
 	}

 	led_update_active_pattern();
-	old_display_state = display_state;

 EXIT:
 	return;
@@ -1836,7 +1858,14 @@
  */
 static void led_brightness_trigger(gconstpointer data)
 {
-	gint led_brightness = GPOINTER_TO_INT(data);
+	gint prev = led_brightness;
+	led_brightness = GPOINTER_TO_INT(data);
+
+	if( prev == led_brightness )
+		goto EXIT;
+
+	mce_log(LL_DEBUG, "led_brightness: %d -> %d",
+		prev, led_brightness);

 	switch (get_led_type()) {
 	case LED_TYPE_LYSTI_RGB:
@@ -1861,6 +1890,9 @@
 	default:
 		break;
 	}
+
+EXIT:
+	return;
 }

 /**
@@ -1870,7 +1902,13 @@
  */
 static void led_pattern_activate_trigger(gconstpointer data)
 {
-	led_activate_pattern((gchar *)data);
+	const char *name = data;
+
+	/* The datapipe does not have a state, so we need to
+	 * ignore null data that shows up on initialization */
+
+	if( name )
+		led_activate_pattern(name);
 }

 /**
@@ -1880,7 +1918,13 @@
  */
 static void led_pattern_deactivate_trigger(gconstpointer data)
 {
-	led_deactivate_pattern((gchar *)data);
+	const char *name = data;
+
+	/* The datapipe does not have a state, so we need to
+	 * ignore null data that shows up on initialization */
+
+	if( name )
+		led_deactivate_pattern(data);
 }

 /**
@@ -2966,6 +3010,10 @@
 	if( charger_state == prev )
 		goto EXIT;

+	mce_log(LL_DEBUG, "charger_state: %s -> %s",
+		charger_state_repr(prev),
+		charger_state_repr(charger_state));
+
 	sw_breathing_rethink();
 EXIT:
 	return;
@@ -2980,6 +3028,8 @@

 	if( battery_level == prev )
 		goto EXIT;
+
+	mce_log(LL_DEBUG, "battery_level: %d -> %d", prev, battery_level);

 	sw_breathing_rethink();
 EXIT:
@@ -3057,6 +3107,70 @@
 	mce_dbus_handler_unregister_array(led_dbus_handlers);
 }

+/** Array of datapipe handlers */
+static datapipe_handler_t mce_led_datapipe_handlers[] =
+{
+	// output triggers
+	{
+		.datapipe  = &user_activity_pipe,
+		.output_cb = user_activity_trigger,
+	},
+	{
+		.datapipe  = &system_state_pipe,
+		.output_cb = system_state_trigger,
+	},
+	{
+		.datapipe  = &display_state_pipe,
+		.output_cb = display_state_trigger,
+	},
+	{
+		.datapipe  = &led_brightness_pipe,
+		.output_cb = led_brightness_trigger,
+	},
+	{
+		.datapipe  = &led_pattern_activate_pipe,
+		.output_cb = led_pattern_activate_trigger,
+	},
+	{
+		.datapipe  = &led_pattern_deactivate_pipe,
+		.output_cb = led_pattern_deactivate_trigger,
+	},
+	{
+		.datapipe  = &charger_state_pipe,
+		.output_cb = charger_state_trigger,
+	},
+	{
+		.datapipe  = &battery_level_pipe,
+		.output_cb = battery_level_trigger,
+	},
+	// sentinel
+	{
+		.datapipe = 0,
+	}
+};
+
+static datapipe_bindings_t mce_led_datapipe_bindings =
+{
+	.module   = "led",
+	.handlers = mce_led_datapipe_handlers,
+};
+
+/** Append triggers/filters to datapipes
+ */
+static void
+mce_led_datapipes_init(void)
+{
+	datapipe_bindings_init(&mce_led_datapipe_bindings);
+}
+
+/** Remove triggers/filters from datapipes
+ */
+static void
+mce_led_datapipes_quit(void)
+{
+	datapipe_bindings_quit(&mce_led_datapipe_bindings);
+}
+
 /**
  * Init function for the LED logic module
  *
@@ -3072,22 +3186,7 @@
 	(void)module;

 	/* Append triggers/filters to datapipes */
-	append_output_trigger_to_datapipe(&user_activity_pipe,
-					  user_activity_trigger);
-	append_output_trigger_to_datapipe(&system_state_pipe,
-					  system_state_trigger);
-	append_output_trigger_to_datapipe(&display_state_pipe,
-					  display_state_trigger);
-	append_output_trigger_to_datapipe(&led_brightness_pipe,
-					  led_brightness_trigger);
-	append_output_trigger_to_datapipe(&led_pattern_activate_pipe,
-					  led_pattern_activate_trigger);
-	append_output_trigger_to_datapipe(&led_pattern_deactivate_pipe,
-					  led_pattern_deactivate_trigger);
-	append_output_trigger_to_datapipe(&charger_state_pipe,
-					  charger_state_trigger);
-	append_output_trigger_to_datapipe(&battery_level_pipe,
-					  battery_level_trigger);
+	mce_led_datapipes_init();

 	/* Setup a pattern stack,
 	 * a combination rule stack and a cross-refernce for said stack
@@ -3124,8 +3223,6 @@
  */
 void g_module_unload(GModule *module)
 {
-	system_state_t system_state = datapipe_get_gint(system_state_pipe);
-
 	(void)module;

 	/* Remove dbus handlers */
@@ -3141,22 +3238,7 @@
 	mce_close_output(&led_brightness_b_output);

 	/* Remove triggers/filters from datapipes */
-	remove_output_trigger_from_datapipe(&led_pattern_deactivate_pipe,
-					    led_pattern_deactivate_trigger);
-	remove_output_trigger_from_datapipe(&led_pattern_activate_pipe,
-					    led_pattern_activate_trigger);
-	remove_output_trigger_from_datapipe(&led_brightness_pipe,
-					    led_brightness_trigger);
-	remove_output_trigger_from_datapipe(&display_state_pipe,
-					    display_state_trigger);
-	remove_output_trigger_from_datapipe(&system_state_pipe,
-					    system_state_trigger);
-	remove_output_trigger_from_datapipe(&user_activity_pipe,
-					    user_activity_trigger);
-	remove_output_trigger_from_datapipe(&charger_state_pipe,
-					    charger_state_trigger);
-	remove_output_trigger_from_datapipe(&battery_level_pipe,
-					    battery_level_trigger);
+	mce_led_datapipes_quit();

 	/* Remove breathing timers and wakelocks */
 	sw_breathing_quit();


Revert "Fixed build issue"

Revert "Fixed build issue"

This reverts commit 8fdcbd41cba0173894373c8e60f8c7f484469d6c.

--- src/data-types/connect.h
+++ src/data-types/connect.h
@@ -37,8 +37,9 @@

 #define CONNECT_H

-#include <libetpan/libetpan-config.h>
-
+#ifdef HAVE_INTTYPES_H
+#	include <inttypes.h>
+#endif
 #include <time.h>

 #ifdef __cplusplus


Don't open drive before autochanger list command

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

--- bacula/src/stored/dircmd.c
+++ bacula/src/stored/dircmd.c
@@ -733,12 +733,7 @@
 	 if (!dev_is_tape(dev)) {
             bnet_fsend(dir, _("3995 Device %s is not an autochanger.\n"), dev_name(dev));
 	 } else if (!(dev->state & ST_OPENED)) {
-	    if (open_dev(dev, NULL, READ_WRITE) < 0) {
-               bnet_fsend(dir, _("3994 Connot open device: %s\n"), strerror_dev(dev));
-	    } else {
-	       autochanger_list(jcr, dev, dir);
-	       force_close_dev(dev);
-	    }
+	    autochanger_list(jcr, dev, dir);
          /* Under certain "safe" conditions, we can steal the lock */
 	 } else if (dev->dev_blocked &&
 		    (dev->dev_blocked == BST_UNMOUNTED ||


Show URL in New Tab menu item only over selections

--- midori/midori-view.c
+++ midori/midori-view.c
@@ -895,8 +895,10 @@
     GList* items;
     gboolean has_selection;

-    /* We do not want to modify the Edit menu.
-       The only reliable indicator is inspecting the first item. */
+    has_selection = midori_view_has_selection (view);
+
+    /* Unfortunately inspecting the menu is the only way to
+       determine that the mouse is over a text area or selection. */
     items = gtk_container_get_children (GTK_CONTAINER (menu));
     menuitem = (GtkWidget*)g_list_nth_data (items, 0);
     if (GTK_IS_IMAGE_MENU_ITEM (menuitem))
@@ -905,9 +907,9 @@
         gtk_image_get_stock (GTK_IMAGE (icon), &stock_id, NULL);
         if (!strcmp (stock_id, GTK_STOCK_CUT))
             return;
-    }
-
-    has_selection = midori_view_has_selection (view);
+        if (strcmp (stock_id, GTK_STOCK_FIND))
+            has_selection = FALSE;
+    }

     if (view->link_uri)
     {


Rename 'Download link destination' to 'Save as'

Fixes: https://bugs.launchpad.net/midori/+bug/699989

--- midori/midori-view.c
+++ midori/midori-view.c
@@ -2414,7 +2414,7 @@
             _("Copy Link de_stination"), NULL,
             G_CALLBACK (midori_web_view_menu_link_copy_activate_cb), widget);
         midori_view_insert_menu_item (menu_shell, -1,
-            _("_Save Link destination"), NULL,
+            NULL, GTK_STOCK_SAVE_AS,
             G_CALLBACK (midori_web_view_menu_save_activate_cb), widget);
         if (view->download_manager && *view->download_manager)
             midori_view_insert_menu_item (menu_shell, -1,
@@ -2478,13 +2478,15 @@
         #if WEBKIT_CHECK_VERSION (1, 1, 3)
         /* hack to localize menu item */
         label = gtk_bin_get_child (GTK_BIN (menuitem));
-        gtk_label_set_label (GTK_LABEL (label), _("_Download Link destination"));
+        GtkStockItem stock_item;
+        if (gtk_stock_lookup (GTK_STOCK_SAVE_AS, &stock_item))
+            gtk_label_set_label (GTK_LABEL (label), stock_item.label);
         #else
         /* hack to disable non-functional Download File */
         gtk_widget_hide (menuitem);
         gtk_widget_set_no_show_all (menuitem, TRUE);
         midori_view_insert_menu_item (menu_shell, 3,
-            _("_Save Link destination"), NULL,
+            NULL, GTK_STOCK_SAVE_AS,
             G_CALLBACK (midori_web_view_menu_save_as_activate_cb), widget);
         #endif
         if (view->download_manager && *view->download_manager)


Nip a potential bug in the bud (open2 was relying on the position of the vf->offset cursor not being disturbed from open1)

Fill in offsets and dataoffsets fileds in VF struct, even for non-seekable streams.

git-svn-id: 03f0f1727258f1959b7b485b30a676bafdb78148@15927 0101bb08-14d6-0310-b084-bc0e0c8e3800

--- lib/vorbisfile.c
+++ lib/vorbisfile.c
@@ -284,6 +284,7 @@

     if(searched>=end || next_serialnos==0){
       vf->links=m+1;
+      if(vf->offsets)_ogg_free(vf->offsets);
       vf->offsets=_ogg_malloc((vf->links+1)*sizeof(*vf->offsets));
       vf->offsets[m+1]=searched;
     }else{
@@ -450,8 +451,8 @@
   int i;
   ogg_int64_t ret;

-  /* release any overloaded vf->serialnos state */
   if(vf->serialnos)_ogg_free(vf->serialnos);
+  if(vf->dataoffsets)_ogg_free(vf->dataoffsets);

   vf->vi=_ogg_realloc(vf->vi,vf->links*sizeof(*vf->vi));
   vf->vc=_ogg_realloc(vf->vc,vf->links*sizeof(*vf->vc));
@@ -582,7 +583,7 @@
 }

 static int _open_seekable2(OggVorbis_File *vf){
-  ogg_int64_t dataoffset=vf->offset,end;
+  ogg_int64_t dataoffset=vf->dataoffsets[0],end;
   ogg_page og;

   /* we're partially open and have a first link header state in
@@ -608,7 +609,7 @@

   /* the initial header memory is referenced by vf after; don't free it */
   _prefetch_all_headers(vf,dataoffset);
-  return(ov_raw_seek(vf,0));
+  return(ov_raw_seek(vf,dataoffset));
 }

 /* clear out the current logical bitstream decoder */
@@ -737,7 +738,7 @@

 	    /* two possibilities:
 	       1) our decoding just traversed a bitstream boundary
-	       2) another stream is multiplexed into this logical section? */
+	       2) another stream is multiplexed into this logical section */

 	    if(ogg_page_bos(&og)){
 	      /* boundary case */
@@ -877,6 +878,11 @@
     vf->serialnos[0]=vf->current_serialno;
     vf->serialnos[1]=serialno_list_size;
     memcpy(vf->serialnos+2,serialno_list,serialno_list_size*sizeof(*vf->serialnos));
+
+    vf->offsets=_ogg_calloc(1,sizeof(*vf->offsets));
+    vf->dataoffsets=_ogg_calloc(1,sizeof(*vf->dataoffsets));
+    vf->offsets[0]=0;
+    vf->dataoffsets[0]=vf->offset;

     vf->ready_state=PARTOPEN;
   }


zork: Enable USB PD Version 3.0

zork: Enable USB PD Version 3.0

BUG=none
BRANCH=none
TEST=verify USB is working

Signed-off-by: Denis Brockus <6b21e8190fb5e373363fb95271367073a16474ef@google.com>
Change-Id: I3b7ef4faa7cc535be2df597e0dd8b9a73388f36d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2212204
Tested-by: Denis Brockus <6b21e8190fb5e373363fb95271367073a16474ef@chromium.org>
Commit-Queue: Jett Rink <9d4aef0593e6843318d99df31597fb6153b89787@chromium.org>
Reviewed-by: Jett Rink <9d4aef0593e6843318d99df31597fb6153b89787@chromium.org>
Reviewed-by: Edward Hill <db1406b34e091703092b6b136bdfeb2c8125fc0e@chromium.org>
Auto-Submit: Denis Brockus <6b21e8190fb5e373363fb95271367073a16474ef@chromium.org>

--- baseboard/zork/baseboard.h
+++ baseboard/zork/baseboard.h
@@ -120,6 +120,8 @@
  * http://google3/hardware/standards/usb/
  */
 #define CONFIG_USB_PID 0x5040
+
+#define CONFIG_USB_PD_REV30

 /* Enable the TCPMv2 PD stack */
 #define CONFIG_USB_PD_TCPMV2


minor update in incident_faces_area

minor update in incident_faces_area

--- cgogn/geometry/algos/area.h
+++ cgogn/geometry/algos/area.h
@@ -123,12 +123,12 @@
 	using Scalar = typename vector_traits<VEC3>::Scalar;
 	using Face = typename MAP::Face;

-	Scalar area(0);
+	Scalar incident_area(0);
 	map.foreach_incident_face(c, [&] (Face f)
 	{
-		area += cgogn::geometry::convex_area<VEC3>(map, f, position);
+		incident_area += area<VEC3>(map, f, position);
 	});
-	return area ;
+	return incident_area;
 }

 template <typename VEC3, typename CellType, typename MAP, typename MASK>


in_head: release sbuffer at cb_exit

in_head: release sbuffer at cb_exit

Signed-off-by: Takahiro YAMASHITA <8b9f03f78cb27351a99f79113f99e589b65190d5@gmail.com>

--- plugins/in_head/in_head.c
+++ plugins/in_head/in_head.c
@@ -228,6 +228,8 @@
     (void) *config;
     struct flb_in_head_config *head_config = data;

+    msgpack_sbuffer_destroy(&head_config->mp_sbuf);
+
     delete_head_config(head_config);

     return 0;