Correct documentation for sparse predictions (#4979)

* Correct documentation for sparse predictions

The documentation says that the parameter `nindptr` for `LGBM_BoosterPredictSparseOutput` should be the number of rows plus one, but this is incorrect when the input type is CSC. This PR fixes it.

* Update c_api.h

* Update c_api.h

* Update c_api.h

--- include/LightGBM/c_api.h
+++ include/LightGBM/c_api.h
@@ -830,7 +830,7 @@
  * \param indices Pointer to column indices for CSR or row indices for CSC
  * \param data Pointer to the data space
  * \param data_type Type of ``data`` pointer, can be ``C_API_DTYPE_FLOAT32`` or ``C_API_DTYPE_FLOAT64``
- * \param nindptr Number of rows in the matrix + 1
+ * \param nindptr Number of entries in ``indptr``
  * \param nelem Number of nonzero elements in the matrix
  * \param num_col_or_row Number of columns for CSR or number of rows for CSC
  * \param predict_type What should be predicted, only feature contributions supported currently
@@ -839,7 +839,7 @@
  * \param num_iteration Number of iterations for prediction, <= 0 means no limit
  * \param parameter Other parameters for prediction, e.g. early stopping for prediction
  * \param matrix_type Type of matrix input and output, can be ``C_API_MATRIX_TYPE_CSR`` or ``C_API_MATRIX_TYPE_CSC``
- * \param[out] out_len Length of output indices and data
+ * \param[out] out_len Length of output data and output indptr (pointer to an array with two entries where to write them)
  * \param[out] out_indptr Pointer to output row headers for CSR or column headers for CSC
  * \param[out] out_indices Pointer to sparse column indices for CSR or row indices for CSC
  * \param[out] out_data Pointer to sparse data space


bindings: avoid using additional process

Instead of clone(..., CLONE_NEWNS | CLONE_FILES, ...) simply use
unshare(CLONE_NEWNS) and setns().

Signed-off-by: Christian Brauner <b487c2d908f9548b106d14dc6d7b88a1fc58d1d6@suse.de>

--- bindings.c
+++ bindings.c
@@ -4060,33 +4060,7 @@
 }

 /*
- * Functions and types to ease the use of clone()/__clone2()
- */
-static pid_t lxcfs_clone(int (*fn)(void *), void *arg, int flags)
-{
-	size_t stack_size = sysconf(_SC_PAGESIZE);
-	void *stack = alloca(stack_size);
-	pid_t ret;
-
-#ifdef __ia64__
-	ret = __clone2(do_clone, stack,
-		       stack_size, flags | SIGCHLD, &clone_arg);
-#else
-	ret = clone(fn, stack  + stack_size, flags | SIGCHLD, &arg);
-#endif
-	if (ret < 0)
-		fprintf(stderr, "failed to clone (%#x): %s", flags, strerror(errno));
-
-	return ret;
-}
-
-/*
  * Functions needed to setup cgroups in the __constructor__.
- * After the constructor has collected the mounted hierarchies we clone() a new
- * process which mounts the private lxcfs cgroup mounts in a new private mount
- * namespace not accessible to other processes. We then open an fd for each
- * mounted hierarchy and use CLONE_FILES to keep them valid in both the child
- * and the parent.
  */

 static bool mkdir_p(const char *dir, mode_t mode)
@@ -4116,8 +4090,7 @@
 static bool umount_if_mounted(void)
 {
 	if (umount2(BASEDIR, MNT_DETACH) < 0 && errno != EINVAL) {
-		fprintf(stderr, "failed to umount %s: %s\n", BASEDIR,
-			strerror(errno));
+		fprintf(stderr, "failed to unmount %s: %s.\n", BASEDIR, strerror(errno));
 		return false;
 	}
 	return true;
@@ -4222,17 +4195,30 @@
 static bool setup_cgfs_dir(void)
 {
 	if (!mkdir_p(BASEDIR, 0700)) {
-		fprintf(stderr, "Failed to create lxcfs cgdir\n");
-		return false;
-	}
+		fprintf(stderr, "Failed to create lxcfs cgroup mountpoint.\n");
+		return false;
+	}
+
 	if (!umount_if_mounted()) {
-		fprintf(stderr, "Failed to clean up old lxcfs cgdir\n");
-		return false;
-	}
+		fprintf(stderr, "Failed to clean up old lxcfs cgroup mountpoint.\n");
+		return false;
+	}
+
+	if (unshare(CLONE_NEWNS) < 0) {
+		fprintf(stderr, "%s: Failed to unshare mount namespace: %s.\n", __func__, strerror(errno));
+		return false;
+	}
+
+	if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0) < 0) {
+		fprintf(stderr, "%s: Failed to remount / private: %s.\n", __func__, strerror(errno));
+		return false;
+	}
+
 	if (mount("tmpfs", BASEDIR, "tmpfs", 0, "size=100000,mode=700") < 0) {
-		fprintf(stderr, "Failed to mount tmpfs for private controllers\n");
-		return false;
-	}
+		fprintf(stderr, "Failed to mount tmpfs over lxcfs cgroup mountpoint.\n");
+		return false;
+	}
+
 	return true;
 }

@@ -4274,26 +4260,33 @@
 	return true;
 }

-int cgfs_setup_controllers(void *data)
-{
-	if (mount(NULL, "/", NULL, MS_REC | MS_PRIVATE, 0) < 0) {
-		fprintf(stderr, "%s: Failed to re-mount / private: %s.\n", __func__, strerror(errno));
+static bool cgfs_setup_controllers(void)
+{
+	if (!setup_cgfs_dir())
+		return false;
+
+	if (!do_mount_cgroups()) {
+		fprintf(stderr, "Failed to set up private lxcfs cgroup mounts.\n");
+		return false;
+	}
+
+	if (!pivot_new_root())
+		return false;
+
+	return true;
+}
+
+static int preserve_ns(int pid)
+{
+	int ret;
+	size_t len = 5 /* /proc */ + 21 /* /int_as_str */ + 7 /* /ns/mnt */ + 1 /* \0 */;
+	char path[len];
+
+	ret = snprintf(path, len, "/proc/%d/ns/mnt", pid);
+	if (ret < 0 || (size_t)ret >= len)
 		return -1;
-	}
-
-	if (!setup_cgfs_dir()) {
-		return false;
-	}
-
-	if (!do_mount_cgroups()) {
-		fprintf(stderr, "Failed to set up cgroup mounts\n");
-		return false;
-	}
-
-	if (!pivot_new_root())
-		return false;
-
-	return true;
+
+	return open(path, O_RDONLY | O_CLOEXEC);
 }

 static void __attribute__((constructor)) collect_and_mount_subsystems(void)
@@ -4301,6 +4294,7 @@
 	FILE *f;
 	char *line = NULL;
 	size_t len = 0;
+	int i, init_ns = -1;

 	if ((f = fopen("/proc/self/cgroup", "r")) == NULL) {
 		fprintf(stderr, "Error opening /proc/self/cgroup: %s\n", strerror(errno));
@@ -4331,31 +4325,33 @@
 			goto out;
 	}

-	/* Now use clone(CLONE_NEWNS | CLONE_FILES) to mount cgroup hierarchies
-	 * in a private mount namespace to hide them from other processes that
-	 * would otherwise get confused. As fuse needs to be able to perform
-	 * file operations on the cgroup hierarchies. Hence we share open file
-	 * descriptors opened in the private mount namespace referring to those
-	 * hierarchies between child and parent process. */
-	fd_hierarchies = mmap(NULL, sizeof(int *) * num_hierarchies, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+	/* Preserve initial namespace. */
+	init_ns = preserve_ns(getpid());
+	if (init_ns < 0)
+		goto out;
+
+	fd_hierarchies = malloc(sizeof(int *) * num_hierarchies);
 	if (!fd_hierarchies)
 		goto out;

-	pid_t pid = lxcfs_clone(cgfs_setup_controllers, NULL, CLONE_NEWNS | CLONE_FILES);
-	if (pid < 0) {
-		fprintf(stderr, "%s: Error cloning new mount namespace: %s\n", __func__, strerror(errno));
-		goto out;
-	}
-	if (waitpid(pid, NULL, 0) < 0) {
-		fprintf(stderr, "%s: Error waiting on cloned child: %s\n", __func__, strerror(errno));
-		goto out;
-	}
+	for (i = 0; i < num_hierarchies; i++)
+		fd_hierarchies[i] = -1;
+
+	/* This function calls unshare(CLONE_NEWNS) our initial mount namespace
+	 * to privately mount lxcfs cgroups. */
+	if (!cgfs_setup_controllers())
+		goto out;
+
+	if (setns(init_ns, 0) < 0)
+		goto out;

 	print_subsystems();

 out:
 	free(line);
 	fclose(f);
+	if (init_ns >= 0)
+		close(init_ns);
 }

 static void __attribute__((destructor)) free_subsystems(void)
@@ -4365,10 +4361,9 @@
 	for (i = 0; i < num_hierarchies; i++) {
 		if (hierarchies[i])
 			free(hierarchies[i]);
-		if (fd_hierarchies[i] >= 0)
+		if (fd_hierarchies && fd_hierarchies[i] >= 0)
 			close(fd_hierarchies[i]);
 	}
 	free(hierarchies);
-	if (fd_hierarchies)
-		munmap(fd_hierarchies, sizeof(int *) * num_hierarchies);
-}
+	free(fd_hierarchies);
+}


(LogReader): увеличил максимальный размер названия лога до 120 символов

--- include/LogServerTypes.h
+++ include/LogServerTypes.h
@@ -59,7 +59,7 @@
 			Command cmd;
 			unsigned int data;

-			static const size_t MAXLOGNAME = 30;
+			static const size_t MAXLOGNAME = 120;
 			char logname[MAXLOGNAME + 1]; // +1 reserverd for '\0'

 			void setLogName( const std::string& name );


bindings: cgfs_get_value(), slurp_file()

Enable cgfs_get_value() and slurp_file() to be used with *at() family of
functions.

Signed-off-by: Christian Brauner <b487c2d908f9548b106d14dc6d7b88a1fc58d1d6@suse.de>

--- bindings.c
+++ bindings.c
@@ -307,11 +307,11 @@
 	*len = newlen;
 }

-static char *slurp_file(const char *from)
+static char *slurp_file(const char *from, int fd)
 {
 	char *line = NULL;
 	char *contents = NULL;
-	FILE *f = fopen(from, "r");
+	FILE *f = fdopen(fd, "r");
 	size_t len = 0, fulllen = 0;
 	ssize_t linelen;

@@ -769,18 +769,24 @@

 bool cgfs_get_value(const char *controller, const char *cgroup, const char *file, char **value)
 {
-	int cfd;
+	int ret, fd, cfd;
 	size_t len;
 	char *fnam, *tmpc = find_mounted_controller(controller, &cfd);

 	if (!tmpc)
 		return false;
-	/* BASEDIR / tmpc / cgroup / file \0 */
-	len = strlen(BASEDIR) + strlen(tmpc) + strlen(cgroup) + strlen(file) + 4;
+	/* . + /cgroup + / + file + \0 */
+	len = strlen(cgroup) + strlen(file) + 3;
 	fnam = alloca(len);
-	snprintf(fnam, len, "%s/%s/%s/%s", BASEDIR, tmpc, cgroup, file);
-
-	*value = slurp_file(fnam);
+	ret = snprintf(fnam, len, "%s%s/%s", *cgroup == '/' ? "." : "", cgroup, file);
+	if (ret < 0 || (size_t)ret >= len)
+		return NULL;
+
+	fd = openat(cfd, fnam, O_RDONLY);
+	if (fd < 0)
+		return NULL;
+
+	*value = slurp_file(fnam, fd);
 	return *value != NULL;
 }


bindings: fix debug macro

bindings: fix debug macro

Signed-off-by: Christian Brauner <b487c2d908f9548b106d14dc6d7b88a1fc58d1d6@suse.de>

--- bindings.h
+++ bindings.h
@@ -1,10 +1,13 @@
+#ifndef __LXCFS_BINDINGS_H
+#define __LXCFS_BINDINGS_H
+
 /* directory under which we mount the controllers - /run/lxcfs/controllers */
 #define BASEDIR RUNTIME_PATH "/lxcfs/controllers"
 #define ROOTDIR RUNTIME_PATH "/lxcfs/root"

 #define lxcfs_debug_stream(stream, format, ...)                                \
 	do {                                                                   \
-		fprintf(stderr, "%s: %d: %s: " format, __FILE__, __LINE__,     \
+		fprintf(stream, "%s: %d: %s: " format, __FILE__, __LINE__,     \
 			__func__, __VA_ARGS__);                                \
 	} while (false)

@@ -41,3 +44,5 @@
 extern int proc_read(const char *path, char *buf, size_t size, off_t offset,
 		struct fuse_file_info *fi);
 extern int proc_access(const char *path, int mask);
+
+#endif /* __LXCFS__BINDINGS_H */


ACPI: processor: remove _PDC object list from struct acpi_processor

When we call _PDC, we get a handle to the processor, allocate the
object list buffer as needed, and free it immediately after calling
_PDC.

There's no need to drag around this object list with us everywhere
else, so let's just get rid of it.

Signed-off-by: Alex Chiang <a25bebb898370739a99065f6e6d48125356d8b30@hp.com>
Signed-off-by: Len Brown <b060cfa1096cc6e8be83699ddb4ed8a77dd63af5@intel.com>

--- include/acpi/processor.h
+++ include/acpi/processor.h
@@ -224,8 +224,6 @@
 	struct acpi_processor_throttling throttling;
 	struct acpi_processor_limit limit;
 	struct thermal_cooling_device *cdev;
-	/* the _PDC objects for this processor, if any */
-	struct acpi_object_list *pdc;
 };

 struct acpi_processor_errata {


clean up

clean up

--- mcuconf.h
+++ mcuconf.h
@@ -19,14 +19,6 @@
 */

 /*
- * LPC214x drivers configuration.
- * The following settings override the default settings present in
- * the various device driver implementation headers.
- * Note that the settings for each driver only have effect if the driver
- * is enabled in halconf.h.
- */
-
-/*
  * ADC driver system settings.
  */

@@ -45,13 +37,11 @@
 /*
  * SERIAL driver system settings.
  */
-#define USE_LPC214x_UART0           TRUE
-#define USE_LPC214x_UART1           TRUE
-#define LPC214x_UART_FIFO_PRELOAD   16
-#define LPC214x_UART0_PRIORITY      1
-#define LPC214x_UART1_PRIORITY      2

 /*
  * SPI driver system settings.
  */
-#define USE_LPC214x_SPI1            TRUE
+
+/*
+ * I2C driver system settings.
+ */


usb: dfu: halt endpoint on flash API error or block mismatch

Halt endpoint on flash API error or block mismatch.

Signed-off-by: Johann Fischer <64a5f06fca6b2d93d742efe564789153170f6198@nordicsemi.no>

--- subsys/usb/class/dfu/usb_dfu.c
+++ subsys/usb/class/dfu/usb_dfu.c
@@ -439,7 +439,7 @@
 					dfu_data.block_nr, setup->wLength);
 				dfu_data.state = dfuERROR;
 				dfu_data.status = errUNKNOWN;
-				break;
+				return -EINVAL;
 			}

 			/* Upload in progress */
