* libsvn_fs/dag.h (svn_fs__dag_check_mutable): Doc fix.

* libsvn_fs/dag.h (svn_fs__dag_link): Doc fix.
(svn_fs__dag_rename): New function.

--- subversion/libsvn_fs/dag.h
+++ subversion/libsvn_fs/dag.h
@@ -78,7 +78,8 @@
 const svn_fs_id_t *svn_fs__dag_get_id (dag_node_t *node);

-/* Set IS_MUTABLE to TRUE iff NODE is mutable */
+/* Set IS_MUTABLE to a non-zero value if NODE is currently mutable in
+   TRAIL, or zero otherwise.  */
 svn_error_t *svn_fs__dag_check_mutable (svn_boolean_t *is_mutable,
                                         dag_node_t *node,
                                         trail_t *trail);
@@ -187,15 +188,53 @@
                                       trail_t *trail);

+/* Why do we have both svn_fs__dag_link and svn_fs__dag_rename?
+
+   They each have different limitations and abilities (kind of like
+   superheroes!) that allow them to ensure the consistency of the
+   filesystem.
+
+   - svn_fs__dag_link can't rename mutable nodes.  But since CHILD is
+     immutable, it knows that it's safe to create a new link to it:
+     mutable nodes must have exactly one parent, while immutable nodes
+     can be shared arbitrarily.
+
+   - svn_fs__dag_rename always deletes one link, and adds another, as
+     a single atomic operation.  Since it preserves the total number
+     of links to the node being renamed, you can use it on both
+     mutable nodes (which must always have one parent) and immutable
+     nodes (which can have as many parents as they please).  But by
+     the same token, you can't use it to create virtual copies, one of
+     the filesystem's defining features.  */
+
+
 /* Create a link to CHILD in PARENT named NAME, as part of TRAIL.
-   PARENT must be mutable.  CHILD must be immutable.  This function
-   ensures that CHILD is not equal to, or a parent of, PARENT.  NAME
-   must be a single path component; it cannot be a slash-separated
-   directory path.  */
+   PARENT must be mutable.  CHILD must be immutable.  NAME must be a
+   single path component; it cannot be a slash-separated directory
+   path.
+
+   Note that it is impossible to use this function to create cyclic
+   directory structures.  Since PARENT is mutable, and every parent of
+   a mutable node is mutable itself, and CHILD is immutable, we know
+   that CHILD can't be equal to, or a parent of, PARENT.  */
 svn_error_t *svn_fs__dag_link (dag_node_t *parent,
                                dag_node_t *child,
                                const char *name,
                                trail_t *trail);
+
+
+/* Rename the node named FROM_NAME in FROM_DIR to TO_NAME in TO_DIR,
+   as part of TRAIL.  FROM_DIR and TO_DIR must both be mutable; the
+   node being renamed may be either mutable or immutable.  FROM_NAME
+   and TO_NAME must be single path components; they cannot be
+   slash-separated directory paths.
+
+   This function ensures that the rename does not create a cyclic
+   directory structure, by checking that TO_DIR is not a child of
+   FROM_DIR.  */
+svn_error_t *svn_fs__dag_rename (dag_node_t *from_dir, const char *from_name,
+                                 dag_node_t *  to_dir, const char *  to_name,
+                                 trail_t *trail);

 /* Delete the directory entry named NAME from PARENT, as part of


* subversion/svnadmin/main.c   (cmd_table, subcommand_load): Teach 'svnadmin load' to be quiet when asked.

--- subversion/svnadmin/main.c
+++ subversion/svnadmin/main.c
@@ -214,7 +214,8 @@
      "new revisions into the repository's filesystem.  If the repository\n"
      "was previously empty, its UUID will, by default, be changed to the\n"
      "one specified in the stream.  Progress feedback is sent to stdout.\n",
-     {svnadmin__ignore_uuid, svnadmin__force_uuid, svnadmin__parent_dir} },
+     {'q', svnadmin__ignore_uuid, svnadmin__force_uuid,
+      svnadmin__parent_dir} },

     {"list-dblogs", subcommand_list_dblogs, {0},
      "usage: svnadmin list-dblogs REPOS_PATH\n\n"
@@ -471,7 +472,7 @@
 {
   struct svnadmin_opt_state *opt_state = baton;
   svn_repos_t *repos;
-  svn_stream_t *stdin_stream, *stdout_stream;
+  svn_stream_t *stdin_stream, *stdout_stream = NULL;

   SVN_ERR (svn_repos_open (&repos, opt_state->repository_path, pool));

@@ -480,8 +481,9 @@
                                 apr_file_open_stdin, pool));

   /* Have the parser dump feedback to STDOUT. */
-  SVN_ERR (create_stdio_stream (&stdout_stream,
-                                apr_file_open_stdout, pool));
+  if (! opt_state->quiet)
+    SVN_ERR (create_stdio_stream (&stdout_stream,
+                                  apr_file_open_stdout, pool));

   SVN_ERR (svn_repos_load_fs (repos, stdin_stream, stdout_stream,
                               opt_state->uuid_action, opt_state->parent_dir,


In a bit of insomnia induced hacking, update the svnadmin client to use the
notify-aware load API.

* subversion/svnadmin/main.c
  (repos_notify_handler): Handle the updated notification actions.
  (subcommand_load): Use the updated API.

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

--- subversion/svnadmin/main.c
+++ subversion/svnadmin/main.c
@@ -660,16 +660,15 @@
                      apr_pool_t *scratch_pool)
 {
   svn_stream_t *feedback_stream = baton;
+  apr_size_t len;

   switch (notify->action)
   {
     case svn_repos_notify_warning:
-      {
-        apr_size_t len = strlen(notify->warning);
-        svn_error_clear(svn_stream_write(feedback_stream, notify->warning,
-                                         &len));
-        return;
-      }
+      len = strlen(notify->warning);
+      svn_error_clear(svn_stream_write(feedback_stream, notify->warning,
+                                       &len));
+      return;

     case svn_repos_notify_dump_rev_end:
       svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
@@ -715,6 +714,78 @@
                                         _("done.\n")));
       return;

+    case svn_repos_notify_load_txn_committed:
+      if (notify->old_revision == SVN_INVALID_REVNUM)
+        {
+          svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                            _("\n------- Committed revision %ld >>>\n\n"),
+                            notify->new_revision));
+        }
+      else
+        {
+          svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                            _("\n------- Committed new rev %ld"
+                              " (loaded from original rev %ld"
+                              ") >>>\n\n"), notify->new_revision,
+                              notify->old_revision));
+        }
+      return;
+
+    case svn_repos_notify_load_node_start:
+      {
+        switch (notify->node_action)
+        {
+          case svn_node_action_change:
+            svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                                  _("     * editing path : %s ..."),
+                                  notify->path));
+            break;
+
+          case svn_node_action_delete:
+            svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                                  _("     * deleting path : %s ..."),
+                                  notify->path));
+            break;
+
+          case svn_node_action_add:
+            svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                                  _("     * adding path : %s ..."),
+                                  notify->path));
+            break;
+
+          case svn_node_action_replace:
+            svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                                  _("     * replacing path : %s ..."),
+                                  notify->path));
+            break;
+
+        }
+      }
+      return;
+
+    case svn_repos_notify_load_node_done:
+      len = 7;
+      svn_error_clear(svn_stream_write(feedback_stream, _(" done.\n"), &len));
+      return;
+
+    case svn_repos_notify_load_copied_node:
+      len = 9;
+      svn_error_clear(svn_stream_write(feedback_stream, "COPIED...", &len));
+      return;
+
+    case svn_repos_notify_load_txn_start:
+      svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                                _("<<< Started new transaction, based on "
+                                  "original revision %ld\n"),
+                                notify->old_revision));
+      return;
+
+    case svn_repos_notify_load_normalized_mergeinfo:
+      svn_error_clear(svn_stream_printf(feedback_stream, scratch_pool,
+                                _(" removing '\\r' from %s ..."),
+                                SVN_PROP_MERGEINFO));
+      return;
+
     default:
       return;
   }
@@ -862,11 +933,12 @@
   if (! opt_state->quiet)
     stdout_stream = recode_stream_create(stdout, pool);

-  SVN_ERR(svn_repos_load_fs2(repos, stdin_stream, stdout_stream,
+  SVN_ERR(svn_repos_load_fs3(repos, stdin_stream,
                              opt_state->uuid_action, opt_state->parent_dir,
                              opt_state->use_pre_commit_hook,
                              opt_state->use_post_commit_hook,
-                             check_cancel, NULL, pool));
+                             !opt_state->quiet ? repos_notify_handler : NULL,
+                             stdout_stream, check_cancel, NULL, pool));

   return SVN_NO_ERROR;
 }


Thanks to D.J. Heap for pointing out a misleading progress message,
in (already resolved) issue #1579:

* subversion/svnadmin/main.c
  (subcommand_recover): Don't claim that the lock is acquired and
    recovery begun when we don't know this to be true.

--- subversion/svnadmin/main.c
+++ subversion/svnadmin/main.c
@@ -523,8 +523,7 @@
   svn_repos_t *repos;
   struct svnadmin_opt_state *opt_state = baton;

-  printf ("Acquiring exclusive lock on repository db.\n"
-          "Recovery is running, please stand by...");
+  printf ("Please wait; recovering the repository may take some time...\n");
   fflush (stdout);

   SVN_ERR (svn_repos_recover (opt_state->repository_path, pool));


added comments to marks_struct.c

added comments to marks_struct.c

--- C/marks_struct.c
+++ C/marks_struct.c
@@ -1,10 +1,17 @@
+/* Create a student structure which contain 3 fields such as Rollno, Marks and
+   name of a student.
+   Enter the details of a student by user as Rollno,name and 3 subject marks
+   and name of the student
+  a)Find the total marks of a student?
+  b)Find highest marks among the 3 subjects? */
+
 #include <stdio.h>
 struct result
 {
 	int rno, mrks[5];
 	char nm;
 }res;
-void main()
+int main()
 {
 	int i,total;
 	total = 0;
@@ -24,4 +31,5 @@
 	printf("marks:%d\n",res.mrks[i]);
 	}
 	printf("\n\n\t Total is : %d",total);
+	return 0;
 }


error: pathspec 'CPP/Syntax/For.c' did not match any file(s) known to git

--- CPP/Syntax/For.c
+++ CPP/Syntax/For.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+int main () {
+    for (int x = 0; x < 10; x++) {
+    	printf("%d\n", x);
+    	if (x % 2 == 0) {
+    		x++;
+    		continue;
+    	}
+    }
+}
+
+//https://pt.stackoverflow.com/q/80589/101


changing for // comments to /* */... to much java lately

--- common/source/library/globus_object.c
+++ common/source/library/globus_object.c
@@ -51,7 +51,7 @@

 static int s_object_destroy (void)
 {
-//    return local_mutex_destroy(&s_object_ref_mutex);
+/*    return local_mutex_destroy(&s_object_ref_mutex); */
 }

 #include "version.h"


void linux suspend and hibernate

void linux suspend and hibernate

--- rbin/src/dwm/ryans_dwm_config.h
+++ rbin/src/dwm/ryans_dwm_config.h
@@ -82,9 +82,9 @@

 /* lock, sleep, hibernate, (or some combination thereof) */
 static const char *lockcmd[]      = { "sh", "-c", "slock", NULL };
