fixed photoz back

fixed photoz back

git-svn-id: ff161d7bf9932b9502760ab749a51029bb9517c1@12 75dff457-8751-0410-ab1a-cd701654ce6b

--- src/k_fit_photoz.c
+++ src/k_fit_photoz.c
@@ -24,47 +24,17 @@
 static double *pz_model_flux=NULL;
 static double *pz_galaxy_flux=NULL;
 static double *pz_galaxy_invvar=NULL;
-static double *pz_ematrix1=NULL;
 static double *pz_coeffspnorm=NULL;
-static double *pz_coeffs1=NULL;
 static double pz_z,pz_linepos;
 static IDL_LONG pz_nt,pz_nz,pz_nk,pz_nb,pz_puse,pz_np,pz_p;
-
-#if 0
-static double pz_coeffsps[12]={
-	0.07,0.08,-0.19,
-	0.011,0.085,-0.17,
-	0.009,0.09,-0.15,
-	0.03,0.09,-0.1
-};
-static double pz_coeffspe[12]={
-	0.011,0.085,-0.17,
-	0.009,0.09,-0.15,
-	0.03,0.09,-0.1,
-	0.12,0.08,0.14
-};
-#endif
-
-static double pz_coeffsps[12]={
-	0.04,0.082,-0.185,
-	0.04,0.082,-0.175,
-	0.04,0.082,-0.15,
-	0.04,0.082,-0.1
-};
-static double pz_coeffspe[12]={
-	0.04,0.082,-0.175,
-	0.04,0.082,-0.15,
-	0.04,0.082,-0.1,
-	0.04,0.082,0.0
-};

 double pz_calc_chi2(double z)
 {
 	double *model_flux,chi2;
 	IDL_LONG k;

-	k_model_fluxes(pz_ematrix1,1,pz_zvals,pz_nz,pz_rmatrix,
-								 pz_nk,pz_nb,pz_coeffs1,&z,pz_model_flux,1);
+	k_model_fluxes(pz_ematrix,pz_nt,pz_zvals,pz_nz,pz_rmatrix,
+								 pz_nk,pz_nb,pz_coeffs,&z,pz_model_flux,1);
 	chi2=0.;
 	for(k=0;k<pz_nk;k++)
 		chi2+=(pz_model_flux[k]-pz_galaxy_flux[k])
@@ -73,101 +43,19 @@
 	return(chi2);
 } /* end pz_calc_chi2 */

-double pz_line_fit(double linepos)
-{
-	double sl,chi2;
-	IDL_LONG b,i,j;
-
-	for(i=0;i<pz_np;i++) {
-#if 0
-		fprintf(stderr,"%e %e\n",pz_coeffspnorm[i+1]/pz_coeffspnorm[pz_np],linepos);
-#endif
-		if(pz_coeffspnorm[i]/pz_coeffspnorm[pz_np]<linepos &&
-			 pz_coeffspnorm[i+1]/pz_coeffspnorm[pz_np]>linepos)
-			break;
-	}
-	if(i==pz_np) i=pz_np-1;
-	sl=(linepos*pz_coeffspnorm[pz_np]-pz_coeffspnorm[i])
-		/(pz_coeffspnorm[i+1]-pz_coeffspnorm[i]);
-	pz_coeffs[0]=1.;
-	for(j=1;j<pz_nt;j++)
-		pz_coeffs[j]=pz_coeffsps[i*(pz_nt-1)+(j-1)]
-			+(pz_coeffspe[i*(pz_nt-1)+(j-1)]-pz_coeffsps[i*(pz_nt-1)+(j-1)])*sl;
-
-	for(b=0;b<pz_nb;b++) {
-		pz_ematrix1[b]=0.;
-		for(j=0;j<pz_nt;j++)
-			pz_ematrix1[b]+=pz_coeffs[j]*pz_ematrix[j*pz_nb+b];
-	} /* end for b */
-
-	k_fit_coeffs(pz_ematrix1,1,pz_zvals,pz_nz,pz_rmatrix,
-							 pz_nk,pz_nb,pz_coeffs1,pz_galaxy_flux,pz_galaxy_invvar,&pz_z,1);
-	chi2=pz_calc_chi2(pz_z);
-
-#if 0
-	fprintf(stderr,"%e %e %d %e %e\n",pz_z,linepos,i,sl,chi2);
-#endif
-
-	return(chi2);
-} /* end pz_line_fit */
-
 /* calculates chi2 */
 double pz_fit_coeffs(double z)
 {
-	double chi2min,az,bz,cz;
+	double chi2,az,bz,cz;
 	IDL_LONG i,k;
-
-	/* find the best along the chain */
-	az=0.;
-	bz=0.5;
-	cz=1.;
-	pz_z=z;
-	chi2min=k_brent(az,bz,cz,pz_line_fit,TOL,&pz_linepos);
-#if 0
-	fprintf(stderr,"linepos=%e\n",pz_linepos); fflush(stderr);
-#endif
-
-	return(chi2min);
-
-#if 0
-	/* try the best of several piece-wise fits */
-	chi2min=-1.;
-	for(pz_p=0;pz_p<pz_np;pz_p++) {
-
-		/* fit coeffs along this line */
-		k_fit_coeffs(&(pz_ematrix1[pz_p*pz_nb*2]),2,pz_zvals,pz_nz,pz_rmatrix,
-								 pz_nk,pz_nb,pz_coeffs1,pz_galaxy_flux,pz_galaxy_invvar,&z,1);
-
-		if(pz_coeffs1[1]/pz_coeffs1[0]>0. && pz_coeffs1[1]/pz_coeffs1[0]<1.) {
-			/* calculate chi2 ... */
-			chi2=pz_calc_chi2(z);
-		} else {
-			/* unless the best fit is off the edge of the line. in this case
-				 pick the best edge */
-#if 0
-			fprintf(stderr,"yuckky\n");
-#endif
-			pz_coeffs1[1]=0.;
-			chi2lo=pz_calc_chi2(z);
-			pz_coeffs1[1]=pz_coeffs1[0];
-			chi2hi=pz_calc_chi2(z);
-			chi2=(chi2lo<chi2hi) ? chi2lo : chi2hi;
-		} /* end if..else */
-
-		/* is this the best fit so far? if so, keep it */
-		if(chi2min<0. || chi2<chi2min) {
-			chi2min=chi2;
-			pz_puse=pz_p;
-		} /* end if */
-#if 0
-		fprintf(stderr,"puse=%d p=%d chi2=%e %e %e\n",pz_puse,pz_p,chi2,
-						pz_coeffs1[0],pz_coeffs1[1]/pz_coeffs1[0]);
-		fflush(stdout);
-#endif
-
-	} /* end for p */
-#endif
-
+
+	/* fit coeffs */
+	k_fit_coeffs(pz_ematrix,pz_nt,pz_zvals,pz_nz,pz_rmatrix,
+							 pz_nk,pz_nb,pz_coeffs,pz_galaxy_flux,pz_galaxy_invvar,
+							 &z,1);
+
+	chi2=pz_calc_chi2(z);
+	return(chi2);
 } /* end pz_fit_coeffs */

 /* fit redshift and coefficients, given information about the templates and
@@ -188,7 +76,6 @@
 {
 	double *zgrid,*chi2,chi2min,az,bz,cz,sl;
 	IDL_LONG i,j,k,b,p,nzsteps,jmin;
-	IDL_LONG np=1;

 	/* allocate memory */
 	pz_nk=nk;
@@ -208,44 +95,8 @@
 	pz_coeffs=(double *) malloc(pz_nt*sizeof(double));
 	pz_galaxy_flux=(double *) malloc(pz_nk*sizeof(double));
 	pz_galaxy_invvar=(double *) malloc(pz_nk*sizeof(double));
-	pz_np=np;
-	pz_coeffspnorm=(double *) malloc((pz_np+1)*sizeof(double));
-	pz_ematrix1=(double *) malloc(pz_nb*sizeof(double));
-	pz_coeffs1=(double *) malloc(1*sizeof(double));

-	/* set up piece-wise stuff */
-#if 0
-	fprintf(stderr,"pz_np=%d\n",pz_np); fflush(stdout);
-#endif
-	pz_coeffspnorm[0]=0.;
-	for(p=0;p<pz_np;p++) {
-		pz_coeffspnorm[p+1]=pz_coeffspnorm[p]*pz_coeffspnorm[p];
-		for(j=1;j<pz_nt;j++) {
-			pz_coeffspnorm[p+1]+=((pz_coeffspe[(pz_nt-1)*p+j-1]
-														 -pz_coeffsps[(pz_nt-1)*p+j-1])*
-														(pz_coeffspe[(pz_nt-1)*p+j-1]
-														 -pz_coeffsps[(pz_nt-1)*p+j-1]));
-		} /* end for j */
-		pz_coeffspnorm[p+1]=sqrt(pz_coeffspnorm[p+1]);
-#if 0
-		fprintf(stderr,"pz_coeffspnorm=%e\n",pz_coeffspnorm[p+1]);
-#endif
-#if 0
-		for(b=0;b<pz_nb;b++) {
-			pz_ematrix1[pz_nb*2*p+0*pz_nb+b]=pz_ematrix[0*pz_nb+b];
-			pz_ematrix1[pz_nb*2*p+1*pz_nb+b]=0.;
-			for(j=1;j<pz_nt;j++) {
-				pz_ematrix1[pz_nb*2*p+0*pz_nb+b]+=pz_ematrix[pz_nb*j+b]
-					*pz_coeffsps[(pz_nt-1)*p+j-1];
-				pz_ematrix1[pz_nb*2*p+1*pz_nb+b]+=
-					pz_ematrix[pz_nb*j+b]*
-					(pz_coeffspe[(pz_nt-1)*p+j-1]-pz_coeffsps[(pz_nt-1)*p+j-1]);
-			} /* end for j */
-		} /* end for b */
-#endif
-	} /* end for p */
-
-	nzsteps=(int) floor((zvals[nz-1]-zvals[0])/ZRES);
+	nzsteps=(IDL_LONG) floor((zvals[nz-1]-zvals[0])/ZRES);
 	zgrid=(double *) malloc(nzsteps*sizeof(double));
 	chi2=(double *) malloc(nzsteps*sizeof(double));
 	for(j=0;j<nzsteps;j++)
