The base character of a character belonging to a mode can never cancel the mode

--- liblouis/lou_translateString.c
+++ liblouis/lou_translateString.c
@@ -2504,6 +2504,23 @@
 		widechar c, const TranslationTableHeader *table, const EmphasisClass *emphClass) {
 	/* Whether a character cancels word emphasis mode or not. */
 	if (emphClass->mode) {
+		const TranslationTableCharacter *chardef = getChar(c, table);
+		/* the base character of a character belonging to a mode can never cancel the mode
+		 */
+		if (chardef->attributes & emphClass->mode)
+			return 0;
+		else {
+			const TranslationTableCharacter *ch = chardef;
+			if (ch->basechar)
+				ch = (TranslationTableCharacter *)&table->ruleArea[ch->basechar];
+			while (ch->linked) {
+				ch = (TranslationTableCharacter *)&table->ruleArea[ch->linked];
+				if ((ch->mode & chardef->mode) == chardef->mode &&
+						ch->attributes & emphClass->mode) {
+					return 0;
+				}
+			}
+		}
 		if (emphClass->mode == CTC_UpperCase) {
 			/* characters that are not letter and not capsmodechars cancel capsword mode
 			 */


same final call of two if branches moved outside

--- src/dscache.c
+++ src/dscache.c
@@ -383,11 +383,10 @@
             }
             cacheScheduleIODelFlag(j->db,j->key,REDIS_IO_LOADINPROG);
             handleClientsBlockedOnSwappedKey(j->db,j->key);
-            freeIOJob(j);
         } else if (j->type == REDIS_IOJOB_SAVE) {
             cacheScheduleIODelFlag(j->db,j->key,REDIS_IO_SAVEINPROG);
-            freeIOJob(j);
-        }
+        }
+        freeIOJob(j);
         processed++;
         if (privdata == NULL) cacheScheduleIOPushJobs(0);
         if (processed == toprocess) return;


Make puts add a trailing newline

Make puts add a trailing newline

--- software/libc/src/stdio.c
+++ software/libc/src/stdio.c
@@ -332,6 +332,8 @@
 {
 	for (const char *c = s; *c; c++)
 		putchar(*c);
+
+	putchar('\n');
 }

 volatile unsigned int * const REGISTERS = (volatile unsigned int*) 0xffff0000;


Set cache-dir depending on OS.

Set cache-dir depending on OS.

--- src/spotify.c
+++ src/spotify.c
@@ -41,6 +41,12 @@

 #define START_STOP_PROCEDURE_TIMEOUT_US 5000000

+#ifndef _WIN32
+#define VLC_SPOTIFY_CACHE_DIR "/tmp/spot"
+#else
+#define VLC_SPOTIFY_CACHE_DIR "C:\\temp\\spot"
+#endif
+
 typedef enum {
     CLEANUP_NOT_STARTED,
     CLEANUP_PENDING,
@@ -125,7 +131,7 @@

 static sp_session_config spconfig = {
     .api_version = SPOTIFY_API_VERSION,
-    .cache_location = "/tmp/spot", // TODO: path to vlc data?
+    .cache_location = VLC_SPOTIFY_CACHE_DIR, // TODO: path to vlc data?
     //.settings_location = "/tmp/spot", // Crashes at logout when enabled (!)
     .application_key = g_appkey,
     .application_key_size = 0,


bugfix: correct detection of the maximum

--- NaoTHSoccer/Source/Tools/ImageProcessing/MaximumScan.h
+++ NaoTHSoccer/Source/Tools/ImageProcessing/MaximumScan.h
@@ -40,7 +40,7 @@
     {
       value_max = value;
       peakMax = point;
-    } else if(value_max > threshhold && value < threshhold) {
+    } else if(value_max > threshhold && value < value_max) {
       maximum = true;
     }


Fixing documentation for lowerBoundAlignedReads and upperBoundAlignedReads.

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

--- seqan/projects/library/seqan/store/store_align.h
+++ seqan/projects/library/seqan/store/store_align.h
@@ -376,8 +376,9 @@
 .Function.lowerBoundAlignedReads
 ..summary:Performs a binary lower bound search on the aligned reads.
 ..cat:Fragment Store
-..signature:sortAlignedReads(alignStore, sortTag)
+..signature:lowerBoundAlignedReads(alignStore, value, sortTag)
 ..param.alignStore:A sequence of @Class.AlignedReadStoreElement@ to be sorted, e.g. @Memvar.FragmentStore#alignedReadStore@.
+..param.value:The value to use for the comparison.
 ..param.sortTag:Selects the field for the comparison in the binary search.
 ...type:Tag.sortAlignedRead Tags
 ..remarks:This is equivalent to calling $std::lower_bound$ on $alignStore$ with according parameters.
@@ -388,8 +389,9 @@
 .Function.upperBoundAlignedReads
 ..summary:Performs a binary upper bound search on the aligned reads.
 ..cat:Fragment Store
-..signature:sortAlignedReads(alignStore, sortTag)
+..signature:upperBoundAlignedReads(alignStore, value, sortTag)
 ..param.alignStore:A sequence of @Class.AlignedReadStoreElement@ to be sorted, e.g. @Memvar.FragmentStore#alignedReadStore@.
+..param.value:The value to use for the comparison.
 ..param.sortTag:Selects the field for the comparison in the binary search.
 ...type:Tag.sortAlignedRead Tags
 ..remarks:This is equivalent to calling $std::lower_bound$ on $alignStore$ with according parameters.


remove CVS conflict that has been committed

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@8370 67ed7778-7388-44ab-90cf-0a291f65f57c

--- camlibs/digigr8/library.c
+++ camlibs/digigr8/library.c
@@ -56,19 +56,10 @@
    	unsigned short idVendor;
    	unsigned short idProduct;
 } models[] = {
-<<<<<<< library.c
         {"Digigr8",     	GP_DRIVER_STATUS_EXPERIMENTAL, 0x2770, 0x905c},
         {"Che-Ez Snap SNAP-U",  GP_DRIVER_STATUS_EXPERIMENTAL, 0x2770, 0x905c},
         {"DC-N130t",            GP_DRIVER_STATUS_EXPERIMENTAL, 0x2770, 0x905C},
         {"Soundstar TDC-35",    GP_DRIVER_STATUS_EXPERIMENTAL, 0x2770, 0x905c},
-=======
-        	{"Digigr8",     GP_DRIVER_STATUS_EXPERIMENTAL, 0x2770, 0x905c},
-        	{"Che-Ez Snap SNAP-U",     GP_DRIVER_STATUS_EXPERIMENTAL,
-								0x2770, 0x905c},
-        	{"Soundstar TDC-35",     GP_DRIVER_STATUS_EXPERIMENTAL,
-								0x2770, 0x905c},
-
->>>>>>> 1.2
 	{NULL,0,0,0}
 };


[introspection] Add missing annotations to GDataDocumentsSpreadsheet

--- gdata/services/documents/gdata-documents-spreadsheet.c
+++ gdata/services/documents/gdata-documents-spreadsheet.c
@@ -87,7 +87,7 @@

 /**
  * gdata_documents_spreadsheet_new:
- * @id: the entry's ID (not the document ID of the spreadsheet), or %NULL
+ * @id: (allow-none): the entry's ID (not the document ID of the spreadsheet), or %NULL
  *
  * Creates a new #GDataDocumentsSpreadsheet with the given entry ID (#GDataEntry:id).
  *
@@ -111,9 +111,9 @@
  * gdata_documents_spreadsheet_download_document:
  * @self: a #GDataDocumentsSpreadsheet
  * @service: a #GDataDocumentsService
- * @content_type: return location for the document's content type, or %NULL; free with g_free()
+ * @content_type: (out callee-allocates) (transfer full) (allow-none): return location for the document's content type, or %NULL; free with g_free()
  * @export_format: the format in which the spreadsheet should be exported
- * @gid: the 0-based sheet ID to download, or -1
+ * @gid: (default -1): the 0-based sheet ID to download, or -1
  * @destination_file: the #GFile into which the spreadsheet file should be saved
  * @replace_file_if_exists: %TRUE if the file should be replaced if it already exists, %FALSE otherwise
  * @cancellable: optional #GCancellable object, or %NULL
@@ -177,7 +177,7 @@
  * gdata_documents_spreadsheet_get_download_uri:
  * @self: a #GDataDocumentsSpreadsheet
  * @export_format: the format in which the spreadsheet should be exported when downloaded
- * @gid: the 0-based sheet ID to download, or -1
+ * @gid: (default -1): the 0-based sheet ID to download, or -1
  *
  * Builds and returns the download URI for the given #GDataDocumentsSpreadsheet in the desired format. Note that directly downloading
  * the document using this URI isn't possible, as authentication is required. You should instead use gdata_download_stream_new() with


Print key value, an index, otherwise we don't know which key is allocated.

--- gnu/usr.bin/gdb/libgdb/fbsd-threads.c
+++ gnu/usr.bin/gdb/libgdb/fbsd-threads.c
@@ -1311,7 +1311,7 @@
   else
     name = DEPRECATED_SYMBOL_NAME (ms);

-  printf_filtered ("Destructor %p <%s>\n", destructor, name);
+  printf_filtered ("Key %d, destructor %p <%s>\n", key, destructor, name);
   return 0;
 }


These loop counter variables should never reach srcmax.

--- liblouis/lou_translateString.c
+++ liblouis/lou_translateString.c
@@ -2030,7 +2030,7 @@
 			{
 				/*   check if emphasis ended inside a word   */
 				word_stop = bit_end | bit_word;
-				if(i < srcmax && wordBuffer[i] & WORD_CHAR)
+				if(wordBuffer[i] & WORD_CHAR)
 					word_whole = 0;
 				else
 					word_stop = 0;
@@ -2062,7 +2062,7 @@

 		/*   check if at end of word   */
 		if(in_word)
-		if(i == srcmax || !(wordBuffer[i] & WORD_CHAR))
+		if(!(wordBuffer[i] & WORD_CHAR))
 		{
 			/*   made it through whole word   */
 			if(in_emp && word_start >= 0)
@@ -2212,7 +2212,7 @@

 		/*   check if at end of word   */
 		if(in_word)
-		if(i == srcmax || !(wordBuffer[i] & WORD_CHAR))
+		if(!(wordBuffer[i] & WORD_CHAR))
 		{
 			in_word = 0;
 			if(in_pass)
@@ -2338,7 +2338,7 @@
 			if(in_word)

 			/*   at end of word   */
-			if(i == srcmax || !(wordBuffer[i] & WORD_CHAR)
+			if(!(wordBuffer[i] & WORD_CHAR)
 			   || (buffer[i] & bit_word && buffer[i] & bit_end))
 			{
 				in_word = 0;


simplification

simplification

--- Eigen/src/Cholesky/LLT.h
+++ Eigen/src/Cholesky/LLT.h
@@ -200,7 +200,7 @@
       Block<MatrixType,Dynamic,Dynamic> A20(mat,k+1,0,rs,k);

       RealScalar x = real(mat.coeff(k,k));
-      if (k>0) x -= mat.row(k).head(k).squaredNorm();
+      if (k>0) x -= A10.squaredNorm();
       if (x<=RealScalar(0))
         return false;
       mat.coeffRef(k,k) = x = sqrt(x);


Close the PID on class finalize as well, to not leave an open fd hanging around.

--- src/dvb-sub.c
+++ src/dvb-sub.c
@@ -290,7 +290,8 @@
 	DvbSubPrivate *priv = (DvbSubPrivate *)self->private_data;
 	/* TODO: Add deinitalization code here */
 	/* FIXME: Clear up region_list contents */
-	delete_state (self);
+	dvb_sub_close_pid (self);
+	delete_state (self); /* close_pid should have called this, but lets be sure */

 	G_OBJECT_CLASS (dvb_sub_parent_class)->finalize (object);
 }


file-xfer: Fix bad filename encoding

file-xfer: Fix bad filename encoding

Manual for G_FILE_ATTRIBUTE_STANDARD_NAME states:
 > The name is the on-disk filename which may not be in any known
 > encoding, and can thus not be generally displayed as is.

Considering a file named "ěščřžýáíé", if we use
G_FILE_ATTRIBUTE_STANDARD_NAME to get the file name, we will have the
following 72 bytes long string:
"\xc4\x9b\xc5\xa1\xc4\x8d\xc5\x99\xc5\xbe\xc3\xbd\xc3\xa1\xc3\xad\xc3\xa9"

This is a regression introduced at 4647ac9a2a72c98b6841180ccf5f8d

Possible solutions are:
1) Using G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME attribute;
2) Using g_file_info_get_attribute_byte_string() function;
3) Using the g_file_get_basename() which was used before 4647ac9a2a72c9

Using option 2 based on better long term solution.
This give us the correct 18 bytes long utf-8 string to "ěščřžýáíé"

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1440206
Signed-off-by: Victor Toso <39b7599ff73bbf5db531748ba5250f21fa7120ff@redhat.com>
Acked-by: Christophe Fergeau <05b95054a663c388a4e33d95828cb30f0370f8ef@redhat.com>

--- src/channel-main.c
+++ src/channel-main.c
@@ -2831,7 +2831,8 @@
     GFileInfo *info;
     SpiceFileTransferTask *xfer_task;
     SpiceMainChannel *channel;
-    gchar *string, *basename;
+    gchar *string;
+    const gchar *basename;
     GKeyFile *keyfile;
     VDAgentFileXferStartMessage msg;
     guint64 file_size;
@@ -2846,7 +2847,7 @@
         goto failed;

     channel = spice_file_transfer_task_get_channel(xfer_task);
-    basename = g_file_info_get_attribute_as_string(info, G_FILE_ATTRIBUTE_STANDARD_NAME);
+    basename = g_file_info_get_attribute_byte_string(info, G_FILE_ATTRIBUTE_STANDARD_NAME);
     file_size = g_file_info_get_attribute_uint64(info, G_FILE_ATTRIBUTE_STANDARD_SIZE);

     xfer_op = data;
@@ -2855,7 +2856,6 @@
     keyfile = g_key_file_new();
     g_key_file_set_string(keyfile, "vdagent-file-xfer", "name", basename);
     g_key_file_set_uint64(keyfile, "vdagent-file-xfer", "size", file_size);
-    g_free(basename);

     /* Save keyfile content to memory. TODO: more file attributions
        need to be sent to guest */


error handling

error handling

--- src/sstring.c
+++ src/sstring.c
@@ -256,7 +256,10 @@
 	RETURN_IF(!s, 0);
 	RETURN_IF(!(*s), ss_reserve(s, extra_size));
 	size_t size = ss_size(*s);
-	ASSERT_RETURN_IF(s_size_t_overflow(size, extra_size), 0);
+	if (s_size_t_overflow(size, extra_size)) {
+		ss_set_alloc_errors(*s);
+		return 0;
+	}
 	/*
 	* If passing from small struct to full struct,
 	* we'll have to update the unicode cached size.


Daily dev - verification.

Daily dev - verification.

--- p7r/p7r_stack_allocator.c
+++ p7r/p7r_stack_allocator.c
@@ -220,6 +220,7 @@
     adjust_capacity(config.n_pages_long_term);
     adjust_capacity(config.n_pages_slave);
     return config;
+#undef adjust_capacity
 }

 struct p7r_stack_allocator *p7r_stack_allocator_init(struct p7r_stack_allocator *allocator, struct p7r_stack_allocator_config config) {


There is another call to get the number of pictures , 0x8d.
Also, both number of picture calls get actually 2 bytes. (My camera can
store like 320 QCIF pictures, so this actually a problem.)
Adapted file_count accordingly.

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@3161 67ed7778-7388-44ab-90cf-0a291f65f57c

--- camlibs/stv0680/library.c
+++ camlibs/stv0680/library.c
@@ -40,6 +40,9 @@
 #define CMD_GET_PREVIEW		0x84
 #define CMD_GET_PREVIEW_RLEN	0x10

+#define CMD_GET_PICS            0x8d
+#define CMD_GET_PICS_RLEN       0x08
+
 #define CMD_GET_IMAGE_INFO	0x8f
 #define CMD_GET_IMAGE_INFO_RLEN	0x10
 #define CMD_CAPTURE_IMAGE	0x09
@@ -188,23 +191,29 @@
 	unsigned char response[CMD_GET_FILE_INFO_RLEN];
 	int ret;

-printf("STV: getting file count\n");
-
-	switch (device->type) {
-
-		case GP_PORT_USB:
-			if ((ret = gp_port_usb_msg_read(device, CMD_GET_FILE_INFO, 0x00, 0x00,
-				response, sizeof(response)) < 0))
-
-				ret = stv0680_remap_gp_port_error(ret);
-
-			break;
-
-		default:
-		case GP_PORT_SERIAL:
-			ret = stv0680_try_cmd(device, CMD_GET_FILE_INFO, 0x00, 0x00, 0x00,
-				response, sizeof(response), CMD_RETRIES);
-			break;
+	switch (device->type) {
+	case GP_PORT_USB: {
+		unsigned char getpics[CMD_GET_PICS_RLEN];
+
+		if ((ret = gp_port_usb_msg_read(device,CMD_GET_PICS,0x00,0x00,
+			getpics, sizeof(getpics)) >= 0)) {
+			*count = (getpics[2]<<8)|getpics[3];
+			return GP_OK;
+		}
+		/* Try old method */
+		if ((ret = gp_port_usb_msg_read(device,CMD_GET_FILE_INFO,0x00,0x00,
+			response,sizeof(response))) >= 0) {
+		    *count = response[1]+(response[0]<<8);
+		    return GP_OK;
+		} else
+		    ret = stv0680_remap_gp_port_error(ret);
+		break;
+	}
+	default:
+	case GP_PORT_SERIAL:
+		ret = stv0680_try_cmd(device, CMD_GET_FILE_INFO, 0x00, 0x00, 0x00,
+			response, sizeof(response), CMD_RETRIES);
+		break;
 	}

 	switch(ret) {
@@ -213,7 +222,7 @@
 		return GP_ERROR_IO;
 	case CMD_OK:
 		printf("GFI OK, count = %d\n", response[1]);
-		*count = response[1];
+		*count = (response[0]<<8)|response[1];
 		return GP_OK;
 	default:
 		//Should not be reached.
@@ -271,7 +280,6 @@
 	strcpy(*data, header);

 	gp_bayer_decode (raw, w, h, *data + strlen(header), BAYER_TILE_GBRG_INTERLACED);
-
 	free(raw);

 	*size *= 3;
@@ -414,8 +422,3 @@

 	return GP_OK;
 }
