intel_gt_tuchuck.c: Make sure GPIOs are set to 0 muxes

Use calloc for pinsize and set mux_total to 0 in all gpios

Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- src/x86/intel_gt_tuchuck.c
+++ src/x86/intel_gt_tuchuck.c
@@ -47,7 +47,7 @@
     b->adc_raw = 0;
     b->adc_supported = 0;

-    b->pins = (mraa_pininfo_t*) malloc(sizeof(mraa_pininfo_t) * MRAA_INTEL_GT_TUCHUCK_PINCOUNT);
+    b->pins = (mraa_pininfo_t*) calloc(MRAA_INTEL_GT_TUCHUCK_PINCOUNT, sizeof(mraa_pininfo_t));
     if (b->pins == NULL) {
         goto error;
     }
@@ -558,6 +558,7 @@
     strncpy(b->pins[pos].name, "UART1TX", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
     b->pins[pos].gpio.pinmap = 484;
+    b->pins[pos].gpio.mux_total = 0;
     b->pins[pos].uart.pinmap = 0;
     b->pins[pos].uart.parent_id = 0;
     b->pins[pos].uart.mux_total = 0;
@@ -574,6 +575,7 @@
     strncpy(b->pins[pos].name, "UART1RX", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
     b->pins[pos].gpio.pinmap = 483;
+    b->pins[pos].gpio.mux_total = 0;
     b->pins[pos].uart.pinmap = 0;
     b->pins[pos].uart.parent_id = 0;
     b->pins[pos].uart.mux_total = 0;
@@ -590,6 +592,7 @@
     strncpy(b->pins[pos].name, "UART1RT", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 1 };
     b->pins[pos].gpio.pinmap = 485;
+    b->pins[pos].gpio.mux_total = 0;
     b->pins[pos].uart.pinmap = 0;
     b->pins[pos].uart.parent_id = 0;
     b->pins[pos].uart.mux_total = 0;
@@ -598,6 +601,7 @@
     strncpy(b->pins[pos].name, "RTC_CLK", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
     b->pins[pos].gpio.pinmap = 367;
+    b->pins[pos].gpio.mux_total = 0;
     pos++;

     strncpy(b->pins[pos].name, "UART1CT", 8);
@@ -616,31 +620,37 @@
     strncpy(b->pins[pos].name, "LED100", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
     b->pins[pos].gpio.pinmap = 337;
+    b->pins[pos].gpio.mux_total = 0;
     pos++;

     strncpy(b->pins[pos].name, "LED101", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
     b->pins[pos].gpio.pinmap = 338;
+    b->pins[pos].gpio.mux_total = 0;
     pos++;

     strncpy(b->pins[pos].name, "LED102", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
     b->pins[pos].gpio.pinmap = 339;
+    b->pins[pos].gpio.mux_total = 0;
     pos++;

     strncpy(b->pins[pos].name, "LED103", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
     b->pins[pos].gpio.pinmap = 340;
+    b->pins[pos].gpio.mux_total = 0;
     pos++;

     strncpy(b->pins[pos].name, "LEDWIFI", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
     b->pins[pos].gpio.pinmap = 438;
+    b->pins[pos].gpio.mux_total = 0;
     pos++;

     strncpy(b->pins[pos].name, "LEDBT", 8);
     b->pins[pos].capabilities = (mraa_pincapabilities_t){ 1, 1, 0, 0, 0, 0, 0, 0 };
     b->pins[pos].gpio.pinmap = 439;
+    b->pins[pos].gpio.mux_total = 0;
     pos++;

     return b;


QPID: Fixed bug in timer initialization on windows

Timers would not initialize on the qpid bridge when run on windows because
the required socket interface was not properly initialized. This fix
initializes the underlying sockets so the timers will be created
correctly.

Signed-off-by: Frank Quinn <b81fea4778f144c02bf8eccb0f2c325a4dc652f4@nyx.com>

--- mama/c_cpp/src/c/bridge/qpid/bridge.c
+++ mama/c_cpp/src/c/bridge/qpid/bridge.c
@@ -91,6 +91,8 @@
 {
     mama_status         status  = MAMA_STATUS_OK;
     mamaBridgeImpl*     bridge  = (mamaBridgeImpl*) bridgeImpl;
+
+    wsocketstartup();

     if (NULL == bridgeImpl)
     {


tests: define PRI__[dux]64 macros to print __s64 and __u64 values

Rather than cast every __u64 or __s64 before printing,
define printing helpers for those types directly.

This complements commit 1f3482bedad505a41caf1d61b3a4e7e09a2f4330.

* tests/tests.h (PRI__d64, PRI__u64, PRI__x64): New macros.

--- tests/tests.h
+++ tests/tests.h
@@ -107,4 +107,24 @@
 # define SKIP_MAIN_UNDEFINED(arg) \
 	int main(void) { error_msg_and_skip("undefined: %s", arg); }

+/*
+ * The kernel used to define 64-bit types on 64-bit systems on a per-arch
+ * basis.  Some architectures would use unsigned long and others would use
+ * unsigned long long.  These types were exported as part of the
+ * kernel-userspace ABI and now must be maintained forever.  This matches
+ * what the kernel exports for each architecture so we don't need to cast
+ * every printing of __u64 or __s64 to stdint types.
+ */
+# if SIZEOF_LONG == 4
+#  define PRI__64 "ll"
+# elif defined ALPHA || defined IA64 || defined MIPS || defined POWERPC
+#  define PRI__64 "l"
+# else
+#  define PRI__64 "ll"
+# endif
+
+# define PRI__d64 PRI__64"d"
+# define PRI__u64 PRI__64"u"
+# define PRI__x64 PRI__64"x"
+
 #endif


Multiply WALLTIME with the number of processors. Let's see if that gets the
number of spurious failures back down.

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@22962 0785d39b-7218-0410-832d-ea1e28bc413d

--- tests/tests.h
+++ tests/tests.h
@@ -22,6 +22,7 @@
 #include <base/exceptions.h>
 #include <base/utilities.h>
 #include <base/thread_management.h>
+#include <base/multithread_info.h>
 #include <cmath>
 #include <fstream>
 #include <sstream>
@@ -137,7 +138,7 @@
 	    conv >> delay;
 	    if (conv)
 	      {
-		sleep (delay*4);
+		sleep (delay*multithread_info.n_cpus);
 		std::cerr << "Time's up: Killing job because it overran its allowed walltime"
 			  << std::endl;
 		std::abort ();


Code for Lego Mindstorm scanner - RobotC

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

--- Scanner.c
+++ Scanner.c
@@ -0,0 +1,134 @@
+void nextLine()
+{
+  nMotorEncoder[motorA]=0;
+  motor[motorA] = -8;
+  motor[motorC] = -8;
+  while (nMotorEncoder[motorA]>-6);//######################################
+  motor[motorA] = 0;
+  motor[motorC] = 0;
+}
+
+bool readPoint()
+{
+	if(SensorValue[S1] < 20) //if black
+		return true;
+	return false;
+}
+
+void printPoint(int row, int col, bool b)
+{
+	if(b) nxtSetPixel(row, col);
+}
+
+void donePrinting()
+{
+	motor[motorB] = 0;
+	wait1Msec(500);
+	motor[motorB] = -20;
+	while(SensorValue[S3] != 1);
+	motor[motorB] = 0;
+
+	nMotorEncoder[motorA]=0;
+	motor[motorA] = motor[motorC] = 50;
+	while (nMotorEncoder[motorA] > -360*10);//##############################
+	motor[motorA] = 0;
+	motor[motorC] = 0;
+}
+
+task main()
+{
+	//sensor setup
+	SensorType[S1] = sensorLightActive;
+	SensorType[S2] = sensorCOLORFULL;
+	SensorType[S3] = sensorTouch;
+
+	bool stopScan = false;
+	eraseDisplay();
+
+	wait1Msec(1000);
+
+  //left triangle
+	nxtDrawLine(10,20,25,30);
+	nxtDrawLine(10,20,25,10);
+	nxtDrawLine(25,10,25,30);
+  //right triangle
+	nxtDrawLine(90,20,75,30);
+	nxtDrawLine(90,20,75,10);
+	nxtDrawLine(75,10,75,30);
+  //rectangle
+	nxtDrawRect(38,30,62,10);
+  //prompts
+	nxtDisplayStringAt(3,60,"Resolution:");
+	nxtDisplayStringAt(42,45,"Low");
+	nxtDisplayStringAt(7,45,"High");
+	nxtDisplayStringAt(72,45,"Mid");
+  //get user button press for resolution
+	while (nNxtButtonPressed == -1);
+	int resolution = nNxtButtonPressed; //left; 2med. middle; 3big. right; 1small.
+	while (nNxtButtonPressed != -1);
+
+  //touch for start
+
+	eraseDisplay();
+	nxtDisplayTextLine(1, "Place paper in");
+	nxtDisplayTextLine(2, "front of the");
+	nxtDisplayTextLine(3, "wheel");
+  //color sensor read table or paper
+
+	int tableColor = SensorValue[S2];
+	while (SensorValue[S2] == tableColor);
+
+	eraseDisplay();
+
+	int color = SensorValue[S1];
+	nMotorEncoder[motorA]=0;
+	motor[motorA] = motor[motorC] = -5;
+	while (abs(SensorValue[S1] - color) <2); //##################################
+	motor[motorA] =0;
+	motor[motorC] = 0;
+
+  //take in paper a little bit more for encoder
+	nMotorEncoder[motorA]=0;
+	motor[motorA] = motor[motorC] = -5;
+	while (nMotorEncoder[motorA] > -90); //##################################
+	motor[motorA] =0;
+	motor[motorC] = 0;
+
+  //START TIMER HERE
+	timer[T1] = 0;
+
+  //take in paper at 10% power for correct distance - (100/resolution)*0.11 inches in encoder
+	for (int i=0; i<100 && (stopScan == false); i++)
+	{
+		//move row down
+		nextLine();
+
+		//sensor moves 64 pixels (each pixel is multiplier of resolution) number of degrees on the encoder
+		nMotorEncoder[motorB]=0;
+		for (int j=0; j<64 && (stopScan == false); j++)
+		{
+			while(abs(nMotorEncoder[motorB])< j*resolution*2);//#######################
+			//motor[motorB] = 0;
+
+			if (i%2.0 == 1) printPoint(i,j,readPoint());
+			if (i%2.0 == 0) printPoint(i,24*resolution-j,readPoint());
+
+			motor[motorB] = -40*(i%2.0 - 0.5);
+
+			if (nNxtButtonPressed == 3) stopScan = true;
+		}
+	}
+	//spit paper back out, get ready to scan next paper
+
+	float timeTaken = timer[T1] / 1000.0;
+	donePrinting();
+
+	//press button to end
+	while (nNxtButtonPressed == -1);
+	while (nNxtButtonPressed != -1);
+
+	eraseDisplay();
+	nxtDisplayTextLine(1, "took %f seconds",timeTaken);
+  	while (nNxtButtonPressed == -1);
+	while (nNxtButtonPressed != -1);
+}


fix atan2 when tmp4==0

fix atan2 when tmp4==0

--- unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h
+++ unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h
@@ -569,6 +569,7 @@
 atan2(const AutoDiffScalar<DerTypeA>& a, const AutoDiffScalar<DerTypeB>& b)
 {
   using std::atan2;
+  using std::max;
   typedef typename internal::traits<DerTypeA>::Scalar Scalar;
   typedef AutoDiffScalar<Matrix<Scalar,Dynamic,1> > PlainADS;
   PlainADS ret;
@@ -580,8 +581,6 @@

   if (tmp4!=0)
     ret.derivatives() = (a.derivatives() * b.value() - a.value() * b.derivatives()) * (tmp2+tmp3);
-  else
-    ret.derivatives().setZero();

   return ret;
 }


Re #5 fixing spheresld compilation on MSVC (trying to go too fast...)

--- sansmodels/src/sans/models/c_extensions/spheresld.c
+++ sansmodels/src/sans/models/c_extensions/spheresld.c
@@ -158,7 +158,6 @@

   free(fun_type);
   free(sld);
-  free(sld_im);
   free(thick_inter);
   free(thick);
   free(fun_coef);


updated include file

updated include file

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@4258 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- trunk/extension/include/wx/extension/extension.h
+++ trunk/extension/include/wx/extension/extension.h
@@ -51,6 +51,7 @@
 #include <wx/extension/toolbar.h>
 #include <wx/extension/util.h>
 #include <wx/extension/vcs.h>
+#include <wx/extension/vcscommand.h>
 #include <wx/extension/vcsentry.h>
 #include <wx/extension/version.h>
 #include <wx/extension/vi.h>


Reordered a structure; added some explicit initializers

git-svn-id: e88a1e38e13faf406e05cc89eca8dd613216f6c4@4169 434f946d-2f3d-0410-ba4c-cb9f52fb0dbf

--- trunk/libmesh/include/base/periodic_boundaries.h
+++ trunk/libmesh/include/base/periodic_boundaries.h
@@ -53,6 +53,10 @@
 	       pairedboundary;

   PeriodicBoundary() :
+    myboundary(-1),
+    pairedboundary(-1),
+    translation_vector(),
+    variable(0),
     var_set(false)
   {
   }
@@ -60,10 +64,11 @@
   ~PeriodicBoundary() {}

   PeriodicBoundary(const PeriodicBoundary & o, bool inverse = false) :
-      myboundary(o.myboundary),
-      pairedboundary(o.pairedboundary),
-      translation_vector(o.translation_vector),
-      var_set(o.var_set)
+    myboundary(o.myboundary),
+    pairedboundary(o.pairedboundary),
+    translation_vector(o.translation_vector),
+    variable(0),
+    var_set(o.var_set)
   {
     if (inverse)
     {
@@ -73,7 +78,10 @@
   }

   PeriodicBoundary(const RealVectorValue & vector) :
+    myboundary(-1),
+    pairedboundary(-1),
     translation_vector (vector),
+    variable(0),
     var_set(false)
   {
   }
@@ -103,8 +111,8 @@
   // to produce corresponding points in pairedboundary
   RealVectorValue translation_vector;

+  unsigned int variable;
   bool var_set;
-  unsigned int variable;
 };


Update timer_ticks.h

Update timer_ticks.h

Added a necessary include that had been left out

--- timer_ticks.h
+++ timer_ticks.h
@@ -2,6 +2,7 @@
 #define TIMER_TICKS_H_

 #include <avr/io.h>
+#include <avr/interrupt.h>

 // the timing resolution can go down to a couple dozen microseconds if you need it to, though
 // you'll probably have to change the prescaler from /64 to /8


Add support for the local supported commands

--- tools/pskey.c
+++ tools/pskey.c
@@ -78,8 +78,14 @@
 		err = csr_write_pskey_uint16(dd, 0x4711, pskey,
 					transient ? 0x0008 : 0x0000, value);
 	} else {
-		if (pskey == CSR_PSKEY_LOCAL_SUPPORTED_FEATURES)
+		switch (pskey) {
+		case CSR_PSKEY_LOCAL_SUPPORTED_FEATURES:
 			size = 8;
+			break;
+		case CSR_PSKEY_LOCAL_SUPPORTED_COMMANDS:
+			size = 18;
+			break;
+		}

 		if (argc != size) {
 			errno = EINVAL;
@@ -121,8 +127,14 @@

 		printf("%s: 0x%04x (%d)\n", csr_pskeytostr(pskey), value, value);
 	} else {
-		if (pskey == CSR_PSKEY_LOCAL_SUPPORTED_FEATURES)
+		switch (pskey) {
+		case CSR_PSKEY_LOCAL_SUPPORTED_FEATURES:
 			size = 8;
+			break;
+		case CSR_PSKEY_LOCAL_SUPPORTED_COMMANDS:
+			size = 18;
+			break;
+		}

 		err = csr_read_pskey_complex(dd, 0x4711, pskey, 0x0000, array, size);
 		if (err < 0)
@@ -145,6 +157,7 @@
 	{ CSR_PSKEY_ENC_KEY_LMIN,             CSR_TYPE_UINT16, "keymin"   },
 	{ CSR_PSKEY_ENC_KEY_LMAX,             CSR_TYPE_UINT16, "keymax"   },
 	{ CSR_PSKEY_LOCAL_SUPPORTED_FEATURES, CSR_TYPE_ARRAY,  "features" },
+	{ CSR_PSKEY_LOCAL_SUPPORTED_COMMANDS, CSR_TYPE_ARRAY,  "commands" },
 	{ CSR_PSKEY_HCI_LMP_LOCAL_VERSION,    CSR_TYPE_UINT16, "version"  },
 	{ CSR_PSKEY_LMP_REMOTE_VERSION,       CSR_TYPE_UINT8,  "remver"   },
 	{ CSR_PSKEY_HOSTIO_USE_HCI_EXTN,      CSR_TYPE_UINT16, "hciextn"  },


query: Add -c option to show column names in result table

- Add -c option which prints column names at the top of the result table
if any results are printed

--- tools/query.c
+++ tools/query.c
@@ -15,6 +15,7 @@
 static unsigned param_length[MAX_PARAMS];  /* zero if not blob */
 static char *attached_names[MAX_ATTACHED];
 static char *attached_files[MAX_ATTACHED];
+static int show_col_names;
 static int num_params;
 static int used_params;
 static int num_attached;
@@ -132,6 +133,20 @@
 bad:
 	sqlite3_finalize(stmt);
 	return -1;
+}
+
+static void handle_col_names(sqlite3_stmt *stmt)
+{
+	int i;
+	int count=sqlite3_column_count(stmt);
+
+	for (i=0; i<count; i++) {
+		if (i)
+			fprintf(tmp, "|");
+		fprintf(tmp, "%s", sqlite3_column_name(stmt, i));
+	}
+	if (count)
+		fprintf(tmp, "\n");
 }

 static void handle_row(sqlite3_stmt *stmt)
@@ -170,6 +185,7 @@
 	int ret;
 	int i;
 	int count;
+	int did_cols;

 	used_params=0;
 	for (query=str; *query; ) {
@@ -201,8 +217,13 @@
 			}
 			used_params++;
 		}
+		did_cols=0;
 		while ((ret=sqlite3_step(stmt)) != SQLITE_DONE) {
 			if (ret == SQLITE_ROW) {
+				if (show_col_names && !did_cols) {
+					did_cols=1;
+					handle_col_names(stmt);
+				}
 				handle_row(stmt);
 			} else {
 				if (ret != SQLITE_BUSY)
@@ -286,6 +307,7 @@
 {
 	fprintf(stderr, "Usage: %s [flags] database query\n", argv0);
 	fprintf(stderr, "\t-a name:file - attach database\n");
+	fprintf(stderr, "\t-c - print column names\n");
 	fprintf(stderr, "\t-p param - statement parameter\n");
 	fprintf(stderr, "\t-b param - blob parameter in hex\n");
 	exit(2);
@@ -296,7 +318,7 @@
 	int opt;
 	char *cp;

-	while ((opt=getopt(argc, argv, "a:b:p:")) != -1) {
+	while ((opt=getopt(argc, argv, "a:b:p:c")) != -1) {
 		switch (opt) {
 		case '?':
 			usage(argv[0]);
@@ -324,6 +346,9 @@
 			attached_files[num_attached]=cp+1;
 			num_attached++;
 			break;
+		case 'c':
+			show_col_names=1;
+			break;
 		}
 	}
 	if (optind != argc - 2)


Clean up syslogging

Clean up syslogging

--- simvacation.c
+++ simvacation.c
@@ -209,14 +209,14 @@
      * Open ldap connection and bind
      */
     if (( ld = ldap_open( ldap_host, ldap_port )) == NULL ) {
-	syslog( LOG_INFO, "ldap_open failed" );
+	syslog( LOG_INFO, "ldap: ldap_open failed" );
 	myexit( NULL, EX_TEMPFAIL ); /* Try again later */
     }

     if (( rc = ldap_simple_bind_s( ld, BIND_DN, BIND_METHOD ))
 		 != LDAP_SUCCESS ) {
 	ldap_get_option ( ld, LDAP_OPT_ERROR_STRING, &errmsgptr) ;
-	syslog( LOG_ALERT, "ldap_simple_bind failed: %s", errmsgptr);
+	syslog( LOG_ALERT, "ldap: ldap_simple_bind failed: %s", errmsgptr);
 	free (errmsgptr);
 	myexit( NULL, EX_TEMPFAIL ); /* Try again later */
     }
@@ -244,16 +244,16 @@
 	rval = 0;	/* permanent errors */
     }
     if ( rc != LDAP_SUCCESS ) {
-	syslog( LOG_ALERT, "error in ldap_search: %s", ldap_err2string( rc ));
+	syslog( LOG_ALERT, "ldap: ldap_search failed: %s", ldap_err2string( rc ));
 	myexit( NULL, rval );
     }

     matches = ldap_count_entries( ld, result );
     if ( matches > 1 ) {
-	syslog( LOG_ALERT, "ambiguous: %s", rcpt );
+	syslog( LOG_ALERT, "ldap: multiple matches for %s", rcpt );
 	myexit( NULL, 0 );
     } else if ( matches == 0 ) {
-	syslog( LOG_ALERT, "no match for %s", rcpt );
+	syslog( LOG_ALERT, "ldap: no match for %s", rcpt );
 	myexit( NULL, 0 );
     } else {
 	e = ldap_first_entry( ld, result );
@@ -268,7 +268,7 @@
 	     * XXX why were we invoked if user is not
 	     * on vacation??? syslog it
 	     */
-	    syslog( LOG_ALERT, "user %s not on vacation", rcpt );
+	    syslog( LOG_ALERT, "ldap: user %s is not on vacation", rcpt );
 	    myexit(NULL, 0);
 	}
     }
@@ -283,7 +283,7 @@
     ** Create the database handle and Open the db
     */
     if ((rc = db_create( &dbp, NULL, 0)) != 0) {
-        syslog( LOG_ALERT,  "db_create: %s\n", db_strerror(rc));
+        syslog( LOG_ALERT,  "bdb: db_create: %s", db_strerror(rc));
 	myexit( NULL, 0);
     }

@@ -308,7 +308,7 @@
 			DB_CREATE,      /* Create db if it doesn't exist */
 			0664)) != 0) {
 	dbp->err(dbp, rc, "%s: open", vdbpath);
-	syslog( LOG_ALERT, "%s: %s\n", vdbpath, strerror( errno ));
+	syslog( LOG_ALERT, "bdb: %s: %s\n", vdbpath, strerror( errno ));
 	myexit( dbp, 0 );
     }
     dbp->set_errpfx( dbp, "");
@@ -344,10 +344,10 @@
 	setreply( dbp );
 	sprintf(rcptstr, "%s@%s", rcpt, DOMAIN);
 	sendmessage( rcptstr, vacmsgs );
-	syslog( LOG_DEBUG, "sent message for %s to %s from %s",
+	syslog( LOG_DEBUG, "mail: sent message for %s to %s from %s",
 			rcpt, from, rcptstr );
     } else {
-	syslog( LOG_DEBUG, "suppressed message for %s to %s",
+	syslog( LOG_DEBUG, "mail: suppressed message for %s to %s",
 		rcpt, from );
     }
     dbp->close(dbp, 0);
@@ -401,7 +401,7 @@
                 break;
             }
             if ( strncasecmp( p, "no", 2 ) != 0 ) {
-                syslog( LOG_DEBUG, "Ignoring message due to header %s", buf );
+                syslog( LOG_DEBUG, "readheaders: suppressing message: %s", buf );
                 myexit( dbp, 0 );
             }
         }
@@ -416,7 +416,7 @@
              *  with a List-* field [RFC2369].
              */
             state = HEADER_NOREPLY;
-            syslog( LOG_DEBUG, "Ignoring message due to header %s", buf );
+            syslog( LOG_DEBUG, "readheaders: suppressing message: %s", buf );
             myexit( dbp, 0 );
         }
         else if ( strncasecmp( buf, "Precedence", 10 ) == 0 ) {
@@ -442,8 +442,7 @@
                 if ( strncasecmp( p, "junk", 4 ) == 0 ||
                      strncasecmp( p, "bulk", 4 ) == 0 ||
                      strncasecmp( p, "list", 4 ) == 0 ) {
-                    syslog( LOG_DEBUG, "Ignoring Precedence %s from %s",
-                            p, from );
+                    syslog( LOG_DEBUG, "readheaders: suppressing message: precedence %s", p );
                     myexit( dbp, 0 );
                 }
             }
@@ -481,7 +480,7 @@
              */
             state = HEADER_NOREPLY;
             if ( nsearch( "OOF", buf ) || nsearch( "All", buf )) {
-                syslog( LOG_DEBUG, "Ignoring message due to header %s", buf );
+                syslog( LOG_DEBUG, "readheaders: suppressing message: %s", buf );
                 myexit( dbp, 0 );
             }
         }
@@ -545,19 +544,20 @@
 	}
     }

+    if ( !*from ) {
+        syslog( LOG_NOTICE, "readheaders: skipping message: unknown sender" );
+        myexit( dbp, 0 );
+    }
+
+    syslog( LOG_DEBUG, "readheaders: mail from %s", from );
+
     if ( !tome ) {
-	syslog( LOG_DEBUG, "Mail from \"%s\" not to user \"%s\"",
-			*from ? from : "(unknown)", dn );
+	syslog( LOG_NOTICE, "readheaders: suppressing message: mail does not appear to be to user %s", dn );
 	myexit( dbp, 0 );
     }

-    if ( !*from ) {
-	syslog( LOG_NOTICE, "Unknown sender. No -f or \"From\" line" );
-	myexit( dbp, 0 );
-    }
-
     if ( check_from()) {
-        syslog( LOG_NOTICE, "Not replying to sender \"%s\"", from );
+        syslog( LOG_NOTICE, "readheaders: suppressing message: bad sender %s", from );
         myexit( dbp, 0 );
     }

@@ -718,7 +718,7 @@
     data.size = sizeof( interval );
     rc = dbp->put(dbp, NULL, &key, &data, (u_int32_t) 0); /* allow overwrites */
     if (rc != 0) {
-	syslog( LOG_ALERT, "DB Error while putting interval: %d, %s",
+	syslog( LOG_ALERT, "bdb: error while putting interval: %d, %s",
 		rc, db_strerror(rc) );
     }
     return (rc);
@@ -746,7 +746,7 @@
     data.size = sizeof( now );
     rc = dbp->put(dbp, NULL, &key, &data, 0);  /* allow overwrites */
     if (rc != 0) {
-	syslog( LOG_ALERT, "DB Error while putting reply time: %d, %s",
+	syslog( LOG_ALERT, "bdb: error while putting reply time: %d, %s",
 		rc, db_strerror(rc) );
     }

@@ -778,7 +778,7 @@
 #endif

     if (( pexecv( _PATH_SENDMAIL, nargv )) == -1 ) {
-	syslog( LOG_ERR, "pexecv of %s failed", _PATH_SENDMAIL );
+	syslog( LOG_ERR, "mail: pexecv of %s failed", _PATH_SENDMAIL );
 	return( EX_TEMPFAIL );
     }
     /*
@@ -881,6 +881,7 @@
     void
 usage( char * progname)
 {
+    /* FIXME: wth? */
     syslog(LOG_NOTICE, "uid %u: usage: %s login\n", getuid(), progname);
     myexit( NULL, 0 );
 }
@@ -915,7 +916,7 @@
     void
 bdb_err_log ( const DB_ENV * dbenv, const char *errpfx, const char *msg )
 {
-    syslog( LOG_ALERT, "%s: %s", errpfx, msg);
+    syslog( LOG_ALERT, "bdb: %s: %s", errpfx, msg);
     return;
 }


adding new attribute

adding new attribute

--- siqs/qsieve.h
+++ siqs/qsieve.h
@@ -43,7 +43,7 @@
 #endif

-#define QS_DEBUG 0
+#define QS_DEBUG 128

 typedef struct prime_t
 {
@@ -101,6 +101,7 @@
    int * sqrts;            /* square roots of kn mod factor base primes */

    slong small_primes;     /* number of primes to not sieve with */
+   slong second_prime;
    slong sieve_size;       /* size of sieve to use */

    unsigned char sieve_bits;  /* sieve threshold */


strbuf_test check gets doesn't return NULL

--- strbuf_test.c
+++ strbuf_test.c
@@ -368,10 +368,10 @@
   st1->len = st2->len = st3->len = st4->len = 0;

   // gets
-  fgets2(file1, st1->text, st1->size);
-  fgets_buf(file2, fbuf, st2->text, (int)st2->size);
-  gzgets2(gzfile1, st3->text, st3->size);
-  gzgets_buf(gzfile2, gzbuf, st4->text, (int)st4->size);
+  ASSERT(fgets2(file1, st1->text, st1->size) != NULL);
+  ASSERT(fgets_buf(file2, fbuf, st2->text, (int)st2->size) != NULL);
+  ASSERT(gzgets2(gzfile1, st3->text, st3->size) != NULL);
+  ASSERT(gzgets_buf(gzfile2, gzbuf, st4->text, (int)st4->size) != NULL);

   ASSERT(strcmp(st1->text, "That's all folks!") == 0);
   ASSERT(strcmp(st2->text, "That's all folks!") == 0);


Associate the device to a stage on touch events

Just like we do for crossing events, we need to update the stage pointer
inside ClutterInputDevice on TOUCH_BEGIN and TOUCH_END.

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

--- clutter/clutter-main.c
+++ clutter/clutter-main.c
@@ -2678,7 +2678,10 @@
             clutter_event_get_event_sequence (event);

           if (event->type == CLUTTER_TOUCH_BEGIN)
-            _clutter_input_device_add_sequence (device, sequence);
+            {
+              _clutter_stage_add_device (CLUTTER_STAGE (stage), device);
+              _clutter_input_device_add_sequence (device, sequence);
+            }

           clutter_event_get_coords (event, &x, &y);

@@ -2713,7 +2716,10 @@
           emit_touch_event (event, device);

           if (event->type == CLUTTER_TOUCH_END)
-            _clutter_input_device_remove_sequence (device, sequence);
+            {
+              _clutter_stage_remove_device (CLUTTER_STAGE (stage), device);
+              _clutter_input_device_remove_sequence (device, sequence);
+            }

           break;
         }


events: Fix and improve some touch events debug notes

--- clutter/clutter-main.c
+++ clutter/clutter-main.c
@@ -2706,9 +2706,9 @@
                 {
                   CLUTTER_NOTE (EVENT,
                                 "Touch %s off stage received at %.2f, %.2f",
-                                event->type == CLUTTER_TOUCH_UPDATE ? "Touch update" :
-                                event->type == CLUTTER_TOUCH_END ? "Touch end" :
-                                event->type == CLUTTER_TOUCH_CANCEL ? "Touch cancel" :
+                                event->type == CLUTTER_TOUCH_UPDATE ? "update" :
+                                event->type == CLUTTER_TOUCH_END ? "end" :
+                                event->type == CLUTTER_TOUCH_CANCEL ? "cancel" :
                                 "?", x, y);

                   event->touch.source = stage;
@@ -2724,9 +2724,13 @@
               if (device != NULL)
                 actor = _clutter_input_device_update (device, sequence, TRUE);
               else
-                actor = _clutter_stage_do_pick (CLUTTER_STAGE (stage),
-                                                x, y,
-                                                CLUTTER_PICK_REACTIVE);
+                {
+                  CLUTTER_NOTE (EVENT, "No device found: picking");
+
+                  actor = _clutter_stage_do_pick (CLUTTER_STAGE (stage),
+                                                  x, y,
+                                                  CLUTTER_PICK_REACTIVE);
+                }

               if (actor == NULL)
                 break;
@@ -2784,7 +2788,7 @@
   stage = CLUTTER_ACTOR (event->any.stage);
   if (stage == NULL)
     {
-      CLUTTER_NOTE (EVENT, "Discarding event withou a stage set");
+      CLUTTER_NOTE (EVENT, "Discarding event without a stage set");
       return;
     }


text: Fix the implementation of delete_chars()

The internal delete_text() implementation takes a start and an end
position, whereas the public delete_chars() method takes a number of
characters to delete starting from the current cursor position.

--- clutter/clutter-text.c
+++ clutter/clutter-text.c
@@ -6040,7 +6040,7 @@

   priv = self->priv;

-  clutter_text_real_delete_text (self, priv->position, n_chars);
+  clutter_text_real_delete_text (self, priv->position, priv->position + n_chars);

   if (priv->position > 0)
     clutter_text_set_cursor_position (self, priv->position - n_chars);


[text] Don't interpret the unicode value when the control modifier is on

When a letter key is pressed with the control key held down one of
three things will happen :-

a) If the stage is embedded within a GtkClutterEmbed the unicode value
   will be filled from gdk_keyval_to_unicode. This will be the same
   value as if control was not pressed (so Ctrl+V will be 'v').

b) If the stage is not in a GtkClutterEmbed and Clutter is running on
   the X11 backend then it will try to fill in the unicode value from
   XLookupString. This *will* take into account the control so the
   unicode value will represent a control character (Ctrl+V will be
   '\x16').

c) Most other backends will not bother to fill in the unicode
   value. Therefore clutter_keysym_to_unicode will be used which also
   does not take into account the control key (so Ctrl+V will be 'v').

For cut and paste to work in Nbtk, the control keys need to bubble up
to the parent NbtkEntry container. This works fine for 'b' but not 'a'
and 'c'.

This patch makes ClutterText always allow the event to bubble if the
key is not handled by the binding pool and the control modifier is
down.

Ideally ClutterText would always get a unicode value that takes into
account the modifiers but this is probably best left up to the input
methods.

Backport from master:

  99437c476136ec6a735270efd8670efcd1f2c77e

Signed-off-by: Emmanuele Bassi <049ee2061f71220e5aaf33f5be422fc2a2b06a44@linux.intel.com>

--- clutter/clutter-text.c
+++ clutter/clutter-text.c
@@ -1312,7 +1312,8 @@
    */
   if (res)
     return TRUE;
-  else
+  /* Skip keys when control is pressed */
+  else if ((event->modifier_state & CLUTTER_CONTROL_MASK) == 0)
     {
       gunichar key_unichar;


[text] Allow key navigation by word

[text] Allow key navigation by word

When pressing Ctrl with the left and right arrow keys we should
skip to (or select until) the previous and next word, respectively.

Fixes bug:

  http://bugzilla.openedhand.com/show_bug.cgi?id=1713

--- clutter/clutter-text.c
+++ clutter/clutter-text.c
@@ -1049,7 +1049,7 @@

       pango_layout_get_log_attrs (layout, &log_attrs, &n_attrs);

-      retval = start - 1;
+      retval = start;
       while (retval > 0 && !log_attrs[retval].is_word_end)
         retval += 1;

@@ -1577,16 +1577,29 @@
 {
   ClutterTextPrivate *priv = self->priv;
   gint pos = priv->position;
+  gint new_pos = 0;
   gint len;

   len = priv->n_chars;

   if (pos != 0 && len != 0)
     {
-      if (pos == -1)
-        clutter_text_set_cursor_position (self, len - 1);
+      if (modifiers & CLUTTER_CONTROL_MASK)
+        {
+          if (pos == -1)
+            new_pos = clutter_text_move_word_backward (self, len - 1);
+          else
+            new_pos = clutter_text_move_word_backward (self, pos - 1);
+        }
       else
-        clutter_text_set_cursor_position (self, pos - 1);
+        {
+          if (pos == -1)
+            new_pos = len - 1;
+          else
+            new_pos = pos - 1;
+        }
+
+      clutter_text_set_cursor_position (self, new_pos);
     }

   if (!(priv->selectable && (modifiers & CLUTTER_SHIFT_MASK)))
@@ -1603,14 +1616,25 @@
 {
   ClutterTextPrivate *priv = self->priv;
   gint pos = priv->position;
+  gint new_pos;
   gint len;

   len = priv->n_chars;

   if (pos != -1 && len !=0)
     {
-      if (pos != len)
-        clutter_text_set_cursor_position (self, pos + 1);
+      if (modifiers & CLUTTER_CONTROL_MASK)
+        {
+          if (pos != len)
+            new_pos = clutter_text_move_word_forward (self, pos + 1);
+        }
+      else
+        {
+          if (pos != len)
+            new_pos = pos + 1;
+        }
+
+      clutter_text_set_cursor_position (self, new_pos);
     }

   if (!(priv->selectable && (modifiers & CLUTTER_SHIFT_MASK)))
@@ -1838,19 +1862,37 @@
 }

 static inline void
-clutter_text_add_move_binding (ClutterBindingPool *pool,
-                               const gchar        *action,
-                               guint               key_val,
-                               GCallback           callback)
+clutter_text_add_move_binding (ClutterBindingPool  *pool,
+                               const gchar         *action,
+                               guint                key_val,
+                               ClutterModifierType  additional_modifiers,
+                               GCallback            callback)
 {
   clutter_binding_pool_install_action (pool, action,
-                                       key_val, 0,
+                                       key_val,
+                                       0,
                                        callback,
                                        NULL, NULL);
   clutter_binding_pool_install_action (pool, action,
-                                       key_val, CLUTTER_SHIFT_MASK,
+                                       key_val,
+                                       CLUTTER_SHIFT_MASK,
                                        callback,
                                        NULL, NULL);
+
+  if (additional_modifiers != 0)
+    {
+      clutter_binding_pool_install_action (pool, action,
+                                           key_val,
+                                           additional_modifiers,
+                                           callback,
+                                           NULL, NULL);
+      clutter_binding_pool_install_action (pool, action,
+                                           key_val,
+                                           CLUTTER_SHIFT_MASK |
+                                             additional_modifiers,
+                                           callback,
+                                           NULL, NULL);
+    }
 }

 static void
@@ -2305,44 +2347,44 @@
   binding_pool = clutter_binding_pool_get_for_class (klass);

   clutter_text_add_move_binding (binding_pool, "move-left",
-                                 CLUTTER_Left,
+                                 CLUTTER_Left, CLUTTER_CONTROL_MASK,
                                  G_CALLBACK (clutter_text_real_move_left));
   clutter_text_add_move_binding (binding_pool, "move-left",
-                                 CLUTTER_KP_Left,
+                                 CLUTTER_KP_Left, CLUTTER_CONTROL_MASK,
                                  G_CALLBACK (clutter_text_real_move_left));
   clutter_text_add_move_binding (binding_pool, "move-right",
-                                 CLUTTER_Right,
+                                 CLUTTER_Right, CLUTTER_CONTROL_MASK,
                                  G_CALLBACK (clutter_text_real_move_right));
   clutter_text_add_move_binding (binding_pool, "move-right",
-                                 CLUTTER_KP_Right,
+                                 CLUTTER_KP_Right, CLUTTER_CONTROL_MASK,
                                  G_CALLBACK (clutter_text_real_move_right));
   clutter_text_add_move_binding (binding_pool, "move-up",
-                                 CLUTTER_Up,
+                                 CLUTTER_Up, 0,
                                  G_CALLBACK (clutter_text_real_move_up));
   clutter_text_add_move_binding (binding_pool, "move-up",
-                                 CLUTTER_KP_Up,
+                                 CLUTTER_KP_Up, 0,
                                  G_CALLBACK (clutter_text_real_move_up));
   clutter_text_add_move_binding (binding_pool, "move-down",
-                                 CLUTTER_Down,
+                                 CLUTTER_Down, 0,
                                  G_CALLBACK (clutter_text_real_move_down));
   clutter_text_add_move_binding (binding_pool, "move-down",
-                                 CLUTTER_KP_Down,
+                                 CLUTTER_KP_Down, 0,
                                  G_CALLBACK (clutter_text_real_move_down));

   clutter_text_add_move_binding (binding_pool, "line-start",
-                                 CLUTTER_Home,
+                                 CLUTTER_Home, 0,
                                  G_CALLBACK (clutter_text_real_line_start));
   clutter_text_add_move_binding (binding_pool, "line-start",
-                                 CLUTTER_KP_Home,
+                                 CLUTTER_KP_Home, 0,
                                  G_CALLBACK (clutter_text_real_line_start));
   clutter_text_add_move_binding (binding_pool, "line-start",
-                                 CLUTTER_Begin,
+                                 CLUTTER_Begin, 0,
                                  G_CALLBACK (clutter_text_real_line_start));
   clutter_text_add_move_binding (binding_pool, "line-end",
-                                 CLUTTER_End,
+                                 CLUTTER_End, 0,
                                  G_CALLBACK (clutter_text_real_line_end));
   clutter_text_add_move_binding (binding_pool, "line-end",
-                                 CLUTTER_KP_End,
+                                 CLUTTER_KP_End, 0,
                                  G_CALLBACK (clutter_text_real_line_end));

   clutter_binding_pool_install_action (binding_pool, "select-all",


Refactored some repetitive code

Refactored some repetitive code


gl: Fix encryption options in PDF save dialog.

Check pdf_can_be_saved_incrementally before setting do_incremental.

Don't reset the password fields each time through the event loop.

--- platform/gl/gl-annotate.c
+++ platform/gl/gl-annotate.c
@@ -29,14 +29,15 @@
 static void init_save_pdf_options(void)
 {
 	save_opts = pdf_default_write_options;
-	save_opts = pdf_default_write_options;
 	if (pdf->redacted)
 		save_opts.do_garbage = 1;
-	else
+	if (pdf_can_be_saved_incrementally(ctx, pdf))
 		save_opts.do_incremental = 1;
 	save_opts.do_compress = 1;
 	save_opts.do_compress_images = 1;
 	save_opts.do_compress_fonts = 1;
+	ui_input_init(&opwinput, "");
+	ui_input_init(&upwinput, "");
 }

 static const char *cryptalgo_names[] = {
@@ -59,17 +60,17 @@

 	if (pdf_can_be_saved_incrementally(ctx, pdf))
 		ui_checkbox("Incremental", &save_opts.do_incremental);
+
 	fz_try(ctx)
 	{
 		if (pdf_count_signatures(ctx, pdf))
-		{
 			ui_label("WARNING: Saving non-incrementally will break existing signatures");
-		}
 	}
 	fz_catch(ctx)
 	{
 		/* Ignore the error. */
 	}
+
 	ui_spacer();
 	ui_checkbox("Pretty-print", &save_opts.do_pretty);
 	ui_checkbox("Ascii", &save_opts.do_ascii);
@@ -77,6 +78,7 @@
 	ui_checkbox("Compress", &save_opts.do_compress);
 	ui_checkbox("Compress images", &save_opts.do_compress_images);
 	ui_checkbox("Compress fonts", &save_opts.do_compress_fonts);
+
 	if (save_opts.do_incremental)
 	{
 		save_opts.do_garbage = 0;
@@ -114,9 +116,6 @@

 static void do_save_pdf_dialog(int for_signing)
 {
-	ui_input_init(&opwinput, "");
-	ui_input_init(&upwinput, "");
-
 	if (ui_save_file(save_filename, save_pdf_options,
 			for_signing ?
 			"Select where to save the signed document:" :


msm_shared: Fix to pass the valid address to invalidate cache.

We are trying to flush the cache from 0xe000000 + len
 (length as 128,256,512 and 1024).
But here we are not passing 0xe000000 + 256, 0xe0000000 + 512,
0xe000000 + 1024 and so on.

CRs-Fixed: 564142
Change-Id: I78155506573feca0a4e751c219c9fd993a7962a3

--- platform/msm_shared/scm.c
+++ platform/msm_shared/scm.c
@@ -293,7 +293,7 @@

 			parse_req.md_len *= MULTIPLICATION_FACTOR;

-			arch_clean_invalidate_cache_range((addr_t) *(img_ptr + prev_len),
+			arch_clean_invalidate_cache_range((addr_t) (*img_ptr + prev_len),
 		                                         (parse_req.md_len - prev_len) );

 			continue;


astbmc: Use firmware FRU ID from the device tree

Rather than using the hardcoded FRU ID, parse it from the device tree.

Signed-off-by: Jeremy Kerr <68a658b44bbaefab3ef5cd231967195fc0ff9d69@ozlabs.org>

--- platforms/astbmc/common.c
+++ platforms/astbmc/common.c
@@ -88,6 +88,25 @@

 }

+static int astbmc_fru_init(void)
+{
+	const struct dt_property *prop;
+	struct dt_node *node;
+	uint8_t fru_id;
+
+	node = dt_find_by_path(dt_root, "bmc");
+	if (!node)
+		return -1;
+
+	prop = dt_find_property(node, "firmware-fru-id");
+	if (!prop)
+		return -1;
+
+	fru_id = dt_property_get_cell(prop, 0) & 0xff;
+	ipmi_fru_init(fru_id);
+	return 0;
+}
+

 void astbmc_init(void)
 {
@@ -99,7 +118,7 @@
 	ipmi_wdt_init();
 	ipmi_rtc_init();
 	ipmi_opal_init();
-	ipmi_fru_init(0x01);
+	astbmc_fru_init();
 	elog_init();
 	ipmi_sensor_init();


config: apply input type configs on reload

When making the reload validation improvements, I forgot that input type
configs are stored in a separate list. This makes it so input type
configs are correctly applied on reload.

--- sway/config.c
+++ sway/config.c
@@ -529,6 +529,11 @@
 			input_manager_apply_input_config(config->input_configs->items[i]);
 		}

+		for (int i = 0; i < config->input_type_configs->length; i++) {
+			input_manager_apply_input_config(
+					config->input_type_configs->items[i]);
+		}
+
 		for (int i = 0; i < config->seat_configs->length; i++) {
 			input_manager_apply_seat_config(config->seat_configs->items[i]);
 		}


Skip line continuation when it is a comment

Currently commented lines ending in the backslash character will be
concatenated with the following line.

```
 # with this comment \
exec swaynag -m 'will not run'
```

This change modifies `getline_with_cont` to stop reading when the
initial character is a '#'.

--- sway/config.c
+++ sway/config.c
@@ -677,7 +677,7 @@
 	size_t next_line_size = 0;
 	ssize_t nread = getline(lineptr, line_size, file);
 	*nlines = nread == -1 ? 0 : 1;
-	while (nread >= 2 && strcmp(&(*lineptr)[nread - 2], "\\\n") == 0) {
+	while (nread >= 2 && strcmp(&(*lineptr)[nread - 2], "\\\n") == 0 && (*lineptr)[0] != '#') {
 		ssize_t next_nread = getline(&next_line, &next_line_size, file);
 		if (next_nread == -1) {
 			break;


sway/config.c: Change to the useful free_cmd_results helper method

--- sway/config.c
+++ sway/config.c
@@ -536,8 +536,7 @@
 		default:;
 		}
 		free(line);
-		free(res->input);
-		free(res);
+		free_cmd_results(res);
 	}

 	return success;


config: do not reset pos when braces found

When a brace is found, the config file should not seek back to before
the brace, otherwise the brace will be read multiple times.

--- sway/config.c
+++ sway/config.c
@@ -613,7 +613,9 @@
 		}
 	}
 	free(line);
-	fseek(file, pos, SEEK_SET);
+	if (ret == 0) {
+		fseek(file, pos, SEEK_SET);
+	}
 	return ret;
 }


sway/config.c: config_home is the result of a malloc but was never freed

--- sway/config.c
+++ sway/config.c
@@ -267,6 +267,7 @@
 		strcpy(config_home, home);
 		strcat(config_home, "/.config");
 		setenv("XDG_CONFIG_HOME", config_home, 1);
+		free(config_home);
 		sway_log(L_DEBUG, "Set XDG_CONFIG_HOME to %s", config_home);
 	}


fix compile failed.

fix compile failed.

--- swoole_http.c
+++ swoole_http.c
@@ -810,6 +810,10 @@

 static int multipart_body_end(multipart_parser* p)
 {
+#if PHP_MAJOR_VERSION < 7
+    TSRMLS_FETCH_FROM_CTX(sw_thread_ctx ? sw_thread_ctx : NULL);
+#endif
+
     swoole_http_client *client = (swoole_http_client *) p->data;
     zval *files = client->request.zfiles;
     zval *value;
@@ -818,14 +822,16 @@

     SW_HASHTABLE_FOREACH_START(Z_ARRVAL_P(client->request.zfiles), value)
     {
-
         zval *file_path;
-        zend_string *tmp_name;
         if (sw_zend_hash_find(Z_ARRVAL_P(value), ZEND_STRS("tmp_name"), (void **) &file_path) == SUCCESS)
         {
-            tmp_name = zval_get_string(file_path);
+#if PHP_MAJOR_VERSION >= 7
+            zend_string *tmp_name = zval_get_string(file_path);
             zend_hash_add_ptr(SG(rfc1867_uploaded_files), tmp_name, tmp_name);
-
+#else
+            char *temp_filename = Z_STRVAL_P(file_path);
+            sw_zend_hash_add(SG(rfc1867_uploaded_files), temp_filename, Z_STRLEN_P(file_path) + 1, &temp_filename, sizeof(char *), NULL);
+#endif
         }
     }
     SW_HASHTABLE_FOREACH_END();
@@ -1232,7 +1238,6 @@
         SW_HASHTABLE_FOREACH_START(Z_ARRVAL_P(zfiles), value)
         {
             keytype = sw_zend_hash_get_current_key(Z_ARRVAL_P(zfiles), &key, &keylen, 0);
-
             if (HASH_KEY_IS_STRING != keytype)
             {
                 continue;
@@ -1241,14 +1246,13 @@
             if (sw_zend_hash_find(Z_ARRVAL_P(value), ZEND_STRS("tmp_name"), (void **) &file_path) == SUCCESS)
             {
                 unlink(Z_STRVAL_P(file_path));
+                sw_zend_hash_del(SG(rfc1867_uploaded_files), Z_STRVAL_P(file_path), Z_STRLEN_P(file_path) + 1);
             }
             sw_zval_ptr_dtor(&value);
         }
         SW_HASHTABLE_FOREACH_END();

         sw_zval_ptr_dtor(&zfiles);
-
-        destroy_uploaded_files_hash();
     }
     //request server info
     if (req->zserver)
@@ -1488,6 +1492,10 @@

     serv->ptr2 = getThis();

+    //for is_uploaded_file and move_uploaded_file
+    ALLOC_HASHTABLE(SG(rfc1867_uploaded_files));
+    zend_hash_init(SG(rfc1867_uploaded_files), 8, NULL, NULL, 0);
+
     ret = swServer_create(serv);
     if (ret < 0)
     {


MSG_CARD_USED

--- codecan/codecan/Plug.h
+++ codecan/codecan/Plug.h
@@ -22,7 +22,8 @@
 	MSG_BUILD,
 	MSG_EOT,
 	MSG_HAND_CHANGED,
-	MSG_CARD_BUILD
+	MSG_CARD_BUILD,
+	MSG_CARD_USED
 } PlugMsgType;

 @class Plug;


virsh: Resolve Coverity 'MISSING_BREAK'

virsh: Resolve Coverity 'MISSING_BREAK'

https://bugzilla.redhat.com/show_bug.cgi?id=924596

Recent commit '53531e16' resulted in a new Coverity warning regarding
a missing break in the ':' options processing. Adjust the commit to
avoid the issue.
(cherry picked from commit 55b46920bbcceaad6c71a74eb5877c0d2bebf673)

--- tools/virsh.c
+++ tools/virsh.c
@@ -2970,12 +2970,15 @@
             break;
         case ':':
             for (i = 0; opt[i].name != NULL; i++) {
-                if (opt[i].val == optopt) {
-                    vshError(ctl, _("option '-%c'/'--%s' requires an argument"),
-                             optopt, opt[i].name);
-                    exit(EXIT_FAILURE);
-                }
+                if (opt[i].val == optopt)
+                    break;
             }
+            if (opt[i].name)
+                vshError(ctl, _("option '-%c'/'--%s' requires an argument"),
+                         optopt, opt[i].name);
+            else
+                vshError(ctl, _("option '-%c' requires an argument"), optopt);
+            exit(EXIT_FAILURE);
         case '?':
             if (optopt)
                 vshError(ctl, _("unsupported option '-%c'. See --help."), optopt);


Delete test_proto.h

Delete test_proto.h

--- test_proto.h
+++ test_proto.h
@@ -1,166 +0,0 @@
-#include "rawbuffer_interface.h"
-
-//Some related compiler bug
-//During the test, if you see warning"dereferencing pointer blabla does break strict-aliasing rules", it is a bug fixed in GCC4.5。
-//测试中如果你看到警告"dereferencing pointer blabla does break strict-aliasing rules"，请勿介意，这是一个的GCC4.5修復的bug，O2或者O3优化时会给出这个提示。
-//https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39390
-//
-//https://bugs.llvm.org/show_bug.cgi?id=18009  clang-3.4 can not use our library, using clang-3.6 instead!
-
-//overload << operator to enable output of std::pair.
-//重载一下<< 操作符让std::pair支持输出到流
-template<typename L, typename R>
-std::ostream& operator << (std::ostream &ost, const std::pair<L, R>& rhs) {
-	ost << "fisrt: " << rhs.first << "  " << "second: " << rhs.second;
-	return ost;
-}
-//We put the definition of the function ahead due to the following strange policy of clang compiler.
-//I think it is a bug for clang but the maintainer does not.
-//https://stackoverflow.com/questions/31036530/cannot-compile-code-with-clang-but-works-with-gcc?rq=1
-
-struct mystruct0 {
-	int xx;
-	short yy;
-	int zz;
-};//Yes, we support raw struct packed in raw buffer, if all the numeric member is portable!
-  //是的，我们支持原生的结构体，只要里面的数值类型都是可移植的。推荐使用int32_t, int16_t这样更有可移植性的类型。
-
-//Do not use multiple inheritance. It will leads to several unportable layouts between several compilers.
-//别使用多继承。会在各个编译器之间产生很多无法移植的内存布局。
-struct mystruct1 : public mystruct0 {
-};
-
-//overload << operator to enable output of mystruct0.
-//重载一下<< 操作符让mystruct0支持输出到流
-std::ostream& operator<< (std::ostream &ost, const mystruct0& rhs) {
-	ost << "xx=" << rhs.xx << "  " << "yy=" << rhs.yy << "  " << "zz=" << rhs.zz;
-	return ost;
-}
-
-//Yes, we can use the packet data type that defined later as fields.
-//是的，我们还可以使用延迟定义的包数据类型作为包的数据成员。
-struct test_type1;
-
-//Between DEF_PACKET_BEGIN and DEF_PACKET_END are the data fields. test_type is the packet type name
-//在DEF_PACKET_BEGIN 和 DEF_PACKET_END之间的是包的数据成员。test_type是包的类型名字
-DEF_PACKET_BEGIN(test_type)
-
-	ADD_FIELD_REQUIRED(int, a)
-	//ADD_FIELD_REQUIRED will layout the field "a" like a c struct member "int a"
-	//ADD_FIELD_REQUIRED 会把a当C结构体的整数成员一样进行布局和存储
-	//So the packet in raw_buffer is a tree struct and the required fields are value of the tree node.
-	//所以在raw_buffer中包是一个树形的结构体，必须的字段会被视为树的节点的值。
-
-
-	//The rest fields are optional. They are son node of the current packet
-	//剩下的都是可选的字段. 他们是当前包的子节点。
-	ADD_FIELD(int, x)
-	ADD_FIELD(long long, y)	// Do not use 64bit integer as required field,their alignment is not portable
-
-	ADD_FIELD(mystruct0, z)
-	ADD_FIELD(mystruct1, w)
-
-	//"ANY" field definition can be used for any other packet type that even only declared.
-	//It does not lose any performanse but we can not estimate the packet(test_type) max size at compiling time.
-	//"ANY" 式的成员定义可以用于任何其他仅仅有声明的包类型。
-	//它不会带来任何性能的损失，但是会让我们无法在编译时估计包(test_type)的最大空间开销。
-
-	//test_type1 need to be defined by DEF_PACKET_BEGIN when test_type is used in your codes and test_type1 must be another packet type!
-	//当你开始使用test_type的时候，test_type1需要已被定义并且他必须也是通过DEF_PACKET_BEGIN定义的数据包类型。
-	ADD_PACKET_ANY(test_type1, u);
-
-	//test_type1 need to be defined by DEF_PACKET_BEGIN when test_type is used in your codes and test_type1 must be another packet type!
-	//当你开始使用test_type的时候，test_type1需要已被定义并且他必须也是通过DEF_PACKET_BEGIN定义的数据包类型。
-	ADD_PACKET_ARRAY_ANY(test_type1, v, 2);
-
-	//After protocol is published, we can only modify it safely by adding or removing optional fields at the back of the packet.
-	//协议公开之后，对协议安全的修改只允许在协议末尾增加或者删除字段。
-DEF_PACKET_END
-
-
-//Now lets turn to a harder one: test_type1
-//好，现在我们来点复杂的协议: test_type1。
-DEF_PACKET_BEGIN(test_type1)
-
-	//All the optional fields will be visited via their offset stored in the packet. The default offset type is uint32_t
-	//Our packet test_type1 here will not be bigger than 1<<16 in design of users. So we can use a smaller unsigned type instead to save space.
-	//所有的可选成员，都会通过在包中存储的他们的位置偏移量来进行访问。默认偏移量类型是uint32_t.
-	//这里我们的数据包test_type1按照使用者的设计，不会超过1<<16, 所以可以使用一个小一点的无符号数值类型来节省空间。
-	typedef unsigned short offset_type;
-
-	//We can define a fixed length array field like: char aa[12];
-	//我们可以定义一个定长的数组成员：char aa[12];
-	ADD_FIELD_ARRAY_REQUIRED(char, aa, 12)
-
-	//Ok, next!
-	//好的，再来一个
-	ADD_FIELD_ARRAY_REQUIRED(int, bb, 3)
-
-	//We can define an optioanl variable length vector field.
-	//我们也可以定义一个变长的可选的数组成员。注意32仅仅是个长度估计，用来初始化时评估预分配内存数量的，不会限制cc的大小，可以安全的随意修改。
-	ADD_FIELD_ARRAY(int, cc, 32)
-	//Here 32 just provides an estimation of ccfor the writer pre-allocation. It does not limit the size of cc.
-	//32 can be changed into other number after the protocol is published because it just affect the meory allocator.
-
-	//We can define a knownable packet as field. For safety it can not be required!
-	//我们还可以定义一个已知的包类型作为数据成员。为了安全（包类型可能增减成员），他不可以被声明为必须的。
-	ADD_PACKET(test_type, xx)
-
-	//just more fields..
-	//再来更多的数据成员
-	ADD_FIELD(int, yy)
-	ADD_FIELD_ARRAY(char, zz, 32)
-	ADD_PACKET(test_type, ww)
-
-	//We can define a optioanl variable length vector of knownable packet as field. For safety it can not be required!
-	//我们还可以定义一个已知的包类型的变长数组作为数据成员。为了安全（包类型可能增减成员），他不可以被声明为必须的。
-	ADD_PACKET_ARRAY(test_type, uu, 4)
-
-	ADD_PACKET_ARRAY(test_type, tt, 4)
-
-	//test_type1 can use the packet type itself, make a link list.
-	//test_type1 还可以使用自己类型,可以构造出链表效果。
-	ADD_PACKET_ANY(test_type1, vv)
-
-	//test_type1 can use the packet type itself as array, make a tree.
-	//test_type1 还可以使用自己类型做数组,可以构造出树的效果。
-	ADD_PACKET_ARRAY_ANY(test_type1, dd, 3)
-
-	//After protocol is published, we can only modify it safely by adding or removing optional fields at the back of the packet.
-	//Or update the size estimation of the optional array of cc, zz, uu.
-	//协议公开之后，对协议安全的修改只允许在协议末尾增加或者删除字段。或者修改对可选数组如cc,zz,uu,tt, dd的长度估计。
-
-DEF_PACKET_END
-
-
-//template packet definition
-//使用模板的包类型定义
-template<typename T
-	, typename Array_count_type = rawbuf_config::array_count_type
-	, bool is_raw_buf_test_result = rawbuf::is_rawbuf_struct<T>::result
->
-DEF_PACKET_BEGIN(test_type2)
-	typedef Array_count_type array_count_type;
-	ADD_FIELD_REQUIRED(T, o)
-	ADD_FIELD(T, a)
-	ADD_PACKET_ANY(test_type2, b)
-	ADD_PACKET_ARRAY_ANY(test_type2, c, 3)
-DEF_PACKET_END
-
-//template specification or partial specification, and you need to mention how to specify.
-//模板特化或者偏特化，需要你写出特化形式
-template<typename T, typename Array_count_type> //
-												//DEF_PACKET_BEGIN(test_type2<T, false>) No! The c++ preproccesor will think "test_type2<T, false>"  as two arguments "test_type2<T", " false>"
-												//宏不认识<> 所以他认为里面的,是分割用的。
-												//using ARGS_LIST to wrap any template arguments list.
-												//使用ARGS_LIST来把所有的模板参数列表给包起来
-DEF_PACKET_BEGIN(test_type2<ARGS_LIST(T, Array_count_type, true)>)
-	typedef Array_count_type array_count_type;
-	ADD_PACKET(T, a)
-	ADD_PACKET(test_type2<int>, b)		//Use
-	ADD_PACKET_ARRAY_ANY(test_type2, c, 3)	//Here test_type2 is test_type2<ARGS_LIST(T, Array_count_type, true)> itself
-	ADD_FIELD(std::pair<ARGS_LIST(int, double)>, d)	//ARGS_LIST should be used again.
-	ADD_FIELD_REQUIRED(std::pair<ARGS_LIST(int, double)>, e)
-	ADD_PACKET_ARRAY_ANY(test_type2<int>, f, 3)
-DEF_PACKET_END
-


Version 0.8.3

Version 0.8.3

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

 #define DEBUG			1
 #define APPNAME			"Teapotnet"
-#define APPVERSION		"0.8.2"
+#define APPVERSION		"0.8.3"
 #define APPAUTHOR		"Paul-Louis Ageneau"
 #define APPLINK			"http://teapotnet.org/"
 #define SOURCELINK		"http://teapotnet.org/source"


Version 0.7.1

Version 0.7.1

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

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


t1ha-bench: minor cosmetic fr output.

t1ha-bench: minor cosmetic fr output.

--- tests/main.c
+++ tests/main.c
@@ -495,9 +495,17 @@
   printf(" - measure granularity and overhead: ");
   fflush(NULL);
   double mats /* MeasurAble TimeSlice */ = bench_mats();
-  printf("%g %s%s, %g iteration%s/%s\n", mats, mera.units,
-         (mats > 1.5) ? "s" : "", 1 / mats, (1 / mats > 1.5) ? "s" : "",
-         mera.units);
+  printf(
+      "%g %s%s, %g iteration%s/%s\n", mats, mera.units,
+      ((mera.flags & (timestamp_cycles | timestamp_ticks)) != 0 && mats > 1.5)
+          ? "s"
+          : "",
+      1 / mats,
+      ((mera.flags & (timestamp_cycles | timestamp_ticks)) != 0 &&
+       1 / mats > 1.5)
+          ? "s"
+          : "",
+      mera.units);

   if (is_option_set(bench_verbose)) {
     printf(" - convergence: ");


add test for longer data, 8K

add test for longer data, 8K

--- tests/test.c
+++ tests/test.c
@@ -168,6 +168,40 @@
   memcached_deinit(memc);
 }

+void get_test3(void)
+{
+  memcached_st *memc;
+  memcached_return rc;
+  char *key= "foo";
+  char *value;
+  size_t value_length= 8191;
+  char *string;
+  size_t string_length;
+  uint16_t flags;
+  int i;
+
+  value = (char*) malloc(value_length);
+  for (i=0; i<value_length; i++)
+    value[i] = (char) (i % 127);
+
+  memc= memcached_init(NULL);
+  assert(memc);
+  rc= memcached_set(memc, key, strlen(key),
+                    value, value_length,
+                    (time_t)0, (uint16_t)0);
+  assert(rc == MEMCACHED_SUCCESS);
+
+  string= memcached_get(memc, key, strlen(key),
+                        &string_length, &flags, &rc);
+
+  assert(string_length == value_length);
+  assert(!memcmp(string, value, string_length));
+
+  free(string);
+
+  memcached_deinit(memc);
+}
+
 void stats_hostname_test(void)
 {
   memcached_return rc;
@@ -249,6 +283,7 @@
   flush_test();
   get_test();
   get_test2();
+  get_test3();
   stats_hostname_test();

   increment_test();


Enabled all tests (they now all pass)

Enabled all tests (they now all pass)

--- tests/test.c
+++ tests/test.c
@@ -867,7 +867,7 @@
   test_st user_tests[] ={
     {"user_supplied_bug1", 0, user_supplied_bug1 },
     {"user_supplied_bug2", 0, user_supplied_bug2 },
-//    {"user_supplied_bug3", 0, user_supplied_bug3 },
+    {"user_supplied_bug3", 0, user_supplied_bug3 },
     {0, 0, 0}
   };


Removed all references to UsenetSubscription

--- tickertape.c
+++ tickertape.c
@@ -28,7 +28,7 @@
 ****************************************************************/

 #ifndef lint
-static const char cvsid[] = "$Id: tickertape.c,v 1.23 1999/10/04 07:05:48 phelps Exp $";
+static const char cvsid[] = "$Id: tickertape.c,v 1.24 1999/10/04 11:07:58 phelps Exp $";
 #endif /* lint */

 #include <stdio.h>
@@ -54,7 +54,6 @@
 #include "usenet.h"
 #include "usenet_parser.h"
 #include "usenet_sub.h"
-#include "UsenetSubscription.h"
 #include "mail_sub.h"
 #include "connect.h"
 #ifdef ORBIT
@@ -103,7 +102,6 @@
     int groups_count;

     /* The receiver's usenet subscription (from the usenet file) */
-    UsenetSubscription usenetSubscription;
     usenet_sub_t usenet_sub;

     /* The receiver's mail subscription */
@@ -148,7 +146,6 @@
 static char *tickertape_ticker_dir(tickertape_t self);
 static char *tickertape_groups_filename(tickertape_t self);
 static char *tickertape_usenet_filename(tickertape_t self);
-static FILE *tickertape_usenet_file(tickertape_t self);

 /*
@@ -487,8 +484,6 @@
     tickertape_t self, int has_not, char *pattern,
     struct usenet_expr *expressions, size_t count)
 {
-    struct usenet_expr *pointer;
-
     /* Forward the information to the usenet subscription */
     return usenet_sub_add(self -> usenet_sub, has_not, pattern, expressions, count);
 }
@@ -553,27 +548,6 @@
     }
 }

-/* Read from the usenet file.  Returns a Usenet subscription. */
-static UsenetSubscription read_usenet_file(tickertape_t self)
-{
-    FILE *file;
-    UsenetSubscription subscription;
-
-    /* Open the usenet file and read */
-    if ((file = tickertape_usenet_file(self)) == NULL)
-    {
-	return NULL;
-    }
-
-    /* Read the file */
-    subscription = UsenetSubscription_readFromUsenetFile(
-	file, (UsenetSubscriptionCallback)receive_callback, self);
-    fclose(file);
-
-    return subscription;
-}
-
-
 /* Returns the index of the group with the given expression (-1 it none) */
 static int find_group(group_sub_t *groups, int count, char *expression)
 {
@@ -659,26 +633,18 @@
 /* Request from the ControlPanel to reload usenet file */
 void tickertape_reload_usenet(tickertape_t self)
 {
-    UsenetSubscription subscription;
-    SANITY_CHECK(self);
-
-    /* Read the new usenet subscription */
-    subscription = read_usenet_file(self);
-
-    /* Stop listening to old subscription */
-    if (self -> usenetSubscription != NULL)
-    {
-	UsenetSubscription_setConnection(self -> usenetSubscription, NULL);
-	UsenetSubscription_free(self -> usenetSubscription);
-    }
-
-    /* Start listening to the new subscription */
-    self -> usenetSubscription = subscription;
-
-    if (self -> usenetSubscription != NULL)
-    {
-	UsenetSubscription_setConnection(self -> usenetSubscription, self -> connection);
-    }
+    /* Release the old usenet subscription */
+    usenet_sub_free(self -> usenet_sub);
+    self -> usenet_sub = NULL;
+
+    /* Try to read in the new one */
+    if (parse_usenet_file(self) < 0)
+    {
+	return;
+    }
+
+    /* Set its connection */
+    usenet_sub_set_connection(self -> usenet_sub, self -> connection);
 }

@@ -917,11 +883,8 @@
     self -> groups = NULL;
     self -> groups_count = 0;

-    self -> usenetSubscription = read_usenet_file(self);
     self -> usenet_sub = NULL;
-    parse_usenet_file(self);
-    self -> mail_sub = mail_sub_alloc(
-	user, (mail_sub_callback_t)receive_callback, self);
+    self -> mail_sub = NULL;
     self -> connection = NULL;
     self -> history = history_alloc();

@@ -931,6 +894,16 @@
 	exit(1);
     }

+    /* Read the subscriptions from the usenet file */
+    if (parse_usenet_file(self) < 0)
+    {
+	exit(1);
+    }
+
+    /* Initialize the e-mail subscription */
+    self -> mail_sub = mail_sub_alloc(user, (mail_sub_callback_t)receive_callback, self);
+
+    /* Draw the user interface */
     init_ui(self);

     /* Connect to elvin and subscribe */
@@ -942,12 +915,6 @@
     for (index = 0; index < self -> groups_count; index++)
     {
 	group_sub_set_connection(self -> groups[index], self -> connection);
-    }
-
-    /* Subscribe to the Usenet subscription if we have one */
-    if (self -> usenetSubscription != NULL)
-    {
-	UsenetSubscription_setConnection(self -> usenetSubscription, self -> connection);
     }

     /* Subscribe to the usenet_sub */
@@ -1134,45 +1101,6 @@
 }

-/* Answers the receiver's usenet file */
-static FILE *tickertape_usenet_file(tickertape_t self)
-{
-    char *filename = tickertape_usenet_filename(self);
-    FILE *file;
-    int result;
-
-    /* Try to open the file */
-    if ((file = fopen(filename, "r")) != NULL)
-    {
-	return file;
-    }
-
-    /* If failure was not due to a missing file, then fail */
-    if (errno != ENOENT)
-    {
-	return NULL;
-    }
-
-    /* Try to create the file */
-    if ((file = fopen(filename, "w")) == NULL)
-    {
-	return NULL;
-    }
-
-    /* Try to write a default usenet file for the current user */
-    result = UsenetSubscription_writeDefaultUsenetFile(file);
-    fclose(file);
-
-    if (result < 0)
-    {
-	unlink(filename);
-	return NULL;
-    }
-
-    /* Try to open the newly created file */
-    return fopen(filename, "r");
-}
-
 /* Displays a message's MIME attachment */
 int tickertape_show_attachment(tickertape_t self, message_t message)
 {


Fix the test for Release.

Fix the test for Release.

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

--- test/CodeGen/vla.c
+++ test/CodeGen/vla.c
@@ -89,7 +89,7 @@
 // CHECK: define double @test_PR8567
 double test_PR8567(int n, double (*p)[n][5]) {
   // CHECK: store [[vla_type:.*]] %p,
-  // CHECK: load i32* %n
+  // CHECK: load i32*
   // CHECK-NEXT: mul i32 40
   // CHECK-NEXT: [[byte_idx:%.*]] = mul i32 1
   // CHECK-NEXT: [[tmp_1:%.*]] = load [[vla_type]]*


orcc: Add custom header barrier

orcc: Add custom header barrier

--- tools/orcc.c
+++ tools/orcc.c
@@ -8,6 +8,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>

 static char * read_file (const char *filename);
 void output_code (OrcProgram *p, FILE *output);
@@ -17,6 +18,7 @@
 void output_code_no_orc (OrcProgram *p, FILE *output);
 static void print_defines (FILE *output);
 static void print_exec_header (FILE *output);
+static char * get_barrier (const char *s);

 int verbose = 0;

@@ -157,8 +159,11 @@
       output_code (programs[i], output);
     }
   } else if (mode == MODE_HEADER) {
-    fprintf(output, "#ifndef _ORC_OUT_H_\n");
-    fprintf(output, "#define _ORC_OUT_H_\n");
+    char *barrier = get_barrier (output_file);
+
+    fprintf(output, "#ifndef _%s_\n", barrier);
+    fprintf(output, "#define _%s_\n", barrier);
+    free (barrier);
     fprintf(output, "\n");
     if (include_file) {
       fprintf(output, "#include <%s>\n", include_file);
@@ -289,6 +294,27 @@
 #endif
 }

+static char *
+get_barrier (const char *s)
+{
+  char *barrier;
+  int n;
+  int i;
+
+  n = strlen(s);
+  barrier = malloc (n + 1);
+  for(i=0;i<n;i++) {
+    if (isalnum (s[i])) {
+      barrier[i] = toupper(s[i]);
+    } else {
+      barrier[i] = '_';
+    }
+  }
+  barrier[n] = 0;
+
+  return barrier;
+}
+
 static void
 print_defines (FILE *output)
 {


More compiler work.

More compiler work.

--- tools/upbc.c
+++ tools/upbc.c
@@ -205,7 +205,7 @@

 struct strtable_entry {
   struct upb_strtable_entry e;
-  size_t offset;
+  int offset;
   int num;
 };

@@ -275,7 +275,7 @@
   qsort(str_entries, size, sizeof(void*), compare_entries);

   /* Emit strings. */
-  fputs("static const char strings[] =\n  \"", stream);
+  fputs("static char strdata[] =\n  \"", stream);
   int col = 2;
   int offset = 0;
   for(int i = 0; i < size; i++) {
@@ -291,7 +291,16 @@
     }
     offset += s->byte_len;
   }
-  fputs("\"\n\n", stream);
+  fputs("\";\n\n", stream);
+
+  fputs("static struct upb_string strings[] = {\n", stream);
+  for(int i = 0; i < size; i++) {
+    struct strtable_entry *e = str_entries[i];
+    fprintf(stream, "  {.ptr = &strdata[%d], .byte_len=%d}", e->offset, e->e.key.byte_len);
+    if(i+1 != size) fputc(',', stream);
+    fputc('\n', stream);
+  }
+  fputs("};\n\n", stream);
 }

 const char usage[] =


[FIX] some memory issues

[FIX] some memory issues

--- trams_list.c
+++ trams_list.c
@@ -33,33 +33,46 @@
 void delete_tram_with_index(int idx)
 {
     struct ListNode* curr_node;
-    for (curr_node=root; (curr_node->record_no==idx || curr_node->next==NULL); curr_node=curr_node->next);

-    if (curr_node->record_no == idx) {
-        /* cofniecie indeksow rekordow za usuwanym elementem */
-        move_back_records_no_from(curr_node->next);
+    if (!root) {
+        printf("Nie mozna usunac elementu z pustej listy!\n");
+        return;
+    }

-        /* jesli ogon, to nie mozna odniesc sie do curr_node->next->prev */
-        if (curr_node->next == NULL)
+    for (curr_node=root; (curr_node->record_no==idx || curr_node==NULL); curr_node=curr_node->next);
+
+    if (!curr_node) {
+        printf("Nie ma takiego indeksu!\n");
+        return;
+    }
+
+    /* cofniecie indeksow rekordow za usuwanym elementem */
+    /* wykonuje jedna zbedna dekrementacje (elementu do usuniecia) */
+    /* ale nie wymaga obslugi 1-elementowej listy */
+    move_back_records_no_from(curr_node);
+
+    /* jesli curr_node jest rootem, nie jest wymagana ani dozwolona zadna podmiana wskaznikow */
+    if (curr_node != root) {
+        if (curr_node->next == NULL) {
+            /* jesli ogon */
             curr_node->prev->next = NULL;
-        /* jesli glowa, to nie mozna odniesc sie do curr_node->prev->next =>
-        curr_element byl rootem */
+        }
         else if (curr_node->prev == NULL) {
+            /* jesli glowa */
             curr_node->next->prev = NULL;
             root = curr_node->next;
-        } else {
+        }
+        else {
             curr_node->prev->next = curr_node->next;
             curr_node->next->prev = curr_node->prev;
         }
+    }

-        delete_tram(curr_node->tram);
-        curr_node->next = curr_node->prev = NULL;
-        free(curr_node);
-    } else {
-        printf("Nie ma takiego indeksu!\n");
-        return;
-    }
+    delete_tram(curr_node->tram);
+    curr_node->next = curr_node->prev = NULL;
+    free(curr_node);
 }
+

 void move_back_records_no_from(struct ListNode* node)
 {


Be sure to destroy memory after tests run

--- test/memory-test.c
+++ test/memory-test.c
@@ -305,6 +305,8 @@
 	clearMemory_setsallzeros(0);
 	clearMemory_setsallzeros(4092);

+	destroyMemory();
+
 	printf("\nfailed tests: %d\n", num_failed);
 	return 0;
 }


修改按钮部件的测试程序

修改按钮部件的测试程序

新增一个按钮，用于测试部件的clickable_mode和clickable_area_alpha属性。

--- test/test_button.c
+++ test/test_button.c
@@ -10,32 +10,42 @@
 int main(int argc, char*argv[])
 {
     LCUI_Init(argc, argv);
-    LCUI_Widget *window, *button;
+    LCUI_Widget *window, *button[2];
     /* 创建部件 */
     window  = Create_Widget("window");
-    button  = Create_Widget("button");
+    button[0]  = Create_Widget("button");
+    button[1]  = Create_Widget("button");

     /* 设定窗口标题的文本 */
     Set_Window_Title_Text(window, "测试窗口");
     /* 改变窗口的尺寸，也可以用Resize_Widget() */
     window->resize(window, Size(320, 240));
     /* 将窗口客户区作为lael部件的容器添加进去 */
-    Window_Client_Area_Add(window, button);
+    Window_Client_Area_Add(window, button[0]);
+    Window_Client_Area_Add(window, button[1]);
     /* 居中显示按钮,也可以用Set_Widget_Align() */
-    button->set_align(button, ALIGN_MIDDLE_CENTER, Pos(0, 0));
+    button[0]->set_align(button[0], ALIGN_MIDDLE_CENTER, Pos(45, 0));
+    button[1]->set_align(button[1], ALIGN_MIDDLE_CENTER, Pos(-50, 0));
     /* 禁用部件的自动尺寸调整 */
-    Disable_Widget_Auto_Size(button);
+    Disable_Widget_Auto_Size(button[0]);
+    Disable_Widget_Auto_Size(button[1]);
     /* 自定义按钮的尺寸 */
-    button->resize(button, Size(80, 30));
+    button[0]->resize(button[0], Size(80, 30));
+    button[1]->resize(button[1], Size(100, 40));
+
+    Set_Widget_ClickableAlpha( button[1], 255, 0 );
     /* 设定按钮上显示的文本内容，和label部件的用法一样 */
-    Set_Button_Text(button,
+    Set_Button_Text(button[0],
                 "<color=255,0,0>彩</color>"
                 "<color=0,255，0>色</color>"
                 "<color=0,0,255>的</color>"
                 "<color=255,255,0>按</color>"
                 "<color=255,255,255>钮</color>");
+    Set_Button_Text(button[1], "你点击不到的按钮");
+
     /* 显示部件，也可以用Show_Widget()函数 */
-    button->show(button);
+    button[0]->show(button[0]);
+    button[1]->show(button[1]);
     window->show(window);
     return LCUI_Main(); /* 进入主循环 */
 }


Fix a warning

Fix a warning

--- tests/check_yaml.c
+++ tests/check_yaml.c
@@ -36,7 +36,7 @@
   exit (EXIT_FAILURE);
 }

-int
+void
 read_tables(yaml_parser_t *parser, char *tables_list) {
   yaml_event_t event;
   if (!yaml_parser_parse(parser, &event) ||


removed tests up to test_bhdct_get_nonexist_many in int_int suite

--- src/tests/behaviour/dictionary/behaviour_dictionary.c
+++ src/tests/behaviour/dictionary/behaviour_dictionary.c
@@ -1507,13 +1507,13 @@
 		PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_in_many);

 		PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_lots);
-*/
+
 		PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_nonexist_empty);
 		PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_nonexist_single);
 		PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_nonexist_many);

 		PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_exist_single);
-		PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_populated_single);
+*/	  PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_populated_single);
 		PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_populated_multiple);

 		PLANCK_UNIT_ADD_TO_SUITE(suite, test_bhdct_get_all);