@@ -468,7 +468,7 @@
 				if (ret) {
 					dfu_data.state = dfuERROR;
 					dfu_data.status = errFILE;
-					break;
+					return -EINVAL;
 				}
 				ret = flash_area_read(fa, dfu_data.bytes_sent,
 						      *data, len);
@@ -476,7 +476,7 @@
 				if (ret) {
 					dfu_data.state = dfuERROR;
 					dfu_data.status = errFILE;
-					break;
+					return -EINVAL;
 				}
 			}
 			*data_len = len;


New address family type OFP_AF_LINK.

New address family type OFP_AF_LINK.

Signed-off-by: Hannu Jokinen <cb7811d6e4f31e21756019d681ad07ec7833e91d@nokia.com>
Reviewed-by: José Pekkarinen <d7cb8761fb0e75b1a78c2fda4f1daed76cd46cfe@nokia.com>
Reviewed-by: Brian Brooks <8e906ed46ccdc37d68771658f0f8f8740a374927@arm.com>

--- include/api/ofp_socket.h
+++ include/api/ofp_socket.h
@@ -160,7 +160,8 @@
 #define	OFP_AF_UNIX	1		/* standardized name for OFP_AF_LOCAL */
 #define	OFP_AF_INET	2		/* internetwork: UDP, TCP, etc. */
 #define	OFP_AF_INET6	3		/* IPv6 */
-#define	OFP_AF_MAX	4
+#define	OFP_AF_LINK	4		/* Link layer interface */
+#define	OFP_AF_MAX	5

 /*
  * Structure used by kernel to store most


core: Fix filter_key_list() function

core: Fix filter_key_list() function

This function was working bad.

This fixes https://bugzilla.gnome.org/show_bug.cgi?id=645542

Signed-off-by: Juan A. Suarez Romero <af79b5692270b306571bb1d8bbe0285ae3ac93d9@igalia.com>

--- src/grl-metadata-source.c
+++ src/grl-metadata-source.c
@@ -511,41 +511,29 @@
 filter_key_list (GrlMetadataSource *source,
                  GList **keys_to_filter,
                  gboolean return_filtered,
-                 const GList *source_keys)
-{
-  GList *iter_source_keys;
-  GList *iter_keys;
-  GList *filtered_keys = NULL;
-  gboolean got_match;
-  GrlKeyID filtered_key;
-
-  iter_source_keys = (GList *) source_keys;
-  while (iter_source_keys) {
-    got_match = FALSE;
-    iter_keys = *keys_to_filter;
-
-    filtered_key = iter_source_keys->data;
-    while (!got_match && iter_keys) {
-      if (iter_keys->data == filtered_key) {
-        got_match = TRUE;
-      }
-      else {
-        iter_keys = g_list_next (iter_keys);
+                 GList *source_keys)
+{
+  GList *iter_keys, *found;
+  GList *in_source = NULL;
+  GList *out_source = NULL;
+
+  for (iter_keys = *keys_to_filter;
+       iter_keys;
+       iter_keys = g_list_next (iter_keys)) {
+    found = g_list_find (source_keys, iter_keys->data);
+    if (found) {
+      in_source = g_list_prepend (in_source, iter_keys->data);
+    } else {
+      if (return_filtered) {
+        out_source = g_list_prepend (out_source, iter_keys->data);
       }
     }
-
-    iter_source_keys = g_list_next (iter_source_keys);
-
-    if (got_match) {
-      if (return_filtered) {
-        filtered_keys = g_list_prepend (filtered_keys, filtered_key);
-      }
-      *keys_to_filter = g_list_delete_link (*keys_to_filter, iter_keys);
-      got_match = FALSE;
-    }
-  }
-
-  return filtered_keys;
+  }
+
+  g_list_free (*keys_to_filter);
+  *keys_to_filter = g_list_reverse (in_source);
+
+  return g_list_reverse (out_source);
 }

 /**
@@ -1019,7 +1007,7 @@

   supported_keys = grl_metadata_source_supported_keys (source);

-  return filter_key_list (source, keys, return_filtered, supported_keys);
+  return filter_key_list (source, keys, return_filtered, (GList *) supported_keys);
 }

 /**
@@ -1053,7 +1041,7 @@
   slow_keys = grl_metadata_source_slow_keys (source);

   /* Note that we want to do the opposite */
-  fastest_keys = filter_key_list (source, keys, TRUE, slow_keys);
+  fastest_keys = filter_key_list (source, keys, TRUE, (GList *) slow_keys);
   tmp = *keys;
   *keys = fastest_keys;

@@ -1098,7 +1086,7 @@

   writable_keys = grl_metadata_source_writable_keys (source);

-  return filter_key_list (source, keys, return_filtered, writable_keys);
+  return filter_key_list (source, keys, return_filtered, (GList *) writable_keys);
 }

 /**


* subversion/include/svn_delta.h   (svn_delta_editor_t): Add note about how to construct these.

--- subversion/include/svn_delta.h
+++ subversion/include/svn_delta.h
@@ -528,6 +528,10 @@
 /** A structure full of callback functions the delta source will invoke
  * as it produces the delta.
  *
+ * Note: Don't try to allocate one of these yourself.  Instead, always
+ * use svn_delta_default_editor() or some other constructor, to ensure
+ * that unused slots are filled in with no-op functions.
+ *
  *
Function Usage

  *
  * Here's how to use these functions to express a tree delta.


[ARM] Provide a method to alter the control register

i.MX needs to tweak the control register to support CPU frequency
scaling.  Rather than have folk blindly try and change the control
register by writing to it and then wondering why it doesn't work,
provide a method (which is safe for UP only, and therefore only
available for UP) to achieve this.

Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- include/asm-arm/system.h
+++ include/asm-arm/system.h
@@ -173,6 +173,26 @@
 extern unsigned long cr_no_alignment;	/* defined in entry-armv.S */
 extern unsigned long cr_alignment;	/* defined in entry-armv.S */

+#ifndef CONFIG_SMP
+static inline void adjust_cr(unsigned long mask, unsigned long set)
+{
+	unsigned long flags, cr;
+
+	mask &= ~CR_A;
+
+	set &= mask;
+
+	local_irq_save(flags);
+
+	cr_no_alignment = (cr_no_alignment & ~mask) | set;
+	cr_alignment = (cr_alignment & ~mask) | set;
+
+	set_cr((get_cr() & ~mask) | set);
+
+	local_irq_restore(flags);
+}
+#endif
+
 #define UDBG_UNDEFINED	(1 << 0)
 #define UDBG_SYSCALL	(1 << 1)
 #define UDBG_BADABORT	(1 << 2)


Push -l option of gtm_ctl to gtm

Push -l option of gtm_ctl to gtm

This solves 2 problems:
- Avoid to have an empty output file when gtm_ctl has a log file defined
- Change log file name of GTM according to what is given by gtm_ctl

Patch by Michael Meskes

--- src/gtm/gtm_ctl/gtm_ctl.c
+++ src/gtm/gtm_ctl/gtm_ctl.c
@@ -286,9 +286,8 @@
 	strncat(gtm_app_path, gtm_app, MAXPGPATH - len - 1);

 	if (log_file != NULL)
-		len = snprintf(cmd, MAXPGPATH - 1, SYSTEMQUOTE "\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1 &" SYSTEMQUOTE,
-				 gtm_app_path, gtmdata_opt, gtm_opts,
-				 DEVNULL, log_file);
+		len = snprintf(cmd, MAXPGPATH - 1, SYSTEMQUOTE "\"%s\" %s%s -l %s < \"%s\" 2>&1 &" SYSTEMQUOTE,
+				 gtm_app_path, gtmdata_opt, gtm_opts, log_file, DEVNULL);
 	else
 		len = snprintf(cmd, MAXPGPATH - 1, SYSTEMQUOTE "\"%s\" %s%s < \"%s\" 2>&1 &" SYSTEMQUOTE,
 				 gtm_app_path, gtmdata_opt, gtm_opts, DEVNULL);


* subversion/include/svn_props.h
  (SVN_PROP_EXTERNALS): Update the format description of svn:externals.

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

--- subversion/include/svn_props.h
+++ subversion/include/svn_props.h
@@ -359,19 +359,21 @@

 /** Describes external items to check out into this directory.
  *
- * The format is a series of lines, such as:
- *
- * <pre reason="Should use 'verbatim' instead, but Doxygen v1.6.1 & v1.7.1
- *              then doesn't recognize the #define; presumably a bug.">
-     localdir1           http://url.for.external.source/etc/
-     localdir1/foo       http://url.for.external.source/foo
-     localdir1/bar       http://blah.blah.blah/repositories/theirproj
-     localdir1/bar/baz   http://blorg.blorg.blorg/basement/code
-     localdir2           http://another.url/blah/blah/blah
-     localdir3           http://and.so.on/and/so/forth </pre>
- *
- * The subdir names on the left side are relative to the directory on
- * which this property is set.
+ * The format is a series of lines, each in the following format:
+ *   [-r REV] URL[@PEG] LOCALPATH
+ * LOCALPATH is relative to the directory having this property.
+ * REV pins the external to revision REV.
+ * URL may be a full URL or a relative URL starting with one of:
+ *   ../  to the parent directory of the extracted external
+ *   ^/   to the repository root
+ *   /    to the server root
+ *   //   to the URL scheme
+ * The following format is supported for interoperability with
+ * Subversion 1.4 and earlier clients:
+ *   LOCALPATH [-r PEG] URL
+ * The ambiguous format 'relative_path relative_path' is taken as
+ * 'relative_url relative_path' with peg revision support.
+ * Lines starting with a '#' character are ignored.
  */
 #define SVN_PROP_EXTERNALS  SVN_PROP_PREFIX "externals"


[PATCH] x86-64: Fix BUG()

[PATCH] x86-64: Fix BUG()

Use the correct file name in BUG()

Signed-off-by: Andi Kleen <0474aee45985f5ae829f53849df476200e876990@suse.de>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- include/asm-x86_64/bug.h
+++ include/asm-x86_64/bug.h
@@ -18,7 +18,7 @@
 #define HAVE_ARCH_BUG
 #define BUG() \
 	asm volatile("ud2 ; .quad %c1 ; .short %c0" :: \
-		     "i"(__LINE__), "i" (__stringify(KBUILD_BASENAME)))
+		     "i"(__LINE__), "i" (__stringify(__FILE__)))
 void out_of_line_bug(void);
 #include <asm-generic/bug.h>


rindex() returns (const char*) when given a (const char*)

at least on c++

--- utils/ambix-deinterleave.c
+++ utils/ambix-deinterleave.c
@@ -75,7 +75,7 @@

 static char*ai_prefix(const char*filename) {
   char*result=NULL;
-  char*last=rindex(filename, '.');
+  const char*last=rindex(filename, '.');
   if(last) {
     int length=last-filename;
     result=(char*)calloc(sizeof(char), strlen(filename));


Fix typo in call to end_message in buffer_hello.

This would cause an assertion failure whenever we
sent a Unicast Hello.  Thanks to Dave Taht.

--- message.c
+++ message.c
@@ -1041,7 +1041,7 @@
         accumulate_byte(buf, 4);
         accumulate_int(buf, 0);
     }
-    end_message(&ifp->buf, MESSAGE_HELLO, timestamp ? 12 : 6);
+    end_message(buf, MESSAGE_HELLO, timestamp ? 12 : 6);
 }

 void