-
-
-
-
-


change log message english - use gooder english

--- src/dyndnsd.c
+++ src/dyndnsd.c
@@ -165,17 +165,17 @@

 			/* SIGTERM event */
 			if (events[i].ident == SIGTERM) {
-				syslog(LOG_NOTICE, "SIGTERM received");
+				syslog(LOG_NOTICE, "SIGTERM received. Terminating...");
 				goto end;
 			}

 			/* SIGHUP event */
 			else if (events[i].ident == SIGHUP) {
-				syslog(LOG_NOTICE, "SIGHUP received; reloading configuration file.");
+				syslog(LOG_NOTICE, "SIGHUP received. Reloading the configuration file...");
 				if (ast_reload(&ast, conf))
-					syslog(LOG_NOTICE, "successfully reloaded configuration file.");
+					syslog(LOG_NOTICE, "successfully reloaded the configuration file!");
 				else
-					syslog(LOG_ERR, "cannot reload configuration file.");
+					syslog(LOG_ERR, "cannot reload the configuration file.");
 			}

 			/* RTM_NEWADDR event */
@@ -221,7 +221,6 @@
 	}

 end:
-	syslog(LOG_NOTICE, "terminating...");
 	curl_easy_cleanup(curl);
 	close(routefd);
 	closelog();


[APPROVAL] pending/master/bslscm_versiontag-MACROS-typo-drqs-57458684 to master

--- groups/bsl/bslscm/bslscm_versiontag.h
+++ groups/bsl/bslscm/bslscm_versiontag.h
@@ -15,8 +15,8 @@
 //@MACROS:
 //  BSL_VERSION_MAJOR: current release major version number
 //  BSL_VERSION_MINOR: current release minor version number
-//  BLS_MAKE_VERSION(MA, MI): create combined, 6-digit version number (MAMI00)
-//  BLS_VERSION: combined, 6-digit version number for current release
+//  BSL_MAKE_VERSION(MA, MI): create combined, 6-digit version number (MAMI00)
+//  BSL_VERSION: combined, 6-digit version number for current release
 //
 //@SEE_ALSO: bslscm_version
 //
@@ -54,7 +54,7 @@

 #define BSL_MAKE_VERSION(major, minor) ((major) * 10000 \
                                       + (minor) *   100)
-    // Construct a composite version number in the range [ 0 .. 999900 ] from
+    // Construct a composite version number in the range '[0 .. 999900]' from
     // the specified 'major' and 'minor' version numbers.  The resulting value,
     // when expressed as a 6-digit decimal string, has "00" as the two
     // lowest-order decimal digits, 'minor' as the next two digits, and 'major'
@@ -66,11 +66,11 @@
     // integral constants, then the resulting expression is also a compile-time
     // integral constant.  Also note that the patch version number is
     // intentionally not included.  The behavior is undefined unless 'major'
-    // and 'minor' are integral values in the range [ 0 .. 99 ].
+    // and 'minor' are integral values in the range '[0 .. 99]'.

 #define BSL_VERSION BSL_MAKE_VERSION(BSL_VERSION_MAJOR, \
                                      BSL_VERSION_MINOR)
-    // Construct a composite version number in the range [ 0 .. 999900 ] from
+    // Construct a composite version number in the range '[0 .. 999900]' from
     // the specified 'BSL_VERSION_MAJOR' and 'BSL_VERSION_MINOR' numbers
     // corresponding to the major and minor version numbers, respectively, of
     // the current (latest) BSL release.  Note that the patch version number is


	* The Logitech ClickSmart is not a stv680 based camera.

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@4490 67ed7778-7388-44ab-90cf-0a291f65f57c

--- camlibs/stv0680/stv0680.c
+++ camlibs/stv0680/stv0680.c
@@ -62,8 +62,6 @@
 	 * It has been rebranded and rereleased dozens of times.
 	 */

-	/* http://www.logitech.com/cf/products/productoverview.cfm/3041 */
-	{ "Logitech Clicksmart 310",    0x0553, 0x0202, 0 },
 	/* http://www.iomagic.com/support/digitalcameras/magicimage400/magicimage400manual.htm */
 	{ "IOMagic MagicImage 400",     0x0553, 0x0202, 0 },
 	/* http://www.pctekonline.com/phoebsmardig.html */


Finished conversion to FD macro

Finished conversion to FD macro

--- src/emu6502.c
+++ src/emu6502.c
@@ -4,130 +4,37 @@
 /* Forward Declaration macro */
 #define FD(x) static void op##x(emu6502 *emu)
 FD(00); FD(01); FD(02); FD(03); FD(04); FD(05); FD(06); FD(07);