@@ -286,34 +137,10 @@
 		} /* end if..else */
 		chi2min=k_brent(az,bz,cz,pz_fit_coeffs,TOL,&(galaxy_z[i]));

-		/* calculate coeffs for this redshift */
-		pz_z=galaxy_z[i];
-		chi2min=k_brent(0.,0.5,1.,pz_line_fit,TOL,&pz_linepos);
-
-		for(p=0;p<pz_np;p++)
-			if(pz_coeffspnorm[p]/pz_coeffspnorm[pz_np]<pz_linepos &&
-				 pz_coeffspnorm[p+1]/pz_coeffspnorm[pz_np]>pz_linepos)
-				break;
-		if(p==pz_np) p=pz_np-1;
-		sl=(pz_linepos*pz_coeffspnorm[pz_np]-pz_coeffspnorm[p])
-			/(pz_coeffspnorm[p+1]-pz_coeffspnorm[p]);
-		coeffs[0]=pz_coeffs1[0];
-		for(j=1;j<pz_nt;j++)
-			coeffs[j]=coeffs[0]*(pz_coeffsps[p*(pz_nt-1)+(j-1)]
-													 +(pz_coeffspe[p*(pz_nt-1)+(j-1)]
-														 -pz_coeffsps[p*(pz_nt-1)+(j-1)])*sl);
-
-#if 0
-		k_fit_coeffs(pz_ematrix,pz_nt,pz_zvals,pz_nz,pz_rmatrix,pz_nk,pz_nb,
-								 &(coeffs[i*nt]),pz_galaxy_flux,pz_galaxy_invvar,
-								 &(galaxy_z[i]),1);
-
-#endif
-
-#if 0
-		pz_fit_coeffs(galaxy_z[i]);
-#endif
-
+		/* evaluate coefficients at final z */
+		chi2min=pz_fit_coeffs(galaxy_z[i]);
+		for(j=0;j<nt;j++)
+			coeffs[i*nt+j]=pz_coeffs[j];
 	} /* end for i */

@@ -324,9 +151,6 @@
 	FREEVEC(pz_galaxy_invvar);
 	FREEVEC(pz_model_flux);
 	FREEVEC(pz_coeffs);
-	FREEVEC(pz_coeffs1);
-	FREEVEC(pz_coeffspnorm);
-	FREEVEC(pz_ematrix1);
 	FREEVEC(zgrid);
 	FREEVEC(chi2);
 	return(1);


replaced various return GP_ERROR by return translate_ptp_result (ret);
to give the correct error

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

--- camlibs/ptp2/library.c
+++ camlibs/ptp2/library.c
@@ -1508,7 +1508,7 @@
 				if (ret != PTP_RC_OK) {
 					gp_context_error (context, _("Canon enable viewfinder failed: %d"), ret);
 					SET_CONTEXT_P(params, NULL);
-					return GP_ERROR;
+					return translate_ptp_result (ret);
 				}
 				params->canon_viewfinder_on = 1;
 			}
@@ -1516,7 +1516,7 @@
 			if (ret != PTP_RC_OK) {
 				gp_context_error (context, _("Canon get viewfinder image failed: %d"), ret);
 				SET_CONTEXT_P(params, NULL);
-				return GP_ERROR;
+				return translate_ptp_result (ret);
 			}
 			gp_file_set_data_and_size ( file, (char*)data, size );
 			gp_file_set_mime_type (file, GP_MIME_JPEG);     /* always */
@@ -1545,13 +1545,13 @@
 				ret = ptp_canon_eos_setdevicepropvalue (params, PTP_DPC_CANON_EOS_EVFOutputDevice, &val, PTP_DTC_UINT32);
 				if (ret != PTP_RC_OK) {
 					gp_log (GP_LOG_ERROR,"ptp2_prepare_eos_preview", "setval of evf outputmode to 2 failed!");
-					return GP_ERROR;
+					return translate_ptp_result (ret);
 				}
 			}
 			ptp_free_devicepropdesc (&dpd);

 			while (tries--) {
-				/* Poll for camera events */
+				/* Poll for camera events (should perhaps handle them?) */
 				ptp_check_eos_events (params);
 				ret = ptp_canon_eos_get_viewfinder_image (params , &data, &size);
 				if (ret == PTP_RC_OK) {
@@ -1578,7 +1578,7 @@
 					}
 					gp_log (GP_LOG_ERROR,"ptp2_capture_eos_preview", "get_viewfinder_image failed: 0x%x", ret);
 					SET_CONTEXT_P(params, NULL);
-					return GP_ERROR;
+					return translate_ptp_result (ret);
 				}
 			}
 			gp_log (GP_LOG_ERROR,"ptp2_capture_eos_preview","get_viewfinder_image failed after 20 tries with ret: 0x%x\n", ret);
@@ -1609,7 +1609,7 @@
 			if (ret != PTP_RC_OK) {
 				gp_context_error (context, _("Nikon enable liveview failed: %x"), ret);
 				SET_CONTEXT_P(params, NULL);
-				return GP_ERROR;
+				return translate_ptp_result (ret);
 			}
 			while (ptp_nikon_device_ready(params) != PTP_RC_OK) /* empty */;
 		}
@@ -1855,7 +1855,7 @@
 		ret = ptp_getobjectinfo (params, newobject, &oi);
 		if (ret != PTP_RC_OK) {
 			gp_log (GP_LOG_ERROR,"nikon_capture","getobjectinfo(%x) failed: %d", newobject, ret);
-			return GP_ERROR_IO;
+			return translate_ptp_result (ret);
 		}
 		if (oi.ParentObject != 0)
 			gp_log (GP_LOG_ERROR,"nikon_capture", "Parentobject is 0x%lx now?", (unsigned long)oi.ParentObject);
@@ -1924,7 +1924,7 @@
 	ret = ptp_canon_eos_capture (params);
 	if (ret != PTP_RC_OK) {
 		gp_context_error (context, _("Canon EOS Capture failed: %x"), ret);
-		return GP_ERROR;
+		return translate_ptp_result (ret);
 	}

 	newobject = 0;
@@ -2463,7 +2463,7 @@
 			ret = ptp_check_eos_events (params);
 			if (ret != PTP_RC_OK) {
 				gp_context_error (context, _("Canon EOS Get Changes failed: %x"), ret);
-				return GP_ERROR;
+				return translate_ptp_result (ret);
 			}
 			if (!ptp_get_one_eos_event (params, &entry)) {
 				for (i=sleepcnt;i--;) {


Initialize prev_ly_errno to prevent corruption.

Earlier if a option of LYD_OPT_NOEXTDEPS | LYD_OPT_TRUSTED was passed to lyd_parse_mem, ignore_fail was 2.
So prev_ly_errno was left uninitialized as code didn't reach line 8008.

And we updated this junk value of prev_ly_errno back to ly_errno at line 8153.

As a result of which lyd_parse_mem returned NULL as ly_errno was set to some junk value.

--- src/resolve.c
+++ src/resolve.c
@@ -7983,7 +7983,7 @@
     int rc, progress, ignore_fail;
     enum int_log_opts prev_ilo;
     struct ly_err_item *prev_eitem;
-    LY_ERR prev_ly_errno;
+    LY_ERR prev_ly_errno = ly_errno;
     struct lyd_node *parent;
     struct lys_when *when;

@@ -8005,7 +8005,6 @@
     LOGVRB("Resolving unresolved data nodes and their constraints...");
     if (!ignore_fail) {
         /* remember logging state only if errors are generated and valid */
-        prev_ly_errno = ly_errno;
         ly_ilo_change(ctx, ILO_STORE, &prev_ilo, &prev_eitem);
     }


Add property to handle MediaHandlerManager in Endpoint constructor

--- src/kms-endpoint.c
+++ src/kms-endpoint.c
@@ -1,4 +1,5 @@
 #include "kms-endpoint.h"
+#include "kms-media-handler-manager.h"
 #include <glib.h>

 #define KMS_ENDPOINT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), KMS_TYPE_ENDPOINT, KmsEndpointPriv))
@@ -7,12 +8,14 @@
 	gchar *localname;
 	gulong local_count;
 	GStaticMutex local_count_mutex;
+	KmsMediaHandlerManager *manager;
 };

 enum {
 	PROP_0,

-	PROP_LOCALNAME
+	PROP_LOCALNAME,
+	PROP_MANAGER
 };

 G_DEFINE_TYPE(KmsEndpoint, kms_endpoint, G_TYPE_OBJECT);
@@ -38,6 +41,15 @@
 		free_localname(self);
 		self->priv->localname = g_value_dup_string(value);
 		break;
+	case PROP_MANAGER: {
+		gpointer pmanager = g_value_get_pointer(value);
+		if (KMS_IS_MEDIA_HANDLER_MANAGER(pmanager))
+			self->priv->manager = g_object_ref(
+					KMS_MEDIA_HANDLER_MANAGER(pmanager));
+		else
+			self->priv->manager = NULL;
+		break;
+	}
 	default:
 		/* We don't have any other property... */
 		G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
@@ -100,6 +112,19 @@
 }

 static void