include in ...epilogue_recursive.h too

include in ...epilogue_recursive.h too

--- groups/bsl/bsl+stdhdrs/bsl_stdhdrs_epilogue_recursive.h
+++ groups/bsl/bsl+stdhdrs/bsl_stdhdrs_epilogue_recursive.h
@@ -224,6 +224,10 @@
 #   include <bslstl_hash.h>
 #   define INCLUDE_BSL_STDHDRS_EPILOGUE_RECURSIVE
 # endif
+# ifndef INCLUDED_BSLSTL_REFERENCEWRAPPER
+#   include <bslstl_referencewrapper.h>
+#   define INCLUDE_BSL_STDHDRS_EPILOGUE_RECURSIVE
+# endif
 #endif

 // If '<memory>' was included, then include our implementation of allocators.


* subversion/libsvn_delta/diff.c

* subversion/libsvn_delta/diff.c

  (svn_diff3): Handle the case where we should see a conflict
    if two lcs segments don't match up.  This bug only showed
    itself if the syncpoint was EOF.  This fix makes trans-test 5:
    "update locally modified file with eol-style 'native'" pass.
    We probably need further testing to ensure this bug doesn't
    reach beyond the 'EOF' case.

--- subversion/libsvn_delta/diff.c
+++ subversion/libsvn_delta/diff.c
@@ -609,6 +609,16 @@
                        < original_sync)
                   lcs_ol = lcs_ol->next;

+                /* If the sync point is the EOF, and our current lcs segment
+                 * doesn't reach as far as EOF, we need to skip this segment.
+                 */
+                if (lcs_om->length == 0 && lcs_ol->length > 0
+                    && lcs_ol->position[0]->offset + lcs_ol->length
+                       == original_sync
+                    && lcs_ol->position[1]->offset + lcs_ol->length
+                       != lcs_ol->next->position[1]->offset)
+                  lcs_ol = lcs_ol->next;
+
                 if (lcs_ol->position[0]->offset <= original_sync)
                     break;
               }
@@ -618,6 +628,16 @@

                 while (lcs_om->position[0]->offset + lcs_om->length
                        < original_sync)
+                  lcs_om = lcs_om->next;
+
+                /* If the sync point is the EOF, and our current lcs segment
+                 * doesn't reach as far as EOF, we need to skip this segment.
+                 */
+                if (lcs_ol->length == 0 && lcs_om->length > 0
+                    && lcs_om->position[0]->offset + lcs_om->length
+                       == original_sync
+                    && lcs_om->position[1]->offset + lcs_om->length
+                       != lcs_om->next->position[1]->offset)
                   lcs_om = lcs_om->next;

                 if (lcs_om->position[0]->offset <= original_sync)


* subversion/libsvn_delta/diff.c

* subversion/libsvn_delta/diff.c

  (svn_diff3): Enable the 'smart' conflict detection all the time.  This
    effectively tries to find common differences in conflicts, returning
    those and the true conflicts.  Remove the fallback code.

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

--- subversion/libsvn_delta/diff.c
+++ subversion/libsvn_delta/diff.c
@@ -647,7 +647,6 @@

             if (is_modified && is_latest)
               {
-#if USE_SMART_CONFLICT_DETECTION
                 svn_diff__position_t *start_position[2];

                 type = svn_diff__type_diff_common;
@@ -854,41 +853,6 @@

                     svn_pool_destroy(subpool2);
                   }
-#else /* !USE_SMART_CONFLICT_DETECTION */
-                type = svn_diff__type_diff_common;
-
-                if (modified_length != latest_length)
-                  {
-                    type = svn_diff__type_conflict;
-                  }
-                else if (modified_length > 0)
-                  {
-                    /* First find the starting positions for the
-                     * comparison
-                     */
-                    while (position_list[1]->offset < modified_start)
-                         position_list[1] = position_list[1]->next;
-
-                    while (position_list[2]->offset < latest_start)
-                         position_list[2] = position_list[2]->next;
-
-                      while (modified_length)
-                        {
-                          if (position_list[1]->node != position_list[2]->node)
-                            {
-                              type = svn_diff__type_conflict;
-                              break;
-                            }
-
-                          position_list[1] = position_list[1]->next;
-                          position_list[2] = position_list[2]->next;
-
-                          modified_length--;
-                        }
-
-                    modified_length = latest_length;
-                  }
-#endif /* !USE_SMART_CONFLICT_DETECTION */
               }
             else if (is_modified)
               {


add debug code for showing argc/argv/envp and touch up some other debug output

--- ldso/ldso/dl-startup.c
+++ ldso/ldso/dl-startup.c
@@ -101,14 +101,14 @@
 strong_alias(__rtld_stack_end, __libc_stack_end); /* Exported version of __rtld_stack_end */

 /* When we enter this piece of code, the program stack looks like this:
-        argc            argument counter (integer)
-        argv[0]         program name (pointer)
-        argv[1...N]     program args (pointers)
-        argv[argc-1]    end of args (integer)
-		NULL
-        env[0...N]      environment variables (pointers)
-        NULL
-		auxvt[0...N]   Auxiliary Vector Table elements (mixed types)
+	argc            argument counter (integer)
+	argv[0]         program name (pointer)
+	argv[1...N]     program args (pointers)
+	argv[argc-1]    end of args (integer)
+	NULL
+	env[0...N]      environment variables (pointers)
+	NULL
+	auxvt[0...N]   Auxiliary Vector Table elements (mixed types)
 */
 static void * __attribute_used__ _dl_start(unsigned long args)
 {
@@ -136,6 +136,12 @@
 	aux_dat += argc;			/* Skip over the argv pointers */
 	aux_dat++;					/* Skip over NULL at end of argv */
 	envp = (char **) aux_dat;
+	SEND_STDERR_DEBUG("argc=");
+	SEND_NUMBER_STDERR(argc, 0);
+	SEND_STDERR_DEBUG(" argv=");
+	SEND_ADDRESS_STDERR_DEBUG(argv, 0);
+	SEND_STDERR_DEBUG(" envp=");
+	SEND_ADDRESS_STDERR_DEBUG(envp, 1);
 	while (*aux_dat)
 		aux_dat++;				/* Skip over the envp pointers */
 	aux_dat++;					/* Skip over NULL at end of envp */
@@ -180,7 +186,6 @@
 	SEND_STDERR_DEBUG("ELF header=");
 	SEND_ADDRESS_STDERR_DEBUG(load_addr, 1);

-
 	/* Locate the global offset table.  Since this code must be PIC
 	 * we can take advantage of the magic offset register, if we
 	 * happen to know what that is for this architecture.  If not,
@@ -193,7 +198,7 @@
 	tpnt->loadaddr = load_addr;
 	/* OK, that was easy.  Next scan the DYNAMIC section of the image.
 	   We are only doing ourself right now - we will have to do the rest later */
-	SEND_STDERR_DEBUG("scanning DYNAMIC section\n");
+	SEND_STDERR_DEBUG("Scanning DYNAMIC section ... ");
 	tpnt->dynamic_addr = dpnt;
 #if defined(__mips__) || defined(__cris__)
 	/* Some architectures cannot call functions here, must inline */
@@ -202,7 +207,7 @@
 	_dl_parse_dynamic_info(dpnt, tpnt->dynamic_info, NULL, load_addr);
 #endif

-	SEND_STDERR_DEBUG("done scanning DYNAMIC section\n");
+	SEND_STDERR_DEBUG("DONE !\n");

 #if defined(__mips__)


Followup to #1818:  copy bdb tables in larger chunks.

* libsvn_fs_base/fs.c
  (base_hotcopy): use the largest possible multiple of BDB's pagesize
  less than SVN_STREAM_CHUNK_SIZE.  If we don't know BDB's pagesize,
  default to 128K.

--- subversion/libsvn_fs_base/fs.c
+++ subversion/libsvn_fs_base/fs.c
@@ -1029,8 +1029,16 @@
      used by BDB.  See sleepycat docs for details, or svn issue #1818. */
 #ifdef DB_LOG_AUTOREMOVE
   SVN_ERR (get_db_pagesize (&pagesize, src_path, pool));
+  if (pagesize < SVN_STREAM_CHUNK_SIZE)
+    {
+      /* use the largest multiple of BDB pagesize we can. */
+      int multiple = SVN_STREAM_CHUNK_SIZE / pagesize;
+      pagesize *= multiple;
+    }
 #else
-  pagesize = 4096;
+  /* default to 128K chunks, which should be safe.
+     BDB almost certainly uses a power-of-2 pagesize. */
+  pagesize = (4096 * 32);
 #endif

   /* Copy the databases.  */


* subversion/libsvn_fs_fs/pack.c
  (append_revision): Obtain file size from handle after opening revision file
   instead of calling stat() to obtain file size by name.

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

--- subversion/libsvn_fs_fs/pack.c
+++ subversion/libsvn_fs_fs/pack.c
@@ -1438,21 +1438,17 @@
   apr_off_t offset = 0;
   apr_pool_t *iterpool = svn_pool_create(pool);
   svn_fs_fs__revision_file_t *rev_file;
-  apr_finfo_t finfo;
-
-  /* Get the size of the file. */
-  const char *path = svn_dirent_join(context->shard_dir,
-                                     apr_psprintf(iterpool, "%ld",
-                                                  context->start_rev),
-                                     pool);
-  SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, pool));
+  svn_filesize_t revfile_size;

   /* Copy all the bits from the rev file to the end of the pack file. */
   SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs,
                                            context->start_rev, pool,
                                            iterpool));