-static const char *sleepcmd[]     = { "sh", "-c", "slock & { sleep 1; systemctl suspend; }", NULL };
-static const char *hibernatecmd[] = { "sh", "-c", "slock & { sleep 1; sudo s2disk; }", NULL };
-static const char *hybridcmd[]    = { "sh", "-c", "slock & { sleep 1; sudo s2both; }", NULL };
+static const char *sleepcmd[]     = { "sh", "-c", "slock & { sleep 1; sudo zzz; }",    NULL };
+static const char *hibernatecmd[] = { "sh", "-c", "slock & { sleep 1; sudo ZZZ; }",    NULL };
+static const char *hybridcmd[]    = { "sh", "-c", "slock & { sleep 1; sudo ZZZ -H; }", NULL };

 static Key keys[] = {
     /* modifier                     key        function        argument */


system: fix brownout ISR triggering assert on single-core configs.

ISR handler was incorrectly calling stall other cpu even on single core systems

Closes https://github.com/espressif/esp-idf/issues/9456

--- components/esp_system/port/brownout.c
+++ components/esp_system/port/brownout.c
@@ -41,8 +41,14 @@
      * cleared manually.
      */
     brownout_hal_intr_clear();
+
     // Stop the other core.
-    esp_cpu_stall(!esp_cpu_get_core_id());
+#if !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE
+    const uint32_t core_id = esp_cpu_get_core_id();
+    const uint32_t other_core_id = (core_id == 0) ? 1 : 0;
+    esp_cpu_stall(other_core_id);
+#endif
+
     esp_reset_reason_set_hint(ESP_RST_BROWNOUT);
 #if CONFIG_SPI_FLASH_BROWNOUT_RESET
     if (spi_flash_brownout_need_reset()) {


auth: Don't crash when setting valueless default/override_fields to passdb.

--- src/auth/passdb-template.c
+++ src/auth/passdb-template.c
@@ -51,7 +51,7 @@
 	i_assert((count % 2) == 0);
 	for (i = 0; i < count; i += 2) {
 		if (args[i+1] == NULL)
-			value = NULL;
+			value = "";
 		else {
 			str_truncate(str, 0);
 			var_expand(str, args[i+1], table);


Pass NULL instead of InvalidOid for pointer argument

MetaTrackAddUpdInternal() takes a HeapTuple as argument, which in
turn is defined as a pointer to a HeapTupleData structure. Pass
NULL rather than InvalidOid as that gets treated as a null pointer
constant causing a compiler warning:

heap.c:750:13: warning: expression which evaluates to zero treated
               as a null pointer constant of type 'HeapTuple'
               (aka 'struct HeapTupleData *')
      [-Wnon-literal-null-conversion]

--- src/backend/catalog/heap.c
+++ src/backend/catalog/heap.c
@@ -747,7 +747,7 @@

 	MetaTrackAddUpdInternal(classid, objoid, relowner,
 							actionname, subtype,
-							rel, InvalidOid);
+							rel, NULL);

 	heap_close(rel, RowExclusiveLock);


Apply 03-CVE-2011-4516-and-CVE-2011-4517 patch from debian libjasper-dev (1.900.1-13) package

--- 3rdparty/libjasper/jpc_cs.c
+++ 3rdparty/libjasper/jpc_cs.c
@@ -743,6 +743,10 @@
 		return -1;
 	}
 	compparms->numrlvls = compparms->numdlvls + 1;
+	if (compparms->numrlvls > JPC_MAXRLVLS) {
+		jpc_cox_destroycompparms(compparms);
+		return -1;
+	}
 	if (prtflag) {
 		for (i = 0; i < compparms->numrlvls; ++i) {
 			if (jpc_getuint8(in, &tmp)) {
@@ -1330,7 +1334,7 @@
 	jpc_crgcomp_t *comp;
 	uint_fast16_t compno;
 	crg->numcomps = cstate->numcomps;
-	if (!(crg->comps = jas_alloc2(cstate->numcomps, sizeof(uint_fast16_t)))) {
+	if (!(crg->comps = jas_alloc2(cstate->numcomps, sizeof(jpc_crgcomp_t)))) {
 		return -1;
 	}
 	for (compno = 0, comp = crg->comps; compno < cstate->numcomps;


memory hints for condition variable

memory hints for condition variable

--- hoomd/hpmc/IntegratorHPMCMonoGPU.h
+++ hoomd/hpmc/IntegratorHPMCMonoGPU.h
@@ -347,6 +347,23 @@
     GlobalArray<unsigned int>(1, this->m_exec_conf).swap(m_condition);
     TAG_ALLOCATION(m_condition);

+    #ifdef __HIP_PLATFORM_NVCC__
+    if (this->m_exec_conf->allConcurrentManagedAccess())
+        {
+        // set memory hints
+        auto gpu_map = this->m_exec_conf->getGPUIds();
+        cudaMemAdvise(m_condition.get(), sizeof(unsigned int), cudaMemAdviseSetPreferredLocation, gpu_map[0]);
+        cudaMemPrefetchAsync(m_condition.get(), sizeof(unsigned int), gpu_map[0]);
+
+        for (unsigned int idev = 0; idev < this->m_exec_conf->getNumActiveGPUs(); ++idev)
+            {
+            cudaMemAdvise(m_condition.get(), sizeof(unsigned int), cudaMemAdviseSetAccessedBy, gpu_map[idev]);
+            }
+        cudaMemAdvise(m_condition.get(), sizeof(unsigned int), cudaMemAdviseSetAccessedBy, cudaCpuDeviceId);
+        CHECK_CUDA_ERROR();
+        }
+    #endif
+
     GlobalArray<unsigned int> excell_size(0, this->m_exec_conf);
     m_excell_size.swap(excell_size);
     TAG_ALLOCATION(m_excell_size);
@@ -370,6 +387,7 @@
             cudaMemAdvise(m_counters.get()+idev*m_counters.getPitch(), sizeof(hpmc_counters_t)*m_counters.getPitch(), cudaMemAdviseSetPreferredLocation, gpu_map[idev]);
             cudaMemPrefetchAsync(m_counters.get()+idev*m_counters.getPitch(), sizeof(hpmc_counters_t)*m_counters.getPitch(), gpu_map[idev]);
             }
+        CHECK_CUDA_ERROR();
         }
     #endif


Fixed cache sizing bug

Fixed cache sizing bug

--- FFND/setdbin.c
+++ FFND/setdbin.c
@@ -2644,7 +2644,7 @@
 			if (PINFO_MATE(pinfo) && PINFO_BYTES_LEFT(pinfo))
 			{
 				if (PINFO_MATE_IS_BUFFER(pinfo))
-					cache_size = max(cache_size, PINFO_MATE_BYTES_LEFT(pinfo));
+					cache_size = max(cache_size, max(PINFO_BYTES_LEFT(pinfo), PINFO_MATE_BYTES_LEFT(pinfo))); /* too conservative?  Maybe get rid of PINFO_MATE_BYTES_LEFT */
 				else
 				{
 					unsigned long out_fsize; /* guess output file size */


Fixed stupid bit mangling on index fields Changed field read/write code for special case aligned, non-aligned read/write ok marco@

--- dev/acpi/dsdt.c
+++ dev/acpi/dsdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.c,v 1.78 2007/02/06 18:56:31 jordan Exp $ */
+/* $OpenBSD: dsdt.c,v 1.79 2007/02/13 04:40:00 jordan Exp $ */
 /*
  * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
  *
@@ -1025,6 +1025,26 @@
 	}
 }

+void *aml_getbuffer(struct aml_value *, int *);
+
+void *
+aml_getbuffer(struct aml_value *val, int *bitlen)
+{
+	switch (val->type) {
+	case AML_OBJTYPE_INTEGER:
+	case AML_OBJTYPE_STATICINT:
+		*bitlen = aml_intlen;
+		return &val->v_integer;
+	case AML_OBJTYPE_BUFFER:
+	case AML_OBJTYPE_STRING:
+		*bitlen = val->length<<3;
+		return val->v_buffer;
+	default:
+		aml_die("getvbi");
+	}
+	return NULL;
+}
+
 /*
  * Buffer/Region: read/write to bitfields
  */
@@ -1032,25 +1052,55 @@
 aml_fieldio(struct aml_scope *scope, struct aml_value *field,
     struct aml_value *res, int mode)
 {
-	struct aml_value *pop, *tmp;
+	struct aml_value *pop, tf;
 	int bpos, blen, aligned, mask;
+	void    *iobuf, *iobuf2;
 	uint64_t iobase;

 	pop = field->v_field.ref1;
 	bpos = field->v_field.bitpos;
 	blen = field->v_field.bitlen;
+
+	dnprintf(55,"--fieldio: %s [%s] bp:%.4x bl:%.4x\n",
+		 mode == ACPI_IOREAD ? "rd" : "wr",
+		 aml_nodename(field->node),
+		 bpos, blen);

 	aml_lockfield(scope, field);
 	switch (field->v_field.type) {
 	case AMLOP_INDEXFIELD:
 		/* Set Index */
+		memcpy(&tf, field->v_field.ref2, sizeof(struct aml_value));
+		tf.v_field.bitpos += (bpos & 7);
+		tf.v_field.bitlen  = blen;
+
 		aml_setvalue(scope, pop, NULL, bpos>>3);
-		aml_fieldio(scope, field->v_field.ref2, res, mode);
+		aml_fieldio(scope, &tf, res, mode);
+#ifdef ACPI_DEBUG
+		dnprintf(55, "-- post indexfield %x,%x @ %x,%x\n",
+		       bpos & 3, blen,
+		       field->v_field.ref2->v_field.bitpos,
+		       field->v_field.ref2->v_field.bitlen);
+		iobuf = aml_getbuffer(res, &aligned);
+		aml_dump(aligned>>3, iobuf);
+#endif
 		break;
 	case AMLOP_BANKFIELD:
 		/* Set Bank */
+		memcpy(&tf, field->v_field.ref2, sizeof(struct aml_value));
+		tf.v_field.bitpos += (bpos & 7);
+		tf.v_field.bitlen  = blen;
+
 		aml_setvalue(scope, pop, NULL, field->v_field.ref3);
-		aml_fieldio(scope, field->v_field.ref2, res, mode);
+		aml_fieldio(scope, &tf, res, mode);
+#ifdef ACPI_DEBUG
+		dnprintf(55, "-- post bankfield %x,%x @ %x,%x\n",
+		       bpos & 3, blen,
+		       field->v_field.ref2->v_field.bitpos,
+		       field->v_field.ref2->v_field.bitlen);
+		iobuf = aml_getbuffer(res, &aligned);
+		aml_dump(aligned>>3, iobuf);
+#endif
 		break;
 	case AMLOP_FIELD:
 		/* This is an I/O field */
@@ -1074,6 +1124,11 @@
 			break;
 		}

+		/* Pre-allocate return value for reads */
+		if (mode == ACPI_IOREAD)
+			_aml_setvalue(res, AML_OBJTYPE_BUFFER,
+				      (field->v_field.bitlen+7)>>3, NULL);
+
 		/* Get aligned bitpos/bitlength */
 		blen = ((bpos & mask) + blen + mask) & ~mask;
 		bpos = bpos & ~mask;
@@ -1081,6 +1136,70 @@
 		    blen == field->v_field.bitlen);
 		iobase = pop->v_opregion.iobase;

+		/* Check for aligned reads/writes */
+		if (aligned) {
+			iobuf = aml_getbuffer(res, &aligned);
+			aml_gasio(scope->sc, pop->v_opregion.iospace,
+				  iobase, pop->v_opregion.iolen, bpos, blen, mask+1,
+				  iobuf, mode);
+#ifdef ACPI_DEBUG
+			dnprintf(55, "aligned: %s @ %.4x:%.4x + %.4x\n",
+			       mode == ACPI_IOREAD ? "rd" : "wr",
+			       bpos, blen, aligned);
+			aml_dump(blen>>3, iobuf);
+#endif
+		}
+		else if (mode == ACPI_IOREAD) {
+			iobuf = acpi_os_malloc(blen>>3);
+			aml_gasio(scope->sc, pop->v_opregion.iospace,
+				  iobase, pop->v_opregion.iolen, bpos, blen, mask+1,
+				  iobuf, mode);
+
+			/* ASSERT: res is buffer type as it was set above */
+			aml_bufcpy(res->v_buffer, 0, iobuf,
+				   field->v_field.bitpos & mask,
+				   field->v_field.bitlen);
+
+#ifdef ACPI_DEBUG
+			dnprintf(55,"non-aligned read: %.4x:%.4x : ",
+			    field->v_field.bitpos & mask,
+			    field->v_field.bitlen);
+			aml_dump(blen>>3, iobuf);
+			dnprintf(55,"post-read: ");
+			aml_dump((field->v_field.bitlen+7)>>3, res->v_buffer);
+#endif
+			acpi_os_free(iobuf);
+		}
+		else {
+			iobuf = acpi_os_malloc(blen>>3);
+			switch (AML_FIELD_UPDATE(field->v_field.flags)) {
+			case AML_FIELD_WRITEASONES:
+				memset(iobuf, 0xFF, blen>>3);
+				break;
+			case AML_FIELD_PRESERVE:
+				aml_gasio(scope->sc, pop->v_opregion.iospace,
+					  iobase, pop->v_opregion.iolen, bpos, blen, mask+1,
+					  iobuf, ACPI_IOREAD);
+				break;
+			}
+			/* Copy into IOBUF */
+			iobuf2 = aml_getbuffer(res, &aligned);
+			aml_bufcpy(iobuf, field->v_field.bitpos & mask,
+				   iobuf2, 0,
+				   field->v_field.bitlen);
+
+#ifdef ACPI_DEBUG
+			dnprintf(55,"non-aligned write: %.4x:%.4x : ",
+				 field->v_field.bitpos & mask,
+				 field->v_field.bitlen);
+			aml_dump(blen>>3, iobuf);
+#endif
+			aml_gasio(scope->sc, pop->v_opregion.iospace,
+				  iobase, pop->v_opregion.iolen, bpos, blen, mask+1,
+				  iobuf, mode);
+
+			acpi_os_free(iobuf);
+		}
 		/* Verify that I/O is in range */
 #if 0
 		/*
@@ -1094,46 +1213,6 @@
 			    pop->v_opregion.iolen, bpos+blen);
 		}
 #endif
-
-		/* Allocate temporary space for field read
-		 * XXX: not needed if aligned??
-		 */
-		tmp = aml_alloctmp(scope, 1);
-		_aml_setvalue(tmp, AML_OBJTYPE_BUFFER, blen>>3, NULL);
-		if (mode == ACPI_IOREAD) {
-			/* Read from GAS space */
-			aml_gasio(scope->sc, pop->v_opregion.iospace,
-			    iobase, pop->v_opregion.iolen, bpos, blen, mask+1,
-			    tmp->v_buffer, ACPI_IOREAD);
-			aml_setbufint(res, field->v_field.bitpos & mask,
-			    field->v_field.bitlen, tmp);
-		} else {
-			switch (AML_FIELD_UPDATE(field->v_field.flags)) {
-			case AML_FIELD_WRITEASONES:
-				if (!aligned) {
-					dnprintf(50, "fpr:WriteOnes\n");
-					memset(tmp->v_buffer, 0xff, tmp->length);
-				}
-				break;
-			case AML_FIELD_PRESERVE:
-				if (!aligned) {
-					/* Non-aligned I/O: need to read current value */
-					/* XXX: only need to read 1st/last mask chunk */
-					dnprintf(50, "fpr:Preserve\n");
-					aml_gasio(scope->sc,
-					    pop->v_opregion.iospace, iobase,
-					    pop->v_opregion.iolen, bpos, blen,
-					    mask+1, tmp->v_buffer, ACPI_IOREAD);
-				}
-				break;
-			}
-			/* Copy Bits into destination buffer */
-			aml_getbufint(res, field->v_field.bitpos & mask,
-			    field->v_field.bitlen, tmp);
-			aml_gasio(scope->sc, pop->v_opregion.iospace,
-			    iobase, pop->v_opregion.iolen, bpos, blen, mask+1,
-			    tmp->v_buffer, ACPI_IOWRITE);
-		}
 		break;
 	default:
 		/* This is a buffer field */
@@ -1859,6 +1938,7 @@

 	if (res == NULL)
 		res = aml_alloctmp(scope, 1);
+
 #ifdef ACPI_DEBUG
 	dnprintf(10, "calling [%s] (%d args)\n",
 	    aml_nodename(node), scope->nargs);
@@ -3177,6 +3257,7 @@
 	"Windows 2001 SP2",
 	"Windows 2001 SP3",
 	"Windows 2001 SP4",
+	"Windows 2006",
 	NULL
 };


Delete rmtx.c

Delete rmtx.c

--- components/libc/compilers/dlib/rmtx.c
+++ components/libc/compilers/dlib/rmtx.c
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2006-2021, RT-Thread Development Team
- *
- * SPDX-License-Identifier: Apache-2.0
- *
- * Change Logs:
- * Date           Author       Notes
- * 2015-01-28     Bernard      first version
- */
-#include <rtthread.h>
-#include <yfuns.h>
-
-/*
- * for IAR compiler, we recommand to define _DLIB_THREAD_SUPPORT
- * as 2 for dlib multi-thread support.
- */
-
-#if _DLIB_THREAD_SUPPORT
-typedef void* _Rmtx;
-void _Mtxinit(_Rmtx *m)
-{
-    rt_mutex_t mutex;
-
-    RT_ASSERT(m != RT_NULL);
-
-    mutex = (rt_mutex_t)m;
-    rt_mutex_init(mutex, "iarMtx", RT_IPC_FLAG_FIFO);
-}
-
-void _Mtxdst(_Rmtx *m)
-{
-    rt_mutex_t mutex;
-
-    RT_ASSERT(m != RT_NULL);
-
-    mutex = (rt_mutex_t)m;
-    rt_mutex_detach(mutex);
-}
-
-void _Mtxlock(_Rmtx *m)
-{
-    rt_mutex_t mutex;
-
-    RT_ASSERT(m != RT_NULL);
-
-    mutex = (rt_mutex_t)m;
-    rt_mutex_take(mutex, RT_WAITING_FOREVER);
-}
-
-void _Mtxunlock(_Rmtx *m)
-{
-    rt_mutex_t mutex;
-
-    RT_ASSERT(m != RT_NULL);
-
-    mutex = (rt_mutex_t)m;
-    rt_mutex_release(mutex);
-}
-#endif
-


Correct the placement of an avcodec_default_release_buffer call from r1065.

Fixes #439, no apparent new problems found in normal use.

--- FFusionCodec.c
+++ FFusionCodec.c
@@ -1347,7 +1347,6 @@
 	if(buf->ffmpegUsing)
 	{
 		buf->ffmpegUsing = 0;
-		avcodec_default_release_buffer(s, buf->frame);
 		releaseBuffer(s, buf);
 	}
 }
@@ -1364,8 +1363,11 @@
 	buf->retainCount--;
 //	FFusionGlobals glob = (FFusionGlobals)s->opaque;
 //	FFusionDebugPrint("%p Released Buffer %p #%d to %d.\n", glob, buf, buf->frameNumber, buf->retainCount);
-	if(!buf->retainCount)
+	if(!buf->retainCount && !buf->ffmpegUsing)
+	{
 		buf->returnedFrame.data[0] = NULL;
+		avcodec_default_release_buffer(s, buf->frame);
+	}
 }

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


spine-simple-sapp.c: improve comments

spine-simple-sapp.c: improve comments

--- sapp/spine-simple-sapp.c
+++ sapp/spine-simple-sapp.c
@@ -190,11 +190,11 @@
         // creation. Alternatively we could store the atlas handle and image index,
         // and then call sspine_get_image_info() in the fetch callback, up to you.
         //
-        // Also important to note: all image fetch requests go into the same
+        // Also important to note: all image fetch requests load their into the same
         // buffer. This is fine because sokol-fetch has been configured
         // with num_lanes=1, this will cause all requests on the same
-        // channel to be serialized and not run in parallel. That way
-        // the same buffer can be reused even if there are multiple images.
+        // channel to be serialized (not run in parallel). That way
+        // the same buffer can be reused even if there are multiple atlas images.
         // The downside is that loading multiple images would take longer.
         sfetch_send(&(sfetch_request_t){
             .path = fileutil_get_path(img_info.filename, path_buf,  sizeof(path_buf)),


Delete FYAutoLayout.h

Delete FYAutoLayout.h

--- FYAutoLayout.h
+++ FYAutoLayout.h
@@ -1,40 +0,0 @@
-/*
-    使用注意:
-        一定要在子控件添加到父控件之后, 才能进行布局
-
-    三个核心函数:
-        fy_makeConstraints     (构建约束)
-        fy_updateConstraints   (修改已经建立的约束, 如果约束不存在, 会在控制台输出错误, 影响性能)
-        fy_remakeConstraints   (删除已经建立的所有约束, 然后重新生成约束)
-
-    等于函数:
-        equalTo(对象)
-        equalTo(对象.fy_对象属性)
-        fy_equalTo(结构体)
-
-    偏移函数:
-        offset(CGFloat)
-        fy_offset(结构体)
-        make.width.equalTo(view).multipliedBy(0.5);
-
-    make.edges.equalTo(view).fy_offset(UIEdgeInsetsMake(20, 20, 20, 20));
-    (一行代码布局)
-    make.top.equalTo(self.fy_topLayoutGuide);
-    (辅助布局)
-    self.view layoutIfNeeded
-    (立即生成布局)
- */
-
-#import "FYUtilities.h"
-#import "View+FYAdditions.h"
-#import "View+FYShorthandAdditions.h"
-#import "ViewController+FYAdditions.h"
-#import "NSArray+FYAdditions.h"
-#import "NSArray+FYShorthandAdditions.h"
-#import "FYConstraint.h"
-#import "FYCompositeConstraint.h"
-#import "FYViewAttribute.h"
-#import "FYViewConstraint.h"
-#import "FYConstraintMaker.h"
-#import "FYLayoutConstraint.h"
-#import "NSLayoutConstraint+FYDebugAdditions.h"


Before reading an ascii label, initialize with defaults so that
getasciipartspec() has a sectorisize in case it needs one.

Approved by:	re/jhb

--- sbin/bsdlabel/bsdlabel.c
+++ sbin/bsdlabel/bsdlabel.c
@@ -656,6 +656,7 @@
 	int lineno = 0, errors = 0;
 	int i;

+	makelabel("auto", lp);
 	bzero(&part_set, sizeof(part_set));
 	bzero(&part_size_type, sizeof(part_size_type));
 	bzero(&part_offset_type, sizeof(part_offset_type));


fix a weird typo

fix a weird typo

--- Yep/Yep-Bridging-Header.h
+++ Yep/Yep-Bridging-Header.h
@@ -2,5 +2,5 @@
 //  Use this file to import your target's public headers that you would like to expose to Swift.
 //

-#import <UIKit/UIkit.h>
+#import <UIKit/UIKit.h>
 #import "APService.h"


Make "ifconfig" with no arguments equivalent to "ifconfig -a".

--- sbin/ifconfig/ifconfig.c
+++ sbin/ifconfig/ifconfig.c
@@ -390,6 +390,10 @@
 	if (uponly && downonly)
 		usage();

+	/* no arguments is equivalent to '-a' */
+	if (!namesonly && argc < 1)
+		all = 1;
+
 	/* -a and -l allow an address family arg to limit the output */
 	if (all || namesonly) {
 		if (argc > 1)


Eliminate an overly clever indirection

Eliminate an overly clever indirection

For some reason the CCacheEntry class anticipates having both value
types and pointer types and the cache value type. I scanned through the
code base and only found pointer types. Remove the unnecessary
cleverness and directly use m_val as a pointer.

--- src/backend/gporca/libgpos/include/gpos/memory/CCacheEntry.h
+++ src/backend/gporca/libgpos/include/gpos/memory/CCacheEntry.h
@@ -30,40 +30,6 @@

 namespace gpos
 {
-//prototype
-template <class T, class K>
-class CCacheAccessor;
-
-
-
-// Template to convert object (any data type) to pointer
-template <class T>
-struct ptr
-{
-	T *
-	operator()(T &obj)
-	{
-		return &obj;
-	}
-
-	const T *
-	operator()(const T &obj)
-	{
-		return &obj;
-	}
-};
-
-// Template specialization for pointer type
-template <class T>
-struct ptr<T *>
-{
-	T *
-	operator()(T *ptr)
-	{
-		return ptr;
-	}
-};
-
 //---------------------------------------------------------------------------
 //	@class:
 //		CCacheEntry
@@ -152,21 +118,21 @@
 	ULONG
 	RefCount() const
 	{
-		return (ULONG) ptr<T>()(m_val)->RefCount();
+		return (ULONG) m_val->RefCount();
 	}

 	// increments value's ref-count
 	void
 	IncRefCount()
 	{
-		ptr<T>()(m_val)->AddRef();
+		m_val->AddRef();
 	}

 	//decrements value's ref-count
 	void
 	DecRefCount()
 	{
-		ptr<T>()(m_val)->Release();
+		m_val->Release();
 	}

 	// sets the gclock counter for an entry; useful for updating counter upon access


Adding #warning macros when SystemConfiguration or CoreServices frameworks are missing, causing functionality to be missing or altered

--- AFNetworking/AFHTTPClient.h
+++ AFNetworking/AFHTTPClient.h
@@ -78,6 +78,12 @@
     AFNetworkReachabilityStatusReachableViaWWAN = 1,
     AFNetworkReachabilityStatusReachableViaWiFi = 2,
 } AFNetworkReachabilityStatus;
+#else
+#warning "SystemConfiguration framework not found in project, or not included in precompiled header. Network reachability functionality will not be available."
+#endif
+
+#ifndef __UTTYPE__
+#warning "CoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available."
 #endif

 typedef enum {


High-level changes (user visible):
o  Implement -c (clear) to clear previously kept headers (note that
   dumps not cleared will remain until -c is used),
o  Implement -f (force) to allow re-saving a previously saved dump,
o  Implement -k (keep) and make clearing the dump header the default,
o  Implement -v (verbose) and make most output conditional upon it,
o  Emit minimal output for the non-verbose case with the assumption
   that savecore is run mostly from within /etc/rc,
o  Update usage message to reflect what is and what's not,
o  mark -d as obsolete.

Low-level changes:
o  Rename devname to device, for devname mirrors a global declaration
   and GCC 3.x warns about it,
o  Open the dump device R/W for clear and !keep to work,
o  Reorder the locals of DoFile according to style(9),
o  Remove newlines from strings passed to warn* and err*,
o  Use stat(2) to check if a dump has been saved before,
o  Truncate existing core and info files to support force,
o  First check for the magic and the version before we complain about
   parity errors. This prevents emitting parity error messages when
   there's no dump,
o  Keep track of the number of headers found and the number of headers
   saved to support the minimal output,
o  Close files we opened in DoFile. Not critical, but cleaner.

--- sbin/savecore/savecore.c
+++ sbin/savecore/savecore.c
@@ -35,26 +35,32 @@
  * $FreeBSD$
  */

-#include <stdio.h>
-#include <unistd.h>
+#include <sys/types.h>
+#include <sys/disk.h>
+#include <sys/kerneldump.h>
+#include <sys/stat.h>
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <fstab.h>
-#include <errno.h>
+#include <md5.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <time.h>
-#include <md5.h>
 #include <unistd.h>
-#include <sys/disk.h>
-#include <sys/kerneldump.h>
+
+int clear, force, keep, verbose;	/* flags */
+int nfound, nsaved;			/* statistics */

 static void
-printheader(FILE *f, const struct kerneldumpheader *h, const char *devname,
+printheader(FILE *f, const struct kerneldumpheader *h, const char *device,
     const char *md5)
 {
 	uint64_t dumplen;
 	time_t t;

-	fprintf(f, "Good dump found on device %s\n", devname);
+	fprintf(f, "Good dump found on device %s\n", device);
 	fprintf(f, "  Architecture: %s\n", h->architecture);
 	fprintf(f, "  Architecture version: %d\n",
 	    dtoh32(h->architectureversion));
@@ -72,111 +78,171 @@

 static void
-DoFile(const char *devname)
+DoFile(const char *device)
 {
-	int fd, fdcore, fdinfo, error, wl;
+	struct kerneldumpheader kdhf, kdhl;
+	char buf[BUFSIZ];
+	struct stat sb;
 	off_t mediasize, dumpsize, firsthd, lasthd;
-	u_int sectorsize;
-	struct kerneldumpheader kdhf, kdhl;
 	char *md5;
 	FILE *info;
-	char buf[BUFSIZ];
+	int fd, fdcore, fdinfo, error, wl;
+	u_int sectorsize;
+
+	if (verbose)
+		printf("Checking for kernel dump on device %s\n", device);

 	mediasize = 0;
-	fd = open(devname, O_RDONLY);
+	fd = open(device, O_RDWR);
 	if (fd < 0) {
-		warn("%s", devname);
+		warn("%s", device);
 		return;
 	}
 	error = ioctl(fd, DIOCGMEDIASIZE, &mediasize);
 	if (!error)
 		error = ioctl(fd, DIOCGSECTORSIZE, &sectorsize);
 	if (error) {
-		warn("Couldn't find media and/or sector size of %s)", devname);
-		return;
-	}
-	printf("Mediasize = %lld\n", (long long)mediasize);
-	printf("Sectorsize = %u\n", sectorsize);
+		warn("Couldn't find media and/or sector size of %s)", device);
+		goto closefd;
+	}
+
+	if (verbose) {
+		printf("Mediasize = %lld\n", (long long)mediasize);
+		printf("Sectorsize = %u\n", sectorsize);
+	}
+
 	lasthd = mediasize - sectorsize;
 	lseek(fd, lasthd, SEEK_SET);
 	error = read(fd, &kdhl, sizeof kdhl);
 	if (error != sizeof kdhl) {
-		warn("Error Reading last dump header at offset %lld in %s",
-		    (long long)lasthd, devname);
-		return;
-	}
+		warn("Error reading last dump header at offset %lld in %s",
+		    (long long)lasthd, device);
+		goto closefd;
+	}
+	if (memcmp(kdhl.magic, KERNELDUMPMAGIC, sizeof kdhl.magic)) {
+		if (verbose)
+			warnx("Magic mismatch on last dump header on %s",
+			    device);
+		goto closefd;
+	}
+	if (dtoh32(kdhl.version) != KERNELDUMPVERSION) {
+		warnx("Unknown version (%d) in last dump header on %s",
+		    dtoh32(kdhl.version), device);
+		goto closefd;
+	}
+
+	nfound++;
+	if (clear)
+		goto nuke;
+
 	if (kerneldump_parity(&kdhl)) {
-		warnx("Parity error on last dump header on %s\n", devname);
-		return;
-	}
-	if (memcmp(kdhl.magic, KERNELDUMPMAGIC, sizeof kdhl.magic)) {
-		warnx("Magic mismatch on last dump header on %s\n", devname);
-		return;
-	}
-	if (dtoh32(kdhl.version) != KERNELDUMPVERSION) {
-		warnx("Unknown version (%d) in last dump header on %s\n",
-		    dtoh32(kdhl.version), devname);
-		return;
+		warnx("Parity error on last dump header on %s", device);
+		goto closefd;
 	}
 	dumpsize = dtoh64(kdhl.dumplength);
 	firsthd = lasthd - dumpsize - sizeof kdhf;
 	lseek(fd, firsthd, SEEK_SET);
 	error = read(fd, &kdhf, sizeof kdhf);
 	if (error != sizeof kdhf) {
-		warn("Error Reading first dump header at offset %lld in %s",
-		    (long long)firsthd, devname);
-		return;
+		warn("Error reading first dump header at offset %lld in %s",
+		    (long long)firsthd, device);
+		goto closefd;
 	}
 	if (memcmp(&kdhl, &kdhf, sizeof kdhl)) {
-		warn("First and last dump headers disagree on %s\n", devname);
-		return;
+		warn("First and last dump headers disagree on %s", device);
+		goto closefd;
 	}
 	md5 = MD5Data((unsigned char *)&kdhl, sizeof kdhl, NULL);
 	sprintf(buf, "%s.info", md5);
-	fdinfo = open(buf, O_WRONLY | O_CREAT | O_EXCL, 0600);
-	if (fdinfo < 0 && errno == EEXIST) {
-		printf("Dump on device %s already saved\n", devname);
-		return;
-	}
+
+	/*
+	 * See if the dump has been saved already. Don't save the dump
+	 * again, unless 'force' is in effect.
+	 */
+	if (stat(buf, &sb) == 0) {
+		if (!force) {
+			if (verbose)
+				printf("Dump on device %s already saved\n",
+				    device);
+			goto closefd;
+		}
+	} else if (errno != ENOENT) {
+		warn("Error while checking for pre-saved core file");
+		goto closefd;
+	}
+
+	/*
+	 * Create or overwrite any existing files.
+	 */
+	fdinfo = open(buf, O_WRONLY | O_CREAT | O_TRUNC, 0600);
 	if (fdinfo < 0) {
 		warn("%s", buf);
-		return;
+		goto closefd;
 	}
 	sprintf(buf, "%s.core", md5);
-	fdcore = open(buf, O_WRONLY | O_CREAT | O_EXCL, 0600);
+	fdcore = open(buf, O_WRONLY | O_CREAT | O_TRUNC, 0600);
 	if (fdcore < 0) {
 		warn("%s", buf);
-		return;
+		close(fdinfo);
+		goto closefd;
 	}
 	info = fdopen(fdinfo, "w");
-	printheader(stdout, &kdhl, devname, md5);
-	printheader(info, &kdhl, devname, md5);
-	printf("Saving dump to file...\n");
+
+	if (verbose)
+		printheader(stdout, &kdhl, device, md5);
+
+	printf("Saving dump to file %s\n", buf);
+	nsaved++;
+
+	printheader(info, &kdhl, device, md5);
+
 	while (dumpsize > 0) {
 		wl = sizeof(buf);
 		if (wl > dumpsize)
 			wl = dumpsize;
 		error = read(fd, buf, wl);
 		if (error != wl) {
-			warn("read error on %s\n", devname);
-			return;
+			warn("Read error on %s", device);
+			goto closeall;
 		}
 		error = write(fdcore, buf, wl);
 		if (error != wl) {
-			warn("write error on %s.core file\n", md5);
-			return;
+			warn("Write error on %s.core file", md5);
+			goto closeall;
 		}
 		dumpsize -= wl;
 	}
-	close (fdinfo);
-	close (fdcore);
-	printf("Dump saved\n");
+	close(fdinfo);
+	close(fdcore);
+
+	if (verbose)
+		printf("Dump saved\n");
+
+ nuke:
+	if (clear || !keep) {
+		if (verbose)
+			printf("Clearing dump header\n");
+		memset(&kdhl, 0, sizeof kdhl);
+		lseek(fd, lasthd, SEEK_SET);
+		error = write(fd, &kdhl, sizeof kdhl);
+		if (error != sizeof kdhl)
+			warn("Error while clearing the dump header");
+	}
+	close(fd);
+	return;
+
+ closeall:
+	close(fdinfo);
+	close(fdcore);
+
+ closefd:
+	close(fd);
 }

 static void
 usage(void)
 {
-	errx(1, "usage: ...");
+	errx(1, "usage: savecore [-cfkv] [directory [device...]]");
 	exit (1);
 }

@@ -189,10 +255,18 @@
 	while ((ch = getopt(argc, argv, "cdfkN:vz")) != -1)
 		switch(ch) {
 		case 'c':
-		case 'd':
+			clear = 1;
+			break;
+		case 'k':
+			keep = 1;
+			break;
 		case 'v':
+			verbose = 1;
+			break;
 		case 'f':
-		case 'k':
+			force = 1;
+			break;
+		case 'd':	/* Obsolete */
 		case 'N':
 		case 'z':
 		case '?':
@@ -222,5 +296,12 @@
 		for (i = 0; i < argc; i++)
 			DoFile(argv[i]);
 	}
+
+	/* Emit minimal output. */
+	if (nfound == 0)
+		printf("No dumps found\n");
+	else if (nsaved == 0)
+		printf("No unsaved dumps found\n");
+
 	return (0);
 }


Adding _AFNETWORKING_ definition to header

--- AFNetworking/AFNetworking.h
+++ AFNetworking/AFNetworking.h
@@ -23,6 +23,9 @@
 #import <Foundation/Foundation.h>
 #import <Availability.h>

+#ifndef _AFNETWORKING_
+#define _AFNETWORKING_
+
 #import <AFNetworking/AFURLConnectionOperation.h>

 #import <AFNetworking/AFHTTPRequestOperation.h>
@@ -38,3 +41,5 @@
 #import <AFNetworking/AFNetworkActivityIndicatorManager.h>
 #import <AFNetworking/UIImageView+AFNetworking.h>
 #endif
+
+#endif /* _AFNETWORKING_ */


setkey -> addkey

setkey -> addkey

--- APPS/user/userInputModule.c
+++ APPS/user/userInputModule.c
@@ -1,4 +1,4 @@
-/*	$Header: /usr/sctpCVS/APPS/user/userInputModule.c,v 1.36 2006-03-23 19:33:07 lei Exp $ */
+/*	$Header: /usr/sctpCVS/APPS/user/userInputModule.c,v 1.37 2006-03-23 19:45:32 lei Exp $ */

 /*
  * Copyright (C) 2002-2006 Cisco Systems Inc,
@@ -211,7 +211,7 @@
 static int cmd_setv4mapped(char *argv[], int argc);

 static int cmd_addauth(char *argv[], int argc);
-static int cmd_setkey(char *argv[], int argc);
+static int cmd_addkey(char *argv[], int argc);
 static int cmd_deletekey(char *argv[], int argc);
 static int cmd_setactivekey(char *argv[], int argc);
 static int cmd_getactivekey(char *argv[], int argc);
@@ -507,8 +507,8 @@

     {"addauth", "addauth - add a chunk(s) as requiring auth",
      cmd_addauth},
-    {"setkey", "setkey - set a shared key",
-     cmd_setkey},
+    {"addkey", "addkey - set a shared key",
+     cmd_addkey},
     {"deletekey", "deletekey - delete a shared key",
      cmd_deletekey},
     {"setactivekey", "setactivekey - set a shared key as active",
@@ -5330,14 +5330,14 @@
     return (0);
 }

-static int cmd_setkey(char *argv[], int argc) {
+static int cmd_addkey(char *argv[], int argc) {
 #if defined(__BSD_SCTP_STACK__)
     char optval[512];
     struct sctp_authkey *key;
     int keylen;

     if ((argc < 2) || (argc > 3)) {
-	printf("Expected: setkey <key_id> <key_text> [<optional assoc id>]\n");
+	printf("Expected: addkey <key_id> <key_text> [<optional assoc id>]\n");
 	return (-1);
     }
     bzero(optval, sizeof(optval));


remove unused var

remove unused var

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

--- src/bin/e_backlight_main.c
+++ src/bin/e_backlight_main.c
@@ -57,7 +57,6 @@
 {
    int i;
    int level;
-   char *valstr;
    const char *f;
    int maxlevel = 0, curlevel = -1;
    Eina_List *devs;


Get multi-dispatch cache to handle natively typed arguments.

--- src/binder/multidispatch.c
+++ src/binder/multidispatch.c
@@ -333,16 +333,25 @@
 find_in_cache(PARROT_INTERP, Rakudo_md_cache *cache, PMC *capture, INTVAL num_args) {
     INTVAL arg_tup[MD_CACHE_MAX_ARITY];
     INTVAL i, j, entries, t_pos;
+    struct Pcc_cell * pc_positionals;

     /* If it's zero-arity, return result right off. */
     if (num_args == 0)
         return cache->zero_arity;

     /* Create arg tuple. */
+    if (capture->vtable->base_type == enum_class_CallContext)
+        GETATTR_CallContext_positionals(interp, capture, pc_positionals);
+    else
+        return NULL;
     for (i = 0; i < num_args; i++) {
-        PMC *arg = Rakudo_cont_decontainerize(interp,
-            VTABLE_get_pmc_keyed_int(interp, capture, i));
-        arg_tup[i] = STABLE(arg)->type_cache_id | (REPR(arg)->defined(interp, arg) ? 1 : 0);
+        if (pc_positionals[i].type == BIND_VAL_OBJ) {
+            PMC *arg = Rakudo_cont_decontainerize(interp, pc_positionals[i].u.p);
+            arg_tup[i] = STABLE(arg)->type_cache_id | (REPR(arg)->defined(interp, arg) ? 1 : 0);
+        }
+        else {
+            arg_tup[i] = (pc_positionals[i].type << 1) | 1;
+        }
     }

     /* Look through entries. */
@@ -378,6 +387,7 @@
 add_to_cache(PARROT_INTERP, Rakudo_md_cache *cache, PMC *capture, INTVAL num_args, PMC *result) {
     INTVAL arg_tup[MD_CACHE_MAX_ARITY];
     INTVAL i, entries, ins_type;
+    struct Pcc_cell * pc_positionals;

     /* If it's zero arity, just stick it in that slot. */
     if (num_args == 0) {
@@ -392,10 +402,18 @@
         return;

     /* Create arg tuple. */
+    if (capture->vtable->base_type == enum_class_CallContext)
+        GETATTR_CallContext_positionals(interp, capture, pc_positionals);
+    else
+        return;
     for (i = 0; i < num_args; i++) {
-        PMC *arg = Rakudo_cont_decontainerize(interp,
-            VTABLE_get_pmc_keyed_int(interp, capture, i));
-        arg_tup[i] = STABLE(arg)->type_cache_id | (REPR(arg)->defined(interp, arg) ? 1 : 0);
+        if (pc_positionals[i].type == BIND_VAL_OBJ) {
+            PMC *arg = Rakudo_cont_decontainerize(interp, pc_positionals[i].u.p);
+            arg_tup[i] = STABLE(arg)->type_cache_id | (REPR(arg)->defined(interp, arg) ? 1 : 0);
+        }
+        else {
+            arg_tup[i] = (pc_positionals[i].type << 1) | 1;
+        }
     }

     /* If there's no entries yet, need to do some allocation. */


Greatly weaken the 'could never work' analysis - the initial version was wrong. Add a note about how we probably can catch a bunch of obvious cases.

--- src/binder/multidispatch.c
+++ src/binder/multidispatch.c
@@ -894,7 +894,6 @@
 Rakudo_md_ct_dispatch(PARROT_INTERP, PMC *dispatcher, PMC *capture, PMC **result) {
     /* Get hold of the candidates. */
     Rakudo_Code *code_obj  = (Rakudo_Code *)PMC_data(dispatcher);
-    INTVAL       num_cands = VTABLE_elements(interp, code_obj->dispatchees);
     INTVAL       has_cache = !PMC_IS_NULL(code_obj->dispatcher_cache);
     Rakudo_md_candidate_info **cands = obtain_candidate_list(interp, has_cache,
         dispatcher, code_obj);
@@ -902,8 +901,9 @@
     /* Current dispatch state. */
     Rakudo_md_candidate_info **cur_candidate = cands;
     INTVAL type_mismatch, type_check_count;
-    INTVAL all_native = 1;
-    INTVAL seen_all = 0;
+    INTVAL all_native  = 1;
+    INTVAL seen_all    = 0;
+    INTVAL arity_match = 0;
     PMC *cur_result = PMCNULL;

     /* Grab positionals. */
@@ -941,6 +941,9 @@
             cur_candidate++;
             continue;
         }
+
+        /* If we got this far, something at least matched on arity. */
+        arity_match = 1;

         /* Check if it's admissable by type. */
         type_check_count = (*cur_candidate)->num_types > num_args ?
@@ -1012,9 +1015,21 @@
         }
     }

-    /* If we saw all the candidates, and got no result, and we got this far,
-     * then the dispatch could never work. */
-    if (seen_all && PMC_IS_NULL(cur_result)) {
+    /* If we saw all the candidates, and got no result, and the arity never
+     * matched, then there's no way this could dispatch.
+     * Note: it's tempting to do some type based "could never work" analysis
+     * here also. However, it's non-trivial. When we get a type in here, it's
+     * a widest type. That's why we never go looking more than one group, or
+     * a native group and then one more, up the set of possible candidates -
+     * because we'd end up picking the wrong one. The "could never work"
+     * analysis suffers a similar issue here. At best, we can do some kind of
+     * "silly casts" style analysis. Given we have a candidate that wants an
+     * Int:
+     *   * If we get Mu, we know Int ~~ Mu so it's at least plausbile
+     *   * If we get Str, we know Int !~~ Str, so it's impossible.
+     * So should be possible to do something in this space.
+     */
+    if (seen_all && !arity_match && PMC_IS_NULL(cur_result)) {
         return MD_CT_NO_WAY;
     }


revert changes committed between r1.25 and 1.26.
this breaks some RT2560 adapters.

pointed out by krw@ and Pierre Riteau.

--- dev/ic/rt2560.c
+++ dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: rt2560.c,v 1.30 2007/01/03 18:16:43 claudio Exp $  */
+/*	$OpenBSD: rt2560.c,v 1.31 2007/01/24 17:56:24 damien Exp $  */

 /*-
  * Copyright (c) 2005, 2006
@@ -2628,6 +2628,8 @@
 	/* set basic rate set (will be updated later) */
 	RAL_WRITE(sc, RT2560_ARSP_PLCP_1, 0x153);

+	rt2560_set_txantenna(sc, 1);
+	rt2560_set_rxantenna(sc, 1);
 	rt2560_set_slottime(sc);
 	rt2560_update_plcp(sc);
 	rt2560_update_led(sc, 0, 0);
@@ -2639,9 +2641,6 @@
 		rt2560_stop(ifp, 1);
 		return EIO;
 	}
-
-	rt2560_set_txantenna(sc, 1);
-	rt2560_set_rxantenna(sc, 1);

 	/* set default BSS channel */
 	ic->ic_bss->ni_chan = ic->ic_ibss_chan;


Remove a debug printf that crept into the last commit. ok deraadt@

--- dev/mii/ciphy.c
+++ dev/mii/ciphy.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: ciphy.c,v 1.10 2006/02/28 08:13:47 jsg Exp $	*/
+/*	$OpenBSD: ciphy.c,v 1.11 2006/02/28 12:37:15 jsg Exp $	*/
 /*	$FreeBSD: ciphy.c,v 1.1 2004/09/10 20:57:45 wpaul Exp $	*/
 /*
  * Copyright (c) 2004
@@ -338,7 +338,6 @@
 	speed = status & CIPHY_AUXCSR_SPEED;

 	if (strcmp(sc->mii_dev.dv_parent->dv_cfdata->cf_driver->cd_name, "nfe") == 0) {
-		printf("ciphy nfe fixup called!\n");
 		/* need to set for 2.5V RGMII for NVIDIA adapters */
 		PHY_SETBIT(sc, CIPHY_MII_ECTL1, CIPHY_INTSEL_RGMII);
 		PHY_SETBIT(sc, CIPHY_MII_ECTL1, CIPHY_IOVOL_2500MV);


Update MOE_Timer.h

Update MOE_Timer.h

--- Core/MOE_Timer.h
+++ Core/MOE_Timer.h
@@ -29,6 +29,14 @@
 #ifndef PF_TIMER_SRC
 #define PF_TIMER_SRC PF_TIMER_SRC
 typedef uint32 (*PF_TIMER_SRC)(void);
+#endif
+
+#ifdef __DEBUG_ENABLE
+MOE_TMR_ADD_CNT_UPDATE       (sg_u32TmrAddCnt++)       /* Update the added timer count   */
+MOE_TMR_DEL_CNT_UPDATE       (sg_u32TmrDelCnt++)       /* Update the deleted timer count */
+#else
+MOE_TMR_ADD_CNT_UPDATE
+MOE_TMR_DEL_CNT_UPDATE
 #endif

 typedef uint32 (*PF_TIMER_CB)(void *pPara);


MFC all relevant changes since beginning of 2006:

- Correct spelling of 3DNow!;
- Add two new CPUID bits for AMD CPUs, i. e., SVM and extended APIC register;
- Add another Intel CPU feature flag, xTPR (Send Task Priority Messages);
- Remove bogus white-space diff to current.

--- sys/amd64/amd64/identcpu.c
+++ sys/amd64/amd64/identcpu.c
@@ -228,7 +228,7 @@
 				"\014<b11>"
 				"\015<b12>"
 				"\016CX16"	/* CMPXCHG16B Instruction */
-				"\017<b14>"
+				"\017XTPR"	/* Send Task Priority Messages*/
 				"\020<b15>"
 				"\021<b16>"
 				"\022<b17>"
@@ -291,8 +291,8 @@
 				"\034RDTSCP"	/* RDTSCP */
 				"\035<b28>"	/* Undefined */
 				"\036LM"	/* 64 bit long mode */
-				"\0373DNow+"	/* AMD 3DNow! Extensions */
-				"\0403DNow"	/* AMD 3DNow! */
+				"\0373DNow!+"	/* AMD 3DNow! Extensions */
+				"\0403DNow!"	/* AMD 3DNow! */
 				);
 			}

@@ -301,8 +301,8 @@
 				"\020"
 				"\001LAHF"	/* LAHF/SAHF in long mode */
 				"\002CMP"	/* CMP legacy */
-				"\003<b2>"
-				"\004<b3>"
+				"\003SVM"	/* Secure Virtual Mode */
+				"\004ExtAPIC"	/* Extended APIC register */
 				"\005CR8"	/* CR8 in legacy mode */
 				"\006<b5>"
 				"\007<b6>"
@@ -338,7 +338,7 @@
 			    "AuthenticAMD") == 0) {
 				cpu_feature &= ~CPUID_HTT;
 				if (bootverbose)
-	    				printf("\n    HTT bit cleared - FreeBSD"
+	    				printf("\nHTT bit cleared - FreeBSD"
 					    " does not have licensing issues"
 					    " requiring it.\n");
 			}
@@ -355,7 +355,8 @@
 			else if (strcmp(cpu_vendor, "GenuineIntel") == 0 &&
 			    (cpu_high >= 4)) {
 				cpuid_count(4, 0, regs);
-				cmp = ((regs[0] & 0xfc000000) >> 26) + 1;
+				if ((regs[0] & 0x1f) != 0)
+					cmp = ((regs[0] >> 26) & 0x3f) + 1;
 			}
 			if (cmp > 1)
 				printf("\n  Cores per package: %d", cmp);


Fix precedence warning when compiling kernel with clang.

Approved by:	re (kib)
Submitted by:	dim
MFC after:	1 week


Deny to switch into banked video mode when it is not available.  Some
users has reported corrupted display with old video cards.

Submitted by:	Michal Mertl <mime traveller cz>

--- sys/dev/syscons/scvidctl.c
+++ sys/dev/syscons/scvidctl.c
@@ -389,7 +389,8 @@
 	if (info.vi_width * info.vi_height / 8 > info.vi_window_size)
 	    return ENODEV;
     } else if (info.vi_mem_model == V_INFO_MM_DIRECT) {
-	if ((info.vi_depth != 15) && (info.vi_depth != 16) &&
+	if (!(info.vi_flags & V_INFO_LINEAR) &&
+	    (info.vi_depth != 15) && (info.vi_depth != 16) &&
 	    (info.vi_depth != 24) && (info.vi_depth != 32))
 	    return ENODEV;
     } else


Don't take the detour over VOP_STRATEGY from spec_getpages, call our own strategy directly.

--- sys/fs/specfs/spec_vnops.c
+++ sys/fs/specfs/spec_vnops.c
@@ -862,7 +862,7 @@
 	cnt.v_vnodepgsin += pcount;

 	/* Do the input. */
-	VOP_STRATEGY(bp->b_vp, bp);
+	spec_xstrategy(bp->b_vp, bp);

 	s = splbio();


Finish the support for partition labels and add it to the XML.

--- sys/geom/part/g_part_gpt.c
+++ sys/geom/part/g_part_gpt.c
@@ -83,6 +83,9 @@
 	struct gpt_ent		ent;
 };

+static void g_gpt_printf_utf16(struct sbuf *, uint16_t *, size_t);
+static void g_gpt_utf8_to_utf16(const uint8_t *, uint16_t *, size_t);
+
 static int g_part_gpt_add(struct g_part_table *, struct g_part_entry *,
     struct g_part_parms *);
 static int g_part_gpt_bootcode(struct g_part_table *, struct g_part_parms *);
@@ -225,7 +228,6 @@
 	char *buf, *p;
 	unsigned int idx, sectors, tblsz;
 	int error;
-	uint16_t ch;

 	pp = cp->provider;
 	table->lba[elt] = hdr->hdr_lba_table;
@@ -256,8 +258,8 @@
 		ent->ent_lba_start = le64dec(p + 32);
 		ent->ent_lba_end = le64dec(p + 40);
 		ent->ent_attr = le64dec(p + 48);
-		for (ch = 0; ch < sizeof(ent->ent_name)/2; ch++)
-			ent->ent_name[ch] = le16dec(p + 56 + ch * 2);
+		/* Keep UTF-16 in little-endian. */
+		bcopy(p + 56, ent->ent_name, sizeof(ent->ent_name));
 	}

 	g_free(buf);
@@ -356,7 +358,9 @@
 		entry->ent.ent_attr = 0;
 		bzero(entry->ent.ent_name, sizeof(entry->ent.ent_name));
 	}
-	/* XXX label */
+	if (gpp->gpp_parms & G_PART_PARM_LABEL)
+		g_gpt_utf8_to_utf16(gpp->gpp_label, entry->ent.ent_name,
+		    sizeof(entry->ent.ent_name));
 	return (0);
 }