+kms_endpoint_dispose(GObject *gobject) {
+	KmsEndpoint *self = KMS_ENDPOINT(gobject);
+
+	if (self->priv->manager  != NULL) {
+		g_object_unref(self->priv->manager);
+		self->priv->manager = NULL;
+	}
+
+	/* Chain up to the parent class */
+	G_OBJECT_CLASS(kms_endpoint_parent_class)->dispose(gobject);
+}
+
+static void
 kms_endpoint_finalize(GObject *gobject) {
 	KmsEndpoint *self = KMS_ENDPOINT(gobject);

@@ -119,6 +144,7 @@

 	gobject_class->set_property = endpoint_set_property;
 	gobject_class->get_property = endpoint_get_property;
+	gobject_class->dispose = kms_endpoint_dispose;
 	gobject_class->finalize = kms_endpoint_finalize;

 	pspec = g_param_spec_string("localname", "Endpoint local name",
@@ -127,6 +153,13 @@
 					G_PARAM_READWRITE);

 	g_object_class_install_property(gobject_class, PROP_LOCALNAME, pspec);
+
+	pspec = g_param_spec_pointer("manager", "The media handler manager",
+					"Media handler manager that will "
+					"provide a media handler factory",
+					G_PARAM_WRITABLE);
+
+	g_object_class_install_property(gobject_class, PROP_MANAGER, pspec);

 	/* Set default implementation to avoid segment violation errors */
 	klass->create_connection = default_create_connection;
@@ -139,4 +172,5 @@
 	self->priv->localname = NULL;
 	self->priv->local_count = 0;
 	g_static_mutex_init(&(self->priv->local_count_mutex));
+	self->priv->manager = NULL;
 }


added another gigabeat

added another gigabeat

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

--- camlibs/ptp2/library.c
+++ camlibs/ptp2/library.c
@@ -650,6 +650,7 @@

 	/* Marcoen Hirschberg <marcoen@users.sourceforge.net> */
 	{"Toshiba:Gigabeat",                    0x0930, 0x000c, PTP_MTP},
+	{"Toshiba:Gigabeat MEGF-40",            0x0930, 0x0009, PTP_MTP},

 	/* From Mark Veinot */
 	{"JVC:Alneo XA-HD500", 			0x04f1, 0x6105, PTP_MTP},


Update myTok.c

Update myTok.c

--- shell/myTok.c
+++ shell/myTok.c
@@ -13,33 +13,56 @@
     return i;
 }

+char *prepName(char* curPath, char* arg0){
+     int curPathLength = 0;
+     int argLength = 0;
+     curPathLength = tokenLen(*currPath);
+     argLength = tokenLen(argv[0]);
+     char *newName = (char*) calloc(curPathLength + argLength + 2);
+     for(int i = 0; i<(curPathLength + 2 + argLength); i++){
+         if(i<curPathLength) newName[i] = currPath[i];
+	 if()
+     }
+}
+
 int launcher(int argc, char *argv[], char *envp[]){

-  int execRet = 0;
-  //we first check if the program starts with '/'
+  int rc = 0;
+  //we first check if the program starts with '/' this will be the case for explicit filenames.
   if(*argv[0] == '/'){
-	int rc = fork();
+	rc = fork();
   	if (rc < 0) { // fork failed, exit
     		write(1, "fork failed\n", 13);
     		exit(1);
     	} else
-    	if (rc == 0) { // child (new process)
-     		//char *myargs[3];
-      		//myargs[0] = strdup("wc"); // program: "wc" (word count)
-      		//myargs[1] = strdup("p3.c"); // argument: file to count
-      		//myargs[2] = NULL; // marks end of array
-     		execRet = execve(argv[0], argv, envp); // TODO: must change to execve myargs[0]
+    	if (rc == 0) { // child
+     		execve(argv[0], argv, envp);
       		write(1, "Command not found\n\n", 21);
      		exit(1);
     	}
-    	else { // parent goes down this path (main)
+    	else { // parent
       		int wc = wait(NULL);
     	}
     	return 0;
-  }else{
-  	int rc = fork();
+  }else{//if executable name is used instead.
+  	rc = fork();
   	char **currPath = envp;
-
+	if (rc < 0) { // fork failed, exit
+    		write(1, "fork failed\n", 13);
+    		exit(1);
+    	} else
+    	if (rc == 0) { // child
+		while(*currPath != 0){
+		     char *newName = prepName(*currPath , argv[0]);
+     		     execve(newName, argv, envp);
+		     currPath += 1;
+		}
+      		write(1, "Command not found\n\n", 21);
+     		exit(1);
+    	}
+    	else { // parent
+      		int wc = wait(NULL);
+    	}
   }
 }


basemixer: Disconnect pad-added signal when mixer port is unhandled

Change-Id: I0285cb262643fae087ec0922dacae02bfd448d2e

--- src/kmsbasemixer.c
+++ src/kmsbasemixer.c
@@ -99,6 +99,7 @@
 {
   KmsBaseMixer *mixer;
   GstElement *port;
+  gulong signal_id;
   gint id;
   GstPad *audio_sink_target;
   GstPad *video_sink_target;
@@ -128,6 +129,11 @@
 kms_base_mixer_port_data_destroy (gpointer data)
 {
   KmsBaseMixerPortData *port_data = (KmsBaseMixerPortData *) data;
+
+  if (port_data->signal_id != 0) {
+    g_signal_handler_disconnect (port_data->port, port_data->signal_id);
+    port_data->signal_id = 0;
+  }

   g_clear_object (&port_data->port);
   g_slice_free (KmsBaseMixerPortData, data);
@@ -484,8 +490,8 @@
   GST_DEBUG_OBJECT (mixer, "Adding new port %d", *id);
   port_data = kms_base_mixer_port_data_create (mixer, mixer_end_point, *id);

-  g_signal_connect (G_OBJECT (mixer_end_point), "pad-added",
-      G_CALLBACK (end_point_pad_added), port_data);
+  port_data->signal_id = g_signal_connect (G_OBJECT (mixer_end_point),
+      "pad-added", G_CALLBACK (end_point_pad_added), port_data);

   KMS_BASE_MIXER_LOCK (mixer);
   g_hash_table_insert (mixer->priv->ports, id, port_data);


added Sony DSC-H5.

added Sony DSC-H5.

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

--- camlibs/ptp2/library.c
+++ camlibs/ptp2/library.c
@@ -347,6 +347,7 @@
 	/* Most Sony PTP cameras use the same product/vendor IDs. */
 	{"Sony:PTP",                  0x054c, 0x004e, 0},
 	{"Sony:DSC-H1 (PTP mode)",    0x054c, 0x004e, 0},
+	{"Sony:DSC-H5 (PTP mode)",    0x054c, 0x004e, 0},
 	{"Sony:DSC-P5 (PTP mode)",    0x054c, 0x004e, 0},
 	{"Sony:DSC-P10 (PTP mode)",   0x054c, 0x004e, 0},
 	{"Sony:DSC-F707V (PTP mode)", 0x054c, 0x004e, 0},


Add HIP RR Type

Add HIP RR Type

--- src/rr-dict.c
+++ src/rr-dict.c
@@ -596,7 +596,7 @@
         }
         bindata.size = txt_size;
         bindata.data = rdf_data + 1;
-
+
         r = getdns_list_set_bindata(records, i, &bindata);
     }
     if (r != GETDNS_RETURN_GOOD) {
@@ -611,6 +611,67 @@
 }

 static getdns_return_t
+priv_getdns_equip_dict_with_hip_rdfs(struct getdns_dict* rdata, ldns_rr* rr,
+                                     const struct rr_def* def,
+                                     struct getdns_context* context) {
+    uint8_t alg;
+    uint8_t hit_size;
+    uint16_t key_size;
+    getdns_return_t r;
+    struct getdns_bindata hit_data;
+    struct getdns_bindata key_data;
+    /* first rdf contains the key data */
+    ldns_rdf* rdf = ldns_rr_rdf(rr, 0);
+    /* ask LDNS to parse it for us */
+    ldns_status s = ldns_rdf_hip_get_alg_hit_pk(rdf, &alg, &hit_size,
+                                                &(hit_data.data), &key_size, &(key_data.data));
+    if (s != LDNS_STATUS_OK) {
+        return GETDNS_RETURN_GENERIC_ERROR;
+    }
+    hit_data.size = hit_size;
+    key_data.size = key_size;
+
+    r = getdns_dict_set_int(rdata, def->rdata[0].name, alg);
+    r |= getdns_dict_set_bindata(rdata, def->rdata[1].name, &hit_data);
+    r |= getdns_dict_set_bindata(rdata, def->rdata[2].name, &key_data);
+    if (r != GETDNS_RETURN_GOOD) {
+        return r;
+    }
+
+    if (ldns_rr_rd_count(rr) > 1) {
+        /* servers */
+        size_t i;
+        struct getdns_bindata server_data;
+        struct getdns_list* servers = getdns_list_create_with_context(context);
+        if (!servers) {
+            return GETDNS_RETURN_MEMORY_ERROR;
+        }
+        for (i = 1; i < ldns_rr_rd_count(rr) && r == GETDNS_RETURN_GOOD; ++i) {
+            ldns_rdf* server_rdf = ldns_rr_rdf(rr, i);
+            char* name = ldns_rdf2str(server_rdf);
+            if (name == NULL) {
+                r = GETDNS_RETURN_MEMORY_ERROR;
+                break;
+            }
+            server_data.size = strlen(name) + 1;
+            server_data.data = (uint8_t*)name;
+            r = getdns_list_set_bindata(servers, i - 1, &server_data);
+            free(name);
+        }
+        if (r != GETDNS_RETURN_GOOD) {
+            getdns_list_destroy(servers);
+        } else {
+            r = getdns_dict_set_list(rdata, def->rdata[3].name, servers);
+            if (r != GETDNS_RETURN_GOOD) {
+                getdns_list_destroy(servers);
+            }
+        }
+    }
+
+    return r;
+}
+
+static getdns_return_t
 priv_getdns_equip_dict_with_rdfs(struct getdns_dict *rdata, ldns_rr *rr,
                                  struct getdns_context* context)
 {
@@ -627,6 +688,8 @@
     /* specialty handlers */
     if (def->rdata == txt_rdata) {
         return priv_getdns_equip_dict_with_txt_rdfs(rdata, rr, def, context);
+    } else if (def->rdata == hip_rdata) {
+        return priv_getdns_equip_dict_with_hip_rdfs(rdata, rr, def, context);
     }
     /* generic */
 	for (i = 0; i < ldns_rr_rd_count(rr) && r == GETDNS_RETURN_GOOD; i++) {


another coolpix 4600 id.

another coolpix 4600 id.

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

--- camlibs/ptp2/library.c
+++ camlibs/ptp2/library.c
@@ -444,6 +444,8 @@
 	{"Nikon:Coolpix 5600 (PTP mode)", 0x04b0, 0x012e, PTP_CAP},
 	/* 4600: Martin Klaffenboeck <martin.klaffenboeck@gmx.at> */
 	{"Nikon:Coolpix 4600 (PTP mode)", 0x04b0, 0x0130, 0},
+	/* 4600: Roberto Costa <roberto.costa@ensta.org>, 22 Oct 2006 */
+	{"Nikon:Coolpix 4600a (PTP mode)", 0x04b0, 0x0131, 0},
 	{"Nikon:Coolpix 5900 (PTP mode)", 0x04b0, 0x0135, PTP_CAP},
 	{"Nikon:Coolpix P1 (PTP mode)",   0x04b0, 0x0140, PTP_CAP},
 	/* Marcus Meissner */


scanner: enforce correct argument type for enums

The scanner now checks whether arguments that have an associated
<enum> have the right type.
An argument with an enum attribute must be of type int or uint,
and if the <enum> with that name has the bitfield attribute
set to true, then the argument must be of type uint.

Changes since v3:
 - Remove useless allow_null check
 - Switch to using bool
 - Clearer message on errorous input
 - Minor formatting fix

Signed-off-by: Auke Booij <906bfd5ebd70c03782d5994bcfc4a18108c4f17f@tulcod.com>
Reviewed-by: Bryce Harrington <bdb14cfc1ab8d24e13de84adc40b41ae60c13bd1@osg.samsung.com>
Reviewed-by: Nils Chr. Brause <241f9b9bed2172909aeb12ebeed776ef889f3725@googlemail.com>

--- src/scanner.c
+++ src/scanner.c
@@ -128,6 +128,7 @@
 	char *interface_name;
 	struct wl_list link;
 	char *summary;
+	char *enumeration_name;
 };

 struct enumeration {
@@ -136,6 +137,7 @@
 	struct wl_list entry_list;
 	struct wl_list link;
 	struct description *description;
+	bool bitfield;
 };

 struct entry {
@@ -540,6 +542,8 @@
 	const char *summary = NULL;
 	const char *since = NULL;
 	const char *allow_null = NULL;
+	const char *enumeration_name = NULL;
+	const char *bitfield = NULL;
 	int i, version = 0;

 	ctx->loc.line_number = XML_GetCurrentLineNumber(ctx->parser);
@@ -562,6 +566,10 @@
 			since = atts[i + 1];
 		if (strcmp(atts[i], "allow-null") == 0)
 			allow_null = atts[i + 1];
+		if (strcmp(atts[i], "enum") == 0)
+			enumeration_name = atts[i + 1];
+		if (strcmp(atts[i], "bitfield") == 0)
+			bitfield = atts[i + 1];
 	}

 	ctx->character_data_length = 0;
@@ -655,6 +663,11 @@
 				     "allow-null is only valid for objects, strings, and arrays");
 		}

+		if (enumeration_name == NULL || strcmp(enumeration_name, "") == 0)
+			arg->enumeration_name = NULL;
+		else
+			arg->enumeration_name = xstrdup(enumeration_name);
+
 		if (summary)
 			arg->summary = xstrdup(summary);

@@ -665,6 +678,16 @@
 			fail(&ctx->loc, "no enum name given");

 		enumeration = create_enumeration(name);
+
+		if (bitfield == NULL || strcmp(bitfield, "false") == 0)
+			enumeration->bitfield = false;
+		else if (strcmp(bitfield, "true") == 0)
+			enumeration->bitfield = true;
+		else
+			fail(&ctx->loc,
+                             "invalid value (%s) for bitfield attribute (only true/false are accepted)",
+                             bitfield);
+
 		wl_list_insert(ctx->interface->enumeration_list.prev,
 			       &enumeration->link);

@@ -698,6 +721,46 @@
 			ctx->protocol->description = description;
 		ctx->description = description;
 	}