+  /* Get the size of the file. */
+  SVN_ERR(svn_io_file_size_get(&revfile_size, rev_file->file, pool));
+
   SVN_ERR(copy_file_data(context, context->pack_file, rev_file->file,
-                         finfo.size, iterpool));
+                         revfile_size, iterpool));

   /* mark the start of a new revision */
   SVN_ERR(svn_fs_fs__l2p_proto_index_add_revision(context->proto_l2p_index,
@@ -1460,7 +1456,7 @@

   /* read the phys-to-log index file until we covered the whole rev file.
    * That index contains enough info to build both target indexes from it. */
-  while (offset < finfo.size)
+  while (offset < revfile_size)
     {
       /* read one cluster */
       int i;
@@ -1484,7 +1480,7 @@

           /* process entry while inside the rev file */
           offset = entry->offset;
-          if (offset < finfo.size)
+          if (offset < revfile_size)
             {
               entry->offset += context->pack_offset;
               offset += entry->size;
@@ -1498,7 +1494,7 @@
     }

   svn_pool_destroy(iterpool);
-  context->pack_offset += finfo.size;
+  context->pack_offset += revfile_size;

   SVN_ERR(svn_fs_fs__close_revision_file(rev_file));


* subversion/libsvn_fs_fs/pack.c
  (sort_reps_range): Make the logic more robust against interger
                     overflows and extend the commentary.

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

--- subversion/libsvn_fs_fs/pack.c
+++ subversion/libsvn_fs_fs/pack.c
@@ -896,10 +896,15 @@
       /* Class 1:
        * Pretty round _and_ a significant stop in the node's delta chain.
        * This may pick up more than one representation from the same chain
-       * but that's rare not a problem.  Prefer simple checks here. */
+       * but that's rare not a problem.  Prefer simple checks here.
+       *
+       * The divider of 4 is arbitrary but seems to work well in practice.
+       * Larger values increase the number of item in the "hot zone".
+       * Smaller values make delta chains at HEAD more likely to contain
+       * "cold zone" representations. */
       svn_boolean_t likely_target
         =    (round >= ffd->max_linear_deltification)
-          && (4 * round >= path_order[i]->predecessor_count);
+          && (round >= path_order[i]->predecessor_count / 4);

       /* Class 2:
        * Anything from short node chains.  The default of 16 is generous


fix potential crash in FastSparseVector operator=

--- utils/fast_sparse_vector.h
+++ utils/fast_sparse_vector.h
@@ -25,8 +25,8 @@
 // I have to avoid this since I want to use unions and c++-98
 // does not let unions have types with constructors in them
 // this type bypasses default constructors. use with caution!
-// this should work as long as T is in a acceptable state to
-// have its destructor called when initialized with all zeros
+// this should work as long as T does have a destructor that
+// does anything
 template <typename T>
 struct PairIntT {
   const PairIntT& operator=(const std::pair<const int, T>& v) {
@@ -104,9 +104,6 @@
   };
  public:
   FastSparseVector() : local_size_(0), is_remote_(false) { std::memset(&data_, 0, sizeof(data_)); }
-  explicit FastSparseVector(const std::vector<T>& init) : local_size_(0), is_remote_(false) {
-    for (int i = 0; i < init.size(); ++i) set_value(i, init[i]);
-  }
   ~FastSparseVector() {
     clear();
   }
@@ -128,8 +125,8 @@
       }
     }
   }
-  const FastSparseVector& operator=(const FastSparseVector& other) {
-    if (is_remote_) delete data_.rbmap;
+  const FastSparseVector<T>& operator=(const FastSparseVector<T>& other) {
+    if (&other == this) return *this;
     std::memcpy(this, &other, sizeof(FastSparseVector));
     if (is_remote_)
       data_.rbmap = new std::map<int, T>(*data_.rbmap);
@@ -186,6 +183,7 @@
   }
   inline void clear() {
     if (is_remote_) delete data_.rbmap;
+    is_remote_ = false;
     local_size_ = 0;
   }
   inline bool empty() const {


* subversion/libsvn_fs_fs/tree.c
  (is_changed_node): Remove unused function.

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

--- subversion/libsvn_fs_fs/tree.c
+++ subversion/libsvn_fs_fs/tree.c
@@ -2527,65 +2527,6 @@
   return SVN_NO_ERROR;
 }

-/* Set CHANGES to TRUE if PATH in ROOT is unchanged in REVISION if the
-   same files system.  If the content is identical, parent path copies and
-   deletions still count as changes.  Use POOL for temporary allocations.
-   Not that we will return an error if PATH does not exist in ROOT or
-   REVISION- */
-static svn_error_t *
-is_changed_node(svn_boolean_t *changed,
-                svn_fs_root_t *root,
-                const char *path,
-                svn_revnum_t revision,
-                apr_pool_t *pool)
-{
-  dag_node_t *node, *rev_node;
-  svn_fs_root_t *rev_root;
-  svn_fs_root_t *copy_from_root1, *copy_from_root2;
-  const char *copy_from_path1, *copy_from_path2;
-
-  SVN_ERR(svn_fs_fs__revision_root(&rev_root, root->fs, revision, pool));
-
-  /* Get the NODE for FROM_PATH in FROM_ROOT.*/
-  SVN_ERR(get_dag(&node, root, path, TRUE, pool));
-  SVN_ERR(get_dag(&rev_node, rev_root, path, TRUE, pool));
-
-  /* different ID -> got changed */
-  if (!svn_fs_fs__id_eq(svn_fs_fs__dag_get_id(node),
-                        svn_fs_fs__dag_get_id(rev_node)))
-    {
-      *changed = TRUE;
-       return SVN_NO_ERROR;
-    }
-
-  /* same node. might still be a lazy copy with separate history */
-  SVN_ERR(fs_closest_copy(&copy_from_root1, &copy_from_path1, root,
-                          path, pool));
-  SVN_ERR(fs_closest_copy(&copy_from_root2, &copy_from_path2, rev_root,
-                          path, pool));
-
-  if (copy_from_root1 == NULL && copy_from_root2 == NULL)
-    {
-      /* never copied -> same line of history */
-      *changed = FALSE;
-    }
-  else if (copy_from_root1 != NULL && copy_from_root2 != NULL)
-    {
-      /* both got copied. At the same time & location? */
-      *changed = (copy_from_root1->rev != copy_from_root2->rev)
-                 || strcmp(copy_from_path1, copy_from_path2);
-    }
-  else
-    {
-      /* one is a copy while the other one is not
-       * -> different lines of history */
-      *changed = TRUE;
-    }
-
-  return SVN_NO_ERROR;
-}
-
-
 /* Copy the node at FROM_PATH under FROM_ROOT to TO_PATH under
    TO_ROOT.  If PRESERVE_HISTORY is set, then the copy is recorded in
    the copies table.  Perform temporary allocations in POOL. */


In FSFS, make the dag node cache work for transactions.  A step
towards O(n) FS performance for directories with many files.

* libsvn_fs_fs/tree.c
  (fs_root_data_t): Remove the "only for revision roots" comment.
  (dag_node_cache_get): Allow transaction roots.  Check for
   cache_item->node being NULL, which means the entry has been
   invalidated.
  (dag_node_cache_set): Remove puzzling comment text which amounts to
   "callers should not call this unless they have some reason to do
   so."  Allow transaction roots.  Provide working code for reusing a
   cache item.
  (dag_node_cache_invalidate): New function, invalidates the cache
   entries for a path and its children.  (Might be nice to restructure
   the cache so that this operation doesn't require a full scan, some
   day.)
  (make_path_mutable): Update the cache with the new entry.
  (fs_make_dir, fs_make_file): Add the new entry to the cache.
  (fs_delete_file): Invalidate the path and its children in the cache.

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

--- subversion/libsvn_fs_fs/tree.c
+++ subversion/libsvn_fs_fs/tree.c
@@ -105,17 +105,7 @@
   dag_node_t *root_dir;

   /* Cache structures, for mapping const char * PATH to const
-     struct dag_node_cache_t * structures.
-
-     ### Currently this is only used for revision roots.  To be safe
-     for transaction roots, you must have the guarantee that there is
-     never more than a single transaction root per Subversion
-     transaction ever open at a given time -- having two roots open to
-     the same Subversion transaction would be a request for pain.
-     Also, you have to ensure that if a 'make_path_mutable()' fails for
-     any reason, you don't leave cached nodes for the portion of that
-     function that succeeded.  In other words, this cache must never,
-     ever, lie. */
+     struct dag_node_cache_t * structures. */
   apr_hash_t *node_cache;
   const char *node_cache_keys[SVN_FS_NODE_CACHE_MAX_KEYS];
   int node_cache_idx;
@@ -155,23 +145,16 @@
   /* Assert valid input. */
   assert (*path == '/');

-  /* Only allow revision roots. */
-  if (root->is_txn_root)
-    return NULL;
-
   /* Look in the cache for our desired item. */
   cache_item = apr_hash_get (frd->node_cache, path, APR_HASH_KEY_STRING);
-  if (cache_item)
+  if (cache_item && cache_item->node)
     return svn_fs_fs__dag_dup (cache_item->node, pool);

   return NULL;
 }

-/* Add the NODE for PATH to ROOT's node cache.  Callers should *NOT*
-   call this unless they are adding a currently un-cached item to the
-   cache, or are replacing the NODE for PATH with a new (different)
-   one. */
+/* Add the NODE for PATH to ROOT's node cache. */
 static void
 dag_node_cache_set (svn_fs_root_t *root,
                     const char *path,
@@ -198,55 +181,20 @@
   assert ((frd->node_cache_idx <= num_keys)
           && (num_keys <= SVN_FS_NODE_CACHE_MAX_KEYS));

-  /* Only allow revision roots. */
-  if (root->is_txn_root)
-    return;
-
-  /* Special case: the caller wants us to replace an existing cached
-     node with a new one.  If the callers aren't mindless, this should
-     only happen when a node is made mutable under a transaction
-     root, and that only happens once under that root.  So, we'll be a
-     little bit sloppy here, and count on callers doing the right
-     thing. */
   cache_item = apr_hash_get (frd->node_cache, path, APR_HASH_KEY_STRING);
   if (cache_item)
     {
-      /* ### This section is somehow broken.  I don't know how, but it
-         ### is.  And I don't want to spend any more time on it.  So,
-         ### callers, use only revision root and don't try to update
-         ### an already-cached thing.  -- cmpilato */
-      abort();
-
-#if 0
-      int cache_index = cache_item->idx;
-      cache_path = frd->node_cache_keys[cache_index];
-      cache_pool = cache_item->pool;
-      cache_item->node = svn_fs_fs__dag_dup (node, cache_pool);
-
-      /* Now, move the cache key reference to the end of the keys in
-         the keys array (unless it's already at the end).  ### Yes,
-         it's a memmove(), but we're not talking about pages of memory
-         here. */
-      if (cache_index != (num_keys - 1))
-        {
-          int move_num = SVN_FS_NODE_CACHE_MAX_KEYS - cache_index - 1;
-          memmove (frd->node_cache_keys + cache_index,
-                   frd->node_cache_keys + cache_index + 1,
-                   move_num * sizeof (const char *));
-          cache_index = num_keys - 1;
-          frd->node_cache_keys[cache_index] = cache_path;
-        }
-
-      /* Advance the cache pointers. */
-      cache_item->idx = cache_index;
-      frd->node_cache_idx = (cache_index + 1) % SVN_FS_NODE_CACHE_MAX_KEYS;
+      /* Reuse the existing cache item.  (In theory we should unset
+         the hash entry, clear the pool, rebuild the cache item, and
+         reset the hash entry, but it's unlikely that the same path
+         will be replaced many times in a single transaction.) */
+      cache_item->node = svn_fs_fs__dag_dup (node, cache_item->pool);
       return;
-#endif
     }

   /* We're adding a new cache item.  First, see if we have room for it
      (otherwise, make some room). */
-  if (apr_hash_count (frd->node_cache) == SVN_FS_NODE_CACHE_MAX_KEYS)
+  if (num_keys == SVN_FS_NODE_CACHE_MAX_KEYS)
     {
       /* No room.  Expire the oldest thing. */
       cache_path = frd->node_cache_keys[frd->node_cache_idx];
@@ -271,12 +219,33 @@
   cache_path = apr_pstrdup (cache_pool, path);
   apr_hash_set (frd->node_cache, cache_path, APR_HASH_KEY_STRING, cache_item);
   frd->node_cache_keys[frd->node_cache_idx] = cache_path;
-
+
   /* Advance the cache pointer. */
-  frd->node_cache_idx = (frd->node_cache_idx + 1)
-    % SVN_FS_NODE_CACHE_MAX_KEYS;
-}
-
+  frd->node_cache_idx = (frd->node_cache_idx + 1) % SVN_FS_NODE_CACHE_MAX_KEYS;
+}
+
+
+/* Invalidate cache entries for PATH and any of its children. */
+static void
+dag_node_cache_invalidate (svn_fs_root_t *root,
+                           const char *path)
+{
+  fs_root_data_t *frd = root->fsap_data;
+  int i, num_keys = apr_hash_count (frd->node_cache);
+  apr_size_t len = strlen (path);
+  const char *key;
+  struct dag_node_cache_t *item;
+
+  for (i = 0; i < num_keys; i++)
+    {
+      key = frd->node_cache_keys[i];
+      if (strncmp (key, path, len) == 0 && (key[len] == '/' || !key[len]))
+        {
+          item = apr_hash_get (frd->node_cache, key, APR_HASH_KEY_STRING);
+          item->node = NULL;
+        }
+    }
+}

 @@ -867,6 +836,9 @@
                                            copy_id, txn_id,
                                            is_parent_copyroot,
                                            pool));
+
+      /* Update the path cache. */
+      dag_node_cache_set (root, parent_path_path (parent_path, pool), clone);
     }
   else
     {
@@ -2204,6 +2176,9 @@
                                     txn_id,
                                     pool));