@@ -445,7 +449,10 @@
 		sbuf_printf_uuid(sb, &entry->ent.ent_type);
 	} else if (entry != NULL) {
 		/* confxml: partition entry information */
-		// sbuf_printf(sb, "%s%s\n", indent, NULL);
+		sbuf_printf(sb, "%s", indent);
+		g_gpt_printf_utf16(sb, entry->ent.ent_name,
+		    sizeof(entry->ent.ent_name) >> 1);
+		sbuf_printf(sb, "\n");
 		sbuf_printf(sb, "%s<rawtype>", indent);
 		sbuf_printf_uuid(sb, &entry->ent.ent_type);
 		sbuf_printf(sb, "</rawtype>\n");
@@ -478,7 +485,9 @@
 		if (error)
 			return (error);
 	}
-	/* XXX label */
+	if (gpp->gpp_parms & G_PART_PARM_LABEL)
+		g_gpt_utf8_to_utf16(gpp->gpp_label, entry->ent.ent_name,
+		    sizeof(entry->ent.ent_name));
 	return (0);
 }

@@ -777,15 +786,14 @@
 	return (error);
 }

-#if 0
 static void
-g_gpt_to_utf8(struct sbuf *sb, uint16_t *str, size_t len)
+g_gpt_printf_utf16(struct sbuf *sb, uint16_t *str, size_t len)
 {
 	u_int bo;
 	uint32_t ch;
 	uint16_t c;

-	bo = BYTE_ORDER;
+	bo = LITTLE_ENDIAN;	/* GPT is little-endian */
 	while (len > 0 && *str != 0) {
 		ch = (bo == BIG_ENDIAN) ? be16toh(*str) : le16toh(*str);
 		str++, len--;
@@ -807,6 +815,7 @@
 		} else if (ch == 0xfeff) /* BOM (U+FEFF) unswapped. */
 			continue;

+		/* Write the Unicode character in UTF-8 */
 		if (ch < 0x80)
 			sbuf_printf(sb, "%c", ch);
 		else if (ch < 0x800)
@@ -821,4 +830,71 @@
 			    0x80 | ((ch >> 6) & 0x3f), 0x80 | (ch & 0x3f));
 	}
 }