cy8mrln-palmpre: enable debug mode

cy8mrln-palmpre: enable debug mode

--- plugins/cy8mrln-palmpre.c
+++ plugins/cy8mrln-palmpre.c
@@ -35,6 +35,8 @@
 #define SCREEN_HEIGHT  527
 #define H_FIELDS       7
 #define V_FIELDS       11
+
+#define DEBUG

 #define container_of(ptr, type, member) ({ \
 	const typeof( ((type*)0)->member ) *__mptr = (ptr); \
@@ -302,7 +304,7 @@

 	out->pressure = field[i];
 #ifdef DEBUG
-	printf("RAW--------------------------->f21: %f (%d), f23: %f (%d), f12: %f (%d), f32: %f (%d), ",
+	printf("RAW--------------------------->f21: %f (%d), f23: %f (%d), f12: %f (%d), f32: %f (%d), \n",
 	       f21, field[i - 1], f23, field[i + 1], f12,
 	       field[i - H_FIELDS], f32, field[i + H_FIELDS]);
 #endif /*DEBUG*/


- remove suport for the old libplayback requests (i.e. request without   'stream' field)

--- plugins/playback/dbusif.c
+++ plugins/playback/dbusif.c
@@ -820,18 +820,6 @@
                                         DBUS_TYPE_STRING, &stream,
                                         DBUS_TYPE_INVALID);

