Add array bounds checking, fix memleaks, add null ptr checks.

--- src/mesa/shader/slang/slang_codegen.c
+++ src/mesa/shader/slang/slang_codegen.c
@@ -276,7 +276,7 @@
       { "gl_BackColor", VERT_RESULT_BFC0 },
       { "gl_FrontSecondaryColor", VERT_RESULT_COL1 },
       { "gl_BackSecondaryColor", VERT_RESULT_BFC1 },
-      { "gl_TexCoord", VERT_RESULT_TEX0 }, /* XXX indexed */
+      { "gl_TexCoord", VERT_RESULT_TEX0 },
       { "gl_FogFragCoord", VERT_RESULT_FOGC },
       { "gl_PointSize", VERT_RESULT_PSIZ },
       { NULL, 0 }
@@ -1953,6 +1953,7 @@
 _slang_gen_swizzle(slang_ir_node *child, GLuint swizzle)
 {
    slang_ir_node *n = new_node1(IR_SWIZZLE, child);
+   assert(child);
    if (n) {
       n->Store = _slang_new_ir_storage(PROGRAM_UNDEFINED, -1, -1);
       n->Store->Swizzle = swizzle;
@@ -2045,7 +2046,8 @@

       n = _slang_gen_operation(A, &oper->children[0]);
       /* create new parent node with swizzle */
-      n = _slang_gen_swizzle(n, swizzle);
+      if (n)
+         n = _slang_gen_swizzle(n, swizzle);
       return n;
    }
    else if (ti.spec.type == SLANG_SPEC_FLOAT) {
@@ -2138,21 +2140,42 @@
       /* conventional array */
       slang_typeinfo elem_ti;
       slang_ir_node *elem, *array, *index;
-      GLint elemSize;
+      GLint elemSize, arrayLen;

       /* size of array element */
       slang_typeinfo_construct(&elem_ti);
       _slang_typeof_operation(A, oper, &elem_ti);
       elemSize = _slang_sizeof_type_specifier(&elem_ti.spec);
+
+      if (_slang_type_is_matrix(array_ti.spec.type))
+         arrayLen = _slang_type_dim(array_ti.spec.type);
+      else
+         arrayLen = array_ti.array_len;
+
+      slang_typeinfo_destruct(&array_ti);
+      slang_typeinfo_destruct(&elem_ti);
+
       if (elemSize <= 0) {
          /* unknown var or type */
-         slang_info_log_error(A->log, "Undefined var or type");
+         slang_info_log_error(A->log, "Undefined variable or type");
          return NULL;
       }

       array = _slang_gen_operation(A, &oper->children[0]);
       index = _slang_gen_operation(A, &oper->children[1]);
       if (array && index) {
+         /* bounds check */
+         if (index->Opcode == IR_FLOAT &&
+             ((int) index->Value[0] < 0 ||
+              (int) index->Value[0] >= arrayLen)) {
+            slang_info_log_error(A->log,
+                                "Array index out of bounds (index=%d size=%d)",
+                                 (int) index->Value[0], arrayLen);
+            _slang_free_ir_tree(array);
+            _slang_free_ir_tree(index);
+            return NULL;
+         }
+
          elem = new_node2(IR_ELEMENT, array, index);
          elem->Store = _slang_new_ir_storage(array->Store->File,
                                              array->Store->Index,
@@ -2161,6 +2184,8 @@
          return elem;
       }
       else {
+         _slang_free_ir_tree(array);
+         _slang_free_ir_tree(index);
          return NULL;
       }
    }


Fix editor to always use spaces instead of tabs

Sorry. :(

--- src/kernel.c
+++ src/kernel.c
@@ -133,9 +133,9 @@
     cbuf_init(&free_list);

     for (i = 0; i < 16; i++) {
-	tasks[i].tid   = i;
-	tasks[i].p_tid = -1;
-	cbuf_produce(&free_list, (char)i);
+        tasks[i].tid   = i;
+        tasks[i].p_tid = -1;
+        cbuf_produce(&free_list, (char)i);
     }

     // get the party started
@@ -150,9 +150,9 @@
     task_create(TASK_PRIORITY_MEDIUM,      train_station);

     for (; i < TASK_MAX; i++) {
-	tasks[i].tid   = i;
-	tasks[i].p_tid = -1;
-	cbuf_produce(&free_list, (char)i);
+        tasks[i].tid   = i;
+        tasks[i].p_tid = -1;
+        cbuf_produce(&free_list, (char)i);
     }

     *SWI_HANDLER = (0xea000000 | (((uint)kernel_enter >> 2) - 4));


Do not inline scheduler_schedule in task_create

Because task_create gets inlined in a lot of places.

--- src/kernel.c
+++ src/kernel.c
@@ -553,7 +553,7 @@
     tsk->sp[12]    = EXIT_ADDRESS; // set link register to auto-call Exit()

     // set tsk->next
-    scheduler_schedule(tsk);
+    scheduler_reschedule(tsk);

     return tsk->tid;
 }


emulation: Fix escape sequences of keypad Home and End (take 2)

https://bugzilla.gnome.org/show_bug.cgi?id=600659#c63

--- src/keymap.c
+++ src/keymap.c
@@ -502,13 +502,12 @@

 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_End[] = {
 	{cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, "K4"},
-	{cursor_all, keypad_default, fkey_notvt220,
-	 0, _VTE_CAP_CSI "4~", -1, X_NULL},
+	{cursor_default, keypad_default, fkey_notvt220, 0, _VTE_CAP_CSI "F", -1, X_NULL},
+	{cursor_app, keypad_default, fkey_notvt220, 0, _VTE_CAP_SS3 "F", -1, X_NULL},
 	{cursor_all, keypad_default, fkey_vt220, 0, "1", 1, X_NULL},
-	{cursor_all, keypad_app, fkey_notvt220, 0, _VTE_CAP_CSI "4~", -1, X_NULL},
+	{cursor_default, keypad_app, fkey_notvt220, 0, _VTE_CAP_CSI "F", -1, X_NULL},
+	{cursor_app, keypad_app, fkey_notvt220, 0, _VTE_CAP_SS3 "F", -1, X_NULL},
 	{cursor_all, keypad_app, fkey_vt220, 0, _VTE_CAP_SS3 "q", -1, X_NULL},
-	{cursor_default, keypad_all, fkey_default, 0, _VTE_CAP_CSI "F", -1, X_NULL},
-	{cursor_app, keypad_all, fkey_default, 0, _VTE_CAP_SS3 "F", -1, X_NULL},
 	{cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };

@@ -564,13 +563,12 @@

 static const struct _vte_keymap_entry _vte_keymap_GDK_KP_Home[] = {
 	{cursor_all, keypad_default, fkey_all, 0, X_NULL, 0, "K1"},
-	{cursor_all, keypad_default, fkey_notvt220,
-	 0, _VTE_CAP_CSI "1~", -1, X_NULL},
+	{cursor_default, keypad_default, fkey_notvt220, 0, _VTE_CAP_CSI "H", -1, X_NULL},
+	{cursor_app, keypad_default, fkey_notvt220, 0, _VTE_CAP_SS3 "H", -1, X_NULL},
 	{cursor_all, keypad_default, fkey_vt220, 0, "7", 1, X_NULL},
-	{cursor_all, keypad_app, fkey_notvt220, 0, _VTE_CAP_CSI "1~", -1, X_NULL},
+	{cursor_default, keypad_app, fkey_notvt220, 0, _VTE_CAP_CSI "H", -1, X_NULL},
+	{cursor_app, keypad_app, fkey_notvt220, 0, _VTE_CAP_SS3 "H", -1, X_NULL},
 	{cursor_all, keypad_app, fkey_vt220, 0, _VTE_CAP_SS3 "w", -1, X_NULL},
-	{cursor_default, keypad_all, fkey_default, 0, _VTE_CAP_CSI "H", -1, X_NULL},
-	{cursor_app, keypad_all, fkey_default, 0, _VTE_CAP_SS3 "H", -1, X_NULL},
 	{cursor_all, keypad_all, fkey_all, 0, X_NULL, 0, X_NULL},
 };


pki: Fix memleak in privatekey_from_file().

--- src/legacy.c
+++ src/legacy.c
@@ -286,6 +286,11 @@
     privkey->type = key->type;
     privkey->dsa_priv = key->dsa;
     privkey->rsa_priv = key->rsa;
+
+    key->dsa = NULL;
+    key->rsa = NULL;
+
+    ssh_key_free(key);

     return privkey;
 }


Made command-line arguments take precedence over those inside the kernel.

--- src/CLSmith/cl_launcher.c
+++ src/CLSmith/cl_launcher.c
@@ -132,6 +132,37 @@
       print_help();
       exit(0);
     }
+    if (!strcmp(curr_arg, "-f") || !strcmp(curr_arg, "--filename")) {
+      file = argv[++arg_no];
+    }
+    if (!strcmp(curr_arg, "-a") || !strcmp(curr_arg, "--args")) {
+      args_file = argv[++arg_no];
+    }
+  }
+
+  if (!file) {
+    printf("Require file (-f) argument!\n");
+    return 1;
+  }
+
+  // Parse arguments found in the given source file
+  if (args_file == NULL) {
+    if (!parse_file_args(file)) {
+      printf("Failed parsing file for arguments.\n");
+      return 1;
+    }
+  }
+  // Parse arguments in defined args file
+  else {
+    if (!parse_file_args(args_file)) {
+      printf("Failed parsing given arguments file.\n");
+      return 1;
+    }
+  }
+
+  arg_no = 0;
+  while (++arg_no < argc) {
+    curr_arg = argv[arg_no];
     if (strncmp(curr_arg, "---", 3)) {
       if (++arg_no >= argc) {
         printf("Found option %s with no value.\n", curr_arg);
@@ -146,24 +177,9 @@
       req_arg++;
   }

-  if (req_arg != 3) {
-    printf("Require file (-f), device index (-d) and platform index (-p) arguments!\n");
-    return 1;
-  }
-
-  // Parse arguments found in the given source file
-  if (args_file == NULL) {
-    if (!parse_file_args(file)) {
-      printf("Failed parsing file for arguments.\n");
-      return 1;
-    }
-  }
-  // Parse arguments in defined args file
-  else {
-    if (!parse_file_args(args_file)) {
-      printf("Failed parsing given arguments file.\n");
-      return 1;
-    }
+  if (req_arg != 2) {
+    printf("Require device index (-d) and platform index (-p) arguments!\n");
+    return 1;
   }

   // TODO function this
@@ -211,6 +227,12 @@
     printf("Cannot have more than 3 dimensions!\n");
     return 1;
   }
+  int d;
+  for (d = 1; d < l_dim; d++)
+    if (local_size[d] > global_size[d]) {
+      printf("Local dimension %d greater than global dimension!\n", d);
+      return 1;
+    }

   // Calculating total number of work-units for future use
   int i;
@@ -295,7 +317,7 @@
   if (inter_thread_comm) {
     free(comm_vals);
   }
-
+
   return run_err;
 }

@@ -610,11 +632,9 @@

 int parse_arg(char* arg, char* val) {
   if (!strcmp(arg, "-f") || !strcmp(arg, "--filename")) {
-    file = val;
-    return 2;
+    return 1;
   }
   if (!strcmp(arg, "-a") || !strcmp(arg, "--args")) {
-    args_file = val;
     return 1;
   }
   if (!strcmp(arg, "-d") || !strcmp(arg, "--device_idx")) {


Turn off line buffering for input

Turn off line buffering for input

	modified:   src/libnms.c

--- src/libnms.c
+++ src/libnms.c
@@ -66,7 +66,7 @@
 void nms_sleep(int);
 int  nms_term_rows(void);
 int  nms_term_cols(void);
-void nms_set_echo(int s);
+void nms_set_terminal(int s);
 void nms_clear_input(void);

 // Character table representing the character set know as CP437 used by
@@ -146,7 +146,7 @@
 	}

 	// Turn off terminal echo
-	nms_set_echo(0);
+	nms_set_terminal(0);

 	// Needed for UTF-8 support
 	setlocale(LC_ALL, "");
@@ -248,7 +248,8 @@
 	if (autoDecrypt)
 		sleep(1);
 	else
-		getchar();
+		while ((ret = getchar()) == EOF)
+			;

 	// Jumble loop
 	for (i = 0; i < (JUMBLE_SECONDS * 1000) / JUMBLE_LOOP_SPEED; ++i) {
@@ -345,11 +346,13 @@
 	}

 	// User must press a key to continue
-	ret = getchar();
+	while ((ret = getchar()) == EOF)
+		;
 	if (returnOpts != NULL && strlen(returnOpts) > 0) {
 		while (strchr(returnOpts, ret) == NULL) {
 			BEEP();
-			ret = getchar();
+			while ((ret = getchar()) == EOF)
+				;
 		}
 	}

@@ -359,7 +362,7 @@
 	CURSOR_SHOW();

 	// Turn on terminal echo
-	nms_set_echo(1);
+	nms_set_terminal(1);

 	// Freeing the list.
 	list_pointer = list_head;
@@ -396,7 +399,7 @@
 	return w.ws_col;
 }

-void nms_set_echo(int s) {
+void nms_set_terminal(int s) {
 	struct termios tp;
 	static struct termios save;
 	static int state = 1;
@@ -408,7 +411,7 @@

 		save = tp;

-		tp.c_lflag &= ~ECHO;
+		tp.c_lflag &=(~ICANON & ~ECHO);

 		if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &tp) == -1) {
 			return;
@@ -424,7 +427,7 @@
 void nms_clear_input(void) {
 	int c;

-	while ( (c = getchar()) != '\n' && c != EOF )
+	while ((c = getchar()) != EOF)
 		;
 }


* ./src/libvlc.h: fixed a few typos

* ./src/libvlc.h: fixed a few typos

--- src/libvlc.h
+++ src/libvlc.h
@@ -2,7 +2,7 @@
  * libvlc.h: main libvlc header
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.22 2002/11/28 14:34:39 sam Exp $
+ * $Id: libvlc.h,v 1.23 2002/11/29 23:08:34 ipkiss Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -40,7 +40,7 @@
 #define VERBOSE_TEXT N_("verbosity (0,1,2)")
 #define VERBOSE_LONGTEXT N_( \
     "This options sets the verbosity level (0=only errors and " \
-    "standard messages, 1=warnings, 2=debug.")
+    "standard messages, 1=warnings, 2=debug).")

 #define QUIET_TEXT N_("be quiet")
 #define QUIET_LONGTEXT N_( \