-#endif
+
+static void
+g_gpt_utf8_to_utf16(const uint8_t *s8, uint16_t *s16, size_t s16len)
+{
+	size_t s16idx, s8idx;
+	uint32_t utfchar;
+	unsigned int c, utfbytes;
+
+	s8idx = s16idx = 0;
+	utfchar = 0;
+	utfbytes = 0;
+	bzero(s16, s16len << 1);
+	while (s8[s8idx] != 0 && s16idx < s16len) {
+		c = s8[s8idx++];
+		if ((c & 0xc0) != 0x80) {
+			/* Initial characters. */
+			if (utfbytes != 0) {
+				/* Incomplete encoding of previous char. */
+				s16[s16idx++] = htole16(0xfffd);
+			}
+			if ((c & 0xf8) == 0xf0) {
+				utfchar = c & 0x07;
+				utfbytes = 3;
+			} else if ((c & 0xf0) == 0xe0) {
+				utfchar = c & 0x0f;
+				utfbytes = 2;
+			} else if ((c & 0xe0) == 0xc0) {
+				utfchar = c & 0x1f;
+				utfbytes = 1;
+			} else {
+				utfchar = c & 0x7f;
+				utfbytes = 0;
+			}
+		} else {
+			/* Followup characters. */
+			if (utfbytes > 0) {
+				utfchar = (utfchar << 6) + (c & 0x3f);
+				utfbytes--;
+			} else if (utfbytes == 0)
+				utfbytes = ~0;
+		}
+		/*
+		 * Write the complete Unicode character as UTF-16 when we
+		 * have all the UTF-8 charactars collected.
+		 */
+		if (utfbytes == 0) {
+			/*
+			 * If we need to write 2 UTF-16 characters, but
+			 * we only have room for 1, then we truncate the
+			 * string by writing a 0 instead.
+			 */
+			if (utfchar >= 0x10000 && s16idx < s16len - 1) {
+				s16[s16idx++] =
+				    htole16(0xd800 | ((utfchar >> 10) - 0x40));
+				s16[s16idx++] =
+				    htole16(0xdc00 | (utfchar & 0x3ff));
+			} else
+				s16[s16idx++] = (utfchar >= 0x10000) ? 0 :
+				    htole16(utfchar);
+		}
+	}
+	/*
+	 * If our input string was truncated, append an invalid encoding
+	 * character to the output string.
+	 */
+	if (utfbytes != 0 && s16idx < s16len)
+		s16[s16idx++] = htole16(0xfffd);
+}