+}
+
+static void
+verify_arguments(struct parse_context *ctx, struct wl_list *messages, struct wl_list *enumerations)
+{
+	struct message *m;
+	wl_list_for_each(m, messages, link) {
+		struct arg *a;
+		wl_list_for_each(a, &m->arg_list, link) {
+			struct enumeration *e, *f;
+
+			if (!a->enumeration_name)
+				continue;
+
+			f = NULL;
+			wl_list_for_each(e, enumerations, link) {
+				if(strcmp(e->name, a->enumeration_name) == 0)
+					f = e;
+			}
+
+			if (f == NULL)
+				fail(&ctx->loc,
+				     "could not find enumeration %s",
+				     a->enumeration_name);
+
+			switch (a->type) {
+			case INT:
+				if (f->bitfield)
+					fail(&ctx->loc,
+					     "bitfield-style enum must only be referenced by uint");
+				break;
+			case UNSIGNED:
+				break;
+			default:
+				fail(&ctx->loc,
+				     "enumeration-style argument has wrong type");
+			}
+		}
+	}
+
 }

 static void
@@ -723,6 +786,12 @@
 			     ctx->enumeration->name);
 		}
 		ctx->enumeration = NULL;
+	} else if (strcmp(name, "interface") == 0) {
+		struct interface *i = ctx->interface;
+
+		verify_arguments(ctx, &i->request_list, &i->enumeration_list);
+		verify_arguments(ctx, &i->event_list, &i->enumeration_list);
+
 	}
 }


[tokenization] Regenerated scanner.c

[tokenization] Regenerated scanner.c


ignore busy on live view enable for the Nikon J series

--- camlibs/ptp2/library.c
+++ camlibs/ptp2/library.c
@@ -3736,10 +3736,12 @@
 	}

 	/* On Nikon 1 series, the liveview must be enabled before capture works */
-	if (NIKON_1(params))
-		C_PTP_REP_MSG (ptp_nikon_start_liveview (params),
-			       _("Failed to enable liveview on a Nikon 1, but it is required for capture"));
-
+	if (NIKON_1(params)) {
+		ret = LOG_ON_PTP_E (ptp_nikon_start_liveview (params));
+		if ((ret != PTP_RC_OK) && (ret != PTP_RC_DeviceBusy))
+			C_PTP_REP_MSG(ret, _("Failed to enable liveview on a Nikon 1, but it is required for capture"));
+		/* OK or busy, try to proceed ... */
+	}

 	/* Nikon 2 */
 	if (	(params->deviceinfo.VendorExtensionID == PTP_VENDOR_NIKON) &&


Define class members as protected

Define class members as protected

--- src/world/Management/Battleground/Battleground.h
+++ src/world/Management/Battleground/Battleground.h
@@ -33,7 +33,7 @@
 class SERVER_DECL CBattleground : public EventableObject
 {
     // MIT start
-private:
+protected:
     WorldMap* m_mapMgr;
     uint32_t m_id;
     uint32_t m_type;


Added new API key for Flurry (production)

--- app/src/main/jni/app.c
+++ app/src/main/jni/app.c
@@ -12,6 +12,7 @@
         return (*env)->NewStringUTF(env, "***REMOVED***");
     } else {
         return (*env)->NewStringUTF(env, "***REMOVED***");
+//        return (*env)->NewStringUTF(env, "***REMOVED***");
     }
 }