-static void op08(emu6502 *emu); static void op09(emu6502 *emu);
-static void op0A(emu6502 *emu); static void op0B(emu6502 *emu);
-static void op0C(emu6502 *emu); static void op0D(emu6502 *emu);
-static void op0E(emu6502 *emu); static void op0F(emu6502 *emu);
-static void op10(emu6502 *emu); static void op11(emu6502 *emu);
-static void op12(emu6502 *emu); static void op13(emu6502 *emu);
-static void op14(emu6502 *emu); static void op15(emu6502 *emu);
-static void op16(emu6502 *emu); static void op17(emu6502 *emu);
-static void op18(emu6502 *emu); static void op19(emu6502 *emu);
-static void op1A(emu6502 *emu); static void op1B(emu6502 *emu);
-static void op1C(emu6502 *emu); static void op1D(emu6502 *emu);
-static void op1E(emu6502 *emu); static void op1F(emu6502 *emu);
-static void op20(emu6502 *emu); static void op21(emu6502 *emu);
-static void op22(emu6502 *emu); static void op23(emu6502 *emu);
-static void op24(emu6502 *emu); static void op25(emu6502 *emu);
-static void op26(emu6502 *emu); static void op27(emu6502 *emu);
-static void op28(emu6502 *emu); static void op29(emu6502 *emu);
-static void op2A(emu6502 *emu); static void op2B(emu6502 *emu);
-static void op2C(emu6502 *emu); static void op2D(emu6502 *emu);
-static void op2E(emu6502 *emu); static void op2F(emu6502 *emu);
-static void op30(emu6502 *emu); static void op31(emu6502 *emu);
-static void op32(emu6502 *emu); static void op33(emu6502 *emu);
-static void op34(emu6502 *emu); static void op35(emu6502 *emu);
-static void op36(emu6502 *emu); static void op37(emu6502 *emu);
-static void op38(emu6502 *emu); static void op39(emu6502 *emu);
-static void op3A(emu6502 *emu); static void op3B(emu6502 *emu);
-static void op3C(emu6502 *emu); static void op3D(emu6502 *emu);
-static void op3E(emu6502 *emu); static void op3F(emu6502 *emu);
-static void op40(emu6502 *emu); static void op41(emu6502 *emu);
-static void op42(emu6502 *emu); static void op43(emu6502 *emu);
-static void op44(emu6502 *emu); static void op45(emu6502 *emu);
-static void op46(emu6502 *emu); static void op47(emu6502 *emu);
-static void op48(emu6502 *emu); static void op49(emu6502 *emu);
-static void op4A(emu6502 *emu); static void op4B(emu6502 *emu);
-static void op4C(emu6502 *emu); static void op4D(emu6502 *emu);
-static void op4E(emu6502 *emu); static void op4F(emu6502 *emu);
-static void op50(emu6502 *emu); static void op51(emu6502 *emu);
-static void op52(emu6502 *emu); static void op53(emu6502 *emu);
-static void op54(emu6502 *emu); static void op55(emu6502 *emu);
-static void op56(emu6502 *emu); static void op57(emu6502 *emu);
-static void op58(emu6502 *emu); static void op59(emu6502 *emu);
-static void op5A(emu6502 *emu); static void op5B(emu6502 *emu);
-static void op5C(emu6502 *emu); static void op5D(emu6502 *emu);
-static void op5E(emu6502 *emu); static void op5F(emu6502 *emu);
-static void op60(emu6502 *emu); static void op61(emu6502 *emu);
-static void op62(emu6502 *emu); static void op63(emu6502 *emu);
-static void op64(emu6502 *emu); static void op65(emu6502 *emu);
-static void op66(emu6502 *emu); static void op67(emu6502 *emu);
-static void op68(emu6502 *emu); static void op69(emu6502 *emu);
-static void op6A(emu6502 *emu); static void op6B(emu6502 *emu);
-static void op6C(emu6502 *emu); static void op6D(emu6502 *emu);
-static void op6E(emu6502 *emu); static void op6F(emu6502 *emu);
-static void op70(emu6502 *emu); static void op71(emu6502 *emu);
-static void op72(emu6502 *emu); static void op73(emu6502 *emu);
-static void op74(emu6502 *emu); static void op75(emu6502 *emu);
-static void op76(emu6502 *emu); static void op77(emu6502 *emu);
-static void op78(emu6502 *emu); static void op79(emu6502 *emu);
-static void op7A(emu6502 *emu); static void op7B(emu6502 *emu);
-static void op7C(emu6502 *emu); static void op7D(emu6502 *emu);
-static void op7E(emu6502 *emu); static void op7F(emu6502 *emu);
-static void op80(emu6502 *emu); static void op81(emu6502 *emu);
-static void op82(emu6502 *emu); static void op83(emu6502 *emu);
-static void op84(emu6502 *emu); static void op85(emu6502 *emu);
-static void op86(emu6502 *emu); static void op87(emu6502 *emu);
-static void op88(emu6502 *emu); static void op89(emu6502 *emu);
-static void op8A(emu6502 *emu); static void op8B(emu6502 *emu);
-static void op8C(emu6502 *emu); static void op8D(emu6502 *emu);
-static void op8E(emu6502 *emu); static void op8F(emu6502 *emu);
-static void op90(emu6502 *emu); static void op91(emu6502 *emu);
-static void op92(emu6502 *emu); static void op93(emu6502 *emu);
-static void op94(emu6502 *emu); static void op95(emu6502 *emu);
-static void op96(emu6502 *emu); static void op97(emu6502 *emu);
-static void op98(emu6502 *emu); static void op99(emu6502 *emu);
-static void op9A(emu6502 *emu); static void op9B(emu6502 *emu);
-static void op9C(emu6502 *emu); static void op9D(emu6502 *emu);
-static void op9E(emu6502 *emu); static void op9F(emu6502 *emu);
-static void opA0(emu6502 *emu); static void opA1(emu6502 *emu);
-static void opA2(emu6502 *emu); static void opA3(emu6502 *emu);
-static void opA4(emu6502 *emu); static void opA5(emu6502 *emu);
-static void opA6(emu6502 *emu); static void opA7(emu6502 *emu);
-static void opA8(emu6502 *emu); static void opA9(emu6502 *emu);
-static void opAA(emu6502 *emu); static void opAB(emu6502 *emu);
-static void opAC(emu6502 *emu); static void opAD(emu6502 *emu);
-static void opAE(emu6502 *emu); static void opAF(emu6502 *emu);
-static void opB0(emu6502 *emu); static void opB1(emu6502 *emu);
-static void opB2(emu6502 *emu); static void opB3(emu6502 *emu);
-static void opB4(emu6502 *emu); static void opB5(emu6502 *emu);
-static void opB6(emu6502 *emu); static void opB7(emu6502 *emu);
-static void opB8(emu6502 *emu); static void opB9(emu6502 *emu);
-static void opBA(emu6502 *emu); static void opBB(emu6502 *emu);
-static void opBC(emu6502 *emu); static void opBD(emu6502 *emu);
-static void opBE(emu6502 *emu); static void opBF(emu6502 *emu);
-static void opC0(emu6502 *emu); static void opC1(emu6502 *emu);
-static void opC2(emu6502 *emu); static void opC3(emu6502 *emu);
-static void opC4(emu6502 *emu); static void opC5(emu6502 *emu);
-static void opC6(emu6502 *emu); static void opC7(emu6502 *emu);
-static void opC8(emu6502 *emu); static void opC9(emu6502 *emu);
-static void opCA(emu6502 *emu); static void opCB(emu6502 *emu);
-static void opCC(emu6502 *emu); static void opCD(emu6502 *emu);
-static void opCE(emu6502 *emu); static void opCF(emu6502 *emu);
-static void opD0(emu6502 *emu); static void opD1(emu6502 *emu);
-static void opD2(emu6502 *emu); static void opD3(emu6502 *emu);
-static void opD4(emu6502 *emu); static void opD5(emu6502 *emu);
-static void opD6(emu6502 *emu); static void opD7(emu6502 *emu);
-static void opD8(emu6502 *emu); static void opD9(emu6502 *emu);
-static void opDA(emu6502 *emu); static void opDB(emu6502 *emu);
-static void opDC(emu6502 *emu); static void opDD(emu6502 *emu);
-static void opDE(emu6502 *emu); static void opDF(emu6502 *emu);
-static void opE0(emu6502 *emu); static void opE1(emu6502 *emu);
-static void opE2(emu6502 *emu); static void opE3(emu6502 *emu);
-static void opE4(emu6502 *emu); static void opE5(emu6502 *emu);
-static void opE6(emu6502 *emu); static void opE7(emu6502 *emu);
-static void opE8(emu6502 *emu); static void opE9(emu6502 *emu);
-static void opEA(emu6502 *emu); static void opEB(emu6502 *emu);
-static void opEC(emu6502 *emu); static void opED(emu6502 *emu);
-static void opEE(emu6502 *emu); static void opEF(emu6502 *emu);
-static void opF0(emu6502 *emu); static void opF1(emu6502 *emu);
-static void opF2(emu6502 *emu); static void opF3(emu6502 *emu);
-static void opF4(emu6502 *emu); static void opF5(emu6502 *emu);
-static void opF6(emu6502 *emu); static void opF7(emu6502 *emu);
-static void opF8(emu6502 *emu); static void opF9(emu6502 *emu);
-static void opFA(emu6502 *emu); static void opFB(emu6502 *emu);
-static void opFC(emu6502 *emu); static void opFD(emu6502 *emu);
-static void opFE(emu6502 *emu); static void opFF(emu6502 *emu);
+FD(08); FD(09); FD(0A); FD(0B); FD(0C); FD(0D); FD(0E); FD(0F);
+FD(10); FD(11); FD(12); FD(13); FD(14); FD(15); FD(16); FD(17);
+FD(18); FD(19); FD(1A); FD(1B); FD(1C); FD(1D); FD(1E); FD(1F);
+FD(20); FD(21); FD(22); FD(23); FD(24); FD(25); FD(26); FD(27);
+FD(28); FD(29); FD(2A); FD(2B); FD(2C); FD(2D); FD(2E); FD(2F);
+FD(30); FD(31); FD(32); FD(33); FD(34); FD(35); FD(36); FD(37);
+FD(38); FD(39); FD(3A); FD(3B); FD(3C); FD(3D); FD(3E); FD(3F);
+FD(40); FD(41); FD(42); FD(43); FD(44); FD(45); FD(46); FD(47);
+FD(48); FD(49); FD(4A); FD(4B); FD(4C); FD(4D); FD(4E); FD(4F);
+FD(50); FD(51); FD(52); FD(53); FD(54); FD(55); FD(56); FD(57);
+FD(58); FD(59); FD(5A); FD(5B); FD(5C); FD(5D); FD(5E); FD(5F);
+FD(60); FD(61); FD(62); FD(63); FD(64); FD(65); FD(66); FD(67);
+FD(68); FD(69); FD(6A); FD(6B); FD(6C); FD(6D); FD(6E); FD(6F);
+FD(70); FD(71); FD(72); FD(73); FD(74); FD(75); FD(76); FD(77);
+FD(78); FD(79); FD(7A); FD(7B); FD(7C); FD(7D); FD(7E); FD(7F);
+FD(80); FD(81); FD(82); FD(83); FD(84); FD(85); FD(86); FD(87);
+FD(88); FD(89); FD(8A); FD(8B); FD(8C); FD(8D); FD(8E); FD(8F);
+FD(90); FD(91); FD(92); FD(93); FD(94); FD(95); FD(96); FD(97);
+FD(98); FD(99); FD(9A); FD(9B); FD(9C); FD(9D); FD(9E); FD(9F);
+FD(A0); FD(A1); FD(A2); FD(A3); FD(A4); FD(A5); FD(A6); FD(A7);
+FD(A8); FD(A9); FD(AA); FD(AB); FD(AC); FD(AD); FD(AE); FD(AF);
+FD(B0); FD(B1); FD(B2); FD(B3); FD(B4); FD(B5); FD(B6); FD(B7);
+FD(B8); FD(B9); FD(BA); FD(BB); FD(BC); FD(BD); FD(BE); FD(BF);
+FD(C0); FD(C1); FD(C2); FD(C3); FD(C4); FD(C5); FD(C6); FD(C7);
+FD(C8); FD(C9); FD(CA); FD(CB); FD(CC); FD(CD); FD(CE); FD(CF);
+FD(D0); FD(D1); FD(D2); FD(D3); FD(D4); FD(D5); FD(D6); FD(D7);
+FD(D8); FD(D9); FD(DA); FD(DB); FD(DC); FD(DD); FD(DE); FD(DF);
+FD(E0); FD(E1); FD(E2); FD(E3); FD(E4); FD(E5); FD(E6); FD(E7);
+FD(E8); FD(E9); FD(EA); FD(EB); FD(EC); FD(ED); FD(EE); FD(EF);
+FD(F0); FD(F1); FD(F2); FD(F3); FD(F4); FD(F5); FD(F6); FD(F7);
+FD(F8); FD(F9); FD(FA); FD(FB); FD(FC); FD(FD); FD(FE); FD(FF);
 #undef FD

 void (*inslookup[256])(emu6502 *emu) = {
@@ -2452,4 +2359,3 @@
 #undef BRK_BIT
 #undef OVER_BIT
 #undef NEG_BIT
-


Allow whitespace in the enchant ordering file. From Eric Albright

git-svn-id: 18bf4e4f0ca11a3471e5785d6da82074410339c6@22207 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6

--- src/enchant.c
+++ src/enchant.c
@@ -989,7 +989,7 @@
 		{
 			for (i = 0; tokens[i]; i++)
 				{
-					token = tokens[i];
+					token = g_strstrip(tokens[i]);

 					for (iter = broker->provider_list; iter != NULL; iter = g_slist_next (iter))
 						{


guard Freescale_KLXX shared RTC implementation with DEVICE_RTC

--- hal/targets/hal/TARGET_Freescale/TARGET_KLXX/rtc_api.c
+++ hal/targets/hal/TARGET_Freescale/TARGET_KLXX/rtc_api.c
@@ -13,6 +13,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
+#if DEVICE_RTC
+
 #include "rtc_api.h"
 #include "PeripheralPins.h"
 #include "clk_freqs.h"
@@ -112,3 +115,5 @@
     // re-enable counter
     RTC->SR |= RTC_SR_TCE_MASK;
 }
+
+#endif


Touch up function documentation comments.

--- src/enchive.c
+++ src/enchive.c
@@ -48,6 +48,9 @@
     abort();
 }

+/**
+ * Update cleanup registry to indicate FILE has been closed.
+ */
 static void
 cleanup_closed(FILE *file)
 {
@@ -60,7 +63,9 @@
     abort();
 }

-/* Free filename strings in cleanup registry. */
+/**
+ * Free resources held by the cleanup registry.
+ */
 static void
 cleanup_free(void)
 {
@@ -159,6 +164,16 @@
     return str;
 }

+/**
+ * Read the protection key from a key agent identified by its IV.
+ */
+static int agent_read(const u8 *key, const u8 *id);
+
+/**
+ * Serve the protection key on a key agent identified by its IV.
+ */
+static int agent_run(const u8 *key, const u8 *id);
+
 #if ENCHIVE_OPTION_AGENT
 #include <poll.h>
 #include <unistd.h>
@@ -166,6 +181,9 @@
 #include <sys/stat.h>
 #include <sys/socket.h>

+/**
+ * Fill ADDR with a unix domain socket name for the agent.
+ */
 static int
 agent_addr(struct sockaddr_un *addr, const u8 *iv)
 {
@@ -187,9 +205,6 @@
     }
 }

-/**
- * Read the protection key from a unix socket identified by its IV.
- */
 static int
 agent_read(u8 *key, const u8 *iv)
 {
@@ -209,9 +224,6 @@
     return success;
 }

-/**
- * Serve the protection key on a unix socket identified by its IV.
- */
 static int
 agent_run(const u8 *key, const u8 *iv)
 {
@@ -311,7 +323,9 @@
 #include <sys/stat.h>
 #include <sys/types.h>

-/* Return non-zero if path exists and is a directory. */
+/**
+ * Return non-zero if path exists and is a directory.
+ */
 static int
 dir_exists(const char *path)
 {
@@ -319,7 +333,9 @@
     return !stat(path, &info) && S_ISDIR(info.st_mode);
 }

-/* Use $XDG_CONFIG_HOME/enchive, or $HOME/.config/enchive. */
+/**
+ * Use $XDG_CONFIG_HOME/enchive, or $HOME/.config/enchive.
+ */
 static char *
 storage_directory(char *file)
 {
@@ -391,6 +407,9 @@

 #endif /* _WIN32 */

+/**
+ * Read a passphrase directly from the keyboard without echo.
+ */
 static void get_passphrase(char *buf, size_t len, char *prompt);

 /**
@@ -480,7 +499,6 @@

 /**
  * Create/truncate a file with paranoid permissions using OS calls.
- * Abort the program if the entropy could not be retrieved.
  */
 static FILE *secure_creat(const char *file);

@@ -589,6 +607,7 @@

 /**
  * Get secure entropy suitable for key generation from OS.
+ * Abort the program if the entropy could not be retrieved.
  */
 static void secure_entropy(void *buf, size_t len);

@@ -946,6 +965,9 @@
     }
 }

+/**
+ * Return 1 if file exists, or 0 if it doesn't.
+ */
 static int
 file_exists(char *filename)
 {
@@ -957,7 +979,9 @@
     return 0;
 }

-/* Print a nice fingerprint of a key */
+/**
+ * Print a nice fingerprint of a key.
+ */
 static void
 print_fingerprint(const u8 *key)
 {
@@ -991,6 +1015,9 @@
     "keygen", "fingerprint", "archive", "extract"
 };

+/**
+ * Attempt to unambiguously parse the user's command into an enum.
+ */
 static enum command
 parse_command(char *command)
 {
@@ -1339,6 +1366,9 @@
         remove(infile);
 }

+/**
+ * Write a NULL-terminated array of strings with a newline after each.
+ */
 static void
 multiputs(const char **s, FILE *f)
 {


Only print PSNR if some frames were encoded.

--- src/encmain.c
+++ src/encmain.c
@@ -243,16 +243,23 @@

     GET_TIME(&encoding_end_real_time);
     encoding_end_cpu_time = clock();
-
+
     threadqueue_flush(encoder->threadqueue);
     // Coding finished

     // Print statistics of the coding
-    fprintf(stderr, " Processed %d frames, %10llu bits AVG PSNR: %2.4f %2.4f %2.4f\n",
-            frames_done, (long long unsigned int)bitstream_length * 8,
-            psnr_sum[0] / frames_done, psnr_sum[1] / frames_done, psnr_sum[2] / frames_done);
+    fprintf(stderr, " Processed %d frames, %10llu bits",
+            frames_done,
+            (long long unsigned int)bitstream_length * 8);
+    if (frames_done > 0) {
+      fprintf(stderr, " AVG PSNR: %2.4f %2.4f %2.4f",
+              psnr_sum[0] / frames_done,
+              psnr_sum[1] / frames_done,
+              psnr_sum[2] / frames_done);
+    }
+    fprintf(stderr, "\n");
     fprintf(stderr, " Total CPU time: %.3f s.\n", ((float)(clock() - start_time)) / CLOCKS_PER_SEC);
-
+
     {
       double encoding_time = ( (double)(encoding_end_cpu_time - encoding_start_cpu_time) ) / (double) CLOCKS_PER_SEC;
       double wall_time = CLOCK_T_AS_DOUBLE(encoding_end_real_time) - CLOCK_T_AS_DOUBLE(encoding_start_real_time);


Add some comments and const qualifiers.

Add some comments and const qualifiers.

--- src/encoder.c
+++ src/encoder.c
@@ -2025,7 +2025,7 @@
 }

 static void transform_chroma(encoder_state * const encoder_state, cu_info *cur_cu,
-                             int depth, pixel *base_u, pixel *pred_u,
+                             int depth, const pixel *base_u, pixel *pred_u,
                              coefficient *coeff_u, int8_t scan_idx_chroma,
                              coefficient *pre_quant_coeff, coefficient *block)
 {
@@ -2095,6 +2095,11 @@
   }
 }

+/**
+ * This function calculates the residual coefficients for a region of the LCU
+ * (defined by x, y and depth) and updates the reconstruction with the
+ * kvantized residual.
+ */
 void encode_transform_tree(encoder_state * const encoder_state, int32_t x, int32_t y, const uint8_t depth, lcu_t* lcu)
 {
   const encoder_control * const encoder = encoder_state->encoder_control;
@@ -2149,38 +2154,39 @@
   }

   {
-    // INTRAPREDICTION VARIABLES
-      // Pointers to reconstruction arrays
+    // Pointers to current location in arrays with prediction.
     pixel *recbase_y = &lcu->rec.y[x_local + y_local * LCU_WIDTH];
     pixel *recbase_u = &lcu->rec.u[x_local/2 + (y_local * LCU_WIDTH)/4];
     pixel *recbase_v = &lcu->rec.v[x_local/2 + (y_local * LCU_WIDTH)/4];
-    int32_t recbase_stride = LCU_WIDTH;
-
-
-    pixel *base_y = &lcu->ref.y[x_local + y_local * LCU_WIDTH];
-    pixel *base_u = &lcu->ref.u[x_local/2 + (y_local * LCU_WIDTH)/4];
-    pixel *base_v = &lcu->ref.v[x_local/2 + (y_local * LCU_WIDTH)/4];
-    int32_t base_stride = LCU_WIDTH;
-
+    const int32_t recbase_stride = LCU_WIDTH;
+
+    // Pointers to current location in arrays with reference.
+    const pixel *base_y = &lcu->ref.y[x_local + y_local * LCU_WIDTH];
+    const pixel *base_u = &lcu->ref.u[x_local/2 + (y_local * LCU_WIDTH)/4];
+    const pixel *base_v = &lcu->ref.v[x_local/2 + (y_local * LCU_WIDTH)/4];
+    const int32_t base_stride = LCU_WIDTH;
+
+    // Temporary buffers. Not really used for much. Possibly unnecessary.
     pixel pred_y[LCU_WIDTH*LCU_WIDTH];
     pixel pred_u[LCU_WIDTH*LCU_WIDTH>>2];
     pixel pred_v[LCU_WIDTH*LCU_WIDTH>>2];
-    int32_t pred_stride = LCU_WIDTH;
-
+    const int32_t pred_stride = LCU_WIDTH;
+
+    // Buffers for coefficients.
     coefficient coeff_y[LCU_WIDTH*LCU_WIDTH];
     coefficient coeff_u[LCU_WIDTH*LCU_WIDTH>>2];
     coefficient coeff_v[LCU_WIDTH*LCU_WIDTH>>2];
+
+    // Pointers to current location in arrays with kvantized coefficients.
     coefficient *orig_coeff_y = &lcu->coeff.y[x_local + y_local * LCU_WIDTH];
     coefficient *orig_coeff_u = &lcu->coeff.u[x_local/2 + (y_local * LCU_WIDTH)/4];
     coefficient *orig_coeff_v = &lcu->coeff.v[x_local/2 + (y_local * LCU_WIDTH)/4];
-    int32_t coeff_stride = LCU_WIDTH;
-
-    // Quant and transform here...
+    const int32_t coeff_stride = LCU_WIDTH;
+
+    // Temporary buffers for kvantization and transformation.
     int16_t block[LCU_WIDTH*LCU_WIDTH>>2];
     int16_t pre_quant_coeff[LCU_WIDTH*LCU_WIDTH>>2];
-
-    // INTRA PREDICTION
-
+
     uint32_t ac_sum = 0;
     uint8_t scan_idx_luma   = SCAN_DIAG;
     uint8_t scan_idx_chroma = SCAN_DIAG;


Fix encoder_state_init, which was making out of bound reads

--- src/encoder.c
+++ src/encoder.c
@@ -1073,7 +1073,8 @@
           //Find LCU above
           if (child_state->type == ENCODER_STATE_TYPE_WAVEFRONT_ROW) {
             int j;
-            for (j=0; child_state->parent->children[j].encoder_control; ++j) {
+            //For all previous wavefront rows
+            for (j=0; &child_state->parent->children[j] != child_state && child_state->parent->children[j].encoder_control; ++j) {
               if (child_state->parent->children[j].wfrow->lcu_offset_y == child_state->wfrow->lcu_offset_y - 1) {
                 int k;
                 for (k=0; k < child_state->parent->children[j].lcu_order_count; ++k) {


Sync FBSDID.

Sync FBSDID.

--- KERN/netinet/sctp_input.c
+++ KERN/netinet/sctp_input.c
@@ -32,7 +32,7 @@

 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 216825 2010-12-30 21:32:35Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_input.c 216887 2011-01-02 10:27:27Z tuexen $");
 #endif

 #include <netinet/sctp_os.h>


Move transform skip decision to it's own function.

--- src/encoder.c
+++ src/encoder.c
@@ -2945,6 +2945,72 @@
 }

+void decide_trskip(encoder_state * const encoder_state, cu_info *cur_cu, int8_t depth, int pu_index,
+                   int16_t *residual, uint32_t *ac_sum)
+{
+  const encoder_control * const encoder = encoder_state->encoder_control;
+  const coeff_scan_order_t scan_idx_luma = get_scan_order(cur_cu->type, cur_cu->intra[pu_index].mode, depth);
+  const int8_t width = LCU_WIDTH >> depth;
+
+  //int16_t block[LCU_WIDTH*LCU_WIDTH>>2];
+  int16_t pre_quant_coeff[LCU_WIDTH*LCU_WIDTH>>2];
+
+  int i;
+  coefficient temp_block[16];  coefficient temp_coeff[16];
+  coefficient temp_block2[16]; coefficient temp_coeff2[16];
+  uint32_t cost = 0,cost2 = 0;
+  uint32_t coeffcost = 0,coeffcost2 = 0;
+
+  // Test for transform skip
+  transformskip(encoder, residual,pre_quant_coeff, width);
+  if (encoder->rdoq_enable) {
+    rdoq(encoder_state, pre_quant_coeff, temp_coeff, 4, 4, ac_sum, 0, scan_idx_luma, cur_cu->type,0);
+  } else {
+    quant(encoder_state, pre_quant_coeff, temp_coeff, 4, 4, ac_sum, 0, scan_idx_luma, cur_cu->type);
+  }
+  dequant(encoder_state, temp_coeff, pre_quant_coeff, 4, 4, 0, cur_cu->type);
+  itransformskip(encoder, temp_block,pre_quant_coeff,width);
+
+  transform2d(encoder, residual,pre_quant_coeff,width,0);
+  if (encoder->rdoq_enable) {
+    rdoq(encoder_state, pre_quant_coeff, temp_coeff2, 4, 4, ac_sum, 0, scan_idx_luma, cur_cu->type,0);
+  } else {
+    quant(encoder_state, pre_quant_coeff, temp_coeff2, 4, 4, ac_sum, 0, scan_idx_luma, cur_cu->type);
+  }
+  dequant(encoder_state, temp_coeff2, pre_quant_coeff, 4, 4, 0, cur_cu->type);
+  itransform2d(encoder, temp_block2,pre_quant_coeff,width,0);
+
+  // SSD between original and reconstructed
+  for (i = 0; i < 16; i++) {
+    int diff = temp_block[i] - residual[i];
+    cost += diff*diff;
+
+    diff = temp_block2[i] - residual[i];
+    cost2 += diff*diff;
+  }
+
+  // Simple RDO
+  if(encoder->rdo == 1) {
+    // SSD between reconstruction and original + sum of coeffs
+    for (i = 0; i < 16; i++) {
+      coeffcost += abs((int)temp_coeff[i]);
+      coeffcost2 += abs((int)temp_coeff2[i]);
+    }
+    cost += (1 + coeffcost + (coeffcost>>1))*((int)encoder_state->global->cur_lambda_cost+0.5);
+    cost2 += (coeffcost2 + (coeffcost2>>1))*((int)encoder_state->global->cur_lambda_cost+0.5);
+    // Full RDO
+  } else if(encoder->rdo == 2) {
+    coeffcost = get_coeff_cost(encoder_state, temp_coeff, 4, 0, scan_idx_luma);
+    coeffcost2 = get_coeff_cost(encoder_state, temp_coeff2, 4, 0, scan_idx_luma);
+
+    cost  += coeffcost*((int)encoder_state->global->cur_lambda_cost+0.5);
+    cost2 += coeffcost2*((int)encoder_state->global->cur_lambda_cost+0.5);
+  }
+
+  cur_cu->intra[pu_index].tr_skip = (cost < cost2);
+}
+
+
 /**
  * This function calculates the residual coefficients for a region of the LCU
  * (defined by x, y and depth) and updates the reconstruction with the
@@ -3080,59 +3146,7 @@

     // For 4x4 blocks, check for transform skip
     if(width == 4 && encoder->trskip_enable) {
-      int i;
-      coefficient temp_block[16];  coefficient temp_coeff[16];
-      coefficient temp_block2[16]; coefficient temp_coeff2[16];
-      uint32_t cost = 0,cost2 = 0;
-      uint32_t coeffcost = 0,coeffcost2 = 0;
-
-      // Test for transform skip
-      transformskip(encoder, block,pre_quant_coeff,width);
-      if (encoder->rdoq_enable) {
-        rdoq(encoder_state, pre_quant_coeff, temp_coeff, 4, 4, &ac_sum, 0, scan_idx_luma, cur_cu->type,0);
-      } else {
-        quant(encoder_state, pre_quant_coeff, temp_coeff, 4, 4, &ac_sum, 0, scan_idx_luma, cur_cu->type);
-      }
-      dequant(encoder_state, temp_coeff, pre_quant_coeff, 4, 4, 0, cur_cu->type);
-      itransformskip(encoder, temp_block,pre_quant_coeff,width);
-
-      transform2d(encoder, block,pre_quant_coeff,width,0);
-      if (encoder->rdoq_enable) {
-        rdoq(encoder_state, pre_quant_coeff, temp_coeff2, 4, 4, &ac_sum, 0, scan_idx_luma, cur_cu->type,0);
-      } else {
-        quant(encoder_state, pre_quant_coeff, temp_coeff2, 4, 4, &ac_sum, 0, scan_idx_luma, cur_cu->type);
-      }
-      dequant(encoder_state, temp_coeff2, pre_quant_coeff, 4, 4, 0, cur_cu->type);
-      itransform2d(encoder, temp_block2,pre_quant_coeff,width,0);
-
-      // SSD between original and reconstructed
-      for (i = 0; i < 16; i++) {
-        int diff = temp_block[i]-block[i];
-        cost += diff*diff;
-
-        diff = temp_block2[i] - block[i];
-        cost2 += diff*diff;
-      }
-
-      // Simple RDO
-      if(encoder->rdo == 1) {
-        // SSD between reconstruction and original + sum of coeffs
-        for (i = 0; i < 16; i++) {
-          coeffcost += abs((int)temp_coeff[i]);
-          coeffcost2 += abs((int)temp_coeff2[i]);
-        }
-        cost += (1 + coeffcost + (coeffcost>>1))*((int)encoder_state->global->cur_lambda_cost+0.5);
-        cost2 += (coeffcost2 + (coeffcost2>>1))*((int)encoder_state->global->cur_lambda_cost+0.5);
-        // Full RDO
-      } else if(encoder->rdo == 2) {
-        coeffcost = get_coeff_cost(encoder_state, temp_coeff, 4, 0, scan_idx_luma);
-        coeffcost2 = get_coeff_cost(encoder_state, temp_coeff2, 4, 0, scan_idx_luma);
-
-        cost  += coeffcost*((int)encoder_state->global->cur_lambda_cost+0.5);
-        cost2 += coeffcost2*((int)encoder_state->global->cur_lambda_cost+0.5);
-      }
-
-      cur_cu->intra[pu_index].tr_skip = (cost < cost2);
+      decide_trskip(encoder_state, cur_cu, depth, pu_index, block, &ac_sum);
     }

     // Transform and quant residual to coeffs


capplet: Show only image files when choosing a new background

--- capplet/myzone-cc-panel.c
+++ capplet/myzone-cc-panel.c
@@ -330,12 +330,18 @@
     GtkWidget *button;
     const gchar *pictures_dir;
     gchar *current_filename;
+    GtkFileFilter *filter;

     button = (GtkWidget *)gtk_builder_get_object (builder, "background_chooser_button");
     preview = gtk_image_new ();
     gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (button), preview);

     pictures_dir = g_get_user_special_dir (G_USER_DIRECTORY_PICTURES);
+
+    filter = gtk_file_filter_new ();
+    gtk_file_filter_add_pixbuf_formats (filter);
+    gtk_file_filter_set_name (filter, _("Images"));
+    gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (button), filter);

     gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (button),
                                           pictures_dir,


Re-examine the sending_seq.. and put print in during restart cond that sets it now.

--- KERN/netinet/sctp_input.c
+++ KERN/netinet/sctp_input.c
@@ -1307,19 +1307,12 @@
 			sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE, inp, stcb,
 			    NULL);
 		}
+		/* FIX? Should we go out, in this case (if the seq numbers
+		 * changed on the peer) and set any data to RETRANSMIT?
+		 */
 		asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd);
 		asoc->pre_open_streams =
 		    ntohs(initack_cp->init.num_outbound_streams);
-		if(asoc->init_seq_number != ntohl(initack_cp->init.initial_tsn)) {
-			/* If this print comes out, we need to go in to
-			 * any queued data and re-assing TSN's different than
-			 * previously assigned for data that was with the cookie.
-			 */
-			panic("Test case, does this really happen?\n");
-			asoc->init_seq_number != ntohl(initack_cp->init.initial_tsn);
-			asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out =
-				asoc->init_seq_number;
-		}
 		asoc->last_cwr_tsn = asoc->init_seq_number - 1;
 		asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1;
 		asoc->str_reset_seq_in = asoc->init_seq_number;
@@ -1406,6 +1399,8 @@
 		asoc->pre_open_streams =
 		    ntohs(initack_cp->init.num_outbound_streams);
 		asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn);
+		printf("Peer restart set from %x  to:%x\n", asoc->sending_seq,
+		       asoc->init_seq_number);
 		asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number;

 		asoc->last_cwr_tsn = asoc->init_seq_number - 1;


PROTON-581: part2, pick up minor changes since review board version

git-svn-id: 33ed6c3feaacb64944efc691d1ae8e09b17f2bf9@1627987 13f79535-47bb-0310-9956-ffa450edef68


Fix some compiler warnings for VS2010 /W4 in encoder.c.

- Working towards issue #11.
- There is a lot in this module so I'm fixing only ~half in this commit.

--- src/encoder.c
+++ src/encoder.c
@@ -184,13 +184,13 @@
   memset( g_convert_to_bit,-1, sizeof( g_convert_to_bit ) );

   for (i = 4; i < (1 << 7); i *= 2) {
-    g_convert_to_bit[i] = c;
+    g_convert_to_bit[i] = (int8_t)c;
     c++;
   }

   g_convert_to_bit[i] = c;
+
   c = 2;
-
   for (i = 0; i < 7; i++) {
     g_sig_last_scan[0][i] = (uint32_t*)malloc(c*c*sizeof(uint32_t));
     g_sig_last_scan[1][i] = (uint32_t*)malloc(c*c*sizeof(uint32_t));
@@ -484,7 +484,7 @@
   encoder->in.cur_pic->poc = encoder->poc;
 }

-void fill_after_frame(FILE *file, unsigned height, unsigned array_width,
+void fill_after_frame(unsigned height, unsigned array_width,
                       unsigned array_height, pixel *data)
 {
   pixel* p = data + height * array_width;
@@ -553,11 +553,11 @@
   }

   if (height != array_height) {
-    fill_after_frame(file, height, array_width, array_height,
+    fill_after_frame(height, array_width, array_height,
                      in->cur_pic->y_data);
-    fill_after_frame(file, height >> 1, array_width >> 1, array_height >> 1,
+    fill_after_frame(height >> 1, array_width >> 1, array_height >> 1,
                      in->cur_pic->u_data);
-    fill_after_frame(file, height >> 1, array_width >> 1, array_height >> 1,
+    fill_after_frame(height >> 1, array_width >> 1, array_height >> 1,
                      in->cur_pic->v_data);
   }
   return 1;
@@ -1106,13 +1106,8 @@
   }
 }

-void encode_sao_merge_flags(encoder_control *encoder, sao_info *sao,
-                            unsigned x_ctb, unsigned y_ctb)
-{
-  // SAO merge flags are not present if merge candidate is not in the same
-  // slice AND tile, but there isn't any such segmentation right now.
-  assert(!USE_SLICES && !USE_TILES);
-
+void encode_sao_merge_flags(sao_info *sao, unsigned x_ctb, unsigned y_ctb)
+{
   // SAO merge flags are not present for the first row and column.
   if (x_ctb > 0) {
     cabac.ctx = &g_sao_merge_flag_model;
@@ -1130,11 +1125,8 @@
 void encode_sao(encoder_control *encoder, unsigned x_lcu, uint16_t y_lcu,
                 sao_info *sao_luma, sao_info *sao_chroma)
 {
-  unsigned sao_type[3] = {SAO_TYPE_NONE, SAO_TYPE_NONE, SAO_TYPE_NONE};
-  picture *pic = encoder->in.cur_pic;
-
   // TODO: transmit merge flags outside sao_info
-  encode_sao_merge_flags(encoder, sao_luma, x_lcu, y_lcu);
+  encode_sao_merge_flags(sao_luma, x_lcu, y_lcu);

   // If SAO is merged, nothing else needs to be coded.
   if (!sao_luma->merge_left_flag && !sao_luma->merge_up_flag) {
@@ -1384,8 +1376,8 @@
               CABAC_BIN(&cabac, (ref_frame == 0) ? 0 : 1, "ref_frame_flag");

               if (ref_frame > 0) {
-                uint32_t i;
-                uint32_t ref_num = encoder->ref->used_size - 2;
+                int32_t i;
+                int32_t ref_num = encoder->ref->used_size - 2;

                 cabac.ctx = &g_cu_ref_pic_model[1];
                 ref_frame--;
@@ -1474,7 +1466,6 @@
     int8_t mpm_preds[4] = {-1, -1, -1, -1};
     int i, j;
     uint32_t flag[4];
-    uint32_t width = LCU_WIDTH>>depth;
     int num_pred_units = (cur_cu->part_size == SIZE_2Nx2N ? 1 : 4);

     #if ENABLE_PCM == 1
@@ -1495,7 +1486,7 @@
                                    intra_preds[j]);
       for (i = 0; i < 3; i++) {
         if (intra_preds[j][i] == intra_pred_mode[j]) {
-          mpm_preds[j] = i;
+          mpm_preds[j] = (int8_t)i;
           break;
         }
       }
@@ -1629,12 +1620,12 @@
 }

 void transform_chroma(encoder_control *encoder, cu_info *cur_cu, int depth, pixel *base_u, pixel *pred_u,
-                      coefficient *coeff_u, int color_type, unsigned scan_idx_chroma, coefficient *pre_quant_coeff, coefficient *block)
+                      coefficient *coeff_u, int8_t scan_idx_chroma, coefficient *pre_quant_coeff, coefficient *block)
 {
   int base_stride = encoder->in.width;
   int pred_stride = encoder->in.width;

-  int width_c = LCU_WIDTH >> (depth + 1);
+  int8_t width_c = LCU_WIDTH >> (depth + 1);

   int i = 0;
   unsigned ac_sum = 0;
@@ -1649,7 +1640,7 @@
     }
   }

-  transform2d(block, pre_quant_coeff, width_c,65535);
+  transform2d(block, pre_quant_coeff, width_c, 65535);
   #if RDOQ == 1
   rdoq(encoder, pre_quant_coeff, coeff_u, width_c, width_c, &ac_sum, 2,
        scan_idx_chroma, cur_cu->type, cur_cu->tr_depth-cur_cu->depth);
@@ -1932,7 +1923,7 @@
         }
       }

-      transform_chroma(encoder, cur_cu, chroma_depth, base_u, pred_u, coeff_u, color_type_u, scan_idx_chroma, pre_quant_coeff, block);
+      transform_chroma(encoder, cur_cu, chroma_depth, base_u, pred_u, coeff_u, scan_idx_chroma, pre_quant_coeff, block);
       for (i = 0; i < chroma_size; i++) {
         if (coeff_u[i] != 0) {
           // Found one, we can break here
@@ -1941,7 +1932,7 @@
           break;
         }
       }
-      transform_chroma(encoder, cur_cu, chroma_depth, base_v, pred_v, coeff_v, color_type_v, scan_idx_chroma, pre_quant_coeff, block);
+      transform_chroma(encoder, cur_cu, chroma_depth, base_v, pred_v, coeff_v, scan_idx_chroma, pre_quant_coeff, block);
       for (i = 0; i < chroma_size; i++) {
         if (coeff_v[i] != 0) {
           // Found one, we can break here


Fix a bug where message with larger than allowed SID are not deleted when using an implicit association setup.

--- KERN/netinet/sctp_input.c
+++ KERN/netinet/sctp_input.c
@@ -283,18 +283,37 @@
 		unsigned int newcnt;
 		struct sctp_stream_out *outs;
 		struct sctp_stream_queue_pending *sp;
-
-		/* cut back on number of streams */
+		struct sctp_tmit_chunk *chk, *chk_next;
+
+		/* abandon the upper streams */
 		newcnt = ntohs(init->num_inbound_streams);
-		/* This if is probably not needed but I am cautious */
+		if (!TAILQ_EMPTY(&asoc->send_queue)) {
+			chk = TAILQ_FIRST(&asoc->send_queue);
+			while (chk) {
+				chk_next = TAILQ_NEXT(chk, sctp_next);
+				if (chk->rec.data.stream_number >= newcnt) {
+					TAILQ_REMOVE(&asoc->send_queue, chk, sctp_next);
+					asoc->send_queue_cnt--;
+					if (chk->data != NULL) {
+						sctp_free_bufspace(stcb, asoc, chk, 1);
+						sctp_ulp_notify(SCTP_NOTIFY_DG_FAIL, stcb,
+								SCTP_NOTIFY_DATAGRAM_UNSENT, chk, SCTP_SO_NOT_LOCKED);
+						sctp_m_freem(chk->data);
+						chk->data = NULL;
+					}
+					sctp_free_a_chunk(stcb, chk);
+					/*sa_ignore FREED_MEMORY*/
+				}
+				chk = chk_next;
+			}
+		}
 		if (asoc->strmout) {
-			/* First make sure no data chunks are trapped */
 			for (i = newcnt; i < asoc->pre_open_streams; i++) {
 				outs = &asoc->strmout[i];
+				printf("send_queue empty=%d.\n", TAILQ_EMPTY(&asoc->send_queue));
 				sp = TAILQ_FIRST(&outs->outqueue);
 				while (sp) {
-					TAILQ_REMOVE(&outs->outqueue, sp,
-					    next);
+					TAILQ_REMOVE(&outs->outqueue, sp, next);
 					asoc->stream_queue_cnt--;
 					sctp_ulp_notify(SCTP_NOTIFY_SPECIAL_SP_FAIL,
 					    stcb, SCTP_NOTIFY_DATAGRAM_UNSENT,
@@ -306,16 +325,13 @@
 					sctp_free_remote_addr(sp->net);
 					sp->net = NULL;
 					/* Free the chunk */
-					SCTP_PRINTF("sp:%p tcb:%p weird free case\n",
-						    sp, stcb);
-
 					sctp_free_a_strmoq(stcb, sp);
-                    /*sa_ignore FREED_MEMORY*/
+					/*sa_ignore FREED_MEMORY*/
 					sp = TAILQ_FIRST(&outs->outqueue);
 				}
 			}
 		}
-		/* cut back the count and abandon the upper streams */
+		/* cut back the count */
 		asoc->pre_open_streams = newcnt;
 	}
 	SCTP_TCB_SEND_UNLOCK(stcb);


Only show bucket_conns stat for no-arg stats.

I was going to make this a different, more special stat, but it's for
the current specific bucket, so I might as well just append it as
usual in the base set.

Change-Id: I87a560792a8a774cd7b5a6e07f625601bc0fef41
Reviewed-on: http://review.northscale.com/1526
Tested-by: Sean Lynch <9c3328a4a1f4f8f5c18b2d5b9057163c49b93ff3@literati.org>
Reviewed-by: Sean Lynch <9c3328a4a1f4f8f5c18b2d5b9057163c49b93ff3@literati.org>

--- bucket_engine.c
+++ bucket_engine.c
@@ -773,7 +773,6 @@
                                           int nkey,
                                           ADD_STAT add_stat) {
     ENGINE_ERROR_CODE rc = ENGINE_DISCONNECT;
-    char statval[20];
     proxied_engine_t *e = get_engine(handle, cookie);

     if (e) {
@@ -781,9 +780,12 @@
         struct bucket_engine *be = (struct bucket_engine*)handle;
         proxied_engine_handle_t *peh =
             be->upstream_server->core->get_engine_specific(cookie);
-        snprintf(statval, 20, "%d", peh->refcount - 1);
-        add_stat("bucket_conns", strlen("bucket_conns"), statval,
-                 strlen(statval), cookie);
+        if (nkey == 0) {
+            char statval[20];
+            snprintf(statval, 20, "%d", peh->refcount - 1);
+            add_stat("bucket_conns", strlen("bucket_conns"), statval,
+                     strlen(statval), cookie);
+        }
     }
     return rc;
 }


libpanel-applet: Make sure people cannot misuse PanelApplet

If people just create a PanelApplet object and hope it works, then it
will just fail. People should use panel_applet_factory_main().

https://bugzilla.gnome.org/show_bug.cgi?id=640968

--- libpanel-applet/panel-applet.c
+++ libpanel-applet/panel-applet.c
@@ -1759,8 +1759,12 @@
 		break;
 	case PROP_CLOSURE:
 		applet->priv->closure = g_value_get_pointer (value);
-		g_closure_set_marshal (applet->priv->closure,
-				       panel_applet_marshal_BOOLEAN__STRING);
+		/* We know closure should not be NULL, but we'll fail in
+		 * panel_applet_constructed() with a proper message if this is
+		 * the case. */
+		if (applet->priv->closure)
+			g_closure_set_marshal (applet->priv->closure,
+					       panel_applet_marshal_BOOLEAN__STRING);
 		break;
 	case PROP_CONNECTION:
 		applet->priv->connection = g_value_dup_object (value);
@@ -1906,7 +1910,12 @@
 {
 	PanelApplet *applet = PANEL_APPLET (object);

-	panel_applet_register_object (applet);
+	if (!applet->priv->connection || !applet->priv->closure || !applet->priv->id) {
+		g_printerr ("Bad use of PanelApplet API: you should not create a PanelApplet object yourself. Please use panel_applet_factory_main() instead.\n");
+		g_assert_not_reached ();
+	}
+
+	return panel_applet_register_object (applet);
 }

 static void


libpanel-applet: add link to PanelAppletFactoryCallback for 'callback' in doc-block

--- libpanel-applet/panel-applet.h
+++ libpanel-applet/panel-applet.h
@@ -202,7 +202,8 @@
  * PANEL_APPLET_OUT_PROCESS_FACTORY:
  * @id: identifier of an applet factory.
  * @type: GType of the applet this factory creates.
- * @callback: (scope call): callback to be called when a new applet is created.
+ * @callback: (scope call): a %PanelAppletFactoryCallback to be called
+ *     when a new applet is created.
  * @data: (closure): callback data.
  *
  * Convenience macro providing a main() function for an out-of-process applet.
@@ -256,7 +257,8 @@
  * PANEL_APPLET_IN_PROCESS_FACTORY:
  * @id: identifier of an applet factory.
  * @type: GType of the applet this factory creates.
- * @callback: (scope call): callback to be called when a new applet is created.
+ * @callback: (scope call): a %PanelAppletFactoryCallback to be called
+ *     when a new applet is created.
  * @data: (closure): callback data.
  *
  * Convenience macro providing the symbol needed to automatically register the


Use BSLS_KEYWORD_CONSTEXPR_CPP14 instead of BSLS_KEYWORD_CONSTEXPR_RELAXED

--- groups/bsl/bslstl/bslstl_stringview.h
+++ groups/bsl/bslstl/bslstl_stringview.h
@@ -332,27 +332,27 @@
         // 'characterString || (numChars == 0)' and 'numChars <= max_size()'.

     template <class ALLOCATOR>
-    BSLS_KEYWORD_CONSTEXPR_RELAXED
+    BSLS_KEYWORD_CONSTEXPR_CPP14
     basic_string_view(
        const native_std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>& str);
         // Create a view of the specified 'string'.

     // MANIPULATORS
-    BSLS_KEYWORD_CONSTEXPR_RELAXED
+    BSLS_KEYWORD_CONSTEXPR_CPP14
     basic_string_view& operator=(const basic_string_view& rhs)
     BSLS_KEYWORD_NOEXCEPT;
         // Assign to this view the value of the specified 'rhs' object, and
         // return a reference providing modifiable access to this view.

     template <class ALLOCATOR>
-    BSLS_KEYWORD_CONSTEXPR_RELAXED
+    BSLS_KEYWORD_CONSTEXPR_CPP14
     basic_string_view& operator=(
         const native_std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>& rhs)
     BSLS_KEYWORD_NOEXCEPT;
         // Assign to this view the value of the specified 'rhs' object, and
         // return a reference providing modifiable access to this view.

-    BSLS_KEYWORD_CONSTEXPR_RELAXED
+    BSLS_KEYWORD_CONSTEXPR_CPP14
     void remove_prefix(size_type numChars);
         // Move the start of this view forward by the specified 'numChars'.
         // The behavior is undefined unless 'numChars <= length()'.
@@ -1191,7 +1191,7 @@
 template <class CHAR_TYPE, class CHAR_TRAITS>
 template <class ALLOCATOR>
 BSLS_PLATFORM_AGGRESSIVE_INLINE
-BSLS_KEYWORD_CONSTEXPR_RELAXED
+BSLS_KEYWORD_CONSTEXPR_CPP14
 basic_string_view<CHAR_TYPE, CHAR_TRAITS>::basic_string_view(
         const native_std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>& str)
 {
@@ -1203,7 +1203,7 @@
 template <class CHAR_TYPE, class CHAR_TRAITS>
 BSLS_KEYWORD_CONSTEXPR_CPP14
 BSLS_PLATFORM_AGGRESSIVE_INLINE
-BSLS_KEYWORD_CONSTEXPR_RELAXED
+BSLS_KEYWORD_CONSTEXPR_CPP14
 basic_string_view<CHAR_TYPE, CHAR_TRAITS>&
 basic_string_view<CHAR_TYPE, CHAR_TRAITS>::operator=(
                                                   const basic_string_view& rhs)
@@ -1217,7 +1217,7 @@
 template <class CHAR_TYPE, class CHAR_TRAITS>
 template <class ALLOCATOR>
 BSLS_PLATFORM_AGGRESSIVE_INLINE
-BSLS_KEYWORD_CONSTEXPR_RELAXED
+BSLS_KEYWORD_CONSTEXPR_CPP14
 basic_string_view<CHAR_TYPE, CHAR_TRAITS>&
 basic_string_view<CHAR_TYPE, CHAR_TRAITS>::operator=(
         const native_std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>& rhs)
@@ -1229,7 +1229,7 @@
 }

 template <class CHAR_TYPE, class CHAR_TRAITS>
-BSLS_KEYWORD_CONSTEXPR_RELAXED
+BSLS_KEYWORD_CONSTEXPR_CPP14
 void
 basic_string_view<CHAR_TYPE, CHAR_TRAITS>::remove_prefix(size_type numChars)
 {
@@ -2228,7 +2228,7 @@

 template <class CHAR_TYPE, class CHAR_TRAITS>
 inline
-BSLS_KEYWORD_CONSTEXPR_RELAXED
+BSLS_KEYWORD_CONSTEXPR_CPP14
 bool bsl::operator<(basic_string_view<CHAR_TYPE, CHAR_TRAITS>        lhs,
                     basic_string_view<CHAR_TYPE, CHAR_TRAITS>        rhs)
                                                           BSLS_KEYWORD_NOEXCEPT


just moving foreign functions around

just moving foreign functions around

--- src/startup.c
+++ src/startup.c
@@ -75,6 +75,11 @@
   }
 }

+static void print_ptr(ptr x) {
+  print_ptr_rec(stdout, x, OUT);
+  printf("\n");
+}
+
 ptr ik_log(ptr msg) {
   fprintf(stderr, "log: ");
   print_ptr_rec(stderr, msg, IN);
@@ -96,11 +101,6 @@
   }
   fprintf(stderr, "\n");
   exit(0);
-}
-
-static void print_ptr(ptr x) {
-  print_ptr_rec(stdout, x, OUT);
-  printf("\n");
 }

 static char* allocate_protected_space(int size) {


plugins: don't apply overlay composition in GLTextureUpload function.

The GLTextureUpload function is not in charge of doing the overlay
composition if any.

https://bugzilla.gnome.org/show_bug.cgi?id=721859

Signed-off-by: Gwenole Beauchesne <729713629d9640cc095f1c77c692e1881f8093c4@intel.com>

--- gst/vaapi/gstvaapivideometa_texture.c
+++ gst/vaapi/gstvaapivideometa_texture.c
@@ -96,10 +96,6 @@
             return FALSE;
         gst_vaapi_texture_unref(texture);
     }
-
-    if (!gst_vaapi_apply_composition(surface, meta->buffer))
-        GST_WARNING("could not update subtitles");
-
     return gst_vaapi_texture_put_surface(meta_texture->texture, surface,
         gst_vaapi_video_meta_get_render_flags(vmeta));
 }


sensor: small fixed to prevent rep_count overflow

--- cebit_demo/sensor/sense.c
+++ cebit_demo/sensor/sense.c
@@ -48,7 +48,7 @@

 static int16_t acc_data[6];
-static int state;
+static int state = -1;
 static int rep_count = 0;

@@ -82,7 +82,7 @@
         for (int i = 0; i < 3; i++) {
             if (acc_data[i] > AXIS_THRESHOLD || acc_data[i] < -AXIS_THRESHOLD) {
                 // printf("axis %d;  %d > %d", i, acc_data[i], AXIS_THRESHOLD);
-                if (state == i) {
+                if (state == i && rep_count < REP_LIMIT) {
                     ++rep_count;
                     // printf("inc %i\n", i);
                 } else {
@@ -95,7 +95,7 @@
     }

     if (rep_count == REP_LIMIT) {
-        ++rep_count;
+        rep_count = REP_LIMIT + 1;
         switch (state) {
             case STATE_NORMAL:
                 evt_handler_ok();


Refactoring.

Refactoring.

--- src/Application/Controller/ConfigQuorumProcessor.h
+++ src/Application/Controller/ConfigQuorumProcessor.h
@@ -3,6 +3,7 @@

 #include "Application/Common/ClusterMessage.h"
 #include "Application/Common/ClientRequest.h"
+#include "Application/Common/CatchupMessage.h"
 #include "ConfigQuorumContext.h"

 class Controller; // forward


From Axel:
this patch adds "-I path" for rmkdepend ... --
path/src.cxx. Note that "-- src.cxx" will NOT add "-I.", only
"./src.cxx" will.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@14575 27541ba8-7e3a-0410-8455-c3a389f83636

--- build/rmkdepend/main.c
+++ build/rmkdepend/main.c
@@ -165,6 +165,9 @@
 	char *defincdir = NULL;
 	char **undeflist = NULL;
 	int numundefs = 0, i;
+        char *currentFileInc = 0;
+        int bufLenCurrentFileInc = 0;
+        char *posEndPath = 0;

 	ProgramName = argv[0];

@@ -470,13 +473,30 @@
 	 * now peruse through the list of files.
 	 */
 	for(fp=filelist; *fp; fp++) {
-		filecontent = getfile(*fp);
-		ip = newinclude(*fp, (char *)NULL);
-
-		find_includes(filecontent, ip, ip, 0, FALSE);
-		freefile(filecontent);
-		recursive_pr_include(ip, ip->i_file, base_name(*fp));
-		inc_clean();
+           posEndPath = 0;
+           if (incp < includedirs + MAXDIRS) {
+              /* -I dirname(sourcefile) */
+              posEndPath = strrchr(*fp, '/');
+              if (posEndPath) {
+                 if (posEndPath - *fp >= bufLenCurrentFileInc) {
+                    if (currentFileInc) free(currentFileInc);
+                    bufLenCurrentFileInc = (posEndPath - *fp)*2;
+                    currentFileInc = malloc(bufLenCurrentFileInc);
+                 }
+                 memcpy(currentFileInc, *fp, posEndPath - *fp);
+                 currentFileInc[posEndPath - *fp] = 0;
+                 *incp++ = currentFileInc;
+              }
+           }
+
+           filecontent = getfile(*fp);
+           ip = newinclude(*fp, (char *)NULL);
+
+           find_includes(filecontent, ip, ip, 0, FALSE);
+           freefile(filecontent);
+           recursive_pr_include(ip, ip->i_file, base_name(*fp));
+           inc_clean();
+           if (posEndPath) --incp;
 	}
         if (!rootBuild) {
 	   if (printed)


[gnu] Global register should not be marked extern

--- build_send_to_reader.c
+++ build_send_to_reader.c
@@ -1,9 +1,10 @@
 #include "moo.h"
 #include "rfid.h"
 #include "mymoo.h"
-
-LOCK_REG(4, extern volatile unsigned char* dest);
-LOCK_REG(5, extern volatile unsigned short bits);
+#include "compiler.h"
+
+LOCK_REG(4, volatile unsigned char* dest);
+LOCK_REG(5, unsigned short bits);

 //
 //
@@ -32,7 +33,7 @@

   TAR = 0;
   TACCTL0 = OUTMOD2; // RESET MODE
-
+
   BCSCTL2 |= DIVM_1;

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


Actually print buffer size in this reindex log statement (#1251)

--- src/streams.h
+++ src/streams.h
@@ -510,7 +510,7 @@
             throw std::ios_base::failure("Read attempted past buffer limit");
         if (nSize + nRewind > vchBuf.size()) // What's already read + what I want to read + how far I want to rewind
         {
-            LOG(REINDEX, "Large read, growing buffer\n", nSize);
+            LOG(REINDEX, "Large read, growing buffer (size: %lld)\n", nSize);
             GrowTo(nSize + nRewind + RESIZE_EXTRA);
             if (nSize + nRewind > vchBuf.size()) // make sure it worked
                 throw std::ios_base::failure("Read larger than buffer size");


* fixed format string issues.

	* fixed format string issues.

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@7303 67ed7778-7388-44ab-90cf-0a291f65f57c

--- camlibs/barbie/library.c
+++ camlibs/barbie/library.c
@@ -163,7 +163,6 @@
 	int n1, n2, n3, n4, x, y, z;
 	unsigned char r, g, b;
 	char *s = NULL, *us = NULL, *rg = NULL;
-	char *ppmhead_t = "P6\n# test.ppm\n%i %i\n255\n";
 	char ppmhead[64];

 	if (barbie_exchange(port, cmd, cmd_size, resp, 4) != 1)
@@ -194,7 +193,7 @@
 			n4 = (unsigned char)c;
 			*size = PICTURE_SIZE(n1, n2, n3, n4);
 printf("\tn1=%i n2=%i n3=%i n4=%i size=%i\n", n1, n2 ,n3, n4, *size);
-			sprintf(ppmhead, ppmhead_t, n1-1, (n2+n3-1));
+			sprintf(ppmhead, "P6\n# test.ppm\n%i %i\n255\n", n1-1, (n2+n3-1));
 			us = (char *)malloc(sizeof(char)*(*size));
 			rg = (char *)malloc(sizeof(char)*(*size));
 			s  = (char *)malloc(sizeof(char)*(n1-1)*(n2+n3-1)*3+strlen(ppmhead));


fixed endless recursion path

fixed endless recursion path

git-svn-id: 40dd595c6684d839db675001a64203a1457e7319@11822 67ed7778-7388-44ab-90cf-0a291f65f57c

--- camlibs/konica/library.c
+++ camlibs/konica/library.c
@@ -449,8 +449,9 @@
 	image_id = atol (image_id_string);

 	/* Get information about the image */
-	C(gp_filesystem_get_info (camera->fs, folder,
-					filename, &info, context));
+	if (type == GP_FILE_TYPE_NORMAL)
+		C(gp_filesystem_get_info (camera->fs, folder,
+						filename, &info, context));

 	/*
 	 * Remove the timeout, get the image and start the timeout


coment current state

coment current state

--- camlibs/ptp2/fujiptpip.c
+++ camlibs/ptp2/fujiptpip.c
@@ -20,15 +20,26 @@
 /*
  * This is a copy of ptpip.c...
  *
- * This is working, but unfinished!
- * - Event handling not finished.
- * - Some configure checking magic missing for the special header files
- *   and functions.
- * - Not everything implementation correctly cross checked.
- * - Coolpix P3 does not give transfer status (image 000x/000y), and reports an
- *   error when transfers finish correctly.
- *
- * Nikon WU-1* adapters might use 0011223344556677 as GUID always...
+ * This is working, but might be buggy.
+ *
+ * Only the setup packet is similar to PTP/IP.
+ * The rest speaks a protocol very like to the USB Bulk protocol.
+ *
+ * <32bit length> <16 bit transfertype> <16 bit code> <32bit transaction id> <...data...>
+ *
+ *
+ * transfertype as usual:
+ * - 1: send command (with optional parameters)
+ * - 2: send data (data follows transid)
+ * - 3: response (and optional parameters)
+ * - 4: event (over event pipe)
+ *
+ * For JPEG pipe, also <length> <data...> blobs are sent. There is a 14 byte blob in front of the FF D8 start.
+ *
+ * There are 3 TCP pipes:
+ * - command pipe , port 55740
+ * - event pipe , port 55741 (camera remote port starts listen when you run "InitiateOpenCapture")
+ * - jpeg pipe , port 55742 (camera remote port starts listen when you run "InitiateOpenCapture")
  */
 #define _DEFAULT_SOURCE
 #include "config.h"


Omit pre-validating the correctness of input for floats.

When using Python's built-in string->float converters, fastnumbers
used to pre-validate that the input was OK in order to avoid the
python built-in converter from setting an exception. The rational was
that exception setting takes a long time.

There were a couple of invalid assumptions with that logic.
 - Setting an exception does not take that long, and it's certainly
   not offset by the amount of time it takes to pre-validate.
 - The float built-in can be made to not raise an exception, which
   makes pre-validation a complete waste of time.

This is still done for integers because there is no way to disable
exception generation for PyLong_FromString, and generating an exception
actually does take a long time for that function because of an
unnecessary creation of a PyUnicode object just to build the exception.

--- src/strings.c
+++ src/strings.c
@@ -63,9 +63,11 @@

 static PyObject *
-python_lib_str_to_PyFloat(const char *str, Py_ssize_t len, void *options)
-{
-    char *pend = NULL, *nend = (char *) str + len;
+python_lib_str_to_PyFloat(const char *str, Py_ssize_t len,
+                          const struct Options *options)
+{
+    char *nend = (char *) str + len;
+    char *pend = nend;
     double result = -10.0;
 #if PY_MAJOR_VERSION == 2
     /* If this is a long literal, don't include the L. */
@@ -81,12 +83,13 @@
     if (pend == nend) {
         return PyFloat_FromDouble(result);
     }
-    /* Clear error if we should not raise. */
-    if (Options_Should_Raise((const struct Options *) options)) {
-        PyErr_Clear();
-    }
-    else {
-        SET_ERR_INVALID_FLOAT((const struct Options *) options);
+    /* Set error... The above won't because pend is non-NULL. Well, that
+     * statement isn't fully true... if not even the first digit could be
+     * converted then it would raise an error, but we are protected from
+     * that because of the is_likely_float heuristic.
+     */
+    if (Options_Should_Raise(options)) {
+        SET_ERR_INVALID_FLOAT(options);
     }
     return NULL;
 }
@@ -130,17 +133,7 @@
      * Python's built-in version, otherwise use the "fast" version.
      */
     else if (float_might_overflow(str, end)) {
-        /* Building an exception takes a long time. The tiny
-         * performance hit of checking that the input is a valid
-         * float before converting to float is well worth it
-         * compared to trying and failing and then waiting for the
-         * exception to be created, only to clear it and move on.
-         */
-        if (!string_contains_float(str, end, true, true)) {
-            SET_ERR_INVALID_FLOAT(options);
-            return NULL;
-        }
-        return python_lib_str_to_PyFloat(str, real_len, (void *) options);
+        return python_lib_str_to_PyFloat(str, real_len, options);
     }
     else {
         bool error = false;
@@ -228,20 +221,22 @@
      * Python's built-in version, otherwise use the "fast" version.
      */
     else if (int_might_overflow(start, end)) {
-        PyObject *num = NULL;
-        char *pend = "\0";
-        /* Building an exception takes a long time. The tiny
-         * performance hit of checking that the input is a valid
-         * integer before converting to integer is well worth it
-         * compared to trying and failing and then waiting for the
-         * exception to be created, only to clear it and move on.
+        /* The way exception building for Python's built-in string->int
+         * conversion function is slow, because it allocates a unicode
+         * object just to put it into the traceback (rather than use the
+         * given input string, and there is no way to tell it to not
+         * build the traceback. For this reason we pre-validate to save
+         * time in the event of an error.
          */
-        if (!string_contains_int(str, end, 10)) {
+        if (string_contains_int(str, end, 10)) {
+            char *pend = end;
+            PyObject *num = python_lib_str_to_PyInt(str, &pend, 10);
+            return handle_possible_conversion_error(end, pend, num, options);
+        }
+        else {
             SET_ERR_INVALID_INT(options);
             return NULL;
         }
-        num = python_lib_str_to_PyInt(str, &pend, 10);
-        return handle_possible_conversion_error(end, pend, num, options);
     }
     else {
         bool error = false;


Minor syntax edits

Minor syntax edits

--- library/MultiRegions/ExpList.h
+++ library/MultiRegions/ExpList.h
@@ -137,9 +137,9 @@
             /// Returns the total number of local degrees of freedom
             /// \f$N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_m\f$.
             inline int GetNcoeffs(void) const;
-
-            // Returns the total number of local degrees of freedom
-            // for element eid
+
+            /// Returns the total number of local degrees of freedom
+            /// for element eid
             MULTI_REGIONS_EXPORT int GetNcoeffs(const int eid) const;

@@ -821,8 +821,9 @@
             /// \f$=N_{\mathrm{eof}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_l\f$
             int m_ncoeffs;

-            /// The total number of quadrature points. #m_npoints
-            /// \f$=Q_{\mathrm{tot}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_Q\f$
+            /** The total number of quadrature points. #m_npoints
+             *\f$=Q_{\mathrm{tot}}=\sum_{e=1}^{{N_{\mathrm{el}}}}N^{e}_Q\f$
+             **/
             int m_npoints;

             /**


*** empty log message ***

*** empty log message ***

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

--- src/chxj_chtml20.c
+++ src/chxj_chtml20.c
@@ -37,7 +37,7 @@
 static char* s_chtml20_start_a_tag      (Chtml20* chtml, Node* node);
 static char* s_chtml20_end_a_tag        (Chtml20* chtml, Node* node);
 static char* s_chtml20_start_br_tag     (Chtml20* chtml, Node* node);
-static char* chtml20_end_br_tag       (Chtml20* chtml, Node* node);
+static char* s_chtml20_end_br_tag       (Chtml20* chtml, Node* node);
 static char* chtml20_start_font_tag   (Chtml20* chtml, Node* node);
 static char* chtml20_end_font_tag     (Chtml20* chtml, Node* node);
 static char* chtml20_start_form_tag   (Chtml20* chtml, Node* node);
@@ -261,7 +261,7 @@
     {
       s_chtml20_start_br_tag  (chtml20, child);
       s_chtml20_node_exchange (chtml20, child,indent+1);
-      chtml20_end_br_tag    (chtml20, child);
+      s_chtml20_end_br_tag    (chtml20, child);
     }
     /*------------------------------------------------------------------------*/
     /* <FONT>                                                                 */
@@ -1041,7 +1041,7 @@
  * @return The conversion result is returned.
  */
 static char*
-chtml20_end_br_tag(Chtml20* chtml20, Node* child)
+s_chtml20_end_br_tag(Chtml20* chtml20, Node* child)
 {
   return chtml20->out;
 }


Fix segfault related to the random slideshow jump feature

--- src/slideshow.c
+++ src/slideshow.c
@@ -207,6 +207,7 @@
 			break;
 		case SLIDE_RAND:
 			current_file = feh_list_jump(filelist, current_file, FORWARD, rand() % filelist_len);
+			change = SLIDE_NEXT;
 			break;
 		case SLIDE_JUMP_FWD:
 			if (filelist_len < 5)
@@ -308,11 +309,12 @@
 	int len = 0;

 	D_ENTER(4);
+
 	if (!opt.title) {
 		len = strlen(PACKAGE " [slideshow mode] - ") + strlen(file->filename) + 1;
 		s = emalloc(len);
 		snprintf(s, len, PACKAGE " [%d of %d] - %s",
-			 gib_list_num(filelist, current_file) + 1, gib_list_length(filelist), file->filename);
+			gib_list_num(filelist, current_file) + 1, gib_list_length(filelist), file->filename);
 	} else {
 		s = estrdup(feh_printf(opt.title, file));
 	}


* change writting.

  * change writting.

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

--- src/chxj_chtml20.c
+++ src/chxj_chtml20.c
@@ -1150,6 +1150,7 @@
   r       = doc->r;

   chtml20->out = apr_pstrcat(r->pool, chtml20->out, "</a>", NULL);
+
   return chtml20->out;
 }


Fix other usage of the global pool for request temporaries in re_operators.c

--- apache2/re_operators.c
+++ apache2/re_operators.c
@@ -1684,7 +1684,7 @@
         return 0;
     }

-    data = apr_pcalloc(rule->ruleset->mp, var->value_len+1);
+    data = apr_pcalloc(msr->mp, var->value_len+1);

     if(data == NULL)    {
         *error_msg = "Internal Error: cannot allocate memory for data.";
@@ -1699,18 +1699,18 @@
     {
         for(i = 0; i < rv; ++i)
         {
-            match = apr_psprintf(rule->ruleset->mp, "%.*s", ovector[2*i+1] - ovector[2*i], data + ovector[2*i]);
+            match = apr_psprintf(msr->mp, "%.*s", ovector[2*i+1] - ovector[2*i], data + ovector[2*i]);

             if (match == NULL)  {
                 *error_msg = "Internal Error: cannot allocate memory for match.";
                 return -1;
             }

-            match = remove_escape(rule->ruleset->mp, match, strlen(match));
-
-            match = gsb_replace_tpath(rule->ruleset->mp, match, strlen(match));
-
-            match = gsb_reduce_char(rule->ruleset->mp, match);
+            match = remove_escape(msr->mp, match, strlen(match));
+
+            match = gsb_replace_tpath(msr->mp, match, strlen(match));
+
+            match = gsb_reduce_char(msr->mp, match);

             match_length = strlen(match);

@@ -1732,7 +1732,7 @@
                                 log_escape_nq(msr->mp, match));
                     }

-                    str = apr_pstrdup(rule->ruleset->mp,match);
+                    str = apr_pstrdup(msr->mp,match);

                     base = apr_strtok(str,"/",&savedptr);
                     if(base != NULL)
@@ -1744,7 +1744,7 @@
                 /* append / in the end of full url */
                 if ((match[match_length -1] != '/') && (strchr(match,'?') == NULL))    {

-                    canon = apr_psprintf(rule->ruleset->mp, "%s/", match);
+                    canon = apr_psprintf(msr->mp, "%s/", match);
                     if (canon != NULL)  {

                         canon_length = strlen(canon);
@@ -1757,7 +1757,7 @@
                                         log_escape_nq(msr->mp, canon));
                             }

-                            str = apr_pstrdup(rule->ruleset->mp,match);
+                            str = apr_pstrdup(msr->mp,match);

                             base = apr_strtok(str,"/",&savedptr);
                             if(base != NULL)
@@ -1770,7 +1770,7 @@

                 /* Parsing full url */

-                domain = apr_pstrdup(rule->ruleset->mp, match);
+                domain = apr_pstrdup(msr->mp, match);

                 domain_len = strlen(domain);

@@ -1785,7 +1785,7 @@

                     dot = strchr(domain,'.');
                     if(dot != NULL) {
-                        canon = apr_pstrdup(rule->ruleset->mp, domain);
+                        canon = apr_pstrdup(msr->mp, domain);

                         ret = verify_gsb(gsb, msr, canon, strlen(canon));

@@ -1796,7 +1796,7 @@
                                         log_escape_nq(msr->mp, canon));
                             }

-                            str = apr_pstrdup(rule->ruleset->mp,match);
+                            str = apr_pstrdup(msr->mp,match);

                             base = apr_strtok(str,"/",&savedptr);
                             if(base != NULL)
@@ -1818,7 +1818,7 @@
                                             log_escape_nq(msr->mp, base));
                                 }

-                                str = apr_pstrdup(rule->ruleset->mp,match);
+                                str = apr_pstrdup(msr->mp,match);

                                 base = apr_strtok(str,"/",&savedptr);
                                 if(base != NULL)
@@ -1829,13 +1829,13 @@

                         }

-                        url = apr_palloc(rule->ruleset->mp, strlen(canon));
+                        url = apr_palloc(msr->mp, strlen(canon));
                         count_slash = 0;

                         while(*canon != '\0') {
                             switch (*canon)   {
                                 case '/':
-                                    ptr = apr_psprintf(rule->ruleset->mp,"%s/",url);
+                                    ptr = apr_psprintf(msr->mp,"%s/",url);
                                     ret = verify_gsb(gsb, msr, ptr, strlen(ptr));
                                     if(ret > 0) {
                                         set_match_to_tx(msr, capture, ptr, 0);
@@ -1844,7 +1844,7 @@
                                                     log_escape_nq(msr->mp, ptr));
                                         }

-                                        str = apr_pstrdup(rule->ruleset->mp,match);
+                                        str = apr_pstrdup(msr->mp,match);

                                         base = apr_strtok(str,"/",&savedptr);
                                         if(base != NULL)
@@ -1871,7 +1871,7 @@
                 }

-                str = apr_pstrdup(rule->ruleset->mp, match);
+                str = apr_pstrdup(msr->mp, match);

                 while (*str != '\0')   {

@@ -1896,7 +1896,7 @@

                                 dot = strchr(domain,'.');
                                 if(dot != NULL) {
-                                    canon = apr_pstrdup(rule->ruleset->mp, domain);
+                                    canon = apr_pstrdup(msr->mp, domain);

                                     ret = verify_gsb(gsb, msr, canon, strlen(canon));

@@ -1906,7 +1906,7 @@
                                             *error_msg = apr_psprintf(msr->mp, "Gsb lookup for \"%s\" succeeded.",
                                                     log_escape_nq(msr->mp, canon));
                                         }
-                                        str = apr_pstrdup(rule->ruleset->mp,match);
+                                        str = apr_pstrdup(msr->mp,match);

                                         base = apr_strtok(str,"/",&savedptr);
                                         if(base != NULL)
@@ -1926,7 +1926,7 @@
                                                 *error_msg = apr_psprintf(msr->mp, "Gsb lookup for \"%s\" succeeded.",
                                                         log_escape_nq(msr->mp, base));
                                             }
-                                            str = apr_pstrdup(rule->ruleset->mp,match);
+                                            str = apr_pstrdup(msr->mp,match);

                                             base = apr_strtok(str,"/",&savedptr);
                                             if(base != NULL)
@@ -1936,13 +1936,13 @@

                                     }

-                                    url = apr_palloc(rule->ruleset->mp, strlen(canon));
+                                    url = apr_palloc(msr->mp, strlen(canon));
                                     count_slash = 0;

                                     while(*canon != '\0') {
                                         switch (*canon)   {
                                             case '/':
-                                                ptr = apr_psprintf(rule->ruleset->mp,"%s/",url);
+                                                ptr = apr_psprintf(msr->mp,"%s/",url);
                                                 ret = verify_gsb(gsb, msr, ptr, strlen(ptr));
                                                 if(ret > 0) {
                                                     set_match_to_tx(msr, capture, ptr, 0);
@@ -1950,7 +1950,7 @@
                                                         *error_msg = apr_psprintf(msr->mp, "Gsb lookup for \"%s\" succeeded.",
                                                                 log_escape_nq(msr->mp, ptr));
                                                     }
-                                                    str = apr_pstrdup(rule->ruleset->mp,match);
+                                                    str = apr_pstrdup(msr->mp,match);

                                                     base = apr_strtok(str,"/",&savedptr);
                                                     if(base != NULL)
@@ -2781,7 +2781,7 @@
     if (msr->txcfg->debuglog_level >= 4) {
         rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
         if ((rc != 0) || (jit != 1)) {
-            *error_msg = apr_psprintf(rule->ruleset->mp,
+            *error_msg = apr_psprintf(msr->mp,
                     "Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
                     "Execution error - "
                     "Does not support JIT (%d)",
@@ -3092,7 +3092,7 @@
     if (msr->txcfg->debuglog_level >= 4) {
         rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
         if ((rc != 0) || (jit != 1)) {
-            *error_msg = apr_psprintf(rule->ruleset->mp,
+            *error_msg = apr_psprintf(msr->mp,
                     "Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
                     "Execution error - "
                     "Does not support JIT (%d)",
@@ -3386,7 +3386,7 @@
     if (msr->txcfg->debuglog_level >= 4) {
         rc = msc_fullinfo(regex, PCRE_INFO_JIT, &jit);
         if ((rc != 0) || (jit != 1)) {
-            *error_msg = apr_psprintf(rule->ruleset->mp,
+            *error_msg = apr_psprintf(msr->mp,
                     "Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
                     "Execution error - "
                     "Does not support JIT (%d)",
@@ -3967,7 +3967,7 @@
 #ifdef WITH_SSDEEP
     if (fuzzy_hash_buf(var->value, var->value_len, result))
     {
-        *error_msg = apr_psprintf(rule->ruleset->mp, "Problems generating " \
+        *error_msg = apr_psprintf(msr->mp, "Problems generating " \
             "fuzzy hash.");

         return -1;
@@ -3987,7 +3987,7 @@
         chunk = chunk->next;
     }
 #else
-    *error_msg = apr_psprintf(rule->ruleset->mp, "ModSecurity was not " \
+    *error_msg = apr_psprintf(msr->mp, "ModSecurity was not " \
         "compiled with ssdeep support.");

     return -1;


* change writting.

  * change writting.

git-svn-id: 29285e03eadf944384989fddbe8eccac9818e9d7@1473 1a406e8e-add9-4483-a2c8-d8cac5b7c224

--- src/chxj_chtml20.c
+++ src/chxj_chtml20.c
@@ -2003,7 +2003,8 @@
         chtml20->out = apr_pstrcat(r->pool,
                                    chtml20->out,
                                    " align=\"",
-                                   value,"\"", NULL);
+                                   value,
+                                   "\"", NULL);
       }
       else
       if (strcasecmp(name, "alt"   ) == 0) {