Don't try enumerating APICs when running on top of xen
(fixes boot on 64-bit dom0s)

MFC after:	1 month

--- sys/i386/i386/local_apic.c
+++ sys/i386/i386/local_apic.c
@@ -1005,6 +1005,7 @@
 void
 apic_register_enumerator(struct apic_enumerator *enumerator)
 {
+#ifndef XEN
 #ifdef INVARIANTS
 	struct apic_enumerator *apic_enum;

@@ -1015,6 +1016,7 @@
 	}
 #endif
 	SLIST_INSERT_HEAD(&enumerators, enumerator, apic_next);
+#endif
 }

 /*


Rev. 228360 moved the call to cpu_set_upcall() to happen before
td_proc gets initialized in td (=newtd). Use td0 instead.

MFC after:	3 days

--- sys/ia64/ia64/vm_machdep.c
+++ sys/ia64/ia64/vm_machdep.c
@@ -192,7 +192,7 @@
 	bcopy(td0->td_pcb, pcb, sizeof(*pcb));
 	pcb->pcb_special.bspstore = td->td_kstack;
 	pcb->pcb_special.pfs = 0;
-	pcb->pcb_current_pmap = vmspace_pmap(td->td_proc->p_vmspace);
+	pcb->pcb_current_pmap = vmspace_pmap(td0->td_proc->p_vmspace);
 	pcb->pcb_special.sp = (uintptr_t)tf - 16;
 	pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline);
 	cpu_set_fork_handler(td, (void (*)(void*))fork_return, td);


Synchronize with sys/i386/i386/userconfig.c revision 1.87.

--- sys/pc98/i386/userconfig.c
+++ sys/pc98/i386/userconfig.c
@@ -46,7 +46,7 @@
  ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  **
- **      $Id: userconfig.c,v 1.29 1997/03/15 15:44:05 kato Exp $
+ **      $Id: userconfig.c,v 1.30 1997/06/23 09:31:58 kato Exp $
  **/

 /**
@@ -2372,7 +2372,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *      $Id: userconfig.c,v 1.29 1997/03/15 15:44:05 kato Exp $
+ *      $Id: userconfig.c,v 1.30 1997/06/23 09:31:58 kato Exp $
  */

 #include "scbus.h"