@@ -20,5 +21,6 @@
         return (*env)->NewStringUTF(env, "***REMOVED***");
     } else {
         return (*env)->NewStringUTF(env, "***REMOVED***");
+//        return (*env)->NewStringUTF(env, "***REMOVED***");
     }
 }


Fix memleak.

Fix memleak.

SVN revision: 27490

--- src/lib/eet_data.c
+++ src/lib/eet_data.c
@@ -1217,18 +1217,11 @@
 			    hash = *ptr;

 			    /* Read key */
-			    key = calloc(1, eet_coder[EET_T_STRING].size);
-			    if (key)
-			      {
-				 _eet_freelist_add(key);
-				 ret = eet_data_get_type(EET_T_STRING,
-							 echnk.data,
-							 ((char *)echnk.data) + echnk.size,
-							 &key);
-				 if (ret <= 0) goto error;
-			      }
-			    else
-			      goto error;
+			    ret = eet_data_get_type(EET_T_STRING,
+						    echnk.data,
+						    ((char *)echnk.data) + echnk.size,
+						    &key);
+			    if (ret <= 0) goto error;

 			    /* Advance to next chunk */
 			    p += (4 + 4 + strlen(echnk.name) + 1 + echnk.size);


moved curwrite += result to the right place (before progress report).

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

--- camlibs/ptp2/library.c
+++ camlibs/ptp2/library.c
@@ -736,9 +736,9 @@
 		result = gp_port_write (camera->port, (char*)(bytes + curwrite), towrite);
 		if (result < 0)
 			break;
+		curwrite += result;
 		if (usecontext && (oldsize/CONTEXT_BLOCK_SIZE < curwrite/CONTEXT_BLOCK_SIZE))
 			gp_context_progress_update (context, progressid, curwrite/CONTEXT_BLOCK_SIZE);
-		curwrite += result;
 		if (result < towrite) /* short writes happen */
 			break;
 	}


less allocs!

--- src/lib/eet_data.c
+++ src/lib/eet_data.c
@@ -97,6 +97,8 @@
 	 Eet_Data_Descriptor_Hash *buckets;
       } hash;
    } elements;
+   char *strings;
+   int   strings_len;
 };

 struct _Eet_Data_Element
@@ -723,14 +725,8 @@
 void
 eet_data_descriptor_free(Eet_Data_Descriptor *edd)
 {
-   int i;
-
    _eet_descriptor_hash_free(edd);
-   for (i = 0; i < edd->elements.num; i++)
-     {
-	if (edd->elements.set[i].name) free(edd->elements.set[i].name);
-	if (edd->elements.set[i].counter_name) free(edd->elements.set[i].counter_name);
-     }
+   if (edd->strings) free(edd->strings);
    if (edd->elements.set) free(edd->elements.set);
    free(edd);
 }
@@ -743,18 +739,49 @@
 				Eet_Data_Descriptor *subtype)
 {
    Eet_Data_Element *ede;
+   int l1, l2, p1, p2, i;
+   char *ps;

    edd->elements.num++;
    edd->elements.set = realloc(edd->elements.set, edd->elements.num * sizeof(Eet_Data_Element));
    if (!edd->elements.set) return;
    ede = &(edd->elements.set[edd->elements.num - 1]);
-   ede->name = strdup(name);
+
+   l1 = strlen(name);
+   p1 = edd->strings_len;
+   if (counter_name)
+     {
+	l2 = strlen(counter_name);
+	p2 = p1 + l1 + 1;
+     }
+   else l2 = -1;
+   ps = edd->strings;
+   edd->strings_len += l1 + 1 + l2 + 1;
+   edd->strings = realloc(edd->strings, edd->strings_len);
+   if (!edd->strings)
+     {
+	edd->strings = ps;
+	return;
+     }
+   for (i = 0; i < edd->elements.num; i++)
+     {
+	edd->elements.set[i].name =
+	  edd->strings + (edd->elements.set[i].name - ps);
+	if (edd->elements.set[i].counter_name)
+	  edd->elements.set[i].counter_name =
+	  edd->strings + (edd->elements.set[i].counter_name - ps);
+     }
+   ede->name = edd->strings + p1;
+   strcpy(ede->name, name);
    ede->type = type;
    ede->group_type = group_type;
    ede->offset = offset;
    ede->count = count;
    if (counter_name)
-     ede->counter_name = strdup(counter_name);
+     {
+	ede->counter_name = edd->strings + p2;
+	strcpy(ede->counter_name, counter_name);
+     }
    else ede->counter_name = NULL;
    ede->subtype = subtype;
 }


elementary: in some case it could be NULL, resulting in dereferencing a NULL pointer.

SVN revision: 80141

--- src/lib/elm_list.c
+++ src/lib/elm_list.c
@@ -338,7 +338,7 @@
             && (!sd->multi) && (sd->selected))
      {
         it = (Elm_List_Item *)elm_list_selected_item_get(obj);
-        evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
+	if (it) evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
      }
    else if (!strcmp(ev->keyname, "Escape"))
      {


object_item: Check null in elm_object_item_del.

As all EFL del/free APIs handle null as an exception,
   elm_object_item_del() should check null as well.
@fix

--- src/lib/elm_main.c
+++ src/lib/elm_main.c
@@ -1837,6 +1837,7 @@

 EAPI void elm_object_item_del(Elm_Object_Item *it)
 {
+   if (!it) return;
    _elm_widget_item_del((Elm_Widget_Item *)it);
 }


config: ELM_CONFIG_VERSION update

config: ELM_CONFIG_VERSION update

Summary: This patch updates ELM_CONFIG_VERSION according to elementary key binding.

Test Plan: None

Reviewers: raster, Hermet

CC: seoz

Differential Revision: https://phab.enlightenment.org/D768

--- src/lib/elm_priv.h
+++ src/lib/elm_priv.h
@@ -122,12 +122,12 @@
 /* increment this whenever we change config enough that you need new
  * defaults for elm to work.
  */
-#define ELM_CONFIG_EPOCH           0x0001
+#define ELM_CONFIG_EPOCH           0x0002
 /* increment this whenever a new set of config values are added but
  * the users config doesn't need to be wiped - simply new values need
  * to be put in
  */
-#define ELM_CONFIG_FILE_GENERATION 0x0005
+#define ELM_CONFIG_FILE_GENERATION 0x0001
 #define ELM_CONFIG_VERSION         ((ELM_CONFIG_EPOCH << 16) | \
                                     ELM_CONFIG_FILE_GENERATION)
 /* NB: profile configuration files (.src) must have their


Removing warnings in els_icon.c

Removing warnings in els_icon.c

Enum value will be treated in next switch.

SVN revision: 52689

--- src/lib/els_icon.c
+++ src/lib/els_icon.c
@@ -213,6 +213,8 @@
       case ELM_IMAGE_ROTATE_180_CW:
          _els_smart_icon_rotate_180(sd);
          return;
+      default:
+         break;
      }

    evas_object_image_size_get(sd->obj, &iw, &ih);


env_clean(): Clear the environment memory pool also. We trust that nowadays our environment clearing code works everywhere.

--- src/lib/env-util.c
+++ src/lib/env-util.c
@@ -56,6 +56,6 @@
 	*/
 	environ = calloc(1, sizeof(*environ));
 #endif
-	/* don't clear the env_pool, otherwise the environment would get
-	   corrupted if we failed to clear it. */
+	if (env_pool != NULL)
+		p_clear(env_pool);
 }


"Can't open log file" error was missing linefeed.

--- src/lib/failures.c
+++ src/lib/failures.c
@@ -358,7 +358,7 @@
 		if (*fd == -1) {
 			*fd = STDERR_FILENO;
 			i_snprintf(buf, sizeof(buf),
-				   "Can't open log file %s: %m", path);
+				   "Can't open log file %s: %m\n", path);
 			(void)write_full(STDERR_FILENO, buf, strlen(buf));
 			failure_exit(FATAL_LOGOPEN);
 		}


Log raw backtrace when dying with "out of memory" error

--- src/lib/failures.c
+++ src/lib/failures.c
@@ -147,7 +147,7 @@
 			    args) < 0 && status == FATAL_DEFAULT)
 		status = FATAL_LOGWRITE;

-	if (type == LOG_TYPE_PANIC) {
+	if (type == LOG_TYPE_PANIC || status == FATAL_OUTOFMEM) {
 		if (backtrace_get(&backtrace) == 0)
 			i_error("Raw backtrace: %s", backtrace);
 	}


more fixes for split multicast socket case

--- ccnd/udplink/udplink.c
+++ ccnd/udplink/udplink.c
@@ -287,6 +287,7 @@
     int remotesock_r = 0;
     char canonical_remote[NI_MAXHOST] = "";
     struct addrinfo *raddrinfo = NULL;
+    struct addrinfo *raddrinfoz = NULL;
     struct addrinfo *laddrinfo = NULL;
     struct addrinfo hints = {0};
     struct pollfd fds[2];
@@ -364,6 +365,12 @@

     }
     result = bind(remotesock_r, laddrinfo->ai_addr, laddrinfo->ai_addrlen);