-        /********* this is temporary to support the old libplaybacks *********/
-        if (!success) {
-            stream = "";
-
-            success = dbus_message_get_args(msg, NULL,
-                                            DBUS_TYPE_OBJECT_PATH, &objpath,
-                                            DBUS_TYPE_STRING, &state,
-                                            DBUS_TYPE_STRING, &pid,
-                                            DBUS_TYPE_INVALID);
-        }
-        /************************ end of temporary ***************************/
-
         if (!success) {
             errmsg = "failed to parse playback request for state change";
             goto rq_state_failed;


esp8266/esp_mphal.h: Fix I2C glitching by using input mode for od_high.

Certain pins (eg 4 and 5) seem to behave differently at the hardware level
when in open-drain mode: they glitch when set "high" and drive the pin
active high for a brief period before disabling the output driver.  To work
around this make the pin an input to let it float high.

--- ports/esp8266/esp_mphal.h
+++ ports/esp8266/esp_mphal.h
@@ -86,7 +86,7 @@
     } while (0)
 #define mp_hal_pin_od_high(p) do { \
         if ((p) == 16) { WRITE_PERI_REG(RTC_GPIO_ENABLE, (READ_PERI_REG(RTC_GPIO_ENABLE) & ~1)); } \
-        else { gpio_output_set(1 << (p), 0, 1 << (p), 0); } \
+        else { gpio_output_set(0, 0, 0, 1 << (p)); /* set as input to avoid glitches */ } \
     } while (0)
 #define mp_hal_pin_read(p) pin_get(p)
 #define mp_hal_pin_write(p, v) pin_set((p), (v))