@@ -2777,8 +2777,8 @@
     int curr_item, first_time, extended = 0;
     static char *choices[] = {
 	" Skip kernel configuration and continue with installation ",
-	" Start kernel configuration in Visual mode                ",
-	" Start kernel configuration in CLI mode (experts only)    ",
+	" Start kernel configuration in full-screen visual mode    ",
+	" Start kernel configuration in CLI mode                   ",
     };

     clear();


Trim trailing white space, clean up comment line wrapping and formatting.

Document mac_associate_nfsd_label().

Obtained from:	TrustedBSD Project

--- sys/security/mac/mac_vfs.c
+++ sys/security/mac/mac_vfs.c
@@ -13,7 +13,7 @@
  * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA
  * CHATS research program.
  *
- * This software was enhanced by SPARTA ISSO under SPAWAR contract
+ * This software was enhanced by SPARTA ISSO under SPAWAR contract
  * N66001-04-C-6019 ("SEFOS").
  *
  * Redistribution and use in source and binary forms, with or without
@@ -74,8 +74,8 @@
 #include <security/mac/mac_internal.h>

 /*
- * Warn about EA transactions only the first time they happen.
- * Weak coherency, no locking.
+ * Warn about EA transactions only the first time they happen.  No locking on
+ * this variable.
  */
 static int	ea_warn_once = 0;

@@ -978,9 +978,11 @@

 	/*
 	 * Multi-phase commit.  First check the policies to confirm the
-	 * change is OK.  Then commit via the filesystem.  Finally,
-	 * update the actual vnode label.  Question: maybe the filesystem
-	 * should update the vnode at the end as part of VOP_SETLABEL()?
+	 * change is OK.  Then commit via the filesystem.  Finally, update
+	 * the actual vnode label.
+	 *
+	 * Question: maybe the filesystem should update the vnode at the end
+	 * as part of VOP_SETLABEL()?
 	 */
 	error = mac_check_vnode_relabel(cred, vp, intlabel);
 	if (error)
@@ -988,10 +990,10 @@

 	/*
 	 * VADMIN provides the opportunity for the filesystem to make
-	 * decisions about who is and is not able to modify labels
-	 * and protections on files.  This might not be right.  We can't
-	 * assume VOP_SETLABEL() will do it, because we might implement
-	 * that as part of vop_stdsetlabel_ea().
+	 * decisions about who is and is not able to modify labels and
+	 * protections on files.  This might not be right.  We can't assume
+	 * VOP_SETLABEL() will do it, because we might implement that as
+	 * part of vop_stdsetlabel_ea().
 	 */
 	error = VOP_ACCESS(vp, VADMIN, cred, curthread);
 	if (error)
@@ -1004,6 +1006,15 @@
 	return (0);
 }

+/*
+ * When a thread becomes an NFS server daemon, its credential may need to be
+ * updated to reflect this so that policies can recognize when file system
+ * operations originate from the network.
+ *
+ * At some point, it would be desirable if the credential used for each NFS
+ * RPC could be set based on the RPC context (i.e., source system, etc) to
+ * provide more fine-grained access control.
+ */
 void
 mac_associate_nfsd_label(struct ucred *cred)
 {


[http2] in the unit tests, no more call h2o_lcstris

--- t/00unit/lib/http2/hpack.c
+++ t/00unit/lib/http2/hpack.c
@@ -63,7 +63,7 @@
     ok(req.scheme.len == 4);
     ok(memcmp(req.scheme.base, H2O_STRLIT("http")) == 0);
     ok(req.headers.size == 1);
-    ok(h2o_lcstris(req.headers.entries[0].name->base, req.headers.entries[0].name->len, H2O_STRLIT("cache-control")));
+    ok(h2o_memis(req.headers.entries[0].name->base, req.headers.entries[0].name->len, H2O_STRLIT("cache-control")));
     ok(h2o_lcstris(req.headers.entries[0].value.base, req.headers.entries[0].value.len, H2O_STRLIT("no-cache")));

     h2o_mem_clear_pool(&req.pool);
@@ -82,7 +82,7 @@
     ok(req.scheme.len == 5);
     ok(memcmp(req.scheme.base, H2O_STRLIT("https")) == 0);
     ok(req.headers.size == 1);
-    ok(h2o_lcstris(req.headers.entries[0].name->base, req.headers.entries[0].name->len, H2O_STRLIT("custom-key")));
+    ok(h2o_memis(req.headers.entries[0].name->base, req.headers.entries[0].name->len, H2O_STRLIT("custom-key")));
     ok(h2o_lcstris(req.headers.entries[0].value.base, req.headers.entries[0].value.len, H2O_STRLIT("custom-value")));

     h2o_hpack_dispose_header_table(&header_table);


Comment out some superfluous const declarations that cause cast warnings with gcc/alpha.  We have bcopy(const void *...) so casting a const foo *bar as in bcopy((caddr_t) bar,...) for bcopy seems to be fairly pointless in the first place, but there are too many of these to hack out at the moment.

--- dev/pci/if_de.c
+++ dev/pci/if_de.c
@@ -2287,8 +2287,8 @@
 {
     int idx1, idx2, idx3;

-    const tulip_srom_header_t *shp = (tulip_srom_header_t *) &sc->tulip_rombuf[0];
-    const tulip_srom_adapter_info_t *saip = (tulip_srom_adapter_info_t *) (shp + 1);
+    /* const */ tulip_srom_header_t *shp = (tulip_srom_header_t *) &sc->tulip_rombuf[0];
+    tulip_srom_adapter_info_t *saip = (tulip_srom_adapter_info_t *) (shp + 1);
     tulip_srom_media_t srom_media;
     tulip_media_info_t *mi = sc->tulip_mediainfo;
     const u_int8_t *dp;
@@ -2636,7 +2636,7 @@
 }

-static const struct {
+static /* const */ struct {
     void (*vendor_identify_nic)(tulip_softc_t * const sc);
     unsigned char vendor_oui[3];
 } tulip_vendors[] = {


fix a few printf; pval ok

fix a few printf; pval ok

--- dev/pci/if_re.c
+++ dev/pci/if_re.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: if_re.c,v 1.2 2004/06/05 07:39:55 pvalchev Exp $	*/
+/*	$OpenBSD: if_re.c,v 1.3 2004/06/05 17:26:12 deraadt Exp $	*/
 /*
  * Copyright (c) 1997, 1998-2003
  *	Bill Paul <wpaul@windriver.com>.  All rights reserved.
@@ -902,7 +902,7 @@

 	/* Allocate interrupt */
 	if (pci_intr_map(pa, &ih)) {
-		printf("%s: couldn't map interrupt\n", sc->sc_dev.dv_xname);
+		printf(": couldn't map interrupt\n");
 		error = ENXIO;
 		goto fail;
 	}
@@ -910,8 +910,7 @@
 	psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, re_intr, sc,
 	    sc->sc_dev.dv_xname);
 	if (psc->sc_ih == NULL) {
-		printf("%s: couldn't establish interrupt",
-		    sc->sc_dev.dv_xname);
+		printf(": couldn't establish interrupt");
 		if (intrstr != NULL)
 			printf(" at %s", intrstr);
 		goto fail;


Fix coding-style inconsistency (#10)

Fix coding-style inconsistency (#10)

--- r2io/cylang.h
+++ r2io/cylang.h
@@ -8,7 +8,7 @@
 G_BEGIN_DECLS

 enum {
-  CYLANG_COMPILER_ERROR_SYNTAX
+	CYLANG_COMPILER_ERROR_SYNTAX
 };

 char *cylang_compile(const char *code, GError **error);


target: msm8226: Use DMA pipe for splash logo

8x26 has only a single RGB pipe. Currently if userspace calls
prepare on RGB pipe during handoff, then fallback case happens
and VIG pipe is allocated. This leads to issues in case of secure
video content playback as VIG pipe is not available. To avoid
such issues, use DMA pipe instead of RGB for continuous splash
handoff.

Change-Id: Ie04d87b09dcc3020e659262c253a4e393118705e

--- target/msm8226/oem_panel.c
+++ target/msm8226/oem_panel.c
@@ -116,6 +116,12 @@
 	/* OEM can keep there panel spefic off instructions in this
 	function */
 	return NO_ERROR;
+}
+
+static void mdss_source_pipe_select(struct msm_panel_info *pinfo)
+{
+	/* Use DMA pipe for splash logo on 8x26 */
+	pinfo->use_dma_pipe = 1;
 }

 static void init_panel_data(struct panel_struct *panelstruct,
@@ -371,6 +377,7 @@
 	}

 	init_panel_data(panelstruct, pinfo, phy_db);
+	mdss_source_pipe_select(pinfo);

 	return ret;
 }


Fix small bug with large consequences

Fix small bug with large consequences

--- Base/include/MatrixSquare.h
+++ Base/include/MatrixSquare.h
@@ -79,12 +79,12 @@
             return numIterations;
           }

-          VectorBase<T, N> b;
           for(int i = 0; i < (N>>1); i++)
             b[i] = 1;

           b.Normalize();
           badEigenValue = true;
+          continue;
         }

         // Normalize


Remove dead code found by Coverity. All gotos to bailout occur after query has been freed and maxquerylen has been set to 0.

--- clients/mapiclient/dump.c
+++ clients/mapiclient/dump.c
@@ -343,9 +343,6 @@
 		mapi_close_handle(hdl);
 	} else if (mapi_error(mid))
 		mapi_explain(mid, stderr);
-
-	if (query != NULL && maxquerylen != 0)
-		free(query);

 	return 1;
 }


[SWAP-22] Fix replication.

[SWAP-22] Fix replication.

--- redis-4.0-rc2/src/replication.c
+++ redis-4.0-rc2/src/replication.c
@@ -747,9 +747,6 @@
             /* Update the server's status. */
             server.check_write_unresponse_num = listLength(server.clients) - server.special_clients_num;
             server.ssdb_status = MASTER_SSDB_SNAPSHOT_CHECK_WRITE;
-
-            /* Allow to update SSDB after backlog is created. */
-            server.is_allow_ssdb_write = ALLOW_SSDB_WRITE;

             server.check_write_begin_time = server.unixtime;

@@ -2852,8 +2849,10 @@
         }

         if (server.jdjr_mode && server.use_customized_replication) {
-            if (can_bgsave)
+            if (can_bgsave) {
                 startBgsaveForReplication(mincapa);
+                server.is_allow_ssdb_write = ALLOW_SSDB_WRITE;
+            }
         } else if (slaves_waiting &&
             (!server.repl_diskless_sync ||
              max_idle > server.repl_diskless_sync_delay)) {


Fix k20 parallel output

Fix k20 parallel output

--- clockless_block_arm_k20.h
+++ clockless_block_arm_k20.h
@@ -23,7 +23,7 @@
 		FastPin<6>::setOutput();
 		FastPin<20>::setOutput();
 		FastPin<21>::setOutput();
-		FastPin<25>::setOutput();
+		FastPin<5>::setOutput();
 		mPinMask = FastPin<2>::mask();
 		mPort = FastPin<2>::port();
 	}


make tf topic absolute instead of relative to prevent remapping with <group> tag

--- rosserial_client/src/ros_lib/tf/transform_broadcaster.h
+++ rosserial_client/src/ros_lib/tf/transform_broadcaster.h
@@ -43,7 +43,7 @@
   class TransformBroadcaster
   {
     public:
-      TransformBroadcaster() : publisher_("tf", &internal_msg) {}
+      TransformBroadcaster() : publisher_("/tf", &internal_msg) {}

       void init(ros::NodeHandle &nh)
       {


remote-curl.c: fix rpc_out()

remote-curl.c: fix rpc_out()

Remove the extraneous semicolon (';') at the end of the if statement
that allowed the code in its block to execute regardless of the
condition.

This fixes pushing to a smart http backend with chunked encoding.

Signed-off-by: Tay Ray Chuan <781f23e367a7ada1fde54f9860fdd95ca652794e@gmail.com>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>

--- remote-curl.c
+++ remote-curl.c
@@ -307,7 +307,7 @@
 		rpc->len = avail;
 	}

-	if (max < avail);
+	if (max < avail)
 		avail = max;
 	memcpy(ptr, rpc->buf + rpc->pos, avail);
 	rpc->pos += avail;


Add simpler API.

Add simpler API.

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

--- BindingShort.h
+++ BindingShort.h
@@ -0,0 +1,30 @@
+// This file is part of nbind, copyright (C) 2014-2015 BusFaster Ltd.
+// Released under the MIT license, see LICENSE.
+
+#pragma once
+
+#ifdef BUILDING_NODE_EXTENSION
+
+#include "Binding.h"
+
+#define NBIND_ERR(message) nbind::Bindings::setError(message)
+
+#define NBIND_CLASS(Name) \
+	template<class Bound> struct BindInvoker { \
+		BindInvoker(); \
+		nbind::BindClass<Name> linkage; \
+		nbind::BindDefiner<Name> definer; \
+	}; \
+	static struct BindInvoker<Name> bindInvoker##Name; \
+	template<class Bound> BindInvoker<Bound>::BindInvoker():definer(#Name)
+
+#define method(name) definer.function(#name, &Bound::name)
+#define constructor definer.constructor
+
+#define NBIND_INIT(moduleName) NODE_MODULE(moduleName, nbind::Bindings::initModule)
+
+#else
+
+#define NBIND_ERR(message)
+
+#endif


479329 -  extra decref in PKIX_PL_Cert_GetExtendedKeyUsage leads to dangling pointer. r=nelson

--- security/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.c
+++ security/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.c
@@ -2485,20 +2485,17 @@

                         /* save a cached copy in case it is asked for again */
                         cert->extKeyUsages = oidsList;
+                        oidsList = NULL;
                 }
-
-                PKIX_OBJECT_UNLOCK(cert);
-        }
-
-        if (cert->extKeyUsages){
-
-                PKIX_INCREF(cert->extKeyUsages);

                 PKIX_CHECK(PKIX_List_SetImmutable
                             (cert->extKeyUsages, plContext),
                             PKIX_LISTSETIMMUTABLEFAILED);
-        }
-
+
+                PKIX_OBJECT_UNLOCK(cert);
+        }
+
+        PKIX_INCREF(cert->extKeyUsages);
         *pKeyUsage = cert->extKeyUsages;

 cleanup:
@@ -2506,12 +2503,8 @@

         PKIX_FREE(oidAscii);
         PKIX_DECREF(pkixOID);
-
+        PKIX_DECREF(oidsList);
         CERT_DestroyOidSequence(extKeyUsage);
-
-        if (PKIX_ERROR_RECEIVED){
-                PKIX_DECREF(oidsList);
-        }

         PKIX_RETURN(CERT);
 }
@@ -2658,7 +2651,6 @@
         }

         PKIX_INCREF(cert->certPolicyInfos);
-
         *pPolicyInfo = cert->certPolicyInfos;

 cleanup:


wobbly made me do it

wobbly made me do it

--- src/bzadmin/OptionParser.h
+++ src/bzadmin/OptionParser.h
@@ -94,10 +94,13 @@
     T& var;
   };

+#ifdef _WIN32
   /** This is a specialization for @c string variables. It copies the
       entire parameter instead of just the first word (which the
       stream operator would have done). */
-  template<> class VariableParser<std::string> : public Parser {
+  template<>
+#endif
+      class VariableParser<std::string> : public Parser {
   public:
     VariableParser(std::string& variable, const std::string& usageText,
 		   const std::string& helpText)
@@ -110,9 +113,12 @@
     std::string& var;
   };

+#ifdef _WIN32
   /** This is a specialization for @c bool variables. It does not
       take a parameter, but just sets the variable to @c true. */
-  template<> class VariableParser<bool> : public Parser {
+  template<>
+#endif
+      class VariableParser<bool> : public Parser {
   public:
     VariableParser(bool& variable, const std::string& usageText,
 		   const std::string& helpText)


Bug 726134: document that the cert_NSSCertFromPKIXCert function in lib/certhigh/certvfypkix.c depends on nssCert being the first field of struct PKIX_PL_CertStruct.  r=rrelyea.

--- security/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.h
+++ security/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.h
@@ -51,7 +51,10 @@
 #endif

 struct PKIX_PL_CertStruct {
-        CERTCertificate *nssCert;
+        CERTCertificate *nssCert;  /* Must be the first field.  The
+                                    * cert_NSSCertFromPKIXCert function in
+                                    * lib/certhigh/certvfypkix.c depends on
+                                    * this. */
         CERTGeneralName *nssSubjAltNames;
         PLArenaPool *arenaNameConstraints;
         PKIX_PL_X500Name *issuer;


test: utilities to suppress death tests in release

error: pathspec 'test/entt/common/config.h' did not match any file(s) known to git

--- test/entt/common/config.h
+++ test/entt/common/config.h
@@ -0,0 +1,18 @@
+#ifndef ENTT_COMMON_CONFIG_H
+#define ENTT_COMMON_CONFIG_H
+
+namespace test {
+
+#ifdef NDEBUG
+#    define ENTT_DEBUG_TEST(Case, Test) TEST(Case, DISABLED_##Test)
+#    define ENTT_DEBUG_TEST_F(Case, Test) TEST_F(Case, DISABLED_##Test)
+#    define ENTT_DEBUG_TYPED_TEST(Case, Test) TYPED_TEST(Case, DISABLED_##Test)
+#else
+#    define ENTT_DEBUG_TEST(Case, Test) TEST(Case, Test)
+#    define ENTT_DEBUG_TEST_F(Case, Test) TEST_F(Case, Test)
+#    define ENTT_DEBUG_TYPED_TEST(Case, Test) TYPED_TEST(Case, Test)
+#endif
+
+} // namespace test
+
+#endif


Fix windows vs2017 build

Fix windows vs2017 build

--- aeron-client/src/main/cpp/util/BitUtil.h
+++ aeron-client/src/main/cpp/util/BitUtil.h
@@ -20,6 +20,10 @@
 #include <cstdint>
 #include <type_traits>
 #include <util/Exceptions.h>
+
+#if defined(_MSC_VER)
+#include <intrin.h>
+#endif

 namespace aeron { namespace util {


Added isEmpty

Added isEmpty

--- src/cbang/geom/Rectangle.h
+++ src/cbang/geom/Rectangle.h
@@ -292,6 +292,12 @@
     // Math
     bool isReal() const {return rmin.isReal() || rmax.isReal();}

+    bool isEmpty() const {
+      for (unsigned i = 0; i < DIM; i++)
+        if (rmin[i] == rmax[i]) return true;
+      return false;
+    }
+
     // Cast
     template <typename U>
     operator Rectangle<DIM, U>() const {


Setting Growl to 1.3.2.

Setting Growl to 1.3.2.

--HG--
branch : maintenance-1.3

--- GrowlVersion.h
+++ GrowlVersion.h
@@ -1,8 +1,8 @@
 #define COMMENT_1 DO NOT EDIT THE VERSION IN THIS FILE! Change the version in Release/Makefile instead, then run make version while in the Release directory.
 #define COMMENT_2 In case you're wondering why we're using #define for comments: This header is #imported into both Objective-C code and XML Info.plist files.

-#define GROWL_VERSION 1.3.1
-#define GROWL_VERSION_STRING "1.3.1"
+#define GROWL_VERSION 1.3.2
+#define GROWL_VERSION_STRING "1.3.2"

 #include "hgRevision.h"


[lex] Bitfieldize some booleans.

[lex] Bitfieldize some booleans.

Lets us fuse some branches into bit tests downstream. NFC.

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

--- include/clang/Lex/LiteralSupport.h
+++ include/clang/Lex/LiteralSupport.h
@@ -57,13 +57,13 @@
   NumericLiteralParser(StringRef TokSpelling,
                        SourceLocation TokLoc,
                        Preprocessor &PP);
-  bool hadError;
-  bool isUnsigned;
-  bool isLong;        // This is *not* set for long long.
-  bool isLongLong;
-  bool isFloat;       // 1.0f
-  bool isImaginary;   // 1.0i
-  uint8_t MicrosoftInteger;  // Microsoft suffix extension i8, i16, i32, or i64.
+  bool hadError : 1;
+  bool isUnsigned : 1;
+  bool isLong : 1;          // This is *not* set for long long.
+  bool isLongLong : 1;
+  bool isFloat : 1;         // 1.0f
+  bool isImaginary : 1;     // 1.0i
+  uint8_t MicrosoftInteger; // Microsoft suffix extension i8, i16, i32, or i64.

   bool isIntegerLiteral() const {
     return !saw_period && !saw_exponent;


res made some tweaks to the VC7 project templates and some headers
  to have VC8beta2 compile CS happily.

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

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

--- include/csutil/win32/SpecStrings.h
+++ include/csutil/win32/SpecStrings.h
@@ -0,0 +1,5 @@
+/* Both VC8 and the latest Platform SDK define the same macros in two files
+ * (sal.h/SpecStrings.h), unfortunately, there's no way (some #define etc.)
+ * to disable the definitions in one of the file... so we trick VC into
+ * thinking it would actually have already included one of those files. */
+#pragma once


Compilation fix: requires including cassert.

--- include/efficientsorts-merge-inl.h
+++ include/efficientsorts-merge-inl.h
@@ -3,6 +3,7 @@

 #include <cstring> // memmove()
 #include <iostream> // std::min(), std::max()
+#include <cassert>

 namespace sorting {
 namespace efficient {


Bug 438157: memcapable failure on OS X

Bug 438157: memcapable failure on OS X

--- clients/memcapable.c
+++ clients/memcapable.c
@@ -454,8 +454,8 @@
  * @param cc the expected command
  * @param status the expected status
  */
-static enum test_return validate_response_header(response *rsp,
-                                                 uint8_t cc, uint16_t status)
+static enum test_return do_validate_response_header(response *rsp,
+                                                    uint8_t cc, uint16_t status)
 {
   verify(rsp->plain.message.header.response.magic == PROTOCOL_BINARY_RES);
   verify(rsp->plain.message.header.response.opcode == cc);
@@ -555,6 +555,14 @@
   return TEST_PASS;
 }

+/* We call verify(validate_response_header), but that macro
+ * expects a boolean expression, and the function returns
+ * an enum.... Let's just create a macro to avoid cluttering
+ * the code with all of the == TEST_PASS ;-)
+ */
+#define validate_response_header(a,b,c) \
+        do_validate_response_header(a,b,c) == TEST_PASS
+
 static enum test_return test_binary_noop(void)
 {
   command cmd;
@@ -620,6 +628,20 @@
     }
     else
       execute(test_binary_noop());
+  }
+
+  /*
+   * We need to get the current CAS id, and at this time we haven't
+   * verified that we have a working get
+   */
+  if (cc == PROTOCOL_BINARY_CMD_SETQ)
+  {
+    cmd.set.message.header.request.opcode= PROTOCOL_BINARY_CMD_SET;
+    execute(resend_packet(&cmd));
+    execute(recv_packet(&rsp));
+    verify(validate_response_header(&rsp, PROTOCOL_BINARY_CMD_SET,
+                                    PROTOCOL_BINARY_RESPONSE_SUCCESS));
+    cmd.set.message.header.request.opcode= PROTOCOL_BINARY_CMD_SETQ;
   }

   /* try to set with the correct CAS value */
@@ -1170,7 +1192,7 @@
       fprintf(stderr, "Usage: %s [-h hostname] [-p port] [-c] [-v] [-t n]\n"
               "\t-c\tGenerate coredump if a test fails\n"
               "\t-v\tVerbose test output (print out the assertion)\n"
-              "\t-c n\tSet the timeout for io-operations to n seconds\n",
+              "\t-t n\tSet the timeout for io-operations to n seconds\n",
               argv[0]);
       return 1;
     }


Fixed header of StringLexer.h

Fixed header of StringLexer.h

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@338952 91177308-0d34-0410-b5e6-96231b3b80d8


Move dump out of class, use "\n" instead of endl

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

--- include/llvm/ADT/SparseBitVector.h
+++ include/llvm/ADT/SparseBitVector.h
@@ -796,16 +796,6 @@
     return iterator(this, ~0);
   }

-  // Dump our bits to stderr
-  void dump(llvm::OStream &out) const {
-    out << "[ ";
-    for (iterator bi = begin();
-         bi != end();
-         ++bi) {
-      out << *bi << " ";
-    }
-    out << std::endl;
-  }
 };

 // Convenience functions to allow Or and And without dereferencing in the user
@@ -834,7 +824,20 @@
                         const SparseBitVector<ElementSize> *RHS) {
   return LHS &= (*RHS);
 }
-
+
+
+// Dump a SparseBitVector to a stream
+template <unsigned ElementSize>
+void dump(const SparseBitVector<ElementSize> &LHS, llvm::OStream &out) {
+  out << "[ ";
+
+  typename SparseBitVector<ElementSize>::iterator bi;
+  for (bi = LHS.begin(); bi != LHS.end(); ++bi) {
+    out << *bi << " ";
+  }
+    out << "\n";
 }

+}
+
 #endif


Correctly attribute file author & remote tabs

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

--- include/llvm/CodeGen/MachOWriter.h
+++ include/llvm/CodeGen/MachOWriter.h
@@ -2,7 +2,7 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Chris Lattner and is distributed under the
+// This file was developed by Nate Begeman and is distributed under the
 // University of Illinois Open Source License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
@@ -75,13 +75,13 @@
     /// MachOHeader - This struct contains the header information about a
     /// specific architecture type/subtype pair that is emitted to the file.
     struct MachOHeader {
-      uint32_t	magic;      // mach magic number identifier
-      uint32_t	cputype;    // cpu specifier
-      uint32_t	cpusubtype; // machine specifier
-      uint32_t	filetype;   // type of file
-      uint32_t	ncmds;      // number of load commands
-      uint32_t	sizeofcmds; // the size of all the load commands
-      uint32_t	flags;      // flags
+      uint32_t  magic;      // mach magic number identifier
+      uint32_t  cputype;    // cpu specifier
+      uint32_t  cpusubtype; // machine specifier
+      uint32_t  filetype;   // type of file
+      uint32_t  ncmds;      // number of load commands
+      uint32_t  sizeofcmds; // the size of all the load commands
+      uint32_t  flags;      // flags
       uint32_t  reserved;   // 64-bit only

       /// HeaderData - The actual data for the header which we are building
@@ -254,18 +254,18 @@
     /// turned into the SectionCommand in the load command for a particlar
     /// segment.
     struct MachOSection {
-      std::string sectname; // name of this section,
-      std::string	segname;  // segment this section goes in
-      uint64_t	addr;       // memory address of this section
-      uint64_t	size;       // size in bytes of this section
-      uint32_t	offset;     // file offset of this section
-      uint32_t	align;      // section alignment (power of 2)
-      uint32_t	reloff;     // file offset of relocation entries
-      uint32_t	nreloc;     // number of relocation entries
-      uint32_t	flags;      // flags (section type and attributes)
-      uint32_t	reserved1;  // reserved (for offset or index)
-      uint32_t	reserved2;  // reserved (for count or sizeof)
-      uint32_t	reserved3;  // reserved (64 bit only)
+      std::string  sectname; // name of this section,
+      std::string  segname;  // segment this section goes in
+      uint64_t  addr;        // memory address of this section
+      uint64_t  size;        // size in bytes of this section
+      uint32_t  offset;      // file offset of this section
+      uint32_t  align;       // section alignment (power of 2)
+      uint32_t  reloff;      // file offset of relocation entries
+      uint32_t  nreloc;      // number of relocation entries
+      uint32_t  flags;       // flags (section type and attributes)
+      uint32_t  reserved1;   // reserved (for offset or index)
+      uint32_t  reserved2;   // reserved (for count or sizeof)
+      uint32_t  reserved3;   // reserved (64 bit only)

       /// A unique number for this section, which will be used to match symbols
       /// to the correct section.


Hack around a GCC ICE that was fixed in GCC 6.2

lib/Target/X86/AsmParser/X86AsmParser.cpp: In member function ‘void {anonymous}::X86AsmParser::SwitchMode(unsigned int)’:
lib/Target/X86/AsmParser/X86AsmParser.cpp:927:76:   in constexpr expansion of ‘AllModes.llvm::FeatureBitset::FeatureBitset(std::initializer_list<unsigned int>{((const unsigned int*)(& ._157)), 3u})’
include/llvm/MC/SubtargetFeature.h:56:12:   in constexpr expansion of ‘llvm::FeatureBitset::set(I)’
lib/Target/X86/AsmParser/X86AsmParser.cpp:927:76: internal compiler error: in fold_binary_loc, at fold-const.c:9921
     FeatureBitset AllModes({X86::Mode64Bit, X86::Mode32Bit, X86::Mode16Bit});
                                                                            ^

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

--- include/llvm/MC/SubtargetFeature.h
+++ include/llvm/MC/SubtargetFeature.h
@@ -62,17 +62,23 @@
   }

   constexpr FeatureBitset &set(unsigned I) {
-    Bits[I / 64] |= uint64_t(1) << (I % 64);
+    // GCC <6.2 crashes if this is written in a single statement.
+    uint64_t NewBits = Bits[I / 64] | (uint64_t(1) << (I % 64));
+    Bits[I / 64] = NewBits;
     return *this;
   }

   constexpr FeatureBitset &reset(unsigned I) {
-    Bits[I / 64] &= ~(uint64_t(1) << (I % 64));
+    // GCC <6.2 crashes if this is written in a single statement.
+    uint64_t NewBits = Bits[I / 64] & ~(uint64_t(1) << (I % 64));
+    Bits[I / 64] = NewBits;
     return *this;
   }

   constexpr FeatureBitset &flip(unsigned I) {
-    Bits[I / 64] ^= uint64_t(1) << (I % 64);
+    // GCC <6.2 crashes if this is written in a single statement.
+    uint64_t NewBits = Bits[I / 64] ^ (uint64_t(1) << (I % 64));
+    Bits[I / 64] = NewBits;
     return *this;
   }


fixing up some misdocumented parameters

fixing up some misdocumented parameters

--- include/osquery/database/results.h
+++ include/osquery/database/results.h
@@ -101,7 +101,7 @@
 /** @brief Serialize a DiffResults object into a JSON string
  *
  *  @param d the DiffResults to serialize
- *  @param tree a reference to a string which, if all operations are completed
+ *  @param json a reference to a string which, if all operations are completed
  *  successfully, the contents of DiffResults will be serialized into
  *
  *  @return an instance of osquery::Status, indicating the success or failure
@@ -256,7 +256,7 @@
 /** @brief Serialize a ScheduledQueryLogItem object into a JSON string
  *
  *  @param i the ScheduledQueryLogItem to serialize
- *  @param tree a reference to a string which, if all operations are completed
+ *  @param json a reference to a string which, if all operations are completed
  *  successfully, the contents of ScheduledQueryLogItem will be serialized into
  *
  *  @return an instance of osquery::Status, indicating the success or failure


Added api header in include/simplestore/msdom for MS DOM import/export functions.

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

--- include/simplestore/msdom/import.h
+++ include/simplestore/msdom/import.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ZORBA_MS_DOM_STORE_IMPORT_EXPORT_INTERFACE
+#define ZORBA_MS_DOM_STORE_IMPORT_EXPORT_INTERFACE
+
+#include <zorba/item.h>
+#include <msxml.h>
+
+namespace zorba {
+
+namespace simplestore {
+
+class MSDOM2SimpleStore
+{
+public:
+  static IXMLDOMNode   *exportItemAsMSDOM(zorba::Item it);
+  static zorba::Item  importMSDOM(IXMLDOMNode* domNode,
+                            String docUri,
+                            String baseUri);
+};
+
+}
+}
+
+#endif


simdize: ICC compile fix, and clang warning fix

* ICC complained about the types used with std::initializer_list, which
is easily fixable with the address-of operator
* clang complained about the if(&unused) to be always true. Comparing
the address against itself silences the warning (for now).

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- examples/kdtree/simdize.h
+++ examples/kdtree/simdize.h
@@ -344,8 +344,8 @@
 inline void simdize_assign_impl(Adapter<T, N> &a, std::size_t i, const T &x,
                                 Vc::index_sequence<Indexes...>)
 {
-    auto &&unused = {(get<Indexes>(a)[i] = x[Indexes])...};
-    if (&unused) {}
+    auto &&unused = {&(get<Indexes>(a)[i] = x[Indexes])...};
+    if (&unused == &unused) {}
 }
 }  // namespace simdize_internal


delay calling block_externally_updated() until the block is completely filled (and written out)

git-svn-id: 4e7379b20b57f8e3dde5a0b7363f233184647162@1959 4e380d45-d1fd-0310-85a7-d18ec86df0ad

--- include/stxxl/bits/stream/stream.h
+++ include/stxxl/bits/stream/stream.h
@@ -462,7 +462,6 @@
         if (nbuffers == 0)
             nbuffers = 2 * config::get_instance()->disks_number();

-
         outbegin.flush(); // flush container

         // create buffered write stream for blocks
@@ -470,10 +469,18 @@

         assert(outbegin.block_offset() == 0);

+        // delay calling block_externally_updated() until the block is
+        // completely filled (and written out) in outstream
+        ConstExtIterator prev_block = outbegin;
+
         while (!in.empty() && outend != outbegin)
         {
-            if (outbegin.block_offset() == 0)
-                outbegin.block_externally_updated();
+            if (outbegin.block_offset() == 0) {
+                if (prev_block != outbegin) {
+                    prev_block.block_externally_updated();
+                    prev_block = outbegin;
+                }
+            }

             *outstream = *in;
             ++outbegin;
@@ -489,6 +496,10 @@
             ++const_out;
             ++outstream;
         }
+
+        if (prev_block != outbegin)
+            prev_block.block_externally_updated();
+
         outbegin.flush();

         return outbegin;
@@ -1889,3 +1900,4 @@
 __STXXL_END_NAMESPACE

 #endif // !STXXL_STREAM_HEADER
+// vim: et:ts=4:sw=4


Remove unused variable tns that was added during the most recent merge.

--- ext/libxml/ruby_xml_schema.c
+++ ext/libxml/ruby_xml_schema.c
@@ -214,7 +214,6 @@
   if (import->imported && import->schema)
   {
     VALUE elements = rb_hash_new();
-    VALUE tns;
     xmlHashScan(import->schema->elemDecl, (xmlHashScanner)scan_schema_element, (void *)elements);
     rb_hash_aset(result, QNIL_OR_STRING(import->schema->targetNamespace), elements);
   }
@@ -296,7 +295,6 @@
   if (import->imported && import->schema)
   {
     VALUE types = rb_hash_new();
-    VALUE tns;
     xmlHashScan(import->schema->typeDecl, (xmlHashScanner)scan_schema_type, (void *)types);
     rb_hash_aset(result, QNIL_OR_STRING(import->schema->targetNamespace), types);
   }


Remove Needless Template Dependent Access

There's no ambiguity here that can be resolved so just drop it.

--- include/swift/Reflection/TypeRef.h
+++ include/swift/Reflection/TypeRef.h
@@ -760,7 +760,7 @@
   create(Allocator &A,
          llvm::ArrayRef<const GenericTypeParameterTypeRef *> Params,
          llvm::ArrayRef<TypeRefRequirement> Requirements) {
-    return A.template makeGenericSignatureRef(Params, Requirements);
+    return A.makeGenericSignatureRef(Params, Requirements);
   }

   const llvm::ArrayRef<const GenericTypeParameterTypeRef *> getParams() const {


Add a comment on getCalleeArgIndexOfFirstAppliedArg() that I find personally helpful.

--- include/swift/SIL/SILInstruction.h
+++ include/swift/SIL/SILInstruction.h
@@ -7741,8 +7741,15 @@
     case SILInstructionKind::TryApplyInst:
       return 0;
     case SILInstructionKind::PartialApplyInst:
-      // The arguments to partial_apply are a suffix of the arguments to the
-      // the actually-called function.
+      // The arguments to partial_apply are a suffix of the partial_apply's
+      // callee. Note that getSubstCalleeConv is function type of the callee
+      // argument passed to this apply, not necessarilly the function type of
+      // the underlying callee function (i.e. it is based on the `getCallee`
+      // type, not the `getCalleeOrigin` type).
+      //
+      // pa1 = partial_apply f(c) : $(a, b, c)
+      // pa2 = partial_apply pa1(b) : $(a, b)
+      // apply pa2(a)
       return getSubstCalleeConv().getNumSILArguments() - getNumArguments();
     default:
       llvm_unreachable("not implemented for this instruction!");


* Writing is changed.

  * Writing is changed.

git-svn-id: 941c396c0c997e7bb438e0bf88317cdf88a3ff60@804 1a406e8e-add9-4483-a2c8-d8cac5b7c224

--- src/chxj_load_emoji_data.c
+++ src/chxj_load_emoji_data.c
@@ -91,11 +91,8 @@
   {
     char* name = qs_get_node_name(doc, child);
     if ((*name == 's' || *name == 'S') && strcasecmp(name, "set") == 0) {
-      rtn = s_load_emoji_set_tag(doc, p, conf, child);
-      if (rtn != NULL)
-      {
+      if (rtn = s_load_emoji_set_tag(doc, p, conf, child))
         return rtn;
-      }
     }
   }
   return NULL;


[media] v4l: reorganize RF tuner control ID numbers

It appears that controls are ordered by ID number when enumerating.
That could lead illogical UI as controls are usually enumerated and
drawn by the application at runtime.

Change order of controls by reorganizing assigned IDs now as we can.
It is not reasonable possible after the API is released. Also, leave
some spare space between IDs too for possible future extensions.

Cc: Hans Verkuil <f625be9dbdcbbd12a043857af148e8fb895d9a1d@xs4all.nl>
Signed-off-by: Antti Palosaari <293134fe763ce2d9d8609280ea107c73cbd2eb86@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <0cae1d1e981e84d16b82ca3d17be8a7f826608d3@samsung.com>

--- include/uapi/linux/v4l2-controls.h
+++ include/uapi/linux/v4l2-controls.h
@@ -904,13 +904,13 @@
 #define V4L2_CID_RF_TUNER_CLASS_BASE		(V4L2_CTRL_CLASS_RF_TUNER | 0x900)
 #define V4L2_CID_RF_TUNER_CLASS			(V4L2_CTRL_CLASS_RF_TUNER | 1)

-#define V4L2_CID_RF_TUNER_LNA_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 1)
-#define V4L2_CID_RF_TUNER_LNA_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 2)
-#define V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 3)
-#define V4L2_CID_RF_TUNER_MIXER_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 4)
-#define V4L2_CID_RF_TUNER_IF_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 5)
-#define V4L2_CID_RF_TUNER_IF_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 6)
-#define V4L2_CID_RF_TUNER_BANDWIDTH_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 7)
-#define V4L2_CID_RF_TUNER_BANDWIDTH		(V4L2_CID_RF_TUNER_CLASS_BASE + 8)
+#define V4L2_CID_RF_TUNER_BANDWIDTH_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 11)
+#define V4L2_CID_RF_TUNER_BANDWIDTH		(V4L2_CID_RF_TUNER_CLASS_BASE + 12)
+#define V4L2_CID_RF_TUNER_LNA_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 41)
+#define V4L2_CID_RF_TUNER_LNA_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 42)
+#define V4L2_CID_RF_TUNER_MIXER_GAIN_AUTO	(V4L2_CID_RF_TUNER_CLASS_BASE + 51)
+#define V4L2_CID_RF_TUNER_MIXER_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 52)
+#define V4L2_CID_RF_TUNER_IF_GAIN_AUTO		(V4L2_CID_RF_TUNER_CLASS_BASE + 61)
+#define V4L2_CID_RF_TUNER_IF_GAIN		(V4L2_CID_RF_TUNER_CLASS_BASE + 62)

 #endif


Indent

Indent

--- include/visionaray/result_record.h
+++ include/visionaray/result_record.h
@@ -24,9 +24,9 @@
     using vec_type    = vector<3, T>;
     using color_type  = vector<4, T>;

-    mask_type   hit       = mask_type(false);
-    color_type  color     = color_type(0.0);
-    scalar_type depth     = scalar_type(0.0);
+    mask_type   hit   = mask_type(false);
+    color_type  color = color_type(0.0);
+    scalar_type depth = scalar_type(0.0);
 };

 } // visionaray


bugfix: removed use case that is not there

--- include/zorba/zorba_singlethread.h
+++ include/zorba/zorba_singlethread.h
@@ -69,7 +69,4 @@
 /** \example uc8a_loadDocument.cpp
  *
  */
-/** \example usecase2.cpp
- *
- */
 #endif


Added equal operator to Setting structure.

--- includes/IrrIMGUI/SIMGUISettings.h
+++ includes/IrrIMGUI/SIMGUISettings.h
@@ -59,6 +59,15 @@
       bool mIsGUIMouseCursorEnabled;

       /// @}
+
+      bool operator==(SIMGUISettings const &rCompareSettings)
+      {
+        bool AreAllSettingsEqual = true;
+
+        AreAllSettingsEqual = AreAllSettingsEqual && (mIsGUIMouseCursorEnabled == rCompareSettings.mIsGUIMouseCursorEnabled);
+
+        return AreAllSettingsEqual;
+      }
   };
 }