+  /* Add this directory to the path cache. */
+  dag_node_cache_set (root, parent_path_path (parent_path, pool), sub_dir);
+
   /* Make a record of this modification in the changes table. */
   SVN_ERR (add_change (root->fs, txn_id, path, svn_fs_fs__dag_get_id (sub_dir),
                        svn_fs_path_change_add, 0, 0, SVN_INVALID_REVNUM, NULL,
@@ -2238,7 +2213,10 @@
   SVN_ERR (svn_fs_fs__dag_delete (parent_path->parent->node,
                                   parent_path->entry,
                                   txn_id, pool));
-
+
+  /* Remove this node and any children from the path cache. */
+  dag_node_cache_invalidate (root, parent_path_path (parent_path, pool));
+
   /* Make a record of this modification in the changes table. */
   SVN_ERR (add_change (root->fs, txn_id, path,
                        svn_fs_fs__dag_get_id (parent_path->node),
@@ -2453,6 +2431,9 @@
                                      parent_path->entry,
                                      txn_id,
                                      pool));
+
+  /* Add this file to the path cache. */
+  dag_node_cache_set (root, parent_path_path (parent_path, pool), child);

   /* Make a record of this modification in the changes table. */
   SVN_ERR (add_change (root->fs, txn_id, path, svn_fs_fs__dag_get_id (child),


fix bad openssl error assert

fix bad openssl error assert

--- gsi/openssl_error/source/library/globus_error_openssl.c
+++ gsi/openssl_error/source/library/globus_error_openssl.c
@@ -554,8 +554,12 @@
          * openssl error chain
          */
         globus_i_openssl_error_handle_destroy(openssl_error_handle);
-        globus_object_free(error);
-        error = base_cause;
+        if(base_cause)
+        {
+            globus_object_free(error);
+            error = base_cause;
+        }
+
         goto done;
     }


添加文本样式解析代码

添加文本样式解析代码

--- src/gui/widget/textview.c
+++ src/gui/widget/textview.c
@@ -52,6 +52,7 @@
 };

 typedef struct LCUI_TextView_ {
+	LCUI_TextStyle style;
 	LCUI_TextLayer layer;	/**< 文本图层 */
 	struct {
 		LCUI_BOOL is_valid;
@@ -65,6 +66,115 @@

 /*---------------------------- Private -------------------------------*/

+enum FontStyleKey {
+	key_color,
+	key_font_size,
+	key_font_style,
+	key_font_weight,
+	key_font_family,
+	TOTAL_FONT_STYLE_KEY
+};
+
+enum FontStyleType {
+	FS_NORMAL,
+	FS_ITALIC,
+	FS_OBLIQUE
+};
+
+static int style_key_map[TOTAL_FONT_STYLE_KEY];
+
+static int OnParseColor( LCUI_StyleSheet ss, int key, const char *str )
+{
+	LCUI_Style *s = &ss->sheet[key];
+	if( ParseColor( s, str ) ) {
+		return 0;
+	}
+	return -1;
+}
+
+static int OnParseFontSize( LCUI_StyleSheet ss, int key, const char *str )
+{
+	LCUI_Style *s = &ss->sheet[key];
+	if( ParseNumber( s, str ) ) {
+		return 0;
+	}
+	return -1;
+}
+
+static int OnParseFontFamily( LCUI_StyleSheet ss, int key, const char *str )
+{
+	if( ss->sheet[style_key_map[key]].is_valid
+	 && ss->sheet[style_key_map[key]].string) {
+		free( ss->sheet[style_key_map[key]].string );
+	}
+	SetStyle( ss, style_key_map[key], strdup(str), string );
+	return 0;
+}
+
+static int OnParseFontStyle( LCUI_StyleSheet ss, int key, const char *str )
+{
+	if( strcmp(str, "normal") == 0 ) {
+		ss->sheet[style_key_map[key]].type = SVT_VALUE;
+		ss->sheet[style_key_map[key]].value = 0;
+		return 0;
+	}
+	return -1;
+}
+
+static int OnParseFontWeight( LCUI_StyleSheet ss, int key, const char *str )
+{
+	return -1;
+}
+
+static LCUI_StyleParser style_parsers[] = {
+	{ key_color, "color", OnParseColor },
+	{ key_font_family, "font-family", OnParseFontFamily },
+	{ key_font_size, "font-size", OnParseFontSize },
+	{ key_font_style, "font-style", OnParseFontStyle },
+	{ key_font_weight, "font-weight", OnParseFontWeight },
+};
+
+static void TextView_UpdateStyle( LCUI_Widget w )
+{
+	int i, key;
+	LCUI_TextView *txt = (LCUI_TextView*)w->private_data;
+
+	for( i = 0; i < TOTAL_FONT_STYLE_KEY; ++i ) {
+		key = style_key_map[i];
+		if( key < 0 ) {
+			continue;
+		}
+		if( !w->style->sheet[key].is_changed ) {
+			continue;
+		}
+		switch( key ) {
+		case key_color:
+			txt->style.fore_color = w->style->sheet[key].color;
+			break;
+		case key_font_family:
+			_DEBUG_MSG("font_family: %s\n", w->style->sheet[key].string);
+			TextStyle_SetFont( &txt->style, w->style->sheet[key].string );
+			break;
+		case key_font_size:
+			if( w->style->sheet[key].type == SVT_PX ) {
+				txt->style.pixel_size = w->style->sheet[key].px;
+			} else if( w->style->sheet[key].type == SVT_PT ) {
+				// ...
+			} else {
+				txt->style.pixel_size = 13;
+			}
+			break;
+		case key_font_style:
+			txt->style.style = w->style->sheet[key].value;
+			break;
+		case key_font_weight:
+			// ...
+		default:
+			break;
+		}
+	}
+}
+
 static void TextView_OnResize( LCUI_Widget w, LCUI_WidgetEvent *e, void *arg )
 {
 	LinkedList rects;
@@ -96,6 +206,7 @@
 	LCUI_TextView *txt;

 	txt = Widget_NewPrivateData( w, LCUI_TextView );
+	TextStyle_Init( &txt->style );
 	for( i = 0; i < TASK_TOTAL; ++i ) {
 		txt->tasks[i].is_valid = FALSE;
 	}
@@ -138,7 +249,8 @@
 	}
 	DirtyRectList_Destroy( &rects );
 	TextLayer_ClearInvalidRect( txt->layer );
-	if( w->computed_style.w.type == SVT_AUTO || w->computed_style.h.type == SVT_AUTO ) {
+	if( w->computed_style.w.type == SVT_AUTO
+	 || w->computed_style.h.type == SVT_AUTO ) {
 		Widget_AddTask( w, WTT_RESIZE );
 	}
 }
@@ -272,10 +384,17 @@
 /** 添加 TextView 部件类型 */
 void LCUIWidget_AddTextView( void )
 {
+	int i;
 	LCUI_WidgetClass *wc = LCUIWidget_AddClass( "textview" );
 	wc->methods.init = TextView_OnInit;
 	wc->methods.paint = TextView_OnPaint;
 	wc->methods.destroy = TextView_OnDestroy;
 	wc->methods.autosize = TextView_AutoSize;
+	wc->methods.update = TextView_UpdateStyle;
 	wc->task_handler = TextView_OnTask;
-}
+
+	for( i = 0; i < TOTAL_FONT_STYLE_KEY; ++i ) {
+		style_key_map[style_parsers[i].key] =
+		LCUICssParser_Register( &style_parsers[i] );
+	}
+}


* subversion/libsvn_subr/error.c   (print_error, svn_handle_warning2):     Print the numeric APR_ERR error code (as E%d or W%d) along with the message.

--- subversion/libsvn_subr/error.c
+++ subversion/libsvn_subr/error.c
@@ -456,8 +456,9 @@
   /* Only print the same APR error string once. */
   else if (err->message)
     {
-      svn_error_clear(svn_cmdline_fprintf(stream, err->pool, "%s%s\n",
-                                          prefix, err->message));
+      svn_error_clear(svn_cmdline_fprintf(stream, err->pool,
+                                          "%sE%d: %s\n",
+                                          prefix, err->apr_err, err->message));
     }
   else
     {
@@ -475,7 +476,8 @@
         }

       svn_error_clear(svn_cmdline_fprintf(stream, err->pool,
-                                          "%s%s\n", prefix, err_string));
+                                          "%sE%d: %s\n",
+                                          prefix, err->apr_err, err_string));
     }
 }

@@ -570,8 +572,9 @@

   svn_error_clear(svn_cmdline_fprintf
                   (stream, err->pool,
-                   _("%swarning: %s\n"),
-                   prefix, svn_err_best_message(err, buf, sizeof(buf))));
+                   _("%swarning: W%d: %s\n"),
+                   prefix, err->apr_err,
+                   svn_err_best_message(err, buf, sizeof(buf))));
   fflush(stream);
 }


added some comments

added some comments

--- include/csgapplication.h
+++ include/csgapplication.h
@@ -35,9 +35,12 @@
     bool EvaluateOptions();
     void Run(void);

+    /// \brief overload and return true to enable mapping command line options
     virtual bool DoMapping(void) { return false; }
+    /// \brief overload and return true to enable trajectory command line options
     virtual bool DoTrajectory(void) { return false; }

+    /// \brief called after topology was loaded
     virtual void EvaluateTopology(Topology *top) {}

     /// \brief called before the first frame


fixed behavior of get_proxy_filename with X509_USER_PROXY set

--- gsi/sysconfig/source/library/globus_gsi_system_config.c
+++ gsi/sysconfig/source/library/globus_gsi_system_config.c
@@ -4595,6 +4595,18 @@
             & env_user_proxy,
             & status,
             env_value);