+    if (result == -1 && errno == EADDRINUSE) {
+
+        result = getaddrinfo(options.remotehostname, NULL, &hints, &raddrinfoz);
+        if (result == -1) udplink_fatal("getaddrinfo()");
+        result = bind(remotesock_r, raddrinfoz->ai_addr, raddrinfoz->ai_addrlen);
+    }
     if (result == -1) {
         udplink_fatal("bind(remotesock_r, local...): %s\n", strerror(errno));
     }


Removed is_empty_str() macro. Nothing used it, and it's not very useful anyway.

--- src/lib/strfuncs.h
+++ src/lib/strfuncs.h
@@ -1,8 +1,5 @@
 #ifndef STRFUNC_H
 #define STRFUNC_H
-
-#define is_empty_str(str) \
-        ((str) == NULL || (str)[0] == '\0')

 #define MAX_INT_STRLEN ((sizeof(uintmax_t) * CHAR_BIT + 2) / 3 + 1)


>  compile U201414800 sabertazimi Linux 17aa0d73d5e3 4.8.0-46-generic #49~16.04.1-Ubuntu SMP Fri Mar 31 14:51:03 UTC 2017 x86_64 GNU/Linux  10:28:31 up 4 days, 10:19,  3 users,  load average: 0.95, 0.73, 0.49 a9b01077ec0865a43225cecb85a00531eb48a1e6

--- nemu/src/cpu/exec/exec.c
+++ nemu/src/cpu/exec/exec.c
@@ -87,7 +87,7 @@
   /* 0x30 */	EMPTY, IDEX(G2E, xor), EMPTY, EMPTY,
   /* 0x34 */	EMPTY, EMPTY, EMPTY, EMPTY,
   /* 0x38 */	EMPTY, IDEX(G2E, cmp), EMPTY, IDEX(E2G, cmp),
-  /* 0x3c */	EMPTY, IDEX(I2a, cmp), EMPTY, EMPTY,
+  /* 0x3c */	IDEXW(I2a, cmp, 1), IDEX(I2a, cmp), EMPTY, EMPTY,
   /* 0x40 */	IDEX(r, inc), IDEX(r, inc), IDEX(r, inc), IDEX(r, inc),
   /* 0x44 */	IDEX(r, inc), IDEX(r, inc), IDEX(r, inc), IDEX(r, inc),
   /* 0x48 */	IDEX(r, dec), IDEX(r, dec), IDEX(r, dec), IDEX(r, dec),


added linearization flag to template registry input file that is generated with -registry option

--- modules-local/fast-registry/src/Template_registry.c
+++ modules-local/fast-registry/src/Template_registry.c
@@ -19,6 +19,7 @@
 "# Define inputs that the initialization routine may need here:",
 "#   e.g., the name of the input file, the file root name, etc.",
 "typedef ModuleName/ModName InitInputType CHARACTER(1024) InputFile  - - -   \"Name of the input file; remove if there is no file\" -",
+"typedef   ^                ^             LOGICAL         Linearize  - .FALSE. -  \"Flag that tells this module if the glue code wants to linearize.\" -",
 "",
 "# Define outputs from the initialization routine here:",
 "typedef   ^               InitOutputType CHARACTER(ChanLen) WriteOutputHdr  {:} - -   \"Names of the output-to-file channels\" -",


Bluetooth: Refactor check_pending_conn error handling

If anything went wrong just report connection failed. This makes
code easier to read and less error prone. Also makes sure that
scanning is reenabled with correct parameters on failure.

Change-Id: I7387571f6dbf308511694a635aa47d5371a81616
Signed-off-by: Szymon Janc <b8f563e108973ccd513fe259bc96c595c4d39939@tieto.com>

--- net/bluetooth/hci_core.c
+++ net/bluetooth/hci_core.c
@@ -846,12 +846,12 @@
 	}

 	if (bt_hci_stop_scanning()) {
-		goto done;
+		goto failed;
 	}

 #if defined(CONFIG_BLUETOOTH_PRIVACY)
 	if (bt_smp_create_rpa(bt_dev.irk, &conn->le.init_addr.a)) {
-		goto done;
+		goto failed;
 	}
 	conn->le.init_addr.type = BT_ADDR_LE_RANDOM;
 #else
@@ -861,16 +861,18 @@
 	bt_addr_le_copy(&conn->le.resp_addr, addr);

 	if (hci_le_create_conn(conn)) {
-		conn->err = BT_HCI_ERR_UNSPECIFIED;
-		bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
-		bt_le_scan_update(false);
-		goto done;
+		goto failed;
 	}

 	bt_conn_set_state(conn, BT_CONN_CONNECT);
-
-done:
 	bt_conn_unref(conn);
+	return;
+
+failed:
+	conn->err = BT_HCI_ERR_UNSPECIFIED;
+	bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
+	bt_conn_unref(conn);
+	bt_le_scan_update(false);
 }

 static int set_flow_control(void)


Fixed compilation error after migration to newer glm version

--- Source/Engine/Core/include/Core/Gfx/Rectangle.h
+++ Source/Engine/Core/include/Core/Gfx/Rectangle.h
@@ -12,7 +12,7 @@
 	template <typename N>
 	class Rectangle
 	{
-		using vector2 = glm::tvec2<N, glm::precision::defaultp>;
+		using vector2 = glm::tvec2<N>;

 		vector2 _min;
 		vector2 _max;
@@ -54,7 +54,7 @@

 		auto getCenter()		const noexcept -> vector2
 		{
-			return glm::tvec2<N, glm::precision::defaultp> (
+			return glm::tvec2<N> (
 				getLeft() + getWidth() * 0.5, getBottom() + getHeight() * 0.5
 			);
 		}


Bluetooth: Remove global mutex hci_task_lock

The hci_task_lock mutex (previously a lock) was supposed to protect the
register/unregister of HCI protocols against RX/TX tasks. This will not
be needed anymore because SCO and L2CAP will always be compiled.

Moreover, with the recent move of RX/TX to workqueues per device the
global hci_task_lock was causing starvation between different HCI
devices.

Signed-off-by: Ulisses Furquim <7ed65f646802975b382ada105f3a81e68106d06c@profusion.mobi>
Acked-by: Marcel Holtmann <44592b4eea36663c86b994bb0ea99d15309c1c7d@holtmann.org>
Signed-off-by: Gustavo F. Padovan <8463bae6aa74c6c37654a5ac7ce3bbb9fe6ffff8@profusion.mobi>

--- net/bluetooth/hci_core.c
+++ net/bluetooth/hci_core.c
@@ -61,8 +61,6 @@
 static void hci_cmd_work(struct work_struct *work);
 static void hci_tx_work(struct work_struct *work);

-static DEFINE_MUTEX(hci_task_lock);
-
 /* HCI device list */
 LIST_HEAD(hci_dev_list);
 DEFINE_RWLOCK(hci_dev_list_lock);
@@ -1832,8 +1830,7 @@

 /* ---- Interface to upper protocols ---- */

-/* Register/Unregister protocols.
- * hci_task_lock is used to ensure that no tasks are running. */
+/* Register/Unregister protocols. */
 int hci_register_proto(struct hci_proto *hp)
 {
 	int err = 0;
@@ -1842,16 +1839,12 @@

 	if (hp->id >= HCI_MAX_PROTO)
 		return -EINVAL;
-
-	mutex_lock(&hci_task_lock);

 	if (!hci_proto[hp->id])
 		hci_proto[hp->id] = hp;
 	else
 		err = -EEXIST;

-	mutex_unlock(&hci_task_lock);
-
 	return err;
 }
 EXPORT_SYMBOL(hci_register_proto);
@@ -1864,15 +1857,11 @@

 	if (hp->id >= HCI_MAX_PROTO)
 		return -EINVAL;
-
-	mutex_lock(&hci_task_lock);

 	if (hci_proto[hp->id])
 		hci_proto[hp->id] = NULL;
 	else
 		err = -ENOENT;
-
-	mutex_unlock(&hci_task_lock);

 	return err;
 }
@@ -2439,8 +2428,6 @@
 	struct hci_dev *hdev = container_of(work, struct hci_dev, tx_work);
 	struct sk_buff *skb;

-	mutex_lock(&hci_task_lock);
-
 	BT_DBG("%s acl %d sco %d le %d", hdev->name, hdev->acl_cnt,
 		hdev->sco_cnt, hdev->le_cnt);

@@ -2457,8 +2444,6 @@
 	/* Send next queued raw (unknown type) packet */
 	while ((skb = skb_dequeue(&hdev->raw_q)))
 		hci_send_frame(skb);
-
-	mutex_unlock(&hci_task_lock);
 }

 /* ----- HCI RX task (incoming data processing) ----- */
@@ -2546,8 +2531,6 @@

 	BT_DBG("%s", hdev->name);

-	mutex_lock(&hci_task_lock);
-
 	while ((skb = skb_dequeue(&hdev->rx_q))) {
 		if (atomic_read(&hdev->promisc)) {
 			/* Send copy to the sockets */
@@ -2591,8 +2574,6 @@
 			break;
 		}
 	}
-
-	mutex_unlock(&hci_task_lock);
 }

 static void hci_cmd_work(struct work_struct *work)


fix tao theme bookmark color

fix tao theme bookmark color


Bluetooth: Remove unnecessary comment

Bluetooth: Remove unnecessary comment