@@ -151,7 +151,7 @@
 #define OVERLAY_TEXT N_("overlay video output")
 #define OVERLAY_LONGTEXT N_( \
     "If enabled, vlc will try to take advantage of the overlay capabilities " \
-    "of you graphics card.")
+    "of your graphic card.")

 #define SPUMARGIN_TEXT N_("force SPU position")
 #define SPUMARGIN_LONGTEXT N_( \
@@ -257,7 +257,7 @@
     "If you check this box, IPv4 will be used by default for all UDP and " \
     "HTTP connections.")

-#define CODEC_TEXT N_("choose preferred codec list")
+#define CODEC_TEXT N_("choose prefered codec list")
 #define CODEC_LONGTEXT N_( \
     "This allows you to select the order in which vlc will choose its " \
     "codecs. For instance, 'a52old,a52,any' will try the old a52 codec " \
@@ -288,7 +288,7 @@
 #define SSE_TEXT N_("enable CPU SSE support")
 #define SSE_LONGTEXT N_( \
     "If your processor supports the SSE instructions set, vlc can take " \
-    "can take advantage of them.")
+    "advantage of them.")

 #define ALTIVEC_TEXT N_("enable CPU AltiVec support")
 #define ALTIVEC_LONGTEXT N_( \
@@ -316,8 +316,8 @@

 #define MEMCPY_TEXT N_("memory copy module")
 #define MEMCPY_LONGTEXT N_( \
-    "You can select wich memory copy module you want to use. By default vlc " \
-    "will select the fastest one supported by your hardware.")
+    "You can select which memory copy module you want to use. By default" \
+    "vlc will select the fastest one supported by your hardware.")

 #define ACCESS_TEXT N_("access module")
 #define ACCESS_LONGTEXT N_( \
@@ -335,7 +335,7 @@
     "experience problems with it.")

 #define WIN9X_CV_TEXT N_("Condition variables implementation for Win9x " \
-    "(developpers only)")
+    "(developers only)")
 #define WIN9X_CV_LONGTEXT N_( \
     "On Windows 9x/Me we use a fast but not correct condition variables " \
     "implementation (more precisely there is a possibility for a race " \


fix some formatting i spotted.

fix some formatting i spotted.

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