scan: Add write scan interval window

scan: Add write scan interval window

This patch adds the handle discovery of the Scan Interval Window
Characteristic and writes the default value (hard-coded in the kernel)
of the scan interval, and scan window in the remote's characteristic.

--- profiles/scanparam/scan.c
+++ profiles/scanparam/scan.c
@@ -31,6 +31,7 @@
 #include <bluetooth/bluetooth.h>
 #include <bluetooth/uuid.h>

+#include "log.h"
 #include "adapter.h"
 #include "device.h"
 #include "att.h"
@@ -39,10 +40,18 @@
 #include "attio.h"
 #include "scan.h"

+#define SCAN_INTERVAL_WIN_UUID		0x2A4F
+
+#define SCAN_INTERVAL		0x0060
+#define SCAN_WINDOW		0x0030
+
 struct scan {
 	struct btd_device *device;
 	GAttrib *attrib;
+	struct att_range range;
 	guint attioid;
+	uint16_t interval;
+	uint16_t window;
 };

 GSList *servers = NULL;
@@ -55,11 +64,42 @@
 	return (device == scan->device ? 0 : -1);
 }

+static void iwin_discovered_cb(GSList *chars, guint8 status,
+						gpointer user_data)
+{
+	struct scan *scan = user_data;
+	struct gatt_char *chr;
+	uint8_t value[4];
+
+	if (status) {
+		error("Discover Scan Interval Window: %s",
+						att_ecode2str(status));
+		return;
+	}
+
+	chr = chars->data;
+
+	DBG("Scan Interval Window handle: 0x%04x",
+						chr->value_handle);
+
+	att_put_u16(SCAN_INTERVAL, &value[0]);
+	att_put_u16(SCAN_WINDOW, &value[2]);
+
+	gatt_write_char(scan->attrib, chr->value_handle, value,
+						sizeof(value), NULL, NULL);
+}
+
 static void attio_connected_cb(GAttrib *attrib, gpointer user_data)
 {
 	struct scan *scan = user_data;
+	bt_uuid_t iwin_uuid;
+
+	bt_uuid16_create(&iwin_uuid, SCAN_INTERVAL_WIN_UUID);

 	scan->attrib = g_attrib_ref(attrib);
+
+	gatt_discover_char(scan->attrib, scan->range.start, scan->range.end,
+					&iwin_uuid, iwin_discovered_cb, scan);
 }

 static void attio_disconnected_cb(gpointer user_data)