Change-Id: I80827d4692da5e3b0ac4fcc1b75146746c8bf987
Signed-off-by: Johan Hedberg <628991c7b0a19c384f9b99c21ec330ce952bb838@intel.com>

--- net/bluetooth/hci_core.c
+++ net/bluetooth/hci_core.c
@@ -616,9 +616,6 @@
 	copy_id_addr(conn, &evt->peer_addr);
 	conn->le_conn_interval = sys_le16_to_cpu(evt->interval);

-	/* Transform prepared object to CONNECTED state and make sure in callee
-	 * to drop object reference owned in CONNECT state for initiator case.
-	 */
 	bt_conn_set_state(conn, BT_CONN_CONNECTED);

 	if (evt->role == BT_HCI_ROLE_SLAVE) {


xfreerdp-client: xi more tweaks again

xfreerdp-client: xi more tweaks again

--- client/X11/xf_interface.c
+++ client/X11/xf_interface.c
@@ -161,7 +161,9 @@
 	int ndevices, i, j;

 	XIEventMask eventmask;
-	unsigned char mask[1] = { 0 };
+	unsigned char mask[(XI_LASTEVENT + 7)/8];
+
+	ZeroMemory(mask, sizeof(mask));

 	if (XQueryExtension(xfi->display, "XInputExtension", &opcode, &event, &error))


notes

notes

--- portableUnitTests/OTRadValve/ThermalPhysicsModels.h
+++ portableUnitTests/OTRadValve/ThermalPhysicsModels.h
@@ -195,6 +195,8 @@
  *
  * Additionally, heat flow to the radvalve is modelled to allow simulating its
  * position.
+ *
+ * Modelled on DHD's office (Valve 5s, EPC Band B house).
  */
 class ThermalModelBasic
     {


SVGPropertyTearOffs should detachChildren before deleting its value.

TEST=svg/transforms/svg-matrix-tearoff-crash.html
BUG=296276

Review URL: https://codereview.chromium.org/25314003

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@158563 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/core/svg/properties/SVGPropertyTearOff.h
+++ Source/core/svg/properties/SVGPropertyTearOff.h
@@ -56,8 +56,10 @@

     void setValue(PropertyType& value)
     {
-        if (m_valueIsCopy)
+        if (m_valueIsCopy) {
+            detachChildren();
             delete m_value;
+        }
         m_valueIsCopy = false;
         m_value = &value;
     }


Fix typo in comment

Fix typo in comment

PiperOrigin-RevId: 255528444

--- tensorflow/compiler/jit/compilability_check_util.h
+++ tensorflow/compiler/jit/compilability_check_util.h
@@ -78,7 +78,7 @@
     // Whether resource variable ops are allowed are allowed in callees.  We do
     // not allow resource variable ops in called functions (either as direct TF
     // calls or as higher order control flow ops) because we do not yet model
-    // their memory effects in jit/resource_variable_safety_analysis.
+    // their memory effects in jit/resource_operation_safety_analysis.
     bool allow_resource_ops_in_called_functions;

     // Whether Stack operations are allowed.  We avoid auto-clustering Stack


Bumping the class version.

Bumping the class version.

--- STEER/STEERBase/AliDAQ.h
+++ STEER/STEERBase/AliDAQ.h
@@ -88,7 +88,7 @@
   static const char* fgkOfflineModuleName[kNDetectors]; // Names of the offline modules corresponding to the detectors
   static const char* fgkOnlineName[kNDetectors]; // Online (DAQ/ECS) detector names

-  ClassDef(AliDAQ, 3)   // ALICE DAQ Configuration class
+  ClassDef(AliDAQ, 4)   // ALICE DAQ Configuration class
 };

 #endif


porand upper case fix

porand upper case fix


fix hangup when json is closing more } than there are {

--- NppJSONViewer/json.c
+++ NppJSONViewer/json.c
@@ -1037,8 +1037,11 @@
 json_format_string (const char *text)
 {
 	size_t pos = 0, text_length;
-	unsigned int indentation = 0;	/* the current indentation level */
-	unsigned int i;		/* loop iterator variable */
+
+	// make sure these two integers are signed
+	// we want to allow negative when the json is bad
+	signed int indentation = 0;	/* the current indentation level */
+	signed int i;				/* loop iterator variable */
 	char loop;

 	rcstring *output;
@@ -1069,6 +1072,9 @@
 		case '}':
 			indentation--;
 			rcs_catc (output, '\n');
+			// the for loop will compare i with potential negative values
+			// so we don't get caught in an infinite loop if the json is faulty with more "}" than "{"
+			// we just print out the same number of faulty "}" characters.
 			for (i = 0; i < indentation; i++)
 			{
 				rcs_catc (output, '\t');


Bug 704582: Avoid SEGV in filter code.

Bug 704582: Avoid SEGV in filter code.

We were neglecting to make the fontdesc current, which lead
to a NULL dereference in adjust_text.

--- source/pdf/pdf-op-filter.c
+++ source/pdf/pdf-op-filter.c
@@ -872,6 +872,7 @@
 	if (!fontdesc)
 		return;

+	p->tos.fontdesc = fontdesc;
 	i = 0;
 	while (i < len)
 	{


Spell out a move ctor. Even the 2013 vintage of MSVC cannot synthesize move ctors.

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

--- lib/ExecutionEngine/Interpreter/Interpreter.h
+++ lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -51,7 +51,7 @@
     return *this;
   }
 #else
-  AllocaHolder(AllocaHolder &&RHS) = default;
+  AllocaHolder(AllocaHolder &&RHS) : Allocations(std::move(RHS.Allocations)) {}
 #endif

   ~AllocaHolder() {


[Mips] Do not use inheriting constructor due build problem on Windows

No functional changes.

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@233058 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
+++ lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
@@ -139,7 +139,9 @@
       ELFT::Is64Bits && ELFT::TargetEndianness == llvm::support::little;

 public:
-  using RelocationTable<ELFT>::RelocationTable;
+  MipsRelocationTable(const ELFLinkingContext &context, StringRef str,
+                      int32_t order)
+      : RelocationTable<ELFT>(context, str, order) {}

 protected:
   void writeRela(ELFWriter *writer, Elf_Rela &r, const DefinedAtom &atom,


float * vector operator

float * vector operator

--- math/vector.h
+++ math/vector.h
@@ -21,8 +21,6 @@
     vec3 operator - (const vec3 &v) const { return vec3(x-v.x,y-v.y,z-v.z);	}

     float operator * (const vec3 &v) const { return x*v.x+y*v.y+z*v.z; }
-
-    vec3 operator * (const float a) const { return vec3(x*a,y*a,z*a); }

     vec3 operator - () const { return vec3(-x,-y,-z); }

@@ -48,4 +46,7 @@
     }
 };

+inline vec3 operator * ( float a, const vec3& v ) { return vec3(v.x*a,v.y*a,v.z*a); }
+inline vec3 operator * ( const vec3& v, float a ) { return vec3(v.x*a,v.y*a,v.z*a); }
+
 }


fix memory leak in matrix test code

fix memory leak in matrix test code

--- matrix_test.c
+++ matrix_test.c
@@ -44,6 +44,7 @@
   free_matrix(foo);
   free_matrix(foo_copy);
   free_matrix(bar);
+  free_matrix(identity);
 }

 int main(int argc, char *argv[]) {


Emitter: Have functions try to use the storages of their args first.x

--- src/lily_emitter.c
+++ src/lily_emitter.c
@@ -3696,8 +3696,27 @@
         if (return_type->flags & (TYPE_IS_UNRESOLVED | TYPE_HAS_SCOOP))
             return_type = lily_ts_resolve(emit->ts, return_type);

-        lily_storage *storage = get_storage(emit, return_type);
-        storage->flags |= SYM_NOT_ASSIGNABLE;
+        int i = (emit->call_values_pos - cs->arg_count);
+        int count = cs->arg_count;
+
+        lily_storage *storage = NULL;
+
+        /* This function is done, so the storages it claimed are no longer
+           needed. Instead of getting a new storage, can one of them be used
+           instead? */
+        for (i = 0;i < count;i++) {
+            lily_sym *sym = emit->call_values[i];
+            if (sym->item_kind == ITEM_TYPE_STORAGE &&
+                sym->type == return_type) {
+                storage = (lily_storage *)sym;
+                break;
+            }
+        }
+
+        if (storage == NULL) {
+            storage = get_storage(emit, return_type);
+            storage->flags |= SYM_NOT_ASSIGNABLE;
+        }

         ast->result = (lily_sym *)storage;
         lily_u16_insert(emit->code, lily_u16_pos(emit->code) - 1,


remove conflicts

remove conflicts

--- LPDMvvmKit/Classes/ViewControllers/LPDViewController.h
+++ LPDMvvmKit/Classes/ViewControllers/LPDViewController.h
@@ -17,10 +17,6 @@

 @interface LPDViewController : UIViewController <LPDViewControllerProtocol>

-+ (instancetype) new NS_UNAVAILABLE;
-- (instancetype)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;
-- (instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil NS_UNAVAILABLE;
-
 /**
  *  @brief 禁用无关函数
  */


Emitter: Inline 'emit_final_continue', drop it.

--- src/lily_emitter.c
+++ src/lily_emitter.c
@@ -2434,15 +2434,6 @@
     emit->patches[emit->patch_pos-1] = save_jump;
 }

-/* emit_final_continue
-   This writes in a 'continue'-type jump at the end of the while, so that the
-   while runs multiple times. Since the while is definitely the top block, this
-   is a bit simpler. */
-static void emit_final_continue(lily_emit_state *emit)
-{
-    write_2(emit, o_jump, emit->current_block->loop_start);
-}
-
 /* lily_emit_jump_if
    This writes a conditional jump using the result of the given ast. The type
    of jump (true/false) depends on 'jump_on'.
@@ -2841,10 +2832,9 @@
     block = emit->current_block;
     block_type = block->block_type;

-    /* Write in a fake continue so that the end of a while jumps back up to the
-       top. */
+    /* These blocks need to jump back up when the bottom is hit. */
     if (block_type == BLOCK_WHILE || block_type == BLOCK_FOR_IN)
-        emit_final_continue(emit);
+        write_2(emit, o_jump, emit->current_block->loop_start);

     v = block->var_start;


Minor changes to String class docs

Minor changes to String class docs

--- Library/Sources/Stroika/Foundation/Characters/String.h
+++ Library/Sources/Stroika/Foundation/Characters/String.h
@@ -47,6 +47,9 @@
 /*
  * TODO:
  *
+ *
+ *		o	Make another pass over String_ExternalMemoryOwnership_StackLifetime_ReadOnly/ReadWrite documentation, and make clearer,a nd document the tricky bits loosely
+ *			alluded to in the appropriate place if the API is truely DOABLE.
  *
  *		o	At this stage - for our one trivial test - performance is now about 5% faster than visual studio.net 2010, but
  *			about a factor of 2 SLOWER than GCC (as of 2011-12-04).
@@ -627,7 +630,8 @@
 			 *	For example
 			 *		String	tmp1	=	L"FRED";
 			 *		String	tmp2	=	String (L"FRED");
-			 *		String	tmp3	=	String_ExternalMemoryOwnership_ApplicationLifetime_ReadWrite (L"FRED");
+			 *		static	wchar_t	buf[1024] = { L"FRED" };
+			 *		String	tmp3	=	String_ExternalMemoryOwnership_ApplicationLifetime_ReadWrite (buf);
 			 *
 			 *		extern String saved;
 			 *		inline	String	F(String x)			{ saved = x; x.InsertAt ('X', 1); saved = x.ToUpperCase () + "fred";  return saved; }
@@ -653,13 +657,49 @@

+			/*
+ *		o	Seriously reconsider design / semantics of String_ExternalMemoryOwnership_StackLifetime_ReadOnly/String_ExternalMemoryOwnership_StackLifetime_ReadWrite classes.
+ *			There maybe a serious / hopeless bug having todo with threads and c_str(). Suppose in one thread we do:
+ *				void	f()
+ *					{
+ *						wchar_t buf[1024] = L"fred";
+ *						String_ExternalMemoryOwnership_StackLifetime_ReadOnly tmp (buf);
+ *
+ *						// Then call some function F() with tmp - where F() passes the value (as a String) to another thread, and that other thread runs for a very long time with the string - just READING
+ *						// the string - never MODIFYING it.
+ *						//
+ *						// THEN - because of second thread owning that string - the refCount is bumped up. And suppose that other string calls s.c_str() - and is ever so briefly using the s.c_str() results - say
+ *						// in a printf() call.
+ *						//
+ *						// Now when String_ExternalMemoryOwnership_StackLifetime_ReadOnly goes out of scope - and it notices its refCount != 0, it must somehow MORPH the underlying representation into
+ *						// something SAFE (copy all the strings). But thats tricky - ESPECIALLY in light of threads and someone else doing a c_str().
+ *						//
+ *						// I guess its not IMPOSSIBLE to fix all this. You could
+ *						//			(o)		On c_str() calls - at least for this class rep - maybe always - BREAKREFERENCES() - so the lifetime of your ptr is garuanteed friendly
+ *						//			(o)		Put in enuf flags and CriticalSection code - so on String_ExternalMemoryOwnership_StackLifetime_ReadOnly () - we block until we can
+ *						//					Copy all the data safely and set a flag saying to free it at the end - as a regular string - not a String_ExternalMemoryOwnership_StackLifetime_ReadOnly::Rep (would be nice
+ *						//					to transform the rep object but thats trickier).
+ *					}
+
+ *
+			 */
+
+/*
+ * In case of trouble in stack lifetime string make bundle copy object. Store it in rep. Then next call from envelope triggers exception which forces type morph call from envelope!
+
+Think that fixes most trouble except that aLl enveoes methods now need to handle exceotion
+*/
+
+

             /*
-			 *	String_ExternalMemoryOwnership_StackLifetime_ReadOnly is a subtype of string you can use to construct a String object, so long as the memory pointed to
+			 *	String_ExternalMemoryOwnership_StackLifetime_ReadOnly is a subtype of String you can use to construct a String object, so long as the memory pointed to
 			 * in the argument has a
 			 *		o	Greater lifetime than the String_ExternalMemoryOwnership_StackLifetime_ReadOnly envelope class
 			 *		o	and buffer data never changes value externally to this String represenation
 			 *
+///REVIEW - PRETTY SURE THIS IS WRONG!!!! - UNSAFE - READONLY SHOULD mean pointer passed in is CONST - so memory may NOT be modified in this case -- LGP 2012-03-28
+/// DOBLE CHECK NO ASSIMPTIONS BELOW - WRONG - LINE NOT ASSUMED ANYWHERE
 			 *	Note that the memory passed in must be READ/WRITE - and may be modified by the String_ExternalMemoryOwnership_StackLifetime_ReadOnly ()!
 			 *
 			 *	Strings constructed with this String_ExternalMemoryOwnership_StackLifetime_ReadOnly maybe treated like normal strings - passed anywhere, and even modified via the
@@ -686,8 +726,8 @@
 			 *				F(String_ExternalMemoryOwnership_StackLifetime_ReadOnly (cs));
 			 *			}
 			 *
-			 *	These ALL do essentially the same thing, and are all equally safe. The third call to F () with String_ExternalMemoryOwnership_StackLifetime_ReadOnly() based memory maybe more efficient than the
-			 *	previous two, because the string pointed to be 'cs' never needs to be copied (now malloc/copy needed).
+			 *	These ALL do essentially the same thing, and are all equally safe. The third call to F () with String_ExternalMemoryOwnership_StackLifetime_ReadOnly()
+			 *	based memory maybe more efficient than the previous two, because the string pointed to be 'cs' never needs to be copied (now malloc/copy needed).
 			 *
 			 *		<<TODO: not sure we have all the CTOR/op= stuff done correctly for this class - must rethink - but only needed to rethink when we do
 			 *			real optimized implemenation >>
@@ -706,12 +746,12 @@
 			 *	String_ExternalMemoryOwnership_StackLifetime_ReadWrite is a subtype of string you can use to construct a String object, so long as the memory pointed to
 			 * in the argument has a
 			 *		o	Greater lifetime than the String_ExternalMemoryOwnership_StackLifetime_ReadWrite envelope class
-			 *		o	and buffer data never changes value externally to this String represenation
+			 *		o	and buffer data never changes value externally to this String represenation (but maybe changed by the String_ExternalMemoryOwnership_StackLifetime_ReadWrite implementation)
 			 *
 			 *	Note that the memory passed in must be READ/WRITE - and may be modified by the String_ExternalMemoryOwnership_StackLifetime_ReadWrite ()!
 			 *
 			 *	Strings constructed with this String_ExternalMemoryOwnership_StackLifetime_ReadWrite maybe treated like normal strings - passed anywhere, and even modified via the
-			 *	String APIs. However, the underlying implemenation may cache the argument const wchar_t* cString for as long as the lifetime of the envelope class,
+			 *	String APIs. However, the underlying implemenation may cache the argument 'wchar_t* cString' for as long as the lifetime of the envelope class,
 			 *	and re-use it as needed during this time, so only call this String constructor with great care, and then - only as a performance optimization.
 			 *
 			 *	This particular form of String wrapper CAN be a great performance optimization when a C-string buffer is presented and one must
@@ -727,15 +767,16 @@
 			 *		inline	String	F(String x)			{ saved = x; x.InsertAt ('X', 1); saved = x.ToUpperCase () + "fred";  return saved; }
 			 *
 			 *
-			 *		void f (const wchar_t* cs)
+			 *		void f ()
 			 *			{
+			 *				char	cs[1024] = L"FRED";
 			 *				F(L"FRED";);
 			 *				F(String (L"FRED"));
 			 *				F(String_ExternalMemoryOwnership_StackLifetime_ReadWrite (cs));
 			 *			}
 			 *
-			 *	These ALL do essentially the same thing, and are all equally safe. The third call to F () with String_ExternalMemoryOwnership_StackLifetime_ReadWrite() based memory maybe more efficient than the
-			 *	previous two, because the string pointed to be 'cs' never needs to be copied (now malloc/copy needed).
+			 *	These ALL do essentially the same thing, and are all equally safe. The third call to F () with String_ExternalMemoryOwnership_StackLifetime_ReadWrite()
+			 *	based memory maybe more efficient than the previous two, because the string pointed to be 'cs' never needs to be copied (until its changed inside F()).
 			 *
 			 *		<<TODO: not sure we have all the CTOR/op= stuff done correctly for this class - must rethink - but only needed to rethink when we do
 			 *			real optimized implemenation >>