+        if(proxy_file_type == GLOBUS_PROXY_FILE_OUTPUT &&
+           status == GLOBUS_FILE_DOES_NOT_EXIST)
+        {
+            globus_object_t *           error_obj;
+            error_obj = globus_error_get(result);
+            globus_object_free(error_obj);
+
+            *user_proxy = env_user_proxy;
+            status = GLOBUS_FILE_VALID;
+            result = GLOBUS_SUCCESS;
+        }
+
         if(result != GLOBUS_SUCCESS)
         {
             GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(


Update textview fixed size compute

Update textview fixed size compute

--- src/gui/widget/textview.c
+++ src/gui/widget/textview.c
@@ -226,7 +226,7 @@
 		int fixed_w = txt->layer->fixed_width;
 		int fixed_h = txt->layer->fixed_height;
 		/* 解除固定宽高设置，以计算最大宽高 */
-		TextLayer_SetFixedSize( txt->layer, (int)*width, 0 );
+		TextLayer_SetFixedSize( txt->layer, (int)(*width * scale), 0 );
 		TextLayer_Update( txt->layer, NULL );
 		if( *width <= 0 ) {
 			*width = TextLayer_GetWidth( txt->layer ) / scale;


runtime: clean up / align comment tabbing

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/13336046

--- src/pkg/runtime/runtime.h
+++ src/pkg/runtime/runtime.h
@@ -253,10 +253,10 @@
 	Defer*	defer;
 	Panic*	panic;
 	Gobuf	sched;
-	uintptr	syscallstack;		// if status==Gsyscall, syscallstack = stackbase to use during gc
-	uintptr	syscallsp;		// if status==Gsyscall, syscallsp = sched.sp to use during gc
-	uintptr	syscallpc;		// if status==Gsyscall, syscallpc = sched.pc to use during gc
-	uintptr	syscallguard;		// if status==Gsyscall, syscallguard = stackguard to use during gc
+	uintptr	syscallstack;	// if status==Gsyscall, syscallstack = stackbase to use during gc
+	uintptr	syscallsp;	// if status==Gsyscall, syscallsp = sched.sp to use during gc
+	uintptr	syscallpc;	// if status==Gsyscall, syscallpc = sched.pc to use during gc
+	uintptr	syscallguard;	// if status==Gsyscall, syscallguard = stackguard to use during gc
 	uintptr	stackguard;	// same as stackguard0, but not set to StackPreempt
 	uintptr	stack0;
 	uintptr	stacksize;
@@ -282,7 +282,7 @@
 	uintptr	sigcode0;
 	uintptr	sigcode1;
 	uintptr	sigpc;
-	uintptr	gopc;	// pc of go statement that created this goroutine
+	uintptr	gopc;		// pc of go statement that created this goroutine
 	uintptr	racectx;
 	uintptr	end[];
 };
@@ -328,11 +328,11 @@
 	uint32	stackcachecnt;
 	void*	stackcache[StackCacheSize];
 	G*	lockedg;
-	uintptr	createstack[32];	// Stack that created this thread.
+	uintptr	createstack[32];// Stack that created this thread.
 	uint32	freglo[16];	// D[i] lsb and F[i]
 	uint32	freghi[16];	// D[i] msb and F[i+16]
 	uint32	fflag;		// floating point compare flags
-	uint32	locked;	// tracking for LockOSThread
+	uint32	locked;		// tracking for LockOSThread
 	M*	nextwaitm;	// next M waiting for lock
 	uintptr	waitsema;	// semaphore for parking on locks
 	uint32	waitsemacount;
@@ -363,11 +363,11 @@
 	Lock;

 	int32	id;
-	uint32	status;	// one of Pidle/Prunning/...
+	uint32	status;		// one of Pidle/Prunning/...
 	P*	link;
 	uint32	schedtick;	// incremented on every scheduler call
 	uint32	syscalltick;	// incremented on every system call
-	M*	m;	// back-link to associated M (nil if idle)
+	M*	m;		// back-link to associated M (nil if idle)
 	MCache*	mcache;

 	// Queue of runnable goroutines.
@@ -431,7 +431,7 @@
 struct	Func
 {
 	uintptr	entry;	// start pc
-	int32	nameoff;	// function name
+	int32	nameoff;// function name

 	// TODO: Perhaps remove these fields.
 	int32	args;	// in/out args size
@@ -482,7 +482,7 @@
 // If this struct changes, adjust ../time/sleep.go:/runtimeTimer.
 struct	Timer
 {
-	int32	i;		// heap index
+	int32	i;	// heap index

 	// Timer wakes up at when, and then at when+period, ... (period > 0 only)
 	// each time calling f(now, arg) in the timer goroutine, so f must be
@@ -645,9 +645,9 @@
 struct Defer
 {
 	int32	siz;
-	bool	special; // not part of defer frame
-	bool	free; // if special, free when done
-	byte*	argp;  // where args were copied from
+	bool	special;	// not part of defer frame
+	bool	free;		// if special, free when done
+	byte*	argp;		// where args were copied from
 	byte*	pc;
 	FuncVal*	fn;
 	Defer*	link;
@@ -682,7 +682,7 @@
 	uintptr	lr;	// program counter at caller aka link register
 	uintptr	sp;	// stack pointer at pc
 	uintptr	fp;	// stack pointer at caller aka frame pointer
-	byte*	varp;		// top of local variables
+	byte*	varp;	// top of local variables
 	byte*	argp;	// pointer to function arguments
 	uintptr	arglen;	// number of bytes at argp
 };


Host: Refactor path normalize

Host: Refactor path normalize

--- src/host/path_normalize.c
+++ src/host/path_normalize.c
@@ -8,128 +8,124 @@
 #include <ctype.h>
 #include <string.h>

-// isspace custom version (visual c++'s one doesn't like utf8 characters)
-static int is_space(char c)
-{
-	return  (c >= 9 && c <= 13) || c == 32;
-}
+#define	IS_SEP(__c)			((__c) == '/' || (__c) == '\\')

-static void* normalize_substring(const char* str, const char* endPtr, char* writePtr) {
-	const char* const source = str;
-	const char* const writeBegin = writePtr;
-	const char* ptr;
-	char last = 0;
-	char ch;
+#define IS_UPPER_ALPHA(__c)	((__c) >= 'A' && (__c) <= 'Z')
+#define IS_LOWER_ALPHA(__c)	((__c) >= 'a' && (__c) <= 'z')
+#define IS_ALPHA(__c)		(IS_UPPER_ALPHA(__c) || IS_LOWER_ALPHA(__c))

-	while (str != endPtr) {
-		ch = (*str);
+#define IS_SPACE(__c)		((__c >= '\t' && __c <= '\r') || __c == ' ')

-		/* make sure we're using '/' for all separators */
-		if (ch == '\\') {
-			ch = '/';
+static void* normalize_substring(const char* srcPtr, const char* srcEnd, char* dstPtr) {
+
+#define IS_END(__p)			(__p >= srcEnd || *__p == '\0')
+#define IS_SEP_OR_END(__p)	(IS_END(__p) || IS_SEP(*__p))
+
+	// Handle Windows absolute paths
+	if (IS_ALPHA(srcPtr[0]) && srcPtr[1] == ':')
+	{
+		*(dstPtr++) = srcPtr[0];
+		*(dstPtr++) = ':';
+
+		srcPtr += 2;
+	}
+
+	// Handle path starting with a sep (C:/ or /)
+	if (IS_SEP(*srcPtr))
+	{
+		++srcPtr;
+		*(dstPtr++) = '/';
+		// Handle path starting with //
+		if (IS_SEP(*srcPtr))
+		{
+			++srcPtr;
+			*(dstPtr++) = '/';
 		}
+	}

-		/* filter out .. except when it's part of the file or folder name */
-		if (ch == '.' && last == '.' && *(str - 2) == '/' && (*(str + 1) == '/' || str + 1 == endPtr)) {
-			last = 0;
+	const char * const dstRoot = dstPtr;
+	unsigned int folderDepth = 0;

-			ptr = writePtr - 3;
-			while (ptr >= writeBegin) {
-				/* break on '/' except when it's '/../' */
-				if (ptr[0] == '/' && !(ptr[1] == '.' && ptr[2] == '.' && ptr[3] == '/')) {
-					writePtr -= writePtr - ptr;
+	while (!IS_END(srcPtr))
+	{
+		// Skip multiple sep and "./" pattern
+		while (IS_SEP(*srcPtr) || (srcPtr[0] == '.' && IS_SEP_OR_END(&srcPtr[1])))
+			++srcPtr;

-					/* special fix for cases, when '..' is the last chars in path i.e. d:\game\.., this should be converted into d:\,
-					but without this case, it will be converted into d: */
-					if (writePtr - 1 >= writeBegin && *(writePtr - 1) == ':' && str + 1 == endPtr) {
-						++writePtr;
-					}
-					break;
-				}
-				--ptr;
+		if (IS_END(srcPtr))
+			break;
+
+		// Handle "../ pattern"
+		if (srcPtr[0] == '.' && srcPtr[1] == '.' && IS_SEP_OR_END(&srcPtr[2]))
+		{
+			if (folderDepth > 0)
+			{
+				// Here dstPtr[-1] is safe as folderDepth > 0.
+				while (--dstPtr != dstRoot && !IS_SEP(dstPtr[-1]));
+
+				--folderDepth;
 			}
+			else
+			{
+				*(dstPtr++) = '.';
+				*(dstPtr++) = '.';
+				*(dstPtr++) = '/';
+			}
+			srcPtr += 3;
+		}
+		else
+		{
+			while (!IS_SEP_OR_END(srcPtr))
+				*(dstPtr++) = *(srcPtr++);

-			if (ptr < writeBegin) {
-				*(writePtr++) = ch;
-			}
-
-			++str;
-			continue;
-		}
-
-		/* filter out /./ */
-		if (ch == '/' && last == '.') {
-			ptr = str - 2;
-			if (*ptr == '/') {	// there is no need to check whether ptr >= source since all the leading ./ will be skipped in path_normalize
-				if (ptr - 1 < source || *(ptr - 1) != ':') {
-					--writePtr;
-				}
-
-				++str;
-				continue;
+			if (IS_SEP(*srcPtr))
+			{
+				*(dstPtr++) = '/';
+				++srcPtr;
+				++folderDepth;
 			}
 		}
-
-		/* add to the result, filtering out duplicate slashes, except when they are leading slashes */
-		if (str == &source[1] || (ch != '/' || last != '/')) {
-			*(writePtr++) = ch;
-		}
-
-		last = ch;
-		++str;
 	}

-	/* remove any trailing slashes, except those, that follow the ':', to avoid a path corruption i.e. D:\ -> D: */
-	while (*(--endPtr) == '/' && *(endPtr - 1) != ':') {
-		--writePtr;
-	}
+	// Remove trailing slash except for C:/ or / (root)
+	while (dstPtr != dstRoot && IS_SEP(dstPtr[-1]))
+		--dstPtr;

-	*writePtr = *str;
-
-	return writePtr;
+	return dstPtr;
 }

 int path_normalize(lua_State* L)
 {
-	const char* path = luaL_checkstring(L, 1);
-	const char* readPtr = path;
+	const char *path = luaL_checkstring(L, 1);
+	const char *readPtr = path;
 	char buffer[0x4000] = { 0 };
-	char* writePtr = buffer;
-	const char* endPtr;
+	char *writePtr = buffer;
+	const char *endPtr;

 	// skip leading white spaces
-	while (*readPtr && is_space(*readPtr)) {
+	while (IS_SPACE(*readPtr))
 		++readPtr;
-	}

 	endPtr = readPtr;

 	while (*endPtr) {
-		/* remove any leading "./" sequences */
-		while (strncmp(readPtr, "./", 2) == 0) {
-			readPtr += 2;
-		}
-
 		// find the end of sub path
-		while (*endPtr && !is_space(*endPtr)) {
+		while (*endPtr && !IS_SPACE(*endPtr))
 			++endPtr;
-		}

 		writePtr = normalize_substring(readPtr, endPtr, writePtr);

 		// skip any white spaces between sub paths
-		while (*endPtr && is_space(*endPtr)) {
+		while (IS_SPACE(*endPtr))
 			*(writePtr++) = *(endPtr++);
-		}

 		readPtr = endPtr;
 	}

 	// skip any trailing white spaces
-	while (is_space(*(--endPtr))) {
+	while (writePtr != buffer && IS_SPACE(writePtr[-1]))
 		--writePtr;
-	}

 	*writePtr = 0;


More cleanup.

More cleanup.

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

--- include/csgfx/rgbpixel.h
+++ include/csgfx/rgbpixel.h
@@ -88,12 +88,6 @@
     (unsigned char)c.blue + blue); }
 } CS_STRUCT_ALIGN_4BYTE_END;

-// As an optimization, we sometimes handle R/G/B values simultaneously.
-#ifdef CS_BIG_ENDIAN
-#  define RGB_MASK 0xffffff00
-#else
-#  define RGB_MASK 0x00ffffff
-#endif

 /**
  * An RGB pixel. In addition to R,G,B color components this structure also
@@ -199,8 +193,6 @@
   }
 } CS_STRUCT_ALIGN_4BYTE_END;

-// We don't need RGB_MASK anymore
-#undef RGB_MASK

 /** \name Eye sensivity to different color components
  * Eye sensivity to different color components, from NTSC grayscale equation.


Bug 852972, Meaningless comparison with string literal in install-ds.c, patch by Maxim Philippov and me, r=emaldona

--- cmd/modutil/install-ds.c
+++ cmd/modutil/install-ds.c
@@ -214,13 +214,14 @@
                                      FILE_PERMISSIONS_STRING)) {
 				subiter = Pk11Install_ListIter_new(subpair->list);
 				subval = subiter->current;
-				if(!subval || (subval->type != STRING_VALUE)){
+				if(!subval || (subval->type != STRING_VALUE) ||
+				   !subval->string || !subval->string[0]){
 					errStr = PR_smprintf(errString[BOGUS_FILE_PERMISSIONS],
                                     _this->jarPath);
 					goto loser;
 				}
 				_this->permissions = (int) strtol(subval->string, &endp, 8);
-				if(*endp != '\0' || subval->string == "\0") {
+				if(*endp != '\0') {
 					errStr = PR_smprintf(errString[BOGUS_FILE_PERMISSIONS],
                                     _this->jarPath);
 					goto loser;


Added resizing.

Added resizing.

--- src/display.c
+++ src/display.c
@@ -149,6 +149,22 @@
   return extents.x_advance;
 }

+static image_format_t get_new_size(cairo_t *cr, uint32_t width, uint32_t height,
+        uint32_t win_size_x, uint32_t win_size_y) {
+  image_format_t new_format = { width, height };
+  if (width > win_size_x || height > win_size_y) {
+      /* Formatting only the big picture. */
+      float prop = min((float)win_size_x / width,
+              (float)win_size_y / height);
+      /* Finding the best proportion to fit the picture. */
+      new_format.width = prop * width;
+      new_format.height = prop * height;
+
+      debug("Resizing the image to %ix%i (prop = %f)\n", new_format.width, new_format.height, prop);
+  }
+  return new_format;
+}
+
 /* @brief Draw a png at the given offset.
  *
  * @param cr A cairo context for drawing to the screen.
@@ -160,12 +176,20 @@
  * @return The advance in the x direction.
  */
 static void draw_jpeg(cairo_t *cr, const char *file, offset_t offset, uint32_t win_size_x, uint32_t win_size_y, image_format_t *format) {
-    GdkPixbuf *image;
-    GError *error;
-
-    image = gdk_pixbuf_new_from_file(file, &error);
-    gdk_cairo_set_source_pixbuf(cr, image, offset.x, offset.image_y);
-    cairo_paint (cr);
+  GdkPixbuf *image;
+  GError *error;
+
+  image = gdk_pixbuf_new_from_file(file, &error);
+
+  image_format_t new_form;
+  new_form = get_new_size(cr, gdk_pixbuf_get_width(image), gdk_pixbuf_get_height(image), win_size_x, win_size_y);
+  *format = new_form;
+
+  /* Resizing */
+  GdkPixbuf *resize =  gdk_pixbuf_scale_simple(image, new_form.width, new_form.height, GDK_INTERP_BILINEAR);
+
+  gdk_cairo_set_source_pixbuf(cr, resize, offset.x, offset.image_y);
+  cairo_paint (cr);
 }

 /* @brief Draw a png at the given offset.
@@ -184,20 +208,12 @@
   (*format).width = cairo_image_surface_get_width(img);
   (*format).height = cairo_image_surface_get_height(img);

-  if ((*format).width > win_size_x || (*format).height > win_size_y) {
-      /* Formatting only the big picture. */
-      float prop = min((float)win_size_x / (*format).width,
-              (float)win_size_y / (*format).height);
-      /* Finding the best proportion to fit the picture. */
-      image_format_t new_format;
-      new_format.width = prop * (*format).width;
-      new_format.height = prop * (*format).height;
-
-      img = scale_surface(img, (*format).width, (*format).height,
-              new_format.width, new_format.height);
-      *format = new_format;
-      debug("Resizing the image to %ix%i (prop = %f)\n", (*format).width, (*format).height, prop);
-  }
+  image_format_t new_format = get_new_size(cr, (*format).width, (*format).height, win_size_x, win_size_y);
+
+  img = scale_surface(img, (*format).width, (*format).height,
+          new_format.width, new_format.height);
+
+  *format = new_format;

   debug("Drawing the picture in x:%i, y:%i\n", offset.x, offset.image_y);
   cairo_set_source_surface(cr, img, offset.x, offset.image_y);


Core:TypedMesh: Simplified Vertex Tuple

Core:TypedMesh: Simplified Vertex Tuple

--- include/inviwo/core/datastructures/geometry/typedmesh.h
+++ include/inviwo/core/datastructures/geometry/typedmesh.h
@@ -39,6 +39,8 @@
 #include <inviwo/core/datastructures/buffer/bufferram.h>
 #include <inviwo/core/datastructures/buffer/bufferramprecision.h>

+#include <tuple>
+
 namespace inviwo {

 /**
@@ -302,31 +304,12 @@
     template <typename T>
     using TypeAlias = typename T::type;

-    class Vertex {
-
-        template <unsigned I, typename T2, typename... ARGS>
-        void set(T2 &t, ARGS... args) {
-            std::get<I>(values) = t;
-            set<I + 1>(args...);
-        }
-
-        template <unsigned I, typename T2>
-        void set(T2 &t) {
-            std::get<I>(values) = t;
-        }
-
+    using VertexTuple = std::tuple<TypeAlias<BufferTraits>...>;
+    class Vertex : public VertexTuple {
     public:
         Vertex() = default;
-        Vertex(const Vertex &) = default;
-        Vertex &operator=(const Vertex &) = default;
-        ~Vertex() = default;
-
-        Vertex(TypeAlias<BufferTraits>... vals) { set<0>(vals...); }
-        using VertexTuple = std::tuple<TypeAlias<BufferTraits>...>;
-        VertexTuple values;
+        Vertex(TypeAlias<BufferTraits>... vals) : VertexTuple(vals...) { }
     };
-
-    // using Vertex = std::tuple<TypeAlias<BufferTraits>...>;
 #endif

     TypedMesh(DrawType dt = DrawType::Points, ConnectivityType ct = ConnectivityType::None)
@@ -455,7 +438,7 @@
             vec.reserve(neededSize);
         }
         for (auto &v : vertices) {
-            vec.push_back(std::get<I>(v.values));
+            vec.push_back(std::get<I>(v));
         }

         addVerticesImpl<I + 1, ARGS...>(vertices);


commit to head to fix bug in sysconfig changes from status to using globus errors.  In globus_i_gsi_sysconfig_create_key_string, key_string_value shouldn't be freed if error, since some errors are recoverable.

--- gsi/sysconfig/source/library/globus_gsi_system_config.c
+++ gsi/sysconfig/source/library/globus_gsi_system_config.c
@@ -398,8 +398,6 @@
         GLOBUS_GSI_SYSCONFIG_ERROR_CHAIN_RESULT(
             result,
             GLOBUS_GSI_SYSCONFIG_ERROR_GETTING_KEY_STRING);
-        free(*key_string_value);
-        *key_string_value = NULL;
         goto exit;
     }


Remove unused variable segbase

Remove unused variable segbase

--- src/dwarf/Gfind_proc_info-lsb.c
+++ src/dwarf/Gfind_proc_info-lsb.c
@@ -545,7 +545,7 @@
   unw_dyn_info_t *di = &cb_data->di;
   const Elf_W(Phdr) *phdr, *p_eh_hdr, *p_dynamic, *p_text;
   unw_word_t addr, eh_frame_start, eh_frame_end, fde_count, ip;
-  Elf_W(Addr) load_base, segbase = 0, max_load_addr = 0;
+  Elf_W(Addr) load_base, max_load_addr = 0;
   int ret, need_unwind_info = cb_data->need_unwind_info;
   unw_proc_info_t *pi = cb_data->pi;
   struct dwarf_eh_frame_hdr *hdr;
@@ -597,27 +597,6 @@

   if (p_eh_hdr)
     {
-      if (likely (p_eh_hdr->p_vaddr >= p_text->p_vaddr
-		  && p_eh_hdr->p_vaddr < p_text->p_vaddr + p_text->p_memsz))
-	/* normal case: eh-hdr is inside text segment */
-	segbase = p_text->p_vaddr + load_base;
-      else
-	{
-	  /* Special case: eh-hdr is in some other segment; this may
-	     happen, e.g., for the Linux kernel's gate DSO, for
-	     example.  */
-	  phdr = info->dlpi_phdr;
-	  for (n = info->dlpi_phnum; --n >= 0; phdr++)
-	    {
-	      if (phdr->p_type == PT_LOAD && p_eh_hdr->p_vaddr >= phdr->p_vaddr
-		  && p_eh_hdr->p_vaddr < phdr->p_vaddr + phdr->p_memsz)
-		{
-		  segbase = phdr->p_vaddr + load_base;
-		  break;
-		}
-	    }
-	}
-
       if (p_dynamic)
 	{
 	  /* For dynamicly linked executables and shared libraries,


Improve 'svn commit' errormsg when inconsistent line-endings are found.

* libsvn_subr/subst.c
  (svn_subst_copy_and_translate2):  wrap inconsistent newline error
  with a message that says *which* file has inconsistent newlines.

--- subversion/libsvn_subr/subst.c
+++ subversion/libsvn_subr/subst.c
@@ -43,6 +43,8 @@
 #include "svn_hash.h"
 #include "svn_subst.h"
 #include "svn_pools.h"
+
+#include "svn_private_config.h"

 /**
  * The textual elements of a detranslated special file.  One of these
@@ -933,7 +935,13 @@
   err = svn_subst_translate_stream (src_stream, dst_stream,
                                     eol_str, repair, keywords, expand);
   if (err)
-    goto error;
+    {
+      if (err->apr_err == SVN_ERR_IO_INCONSISTENT_EOL)
+        err = svn_error_createf
+          (SVN_ERR_IO_INCONSISTENT_EOL, err,
+           _("File '%s' has inconsistent newlines"), src);
+      goto error;
+    }

   /* clean up nicely. */
   err = svn_stream_close (src_stream);


runtime: remove unused typedef

runtime: remove unused typedef

R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/10660044

--- src/pkg/runtime/runtime.h
+++ src/pkg/runtime/runtime.h
@@ -53,7 +53,6 @@
 typedef	struct	Lock		Lock;
 typedef	struct	M		M;
 typedef	struct	P		P;
-typedef	struct	Mem		Mem;
 typedef	struct	Note		Note;
 typedef	struct	Slice		Slice;
 typedef	struct	Stktop		Stktop;


res reduced the iImage interface to a container for pixel data,
  merged csImageFile and csImageMemory and moved the image
  manipulation functions into helper classes.

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

--- include/csgfx/rgbpixel.h
+++ include/csgfx/rgbpixel.h
@@ -137,10 +137,10 @@
   bool eq (const csRGBpixel& p) const
   { return operator==(p); }
   /// Get the pixel intensity
-  int Intensity ()
+  int Intensity () const
   { return (red + green + blue) / 3; }
   /// Get the pixel luminance
-  unsigned char Luminance ()
+  unsigned char Luminance () const
   {
     return (unsigned char)(((int)red*30 + (int)green*59 + (int)blue*11) / 100);
   }


Expunge dead code.

Expunge dead code.

--- security/nss/cmd/smimetools/cmsutil.c
+++ security/nss/cmd/smimetools/cmsutil.c
@@ -959,17 +959,6 @@

 typedef enum { UNKNOWN, DECODE, SIGN, ENCRYPT, ENVELOPE, CERTSONLY } Mode;

-#if 0
-void
-parse_message_for_recipients(PRFileDesc *inFile,
-                             struct envelopeOptionsStr *envelopeOptions)
-{
-    SECItem filedata;
-    SECStatus rv;
-    rv = SECU_FileToItem(&filedata, inFile);
-}
-#endif
-
 int
 main(int argc, char **argv)
 {
@@ -1170,13 +1159,6 @@
 	    break;

 	case 'o':
-#if 0
-	    if (mode == DECODE) {
-		outFile = fopen(optstate->value, "w");
-	    } else {
-		outFile = fopen(optstate->value, "wb");
-	    }
-#endif
 	    outFile = fopen(optstate->value, "wb");
 	    if (outFile == NULL) {
 		fprintf(stderr, "%s: unable to open \"%s\" for writing\n",
@@ -1191,9 +1173,6 @@
 		Usage(progName);
 		exit(1);
 	    }
-#if 0
-	    fprintf(stderr, "recipient = %s\n", optstate->value);
-#endif
 	    envelopeOptions.recipients = ptrarray;
 	    str = (char *)optstate->value;
 	    do {
@@ -1260,7 +1239,6 @@
     }

 #if defined(_WIN32)
-    /*if (outFile == stdout && mode != DECODE) {*/
     if (outFile == stdout) {
 	/* If we're going to write binary data to stdout, we must put stdout
 	** into O_BINARY mode or else outgoing \n's will become \r\n's.
@@ -1356,10 +1334,6 @@
 	break;
     case ENVELOPE:
 	envelopeOptions.options = &options;
-#if 0
-	if (!envelopeOptions.recipients)
-	    parse_message_for_recipients(myIn, &envelopeOptions);
-#endif
 	cmsg = enveloped_data(&envelopeOptions);
 	if (!cmsg) {
 	    SECU_PrintError(progName, "problem enveloping");


Updated square

Updated square


handle installed evas and missing kaa.evas

git-svn-id: 0398b83559538705afb96f6498afc8fe25790aba@2042 a8f5125c-1e01-0410-8897-facf34644b8e

--- src/display.c
+++ src/display.c
@@ -107,10 +107,18 @@
 #ifdef USE_EVAS
     // Import kaa-evas's C api
     evas_api_ptrs = get_module_api("kaa.evas._evas");
-    if (evas_api_ptrs == NULL)
-        return;
-    evas_object_from_pyobject = evas_api_ptrs[0];
-    Evas_PyObject_Type = evas_api_ptrs[1];
+    if (evas_api_ptrs == NULL) {
+	// evas installed, but kaa.evas missing
+	// FIXME: now with Evas_PyObject_Type == NULL we could
+	// crash with a segfault when trying to use it. So we should
+	// always import kaa.evas first before using this in C code
+	// to get the exception in that case.
+	PyErr_Clear();
+	Evas_PyObject_Type = NULL;
+    } else {
+	evas_object_from_pyobject = evas_api_ptrs[0];
+	Evas_PyObject_Type = evas_api_ptrs[1];
+    }
 #else
     Evas_PyObject_Type = NULL;
 #endif


examples: mc example missed option parser for node counting

--- examples/mc.c
+++ examples/mc.c
@@ -67,6 +67,9 @@
         break;
     case 2:
         report_table = 1;
+        break;
+    case 5:
+        report_nodes = 1;
         break;
     case 6:
         merge_relations = 1;


[FIX] Gustaf app: fixed compiler warnings from nightly builds.

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

--- extras/apps/gustaf/msplazer_algorithms.h
+++ extras/apps/gustaf/msplazer_algorithms.h
@@ -203,7 +203,6 @@
 {
     typedef typename EdgeDescriptor<TGraph>::Type TEdgeDescriptor;
     typedef Align<TSequence, ArrayGaps> TAlign;
-    typedef typename Row<TAlign>::Type TRow;
     typedef typename Position<TSequence>::Type  TPos;
     typedef Breakpoint<TSequence, TId> TBreakpoint;
     typedef typename Infix<TSequence>::Type TInfix;
@@ -384,7 +383,6 @@
 {
     typedef typename EdgeDescriptor<TGraph>::Type TEdgeDescriptor;
     typedef Align<TSequence, ArrayGaps> TAlign;
-    typedef typename Row<TAlign>::Type TRow;
     typedef typename Position<TSequence>::Type  TPos;
     typedef Breakpoint<TSequence, TId> TBreakpoint;
     typedef StellarMatch<TSequence, TId> TMatch;
@@ -653,8 +651,8 @@
 void _analyzeChains(String<TMSplazerChain> & queryChains)
 {
     InternalMap<int> weightMap;
-    typedef typename TMSplazerChain::TGraph TGraph;
-    typedef typename Size<TGraph>::Type TGraphSize;
+    // typedef typename TMSplazerChain::TGraph TGraph;
+    // typedef typename Size<TGraph>::Type TGraphSize;

     for (unsigned i = 0; i < length(queryChains); ++i)
     {


Add gyro to logo.

Add gyro to logo.

--- alice4/software/logo/logo.c
+++ alice4/software/logo/logo.c
@@ -36,6 +36,8 @@

 // In degrees.
 double twist = 0;
+double horiz = 0;
+double vert = 0;

 float ident_matrix[4][4] = {
 	{1.0, 0.0, 0.0, 0.0},
@@ -210,8 +212,16 @@
 		dx = getvaluator(DIAL2) / 65536.0;
 		dy = getvaluator(DIAL3) / 65536.0;
 		dz = getvaluator(DIAL4) / 65536.0;
+
 		// Assume 50 FPS.
-		twist -= dz/50;
+		horiz -= dx/50;
+		vert -= dy/50;
+		// twist -= dz/50; // Disable, it breaks the "object in a box" model.
+
+		// Slowly go back to normal.
+		horiz *= 0.99;
+		vert *= 0.99;
+		twist *= 0.99;

 		draw_everything();

@@ -280,7 +290,16 @@
 	lmbind(LIGHT0, OVER_LIGHT);
 	lmbind(LIGHT1, UNDER_LIGHT);

-	lookat(-30.0, 30.0, 30.0, 0.0, 0.0, 0.0, (int) (twist*10 + 0.5));
+	// We moved the lookat() call for gyro, but be sure it looks like it did
+	// when no gyro is being done.
+	double orig_offset = 30;
+	double new_offset = 5;
+	double difference = sqrt(orig_offset*orig_offset*3) - sqrt(new_offset*new_offset*3);
+	translate(0, 0, -difference);
+	rotate((int) (horiz*10 + 0.5), 'y');
+	rotate((int) (vert*10 + 0.5), 'x');
+
+	lookat(-new_offset, new_offset, new_offset, 0.0, 0.0, 0.0, (int) (twist*10 + 0.5));

 	multmatrix(view);


A little simplification.

A little simplification.

* subversion/libsvn_subr/subst.c
  (translated_stream_mark): Use apr_pmemdup() instead of alloc and copy.

--- subversion/libsvn_subr/subst.c
+++ subversion/libsvn_subr/subst.c
@@ -1186,12 +1186,10 @@
   SVN_ERR(svn_stream_mark(b->stream, &mt->mark, pool));

   /* Save translation state. */
-  mt->saved_baton.in_baton = apr_palloc(pool,
-                                        sizeof(*mt->saved_baton.in_baton));
-  *mt->saved_baton.in_baton = *b->in_baton;
-  mt->saved_baton.out_baton = apr_palloc(pool,
-                                         sizeof(*mt->saved_baton.out_baton));
-  *mt->saved_baton.out_baton = *b->out_baton;
+  mt->saved_baton.in_baton = apr_pmemdup(pool, b->in_baton,
+                                         sizeof(*mt->saved_baton.in_baton));
+  mt->saved_baton.out_baton = apr_pmemdup(pool, b->out_baton,
+                                          sizeof(*mt->saved_baton.out_baton));
   mt->saved_baton.written = b->written;
   mt->saved_baton.readbuf = svn_stringbuf_dup(b->readbuf, pool);
   mt->saved_baton.readbuf_off = b->readbuf_off;


Eric Sunshine made it illegal to copy csMemoryPool (either via constructor
or assignment) since such an operation makes no sense in this context.

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

--- include/csutil/mempool.h
+++ include/csutil/mempool.h
@@ -61,6 +61,9 @@
   size_t remaining;
   /// Number of bytes to allocate for each block.
   size_t granularity;
+
+  csMemoryPool(csMemoryPool const&);   // Illegal; unimplemented.
+  void operator=(csMemoryPool const&); // Illegal; unimplemented.

 public:
   /**


Update VI origin every frame according to current field

This improves the look of hi-res/interlaced video modes.

--- src/display.c
+++ src/display.c
@@ -240,15 +240,21 @@
  */
 static void __display_callback()
 {
+    uint32_t *reg_base = (uint32_t *)REGISTER_BASE;
+
+    /* Least significant bit of the current line register indicates
+       if the currently displayed field is odd or even. */
+    bool field = reg_base[4] & 1;
+
     /* Only swap frames if we have a new frame to swap, otherwise just
        leave up the current frame */
     if(show_next >= 0 && show_next != now_drawing)
     {
-        __write_dram_register( __safe_buffer[show_next] );
-
         now_showing = show_next;
         show_next = -1;
     }
+
+    __write_dram_register(__safe_buffer[now_showing] + (!field ? __width * __bitdepth : 0));
 }

 /**


stub for file imager

stub for file imager

error: pathspec 'forge/filesys/imager.c' did not match any file(s) known to git

--- forge/filesys/imager.c
+++ forge/filesys/imager.c
@@ -0,0 +1,76 @@
+/* minimOS disk imager v0.1       *
+ * (c) 2021 Carlos J. Santisteban *
+ * last modified 20210120-0029    *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* function prototypes */
+int		menu(void);
+void	create(void);
+void	open(void);
+void	dir(void);
+void	close(void);
+void	insert(void);
+void	delete(void);
+void	extract(void);
+
+/* main loop */
+int main(void) {
+	FILE*	im, ext;
+	char	nom[80];
+	int		opc;
+
+	printf("minimOS disk image manager v0.1\n");
+	printf("===============================\n\n");
+	do {
+		opc=menu();
+	} while (opc != 0);
+
+	return 0;
+}
+
+/* function definitions */
+int menu(void) {
+	int x=-1;
+
+	printf("1.Create image\n");
+	printf("2.Open image\n");
+	printf("3.Show image contents\n");
+	printf("4.Close image\n");
+	printf("5.Insert file\n");
+	printf("6.Delete file\n");
+	printf("7.Extract file\n");
+	printf("\n0.EXIT\n\n");
+	while ((x<0)||(x>7)) {
+		printf(">");
+		scanf("%d",&x);
+	}
+
+	return x;
+}
+
+void	create(void){
+
+}
+
+void	open(void) {
+
+}
+
+void	close(void) {
+
+}
+
+void	insert(void) {
+
+}
+
+void	delete(void) {
+
+}
+
+void	extract(void) {
+
+}


Only use a mutex to protect the MethodHandle pool if native threading is enabled

--- ext/Invoker.c
+++ ext/Invoker.c
@@ -57,7 +57,9 @@
     MethodHandle* next;
 };
 struct MethodHandlePool {
+#ifdef HAVE_NATIVETHREAD
     pthread_mutex_t mutex;
+#endif
     MethodHandle* list;
 };

@@ -229,7 +231,13 @@

 static MethodHandlePool methodHandlePool[4];

-
+#ifdef HAVE_NATIVETHREAD
+#  define pool_lock(p) pthread_mutex_lock(&(p)->mutex)
+#  define pool_unlock(p)  pthread_mutex_unlock(&(p)->mutex)
+#else
+#  define pool_lock(p)
+#  define pool_unlock(p)
+#endif
 static MethodHandle*
 method_handle_alloc(int arity)
 {
@@ -249,11 +257,11 @@

     pool = &methodHandlePool[arity < 3 ? arity : 3];
-    pthread_mutex_lock(&pool->mutex);
+    pool_lock(pool);
     if (pool->list != NULL) {
         method = pool->list;
         pool->list = pool->list->next;
-        pthread_mutex_unlock(&pool->mutex);
+        pool_unlock(pool);
         return method;
     }
     ffiReturnType = (sizeof (VALUE) == sizeof (long))
@@ -262,7 +270,7 @@
     nclosures = PageSize / closureSize;
     page = mmap(NULL, PageSize, PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
     if (page == (caddr_t) -1) {
-        pthread_mutex_unlock(&pool->mutex);
+        pool_unlock(pool);
         return NULL;
     }

@@ -302,17 +310,17 @@
     mprotect(page, PageSize, PROT_READ | PROT_EXEC);
     method = pool->list;
     pool->list = pool->list->next;
-    pthread_mutex_unlock(&pool->mutex);
+    pool_unlock(pool);
     return method;
 }
 static void
 method_handle_free(MethodHandle* method)
 {
     MethodHandlePool* pool = method->pool;
-    pthread_mutex_lock(&pool->mutex);
+    pool_lock(pool);
     method->next = pool->list;
     pool->list = method;
-    pthread_mutex_unlock(&pool->mutex);
+    pool_unlock(pool);
 }

 typedef union {
@@ -845,7 +853,9 @@

     }
     methodHandleVarargParamTypes[2] = ffiValueType;
+#ifdef HAVE_NATIVETHREAD
     for (i = 0; i < 4; ++i) {
         pthread_mutex_init(&methodHandlePool[i].mutex, NULL);
     }
-}
+#endif
+}


* subversion/libsvn_wc/adm_ops.c
  (revert_restore): Only set read-only/executable when different from
   property.

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

--- subversion/libsvn_wc/adm_ops.c
+++ subversion/libsvn_wc/adm_ops.c
@@ -1448,18 +1448,23 @@
           else
             {
               apr_hash_t *props;
+              svn_boolean_t read_only_prop;
+#if !defined(WIN32) && !defined(__OS2__)
+              svn_boolean_t executable_prop;
+#endif

               SVN_ERR(svn_wc__db_read_pristine_props(&props, db, local_abspath,
                                                      scratch_pool,
                                                      scratch_pool));
-              if (apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING)
-                  && !read_only)
+              read_only_prop = apr_hash_get(props, SVN_PROP_NEEDS_LOCK,
+                                            APR_HASH_KEY_STRING);
+              if (read_only_prop && !read_only)
                 {
                   SVN_ERR(svn_io_set_file_read_only(local_abspath,
                                                     FALSE, scratch_pool));
                   notify_required = TRUE;
                 }
-              else if (read_only)
+              else if (!read_only_prop && read_only)
                 {
                   SVN_ERR(svn_io_set_file_read_write(local_abspath,
                                                      FALSE, scratch_pool));
@@ -1467,14 +1472,15 @@
                 }

 #if !defined(WIN32) && !defined(__OS2__)
-              if (apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING)
-                  && !executable)
+              executable_prop = apr_hash_get(props, SVN_PROP_EXECUTABLE,
+                                             APR_HASH_KEY_STRING);
+              if (executable_prop && !executable)
                 {
                   SVN_ERR(svn_io_set_file_executable(local_abspath, TRUE,
                                                      FALSE, scratch_pool));
                   notify_required = TRUE;
                 }
-              else if (executable)
+              else if (!executable_prop && executable)
                 {
                   SVN_ERR(svn_io_set_file_executable(local_abspath, FALSE,
                                                      FALSE, scratch_pool));


fix comment

fix comment

R=rsc
CC=golang-dev
http://codereview.appspot.com/203053

--- src/pkg/runtime/runtime.h
+++ src/pkg/runtime/runtime.h
@@ -74,7 +74,7 @@
  *
  * amd64: allocated downwards from R15
  * x86: allocated upwards from 0(FS)
- * arm: allocated upwards from R9
+ * arm: allocated downwards from R10
  *
  * every C file linked into a Go program must include runtime.h
  * so that the C compiler knows to avoid other uses of these registers.


Fixed null ptr handling in _dmt_realloc/_dmt_free

--- src/dmt/dmt.c
+++ src/dmt/dmt.c
@@ -55,6 +55,8 @@
 void *_dmt_realloc(void *ptr, size_t sz, const char *file, unsigned line) {
   dmt_node_t *node = (dmt_node_t*)((char*)ptr - sizeof(*node));

+  if (ptr == NULL) return _dmt_alloc(sz, file, line, 0);
+
   if (!_dmt_has_node(node)) {
     printf("Bad realloc: %p %s, line %u\n", ptr, file, line);
     abort();
@@ -72,6 +74,8 @@

 void _dmt_free(void *ptr, const char *file, unsigned line) {
   dmt_node_t *node = (dmt_node_t*)((char*)ptr - sizeof(*node));
+
+  if (ptr == NULL) return;

   if (!_dmt_has_node(node)) {
     printf("Bad free: %p %s, line %u\n", ptr, file, line);


fixed fontview, finally

fixed fontview, finally


Fix Windows build break.

Fix Windows build break.

* subversion/libsvn_wc/adm_ops.c:
  (svn_wc_queue_committed2): add function skeleton, to be filled in soon.

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

--- subversion/libsvn_wc/adm_ops.c
+++ subversion/libsvn_wc/adm_ops.c
@@ -615,6 +615,21 @@
   q->have_recursive = FALSE;

   return q;
+}
+
+svn_error_t *
+svn_wc_queue_committed2(svn_wc_committed_queue_t *queue,
+                        const char *path,
+                        svn_wc_adm_access_t *adm_access,
+                        svn_boolean_t recurse,
+                        apr_array_header_t *wcprop_changes,
+                        svn_boolean_t remove_lock,
+                        svn_boolean_t remove_changelist,
+                        svn_checksum_t *checksum,
+                        apr_pool_t *pool)
+{
+  /* ### fill this in... */
+  SVN_ERR_MALFUNCTION();
 }

 svn_error_t *


runtime: remove unused typedef

runtime: remove unused typedef

R=golang-dev, dave, r
CC=golang-dev
https://codereview.appspot.com/10660044


Avoid compiler warning: operation on ‘gms.ptr’ may be undefined [-Wsequence-point]

--- ext/glu/glu.c
+++ ext/glu/glu.c
@@ -304,6 +304,7 @@
   GLint uorder;
   GLfloat *ctlarray;
   GLenum type;
+  GLfloat **gms_ptr;

   VALUE args[7];
   VALUE ary_ctl1;
@@ -341,7 +342,8 @@
   gluNurbsCurve(ndata->nobj, uknot_count, uknot, u_stride, ctlarray, uorder, type);

   /* store the pointers */
-  gms.ptr = REALLOC_N(gms.ptr, GLfloat*, gms.len+=2);
+  gms_ptr = gms.ptr;
+  gms.ptr = REALLOC_N(gms_ptr, GLfloat*, gms.len+=2);
   gms.ptr[gms.len - 2] = uknot;
   gms.ptr[gms.len - 1] = ctlarray;

@@ -394,6 +396,7 @@
   GLint sorder;
   GLint torder;
   GLenum type;
+  GLfloat **gms_ptr;

   VALUE args[11];
   VALUE ary_ctl1;
@@ -450,7 +453,8 @@

   /* store the pointers */

-  gms.ptr = REALLOC_N(gms.ptr, GLfloat*, gms.len+=3);
+  gms_ptr = gms.ptr;
+  gms.ptr = REALLOC_N(gms_ptr, GLfloat*, gms.len+=3);
   gms.ptr[gms.len-3] = sknot;
   gms.ptr[gms.len-2] = tknot;
   gms.ptr[gms.len-1] = ctlarray;


Remove GDK_BITMAP macro

Remove GDK_BITMAP macro

--- gdk3/ext/gdk3/rbgdk3.h
+++ gdk3/ext/gdk3/rbgdk3.h
@@ -41,8 +41,6 @@

 #define RVAL2GDKPIXBUFGLIST(value) rbgdk_rval2gdkpixbufglist(value)

-#define GDK_BITMAP(b) ((GdkBitmap*)GDK_PIXMAP(b))
-
 #define GEV2RVAL(ev) (make_gdkevent(ev))
 #define RVAL2GEV(ev) (get_gdkevent(ev))
 #define RVAL2ATOM(atom) (get_gdkatom(atom))


Duration - moved scale caluclation based on std::chrono::duration_cast to a seperated function

fixes #4

--- include/duration_units.h
+++ include/duration_units.h
@@ -38,6 +38,11 @@
 	constexpr _selfType& operator=(const _selfType& other) = default;
 };

+template<class ChronoClassFrom, class ChronoClassTo>
+constexpr auto chronoConversionScale()
+{
+	return std::chrono::duration_cast<ChronoClassTo>(ChronoClassFrom{1}).count();
+}

 struct seconds_tag
 {
@@ -51,8 +56,7 @@
 	using seconds = std::chrono::seconds;
 	using minutes = std::chrono::minutes;
 	static constexpr double scale =
-			seconds_tag::scale
-			* std::chrono::duration_cast<seconds>(minutes{1}).count();
+			seconds_tag::scale * chronoConversionScale<minutes, seconds>();
 	static std::string singularName();
 	static std::string pluralName();
 };
@@ -62,8 +66,7 @@
 	using minutes = std::chrono::minutes;
 	using hours = std::chrono::hours;
 	static constexpr double scale =
-			minutes_tag::scale
-			* std::chrono::duration_cast<minutes>(hours{1}).count();
+			minutes_tag::scale * chronoConversionScale<hours, minutes>();
 	static std::string singularName();
 	static std::string pluralName();
 };