@@ -76,6 +116,7 @@

 	scan = g_new0(struct scan, 1);
 	scan->device = btd_device_ref(device);
+	scan->range = prim->range;
 	scan->attioid = btd_device_add_attio_callback(device,
 							attio_connected_cb,
 							attio_disconnected_cb,


ssl_server: initialize all structures, so that we can call *_free() in case of error

In ssl_server, initialize at the beginning all the structures
that are used in the program. This ensures that calls to
functions like x509_free(), rsa_free() and ssl_free()
do not cause a segmentation fault or other undesired behaviour.

--- programs/ssl/ssl_server.c
+++ programs/ssl/ssl_server.c
@@ -173,8 +173,8 @@
 int main(void)
 {
 	int ret, len;
-	int listen_fd;
-	int client_fd;
+	int listen_fd = -1;
+	int client_fd = -1;
 	unsigned char buf[1024];

 	havege_state hs;
@@ -189,7 +189,10 @@
 	printf("\n  . Loading the server cert. and key...");
 	fflush(stdout);

+	memset(&ssl, 0, sizeof(ssl_context));
+	memset(&ssn, 0, sizeof(ssl_session));
 	memset(&srvcert, 0, sizeof(x509_cert));
+	memset(&rsa, 0, sizeof(rsa_context));

 	/*
 	 * This demonstration program uses embedded test certificates.
@@ -283,8 +286,6 @@

 	ssl_set_ciphers(&ssl, my_ciphers);
 	ssl_set_session(&ssl, 1, 0, &ssn);
-
-	memset(&ssn, 0, sizeof(ssl_session));

 	ssl_set_ca_chain(&ssl, srvcert.next, NULL);
 	ssl_set_own_cert(&ssl, &srvcert, &rsa);


updated comment

updated comment

--- progs/tests/afsmultiarb.c
+++ progs/tests/afsmultiarb.c
@@ -1,13 +1,9 @@
-
 /*
- * GL_ARB_multitexture demo
+ * GL_ATI_fragment_shader test
+ * Roland Scheidegger
  *
  * Command line options:
  *    -info      print GL implementation information
- *
- *
- * Brian Paul  November 1998  This program is in the public domain.
- * Modified on 12 Feb 2002 for > 2 texture units.
  */


Tests: list.h - add test_list_data

Tests: list.h - add test_list_data

--- tests/list_tests.c
+++ tests/list_tests.c
@@ -679,6 +679,28 @@

     return TEST_PASSED;
 }
+
+
+
+//---------------- Get Data from node ----------------
+
+
+
+int test_list_data(struct test_info_t  *test_info)
+{
+
+    TEST_INIT;
+
+    struct tmp_data d1;
+
+    if( list_data(&d1.list, struct tmp_data, list) != &d1 )
+        return TEST_BROKEN;
+
+
+    return TEST_PASSED;
+}
+
+

@@ -698,6 +720,9 @@
     test_list_rotate_right,
     test_list_splice_front,
     test_list_splice_back,
+
+    //Get Data from node
+    test_list_data,
 };