--- src/lib/canvas/evas_events.c
+++ src/lib/canvas/evas_events.c
@@ -1604,76 +1604,76 @@
 EAPI void
 evas_event_refeed_event(Evas *e, void *event_copy, Evas_Callback_Type event_type)
 {
-   switch(event_type)
+   switch (event_type)
      {
       case EVAS_CALLBACK_MOUSE_IN:
-           {
-              Evas_Event_Mouse_In *ev = event_copy;
-              evas_event_feed_mouse_in(e, ev->timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Mouse_In *ev = event_copy;
+             evas_event_feed_mouse_in(e, ev->timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_MOUSE_OUT:
-           {
-              Evas_Event_Mouse_Out *ev = event_copy;
-              evas_event_feed_mouse_out(e, ev->timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Mouse_Out *ev = event_copy;
+             evas_event_feed_mouse_out(e, ev->timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_MOUSE_DOWN:
-           {
-              Evas_Event_Mouse_Down *ev = event_copy;
-              evas_event_feed_mouse_down(e, ev->button, ev->flags, ev-> timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Mouse_Down *ev = event_copy;
+             evas_event_feed_mouse_down(e, ev->button, ev->flags, ev-> timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_MOUSE_UP:
-           {
-              Evas_Event_Mouse_Up *ev = event_copy;
-              evas_event_feed_mouse_up(e, ev->button, ev->flags, ev-> timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Mouse_Up *ev = event_copy;
+             evas_event_feed_mouse_up(e, ev->button, ev->flags, ev-> timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_MOUSE_MOVE:
-           {
-              Evas_Event_Mouse_Move *ev = event_copy;
-              evas_event_feed_mouse_move(e, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Mouse_Move *ev = event_copy;
+             evas_event_feed_mouse_move(e, ev->cur.canvas.x, ev->cur.canvas.y, ev->timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_MOUSE_WHEEL:
-           {
-              Evas_Event_Mouse_Wheel *ev = event_copy;
-              evas_event_feed_mouse_wheel(e, ev->direction, ev-> z, ev->timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Mouse_Wheel *ev = event_copy;
+             evas_event_feed_mouse_wheel(e, ev->direction, ev-> z, ev->timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_MULTI_DOWN:
-           {
-              Evas_Event_Multi_Down *ev = event_copy;
-              evas_event_feed_multi_down(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data);
-                 break;
-           }
+          {
+             Evas_Event_Multi_Down *ev = event_copy;
+             evas_event_feed_multi_down(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_MULTI_UP:
-           {
-              Evas_Event_Multi_Up *ev = event_copy;
-              evas_event_feed_multi_up(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Multi_Up *ev = event_copy;
+             evas_event_feed_multi_up(e, ev->device, ev->canvas.x, ev->canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->canvas.xsub, ev->canvas.ysub, ev->flags, ev->timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_MULTI_MOVE:
-           {
-              Evas_Event_Multi_Move *ev = event_copy;
-              evas_event_feed_multi_move(e, ev->device, ev->cur.canvas.x, ev->cur.canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->cur.canvas.xsub, ev->cur.canvas.ysub, ev->timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Multi_Move *ev = event_copy;
+             evas_event_feed_multi_move(e, ev->device, ev->cur.canvas.x, ev->cur.canvas.y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, ev->cur.canvas.xsub, ev->cur.canvas.ysub, ev->timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_KEY_DOWN:
-           {
-              Evas_Event_Key_Down *ev = event_copy;
-              evas_event_feed_key_down(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Key_Down *ev = event_copy;
+             evas_event_feed_key_down(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data);
+             break;
+          }
       case EVAS_CALLBACK_KEY_UP:
-           {
-              Evas_Event_Key_Up *ev = event_copy;
-              evas_event_feed_key_up(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data);
-              break;
-           }
+          {
+             Evas_Event_Key_Up *ev = event_copy;
+             evas_event_feed_key_up(e, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, ev->data);
+             break;
+          }
       default: /* All non-input events are not handeled */
-         break;
+        break;
      }
 }


Fix segfault when double freeing a string.

This fix makes it work again. However, ecore plugin should really be rewritten
or we should start considering eina_module instead.

git-svn-id: 02aad79badda6dfe9dc72877135550b4bc575585@38275 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/lib/ecore/ecore_plugin.c
+++ src/lib/ecore/ecore_plugin.c
@@ -249,6 +249,6 @@
 static Eina_Bool
 _hash_keys(const Eina_Hash *hash, const char *key, void *list)
 {
-   ecore_list_append(list, key);
+   ecore_list_append(list, strdup(key));
    return EINA_TRUE;
 }


* ecore: oops, forgot that change.

	* ecore: oops, forgot that change.

SVN revision: 52580

--- src/lib/ecore/ecore_thread.c
+++ src/lib/ecore/ecore_thread.c
@@ -754,7 +754,7 @@
  * You should use this function only in the func_heavy call.
  */
 EAPI Eina_Bool
-ecore_thread_notify(Ecore_Thread *thread, const void *data)
+ecore_thread_feedback(Ecore_Thread *thread, const void *data)
 {
    Ecore_Pthread_Worker *worker = (Ecore_Pthread_Worker *) thread;


Add extern "C" for router.h

Add extern "C" for router.h

--- router/router.h
+++ router/router.h
@@ -14,6 +14,10 @@
 #include "rwlock.h"
 #include "threads.h"

+
+#ifdef __cplusplus
+extern "C" {
+#endif

 #ifndef UNUSED
 #if defined(__cplusplus)
@@ -194,4 +198,8 @@
     }                                                     \
 } while(0)

+#ifdef __cplusplus
+} // extern "C"
+#endif
+
 #endif /* ROUTER_ROUTER_H */


On the powerpc, add memory barriers isync and lwsync to the spinlock_lock and _unlock functions.  These barriers are not needed on x86.  But the powerpc has a weaker memory model and without them, inconsistent values inside a spinlock critical region can be visible outside the region.

--- src/lib/prof-lean/spinlock.h
+++ src/lib/prof-lean/spinlock.h
@@ -69,7 +69,6 @@

 /*
  * Simple spin lock.
- *
  */

 typedef struct spinlock_s {
@@ -84,6 +83,14 @@
 #define SPINLOCK_LOCKED INITIALIZE_SPINLOCK(SPINLOCK_LOCKED_VALUE)

+/*
+ * Note: powerpc needs two memory barriers: isync at the end of _lock
+ * and lwsync at the beginning of _unlock.  See JohnMC's Comp 422
+ * slides on "IBM Power Weak Memory Model."
+ *
+ * Technically, the isync could be moved to the assembly code for
+ * fetch_and_store().
+ */
 static inline void
 spinlock_lock(spinlock_t *l)
 {
@@ -92,15 +99,23 @@
     while (l->thelock != SPINLOCK_UNLOCKED_VALUE);

     if (fetch_and_store(&l->thelock, SPINLOCK_LOCKED_VALUE) == SPINLOCK_UNLOCKED_VALUE) {
-      return;
+      break;
     }
   }
+
+#if defined(__powerpc__)
+  __asm__ __volatile__ ("isync\n");
+#endif
 }

 static inline void
 spinlock_unlock(spinlock_t *l)
 {
+#if defined(__powerpc__)
+  __asm__ __volatile__ ("lwsync\n");
+#endif
+
   l->thelock = SPINLOCK_UNLOCKED_VALUE;
 }


ifdef for remove evmm exclusion

ifdef for remove evmm exclusion

--- cpvmm/vmm/startup/layout_host_memory_for_mbr_loader.c
+++ cpvmm/vmm/startup/layout_host_memory_for_mbr_loader.c
@@ -145,7 +145,7 @@
     }

 #if 1
-    // JLM(FIX)
+#if 1   // UNMAP EVMM
     // now remove the VMM area from the primary guest
     ok= gpm_remove_mapping(primary_guest_gpm,
                             vmm_memory_layout[0].base_address,
@@ -153,7 +153,7 @@
     VMM_LOG(mask_anonymous, level_trace,"Primary guest GPM: remove uvmm image base %p size 0x%x\r\n",
     vmm_memory_layout[uvmm_image].base_address,
     vmm_memory_layout[uvmm_image].total_size);
-
+#endif
 #if 0
     // and remove thunk area from the primary guest also
     // if post launch skip it.


For more history, use git log -- smoketestclientlib.c ../../ccnd/lib/smoketestclientlib.c

--- src/lib/smoketestclientlib.c
+++ src/lib/smoketestclientlib.c
@@ -176,3 +176,4 @@
     ccn_destroy(&ccn);
     exit(0);
 }
+


Add WBS support on Bluedroid (1/6)

 Add WBS support on Bluedroid (1/6)

 Bug 13764086

Change-Id: Ib861d94b752561392e315ab8f459c30588075a46

--- bluetooth/bdroid_buildcfg.h
+++ bluetooth/bdroid_buildcfg.h
@@ -19,4 +19,7 @@

 #define BTA_DISABLE_DELAY 100 /* in milliseconds */

+#define BTM_WBS_INCLUDED TRUE
+#define BTIF_HF_WBS_PREFERRED TRUE
+
 #endif


board/nucleo-f072rb/board.h: Format with clang-format

BUG=b:236386294
BRANCH=none
TEST=none

Change-Id: I8f9b177e179e18f8701fe4d8e69ccb917358775f
Signed-off-by: Jack Rosenthal <d3f605bef1867f59845d4ce6e4f83b8dc9e4e0ae@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3728776
Reviewed-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>

--- board/nucleo-f072rb/board.h
+++ board/nucleo-f072rb/board.h
@@ -20,7 +20,7 @@

 #ifdef CTS_MODULE
 #undef STM32_IRQ_EXT2_3_PRIORITY
-#define STM32_IRQ_EXT2_3_PRIORITY	2
+#define STM32_IRQ_EXT2_3_PRIORITY 2
 #ifdef CTS_MODULE_I2C
 #define CONFIG_I2C
 #define CONFIG_I2C_CONTROLLER


Honda Bosch: consider correct bus for buttons (#963)

* fix bosch controls mismatch when using op longitudinal

* misra

--- board/safety/safety_honda.h
+++ board/safety/safety_honda.h
@@ -101,10 +101,13 @@
   bool valid = addr_safety_check(to_push, &honda_rx_checks,
                                  honda_get_checksum, honda_compute_checksum, honda_get_counter);

-  const bool pcm_cruise = ((honda_hw == HONDA_BOSCH) && !honda_bosch_long) || \
-                          ((honda_hw == HONDA_NIDEC) && !gas_interceptor_detected);
-
   if (valid) {
+    const bool pcm_cruise = ((honda_hw == HONDA_BOSCH) && !honda_bosch_long) || \
+                            ((honda_hw == HONDA_NIDEC) && !gas_interceptor_detected);
+
+    int bus_rdr_car = (honda_hw == HONDA_BOSCH) ? 0 : 2;  // radar bus, car side
+    int pt_bus = (honda_hw == HONDA_BOSCH) ? 1 : 0;
+
     int addr = GET_ADDR(to_push);
     int len = GET_LEN(to_push);
     int bus = GET_BUS(to_push);
@@ -142,7 +145,7 @@

     // state machine to enter and exit controls for button enabling
     // 0x1A6 for the ILX, 0x296 for the Civic Touring
-    if (((addr == 0x1A6) || (addr == 0x296))) {
+    if (((addr == 0x1A6) || (addr == 0x296)) && (bus == pt_bus)) {
       int button = (GET_BYTE(to_push, 0) & 0xE0U) >> 5;

       // exit controls once main or cancel are pressed
@@ -211,8 +214,6 @@
     }

     bool stock_ecu_detected = false;
-    int bus_rdr_car = (honda_hw == HONDA_BOSCH) ? 0 : 2;  // radar bus, car side
-    int pt_bus = (honda_hw == HONDA_BOSCH) ? 1 : 0;

     if (safety_mode_cnt > RELAY_TRNS_TIMEOUT) {
       // If steering controls messages are received on the destination bus, it's an indication


* buckets/aggregate_buckets.c   (serf_aggregate_read_iovec): Return EOF if we are empty.

--- buckets/aggregate_buckets.c
+++ buckets/aggregate_buckets.c
@@ -261,6 +261,11 @@

     cleanup_aggregate(ctx, bucket->allocator);

+    if (!ctx->list) {
+        *vecs_used = 0;
+        return APR_EOF;
+    }
+
     for (i = 0; i < vecs_size; i++) {
         if (status || !ctx->list) {
             break;


* buckets/aggregate_buckets.c
  (serf_bucket_aggregate_append): Fix indentation.

git-svn-id: 683495cb1553624b05a54e2ba9533425f69cf277@1326 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845

--- buckets/aggregate_buckets.c
+++ buckets/aggregate_buckets.c
@@ -149,11 +149,11 @@
     */
     if (ctx->list == NULL) {
         ctx->list = new_list;
-	ctx->last = new_list;
+        ctx->last = new_list;
     }
     else {
         ctx->last->next = new_list;
-	ctx->last = ctx->last->next;
+        ctx->last = ctx->last->next;
     }
 }


Fixed ptr2int casting warnings

Fixed ptr2int casting warnings

--- src/components/objects/object.c
+++ src/components/objects/object.c
@@ -186,7 +186,7 @@
         refcount_objects = ht_create();
     }

-    ht_replace_ptr(refcount_objects, (void *)obj, (intptr_t *)obj->ref_count);
+    ht_replace_ptr(refcount_objects, (void *)obj, (void *)(intptr_t)obj->ref_count);

     if (OBJECT_IS_CALLABLE(obj) || OBJECT_IS_ATTRIBUTE(obj)) return;
@@ -209,7 +209,7 @@
     }
     obj->ref_count--;

-    ht_replace_ptr(refcount_objects, (void *)obj, (intptr_t *)obj->ref_count);
+    ht_replace_ptr(refcount_objects, (void *)obj, (void *)(intptr_t)obj->ref_count);

 #if __DEBUG_REFCOUNT
     if (! OBJECT_IS_CALLABLE(obj) && ! OBJECT_IS_ATTRIBUTE(obj)) {


nta.c: asserting in proper place when handling queue tail

darcs-hash:20080123160558-65a35-107dfadfb45501b8e35f1556cd2f4214f661ddd5.gz

--- libsofia-sip-ua/nta/nta.c
+++ libsofia-sip-ua/nta/nta.c
@@ -7647,6 +7647,7 @@
   if (outgoing_is_queued(orq))
     outgoing_remove(orq);

+  assert(orq->orq_next == NULL);
   assert(*queue->q_tail == NULL);

   orq->orq_timeout = set_timeout(orq->orq_agent, queue->q_timeout);
@@ -7670,7 +7671,7 @@
   if ((*orq->orq_prev = orq->orq_next))
     orq->orq_next->orq_prev = orq->orq_prev;
   else
-    orq->orq_queue->q_tail = orq->orq_prev, assert(!*orq->orq_queue->q_tail);
+    orq->orq_queue->q_tail = orq->orq_prev;

   orq->orq_queue->q_length--;
   orq->orq_next = NULL;


renaming

renaming

--- libspmvm/src/spmvm_util.c
+++ libspmvm/src/spmvm_util.c
@@ -61,7 +61,7 @@
 	if(me==0){
 		int pin = (options & SPMVM_OPTION_PIN || options & SPMVM_OPTION_PIN_SMT)?
 			1:0;
-		char *pinStrategy = options & SPMVM_OPTION_PIN?"phys. cores":"all cores";
+		char *pinStrategy = options & SPMVM_OPTION_PIN?"phys. cores":"virt. cores";
 		ws = ((lcrp->nRows+1)*sizeof(int) +
 				lcrp->nEnts*(sizeof(data_t)+sizeof(int)))/(1024*1024);
 		printf("-----------------------------------------------\n");


buggix

buggix

--- libspmvm/src/spmvm_util.c
+++ libspmvm/src/spmvm_util.c
@@ -130,7 +130,7 @@
 		printf("MPI processes  per node          : %12d\n", nproc/nnodes);
 		printf("Physical cores per node          : %12d\n", nphyscores);
 		printf("HW threads     per node          : %12d\n", ncores);
-		printf("OpenMP threads per node          : %12d\n", nproc*nthreads);
+		printf("OpenMP threads per node          : %12d\n", nproc/nnodes*nthreads);
 		printf("OpenMP threads per process       : %12d\n", nthreads);
 #ifdef OPENCL
 		printf("OpenCL devices                   :\n");


fix compile issues

fix compile issues

--- libswfdec/swfdec_loader.c
+++ libswfdec/swfdec_loader.c
@@ -246,7 +246,7 @@
   SwfdecURL *url;

   g_return_val_if_fail (SWFDEC_IS_LOADER (loader), NULL);
-  g_return_val_if_fail (url != NULL, NULL);
+  g_return_val_if_fail (url_string != NULL, NULL);
   g_return_val_if_fail (data != NULL || data_len == 0, NULL);

   klass = SWFDEC_LOADER_GET_CLASS (loader);
@@ -422,7 +422,7 @@
 {
   const SwfdecURL *url;
   const char *path, *ext;
-  char *ret;
+  char *ret = NULL;

   g_return_val_if_fail (SWFDEC_IS_LOADER (loader), NULL);


allow changing the target

allow changing the target

Necessary for future changes

--- libswfdec/swfdec_loader.c
+++ libswfdec/swfdec_loader.c
@@ -192,8 +192,7 @@
 swfdec_loader_set_target (SwfdecLoader *loader, SwfdecLoaderTarget *target)
 {
   g_return_if_fail (SWFDEC_IS_LOADER (loader));
-  g_return_if_fail (loader->target == NULL || target == NULL);
-  g_return_if_fail (SWFDEC_IS_LOADER_TARGET (target));
+  g_return_if_fail (target == NULL || SWFDEC_IS_LOADER_TARGET (target));

   loader->target = target;
 }


iterate audio after video

iterate audio after video

--- libswfdec/swfdec_player.c
+++ libswfdec/swfdec_player.c
@@ -584,8 +584,6 @@

   g_object_freeze_notify (G_OBJECT (player));
   SWFDEC_INFO ("=== START ITERATION ===");
-  /* iterate audio before video so we don't iterate audio clips that get added this frame */
-  swfdec_player_iterate_audio (player);
   /* The handling of this list is rather tricky. This code assumes that no
    * movies get removed that haven't been iterated yet. This should not be a
    * problem without using Javascript, because the only way to remove movies
@@ -617,6 +615,9 @@
     if (klass->iterate_end)
       klass->iterate_end (walk->data);
   }
+  /* iterate audio after video so audio clips that get added during mouse
+   * events have the same behaviour than those added while iterating */
+  swfdec_player_iterate_audio (player);
   g_object_thaw_notify (G_OBJECT (player));
   swfdec_player_emit_invalidate (player);
 }


+ changed constructor so the number of hashbuckets is rounded upwards
to the nearest prime number.

+ fixed bug so table iteration methods work properly even if we are
removing items while iterating (previously, if we deleted any entry
other than the "current" one returned by the iterator, we might skip
entries in the table!)

--- src/condor_c++_util/HashTable.h
+++ src/condor_c++_util/HashTable.h
@@ -73,6 +73,8 @@
   int *chainsUsed;	// array which says which chains have items; speeds iterating
   int chainsUsedLen;	// index to end of chainsUsed array
   int numElems; // number of elements in the hashtable
+  int chainsUsedFreeList;	// head of free list of deleted items in chainsUsed
+  int endOfFreeList;
 };

 // Construct hash table. Allocate memory for hash table and
@@ -84,6 +86,32 @@
 					       int numBuckets)) :
 	tableSize(tableSz), hashfcn(hashF)
 {
+  int i,j,k;
+
+  // If tableSize is anything but tiny, round it up to
+  // the next prime number if a prime can be found within
+  // 35 of the specified size.  Using a prime for tableSize
+  // makes for faster lookups assuming the the hash func does
+  // a mod on tableSize.
+  if ( tableSize > 5 ) {
+	  for (i=tableSize;i<tableSize+35;i++) {
+			k = i / 2;	// should probably be square root...
+			j = 1;
+			while ( ++j < k ) {
+				// if ( (i / j)*j == i ) {
+				if ( (i % j) == 0 ) {
+					j = 0;
+					break;
+				}
+			}
+			if ( j ) {
+				// found a prime
+				tableSize = i;
+				break;
+			}
+	  }
+  }
+
   if (!(ht = new HashBucket<Index, Value>* [tableSize])) {
     cerr << "Insufficient memory for hash table" << endl;
     exit(1);
@@ -92,7 +120,7 @@
     cerr << "Insufficient memory for hash table (chainsUsed array)" << endl;
     exit(1);
   }
-  for(int i = 0; i < tableSize; i++) {
+  for(i = 0; i < tableSize; i++) {
     ht[i] = NULL;
 	chainsUsed[i] = -1;
   }
@@ -100,6 +128,8 @@
   currentItem = 0;
   chainsUsedLen = 0;
   numElems = 0;
+  endOfFreeList = 0 - tableSize - 10;
+  chainsUsedFreeList = endOfFreeList;
 }

 // Insert entry into hash table mapping Index to Value.
@@ -108,6 +138,7 @@
 template <class Index, class Value>
 int HashTable<Index,Value>::insert(const Index &index,const  Value &value)
 {
+  int temp;
   int idx = hashfcn(index, tableSize);

   HashBucket<Index, Value> *bucket;
@@ -121,7 +152,13 @@
   bucket->next = ht[idx];
   if ( !ht[idx] ) {
 	// this is the first item we are adding to this chain
-	chainsUsed[chainsUsedLen++] = idx;
+	if ( chainsUsedFreeList == endOfFreeList ) {
+		chainsUsed[chainsUsedLen++] = idx;
+	} else {
+		temp = chainsUsedFreeList + tableSize;
+		chainsUsedFreeList = chainsUsed[temp];
+		chainsUsed[temp] = idx;
+	}
   }
   ht[idx] = bucket;

@@ -271,7 +308,9 @@
 				// Remove this idx from our chainsUsed array.
 				for (i=0;i<chainsUsedLen;i++) {
 					if ( chainsUsed[i] == idx ) {
-						chainsUsed[i] = chainsUsed[--chainsUsedLen];
+						// chainsUsed[i] = chainsUsed[--chainsUsedLen];
+						chainsUsed[i] = chainsUsedFreeList;
+						chainsUsedFreeList = i - tableSize;
 						break;
 					}
 				}
@@ -307,6 +346,7 @@
   }

   chainsUsedLen = 0;
+  chainsUsedFreeList = endOfFreeList;

   return 0;
 }
@@ -315,8 +355,22 @@
 void HashTable<Index,Value>::
 startIterations (void)
 {
+	int temp, temp1;
+
     currentBucket = -1;
 	currentItem = 0;
+
+	// compress the chainsUsed list if needed
+	while ( chainsUsedFreeList != endOfFreeList ) {
+		temp = chainsUsedFreeList + tableSize;
+		chainsUsedFreeList = chainsUsed[temp];
+		temp1 = -1;
+		while ( temp < chainsUsedLen && temp1 < 0 ) {
+			temp1 = chainsUsed[--chainsUsedLen];
+		}
+		chainsUsed[temp] = temp1;
+	}
+
 }

@@ -338,9 +392,14 @@
     }

 	// try next bucket ...
-	currentBucket ++;
-
-	if (currentBucket == chainsUsedLen)
+	do {
+		currentBucket ++;
+	} while ( (currentBucket < chainsUsedLen) &&
+			  (chainsUsed[currentBucket] < 0) );
+
+	// must use >= here instead of == since chainsUsedLen could decrement
+	// if the user call remove()
+	if (currentBucket >= chainsUsedLen)
 	{
     	// end of hash table ... no more entries
     	currentBucket = -1;
@@ -385,9 +444,15 @@
     }

 	// try next bucket ...
-	currentBucket ++;
-
-	if (currentBucket == chainsUsedLen)
+	do {
+		currentBucket ++;
+	} while ( (currentBucket < chainsUsedLen) &&
+			  (chainsUsed[currentBucket] < 0) );
+
+
+	// must use >= here instead of == since chainsUsedLen could decrement
+	// if the user call remove()
+	if (currentBucket >= chainsUsedLen)
 	{
     	// end of hash table ... no more entries
     	currentBucket = -1;


libeditline: Restore tty setting on returning to shell

Fix issue #522.

Problem description:

When using libeditline, the tty setting is mangled when returning to
the shell due to a signal (SIGTERM, SIGHUP, ..., including ^C and ^Z).
This is normally hidden in Linux, in which the common shells take care
to restore the settings.

However, it still can be seen with (^C is the keyboard ^C):

$ stty -a>/tmp/a; sh -c 'trap : INT;link-parser'; stty -a>/tmp/b; dwdiff /tmp/a /tmp/b
link-grammar: Info: Dictionary found at ../en/4.0.dict
link-grammar: Info: Dictionary version 5.3.15, locale en_US.UTF-8
link-grammar: Info: Library version link-grammar-5.3.15. Enter "!help" for help.
linkparser> ^C speed 38400 baud; rows 70; columns 187; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = [-^D;-] {+<undef>;+} eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = [-^R;-] {+<undef>;+} werase = [-^W;-] {+<undef>;+} lnext = [-^V;-] {+<undef>;+} discard = ^O;
min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip [--inlcr-] {+inlcr+} -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig [-icanon iexten echo-] {+-icanon -iexten -echo+} echoe [-echok-] {+-echok+} -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc

Note the output of "dwdiff":
The tty setup before appears in [...], and after in {...}.

--- link-parser/lg_readline.c
+++ link-parser/lg_readline.c
@@ -68,6 +68,8 @@
 		el_source(el, NULL);       /* Source the user's defaults file. */
 		history_w(hist, &ev, H_LOAD, HFILE);

+		el_set(el, EL_SIGNAL, 1); /* Restore tty setting on returning to shell */
+
 		/* By default, it comes up in vi mode, with the editor not in
 		 * insert mode; and even when in insert mode, it drops back to
 		 * command mode at the drop of a hat. Totally confusing/lame. */


avoid using util_lib code in standalone checkpointing

error: pathspec 'src/condor_ckpt/fake_util_lib.c' did not match any file(s) known to git

--- src/condor_ckpt/fake_util_lib.c
+++ src/condor_ckpt/fake_util_lib.c
@@ -0,0 +1,52 @@
+/*
+** Copyright 1998 by the Condor Team
+**
+** Permission to use, copy, modify, and distribute this software and its
+** documentation for any purpose and without fee is hereby granted,
+** provided that the above copyright notice appear in all copies and that
+** both that copyright notice and this permission notice appear in
+** supporting documentation, and that the names of the University of
+** Wisconsin and the Condor Design Team not be used in advertising or
+** publicity pertaining to distribution of the software without specific,
+** written prior permission.  The University of Wisconsin and the Condor
+** Design Team make no representations about the suitability of this
+** software for any purpose.  It is provided "as is" without express
+** or implied warranty.
+**
+** THE UNIVERSITY OF WISCONSIN AND THE CONDOR DESIGN TEAM DISCLAIM ALL
+** WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+** OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE UNIVERSITY OF
+** WISCONSIN OR THE CONDOR DESIGN TEAM BE LIABLE FOR ANY SPECIAL, INDIRECT
+** OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+** OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+** OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
+** OR PERFORMANCE OF THIS SOFTWARE.
+**
+** Authors:  Jim Basney
+** 	         University of Wisconsin, Computer Sciences Dept.
+**
+*/
+
+/* Avoid linking with util lib functions for standalone checkpointing. */
+
+
+#include "condor_common.h"
+#include <varargs.h>
+
+int		_EXCEPT_Line;
+int		_EXCEPT_Errno;
+char	*_EXCEPT_File;
+int		(*_EXCEPT_Cleanup)();
+
+void
+dprintf(va_alist)
+va_dcl
+{
+}
+
+void
+_EXCEPT_(va_alist)
+va_dcl
+{
+	abort();
+}


link-parser: Avoid duplicate history entries

--- link-parser/lg_readline.c
+++ link-parser/lg_readline.c
@@ -95,6 +95,7 @@
 		hist = history_winit();    /* Init built-in history */
 		el = el_init("link-parser", stdin, stdout, stderr);
 		history_w(hist, &ev, H_SETSIZE, 20);   /* Remember 20 events */
+		history_w(hist, &ev, H_SETUNIQUE, 1);
 		el_wset(el, EL_HIST, history_w, hist);
 		history_w(hist, &ev, H_LOAD, HFILE);


Make more members of InsetOrderOptimizer class const.

--- src/InsetOrderOptimizer.h
+++ src/InsetOrderOptimizer.h
@@ -45,9 +45,9 @@
     const int extruder_nr;
     const PathConfigStorage::MeshPathConfigs& mesh_config;
     const SliceLayerPart& part;
-    unsigned int layer_nr;
-    EZSeamType z_seam_type;
-    Point z_seam_pos;
+    const unsigned int layer_nr;
+    const EZSeamType z_seam_type;
+    const Point z_seam_pos;
     bool added_something;
     std::vector<std::vector<ConstPolygonRef>> inset_polys; // vector of vectors holding the inset polygons


Better handling of overlapping exons

Better handling of overlapping exons

--- src/core/AgnInferExonsVisitor.c
+++ src/core/AgnInferExonsVisitor.c
@@ -71,6 +71,11 @@
  */
 static void visit_gene_infer_introns(AgnInferExonsVisitor *v);

+
+/**
+ * @function Check each mRNA to ensure none of its exons overlap.
+ */
+static void visit_mrna_check_overlap(AgnInferExonsVisitor *v);

 //----------------------------------------------------------------------------//
 // Method implementations
@@ -170,7 +175,7 @@
   gt_array_delete(exons);
   gt_array_delete(introns);
   gt_genome_node_delete(gn);
-
+
   agn_logger_delete(logger);
   gt_node_stream_delete(ievstream);
   gt_array_delete(genes);
@@ -313,7 +318,7 @@
   gt_array_delete(exons);
   gt_array_delete(introns);
   gt_genome_node_delete(gn);
-
+
   agn_logger_delete(logger);
   gt_node_stream_delete(ievstream);
   gt_array_delete(genes);
@@ -336,9 +341,10 @@
   {
     if(!agn_gt_feature_node_is_gene_feature(current))
       continue;
-
+
     GtUword i;
     v->gene = current;
+    visit_mrna_check_overlap(v);

     v->exonsbyrange = gt_interval_tree_new(NULL);
     v->exons = agn_gt_feature_node_children_of_type(current,
@@ -527,7 +533,7 @@
       GtGenomeNode **exon2 = gt_array_get(exons, i);
       GtRange first_range  = gt_genome_node_get_range(*exon1);
       GtRange second_range = gt_genome_node_get_range(*exon2);
-
+
       if(first_range.end == second_range.start - 1)
       {
         agn_logger_log_error(v->logger, "mRNA '%s' (line %u) has directly "
@@ -540,7 +546,7 @@
         gt_array_add(introns_to_add, irange);
       }
     }
-
+
     for(i = 0; i < gt_array_size(introns_to_add); i++)
     {
       GtRange *irange = gt_array_get(introns_to_add, i);
@@ -569,3 +575,40 @@
   }
   gt_feature_node_iterator_delete(iter);
 }
+
+static void visit_mrna_check_overlap(AgnInferExonsVisitor *v)
+{
+  GtArray *mrnas = agn_gt_feature_node_children_of_type(v->gene,
+                                           agn_gt_feature_node_is_mrna_feature);
+  while(gt_array_size(mrnas) > 0)
+  {
+    GtGenomeNode **mrna = gt_array_pop(mrnas);
+    GtFeatureNode *mrnafn = gt_feature_node_cast(*mrna);
+    GtArray *exons = agn_gt_feature_node_children_of_type(mrnafn,
+                                           agn_gt_feature_node_is_exon_feature);
+    GtUword i,j;
+    for(i = 0; i < gt_array_size(exons); i++)
+    {
+      GtGenomeNode **gni = gt_array_get(exons, i);
+      GtRange rangei = gt_genome_node_get_range(*gni);
+      for(j = i + 1; j < gt_array_size(exons); j++)
+      {
+        GtGenomeNode **gnj = gt_array_get(exons, j);
+        GtRange rangej = gt_genome_node_get_range(*gnj);
+        if(gt_range_overlap(&rangei, &rangej))
+        {
+          GtStr *seqid = gt_genome_node_get_seqid(*mrna);
+          GtRange mrnarange = gt_genome_node_get_range(*mrna);
+          fprintf(stderr, "error: mRNA %s:%lu-%lu has overlapping exons",
+                  gt_str_get(seqid), mrnarange.start, mrnarange.end);
+          exit(1);
+        }
+      }
+    }
+
+    gt_array_delete(exons);
+  }
+
+  gt_array_delete(mrnas);
+}
+


branches/innodb+: row_purge_remove_sec_if_poss_low(): If the index entry does not exist, return TRUE without retrying unbuffered operation (which should notice the same).

--- row/row0purge.c
+++ row/row0purge.c
@@ -401,7 +401,11 @@

 	switch (search_result) {
 	case ROW_NOT_FOUND:
+		/* Index entry does not exist, nothing to do. */
+		return(TRUE);
 	case ROW_FOUND:
+		/* The index entry exists and is in the buffer pool;
+		no need to use the insert/delete buffer. */
 		break;

 	case ROW_BUFFERED:


style(decompression): fix whitespace

style(decompression): fix whitespace

--- includes/acl/decompression/impl/transform_animated_track_cache.h
+++ includes/acl/decompression/impl/transform_animated_track_cache.h
@@ -1819,7 +1819,7 @@
 				rtm::vector4f* cache_ptr_floor = &translations.cached_samples[static_cast<int>(sample_rounding_policy::floor)][cache_write_index];
 				rtm::vector4f* cache_ptr_ceil = &translations.cached_samples[static_cast<int>(sample_rounding_policy::ceil)][cache_write_index];
 				rtm::vector4f* cache_ptr_nearest = &translations.cached_samples[static_cast<int>(sample_rounding_policy::nearest)][cache_write_index];
-
+
 				for (uint32_t unpack_index = 0; unpack_index < num_to_unpack; ++unpack_index)
 				{
 					const rtm::vector4f sample0 = scratch0[unpack_index];


style(decompression): use constexpr function directly

--- includes/acl/decompression/impl/transform_animated_track_cache.h
+++ includes/acl/decompression/impl/transform_animated_track_cache.h
@@ -1568,8 +1568,7 @@

 							// Due to the interpolation, the result might not be anywhere near normalized!
 							// Make sure to normalize afterwards if we need to
-							constexpr bool normalize_rotations = decompression_settings_type::normalize_rotations();
-							if (normalize_rotations)
+							if (decompression_settings_type::normalize_rotations())
 								quat_normalize4(interp_xxxx, interp_yyyy, interp_zzzz, interp_wwww);

 #if !defined(ACL_IMPL_PREFETCH_EARLY)
@@ -1622,8 +1621,7 @@

 							// Due to the interpolation, the result might not be anywhere near normalized!
 							// Make sure to normalize afterwards if we need to
-							constexpr bool normalize_rotations = decompression_settings_type::normalize_rotations();
-							if (normalize_rotations)
+							if (decompression_settings_type::normalize_rotations())
 								quat_normalize4(interp_xxxx, interp_yyyy, interp_zzzz, interp_wwww);
 						}
 						else
@@ -1751,8 +1749,7 @@
 				{
 					// Due to the interpolation, the result might not be anywhere near normalized!
 					// Make sure to normalize afterwards before using
-					constexpr bool normalize_rotations = decompression_settings_type::normalize_rotations();
-					if (normalize_rotations)
+					if (decompression_settings_type::normalize_rotations())
 						result = rtm::quat_lerp(sample0, sample1, interpolation_alpha);
 					else
 						result = quat_lerp_no_normalization(sample0, sample1, interpolation_alpha);


fix C++ wrapper

fix C++ wrapper

--- src/core/lib/profiling/timers.h
+++ src/core/lib/profiling/timers.h
@@ -92,18 +92,20 @@
 namespace grpc {
 class ProfileScope {
  public:
-  ProfileScope(const char *desc, bool important) : desc_(desc) {
-    GPR_TIMER_BEGIN(desc_, important ? 1 : 0);
+  ProfileScope(const char *desc, bool important, const char *file, int line)
+      : desc_(desc) {
+    gpr_timer_begin((desc_, important ? 1 : 0, file, line);
   }
-  ~ProfileScope() { GPR_TIMER_END(desc_, 0); }
+  ~ProfileScope() { gpr_timer_end(desc_, 0, "n/a", 0); }

  private:
   const char *const desc_;
 };
 }  // namespace grpc

-#define GPR_TIMER_SCOPE(tag, important) \
-  ::grpc::ProfileScope _profile_scope_##__LINE__((tag), (important))
+#define GPR_TIMER_SCOPE(tag, important)                                        \
+  ::grpc::ProfileScope _profile_scope_##__LINE__((tag), (important), __FILE__, \
+                                                 __LINE__)
 #else
 #define GPR_TIMER_SCOPE(tag, important) \
   do {                                  \


rewrite StringTools. The new algorithm appears to be much faster.

--- src/cpp/auxiliary/StringTools.h
+++ src/cpp/auxiliary/StringTools.h
@@ -1,16 +1,16 @@
 /*
  * StringTools.h
  *
- *  Created on: 11.02.2013
- *      Author: Christian Staudt (christian.staudt@kit.edu)
+ *  Completely rewritten on: 12.05.2014
+ *      Author: Florian Weber (uagws@student.kit.edu)
  */

 #ifndef STRINGTOOLS_H_
 #define STRINGTOOLS_H_

+#include <algorithm>
 #include <vector>
 #include <string>
-#include <sstream>

 namespace Aux {

@@ -20,20 +20,40 @@
 namespace StringTools {

 /**
+ * Splits a range of characters at a delimiter into a vector of strings.
+ *
+ * Requirements:
+ *   Character must be equality-comparable to char and it must be possible to construct a char from
+ *   any Character.
+ *   Iterator must be an input-iterator over Characters.
+ */
+template<typename Iterator, typename Character>
+std::vector<std::string> split(Iterator begin, Iterator end, Character delim = Character{' '}) {
+
+	// measurements showed that precalculating the number of tokens and
+	// reserving space for them was in fact slower than just letting
+	// the vector grow naturally.
+	std::vector<std::string> tokens;
+
+	auto it = begin;
+	while (it != end) {
+		auto tmp = std::find(it, end, delim);
+		tokens.emplace_back(it, tmp);
+		if (tmp == end) {
+			break;
+		}
+		it = tmp;
+		++it;
+
+	}
+	return tokens;
+}
+
+/**
  * Split a string at delimiter and return vector of parts.
- *
  */
 inline std::vector<std::string> split(const std::string& s, char delim = ' ') {
-	std::stringstream stream(s);
-	std::string token;
-	std::vector<std::string> tokens;
-
-	// split string and push adjacent nodes
-	while (std::getline(stream, token, delim)) {
-		tokens.push_back(token);
-	}
-
-	return tokens;
+	return split(s.begin(), s.end(), delim);
 }

 } /* namespace StringTools */


fix init in SIOWriter.h

fix init in SIOWriter.h

--- src/cpp/include/SIO/SIOWriter.h
+++ src/cpp/include/SIO/SIOWriter.h
@@ -130,15 +130,11 @@

     SIOEventHandler *_hdrHandler ;
     SIORunHeaderHandler *_runHandler ;
-    std::vector<SIO_block*> _connectedBlocks ;
+    std::vector<SIO_block*> _connectedBlocks{} ;

   protected:

-//     SIO_record *_evtRecord ;
-//     SIO_record *_hdrRecord ;
-//     SIO_record *_runRecord ;
-
-    LCIORandomAccessMgr _raMgr ;
+    LCIORandomAccessMgr _raMgr{} ;

   }; // class


Fix RLOC Probing with IPv6 EIDs

Fix RLOC Probing with IPv6 EIDs

--- lispd/lispd_map_request.c
+++ lispd/lispd_map_request.c
@@ -139,6 +139,14 @@
         syslog(LOG_DAEMON, "(build_map_request_pkt): Unable to find valid physical interface\n");
         return (0);
     }
+
+    if (!encap) {
+        if ((my_addr = get_my_addr(ctrl_iface->iface_name, dest->afi)) == 0) {
+            syslog(LOG_DAEMON,"can't find suitable source address (%s,%d)",
+                   ctrl_iface->iface_name, dest->afi);
+            return(0);
+        }
+    } else {

   //Pranathi : my_addr -> This is for the source address in the inner header of the encapsulated Map-request msg
   // For v4eid over v4 rloc , Inner header: v4 src rloc , v4 dest eid
@@ -201,7 +209,7 @@
  return(0);

 }
-
+}


Xivu : Correct board_check_extpower function.

This patch modify that initial variable extpower_present, make
gpio_ec_acok_otg setting normally.

BUG=none
BRANCH=none
TEST=test on nivviks, check gpio_ec_acok_otg setting normally.

Signed-off-by: Logan_Liao <38e5e1ec23749ef11e154723cfdd2acf0fcc9df3@compal.corp-partner.google.com>
Change-Id: I94995e494fe5b038c1a88c5d5193708ae085dfca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3789204
Commit-Queue: Logan Liao <3e686fbe841e7f552391c104b5d07238268768cb@compal.corp-partner.google.com>
Tested-by: Logan Liao <3e686fbe841e7f552391c104b5d07238268768cb@compal.corp-partner.google.com>
Reviewed-by: Logan Liao <3e686fbe841e7f552391c104b5d07238268768cb@compal.corp-partner.google.com>
Reviewed-by: Elmo Lan <585f3d3f9d0e2b3e279164f824d1eb34f79f0b80@compal.corp-partner.google.com>
Reviewed-by: Andrew McRae <44ad1424cfc8411c96d9181798ca41ae55709dfb@google.com>

--- zephyr/projects/nissa/xivu/src/charger.c
+++ zephyr/projects/nissa/xivu/src/charger.c
@@ -36,8 +36,8 @@
  */
 __override void board_check_extpower(void)
 {
-	int extpower_present_p0;
-	int extpower_present_p1;
+	int extpower_present_p0 = 0;
+	int extpower_present_p1 = 0;

 	if (pd_is_connected(0))
 		extpower_present_p0 = extpower_is_present();


fixed: bug in convertMatchesToGlobal

fixed: bug in convertMatchesToGlobal

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

--- seqan/projects/library/seqan/store/store_all.h
+++ seqan/projects/library/seqan/store/store_all.h
@@ -811,7 +811,7 @@
 			firstOverlap = it;
 			lastContigId = (*it).contigId;
 		} else
-			while (firstOverlap != itEnd && _max((*firstOverlap).beginPos, (*firstOverlap).endPos) <= cBegin)
+			while (firstOverlap != it && _max((*firstOverlap).beginPos, (*firstOverlap).endPos) <= cBegin)
 				++firstOverlap;

 		// 3. Iterate over alignment


GRN_OUTPUT_UINT32: add an internal macro

--- lib/grn_output.h
+++ lib/grn_output.h
@@ -1,7 +1,7 @@
 /* -*- c-basic-offset: 2 -*- */
 /*
-  Copyright(C) 2010-2018 Brazil
-  Copyright(C) 2020 Sutou Kouhei <kou@clear-code.com>
+  Copyright(C) 2010-2018  Brazil
+  Copyright(C) 2020-2021  Sutou Kouhei <kou@clear-code.com>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -87,6 +87,8 @@
   (grn_ctx_output_int32(ctx, value))
 #define GRN_OUTPUT_INT64(value) \
   (grn_ctx_output_int64(ctx, value))
+#define GRN_OUTPUT_UINT32(value) \
+  (grn_ctx_output_uint32(ctx, value))
 #define GRN_OUTPUT_UINT64(value) \
   (grn_ctx_output_uint64(ctx, value))
 #define GRN_OUTPUT_FLOAT(value) \


Define COND_BROADCAST (Thanks to t2001).

--- lib/groonga_in.h
+++ lib/groonga_in.h
@@ -277,6 +277,7 @@
 #define COND_INIT(c)   pthread_cond_init(&c, NULL)
 #define COND_SIGNAL(c) pthread_cond_signal(&c)
 #define COND_WAIT(c,m) pthread_cond_wait(&c, &m)
+#define COND_BROADCAST(c) pthread_cond_broadcast(&c)
 #define COND_INIT_SHARED(c) do {\
   pthread_condattr_t condattr;\
   pthread_condattr_init(&condattr);\
@@ -354,12 +355,14 @@
   HANDLE waiters_count_lock_;
   HANDLE sema_;
   HANDLE waiters_done_;
+  size_t was_broadcast_;
 } grn_cond;

 #define COND_INIT(c) do { \
   (c).waiters_count_ = 0; \
   (c).sema_ = CreateSemaphore(NULL, 0, 0x7fffffff, NULL); \
   MUTEX_INIT((c).waiters_count_lock_); \
+  (c).waiters_done_ = CreateEvent(NULL, FALSE, FALSE, NULL);\
 } while (0)

 #define COND_SIGNAL(c) do { \
@@ -373,6 +376,27 @@
   } \
 } while (0)

+#define COND_BROADCAST(c) do { \
+  MUTEX_LOCK((c).waiters_count_lock_); \
+  { \
+    int have_waiters = (c).waiters_count_ > 0; \
+    if ((c).waiters_count_ > 0) {  \
+      (c).was_broadcast_ = 1; \
+      have_waiters = 1; \
+    } \
+    if (have_waiters) {\
+      ReleaseSemaphore((c).sema_, (c).waiters_count_, 0); \
+      MUTEX_UNLOCK((c).waiters_count_lock_); \
+      WaitForSingleObject((c).waiters_done_, INFINITE); \
+      (c).was_broadcast_ = 0; \
+    } \
+    else { \
+      MUTEX_UNLOCK((c).waiters_count_lock_); \
+    }\
+  }\
+} while (0)
+
+
 #define COND_WAIT(c,m) do { \
   MUTEX_LOCK((c).waiters_count_lock_); \
   (c).waiters_count_++; \
@@ -380,8 +404,16 @@
   SignalObjectAndWait((m), (c).sema_, INFINITE, FALSE); \
   MUTEX_LOCK((c).waiters_count_lock_); \
   (c).waiters_count_--; \
-  MUTEX_UNLOCK((c).waiters_count_lock_); \
-  WaitForSingleObject((m), INFINITE); \
+  { \
+    int last_waiter = (c).was_broadcast_ && (c).waiters_count_ == 0; \
+    MUTEX_UNLOCK((c).waiters_count_lock_); \
+    if (last_waiter)  { \
+      SignalObjectAndWait((c).waiters_done_, (m), INFINITE, FALSE); \
+    } \
+    else { \
+      WaitForSingleObject((m), FALSE); \
+    }\
+  }\
 } while (0)

 #else /* WIN32 */


recv_init_crash_recovery(): remove trailing white space

--- log/log0recv.c
+++ log/log0recv.c
@@ -115,7 +115,7 @@
 Initialize crash recovery environment. Can be called iff
 recv_needed_recovery == FALSE. */
 static
-void
+void
 recv_init_crash_recovery(void);
 /*===========================*/

@@ -2450,7 +2450,7 @@
 recv_init_crash_recovery(void)
 /*==========================*/
 {
-	ut_a(!recv_needed_recovery);
+	ut_a(!recv_needed_recovery);

 	recv_needed_recovery = TRUE;

@@ -2481,7 +2481,6 @@
 			"InnoDB: buffer...\n");
 		trx_sys_doublewrite_init_or_restore_pages(TRUE);
 	}
-
 }

 /************************************************************
@@ -2805,7 +2804,7 @@
 	recv_synchronize_groups(up_to_date_group);

 	if (!recv_needed_recovery) {
-		ut_a(ut_dulint_cmp(checkpoint_lsn,
+		ut_a(ut_dulint_cmp(checkpoint_lsn,
 				   recv_sys->recovered_lsn) == 0);

 	} else {


added option to save hashes in cowpatty format

--- wlangenpmk.c
+++ wlangenpmk.c
@@ -13,6 +13,19 @@
 #include <openssl/evp.h>
 #include "common.h"

+#define COWPATTY_SIGNATURE 0x43575041L
+
+struct cow_head
+{
+ uint32_t magic;
+ uint8_t reserved1[3];
+ uint8_t essidlen;
+ uint8_t essid[32];
+};
+typedef struct cow_head cow_head_t;
+#define	COWHEAD_SIZE (sizeof(cow_head_t))
+
+
 /*===========================================================================*/
 /* globale Variablen */

@@ -63,18 +76,35 @@
 return len;
 }
 /*===========================================================================*/
-void filepmkout(FILE *pwlist, FILE *fhascii,  FILE *fhasciipw, char *essidname, int essidlen)
+void filepmkout(FILE *pwlist, FILE *fhascii,  FILE *fhasciipw, FILE *fhcow, char *essidname, uint8_t essidlen)
 {
 int pwlen;
 int c;
+int cr;
+cow_head_t cow;
+uint8_t cowreclen = 0;
 long int pmkcount = 0;
 long int skippedcount = 0;
 unsigned char salt[64];
 char password[64];
 unsigned char pmk[64];
+
+
+signal(SIGINT, programmende);
 memcpy(&salt, essidname, essidlen);
-
-signal(SIGINT, programmende);
+if((fhcow != NULL) && (essidname != NULL))
+	{
+	memset(&cow, 0, COWHEAD_SIZE);
+	cow.magic = COWPATTY_SIGNATURE;
+	memcpy(cow.essid, essidname, essidlen);
+	cow.essidlen = essidlen;
+	cr = fwrite(&cow, COWHEAD_SIZE, 1, fhcow);
+	if(cr != 1)
+		{
+		fprintf(stderr, "error writing cowpatty file\n");
+		exit(EXIT_FAILURE);
+		}
+	}

 while((progende != TRUE) && ((pwlen = fgetline(pwlist, 64, password)) != -1))
 	{
@@ -86,6 +116,23 @@

 	if( PKCS5_PBKDF2_HMAC_SHA1(password, pwlen, salt, essidlen, 4096, 32, pmk) != 0 )
 		{
+		cowreclen = sizeof(cowreclen) + pwlen + 32;
+		if(fhcow != NULL)
+			{
+			cr = fwrite(&cowreclen, sizeof(cowreclen), 1, fhcow);
+			if(cr != 1)
+				{
+				fprintf(stderr, "error writing cowpatty file\n");
+				exit(EXIT_FAILURE);
+				}
+			fprintf(fhcow, "%s", password);
+			cr = fwrite(&pmk, sizeof(uint8_t), 32, fhcow);
+			if(cr != 32)
+				{
+				fprintf(stderr, "error writing cowpatty file\n");
+				exit(EXIT_FAILURE);
+				}
+			}
 		for(c = 0; c< 32; c++)
 			{
 			if(fhascii != NULL)
@@ -148,6 +195,7 @@
 	"-i <file>     : input passwordlist\n"
 	"-a <file>     : output plainmasterkeys as ASCII file (hashcat -m 2501)\n"
 	"-A <file>     : output plainmasterkeys:password as ASCII file\n"
+	"-c <file>     : output cowpatty hashfile (existing file will be replaced)\n"
 	"-h            : this help\n"
 	"\n", eigenname, VERSION, VERSION_JAHR, eigenname);
 exit(EXIT_FAILURE);
@@ -158,21 +206,24 @@
 FILE *fhpwlist = NULL;
 FILE *fhascii = NULL;
 FILE *fhasciipw = NULL;
+FILE *fhcow = NULL;
 int auswahl;

 int pwlen = 0;
-int essidlen = 0;
+uint8_t essidlen = 0;

 char *eigenname = NULL;
 char *eigenpfadname = NULL;
 char *pwname = NULL;
 char *essidname = NULL;

+
+
 eigenpfadname = strdupa(argv[0]);
 eigenname = basename(eigenpfadname);

 setbuf(stdout, NULL);
-while ((auswahl = getopt(argc, argv, "p:e:i:a:A:h")) != -1)
+while ((auswahl = getopt(argc, argv, "p:e:i:a:A:c:h")) != -1)
 	{
 	switch (auswahl)
 		{
@@ -220,6 +271,14 @@
 			}
 		break;

+		case 'c':
+		if((fhcow = fopen(optarg, "w")) == NULL)
+			{
+			fprintf(stderr, "error opening %s\n", optarg);
+			exit(EXIT_FAILURE);
+			}
+		break;
+
 		case 'h':
 		usage(eigenname);
 		break;
@@ -230,13 +289,11 @@
 		}
 	}

-
 if((essidname != NULL) && (pwname != NULL))
 	singlepmkout(pwname, pwlen, essidname, essidlen);

-
 else if(essidname != NULL)
-	filepmkout(fhpwlist, fhascii, fhasciipw, essidname, essidlen);
+	filepmkout(fhpwlist, fhascii, fhasciipw, fhcow, essidname, essidlen);


fixed drawing wrong tiled on diffrent images

--- src/SSL/files/SSL_Tiled.c
+++ src/SSL/files/SSL_Tiled.c
@@ -104,6 +104,8 @@
 	layer->opacity = atoi(mxmlElementGetAttr(node, "opacity"));

 	layer->visible = 1;
+
+//	layer->visible = 1;

 	mxml_node_t *data;
 	data = mxmlFindElement(node, node, "data", NULL, NULL, MXML_DESCEND);
@@ -245,7 +247,7 @@
 						 int frame = 1;

 						 if (k != 1) {
-							 frame = tiles[map->map.map_width * j + i] - tileset->firstGid;
+							 frame = tiles[map->map.map_width * j + i] - (tileset->firstGid + 1);
 						 } else {
 							 frame = tiles[map->map.map_width * j + i];
 						 }


Plug a memory leak

Plug a memory leak

When the key is already present in the hash table the values
are not inserted to the hash table therefore they are not
freed when the hash table is destroyed.

Addressing:
6 bytes in 1 blocks are definitely lost in loss record 2 of 234
   at 0x483A809: malloc (vg_replace_malloc.c:307)
   by 0x489F5DB: oscap_vsprintf (util.c:146)
   by 0x489F6DD: oscap_sprintf (util.c:160)
   by 0x4921E77: _xccdf_session_export_oval_result_file (xccdf_session.c:1493)
   by 0x492209E: _build_oval_result_sources (xccdf_session.c:1538)
   by 0x492210F: xccdf_session_export_oval (xccdf_session.c:1552)
   by 0x410F77: app_evaluate_xccdf (oscap-xccdf.c:592)
   by 0x40FFF8: oscap_module_call (oscap-tool.c:292)
   by 0x4104C5: oscap_module_process (oscap-tool.c:382)
   by 0x4130A9: main (oscap.c:88)

45 bytes in 1 blocks are definitely lost in loss record 124 of 234
   at 0x483A809: malloc (vg_replace_malloc.c:307)
   by 0x52262DE: strdup (in /usr/lib64/libc-2.31.so)
   by 0x491E383: oscap_strdup (util.h:312)
   by 0x4921E97: _xccdf_session_export_oval_result_file (xccdf_session.c:1495)
   by 0x492209E: _build_oval_result_sources (xccdf_session.c:1538)
   by 0x492210F: xccdf_session_export_oval (xccdf_session.c:1552)
   by 0x410F77: app_evaluate_xccdf (oscap-xccdf.c:592)
   by 0x40FFF8: oscap_module_call (oscap-tool.c:292)
   by 0x4104C5: oscap_module_process (oscap-tool.c:382)
   by 0x4130A9: main (oscap.c:88)

--- src/XCCDF/xccdf_session.c
+++ src/XCCDF/xccdf_session.c
@@ -1493,8 +1493,12 @@
 	char *report_id = oscap_sprintf("oval%d", counter++);
 	const char *original_name = oval_agent_get_filename(oval_session);
 	char *results_file_name = oscap_strdup(name);
-	oscap_htable_add(session->oval.results_mapping, original_name, results_file_name);
-	oscap_htable_add(session->oval.arf_report_mapping, original_name, report_id);
+	if (!oscap_htable_add(session->oval.results_mapping, original_name, results_file_name)){
+		free(results_file_name);
+	}
+	if (!oscap_htable_add(session->oval.arf_report_mapping, original_name, report_id)) {
+		free(report_id);
+	};

 	/* validate OVAL Results */
 	if (session->validate && session->full_validation) {


Make sure to clean up old state before starting anew

--- src/adiskd/search_state.c
+++ src/adiskd/search_state.c
@@ -393,6 +393,12 @@
 		break;

 	case DEV_SPEC:
+		/* clean up any search state from a previous run */
+		if (sstate->fdata) {
+		    ceval_stop(sstate->fdata);
+		    fexec_term_search(sstate->fdata);
+		}
+
 		err = fexec_load_spec(&sstate->fdata, &cmd->sig);
 		if (err) {
 			/*


socket_pcap: Don't match first fragment when matching ipv4fragments is on.

The first fragment carries transport layer information and should be matched
by the user specified filter. The extra filter for fragments must only match
additional fragments, ie those with a fragment offset.

The old fragment filter matched any fragmented packet, thereby overriding
the user specified filter.

--- src/modules/socket/pcap/socket_pcap.h
+++ src/modules/socket/pcap/socket_pcap.h
@@ -106,7 +106,7 @@

 /*IPv4 filter*/
-#define BPF_DEFRAGMENTION_FILTER_IPV4 "(ip[6:2] & 0x3fff != 0)"
+#define BPF_DEFRAGMENTION_FILTER_IPV4 "(ip[6:2] & 0x1fff != 0)"
 /*IPv6 filter*/
 #define BPF_DEFRAGMENTION_FILTER_IPV6 "(ip6[6]=44 and (ip6[42:2] & 0xfff8 != 0))"


fixed loc_idx for tzsp

fixed loc_idx for tzsp

--- src/modules/socket/tzsp/socket_tzsp.c
+++ src/modules/socket/tzsp/socket_tzsp.c
@@ -160,7 +160,7 @@
     int action_idx = 0;
     struct run_act_ctx ctx;
     struct sockaddr_in *cliaddr;
-    uint8_t loc_idx;
+    uint8_t loc_idx = 0;

     if (nread <= 0 || addr == NULL)
     {
@@ -172,7 +172,8 @@
     	return;
     }

-    loc_idx = *((uint8_t *) handle->data);
+    //loc_idx = *((uint8_t *) handle->data);
+    //loc_idx = 0;

     gettimeofday(&tv, NULL);

@@ -287,6 +288,7 @@
 	        return 2;
 	}

+
 	udp_servers[loc_idx].data = (void *) &loc_idx;

 	status = uv_udp_recv_start(&udp_servers[loc_idx], on_alloc, on_recv);


Fix compile error: rename field in rc_channels.h

--- src/modules/uORB/topics/rc_channels.h
+++ src/modules/uORB/topics/rc_channels.h
@@ -56,7 +56,7 @@
 	RETURN,
 	POSCTL,
 	LOITER,
-	OFFBOARD_MODE,
+	OFFBOARD,
 	ACRO,
 	FLAPS,
 	AUX_1,


src/libFLAC/stream_decoder.c : Fail safely to avoid a heap overflow.

This fix is closely related to the fix for CVE-2014-9028. When that
fix went public Miroslav Lichvar noticed a similar potential problem
spot in the same function and was able to craft a file to trigger a
heap write overflow.

Reported-by : Miroslav Lichvar <mlichvar@redhat.com>

--- src/libFLAC/stream_decoder.c
+++ src/libFLAC/stream_decoder.c
@@ -2744,7 +2744,8 @@
 		if(partition_samples < predictor_order) {
 			send_error_to_client_(decoder, FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC);
 			decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC;
-			return true;
+			/* We have received a potentially malicious bit stream. All we can do is error out to avoid a heap overflow. */
+			return false;
 		}
 	}


virsh: Fix comment of vshCmdInfo

virsh: Fix comment of vshCmdInfo

The original comment of vshCmdInfo:
"name" - command name

Actually it's 'help' and the short description
of command, not the command name.

Signed-off-by: Li Yang <238d8cde7f155cab998fb7d3bca21ace45b10710@cn.fujitsu.com>

--- tools/virsh.h
+++ tools/virsh.h
@@ -154,7 +154,7 @@
  * vshCmdInfo -- name/value pair for information about command
  *
  * Commands should have at least the following names:
- * "name" - command name
+ * "help" - short description of command
  * "desc" - description of command, or empty string
  */
 struct _vshCmdInfo {


correct color names in header for level coloring

--HG--
extra : convert_revision : e9d9dcdea4958f53fec3636401b9820af69d7c3b

--- src/logger.c
+++ src/logger.c
@@ -94,10 +94,10 @@
   { "\x1B[0;37;40m", "\x1B[0m" }, /* Prefix color string for level "UNKNOWN" == 0 -> LOGGER_BG_BLACK,   LOGGER_FG_WHITE, LOGGER_ATTR_RESET */
   { "\x1B[0;37;40m", "\x1B[0m" }, /* Prefix color string for level "DEBUG"   == 1 -> LOGGER_BG_BLACK,   LOGGER_FG_WHITE, LOGGER_ATTR_RESET */
   { "\x1B[0;30;47m", "\x1B[0m" }, /* Prefix color string for level "INFO"    == 2 -> LOGGER_BG_WHITE,   LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
-  { "\x1B[0;30;44m", "\x1B[0m" }, /* Prefix color string for level "NOTICE"  == 3 -> LOGGER_BG_GREEN,   LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
-  { "\x1B[0;30;46m", "\x1B[0m" }, /* Prefix color string for level "WARNING" == 4 -> LOGGER_BG_YELLOW,  LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
-  { "\x1B[0;30;42m", "\x1B[0m" }, /* Prefix color string for level "ERR"     == 5 -> LOGGER_BG_CYAN,    LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
-  { "\x1B[0;30;43m", "\x1B[0m" }, /* Prefix color string for level "CRIT"    == 6 -> LOGGER_BG_BLUE,    LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
+  { "\x1B[0;30;44m", "\x1B[0m" }, /* Prefix color string for level "NOTICE"  == 3 -> LOGGER_BG_BLUE,    LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
+  { "\x1B[0;30;46m", "\x1B[0m" }, /* Prefix color string for level "WARNING" == 4 -> LOGGER_BG_CYAN,    LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
+  { "\x1B[0;30;42m", "\x1B[0m" }, /* Prefix color string for level "ERR"     == 5 -> LOGGER_BG_GREEN,   LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
+  { "\x1B[0;30;43m", "\x1B[0m" }, /* Prefix color string for level "CRIT"    == 6 -> LOGGER_BG_YELLOW,  LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
   { "\x1B[0;30;45m", "\x1B[0m" }, /* Prefix color string for level "ALERT"   == 7 -> LOGGER_BG_MAGENTA, LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
   { "\x1B[0;30;41m", "\x1B[0m" }  /* Prefix color string for level "EMERG"   == 8 -> LOGGER_BG_RED,     LOGGER_FG_BLACK, LOGGER_ATTR_RESET */
 };


Fix the crash when enter SPACE  single character

--- src/lomaji.c
+++ src/lomaji.c
@@ -106,7 +106,7 @@

     /* For tone 1 and 4, skip the enter for tone */
     int *temp = NULL;
-    if(len > 1) temp = &pBopomofo->pho_inx[ len - 1];
+    if(len > 0) temp = &pBopomofo->pho_inx[ len - 1];
     if (key == ' ') {
 	    if (*temp == 'k' || *temp == 't' || *temp == 'h') {
 		    pBopomofo->pho_inx[len] = '4';


brcmfmac: reduce log level for invalid scheduled scan request

When a regular scan does not return any networks user-space does
request a scheduled scan without any matchset or ssid. This can
not be handled by the firmware so we return -EINVAL. However, as
this request is done let us not add an error message to the log.

Reviewed-by: Hante Meuleman <31ca5aa57e9f47a38c33f2797b138069dfa82656@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <996ffb484be4810f081e1899e9b77a0b6fd6a184@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <d101f7ec36e185d305862a92a05a9a0c1b62aa38@broadcom.com>
Signed-off-by: Arend van Spriel <06447fbe43693466d3293d0b5eaeeb2efd3d7d3a@broadcom.com>
Signed-off-by: John W. Linville <2a53bac7a5d324865ef46ec4c38b2c0fba1456b4@tuxdriver.com>

--- drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -3178,7 +3178,7 @@
 	}

 	if (!request->n_ssids || !request->n_match_sets) {
-		brcmf_err("Invalid sched scan req!! n_ssids:%d\n",
+		brcmf_dbg(SCAN, "Invalid sched scan req!! n_ssids:%d\n",
 			  request->n_ssids);
 		return -EINVAL;
 	}


Remove unused code in zip_readline

Remove unused code in zip_readline

--- src/luazip.c
+++ src/luazip.c
@@ -452,35 +452,22 @@
   return g_read(L, tointernalfile(L, 1), 2);
 }

-static int zip_readline (lua_State *L);
+static int zip_readline (lua_State *L) {
+  ZZIP_FILE *f = *(ZZIP_FILE **)lua_touserdata(L, lua_upvalueindex(1));
+  if (f == NULL)  /* file is already closed? */
+    luaL_error(L, "file is already closed");
+  return read_line(L, f);
+}

 static void aux_lines (lua_State *L, int idx, int close) {
-  lua_pushliteral(L, ZIPINTERNALFILEHANDLE);
-  lua_rawget(L, LUA_REGISTRYINDEX);
   lua_pushvalue(L, idx);
-  lua_pushboolean(L, close);  /* close/not close file when finished */
-  lua_pushcclosure(L, zip_readline, 3);
+  lua_pushcclosure(L, zip_readline, 1);
 }

 static int ff_lines (lua_State *L) {
   tointernalfile(L, 1);  /* check that it's a valid file handle */
   aux_lines(L, 1, 0);
   return 1;
-}
-
-static int zip_readline (lua_State *L) {
-  ZZIP_FILE *f = *(ZZIP_FILE **)lua_touserdata(L, lua_upvalueindex(2));
-  if (f == NULL)  /* file is already closed? */
-    luaL_error(L, "file is already closed");
-  if (read_line(L, f)) return 1;
-  else {  /* EOF */
-    if (lua_toboolean(L, lua_upvalueindex(3))) {  /* generator created file? */
-      lua_settop(L, 0);
-      lua_pushvalue(L, lua_upvalueindex(2));
-      aux_close(L);  /* close it */
-    }
-    return 0;
-  }
 }

 static int ff_seek (lua_State *L) {


lib/bloom: Add some missing preconditions on n_bytes

These shouldn’t change the bloom filter’s behaviour at all, but make it
a bit more obvious what the programmatical limitations are on the sizes
it can deal with.

In reality, those sizes should never be reached because they won’t fit
in a DNS-SD record.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1239
Approved by: cgwalters

--- src/libostree/ostree-bloom.c
+++ src/libostree/ostree-bloom.c
@@ -76,7 +76,7 @@
 struct _OstreeBloom
 {
   guint ref_count;
-  gsize n_bytes;
+  gsize n_bytes;  /* 0 < n_bytes <= G_MAXSIZE / 8 */
   gboolean is_mutable;  /* determines which of [im]mutable_bytes is accessed */
   union
     {
@@ -117,6 +117,7 @@
   g_autoptr(OstreeBloom) bloom = NULL;

   g_return_val_if_fail (n_bytes > 0, NULL);
+  g_return_val_if_fail (n_bytes <= G_MAXSIZE / 8, NULL);
   g_return_val_if_fail (k > 0, NULL);
   g_return_val_if_fail (hash_func != NULL, NULL);

@@ -159,6 +160,7 @@

   g_return_val_if_fail (bytes != NULL, NULL);
   g_return_val_if_fail (g_bytes_get_size (bytes) > 0, NULL);
+  g_return_val_if_fail (g_bytes_get_size (bytes) <= G_MAXSIZE / 8, NULL);
   g_return_val_if_fail (k > 0, NULL);
   g_return_val_if_fail (hash_func != NULL, NULL);


Version 0.5.1

Version 0.5.1

--- tpn/include.h
+++ tpn/include.h
@@ -24,7 +24,7 @@

 #define DEBUG
 #define APPNAME		"TeapotNet"
-#define APPVERSION	"0.5.0"
+#define APPVERSION	"0.5.1"
 #define APPAUTHOR	"Paul-Louis Ageneau"
 #define APPLINK		"http://www.teapotnet.org/"
 #define SOURCELINK	"http://www.teapotnet.org/source/"


msm:vdec: Correct filled length of the output buffer

Filled length of the output buffer at FBD for videos
with frame height less than 96 was incorrect. With
this change, we get the proper filled length.

CRs-fixed: 395179
Change-Id: I12d60ef653225b0bf2f0088e515cac19a19ed80a
Signed-off-by: Deepak Verma <2afa83dd02a4531013cf9ecb24e39a5ca10af967@codeaurora.org>

--- drivers/video/msm/vidc/1080p/ddl/vcd_ddl_properties.c
+++ drivers/video/msm/vidc/1080p/ddl/vcd_ddl_properties.c
@@ -1879,7 +1879,6 @@
 		output_buf_req = &decoder->actual_output_buf_req;
 		input_buf_req = &decoder->actual_input_buf_req;
 		min_dpb = decoder->min_dpb_num;
-		y_cb_cr_size = decoder->y_cb_cr_size;
 		if ((decoder->buf_format.buffer_format ==
 			VCD_BUFFER_FORMAT_TILE_4x2) &&
 			(frame_size->height < MDP_MIN_TILE_HEIGHT)) {
@@ -1891,6 +1890,7 @@
 				&decoder->buf_format,
 				(!decoder->progressive_only),
 				decoder->hdr.decoding, NULL);
+			decoder->y_cb_cr_size = y_cb_cr_size;
 		} else
 			y_cb_cr_size = decoder->y_cb_cr_size;
 	}


nl: avoid NULL pointer dereference

nl: avoid NULL pointer dereference

It's a valid case to call nla_put() with NULL data and 0 len. It's done e.g. in
the nla_put_attr().

There has to be a check for data in nla_put() as passing NULL to the memcpy()
is not allowed. Even if length is 0, both pointers have to be valid.

For a reference see C99 standard (7.21.1/2), it says: "pointer arguments on
such a call shall still have valid values".

Reported-by: Daniel Gimpelevich <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@gimpelevich.san-francisco.ca.us>
Signed-off-by: Rafał Miłecki <68396d1faf4100deae824f26e1be60d81c1ce164@milecki.pl>
[48455ab3070520a2d174545c7239d6d0fabd9a83@ubuntu.com: adapted commit message]
Signed-off-by: Christian Brauner <48455ab3070520a2d174545c7239d6d0fabd9a83@ubuntu.com>

--- src/lxc/nl.c
+++ src/lxc/nl.c
@@ -61,7 +61,8 @@
 	rta = NLMSG_TAIL(nlmsg->nlmsghdr);
 	rta->rta_type = attr;
 	rta->rta_len = rtalen;
-	memcpy(RTA_DATA(rta), data, len);
+	if (data && len)
+		memcpy(RTA_DATA(rta), data, len);
 	nlmsg->nlmsghdr->nlmsg_len = tlen;
 	return 0;
 }


Add TEMP_FAILURE_RETRY for the Mac build.

Change-Id: I4934e76643783041773033af61b0ae82fd188c01

--- src/macros.h
+++ src/macros.h
@@ -125,4 +125,14 @@
 #define LIKELY(x)       __builtin_expect((x),true)
 #define UNLIKELY(x)     __builtin_expect((x),false)

+// bionic and glibc both have TEMP_FAILURE_RETRY, but Mac OS' libc doesn't.
+#ifndef TEMP_FAILURE_RETRY
+#define TEMP_FAILURE_RETRY(exp) ({ \
+  typeof (exp) _rc; \
+  do { \
+    _rc = (exp); \
+  } while (_rc == -1 && errno == EINTR); \
+  _rc; })
+#endif
+
 #endif  // ART_SRC_MACROS_H_


Fix evaluation of return value

Fix evaluation of return value

--- src/lv_draw/lv_img_decoder.c
+++ src/lv_draw/lv_img_decoder.c
@@ -559,7 +559,7 @@
     }
     uint32_t btr = len * (px_size >> 3);
     uint32_t br  = 0;
-    lv_fs_read(user_data->f, buf, btr, &br);
+    res = lv_fs_read(user_data->f, buf, btr, &br);
     if(res != LV_FS_RES_OK || btr != br) {
         LV_LOG_WARN("Built-in image decoder read failed");
         return LV_RES_INV;


including header

including header

Former-commit-id: c43bfa579ed28ee272b669564875766e05edefa4 [formerly a859d26024122f3f85128c0c7220a54a0056239c]
Former-commit-id: 1ffab94cde04d95891dbbbf8d3edf172fe726a27

--- src/objectFollowing/objectFollowing.h
+++ src/objectFollowing/objectFollowing.h
@@ -2,6 +2,7 @@
 #define OBJ_FOLLOWING_HEADER

 #include "../ardrone/ardrone.h"
+#include "../structures.h"

 class ObjectFollowing {
   public:


Update serverName comment to be more accurate

--- src/objective-c/GRPCClient/GRPCCall.h
+++ src/objective-c/GRPCClient/GRPCCall.h
@@ -164,8 +164,8 @@
 @interface GRPCCall : GRXWriter

 /**
- * The server name for the RPC. If nil, the host name of the service object will be used instead.
- * This property must be nil when Cronet transport is enabled.
+ * The authority for the RPC. If nil, the default authority will be used. This property must be nil
+ * when Cronet transport is enabled.
  */
 @property (atomic, readwrite) NSString *serverName;


Changed defaults slightly

Changed defaults slightly

--HG--
branch : gnat-planner

--- src/ompl/datastructures/gnatSampler.h
+++ src/ompl/datastructures/gnatSampler.h
@@ -375,10 +375,10 @@
           minRadius_(std::numeric_limits<double>::infinity()),
           maxRadius_(-minRadius_), minRange_(degree, minRadius_),
           maxRange_(degree, maxRadius_),
+          _previousObservedRadius(0.0),
+          _activity(-100.0),
+          _deltaRadius(0.0),
           _maxActivity(2.0),
-          _previousObservedRadius(0.0),
-          _deltaRadius(0.0),
-          _activity(-100.0),
           _totalChildNodes(0),
           _maxObservedRadius(0.0)
       {
@@ -423,7 +423,6 @@

         const _T& sample(GNAT& gnat, double borderFraction = 0.0, size_t total = 1)
         {
-          bool sampleBorder = 0.5 < borderFraction;
           doubleVect distribution;
           double c = 2.0;
           double d = 1.0;
@@ -439,24 +438,15 @@
           {
             distribution.clear();
             ompl::Profiler::Begin("GNAT - Child Distribution");
-            if(!sampleBorder) distribution.push_back(M_PI*powf(radius/std::max(gnat.tree_->_maxObservedRadius,1.0),c)*powf(1.0 - (double)t/(double)total,d)*1.0/double(t));
-            else distribution.push_back(0.0);
+            distribution.push_back(M_PI*powf(radius/std::max(gnat.tree_->_maxObservedRadius,1.0),c)*powf(1.0 - (double)t/(double)total,d)*1.0/double(t));
             for(unsigned int i=0; i<children_.size(); ++i)
             {
               size_t N = children_[i]->totalChildren() + 1;
-              if(!sampleBorder)
-              {
                 double radius = children_[i]->maxRadius_;
                 if(radius<=0.0) radius = children_[i]->_maxObservedRadius;
                 if(radius<=0.0) radius = boundingRadius(gnat,children_[i]->pivot_,true);
                 distribution.push_back(M_PI*powf(radius/std::max(gnat.tree_->_maxObservedRadius,1.0),c)*powf(1.0 - (double)N/(double)total,d));
                 //std::cout<<"<"<<N<<"|"<<distribution.back()<<"|"<<children_[i]->maxRadius_<<">,";
-              }
-              else
-              {
-                //distribution.push_back(a*d*V/(double)N);
-                exit(0);
-              }
             }
             ompl::Profiler::End("GNAT - Child Distribution");
             ompl::Profiler::Begin("GNAT - Calculate Distribution");


qs1dsearch: adding separate init_direction() method, improved consistency

--- src/optim/tests/qs1dsearch_autotest.c
+++ src/optim/tests/qs1dsearch_autotest.c
@@ -105,40 +105,3 @@
 void autotest_qs1dsearch_max_12() { test_qs1dsearch(qs1dsearch_umax, 0, -10, 15, 1, LIQUID_OPTIM_MAXIMIZE); }
 void autotest_qs1dsearch_max_13() { test_qs1dsearch(qs1dsearch_umax, 0, -.1, 15, 1, LIQUID_OPTIM_MAXIMIZE); }

-// test initialization on bounds
-void testbench_qs1dsearch_bounds(liquid_utility_1d _utility,
-                                 float             _v_opt,
-                                 float             _v_lo,
-                                 float             _v_hi,
-                                 int               _direction)
-{
-    // create qs1dsearch object and initialize
-    qs1dsearch q = qs1dsearch_create(_utility, &_v_opt, _direction);
-    qs1dsearch_init_bounds(q, _v_lo, _v_hi);
-
-    // run search
-    unsigned int i;
-    for (i=0; i<32; i++) {
-        qs1dsearch_step(q);
-        if (liquid_autotest_verbose)
-            qs1dsearch_print(q);
-    }
-
-    // check result
-    CONTEND_DELTA( qs1dsearch_get_opt_v(q), _v_opt,                    1e-3f );
-    CONTEND_DELTA( qs1dsearch_get_opt_u(q), _utility(_v_opt, &_v_opt), 1e-3f );
-
-    // print results
-    if (liquid_autotest_verbose) {
-        printf("%3u : u(%12.8f) = %12.4e, v_opt=%12.4e (error=%12.4e)\n",
-            i, qs1dsearch_get_opt_v(q), qs1dsearch_get_opt_u(q),
-            _v_opt, _v_opt - qs1dsearch_get_opt_v(q));
-    }
-
-    // clean it upt
-    qs1dsearch_destroy(q);
-}
-
-void autotest_qs1dsearch_03() { testbench_qs1dsearch_bounds(qs1dsearch_umin, 0, -20, 10, LIQUID_OPTIM_MINIMIZE); }
-void autotest_qs1dsearch_04() { testbench_qs1dsearch_bounds(qs1dsearch_umax, 0, -20, 10, LIQUID_OPTIM_MAXIMIZE); }
-


* updated with corrections in serial init.

--- libraries/mbed/targets/hal/TARGET_Atmel/TARGET_SAM0/serial_api.c
+++ libraries/mbed/targets/hal/TARGET_Atmel/TARGET_SAM0/serial_api.c
@@ -237,9 +237,6 @@
     uint32_t sercom_index = 0;
     uint32_t muxsetting = 0;

-    /* Disable USART module */
-    disable_usart(obj);
-
     get_default_serial_values(obj);

     pSERIAL_S(obj)->pins[USART_TX_INDEX] = tx;
@@ -256,6 +253,9 @@
     sercom_index &= 0x0F;
     uart = pinmap_peripheral_sercom(NC, sercom_index);
     pUSART_S(obj) = (Sercom *)uart;
+
+    /* Disable USART module */
+    disable_usart(obj);

     pm_index     = sercom_index + PM_APBCMASK_SERCOM0_Pos;
     gclk_index   = sercom_index + SERCOM0_GCLK_ID_CORE;


Toolbox: Fix undo/redo cycle causing component icons not being readded to the scene.


trx_sys_print_mysql_binlog_offset_from_page(): Enclose the definition in #ifdef UNIV_HOTBACKUP, to match the function declaration.

--- trx/trx0sys.c
+++ trx/trx0sys.c
@@ -646,6 +646,7 @@
 			 MLOG_4BYTES, mtr);
 }

+#ifdef UNIV_HOTBACKUP
 /*********************************************************************
 Prints to stderr the MySQL binlog info in the system header if the
 magic number shows it valid. */
@@ -677,6 +678,7 @@
 			+ TRX_SYS_MYSQL_LOG_NAME);
 	}
 }
+#endif /* UNIV_HOTBACKUP */

 /*********************************************************************
 Stores the MySQL binlog offset info in the trx system header if


:sparkles: feat(Chaos.Concurrent): add thread for concurrent module


add ability to disable phy

add ability to disable phy

--- features/FEATURE_BLE/ble/gap/ExtendedConnectParameters.h
+++ features/FEATURE_BLE/ble/gap/ExtendedConnectParameters.h
@@ -88,6 +88,31 @@
         return *this;
     }

+    ExtendedConnectParameters_t& togglePhy(
+        bool phy1M,
+        bool phy2M,
+        bool phyCoded,
+    ) {
+        _enabledPhy[ble::phy_t::LE_1M] = phy1M;
+        _enabledPhy[ble::phy_t::LE_2M] = phy2M;
+        _enabledPhy[ble::phy_t::LE_CODED] = phyCoded;
+        return *this;
+    }
+
+    ExtendedConnectParameters_t& disablePhy(
+        ble::phy_t phy = ble::phy_t::LE_1M
+    ) {
+        _enabledPhy[phy] = false;
+        return *this;
+    }
+
+    ExtendedConnectParameters_t& enablePhy(
+        ble::phy_t phy = ble::phy_t::LE_1M
+    ) {
+        _enabledPhy[phy] = false;
+        return *this;
+    }
+
 private:
     ble::scanning_policy_mode_t _filterPolicy;
     ble::own_address_type_t _ownAddressType;


ia32: Document why popfl+sysexit is correct on ia32

--- src/arch/x86/32/c_traps.c
+++ src/arch/x86/32/c_traps.c
@@ -87,6 +87,10 @@
             // skip cs
             "addl $4,  %%esp\n"
             "movl 4(%%esp), %%ecx\n"
+            // It is not properly documented but on ia32 (but NOT x86-64) if interrupts
+            // are enabled as a result of popf then they will not become enabled till
+            // after the next instruction (much like sti)
+            // see https://lkml.org/lkml/2004/7/15/6
             "popfl\n"
             "sysexit\n"
             :


Added missing t_pop().

Added missing t_pop().

--- src/master/master-settings.c
+++ src/master/master-settings.c
@@ -1450,6 +1450,7 @@
 				       set_names[i], str[i]);
 			}
 		}
+		t_pop();
 	}
 }


- Fixing an isue with Disguise that'd make chatrooms disappear when @disguise'ing after creating a chat

--- src/map/pc.c
+++ src/map/pc.c
@@ -18,6 +18,7 @@
 #include "atcommand.h" // get_atcommand_level()
 #include "battle.h" // battle_config
 #include "battleground.h"
+#include "chat.h"
 #include "chrif.h"
 #include "clif.h"
 #include "date.h" // is_day_of_*()
@@ -1691,6 +1692,13 @@
 			//It seems the cart info is lost on undisguise.
 			clif->cartlist(sd);
 			clif->updatestatus(sd,SP_CARTINFO);
+		}
+		if (sd->chatID) {
+			struct chat_data* cd;
+			nullpo_retr(1, sd);
+			cd = (struct chat_data*)map_id2bl(sd->chatID);
+			if( cd != NULL || (struct block_list*)sd == cd->owner )
+				clif->dispchat(cd,0);
 		}
 	}
 	return 1;


Removed some old backwards compatibility handling code.

--- src/master/master-settings.c
+++ src/master/master-settings.c
@@ -964,19 +964,6 @@
 		i_error("stat(%s) failed: %m", set->base_dir);
 		return FALSE;
 	}
-	if ((st.st_mode & 0310) != 0310 || (st.st_mode & 0777) == 0777) {
-		/* FIXME: backwards compatibility: fix permissions so that
-		   login processes can find ssl-parameters file. Group rx is
-		   enough, but change it to world-rx so that we don't have to
-		   start changing groups and causing possibly other problems.
-
-		   The second check is to fix 1.0beta1's accidental 0777
-		   mode change.. */
-		i_warning("Fixing permissions of %s to be world-readable",
-			  set->base_dir);
-		if (chmod(set->base_dir, 0755) < 0)
-			i_error("chmod(%s) failed: %m", set->base_dir);
-	}

 	/* remove auth worker sockets left by unclean exits */
 	unlink_auth_sockets(set->base_dir, "auth-worker.");
@@ -1214,19 +1201,6 @@
 				 struct settings_parse_ctx *ctx)
 {
 	const char *error;
-
-	/* backwards compatibility */
-	if (strcmp(key, "auth") == 0) {
-		ctx->auth = parse_new_auth(ctx->server, value, &error);
-		return ctx->auth == NULL ? error : NULL;
-	}
-
-	if (strcmp(key, "login") == 0) {
-		i_warning("Ignoring deprecated 'login' section handling. "
-			  "Use protocol imap/pop3 { .. } instead. "
-			  "Some settings may have been read incorrectly.");
-		return NULL;
-	}

 	switch (ctx->type) {
 	case SETTINGS_TYPE_ROOT:


removed some potential for sigpipe on denied put

--- gass/transfer/source/library/globus_gass_transfer_http.c
+++ gass/transfer/source/library/globus_gass_transfer_http.c
@@ -24,6 +24,22 @@

 #if defined(DEBUG_GASS_TRANSFER)
 #define debug_printf(a) printf a
+#undef globus_l_gass_transfer_http_lock()
+#undef globus_l_gass_transfer_http_unlock()
+#define globus_l_gass_transfer_http_lock() \
+        printf("Thread [%d] acquiring mutex at %s:%d\n", \
+               (int) globus_thread_self(), \
+	       __FILE__, \
+	       __LINE__), \
+	fflush(stdout), \
+	globus_mutex_lock(&globus_l_gass_transfer_http_mutex)
+#define globus_l_gass_transfer_http_unlock() \
+        printf("Thread [%d] releasing mutex at %s:%d\n", \
+               (int) globus_thread_self(), \
+	       __FILE__, \
+	       __LINE__), \
+	fflush(stdout), \
+	globus_mutex_unlock(&globus_l_gass_transfer_http_mutex)
 #else
 #define debug_printf(a)
 #endif
@@ -83,6 +99,14 @@
     {
 	return GLOBUS_FAILURE;
     }
+    maj_stat = gss_release_name(
+	&min_stat,
+	&name);
+    if (maj_stat != GSS_S_COMPLETE)
+    {
+	return GLOBUS_FAILURE;
+    }
+
     globus_l_gass_transfer_http_subject_name = name_buffer.value;

     return GLOBUS_SUCCESS;
@@ -98,7 +122,6 @@
     globus_free(globus_l_gass_transfer_http_subject_name);

     globus_module_deactivate(GLOBUS_COMMON_MODULE);
-
     return GLOBUS_SUCCESS;
 }
 globus_module_descriptor_t globus_i_gass_transfer_http_module =
@@ -430,22 +453,23 @@
     if(proto->last_data)
     {
 	proto->user_offset = nbytes;
-	globus_l_gass_transfer_http_unlock();
-	if(proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
-	   proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND)
-	{
-	    /* Need to check for a response, and call back from there */
-	    result = globus_io_register_read(
-		&proto->handle,
-		proto->response_buffer,
-		proto->response_buflen,
-		1,
-		globus_l_gass_transfer_http_response_callback,
-		proto);
+	if((proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
+	   proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND) &&
+	   (!proto->failure_occurred && !proto->parse_error))
+	{
+	    /* Need to check for a response, and call back from there
+	       result = globus_io_register_read(
+	       &proto->handle,
+	       proto->response_buffer,
+	       proto->response_buflen,
+	       1,
+	       globus_l_gass_transfer_http_response_callback,
+	       proto);
+	    */
 	}
 	else
 	{
-	    /* need to register the close, and clalback to the user */
+	    /* need to register the close, and callback to the user */
 	    proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING;

 	    globus_l_gass_transfer_http_unlock();
@@ -455,6 +479,7 @@
 		proto->user_offset,
 		proto->failure_occurred,
 		GLOBUS_TRUE);
+	    globus_l_gass_transfer_http_lock();

 	    result = globus_io_register_close(
 		&proto->handle,
@@ -511,14 +536,45 @@
 	proto->user_offset = nbytes - iov[0].iov_len - iov[2].iov_len;

 	globus_l_gass_transfer_http_unlock();
-	/* Need to check for a response, and call back from there */
-	result = globus_io_register_read(
-	    &proto->handle,
-	    proto->response_buffer,
-	    proto->response_buflen,
-	    1,
-	    globus_l_gass_transfer_http_response_callback,
-	    proto);
+
+	if((proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_PUT ||
+	   proto->type == GLOBUS_GASS_TRANSFER_REQUEST_TYPE_APPEND) &&
+	   (!proto->failure_occurred && !proto->parse_error))
+	{
+	    /* Need to check for a response, and call back from there
+	    result = globus_io_register_read(
+		&proto->handle,
+		proto->response_buffer,
+		proto->response_buflen,
+		1,
+		globus_l_gass_transfer_http_response_callback,
+		proto);
+	    */
+	}
+	else
+	{
+	    /* need to register the close, and callback to the user */
+	    proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING;
+
+	    globus_l_gass_transfer_http_unlock();
+	    globus_gass_transfer_proto_send_complete(
+		proto->request,
+		proto->user_buffer,
+		proto->user_offset,
+		proto->failure_occurred,
+		GLOBUS_TRUE);
+
+	    result = globus_io_register_close(
+		&proto->handle,
+		globus_l_gass_transfer_http_close_callback,
+		proto);
+	    if(result != GLOBUS_SUCCESS)
+	    {
+		globus_l_gass_transfer_http_close_callback(proto,
+							   &proto->handle,
+							   GLOBUS_SUCCESS);
+	    }
+	}
     }
     else
     {
@@ -2525,11 +2581,23 @@
 	 */
 	proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE;

+	result = globus_io_register_read(
+	    &proto->handle,
+	    proto->response_buffer,
+	    proto->response_buflen,
+	    1,
+	    globus_l_gass_transfer_http_response_callback,
+	    proto);
+	if(result != GLOBUS_SUCCESS)
+	{
+	    proto->failure_occurred = GLOBUS_TRUE;
+	}
 	globus_l_gass_transfer_http_unlock();

 	globus_gass_transfer_proto_request_ready(
 	    proto->request,
 	    (globus_gass_transfer_request_proto_t *) proto);
+

 	return;
       case GLOBUS_GASS_TRANSFER_REQUEST_TYPE_GET:
@@ -3055,9 +3123,9 @@

   put_success_exit:
     /*
-     * request failed after a put or append operation. We
-     * need to signal the failure to the GASS system
+     * success response from a server, signal this to the GASS system
      */
+    globus_assert(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_PENDING);
     proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING;

     result = globus_io_register_close(
@@ -3082,24 +3150,36 @@
      * request failed after a put or append operation. We
      * need to signal the failure to the GASS system
      */
-    proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING;
+    if(proto->state == GLOBUS_GASS_TRANSFER_HTTP_STATE_IDLE)
+    {
+        proto->failure_occurred = GLOBUS_TRUE;
+	globus_l_gass_transfer_http_unlock();
+    }
+    else
+    {
+	proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_CLOSING;
+        proto->failure_occurred = GLOBUS_TRUE;

-    result = globus_io_register_close(
-	&proto->handle,
-	globus_l_gass_transfer_http_close_callback,
-	proto);
-    if(result != GLOBUS_SUCCESS)
-    {
-	proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_DONE;
-    }
-
-    globus_l_gass_transfer_http_unlock();
-    globus_gass_transfer_proto_send_complete(proto->request,
-					     proto->user_buffer,
-					     proto->user_offset,
-					     GLOBUS_TRUE,
-					     GLOBUS_TRUE);
-
+	result = globus_io_register_close(
+	    &proto->handle,
+	    globus_l_gass_transfer_http_close_callback,
+	    proto);
+
+	globus_assert(result);
+
+	if(result != GLOBUS_SUCCESS)
+	{
+	    proto->state = GLOBUS_GASS_TRANSFER_HTTP_STATE_DONE;
+	}
+
+	globus_l_gass_transfer_http_unlock();
+	globus_gass_transfer_proto_send_complete(proto->request,
+						 proto->user_buffer,
+						 proto->user_offset,
+						 GLOBUS_TRUE,
+						 GLOBUS_TRUE);
+
+    }
     return;
 }
 /* globus_l_gass_transfer_http_response_callback() */


Add master.c

Add master.c

error: pathspec 'src/master.c' did not match any file(s) known to git

--- src/master.c
+++ src/master.c
@@ -0,0 +1,68 @@
+/*
+	Michael Wahlberg
+
+	Main program that moves "slave" program to needed directory and executes the program.
+	From there the slave program pulls, tests and pushes.
+	Slave removes itself after execution.
+
+	NOTE: The repo MUST have a /src folder storing the code for the current version.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define DEBUG 1
+
+FILE * ofp;
+FILE * ifp;
+
+int main()
+{
+	if(DEBUG)
+		printf("Beginning master.c\n");
+
+	char * repo = (char *)malloc(256 * sizeof(char));
+	char * dest = (char *)malloc(256 * sizeof(char));
+	printf("Which repository?\n");
+	scanf("%s", repo);
+
+	printf("Which sub-directory?\n");
+	scanf("%s", dest);
+
+	char * cmd = (char *)malloc(256 * sizeof(char));
+
+	strcpy(cmd, "cp slave.c ");
+	strcat(cmd, repo);
+	strcat(cmd, "/");
+	strcat(cmd, dest);
+	system(cmd);
+
+	strcpy(cmd, "cd ");
+	strcat(cmd, repo);
+	strcat(cmd, " && git pull");
+	system(cmd);
+
+	if(DEBUG)
+		printf("Running slave.\n");
+	strcpy(cmd, "cd ");
+	strcat(cmd, repo);
+	strcat(cmd, "/");
+	strcat(cmd, dest);
+	strcat(cmd, " && git pull && ");
+	strcat(cmd, "gcc slave.c -o slave && ");
+	strcat(cmd, "./slave");
+	system(cmd);
+
+	if(DEBUG)
+		printf("Removing slave.\n");
+	strcpy(cmd, "cd ");
+	strcat(cmd, repo);
+	strcat(cmd, "/");
+	strcat(cmd, dest);
+	strcat(cmd, " && ");
+	strcat(cmd, "rm slave.c && rm slave");
+	system(cmd);
+
+	return 0;
+}


Typofix.

Typofix.

--- src/master/service-process.c
+++ src/master/service-process.c
@@ -190,7 +190,7 @@
 	}
 }

-static void service_rpocess_setup_config_environment(struct service *service)
+static void service_process_setup_config_environment(struct service *service)
 {
 	const struct master_service_settings *set = service->list->service_set;

@@ -222,7 +222,7 @@
 	master_service_env_clean();

 	env_put(MASTER_IS_PARENT_ENV"=1");
-	service_rpocess_setup_config_environment(service);
+	service_process_setup_config_environment(service);
 	env_put(t_strdup_printf(MASTER_CLIENT_LIMIT_ENV"=%u",
 				service->client_limit));
 	env_put(t_strdup_printf(MASTER_PROCESS_LIMIT_ENV"=%u",


In CurveGFp, store just the BigInt mod instead of a GFpModulus

--- src/math/gfpmath/curve_gfp.h
+++ src/math/gfpmath/curve_gfp.h
@@ -79,7 +79,7 @@
       * Get prime modulus of the field of the curve
       * @result prime modulus of the field of the curve
       */
-      const BigInt& get_p() const { return modulus.get_p(); }
+      const BigInt& get_p() const { return modulus; }

       /**
       * swaps the states of *this and other, does not throw
@@ -88,7 +88,7 @@
       void swap(CurveGFp& other);

    private:
-      GFpModulus modulus;
+      BigInt modulus;
       GFpElement mA;
       GFpElement mB;
       GFpElement mres_a, mres_b, mres_one;


mesa: use elementBuf local var instead of ctx->Array.ElementArrayBufferObj

Makes no real difference, but more consistant.

--- src/mesa/main/api_validate.c
+++ src/mesa/main/api_validate.c
@@ -72,7 +72,7 @@
    if (map) {
       ctx->Driver.UnmapBuffer(ctx,
                               GL_ELEMENT_ARRAY_BUFFER_ARB,
-                              ctx->Array.ElementArrayBufferObj);
+                              elementBuf);
    }

    return max;


mesa: Skip ES 3.0/3.1 transform feedback primitive counting error.

This error condition is not implementable when using tessellation or
geometry shaders.  The text was also removed from the ES 3.2 spec.
I believe the intended behavior is to remove the error condition
when either OES_geometry_shader or OES_tessellation_shader are
exposed.

v2: Quote a better part of issue 13 (suggested by Ian).

Signed-off-by: Kenneth Graunke <bd2562f754ec92342f93f61c25d731e290a2ffa8@whitecape.org>
Reviewed-by: Ian Romanick <2b237cafb16dc45038e85df6c85e74e6d899eba9@intel.com>

--- src/mesa/main/api_validate.c
+++ src/mesa/main/api_validate.c
@@ -546,8 +546,24 @@
     *
     * This is in contrast to the behaviour of desktop GL, where the extra
     * primitives are silently dropped from the transform feedback buffer.
-    */
-   if (_mesa_is_gles3(ctx) && _mesa_is_xfb_active_and_unpaused(ctx)) {
+    *
+    * This text is removed in ES 3.2, presumably because it's not really
+    * implementable with geometry and tessellation shaders.  In fact,
+    * the OES_geometry_shader spec says:
+    *
+    *    "(13) Does this extension change how transform feedback operates
+    *     compared to unextended OpenGL ES 3.0 or 3.1?
+    *
+    *     RESOLVED: Yes. Because dynamic geometry amplification in a geometry
+    *     shader can make it difficult if not impossible to predict the amount
+    *     of geometry that may be generated in advance of executing the shader,
+    *     the draw-time error for transform feedback buffer overflow conditions
+    *     is removed and replaced with the GL behavior (primitives are not
+    *     written and the corresponding counter is not updated)..."
+    */
+   if (_mesa_is_gles3(ctx) && _mesa_is_xfb_active_and_unpaused(ctx) &&
+       !_mesa_has_OES_geometry_shader(ctx) &&
+       !_mesa_has_OES_tessellation_shader(ctx)) {
       size_t prim_count = vbo_count_tessellated_primitives(mode, count, 1);
       if (xfb_obj->GlesRemainingPrims < prim_count) {
          _mesa_error(ctx, GL_INVALID_OPERATION,