performance/quick-read: checking for qr_file in inode-context and creating if not present should be atomic.

Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 273 (Code review and optimize quick-read)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=273

--- xlators/performance/quick-read/src/quick-read.c
+++ xlators/performance/quick-read/src/quick-read.c
@@ -176,42 +176,57 @@
                 goto out;
         }

-        /*
-         * FIXME: checking for qr_file and creating (adding in turn) should be
-         * atomic
-         */
-        ret = inode_ctx_get (inode, this, &value);
-        if (ret == -1) {
-                qr_file = CALLOC (1, sizeof (*qr_file));
-                if (qr_file == NULL) {
-                        op_ret = -1;
-                        op_errno = ENOMEM;
-                        goto out;
-                }
+        if (inode == NULL) {
+                op_ret = -1;
+                op_errno = EINVAL;
+                goto out;
+        }
+
+        LOCK (&inode->lock);
+        {
+                ret = __inode_ctx_get (inode, this, &value);
+                if (ret == -1) {
+                        qr_file = CALLOC (1, sizeof (*qr_file));
+                        if (qr_file == NULL) {
+                                op_ret = -1;
+                                op_errno = ENOMEM;
+                                goto unlock;
+                        }

-                LOCK_INIT (&qr_file->lock);
-                inode_ctx_put (inode, this, (uint64_t)(long)qr_file);
-        } else {
-                qr_file = (qr_file_t *)(long)value;
-                if (qr_file == NULL) {
-                        op_ret = -1;
-                        op_errno = EINVAL;
-                        goto out;
-                }
-        }
-
-        LOCK (&qr_file->lock);
-        {
-                if (qr_file->xattr) {
-                        dict_unref (qr_file->xattr);
-                        qr_file->xattr = NULL;
-                }
-
-                qr_file->xattr = dict_ref (dict);
-                qr_file->stbuf = *buf;
-                gettimeofday (&qr_file->tv, NULL);
-        }
-        UNLOCK (&qr_file->lock);
+                        LOCK_INIT (&qr_file->lock);
+                        ret = __inode_ctx_put (inode, this,
+                                               (uint64_t)(long)qr_file);
+                        if (ret == -1) {
+                                FREE (qr_file);
+                                qr_file = NULL;
+                                op_ret = -1;
+                                op_errno = EINVAL;
+                        }
+                } else {
+                        qr_file = (qr_file_t *)(long)value;
+                        if (qr_file == NULL) {
+                                op_ret = -1;
+                                op_errno = EINVAL;
+                        }
+                }
+        }
+unlock:
+        UNLOCK (&inode->lock);
+
+        if (qr_file != NULL) {
+                LOCK (&qr_file->lock);
+                {
+                        if (qr_file->xattr) {
+                                dict_unref (qr_file->xattr);
+                                qr_file->xattr = NULL;
+                        }
+
+                        qr_file->xattr = dict_ref (dict);
+                        qr_file->stbuf = *buf;
+                        gettimeofday (&qr_file->tv, NULL);
+                }
+                UNLOCK (&qr_file->lock);
+        }

 out:
         /*


zephyr test: Verify board_is_usb_pd_port

Verify that the default implementation returns true for existing ports.

BUG=b:256182103
TEST=twister -s zephyr/test/drivers/drivers.usb_common
BRANCH=none

Signed-off-by: Abe Levkoy <2e1ad7039298f93262cf06bbb457275fb3e2ecb5@chromium.org>
Change-Id: If5a94ee83d5dac37cae26ce6e189a785274c0d06
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3994226
Reviewed-by: Al Semjonovs <c3a2ecb550cad1e7d5a943ca6241377f7b43ffc4@google.com>
Code-Coverage: Zoss <345cf107e82c70959d46f59d98bddc98ce458aff@prod.google.com>

--- zephyr/test/drivers/usb_common/src/usb_common.c
+++ zephyr/test/drivers/usb_common/src/usb_common.c
@@ -134,3 +134,10 @@
 	rdo = RDO_FIXED(1, 1000, 1800, 0);
 	zassert_equal(pd_check_requested_voltage(rdo, 0), EC_ERROR_INVAL);
 }
+
+ZTEST_USER(usb_common, test_board_is_usb_pd_port_present)
+{
+	zassert_true(board_is_usb_pd_port_present(TEST_PORT));
+	zassert_false(board_is_usb_pd_port_present(-1));
+	zassert_false(board_is_usb_pd_port_present(100));
+}


Really support Ultra-2 chips. Symbios redefined a register that
was available to the programmer to hold chip state information:

Use the SDID register instead of CTEST3. This change actually
simplifies the SCRIPTS code, but I'm not absolutely sure, that
it is OK for all variants of NCR chips around and all device
combinations. I have had this code running on several systems
with 53c810, 875 and 895 controllers for several months.

Suggested by:	Gerard Roudier <groudier@club-internet.fr>

--- sys/pci/ncr.c
+++ sys/pci/ncr.c
@@ -1,6 +1,6 @@
 /**************************************************************************
 **
-**  $Id: ncr.c,v 1.144 1999/05/06 20:16:37 ken Exp $
+**  $Id: ncr.c,v 1.145 1999/05/09 17:07:09 peter Exp $
 **
 **  Device driver for the   NCR 53C8XX   PCI-SCSI-Controller Family.
 **
@@ -1233,7 +1233,7 @@
 	ncrcmd	skip		[  8];
 	ncrcmd	skip2		[  3];
 	ncrcmd  idle		[  2];
-	ncrcmd	select		[ 22];
+	ncrcmd	select		[ 18];
 	ncrcmd	prepare		[  4];
 	ncrcmd	loadpos		[ 14];
 	ncrcmd	prepare2	[ 24];
@@ -1285,11 +1285,11 @@
 	ncrcmd  getcc		[  4];
 	ncrcmd  getcc1		[  5];
 #ifdef NCR_GETCC_WITHMSG
-	ncrcmd	getcc2		[ 33];
+	ncrcmd	getcc2		[ 29];
 #else
 	ncrcmd	getcc2		[ 14];
 #endif
-	ncrcmd	getcc3		[ 10];
+	ncrcmd	getcc3		[  6];
 	ncrcmd	aborttag	[  4];
 	ncrcmd	abort		[ 22];
 	ncrcmd	snooptest	[  9];
@@ -1361,7 +1361,7 @@

 #if !defined(lint)
 static const char ident[] =
-	"\n$Id: ncr.c,v 1.144 1999/05/06 20:16:37 ken Exp $\n";
+	"\n$Id: ncr.c,v 1.145 1999/05/09 17:07:09 peter Exp $\n";
 #endif

 static const u_long	ncr_version = NCR_VERSION	* 11
@@ -1628,14 +1628,6 @@
 		0,

 	/*
-	**	Save target id to ctest0 register
-	*/
-
-	SCR_FROM_REG (sdid),
-		0,
-	SCR_TO_REG (ctest0),
-		0,
-	/*
 	**	Send the IDENTIFY and SIMPLE_TAG messages
 	**	(and the MSG_EXT_SDTR message)
 	*/
@@ -2308,7 +2300,7 @@
 	*/
 	SCR_REG_SFBR (ssid, SCR_AND, 0x8F),
 		0,
-	SCR_TO_REG (ctest0),
+	SCR_TO_REG (sdid),
 		0,
 	SCR_JUMP,
 		NADDR (jump_tcb),
@@ -2889,13 +2881,6 @@
 	SCR_SEL_TBL_ATN ^ offsetof (struct dsb, select),
 		PADDR(badgetcc),
 	/*
-	**	save target id.
-	*/
-	SCR_FROM_REG (sdid),
-		0,
-	SCR_TO_REG (ctest0),
-		0,
-	/*
 	**	Send the IDENTIFY message.
 	**	In case of short transfer, remove ATN.
 	*/
@@ -2925,13 +2910,6 @@
 	*/
 	SCR_SEL_TBL ^ offsetof (struct dsb, select),
 		PADDR(badgetcc),
-	/*
-	**	save target id.
-	*/
-	SCR_FROM_REG (sdid),
-		0,
-	SCR_TO_REG (ctest0),
-		0,
 	/*
 	**	Force error if selection timeout
 	*/
@@ -4999,7 +4977,7 @@
 	struct	ccb_trans_settings neg;
 	tcb_p	tp;
 	int	div;
-	u_int	target = INB (nc_ctest0) & 0x0f;
+	u_int	target = INB (nc_sdid) & 0x0f;
 	u_int	period_10ns;

 	assert (cp);
@@ -5093,7 +5071,7 @@
 {
 	union	ccb *ccb;
 	struct	ccb_trans_settings neg;
-	u_int	target = INB (nc_ctest0) & 0x0f;
+	u_int	target = INB (nc_sdid) & 0x0f;
 	tcb_p	tp;
 	u_char	scntl3;
 	u_char	sxfer;
@@ -5335,7 +5313,7 @@
 	}

 	printf ("%s:%d: ERROR (%x:%x) (%x-%x-%x) (%x/%x) @ (%s %x:%08x).\n",
-		ncr_name (np), (unsigned)INB (nc_ctest0)&0x0f, dstat, sist,
+		ncr_name (np), (unsigned)INB (nc_sdid)&0x0f, dstat, sist,
 		(unsigned)INB (nc_socl), (unsigned)INB (nc_sbcl), (unsigned)INB (nc_sbdl),
 		(unsigned)INB (nc_sxfer),(unsigned)INB (nc_scntl3), script_name, script_ofs,
 		(unsigned)INL (nc_dbc));
@@ -5560,7 +5538,7 @@
 			return;
 		};
 		printf ("%s: target %d doesn't release the bus.\n",
-			ncr_name (np), INB (nc_ctest0)&0x0f);
+			ncr_name (np), INB (nc_sdid)&0x0f);
 		/*
 		**	return without restarting the NCR.
 		**	timeout will do the real work.
@@ -5935,7 +5913,7 @@
 	u_char num = INB (nc_dsps);
 	nccb_p	cp=0;
 	u_long	dsa;
-	u_int	target = INB (nc_ctest0) & 0x0f;
+	u_int	target = INB (nc_sdid) & 0x0f;
 	tcb_p	tp     = &np->target[target];
 	int     i;
 	if (DEBUG_FLAGS & DEBUG_TINY) printf ("I#%d", num);


Remove the SMART ioctls, they are not in the official sources yet..

This should restore world...

--- sys/sys/ata.h
+++ sys/sys/ata.h
@@ -201,7 +201,5 @@
 #define ATADETACH	_IOW('a',  6, int)
 #define ATAACOUSTIC	_IOWR('a',  7, int);
 #define ATASLEEP	_IOWR('a',  8, struct ata_sleep)
-#define ATAGSMART	_IOWR('a',  9, struct ata_smart)
-#define ATASSMART	_IOWR('a', 10, struct ata_smart)

 #endif /* _SYS_ATA_H_ */


fix deleterange asan issue

fix deleterange asan issue

Summary:
pinned_iters_mgr_ pins iterators allocated with arena_, so we should order the
instance variable declarations such that the pinned iterators have their destructors
executed before the arena is destroyed.
Closes https://github.com/facebook/rocksdb/pull/1528

Differential Revision: D4191984

Pulled By: ajkr

fbshipit-source-id: 1386f20

--- db/range_del_aggregator.h
+++ db/range_del_aggregator.h
@@ -89,9 +89,10 @@
   Status AddTombstones(InternalIterator* input, bool arena);
   TombstoneMap& GetTombstoneMap(SequenceNumber seq);

-  PinnedIteratorsManager pinned_iters_mgr_;
   StripeMap stripe_map_;
   const InternalKeyComparator icmp_;
-  Arena arena_;
+  Arena arena_;  // must be destroyed after pinned_iters_mgr_ which references
+                 // memory in this arena
+  PinnedIteratorsManager pinned_iters_mgr_;
 };
 }  // namespace rocksdb


Use consistent capitalization of demo titles

--- demos/gtk-demo/css_pixbufs.c
+++ demos/gtk-demo/css_pixbufs.c
@@ -1,7 +1,7 @@
-/* CSS Theming/Animated backgrounds
+/* CSS Theming/Animated Backgrounds
  *
- * This demo is done in honour of the Pixbufs demo further down. It is done exclusively
- * with CSS as the background of the window.
+ * This demo is done in honour of the Pixbufs demo further down.
+ * It is done exclusively with CSS as the background of the window.
  */

 #include <gtk/gtk.h>


Fixed typo in CBLView documentation

Fixed typo in CBLView documentation

--- Source/API/CBLView.h
+++ Source/API/CBLView.h
@@ -77,7 +77,7 @@

 /** Defines a view's functions.
     The view's definition is given as an Objective-C block (or NULL to delete the view). The body of the block should call the 'emit' block (passed in as a paramter) for every key/value pair it wants to write to the view.
-    Since the function itself is obviously not stored in the database (only a unique string idenfitying it), you must re-define the view on every launch of the app! If the database needs to rebuild the view but the function hasn't been defined yet, it will fail and the view will be empty, causing weird problems later on.
+    Since the function itself is obviously not stored in the database (only a unique string identifying it), you must re-define the view on every launch of the app! If the database needs to rebuild the view but the function hasn't been defined yet, it will fail and the view will be empty, causing weird problems later on.
     It is very important that this block be a law-abiding map function! As in other languages, it must be a "pure" function, with no side effects, that always emits the same values given the same input document. That means that it should not access or change any external state; be careful, since blocks make that so easy that you might do it inadvertently!
     The block may be called on any thread, or on multiple threads simultaneously. This won't be a problem if the code is "pure" as described above, since it will as a consequence also be thread-safe.
     @param mapBlock  The map function. The MAPBLOCK macro makes it easier to declare this.


Removed Windows.h

Removed Windows.h

--- SourceCode/Windows.h
+++ SourceCode/Windows.h
@@ -1,22 +0,0 @@
-#ifndef WINDOWSCONTAINER_H
-#define WINDOWSCONTAINER_H
-
-#include <Windows.h>
-#include <WindowsX.h>
-
-class Windows
-{
-private:
-protected:
-public:
-	void main(
-		HINSTANCE	hInstance,
-		HINSTANCE	hPrevInstance,
-		LPSTR		lpCmdLine,
-		int			nCmdShow);
-
-	Windows()	{}
-	~Windows()	{}
-};
-
-#endif //WINDOWSCONTAINER_H


hard-code the libyaml version

hard-code the libyaml version

--- deps/yaml/src/yaml_private.h
+++ deps/yaml/src/yaml_private.h
@@ -1,7 +1,8 @@

-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
+#define YAML_VERSION_MAJOR 0
+#define YAML_VERSION_MINOR 1
+#define YAML_VERSION_PATCH 5
+#define YAML_VERSION_STRING "0.1.5"

 #include <yaml.h>


client: do cleanup in one place (error and normal exit). This is possible now that all processing is done using jobs, and there are no error reporters enforcing
immediate cleanup with dead vars.

git-svn-id: e4cff62102d161c5f2a02ad4c00fc75df921e9eb@249 1a93d707-3861-5ebc-ad3b-9740d49b5140

--- client/client.c
+++ client/client.c
@@ -526,9 +526,41 @@
         goto fail10;
     }

-    goto event_loop;
-
-    // cleanup on error
+    // enter event loop
+    BLog(BLOG_NOTICE, "entering event loop");
+    BReactor_Exec(&ss);
+
+    // allow freeing local receive flows
+    PacketPassFairQueue_PrepareFree(&device.output_queue);
+
+    // free peers
+    LinkedList2Node *node;
+    while (node = LinkedList2_GetFirst(&peers)) {
+        struct peer_data *peer = UPPER_OBJECT(node, struct peer_data, list_node);
+
+        // free relaying
+        if (peer->have_relaying) {
+            struct peer_data *relay = peer->relaying_peer;
+            ASSERT(relay->is_relay)
+            ASSERT(relay->have_link)
+
+            // free relay provider
+            peer_dealloc_relay_provider(relay);
+        }
+
+        // free relay provider
+        if (peer->is_relay) {
+            peer_dealloc_relay_provider(peer);
+        }
+
+        // free relay source
+        DataProtoRelaySource_FreeRelease(&peer->relay_source);
+
+        // deallocate peer
+        peer_dealloc(peer);
+    }
+
+    ServerConnection_Free(&server);
 fail10:
     FrameDecider_Free(&frame_decider);
 fail7:
@@ -548,7 +580,7 @@
         CERT_DestroyCertificate(client_cert);
         SECKEY_DestroyPrivateKey(client_key);
 fail4:
-        SSL_ShutdownServerSessionIDCache();
+        ASSERT_FORCE(SSL_ShutdownServerSessionIDCache() == SECSuccess)
 fail3:
         SSL_ClearSessionCache();
         ASSERT_FORCE(NSS_Shutdown() == SECSuccess)
@@ -560,112 +592,20 @@
 fail1b:
     BReactor_Free(&ss);
 fail1:
-    BLog(BLOG_ERROR, "initialization failed");
+    BLog(BLOG_NOTICE, "exiting");
     BLog_Free();
 fail0:
     // finish objects
     DebugObjectGlobal_Finish();
     return 1;
-
-event_loop:
-    // enter event loop
-    BLog(BLOG_NOTICE, "entering event loop");
-    int ret = BReactor_Exec(&ss);
-
-    // free reactor
-    BReactor_Free(&ss);
-
-    // free logger
-    BLog(BLOG_NOTICE, "exiting");
-    BLog_Free();
-
-    // finish objects
-    DebugObjectGlobal_Finish();
-
-    return ret;
 }

 void terminate (void)
 {
     BLog(BLOG_NOTICE, "tearing down");

-    // allow freeing local receive flows
-    PacketPassFairQueue_PrepareFree(&device.output_queue);
-
-    // free peers
-    LinkedList2Node *node;
-    while (node = LinkedList2_GetFirst(&peers)) {
-        struct peer_data *peer = UPPER_OBJECT(node, struct peer_data, list_node);
-
-        // free relaying
-        if (peer->have_relaying) {
-            struct peer_data *relay = peer->relaying_peer;
-            ASSERT(relay->is_relay)
-            ASSERT(relay->have_link)
-
-            // free relay provider
-            peer_dealloc_relay_provider(relay);
-        }
-
-        // free relay provider
-        if (peer->is_relay) {
-            peer_dealloc_relay_provider(peer);
-        }
-
-        // free relay source
-        DataProtoRelaySource_FreeRelease(&peer->relay_source);
-
-        // deallocate peer
-        peer_dealloc(peer);
-    }
-
-    // free server
-    ServerConnection_Free(&server);
-
-    // free frame decider
-    FrameDecider_Free(&frame_decider);
-
-    // free device output
-    PacketPassFairQueue_Free(&device.output_queue);
-
-    // free device input
-    SinglePacketBuffer_Free(&device.input_buffer);
-    PacketPassInterface_Free(&device.input_interface);
-
-    // free device
-    BTap_Free(&device.btap);
-
-    // free listeners
-    if (options.transport_mode == TRANSPORT_MODE_TCP) {
-        for (int i = num_bind_addrs - 1; i >= 0; i--) {
-            PasswordListener_Free(&listeners[i]);
-        }
-    }
-
-    if (options.ssl) {
-        // free client certificate and private key
-        CERT_DestroyCertificate(client_cert);
-        SECKEY_DestroyPrivateKey(client_key);
-
-        // free server cache
-        ASSERT_FORCE(SSL_ShutdownServerSessionIDCache() == SECSuccess)
-
-        // free client cache
-        SSL_ClearSessionCache();
-
-        // free NSS
-        ASSERT_FORCE(NSS_Shutdown() == SECSuccess)
-
-        // free NSPR
-        ASSERT_FORCE(PR_Cleanup() == PR_SUCCESS)
-        PL_ArenaFinish();
-    }
-
-    // remove signal handler
-    BSignal_Finish();
-
-    // exit reactor
-    BReactor_Quit(&ss, 1);
+    // exit event loop
+    BReactor_Quit(&ss, 0);
 }

 void print_help (const char *name)


Allow topic qos to be specified on command line.

--- client/client.c
+++ client/client.c
@@ -135,6 +135,7 @@
 	printf(" -i specifies the id to use for this client. Defaults to mosquitto_client_ appended with the process id.\n");
 	printf(" -k specifies the keep alive in seconds for this client. Defaults to 60.\n");
 	printf(" -p specifies the network port to connect to. Defaults to 1883.\n");
+	printf(" -q specifies the quality of service level to use for the subscription. Defaults to 0.\n");
 	printf(" -t specifies the mqtt topic to subscribe to. Defaults to #.\n");
 }

@@ -198,6 +199,20 @@
 				}
 			}
 			i+=2;
+		}else if(!strcmp(argv[i], "-q") || !strcmp(argv[i], "--qos")){
+			if(i==argc-1){
+				fprintf(stderr, "Error: -q argument given but no QoS specified.\n\n");
+				print_usage();
+				return 1;
+			}else{
+				topic_qos = atoi(argv[i+1]);
+				if(topic_qos<0 || topic_qos>2){
+					fprintf(stderr, "Error: Invalid QoS given: %d\n", topic_qos);
+					print_usage();
+					return 1;
+				}
+			}
+			i+=2;
 		}else if(!strcmp(argv[i], "-t") || !strcmp(argv[i], "--topic")){
 			if(i==argc-1){
 				fprintf(stderr, "Error: -t argument given but no topic specified.\n\n");


client: free link in peer_reset, do not require relay destinations to have a link

--- client/client.c
+++ client/client.c
@@ -1704,6 +1704,14 @@
 {
     peer_log(peer, BLOG_NOTICE, "resetting");

+    // free link
+    if (peer->have_link) {
+        if (peer->is_relay) {
+            peer_disable_relay_provider(peer);
+        }
+        peer_free_link(peer);
+    }
+
     if (peer_am_master(peer)) {
         // if we're the master, schedule retry
         BReactor_SetTimer(&ss, &peer->reset_timer);
@@ -2121,12 +2129,6 @@
             goto out;
         }

-        // check if the destination peer has link
-        if (!dest_peer->have_link) {
-            peer_log(peer, BLOG_NOTICE, "relay destination peer has no link");
-            goto out;
-        }
-
         relay_dest = dest_peer;
     }


yaz-client: fail bad show args

yaz-client: fail bad show args

--- client/client.c
+++ client/client.c
@@ -2783,36 +2783,50 @@

 /* PRESENT SERVICE ----------------------------- */

-static void parse_show_args(const char *arg_c, char *setstring,
-                            Odr_int *start, Odr_int *number)
-{
-    char arg[40];
-    char *p;
-
-    strncpy(arg, arg_c, sizeof(arg)-1);
-    arg[sizeof(arg)-1] = '\0';
-
-    if ((p = strchr(arg, '+')))
-    {
-        *number = odr_atoi(p + 1);
-        *p = '\0';
-    }
-    if (*arg)
-    {
-        if (!strcmp(arg, "all"))
-        {
-            *number = last_hit_count;
-            *start = 1;
-        }
-        else
-            *start = odr_atoi(arg);
-    }
-    if (p && (p=strchr(p+1, '+')))
-        strcpy(setstring, p+1);
-    else if (setnumber >= 0)
+static int parse_show_args(const char *arg_c, char *setstring,
+                           Odr_int *start, Odr_int *number)
+{
+    char *end_ptr;
+
+    if (setnumber >= 0)
         sprintf(setstring, "%d", setnumber);
     else
         *setstring = '\0';
+
+    if (!strcmp(arg_c, "all"))
+    {
+        *number = last_hit_count;
+        *start = 1;
+    }
+    *start = odr_strtol(arg_c, &end_ptr, 10);
+    if (end_ptr == arg_c || *end_ptr == '\0')
+        return 1;
+    while (isspace(*(unsigned char *)end_ptr))
+        end_ptr++;
+    if (*end_ptr != '+')
+    {
+        printf("Bad show arg: expected +. Got %s\n", end_ptr);
+        return 0;
+    }
+    end_ptr++;
+    arg_c = end_ptr;
+    *number = odr_strtol(arg_c, &end_ptr, 10);
+    if (end_ptr == arg_c)
+    {
+        printf("Bad show arg: expected number after +\n");
+        return 0;
+    }
+    if (*end_ptr == '\0')
+        return 1;
+    while (isspace(*(unsigned char *)end_ptr))
+        end_ptr++;
+    if (*end_ptr != '+')
+    {
+        printf("Bad show arg: + expected. Got %s\n", end_ptr);
+        return 0;
+    }
+    strcpy(setstring, end_ptr+1);
+    return 1;
 }

 static int send_presentRequest(const char *arg)
@@ -2825,7 +2839,8 @@

     req->referenceId = set_refid(out);

-    parse_show_args(arg, setstring, &setno, &nos);
+    if (!parse_show_args(arg, setstring, &setno, &nos))
+        return 0;
     if (*setstring)
         req->resultSetId = setstring;

@@ -2916,7 +2931,8 @@

     if (!sr)
         return 0;
-    parse_show_args(arg, setstring, &setno, &nos);
+    if (!parse_show_args(arg, setstring, &setno, &nos))
+        return 0;
     sr->u.request->startRecord = odr_intdup(out, setno);
     sr->u.request->maximumRecords = odr_intdup(out, nos);
     if (record_schema)


modif list chainee

modif list chainee

--- Sources/chain/pile.c
+++ Sources/chain/pile.c
@@ -39,7 +39,7 @@
     e->data = p;
     e->next = NULL;
     e->precedent = NULL;
-    if (l->size == 0) l->last = e;
+    if (l->size != 0) l->first = e;
     else {
         l->first->next = e;
         e->precedent = l->first;


Show OPAC shelvingData

Show OPAC shelvingData

--- client/client.c
+++ client/client.c
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data
  * See the file LICENSE for details.
  *
- * $Id: client.c,v 1.234 2004-03-01 17:33:02 adam Exp $
+ * $Id: client.c,v 1.235 2004-03-10 19:42:45 adam Exp $
  */

 #include <stdio.h>
@@ -916,6 +916,8 @@
 		    printf ("shelvingLocation: %s\n", data->shelvingLocation);
 		if (data->callNumber)
 		    printf ("callNumber: %s\n", data->callNumber);
+		if (data->shelvingData)
+		    printf ("shelvingData: %s\n", data->shelvingData);
 		if (data->copyNumber)
 		    printf ("copyNumber: %s\n", data->copyNumber);
 		if (data->publicNote)


A tiny bit of housekeeping.

A tiny bit of housekeeping.

--- SpectacleUtilities.h
+++ SpectacleUtilities.h
@@ -25,8 +25,6 @@
 #pragma mark -

 #define WindowRectToString(windowRect) [NSString stringWithFormat: @"(%f, %f) %fx%f", windowRect.origin.x, windowRect.origin.y, windowRect.size.width, windowRect.size.height]
-
-#pragma mark -

 enum {
     SpectacleIsTrusted,