added documentation to NOAPI

added documentation to NOAPI

--- NetworkObjects/NOAPI.h
+++ NetworkObjects/NOAPI.h
@@ -178,10 +178,40 @@
                                 URLSession:(NSURLSession *)urlSession
                                 completion:(void (^)(NSError *error, NSArray *results))completionBlock;

+/**
+ Fetches an instance of the resource with the specified resource ID returns a JSON representation of the resource in the completion block.
+
+ @param resourceName Name of the entity that will be fetched. If this does not match a entity description in @c self.model then an exception is raised.
+
+ @param resourceID An integer representing the unique identifier of an instance of the specified entity.
+
+ @param urlSession The URL session that will be used to create the data task. If this parameter is nil than the default URL session is used.
+
+  @param completionBlock The completion block that will be called when a response is recieved from the server. If an error occurred then the completion block's @c error argument will be set to an @c NSError instance. If there is no error then the completion block's @c resource argument will be set to an JSON-compatible dictionary representing the resource instance.
+
+ @return The data task that is communicating with the server. The data task returned is already resumed.
+
+ */
+
 -(NSURLSessionDataTask *)getResource:(NSString *)resourceName
                               withID:(NSUInteger)resourceID
                           URLSession:(NSURLSession *)urlSession
                           completion:(void (^)(NSError *error, NSDictionary *resource))completionBlock;
+
+/**
+ Takes a JSON-compatible dictionary containing new values that should be set to the properties of an instance of a resource.
+
+ @param resourceName Name of the entity that will be edited. If this does not match a entity description in @c self.model then an exception is raised.
+
+ @param resourceID An integer representing the unique identifier of an instance of the specified entity.
+
+ @param urlSession The URL session that will be used to create the data task. If this parameter is nil than the default URL session is used.
+
+ @param completionBlock The completion block that will be called when a response is recieved from the server. If an error occurred then the completion block's @c error argument will be set to an @c NSError instance.
+
+ @return The data task that is communicating with the server. The data task returned is already resumed.
+
+ */

 -(NSURLSessionDataTask *)editResource:(NSString *)resourceName
                                withID:(NSUInteger)resourceID
@@ -189,15 +219,64 @@
                            URLSession:(NSURLSession *)urlSession
                            completion:(void (^)(NSError *error))completionBlock;

+/**
+ Deletes an instance of the resource with the specified resource ID.
+
+ @param resourceName Name of the entity that will be deleted. If this does not match a entity description in @c self.model then an exception is raised.
+
+ @param resourceID An integer representing the unique identifier of an instance of the specified entity.
+
+ @param urlSession The URL session that will be used to create the data task. If this parameter is nil than the default URL session is used.
+
+ @param completionBlock The completion block that will be called when a response is recieved from the server. If an error occurred then the completion block's @c error argument will be set to an @c NSError instance.
+
+ @return The data task that is communicating with the server. The data task returned is already resumed.
+
+ */
+
 -(NSURLSessionDataTask *)deleteResource:(NSString *)resourceName
                                  withID:(NSUInteger)resourceID
                              URLSession:(NSURLSession *)urlSession
                              completion:(void (^)(NSError *error))completionBlock;

+/**
+ Creates an instance of the resource with the specified resource ID and initial values. Returns the resource ID of the newly created resource instance.
+
+ @param resourceName Name of the entity that will be created. If this does not match a entity description in @c self.model then an exception is raised.
+
+ @param initialValues A JSON-compatible dictionary containing the initial values the newly created resource instance should have.
+
+ @param urlSession The URL session that will be used to create the data task. If this parameter is nil than the default URL session is used.
+
+ @param completionBlock The completion block that will be called when a response is recieved from the server. If an error occurred then the completion block's @c error argument will be set to an @c NSError instance. If there is no error then the completion block's @c resourceID argument will be set to number representing the unique identifier of an instance of the specified entity that was created.
+
+ @return The data task that is communicating with the server. The data task returned is already resumed.
+
+ */
+
 -(NSURLSessionDataTask *)createResource:(NSString *)resourceName
                       withInitialValues:(NSDictionary *)initialValues
                              URLSession:(NSURLSession *)urlSession
                              completion:(void (^)(NSError *error, NSNumber *resourceID))completionBlock;
+
+/**
+ Performs a function on the instance of the specified resource. Functions are like Objective-C selectors. If that function is not defined then the server returns an error.
+
+ @param functionName The name of the function that the specified resource instance will perform.
+
+ @param resourceName Name of the entity that will be will perform the function. If this does not match a entity description in @c self.model then an exception is raised.
+
+ @param resourceID An integer representing the unique identifier of an instance of the specified entity.
+
+ @param jsonObject An optional JSON-compatible dictionary that can be used to add argument to the execution of the specified function.
+
+ @param urlSession The URL session that will be used to create the data task. If this parameter is nil than the default URL session is used.
+
+ @param completionBlock The completion block that will be called when a response is recieved from the server. If an error occurred then the completion block's @c error argument will be set to an @c NSError instance. If there is no error then the completion block's @c statusCode argument will be set to a @c NOResourceFunctionCode value and the @c response argmument may be set to a JSON-compatible dictionary.
+
+ @return The data task that is communicating with the server. The data task returned is already resumed.
+
+ */

 -(NSURLSessionDataTask *)performFunction:(NSString *)functionName
                               onResource:(NSString *)resourceName


Fix the FORTRAN bindings

Fix the FORTRAN bindings

--- include/BLAS/trsm.h
+++ include/BLAS/trsm.h
@@ -39,7 +39,7 @@
 namespace FORTRAN {

 #ifndef DOXYGEN_SKIP
-extern C {
+extern "C" {
   void fortran_name(strsm, STRSM)(char* side, char* uplo, char* transa,
                                   char* diag, I_t* m, I_t* n, S_t* alpha,
                                   S_t* A, I_t* lda, S_t* B, I_t* ldb);


util: added util_blit_pixels() overlap test

A comment alluded to this.  Now it's checked.

--- src/gallium/auxiliary/util/u_blit.c
+++ src/gallium/auxiliary/util/u_blit.c
@@ -266,6 +266,31 @@

 /**
+ * \return TRUE if two regions overlap, FALSE otherwise
+ */
+static boolean
+regions_overlap(int srcX0, int srcY0,
+                int srcX1, int srcY1,
+                int dstX0, int dstY0,
+                int dstX1, int dstY1)
+{
+   if (MAX2(srcX0, srcX1) < MIN2(dstX0, dstX1))
+      return FALSE; /* src completely left of dst */
+
+   if (MAX2(dstX0, dstX1) < MIN2(srcX0, srcX1))
+      return FALSE; /* dst completely left of src */
+
+   if (MAX2(srcY0, srcY1) < MIN2(dstY0, dstY1))
+      return FALSE; /* src completely above dst */
+
+   if (MAX2(dstY0, dstY1) < MIN2(srcY0, srcY1))
+      return FALSE; /* dst completely above src */
+
+   return TRUE; /* some overlap */
+}
+
+
+/**
  * Copy pixel block from src surface to dst surface.
  * Overlapping regions are acceptable.
  * Flipping and stretching are supported.
@@ -291,6 +316,7 @@
    const int srcLeft = MIN2(srcX0, srcX1);
    const int srcTop = MIN2(srcY0, srcY1);
    unsigned offset;
+   boolean overlap;

    assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
           filter == PIPE_TEX_MIPFILTER_LINEAR);
@@ -300,8 +326,13 @@
    assert(screen->is_format_supported(screen, dst->format, PIPE_TEXTURE_2D,
                                       PIPE_TEXTURE_USAGE_SAMPLER, 0));

+   /* do the regions overlap? */
+   overlap = (src == dst) && regions_overlap(srcX0, srcY0, srcX1, srcY1,
+                                             dstX0, dstY0, dstX1, dstY1);
+
    /*
-    * Check for simple case:  no format conversion, no flipping, no stretching.
+    * Check for simple case:  no format conversion, no flipping, no stretching,
+    * no overlapping.
     */
    if (dst->format == src->format &&
        srcX0 < srcX1 &&
@@ -309,7 +340,8 @@
        srcY0 < srcY1 &&
        dstY0 < dstY1 &&
        (dstX1 - dstX0) == (srcX1 - srcX0) &&
-       (dstY1 - dstY0) == (srcY1 - srcY0)) {
+       (dstY1 - dstY0) == (srcY1 - srcY0) &&
+       !overlap) {
       /* FIXME: this will most surely fail for overlapping rectangles */
       pipe->surface_copy(pipe,
 			 dst, dstX0, dstY0, /* dest */


Tidying up output

Tidying up output

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@244 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/unemap/utilities/register.c
+++ source/unemap/utilities/register.c
@@ -1,7 +1,7 @@
 /*******************************************************************************
 FILE : register.c

-LAST MODIFIED : 12 October 1999
+LAST MODIFIED : 24 March 2000

 DESCRIPTION :
 For setting and checking registers on second version of the signal conditioning
@@ -102,6 +102,8 @@
 Module constants
 ----------------
 */
+/*#define FLOAT_FORMAT "%10g"*/
+#define FLOAT_FORMAT "%10.3f"
 #define MAXIMUM_NUMBER_OF_NI_CARDS 7
 #define NUMBER_OF_CHANNELS_ON_NI_CARD 64
 #define CALIBRATE_AMPLITUDE_FACTOR ((float)0.75)
@@ -1113,7 +1115,7 @@
 								sample += number_of_channels;
 							}
 							mean[i] /= (float)number_of_samples;
-							printf("%2d %10g",i+1,mean[i]);
+							printf("%2d " FLOAT_FORMAT,i+1,mean[i]);
 							if (0==(i+1)%4)
 							{
 								printf("\n");
@@ -1137,7 +1139,7 @@
 							}
 							rms /= (float)number_of_samples;
 							rms=(float)sqrt((double)rms);
-							printf("%2d %10g",i+1,rms);
+							printf("%2d " FLOAT_FORMAT,i+1,rms);
 							if (0==(i+1)%4)
 							{
 								printf("\n");
@@ -1639,7 +1641,8 @@
 															}
 															else
 															{
-																fprintf(report," %10g",mean[temp_c_number+i]);
+																fprintf(report," " FLOAT_FORMAT,
+																	mean[temp_c_number+i]);
 																if (!((float)fabs((double)(mean[temp_c_number+
 																	i]-sorted_mean[number_of_settled_channels/
 																	2]))<tol_offset_spread))
@@ -1654,7 +1657,7 @@
 																		printf("Offset spread too large for :\n");
 																	}
 																	first++;
-																	printf("%2d %10g",temp_c_number+i+1,
+																	printf("%2d " FLOAT_FORMAT,temp_c_number+i+1,
 																		mean[temp_c_number+i]);
 																	if (0==first%4)
 																	{
@@ -1718,7 +1721,7 @@
 																}
 																rms /= (float)number_of_samples;
 																rms=(float)sqrt((double)rms);
-																fprintf(report," %10g",rms);
+																fprintf(report," " FLOAT_FORMAT,rms);
 																if (!((float)fabs((double)rms)<tol_rms))
 																{
 																	channel_check[temp_c_number+i] |=
@@ -1730,7 +1733,8 @@
 																		printf("RMS too large for :\n");
 																	}
 																	first++;
-																	printf("%2d %10g",temp_c_number+i+1,rms);
+																	printf("%2d " FLOAT_FORMAT,temp_c_number+i+1,
+																		rms);
 																	if (0==first%4)
 																	{
 																		printf("\n");
@@ -1816,8 +1820,8 @@
 														}
 														rms /= (float)number_of_samples;
 														rms=(float)sqrt((double)rms);
-														fprintf(report,"RMS: %10g",rms);
-														printf("RMS: %10g",rms);
+														fprintf(report,"RMS: " FLOAT_FORMAT,rms);
+														printf("RMS: " FLOAT_FORMAT,rms);
 														if ((float)fabs((double)rms)<tol_rms)
 														{
 															fprintf(report," OK");
@@ -2156,8 +2160,8 @@
 																	}
 																	else
 																	{
-																		fprintf(report," %10g",mean[temp_c_number+
-																			i]);
+																		fprintf(report," " FLOAT_FORMAT,
+																			mean[temp_c_number+i]);
 																		if (!((float)fabs((double)(mean[
 																			temp_c_number+i]-sorted_mean[
 																			number_of_settled_channels/2]))<
@@ -2175,7 +2179,8 @@
 																					temp_c_number+l);
 																			}
 																			first++;
-																			printf("%2d %10g",temp_c_number+i+1,
+																			printf("%2d " FLOAT_FORMAT,
+																				temp_c_number+i+1,
 																				mean[temp_c_number+i]);
 																			if (0==first%4)
 																			{
@@ -2247,15 +2252,11 @@
 																		}
 																		rms /= (float)number_of_samples;
 																		rms=(float)sqrt((double)rms);
-																		fprintf(report," %10g",rms);
+																		fprintf(report," " FLOAT_FORMAT,rms);
 																		if (!((float)fabs((double)rms)<tol_rms))
 																		{
 																			channel_check[temp_c_number+i] |=
 																				phase0_flag;
-																			/*???debug */
-																			printf("%d %d %x %x\n",temp_c_number,i,
-																				phase0_flag,
-																				channel_check[temp_c_number+i]);
 																			fprintf(report,
 																				" <<< CHECK too large >>>");
 																			total_checks++;
@@ -2266,7 +2267,8 @@
 																					temp_c_number+l);
 																			}
 																			first++;
-																			printf("%2d %10g",temp_c_number+i+1,rms);
+																			printf("%2d " FLOAT_FORMAT,
+																				temp_c_number+i+1,rms);
 																			if (0==first%4)
 																			{
 																				printf("\n");
@@ -2679,7 +2681,7 @@
 																}
 																else
 																{
-																	fprintf(report," %10g",
+																	fprintf(report," " FLOAT_FORMAT,
 																		mean[temp_c_number+i]);
 																	if (!((float)fabs((double)(mean[
 																		temp_c_number+i]-sorted_mean[
@@ -2699,7 +2701,7 @@
 																				k*NUMBER_OF_CHANNELS_ON_NI_CARD+l);
 																		}
 																		first++;
-																		printf("%2d %10g",
+																		printf("%2d " FLOAT_FORMAT,
 																			k*NUMBER_OF_CHANNELS_ON_NI_CARD+i+1,
 																			mean[temp_c_number+i]);
 																		if (0==first%4)
@@ -2772,7 +2774,7 @@
 																	}
 																	rms /= (float)number_of_samples;
 																	rms=(float)sqrt((double)rms);
-																	fprintf(report," %10g",rms);
+																	fprintf(report," " FLOAT_FORMAT,rms);
 																	if (!((float)fabs((double)rms)<tol_rms))
 																	{
 																		channel_check[
@@ -2787,7 +2789,7 @@
 																				k*NUMBER_OF_CHANNELS_ON_NI_CARD+l);
 																		}
 																		first++;
-																		printf("%2d %10g",
+																		printf("%2d " FLOAT_FORMAT,
 																			k*NUMBER_OF_CHANNELS_ON_NI_CARD+i+1,rms);
 																		if (0==first%4)
 																		{
@@ -3202,12 +3204,6 @@
 											pause_for_error();
 										}
 										unemap_stop_stimulating(0);
-										/*???debug */
-										printf("tester_card_1=%d, tester_card_2=%d\n",tester_card_1,
-											tester_card_2);
-										printf(
-											"calibrate_amplitude_1=%g, calibrate_amplitude_2=%g\n",
-											calibrate_amplitude_1,calibrate_amplitude_2);
 										if (unemap_start_voltage_stimulating(
 											(tester_card_1-1)*NUMBER_OF_CHANNELS_ON_NI_CARD+1,1,
 											(float)0,&calibrate_amplitude_1)&&
@@ -3215,10 +3211,6 @@
 											(tester_card_2-1)*NUMBER_OF_CHANNELS_ON_NI_CARD+1,1,
 											(float)0,&calibrate_amplitude_2))
 										{
-											/*???debug */
-											printf(
-												"calibrate_amplitude_1=%g, calibrate_amplitude_2=%g\n",
-												calibrate_amplitude_1,calibrate_amplitude_2);
 											unemap_start_sampling();
 											sleep(sampling_delay);
 											unemap_stop_sampling();
@@ -3296,7 +3288,7 @@
 																			k*NUMBER_OF_CHANNELS_ON_NI_CARD+i+1,count,
 																			number_of_samples);
 																		fprintf(report,
-																			".  %d out of %lu valid <<< CHECK >>>\n",
+																			".  %d out of %lu valid <<< CHECK >>>",
 																			count,number_of_samples);
 																		first++;
 																		total_checks++;
@@ -3354,13 +3346,12 @@
 																		first++;
 																		total_checks++;
 																	}
-																	fprintf(report,"\n");
 																}
 																else
 																{
 																	printf(".  No valid data\n");
 																	fprintf(report,
-																		".  No valid data <<< CHECK >>>\n");
+																		".  No valid data <<< CHECK >>>");
 																	channel_check[
 																		k*NUMBER_OF_CHANNELS_ON_NI_CARD+i] |=
 																		phase_flag;
@@ -3368,6 +3359,7 @@
 																	total_checks++;
 																}
 															}
+															fprintf(report,"\n");
 														}
 													}
 													if (0==first)
@@ -4932,7 +4924,8 @@
 															}
 															else
 															{
-																fprintf(report," %10g",mean[temp_c_number+i]);
+																fprintf(report," " FLOAT_FORMAT,
+																	mean[temp_c_number+i]);
 																if (!((float)fabs((double)(
 																	mean[temp_c_number+i]-sorted_mean[
 																	number_of_settled_channels/2]))<
@@ -4946,7 +4939,7 @@
 																		printf("Offset spread too large for :\n");
 																	}
 																	first++;
-																	printf("%2d %10g",temp_c_number+i+1,
+																	printf("%2d " FLOAT_FORMAT,temp_c_number+i+1,
 																		mean[temp_c_number+i]);
 																	if (0==first%4)
 																	{
@@ -5000,7 +4993,8 @@
 															}
 															rms /= (float)number_of_samples;
 															rms=(float)sqrt((double)rms);
-															fprintf(report,"%2d %10g",temp_c_number+i+1,rms);
+															fprintf(report,"%2d " FLOAT_FORMAT,
+																temp_c_number+i+1,rms);
 															if (!(fabs(rms)<tol_rms))
 															{
 																channel_check[temp_c_number+i] |= phase_flag;
@@ -5011,7 +5005,8 @@
 																	printf("RMS too large for :\n");
 																}
 																first++;
-																printf("%2d %10g",temp_c_number+i+1,rms);
+																printf("%2d " FLOAT_FORMAT,temp_c_number+i+1,
+																	rms);
 																if (0==first%4)
 																{
 																	printf("\n");
@@ -5091,8 +5086,8 @@
 														}
 														rms /= (float)number_of_samples;
 														rms=(float)sqrt((double)rms);
-														fprintf(report,"RMS: %10g",rms);
-														printf("RMS: %10g",rms);
+														fprintf(report,"RMS: " FLOAT_FORMAT,rms);
+														printf("RMS: " FLOAT_FORMAT,rms);
 														if ((float)fabs((double)rms)<tol_rms)
 														{
 															fprintf(report," OK");


sigh x2

sigh x2

--- shotgun.c
+++ shotgun.c
@@ -67,6 +67,7 @@
         data = eina_strbuf_string_get(auth->buf);
         tag = data + len - 2;
         while (tag[0] != '<') tag--;
+        tag += 2;
         if (!strncmp(data, tag, len - (tag - data))) /* open/end tags maybe match? */
           return EINA_TRUE;
         strncat(buf, data, sizeof(buf) - 1);


Modified return value (reference)

Modified return value (reference)

Modified:
-Values() function : it returns a reference to ListS<T>;

--- include/HashTable.h
+++ include/HashTable.h
@@ -274,7 +274,7 @@

 template<class K, class E>
-ListS<E> hash_table<K, E>::Values()
+ListS<E>& hash_table<K, E>::Values()
 {
 	ListS<E> _values;


gallium: s/copy_pixels_state/blit_state

gallium: s/copy_pixels_state/blit_state

--- src/gallium/auxiliary/util/u_blit.h
+++ src/gallium/auxiliary/util/u_blit.h
@@ -34,7 +34,7 @@
 struct pipe_surface;

-struct copy_pixels_state;
+struct blit_state;

 extern struct blit_state *


Had forgotten to initialise the line number on which a nonterminal symbol occurred first.

--- util/LLgen/src/name.c
+++ util/LLgen/src/name.c
@@ -169,6 +169,7 @@

 		q = &nonterms[nnonterms];
 		q->n_rule = 0;
+		q->n_lineno = linecount;
 		q->n_string = f_input;
 		q->n_follow = 0;
 		q->n_flags = 0;


Improve docs for Helmholtz terms.

Improve docs for Helmholtz terms.

Closes https://github.com/CoolProp/CoolProp/issues/277

Signed-off-by: Ian Bell <6f1c5b737f3c5cff42a9b8f8dcfce305d97fd07b@gmail.com>

--- include/Helmholtz.h
+++ include/Helmholtz.h
@@ -130,6 +130,14 @@
         l_int = 0; m_int = 0;
     }
 };
+/** \brief A generalized residual helmholtz energy container that can deal with a wide range of terms which can be converted to this general form
+ *
+ * \f$ \alpha^r=\sum_i n_i \delta^{d_i} \tau^{t_i}\exp(u_i) \f$
+ *
+ * where \f$ u_i \f$ is given by
+ *
+ * \f$ u_i = -c_i\delta^{l_i}-\omega_i\tau^{m_i}-\eta_{1,i}(\delta-\epsilon_{1,i})-\eta_{2,i}(\delta-\epsilon_{2,i})^2-\beta_{1,i}(\tau-\gamma_{1,i})-\beta_{2,i}(\tau-\gamma_{2,i})^2 \f$
+ */
 class ResidualHelmholtzGeneralizedExponential : public BaseHelmholtzTerm{

 public:
@@ -137,10 +145,10 @@
     std::vector<long double> s;
     std::size_t N;

-    /// These variables are for the exp(u) part
-    /// u is given by -c*delta^l_i-omega*tau^m_i-eta1*(delta-epsilon1)-eta2*(delta-epsilon2)^2-beta1*(tau-gamma1)-beta2*(tau-gamma2)^2
+    // These variables are for the exp(u) part
+    // u is given by -c*delta^l_i-omega*tau^m_i-eta1*(delta-epsilon1)-eta2*(delta-epsilon2)^2-beta1*(tau-gamma1)-beta2*(tau-gamma2)^2
     std::vector<double> n,d,t,c, l_double, omega, m_double, eta1, epsilon1, eta2, epsilon2, beta1, gamma1, beta2, gamma2;
-    /// If l_i or m_i are integers, we will store them as integers in order to call pow(double, int) rather than pow(double, double)
+    // If l_i or m_i are integers, we will store them as integers in order to call pow(double, int) rather than pow(double, double)
     std::vector<int> l_int, m_int;

     Eigen::ArrayXd uE, du_ddeltaE, du_dtauE, d2u_ddelta2E, d2u_dtau2E, d3u_ddelta3E, d3u_dtau3E;
@@ -156,7 +164,11 @@
                                               beta2_in_u = false;
                                               finished = false;
                                               };
-
+    /** \brief Add and convert an old-style power (polynomial) term to generalized form
+	 *
+	 * Term of the format
+	 * \f$ \alpha^r=\left\lbrace\begin{array}{cc}\displaystyle\sum_i n_i \delta^{d_i} \tau^{t_i} & l_i=0\\ \displaystyle\sum_i n_i \delta^{d_i} \tau^{t_i} \exp(-\delta^{l_i}) & l_i\neq 0\end{array}\right.\f$
+	 */
     void add_Power(const std::vector<long double> &n, const std::vector<long double> &d,
                    const std::vector<long double> &t, const std::vector<long double> &l)
     {
@@ -176,6 +188,11 @@
         }
         delta_li_in_u = true;
     };
+	/** \brief Add and convert an old-style exponential term to generalized form
+	 *
+	 * Term of the format
+	 * \f$ \alpha^r=\displaystyle\sum_i n_i \delta^{d_i} \tau^{t_i} \exp(-g_i\delta^{l_i}) \f$
+	 */
     void add_Exponential(const std::vector<long double> &n, const std::vector<long double> &d,
                          const std::vector<long double> &t, const std::vector<long double> &g,
                          const std::vector<long double> &l)
@@ -192,7 +209,12 @@
             elements.push_back(el);
         }
         delta_li_in_u = true;
-    }
+    }
+	/** \brief Add and convert an old-style Gaussian term to generalized form
+	 *
+	 * Term of the format
+	 * \f$ \alpha^r=\displaystyle\sum_i n_i \delta^{d_i} \tau^{t_i} \exp(-\eta_i(\delta-\epsilon_i)^2-\beta_i(\tau-\gamma_i)^2)\f$
+	 */
     void add_Gaussian(const std::vector<long double> &n,
                       const std::vector<long double> &d,
                       const std::vector<long double> &t,
@@ -217,6 +239,11 @@
         eta2_in_u = true;
         beta2_in_u = true;
     };
+	/** \brief Add and convert an old-style Gaussian term from GERG 2008 natural gas model to generalized form
+	 *
+	 * Term of the format
+	 * \f$ \alpha^r=\displaystyle\sum_i n_i \delta^{d_i} \tau^{t_i} \exp(-\eta_i(\delta-\epsilon_i)^2-\beta_i(\delta-\gamma_i))\f$
+	 */
     void add_GERG2008Gaussian(const std::vector<long double> &n,
                               const std::vector<long double> &d,
                               const std::vector<long double> &t,
@@ -240,6 +267,11 @@
         eta2_in_u = true;
         eta1_in_u = true;
     };
+	/** \brief Add and convert a term from Lemmon and Jacobsen (2005) used for R125
+	 *
+	 * Term of the format
+	 * \f$ \alpha^r=\displaystyle\sum_i n_i \delta^{d_i} \tau^{t_i} \exp(-\delta^{l_i}-\tau^{m_i})\f$
+	 */
     void add_Lemmon2005(const std::vector<long double> &n,
                         const std::vector<long double> &d,
                         const std::vector<long double> &t,


svga: add new version 10 device command prototypes

Signed-off-by: Brian Paul <3cb4e1df5ec4da2c7c4af7c52cec8cf340a55a10@vmware.com>

--- src/gallium/drivers/svga/svga_cmd.h
+++ src/gallium/drivers/svga/svga_cmd.h
@@ -47,6 +47,7 @@
 struct svga_winsys_buffer;
 struct svga_winsys_surface;
 struct svga_winsys_gb_shader;
+struct svga_winsys_gb_query;

 /*
@@ -305,4 +306,336 @@
                     SVGA3dQueryType type,
                     struct svga_winsys_buffer *buffer);

+
+
+/*
+ * VGPU10 commands
+ */
+
+enum pipe_error
+SVGA3D_vgpu10_PredCopyRegion(struct svga_winsys_context *swc,
+                             struct svga_winsys_surface *dstSurf,
+                             uint32 dstSubResource,
+                             struct svga_winsys_surface *srcSurf,
+                             uint32 srcSubResource,
+                             const SVGA3dCopyBox *box);
+
+enum pipe_error
+SVGA3D_vgpu10_PredCopy(struct svga_winsys_context *swc,
+                       struct svga_winsys_surface *dstSurf,
+                       struct svga_winsys_surface *srcSurf);
+
+enum pipe_error
+SVGA3D_vgpu10_SetViewports(struct svga_winsys_context *swc,
+                           unsigned count, const SVGA3dViewport *viewports);
+
+enum pipe_error
+SVGA3D_vgpu10_SetShader(struct svga_winsys_context *swc,
+                        SVGA3dShaderType type,
+                        struct svga_winsys_gb_shader *gbshader,
+                        SVGA3dShaderId shaderId);
+
+enum pipe_error
+SVGA3D_vgpu10_SetShaderResources(struct svga_winsys_context *swc,
+                                 SVGA3dShaderType type,
+                                 uint32 startView,
+                                 unsigned count,
+                                 const SVGA3dShaderResourceViewId ids[],
+                                 struct svga_winsys_surface **views);
+
+enum pipe_error
+SVGA3D_vgpu10_SetSamplers(struct svga_winsys_context *swc,
+                          unsigned count,
+                          uint32 startSampler,
+                          SVGA3dShaderType type,
+                          const SVGA3dSamplerId *samplerIds);
+
+enum pipe_error
+SVGA3D_vgpu10_SetRenderTargets(struct svga_winsys_context *swc,
+                               unsigned color_count,
+                               struct pipe_surface **color_surfs,
+                               struct pipe_surface *depth_stencil_surf);
+
+enum pipe_error
+SVGA3D_vgpu10_SetBlendState(struct svga_winsys_context *swc,
+                            SVGA3dBlendStateId blendId,
+                            const float *blendFactor, uint32 sampleMask);
+
+enum pipe_error
+SVGA3D_vgpu10_SetDepthStencilState(struct svga_winsys_context *swc,
+                                   SVGA3dDepthStencilStateId depthStencilId,
+                                   uint32 stencilRef);
+
+enum pipe_error
+SVGA3D_vgpu10_SetRasterizerState(struct svga_winsys_context *swc,
+                                 SVGA3dRasterizerStateId rasterizerId);
+
+enum pipe_error
+SVGA3D_vgpu10_SetPredication(struct svga_winsys_context *swc,
+                             SVGA3dQueryId queryId,
+                             uint32 predicateValue);
+
+enum pipe_error
+SVGA3D_vgpu10_SetSOTargets(struct svga_winsys_context *swc,
+                           unsigned count, const SVGA3dSoTarget *targets,
+                           struct svga_winsys_surface **surfaces);
+
+enum pipe_error
+SVGA3D_vgpu10_SetScissorRects(struct svga_winsys_context *swc,
+                              unsigned count,
+                              const SVGASignedRect *rects);
+
+enum pipe_error
+SVGA3D_vgpu10_SetStreamOutput(struct svga_winsys_context *swc,
+                              SVGA3dStreamOutputId soid);
+
+enum pipe_error
+SVGA3D_vgpu10_Draw(struct svga_winsys_context *swc,
+                   uint32 vertexCount, uint32 startVertexLocation);
+
+enum pipe_error
+SVGA3D_vgpu10_DrawIndexed(struct svga_winsys_context *swc,
+                          uint32 indexCount, uint32 startIndexLocation,
+                          int32 baseVertexLocation);
+
+enum pipe_error
+SVGA3D_vgpu10_DrawInstanced(struct svga_winsys_context *swc,
+                            uint32 vertexCountPerInstance,
+                            uint32 instanceCount,
+                            uint32 startVertexLocation,
+                            uint32 startInstanceLocation);
+
+enum pipe_error
+SVGA3D_vgpu10_DrawIndexedInstanced(struct svga_winsys_context *swc,
+                                   uint32 indexCountPerInstance,
+                                   uint32 instanceCount,
+                                   uint32 startIndexLocation,
+                                   int32  baseVertexLocation,
+                                   uint32 startInstanceLocation);
+
+enum pipe_error
+SVGA3D_vgpu10_DrawAuto(struct svga_winsys_context *swc);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineQuery(struct svga_winsys_context *swc,
+                          SVGA3dQueryId queryId,
+                          SVGA3dQueryType type,
+                          SVGA3dDXQueryFlags flags);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyQuery(struct svga_winsys_context *swc,
+                           SVGA3dQueryId queryId);
+
+enum pipe_error
+SVGA3D_vgpu10_BindQuery(struct svga_winsys_context *swc,
+                        struct svga_winsys_gb_query *gbQuery,
+                        SVGA3dQueryId queryId);
+
+enum pipe_error
+SVGA3D_vgpu10_SetQueryOffset(struct svga_winsys_context *swc,
+                             SVGA3dQueryId queryId,
+                             uint32 mobOffset);
+
+enum pipe_error
+SVGA3D_vgpu10_BeginQuery(struct svga_winsys_context *swc,
+                         SVGA3dQueryId queryId);
+
+enum pipe_error
+SVGA3D_vgpu10_EndQuery(struct svga_winsys_context *swc,
+                       SVGA3dQueryId queryId);
+
+enum pipe_error
+SVGA3D_vgpu10_ClearRenderTargetView(struct svga_winsys_context *swc,
+                                    struct pipe_surface *color_surf,
+                                    const float *rgba);
+
+enum pipe_error
+SVGA3D_vgpu10_ClearDepthStencilView(struct svga_winsys_context *swc,
+                                    struct pipe_surface *ds_surf,
+                                    uint16 flags, uint16 stencil, float depth);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineShaderResourceView(struct svga_winsys_context *swc,
+                             SVGA3dShaderResourceViewId shaderResourceViewId,
+                             struct svga_winsys_surface *surf,
+                             SVGA3dSurfaceFormat format,
+                             SVGA3dResourceType resourceDimension,
+                             const SVGA3dShaderResourceViewDesc *desc);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyShaderResourceView(struct svga_winsys_context *swc,
+                            SVGA3dShaderResourceViewId shaderResourceViewId);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineRenderTargetView(struct svga_winsys_context *swc,
+                                  SVGA3dRenderTargetViewId renderTargetViewId,
+                                  struct svga_winsys_surface *surface,
+                                  SVGA3dSurfaceFormat format,
+                                  SVGA3dResourceType resourceDimension,
+                                  const SVGA3dRenderTargetViewDesc *desc);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyRenderTargetView(struct svga_winsys_context *swc,
+                                SVGA3dRenderTargetViewId renderTargetViewId);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineDepthStencilView(struct svga_winsys_context *swc,
+                                  SVGA3dDepthStencilViewId depthStencilViewId,
+                                  struct svga_winsys_surface *surface,
+                                  SVGA3dSurfaceFormat format,
+                                  SVGA3dResourceType resourceDimension,
+                                  const SVGA3dRenderTargetViewDesc *desc);
+
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyDepthStencilView(struct svga_winsys_context *swc,
+                                SVGA3dDepthStencilViewId depthStencilViewId);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineElementLayout(struct svga_winsys_context *swc,
+                               unsigned count,
+                               SVGA3dElementLayoutId elementLayoutId,
+                               const SVGA3dInputElementDesc *elements);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyElementLayout(struct svga_winsys_context *swc,
+                                   SVGA3dElementLayoutId elementLayoutId);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineBlendState(struct svga_winsys_context *swc,
+                               SVGA3dBlendStateId blendId,
+                               uint8 alphaToCoverageEnable,
+                               uint8 independentBlendEnable,
+                               const SVGA3dDXBlendStatePerRT *perRT);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyBlendState(struct svga_winsys_context *swc,
+                                SVGA3dBlendStateId blendId);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineDepthStencilState(struct svga_winsys_context *swc,
+                                      SVGA3dDepthStencilStateId depthStencilId,
+                                      uint8 depthEnable,
+                                      SVGA3dDepthWriteMask depthWriteMask,
+                                      SVGA3dComparisonFunc depthFunc,
+                                      uint8 stencilEnable,
+                                      uint8 frontEnable,
+                                      uint8 backEnable,
+                                      uint8 stencilReadMask,
+                                      uint8 stencilWriteMask,
+                                      uint8 frontStencilFailOp,
+                                      uint8 frontStencilDepthFailOp,
+                                      uint8 frontStencilPassOp,
+                                      SVGA3dComparisonFunc frontStencilFunc,
+                                      uint8 backStencilFailOp,
+                                      uint8 backStencilDepthFailOp,
+                                      uint8 backStencilPassOp,
+                                      SVGA3dComparisonFunc backStencilFunc);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyDepthStencilState(struct svga_winsys_context *swc,
+                                       SVGA3dDepthStencilStateId depthStencilId);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineRasterizerState(struct svga_winsys_context *swc,
+                                    SVGA3dRasterizerStateId rasterizerId,
+                                    uint8 fillMode,
+                                    SVGA3dCullMode cullMode,
+                                    uint8 frontCounterClockwise,
+                                    int32 depthBias,
+                                    float depthBiasClamp,
+                                    float slopeScaledDepthBias,
+                                    uint8 depthClipEnable,
+                                    uint8 scissorEnable,
+                                    uint8 multisampleEnable,
+                                    uint8 antialiasedLineEnable,
+                                    float lineWidth,
+                                    uint8 lineStippleEnable,
+                                    uint8 lineStippleFactor,
+                                    uint16 lineStipplePattern,
+                                    uint8 provokingVertexLast);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyRasterizerState(struct svga_winsys_context *swc,
+                                     SVGA3dRasterizerStateId rasterizerId);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineSamplerState(struct svga_winsys_context *swc,
+                                 SVGA3dSamplerId samplerId,
+                                 SVGA3dFilter filter,
+                                 uint8 addressU,
+                                 uint8 addressV,
+                                 uint8 addressW,
+                                 float mipLODBias,
+                                 uint8 maxAnisotropy,
+                                 uint8 comparisonFunc,
+                                 SVGA3dRGBAFloat borderColor,
+                                 float minLOD,
+                                 float maxLOD);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroySamplerState(struct svga_winsys_context *swc,
+                                  SVGA3dSamplerId samplerId);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyShader(struct svga_winsys_context *swc,
+                            SVGA3dShaderId shaderId);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineAndBindShader(struct svga_winsys_context *swc,
+                                  struct svga_winsys_gb_shader *gbshader,
+                                  SVGA3dShaderId shaderId,
+                                  SVGA3dShaderType type,
+                                  uint32 sizeInBytes);
+
+enum pipe_error
+SVGA3D_vgpu10_DefineStreamOutput(struct svga_winsys_context *swc,
+      SVGA3dStreamOutputId soid,
+      uint32 numOutputStreamEntries,
+      uint32 streamOutputStrideInBytes[SVGA3D_DX_MAX_SOTARGETS],
+      const SVGA3dStreamOutputDeclarationEntry decl[SVGA3D_MAX_STREAMOUT_DECLS]);
+
+enum pipe_error
+SVGA3D_vgpu10_DestroyStreamOutput(struct svga_winsys_context *swc,
+                                  SVGA3dStreamOutputId soid);
+
+enum pipe_error
+SVGA3D_vgpu10_ReadbackSubResource(struct svga_winsys_context *swc,
+                                  struct svga_winsys_surface *surface,
+                                  unsigned subResource);
+
+enum pipe_error
+SVGA3D_vgpu10_SetInputLayout(struct svga_winsys_context *swc,
+                             SVGA3dElementLayoutId elementLayoutId);
+
+enum pipe_error
+SVGA3D_vgpu10_SetVertexBuffers(struct svga_winsys_context *swc,
+                               unsigned count,
+                               uint32 startBuffer,
+                               const SVGA3dVertexBuffer *bufferInfo,
+                               struct svga_winsys_surface **surfaces);
+
+enum pipe_error
+SVGA3D_vgpu10_SetTopology(struct svga_winsys_context *swc,
+                          SVGA3dPrimitiveType topology);
+
+enum pipe_error
+SVGA3D_vgpu10_SetIndexBuffer(struct svga_winsys_context *swc,
+                             struct svga_winsys_surface *indexes,
+                             SVGA3dSurfaceFormat format, uint32 offset);
+
+enum pipe_error
+SVGA3D_vgpu10_SetSingleConstantBuffer(struct svga_winsys_context *swc,
+                                      unsigned slot,
+                                      SVGA3dShaderType type,
+                                      struct svga_winsys_surface *surface,
+                                      uint32 offsetInBytes,
+                                      uint32 sizeInBytes);
+
+enum pipe_error
+SVGA3D_vgpu10_UpdateSubResource(struct svga_winsys_context *swc,
+                                struct svga_winsys_surface *surface,
+                                const SVGA3dBox *box,
+                                unsigned subResource);
+
 #endif /* __SVGA3D_H__ */


Removed config.h since it gets automatically generated by autogen.sh

--- include/IL/config.h
+++ include/IL/config.h
@@ -1,180 +0,0 @@
-/* include/IL/config.h.  Generated by configure.  */
-/* include/IL/config.h.in.  Generated from configure.in by autoheader.  */
-
-/* Altivec coprocessor found */
-#define ALTIVEC
-
-/* Altivec GCC extension found */
-#define ALTIVEC_GCC
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#define HAVE_DLFCN_H 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#define HAVE_UNISTD_H 1
-
-/* Support Allegro API */
-/* #undef ILUT_USE_ALLEGRO */
-
-/* Support DirectX8 API */
-/* #undef ILUT_USE_DIRECTX8 */
-
-/* Support OpenGL API */
-/* #undef ILUT_USE_OPENGL */
-
-/* Support SDL API */
-/* #undef ILUT_USE_SDL */
-
-/* BMP support */
-/* #undef IL_NO_BMP */
-
-/* DCX support */
-/* #undef IL_NO_DCX */
-
-/* DDS support */
-/* #undef IL_NO_DDS */
-
-/* DOOM support */
-/* #undef IL_NO_DOOM */
-
-/* GIF support */
-/* #undef IL_NO_GIF */
-
-/* HDR support */
-/* #undef IL_NO_HDR */
-
-/* ICO support */
-/* #undef IL_NO_ICO */
-
-/* JPEG support */
-/* #undef IL_NO_JPG */
-
-/* LCMS support */
-#define IL_NO_LCMS
-
-/* LIF support */
-/* #undef IL_NO_LIF */
-
-/* MDL support */
-/* #undef IL_NO_MDL */
-
-/* MNG support */
-/* #undef IL_NO_MNG */
-
-/* PCD support */
-/* #undef IL_NO_PCD */
-
-/* PCX support */
-/* #undef IL_NO_PCX */
-
-/* PIC support */
-/* #undef IL_NO_PIC */
-
-/* PIX support */
-/* #undef IL_NO_PIX */
-
-/* PNG support */
-/* #undef IL_NO_PNG */
-
-/* PNM support */
-/* #undef IL_NO_PNM */
-
-/* PSD support */
-/* #undef IL_NO_PSD */
-
-/* PSP support */
-/* #undef IL_NO_PSP */
-
-/* PXR support */
-/* #undef IL_NO_PXR */
-
-/* RAW support */
-/* #undef IL_NO_RAW */
-
-/* SGI support */
-/* #undef IL_NO_SGI */
-
-/* TGA support */
-/* #undef IL_NO_TGA */
-
-/* TIFF support */
-/* #undef IL_NO_TIF */
-
-/* WAL support */
-/* #undef IL_NO_WAL */
-
-/* XPM support */
-/* #undef IL_NO_XPM */
-
-/* Use jpeglib unmoified */
-#define IL_USE_JPEGLIB_UNMODIFIED
-
-/* LCMS include without lcms/ support */
-/* #undef LCMS_NODIRINCLUDE */
-
-/* Building on Mac OS X */
-#define MAX_OS_X
-
-/* memalign memory alloctaion found */
-/* #undef MEMALIGN */
-
-/* Name of package */
-#define PACKAGE "DevIL"
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT ""
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME ""
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING ""
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME ""
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION ""
-
-/* posix_memalign memory alloctaion found */
-/* #undef POSIX_MEMALIGN */
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-/* vallod memory alloctaion found */
-#define VALLOC
-
-/* Version number of package */
-#define VERSION "1.6.7"
-
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-#define WORDS_BIGENDIAN 1
-
-/* Define to 1 if the X Window System is missing or not being used. */
-/* #undef X_DISPLAY_MISSING */


remove flags GF_COMPLEX and GF_DOUBLE_BUFFERED_VBO, add flag GF_DYNAMIC

--- include/NodeArray.h
+++ include/NodeArray.h
@@ -18,12 +18,11 @@
 #define GF_TEMPORAL_GRAPH	1
 #define GF_HAS_SPATIAL_DATA	4
 #define GF_HAS_ARC_DATA		8
-#define GF_COMPLEX		16
+#define GF_DYNAMIC		16
 #define GF_HAS_TEXTURES		32
 #define GF_PER_NODE_COLORS	64
-#define GF_DOUBLE_BUFFERED_VBO	128
-#define GF_TEMPORAL_COVERAGE	256
-#define GF_FLATTEN_HIERARCHY	512
+#define GF_TEMPORAL_COVERAGE	128
+#define GF_FLATTEN_HIERARCHY	256

 #define DEFAULT_PROFILE	0
 #define PENDING_PROFILE	1
@@ -253,8 +252,8 @@
   bool isTemporal() const { return testFlags(GF_TEMPORAL_GRAPH); }
   void setTemporal(bool t) { updateFlags(GF_TEMPORAL_GRAPH, t); }

-  bool isComplexGraph() const { return testFlags(GF_COMPLEX); }
-  void setComplexGraph(bool t) { updateFlags(GF_COMPLEX, t); }
+  bool isDynamic() const { return testFlags(GF_DYNAMIC); }
+  void setDynamic(bool t) { updateFlags(GF_DYNAMIC, t); }

   bool hasSpatialData() const { return testFlags(GF_HAS_SPATIAL_DATA); }
   void setHasSpatialData(bool t) { updateFlags(GF_HAS_SPATIAL_DATA, t); }
@@ -264,9 +263,6 @@

   bool hasTextures() const { return testFlags(GF_HAS_TEXTURES); }
   void setHasTextures(bool t) { updateFlags(GF_HAS_TEXTURES, t); }
-
-  bool hasDoubleBufferedVBO() const { return testFlags(GF_DOUBLE_BUFFERED_VBO); }
-  void setDoubleBufferedVBO(bool t) { updateFlags(GF_DOUBLE_BUFFERED_VBO, t); }

   bool hasTemporalCoverage() const { return testFlags(GF_TEMPORAL_COVERAGE); }
   void setHasTemporalCoverage(bool t) { updateFlags(GF_TEMPORAL_COVERAGE, t); }


Added modification flag for chanegs to markers.

--- include/Scintilla.h
+++ include/Scintilla.h
@@ -342,6 +342,7 @@
 #define SC_PERFORMED_UNDO 0x20
 #define SC_PERFORMED_REDO 0x40
 #define SC_LASTSTEPINUNDOREDO 0x100
+#define SC_MOD_CHANGEMARKER 0x200

 #define SC_MODEVENTMASKALL 0x377


fix creation

fix creation

--- include/TextLabel.h
+++ include/TextLabel.h
@@ -15,8 +15,7 @@
   }

  protected:
-  void initialize(FWPlatform * _platform) override {
-    Element::initialize(_platform);
+  void create() override {
     Command c(Command::CREATE_TEXT, getParentInternalId(), getInternalId());
     c.setTextValue(text);
     c.setTextValue2(url);


Only launch asynchronously if threading is enabled.

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@291653 91177308-0d34-0410-b5e6-96231b3b80d8

--- include-fixer/SymbolIndexManager.h
+++ include-fixer/SymbolIndexManager.h
@@ -23,7 +23,12 @@
 class SymbolIndexManager {
 public:
   void addSymbolIndex(std::function<std::unique_ptr<SymbolIndex>()> F) {
-    SymbolIndices.push_back(std::async(std::launch::async, F));
+#if LLVM_ENABLE_THREADS
+    auto Strategy = std::launch::async;
+#else
+    auto Strategy = std::launch::deferred;
+#endif
+    SymbolIndices.push_back(std::async(Strategy, F));
   }

   /// Search for header files to be included for an identifier.


with ctype.h, tolower is in global namespace

--- include/TextUtils.h
+++ include/TextUtils.h
@@ -94,8 +94,8 @@
       if (i >= maxlength) {
         return 0;
       }
-      if (std::tolower(*p1) != std::tolower(*p2)) {
-        return (std::tolower(*p1) < std::tolower(*p2)) ? -1 : 1;
+      if (::tolower(*p1) != ::tolower(*p2)) {
+        return (::tolower(*p1) < ::tolower(*p2)) ? -1 : 1;
       }
       ++p1;
       ++p2;


no message

no message

--- include/BALL/VIEW/KERNEL/QTTimer.h
+++ include/BALL/VIEW/KERNEL/QTTimer.h
@@ -1,7 +1,7 @@
 // -*- Mode: C++; tab-width: 2; -*-
 // vi: set ts=2:
 //
-// $Id: QTTimer.h,v 1.22 2004/02/26 08:41:39 anhi Exp $
+// $Id: QTTimer.h,v 1.23 2004/05/18 15:18:16 amoll Exp $
 //

 #ifndef BALL_VIEW_KERNEL_QTTIMER_H
@@ -22,15 +22,15 @@
 		/** QTTimer class.
 				The QTTimer class is a timer class that is useful to have a job repeated
 				unhindered by other jobs that are already processing.
-				The protected method  timer will be called every  intervall msec
+				The protected method timer() will be called every  intervall msec
 				to process its contents. It is important that the process time for executing
-				the code in the  timer method is minimal else the application will hang
-				for the time needed by the  timer method.
-				The  timer method will not save any values when it exits. Therefore
+				the code in the timer() method is minimal else the application will hang
+				for the time needed by the timer() method.
+				The timer() method will not save any values when it exits. Therefore
 				the necessary initialization and value savings must be done by the user in the
-				 timer method.
+				timer() method.
 				The class is derived from the QObject class from the QT library.
-				Therefore it will only function within a qt application.
+				Therefore it will only function within a QT application.
 				\ingroup ViewKernelClient
 		*/
 		class BALL_EXPORT QTTimer: public QObject
@@ -53,12 +53,12 @@
 				NoValidInterval(const char* file, int line, const string& data)
   				throw();
 			};
-			//@}
-
+
+			//@}
 			/**	@name	Constructors
 			*/
 			//@{
-
+
 			/** Default Constructor.
 					The state is:
 					  - interval is set to 100
@@ -125,8 +125,8 @@

 			/** Changes the interval of this qtTimer to the value
 					represented by the parameter  interval. This QTTimer will
-					call the method  timer every  interval msec.
-					\param       interval the new interval of this qtTimer
+					call the method timer() every  interval msec.
+					\param       interval the new interval
 					\exception   NoValidInterval thrown if the value of  interval is lower or equal <tt> 0</tt>
 					\see         startTimer
 					\see         stopTimer
@@ -135,7 +135,7 @@
 			void setInterval(int interval)
 				throw(NoValidInterval);

-			/** Accesses the interval of this qtTimer.
+			/** Accesses the interval
 					\return      int the value of the interval of this qtTimer
 					\see         setInterval
 			*/
@@ -143,19 +143,16 @@
 				throw();

 			/** Starts the timer.
-					After this method is called the method  timer will be called
+					After this method is called timer() will be called
 					every  interval msec.
 					\see     stopTimer
-					\see     timer
 			*/
 			void startTimer()
 				throw();

 			/** Stops the timer.
-					After this method is called the execution of the  timer method
-					will be stopped.
+					After this method is called the execution of timer() will be stopped.
 					\see     startTimer
-					\see     timer
 			*/
 			void stopTimer()
 				throw();
@@ -165,14 +162,14 @@
 			*/
 			//@{

-			/** Tests if this qtTimer is running.
+			/** Tests if this QTTimer is running.
 					\see     startTimer
 					\see     stopTimer
 			*/
 			bool isTimerEnabled() const
 				throw();

-			/** Tests if this qtTimer is stopped.
+			/** Tests if this QTTimer is stopped.
 					\see     startTimer
 					\see     stopTimer
 			*/
@@ -187,17 +184,15 @@
 			/** Internal value dump.
 					Dumps the current state of this QTTimer to
 					the output ostream  s with dumping depth  depth.
-					\param   s output stream where to output the state of this qtTimer
+					\param   s output stream where to output the state
 					\param   depth the dumping depth
 			*/
 			virtual void dump(std::ostream& s = std::cout, Size depth = 0) const
 				throw();

-			//@}
-
 			protected:

-
+			//@}
 			/** @name Timer method.
 			*/
 			//@{


examples: Add a few comments to hello.c to allow for Sphinx code snippets

Signed-off-by: George K. Thiruvathukal <97f75e7847f9d781491c82d5a21e2f28eba950b0@cs.luc.edu>

--- examples/hello_world/hello.c
+++ examples/hello_world/hello.c
@@ -6,6 +6,8 @@
 void hello_init(struct thorium_actor *self);
 void hello_destroy(struct thorium_actor *self);
 void hello_receive(struct thorium_actor *self, struct thorium_message *message);
+
+/* hello-hello_script */

 struct thorium_script hello_script = {
     .identifier = SCRIPT_HELLO,
@@ -16,6 +18,7 @@
     .name = "hello"
 };

+/* hello-hello_init */
 void hello_init(struct thorium_actor *actor)
 {
     struct hello *hello1;
@@ -23,6 +26,8 @@
     hello1 = (struct hello *)thorium_actor_concrete_actor(actor);
     core_vector_init(&hello1->initial_helloes, sizeof(int));
 }
+
+/* hello-hello_destroy */

 void hello_destroy(struct thorium_actor *actor)
 {
@@ -33,6 +38,7 @@
     core_vector_destroy(&hello1->initial_helloes);
 }

+/* hello-hello_receive */
 void hello_receive(struct thorium_actor *actor, struct thorium_message *message)
 {
     int tag;
@@ -61,3 +67,4 @@
         thorium_actor_send_to_self_empty(actor, ACTION_STOP);
     }
 }
+/* hello-end */


move feature/quirk macros to the same place

--- include/Vc/global.h
+++ include/Vc/global.h
@@ -36,6 +36,10 @@
 #endif

 // Features/Quirks defines
+#if defined VC_MSVC && defined _WIN32
+// the Win32 ABI can't handle function parameters with alignment >= 16
+#define VC_PASSING_VECTOR_BY_VALUE_IS_BROKEN 1
+#endif
 #if defined(__GNUC__) && !defined(VC_NO_INLINE_ASM)
 #define VC_GNU_ASM 1
 #endif
@@ -273,11 +277,6 @@
 #undef SSE4a
 #undef AVX
 #undef Scalar
-
-#if defined VC_MSVC && defined _WIN32
-// the Win32 ABI can't handle function parameters with alignment >= 16
-#define VC_PASSING_VECTOR_BY_VALUE_IS_BROKEN
-#endif

 #ifndef DOXYGEN
 namespace Vc {


Add missing examples to documentation

Add missing examples to documentation

--- include/arrayfire.h
+++ include/arrayfire.h
@@ -234,36 +234,50 @@
 */

 /**
-\example helloworld.cpp
-\example pi.cpp
-\example integer.cpp
-\example rainfall.cpp
-\example vectorize.cpp
-\example black_scholes_options.cpp
+\example matching.cpp
+\example fast.cpp
+\example harris.cpp
+\example susan.cpp
+\example logistic_regression.cpp
+\example rbm.cpp
+\example perceptron.cpp
+\example neural_network.cpp
+\example bagging.cpp
+\example naive_bayes.cpp
+\example deep_belief_net.cpp
+\example kmeans.cpp
+\example softmax_regression.cpp
+\example knn.cpp
 \example monte_carlo_options.cpp
 \example heston_model.cpp
-\example harris.cpp
-\example kmeans.cpp
-\example knn.cpp
-\example bagging.cpp
-\example naive_bayes.cpp
-\example perceptron.cpp
-\example neural_network.cpp
-\example rbm.cpp
-\example deep_belief_net.cpp
-\example logistic_regression.cpp
+\example black_scholes_options.cpp
+\example blas.cpp
+\example fft.cpp
+\example pi.cpp
+\example svd.cpp
+\example cholesky.cpp
+\example qr.cpp
+\example lu.cpp
 \example conway.cpp
+\example histogram.cpp
+\example fractal.cpp
+\example plot2d.cpp
 \example conway_pretty.cpp
-\example fractal.cpp
-\example histogram.cpp
-\example plot2d.cpp
+\example helloworld.cpp
+\example vectorize.cpp
+\example integer.cpp
+\example convolve.cpp
+\example rainfall.cpp
+\example morphing.cpp
+\example image_demo.cpp
 \example brain_segmentation.cpp
-\example image_demo.cpp
+\example pyramids.cpp
+\example binary_thresholding.cpp
+\example optical_flow.cpp
+\example adaptive_thresholding.cpp
 \example image_editing.cpp
-\example morphing.cpp
-\example optical_flow.cpp
-\example pyramids.cpp
 \example edge.cpp
+\example filters.cpp
 */

 #include "af/compatible.h"


use ignore in fused::tuple

use ignore in fused::tuple

--- include/archie/utils/fused/tuple.h
+++ include/archie/utils/fused/tuple.h
@@ -130,17 +130,14 @@

       template <std::size_t n, std::size_t... idx>
       struct tuple_internals<n, std::index_sequence<idx...>> {
-        using alias = std::array<bool, sizeof...(idx)+1>;
         template <typename... Ts, typename... Us>
         static void copy_assign(tuple<Ts...>& lhs, tuple<Us...> const& rhs) {
-          (void)alias{false,
-                      (fused::get<idx>(lhs) = fused::get<idx>(rhs), false)...};
+          meta::ignore{(fused::get<idx>(lhs) = fused::get<idx>(rhs), false)...};
         }
         template <typename... Ts, typename... Us>
         static void move_assign(tuple<Ts...>& lhs, tuple<Us...>&& rhs) {
-          (void)alias{false,
-                      (fused::get<idx>(lhs) = std::move(fused::get<idx>(rhs)),
-                       false)...};
+          meta::ignore{(fused::get<idx>(lhs) = std::move(fused::get<idx>(rhs)),
+                        false)...};
         }
         template <typename... Ts>
         static bool equal(tuple<Ts...> const& lhs, tuple<Ts...> const& rhs) {


Updated doxygen comments to clean doc structure

git-svn-id: fbb392d5347ebc45c06187f72dfd8bab02595dbf@423398 13f79535-47bb-0310-9956-ffa450edef68

--- include/axis2_ctx.h
+++ include/axis2_ctx.h
@@ -1,27 +1,39 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/

 #ifndef AXIS2_CTX_H
 #define AXIS2_CTX_H

-
 /**
-  * @file axis2_ctx.h
-  * @brief axis2 context interface
-  */
+ * @defgroup axis2_context context hierarchy
+ * @ingroup axis2
+ * @{
+ * @}
+ */
+
+/** @defgroup axis2_ctx context
+ * @ingroup axis2_context
+ * Description.
+ * @{
+ */
+
+/**
+ * @file axis2_ctx.h
+ * @brief axis2 context interface
+ */

 #include <axis2_defines.h>
 #include <axis2_hash.h>
@@ -33,108 +45,157 @@
 {
 #endif

-/**
-  * @defgroup axis2_context context hierarchy
-  * @ingroup axis2
-  * @{
-  * @}
-  */
-
-/** @defgroup axis2_ctx context
- * @ingroup axis2_context
- * @{
- */
-
-typedef struct axis2_ctx_ops axis2_ctx_ops_t;
-typedef struct axis2_ctx axis2_ctx_t;
-
-
-/**
- * @brief context ops struct
- * Encapsulator struct for ops of axis2_ctx
- */
-struct axis2_ctx_ops
-{
+
+    /** Type name for struct axis2_ctx_ops */
+    typedef struct axis2_ctx_ops axis2_ctx_ops_t;
+    /** Type name for struct axis2_ctx */
+    typedef struct axis2_ctx axis2_ctx_t;
+
+
     /**
-     * Stores a key value pair depending on the persistent flag.
-     *
-     * @param key
-     * @param value
-     * @param persistent
+     * @brief context ops struct
+     * Encapsulator struct for ops of axis2_ctx
      */
-    axis2_status_t (AXIS2_CALL *
-    set_property)(struct axis2_ctx *ctx,
-                    const axis2_env_t *env,
-                    const axis2_char_t *key,
-                    axis2_property_t *value,
+    struct axis2_ctx_ops
+    {
+        /**
+         * Stores a key value pair depending on the persistent flag.
+	 * @param ctx pointer to context struct
+	 * @param env pointer to environment struct
+         * @param key pointer to key
+         * @param value pointer to value
+         * @param persistent persistent
+	 * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+         */
+        axis2_status_t (AXIS2_CALL *
+                set_property)(
+                    struct axis2_ctx *ctx,
+                    const axis2_env_t *env,
+                    const axis2_char_t *key,
+                    axis2_property_t *value,
                     const axis2_bool_t persistent);
-
+
+        /**
+	 * @param ctx pointer to context struct
+	 * @param env pointer to environment struct
+         * @param key pointer to key
+         * @param persistent persistent
+         */
+        axis2_property_t *(AXIS2_CALL *
+                get_property)(
+                    struct axis2_ctx *ctx,
+                    const axis2_env_t *env,
+                    const axis2_char_t *key,
+                    const axis2_bool_t persistent);
+
+	/**
+	 * @param ctx pointer to context struct
+	 * @param env pointer to environment struct
+	 */
+        axis2_hash_t* (AXIS2_CALL *
+                get_non_persistent_map)(
+                    struct axis2_ctx *ctx,
+                    const axis2_env_t *env);
+
+	/**
+	 * @param ctx pointer to context struct
+	 * @param env pointer to environment struct
+	 */
+        axis2_hash_t* (AXIS2_CALL *
+                get_persistent_map)(
+                    struct axis2_ctx *ctx,
+                    const axis2_env_t *env);
+
+        /**
+         * Deallocate memory
+	 * @param ctx pointer to context struct
+	 * @param env pointer to environment struct
+	 * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+         */
+        axis2_status_t (AXIS2_CALL *
+                free)(
+                    axis2_ctx_t *ctx,
+                    const axis2_env_t *env);
+
+	/**
+	 * @param ctx pointer to context struct
+	 * @param env pointer to environment struct
+	 * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+	 */
+        axis2_status_t (AXIS2_CALL *
+                set_non_persistent_map)(
+                    struct axis2_ctx *ctx,
+                    const axis2_env_t *env,
+                    axis2_hash_t* map);
+
+	/**
+	 * @param ctx pointer to context struct
+	 * @param env pointer to enviromnet struct
+	 * @param map pointer to map
+	 * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+	 */
+        axis2_status_t (AXIS2_CALL *
+                set_persistent_map)(
+                    struct axis2_ctx *ctx,
+                    const axis2_env_t *env,
+                    axis2_hash_t* map);
+    };
+
     /**
-     * @param key
-     * @param persistent
-     * @return
+     * context struct
      */
-    axis2_property_t *(AXIS2_CALL *
-    get_property)(
-        struct axis2_ctx *ctx,
-        const axis2_env_t *env,
-        const axis2_char_t *key,
-        const axis2_bool_t persistent);
-
-    axis2_hash_t* (AXIS2_CALL *get_non_persistent_map)(struct axis2_ctx *ctx,
-                                                           const axis2_env_t *env);
-
-    axis2_hash_t* (AXIS2_CALL *get_persistent_map)(struct axis2_ctx *ctx,
-                                                   const axis2_env_t *env);
-
-    /**
-     * Deallocate memory
-     * @return status code
+    struct axis2_ctx
+    {
+	/** operations of context struct */
+        axis2_ctx_ops_t *ops;
+    };
+
+    /**
+     * Creates a context struct
+     * @param env pointer to environment struct
      */
-    axis2_status_t (AXIS2_CALL *free)(axis2_ctx_t *ctx,
-                                        const axis2_env_t *env);
-    axis2_status_t (AXIS2_CALL *
-    set_non_persistent_map)(
-        struct axis2_ctx *ctx,
-        const axis2_env_t *env,
-        axis2_hash_t* map);
-
-    axis2_status_t (AXIS2_CALL *
-    set_persistent_map)(
-        struct axis2_ctx *ctx,
-        const axis2_env_t *env,
-        axis2_hash_t* map);
-};
-
-/**
- * @brief context struct
-  *   Axis2 context
- */
-struct axis2_ctx
-{
-    axis2_ctx_ops_t *ops;
-};
-
-AXIS2_EXTERN axis2_ctx_t *AXIS2_CALL axis2_ctx_create (const axis2_env_t *env);
-
+    AXIS2_EXTERN axis2_ctx_t *AXIS2_CALL
+	    axis2_ctx_create(
+                const axis2_env_t *env);
+
 /************************** Start of function macros **************************/

+/** Set property.
+    @sa axis2_ctx_ops#set_property */
 #define AXIS2_CTX_SET_PROPERTY(ctx, env, key, value, persistent) \
     ((ctx)->ops->set_property(ctx, env, key, value, persistent))
+
+/** Get property.
+    @sa axis2_ctx_ops#get_property */
 #define AXIS2_CTX_GET_PROPERTY(ctx, env, key, persistent) \
     ((ctx)->ops->get_property(ctx, env, key, persistent))
+
+/** Get non persistant.
+    @sa axis2_ctx_ops#get_non_persistant_map */
 #define AXIS2_CTX_GET_NON_PERSISTANT_MAP(ctx, env) \
     ((ctx)->ops->get_non_persistent_map(ctx, env))
+
+/** Get persistant map.
+    @sa axis2_ctx_ops#get_persistant_map */
 #define AXIS2_CTX_GET_PERSISTANT_MAP(ctx, env) \
     ((ctx)->ops->get_persistent_map(ctx, env))
+
+/** Set non persistant map.
+    @sa axis2_ctx_ops#set_non_persistant_map */
 #define AXIS2_CTX_SET_NON_PERSISTANT_MAP(ctx, env, map) \
     ((ctx)->ops->set_non_persistent_map(ctx, env, map))
+
+/** set persistant map.
+    @sa axis2_ctx_ops#set_persistant_map */
 #define AXIS2_CTX_SET_PERSISTANT_MAP(ctx, env, map) \
     ((ctx)->ops->set_persistent_map(ctx, env, map))
+
+/** Frees the context.
+    @sa axis2_ctx_ops#free */
 #define AXIS2_CTX_FREE(ctx, env) \
     ((ctx)->ops->free (ctx, env))

-/************************** End of function macros ****************************/
+/************************** End of function macros ****************************/

 /** @} */
 #ifdef __cplusplus


circular storage: updating clear() function so that it does not resize the internal vector. see Cycling74/min-lib/issue #20

--- include/c74_lib_circular_storage.h
+++ include/c74_lib_circular_storage.h
@@ -170,11 +170,12 @@
 		}

-		///	Zero the contents.
+		///	Zero the contents without resizing.

 		void clear() {
             assert(check_thread());
-			m_items.clear();
+			T empty_value;
+            std::fill(m_items.begin(),m_items.end(),empty_value);
 		}

@@ -194,6 +195,11 @@
 		void resize(std::size_t	new_size) {
 			assert(new_size <= m_items.size());
 			m_size = new_size;
+            // if m_index is out of bounds after resize, we clear the memory to prevent invalid output from history
+            if (m_index >= m_size) {
+                m_index = 0;
+                clear();
+            }
 		}


Removed redundant static_cast

Removed redundant static_cast

--- signals.h
+++ signals.h
@@ -187,7 +187,7 @@
 				ExecutionTokenPtr token = func.Token().GetExecutionToken().Execute();

 				if (token)
-					WRAP_EXCEPTION_HANDLING( exceptionHandler, FunctorInvoker::Invoke(static_cast<const function<Signature>&>(func.Func()), p); );
+					WRAP_EXCEPTION_HANDLING( exceptionHandler, FunctorInvoker::Invoke(func.Func(), p); );
 			}
 		}


Saving...

Saving...

--- shuffle.c
+++ shuffle.c
@@ -8,6 +8,9 @@
 #include <stdint.h>
 #include <immintrin.h>

+/********
+* Next part is mersenne Twister
+*********/

 #define RDTSC_START(cycles)                                     \
     do {                                                        \
@@ -95,27 +98,6 @@

 static uint32_t x;

-uint32_t fastrand(void) {
-#ifdef USE_GENERIC
-    x = ((x * 1103515245) + 12345) & 0x7fffffff;
-    return x;
-#else
-#ifdef USE_MT
-    return randomMT();
-#else
-#ifdef USE_RAND
-    return rand();
-#else
-    return randomMT();
-#endif
-#endif
-#endif
-}
-
-/**************
-* next bit is from
-* https://github.com/axel-bacher/mergeshuffle/
-****/
 // get a random 64-bit register
 // Uses the "rdrand" instruction giving hardware randomness
 // documentation: https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide
@@ -124,6 +106,27 @@
     __asm__ __volatile__("0:\n\t" "rdrand %0\n\t" "jnc 0b": "=r" (r) :: "cc");
     return r;
 }
+
+uint32_t fastrand(void) {
+#ifdef USE_GENERIC
+    x = ((x * 1103515245) + 12345) & 0x7fffffff;
+    return x;
+#elif USE_MT
+    return randomMT();
+#elif USE_RAND
+    return rand();
+#elif USE_HARDWARE
+    return rand64();// 64-bit...
+#else
+    return randomMT();
+#endif
+}
+
+/**************
+* next bit is from
+* https://github.com/axel-bacher/mergeshuffle/
+****/
+

 struct random {
     unsigned long x;
@@ -586,17 +589,15 @@
     uint64_t cycles_start, cycles_final;
 #ifdef USE_GENERIC
     printf("Using some basic random number generator\n");
-#else
-#ifdef USE_MT
+#elif USE_MT
     printf("Using Mersenne Twister\n");
-#else
-#ifdef USE_RAND
+#elif USE_RAND
     printf("Using rand\n");
+#elif USE_HARDWARE
+    printf("Using hardware\n");
 #else
     printf("Using Mersenne Twister\n");
 #endif
-#endif
-#endif

     printf("populating array %zu \n",N);


Cleanup.

Cleanup.

--- include/bgfx/bgfx.h
+++ include/bgfx/bgfx.h
@@ -1098,7 +1098,7 @@
 	/// can pass `ReleaseFn` function pointer to release this memory after it's
 	/// consumed, or you must make sure data is available for at least 2
 	/// `bgfx::frame` calls. `ReleaseFn` function must be able to be called
-	/// called from any thread.
+	/// from any thread.
 	///
 	/// @attention C99 equivalent are `bgfx_make_ref`, `bgfx_make_ref_release`.
 	///


StatAggregator: Added friend classes Trainer and NetStatus for access to hardcoded stats, Added hardcoded stat is_training

--- include/cn24/util/StatAggregator.h
+++ include/cn24/util/StatAggregator.h
@@ -24,8 +24,10 @@

 namespace Conv
 {
-// Forward declaration
+// Forward declarations
 class StatSink;
+class Trainer;
+class NetStatus;

 // Hardcoded stats
 struct HardcodedStats {
@@ -33,6 +35,7 @@
   unsigned long iterations = 0UL;
   unsigned long weights = 0UL;
   unsigned long epoch = 0UL;
+  bool is_training = false;

   void Reset() {
     seconds_elapsed = 0.0;
@@ -62,6 +65,8 @@
 };

 class StatAggregator {
+  friend class Trainer;
+  friend class NetStatus;
 public:
   unsigned int RegisterStat(StatDescriptor* stat_descriptor);
   unsigned int RegisterSink(StatSink* stat_sink);


Bug fix for same subkeys

Bug fix for same subkeys

Remove bugs in key rotation

--- week2-feistel_structure/feistel.c
+++ week2-feistel_structure/feistel.c
@@ -1,6 +1,12 @@
 /*
 Feistel cipher
 by Abhijith V Mohan
+
+Implementation of a simple cipher with feistel structure
+and using it to encrypt a file in EBC mode
+TODO:
+add single block encryption in main
+add CBC mode
 */
 #include <assert.h>
 #include <stdio.h>
@@ -9,49 +15,53 @@
 //Key size 16 bits

 #define NO_OF_ROUNDS 16
-typedef unsigned int uint;
-uint key_sequence[NO_OF_ROUNDS];
+typedef unsigned int uint; //32 bits
+uint key_sequence[NO_OF_ROUNDS]; //subkey sequence

+//left rotate(only the rightmost 16 bits)
 inline uint left_rotate(uint x)
 {
-	return x<<1 | x>>31;
+	return (x<<1)&0x0000FFFF | (1<<15)&x;
 }

+//Left 16 bits of X
 inline uint left(uint X)
 {
-	//Left 16 bits of X
 	return (0xFFFF0000&X)>>16;
 }

+//Right 16 bits of X
 inline uint right(uint X)
 {
-	//Right 16 bits of X
 	return 0x0000FFFF&X;
 }

+//Make 32bits with 16 bit L and 16 bit R
 inline uint pack(uint L, uint R)
 {
-	//Make 32bits with 16 bit L and 16 bit R
 	return (L<<16)|R;
 }

+//Generates round keys from the base key
 void keygen(uint K)
 {
-	//Generates round keys from the base key
+	K &= 0x0000FFFF;
 	uint i;
-	for (i = 0; i < NO_OF_ROUNDS; i++) {
-		key_sequence[i]=right(left_rotate(K));
+	key_sequence[0] = K;
+	for (i = 1; i < NO_OF_ROUNDS; i++) {
+		key_sequence[i]=left_rotate(key_sequence[i-1]);
 	}
 }

+//The feistel round function
 uint round_fn(uint x, uint k)
 {
 	return right(x^k);
 }

+//One round of the feistel function
 uint feistel_round(uint X, uint round_key)
 {
-	//One round of the feistel function
 	return pack(right(X), left(X)^round_fn(right(X), round_key));
 }


Fixed build error for Arduino Mega

Fixed build error for Arduino Mega

Change-Id: Ie7ad30627d0bf9b8a6e99d36fc9e6064da48e566
Signed-off-by: Abhishek Sharma <88f0e1cd49753fc3688d7153556599606f91d04d@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9555
Tested-by: jenkins-iotivity <09cb29e8a2b473a2c978382eec13ee06fa017bda@opendaylight.org>
Reviewed-by: jihwan seo <69598d7552022c520cfdbefd16641727c7ff4ab5@samsung.com>
Reviewed-by: Jaewook Jung <e30c770b7f9b30402e4d6c2240cd5b03cb3bf7f9@samsung.com>
Reviewed-by: Ashok Babu Channa <72ac47ef856ca3d131a57cba474ebed48591eeff@samsung.com>

--- resource/csdk/logger/src/logger.c
+++ resource/csdk/logger/src/logger.c
@@ -35,7 +35,13 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+
+#ifdef HAVE_ARDUINO_TIME_H
+#include <Time.h>
+#else
 #include <time.h>
+#endif
+
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif


pprint: implemented bh_pprint_dag_file()

--- include/bh_pprint.h
+++ include/bh_pprint.h
@@ -92,4 +92,56 @@
 }
 #endif

+#ifdef __cplusplus
+
+#include <boost/foreach.hpp>
+#include <boost/graph/graph_traits.hpp>
+#include <boost/graph/graphviz.hpp>
+#include <iostream>
+#include <fstream>
+
+/* Writes the DOT file of a boost DAG of instruction kernels.
+ *
+ * @dag       The DAG to write (of type 'Graph')
+ * @filename  The name of DOT file
+ */
+template <typename Graph>
+void bh_pprint_dag_file(Graph &dag, const char filename[])
+{
+    using namespace std;
+    using namespace boost;
+
+    //We define a graph and a kernel writer for graphviz
+    struct graph_writer
+    {
+        void operator()(std::ostream& out) const
+        {
+            out << "graph [bgcolor=white, fontname=\"Courier New\"]" << endl;
+            out << "node [shape=box color=black, fontname=\"Courier New\"]" << endl;
+        }
+    };
+    typedef typename graph_traits<Graph>::vertex_descriptor Vertex;
+    struct kernel_writer
+    {
+        const Graph &graph;
+        kernel_writer(const Graph &g) : graph(g) {};
+        void operator()(std::ostream& out, const Vertex& v) const
+        {
+            out << "[label=\"Kernel " << v << ":\\l";
+            BOOST_FOREACH(const bh_instruction &i, graph[v]->instr_list)
+            {
+                char buf[1024*10];
+                bh_sprint_instr(&i, buf, "\\l");
+                out << buf << "\\l";
+            }
+            out << "\"]";
+        }
+    };
+    cout << "Writing file " << filename << endl;
+    ofstream file;
+    file.open(filename);
+    write_graphviz(file, dag, kernel_writer(dag), default_writer(), graph_writer());
+    file.close();
+}
 #endif
+#endif


Fixed to shared_ptr header

Fixed to shared_ptr header

Signed-off-by: Ian Bell <6f1c5b737f3c5cff42a9b8f8dcfce305d97fd07b@gmail.com>

--- include/crossplatform_shared_ptr.h
+++ include/crossplatform_shared_ptr.h
@@ -5,9 +5,12 @@

 // Based on the platform and compiler, include the necessary header to give access to std::tr1::shared_ptr directly as shared_ptr

-#if defined(__ISLINUX__)
+#if defined(__ISLINUX__) && (defined(__llvm__) || defined(__clang__))
 #include <memory>
 using std::shared_ptr;
+#elif defined(__ISLINUX__)
+#include <tr1/memory>
+using namespace std::tr1;
 #elif defined(__ISAPPLE__)
 #include <tr1/memory>
 using namespace std::tr1;


if already included, the class name is Locale not BZLocale

--- include/bz_Locale.h
+++ include/bz_Locale.h
@@ -55,7 +55,7 @@

 #else
-class BZLocale;
+class Locale;
 #endif

 // Local Variables: ***


All pkg info request with -O should return 0, Fixes #32

--- pkg/info.c
+++ pkg/info.c
@@ -166,6 +166,9 @@
 	argv += optind;

 	if (argc == 0 && match != MATCH_ALL) {
+		/* which -O bsd.*.mk always execpt clean output */
+		if (opt & INFO_ORIGIN_SEARCH)
+			return (0);
 		usage_info();
 		return (EX_USAGE);
 	}


Use std::unique_ptr instead of std::shared_ptr for DoFHandler::policy.

This is possible because DoFHandler has no copy constructor or operator, and consequently
there is no reason to share a policy.

--- include/deal.II/dofs/dof_handler.h
+++ include/deal.II/dofs/dof_handler.h
@@ -933,7 +933,7 @@
    * An object that describes how degrees of freedom should be distributed and
    * renumbered.
    */
-  std::shared_ptr<dealii::internal::DoFHandler::Policy::PolicyBase<dim,spacedim> > policy;
+  std::unique_ptr<dealii::internal::DoFHandler::Policy::PolicyBase<dim,spacedim> > policy;

   /**
    * A structure that contains all sorts of numbers that characterize the


Wrap lines for style(9)

Wrap lines for style(9)

--- pkg/lock.c
+++ pkg/lock.c
@@ -67,11 +67,13 @@

 	if (locked) {
 		if (!quiet)
-			printf("%s-%s: already locked\n", pkgname, pkgversion);
-		return (EPKG_OK);
-	}
-
-	if (!yes && !query_yesno("%s-%s: lock this package? [y/N]: ", pkgname, pkgversion))
+			printf("%s-%s: already locked\n",
+			       pkgname, pkgversion);
+		return (EPKG_OK);
+	}
+
+	if (!yes && !query_yesno("%s-%s: lock this package? [y/N]: ",
+				 pkgname, pkgversion))
 		return (EPKG_OK);

 	if (!quiet)
@@ -94,11 +96,13 @@

 	if (!locked) {
 		if (!quiet)
-			printf("%s-%s: already unlocked\n", pkgname, pkgversion);
-		return (EPKG_OK);
-	}
-
-	if (!yes && !query_yesno("%s-%s: unlock this package? [y/N]: ", pkgname, pkgversion))
+			printf("%s-%s: already unlocked\n",
+			       pkgname, pkgversion);
+		return (EPKG_OK);
+	}
+
+	if (!yes && !query_yesno("%s-%s: unlock this package? [y/N]: ",
+				 pkgname, pkgversion))
 		return (EPKG_OK);

 	if (!quiet)


add long integer command line options

add long integer command line options

--- include/ef.gy/cli.h
+++ include/ef.gy/cli.h
@@ -393,6 +393,57 @@
   std::string value;
 };

+/* A long integer CLI flag.
+ *
+ * Exactly what it says on the tin. The regex that this resolves to allows for
+ * the following syntax variants:
+ *
+ *     --name=123
+ *     --name:456
+ *
+ * Dashes are optional, and you can either use -name or --name. It's not
+ * possible to split this into two arguments, however, e.g. "--name 123" is not
+ * a valid way to set the flag.
+ */
+template <>
+class flag<long> : public option {
+ public:
+  /* Construct with name.
+   * @pName The name for the integer CLI flag.
+   * @pDescription A textual description of what the flag does.
+   * @pOpts The option registry to register with.
+   *
+   * The name you give the flag is used as part of a regex, so keep it simple.
+   */
+  flag(const std::string &pName,
+       const std::string &pDescription = "please document me",
+       beacons<option> &pOpts = global<beacons<option>>())
+      : option("-{0,2}" + pName + "[:=]([0-9]+)",
+               [this](std::smatch &m) -> bool {
+                 const std::string v = m[1];
+                 value = std::strtol(v.c_str(), 0, 10);
+                 return true;
+               },
+               "[integer] " + pDescription, pOpts),
+        value(0) {}
+
+  /* Cast to a string.
+   *
+   * This allows accessing the value of this option. The default is 0,
+   * unless it's been set at the command line.
+   *
+   * @return 'value', but forced to be const.
+   */
+  operator const long(void) const { return value; }
+
+ protected:
+  /* Raw value.
+   *
+   * Don't use this. Use the provided type cast operator instead.
+   */
+  long value;
+};
+
 /* Additional CLI usage hints.
  *
  * This class provides additional usage hints to users of your programme. A


Workaround gcc < 4.5.0 bug

Workaround gcc < 4.5.0 bug

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=189

Signed-off-by: Mario J. Rugiero <a49d105ef81b8915faf7fbadb1e4a2444125bc93@gmail.com>

--- src/google/protobuf/metadata_lite.h
+++ src/google/protobuf/metadata_lite.h
@@ -167,7 +167,8 @@
   InternalMetadataWithArenaLite() {}

   explicit InternalMetadataWithArenaLite(Arena* arena)
-      : InternalMetadataWithArenaBase(arena) {}
+      : InternalMetadataWithArenaBase<string,
+                                      InternalMetadataWithArenaLite>(arena) {}

   void DoSwap(string* other) {
     mutable_unknown_fields()->swap(*other);


Added the in* functions to v810.h (can't believe I forgot those)

--- include/eris/v810.h
+++ include/eris/v810.h
@@ -41,6 +41,9 @@
 void out32(u32 port, u32 data);
 void out16(u32 port, u16 data);
 void out8(u32 port, u8 data);
+u32 in32(u32 port);
+u16 in16(u32 port);
+u8 in8(u32 port);

 #endif


Core: ForEach: Change order of template arugment to support iterating over containers where value_type is not defined

--- include/inviwo/core/util/foreach.h
+++ include/inviwo/core/util/foreach.h
@@ -40,19 +40,18 @@
 namespace inviwo {

 namespace util {
-    namespace detail{
-        template <typename Callback, typename IT>
-        void foreach_helper(std::false_type, IT a, IT b, Callback callback, size_t = 0) {
-            std::for_each(a, b, callback);
-        }
+namespace detail {
+template <typename Callback, typename IT>
+void foreach_helper(std::false_type, IT a, IT b, Callback callback, size_t = 0) {
+    std::for_each(a, b, callback);
+}

-        template <typename Callback, typename IT>
-        void foreach_helper(std::true_type, IT a, IT b, Callback callback, size_t start = 0) {
-            std::for_each(a, b, [&](auto v) { callback(v, start++); });
-        }
+template <typename Callback, typename IT>
+void foreach_helper(std::true_type, IT a, IT b, Callback callback, size_t start = 0) {
+    std::for_each(a, b, [&](auto v) { callback(v, start++); });
+}

-    }
-
+}  // namespace detail

 /**
  * Use multiple threads to iterate over all elements in an iterable data structure (such as
@@ -68,7 +67,7 @@
  * create pool size * 4 jobs
  * @return a vector of futures, one for each job created.
  */
-template <typename Iterable, typename Callback, typename T = typename Iterable::value_type>
+template <typename Iterable, typename T = typename Iterable::value_type, typename Callback>
 std::vector<std::future<void>> forEachParallelAsync(const Iterable& iterable, Callback callback,
                                                     size_t jobs = 0) {
     auto settings = InviwoApplication::getPtr()->getSettingsByType<SystemSettings>();
@@ -110,9 +109,9 @@
  * @param jobs optional parameter specifying how many jobs to create, if jobs==0 (default) it will
  * create pool size * 4 jobs
  */
-template <typename Iterable, typename Callback, typename T = typename Iterable::value_type>
+template <typename Iterable, typename T = typename Iterable::value_type, typename Callback>
 void forEachParallel(const Iterable& iterable, Callback callback, size_t jobs = 0) {
-    auto futures = forEachParallelAsync<Iterable,Callback,T>(iterable, callback, jobs);
+    auto futures = forEachParallelAsync<Iterable, T, Callback>(iterable, callback, jobs);

     for (const auto& e : futures) {
         e.wait();


regulator: add missing prototype for regulator_is_supported_voltage

avoids needs for CONFIG_REGULATOR in sdhci.c

Signed-off-by: Philip Rakity <1eb54c8280fcf927734e562c2493f99735c99337@nvidia.com>
Reviewed-by: Eric Miao <60e376623d7bcedd53f4c51cbb2c060fb40a4887@gmail.com>
Signed-off-by: Eric Miao <60e376623d7bcedd53f4c51cbb2c060fb40a4887@gmail.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@opensource.wolfsonmicro.com>

--- include/linux/regulator/consumer.h
+++ include/linux/regulator/consumer.h
@@ -358,6 +358,10 @@
 {
 }

+static inline int regulator_count_voltages(struct regulator *regulator)
+{
+	return 0;
+}
 #endif

 static inline int regulator_set_voltage_tol(struct regulator *regulator,


Convert to use ilist and non-pointer lists for extra goodness

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

--- include/llvm/ADT/SparseBitVector.h
+++ include/llvm/ADT/SparseBitVector.h
@@ -17,12 +17,11 @@

 #include <cassert>
 #include <cstring>
-#include <list>
 #include <algorithm>
 #include "llvm/Support/DataTypes.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/MathExtras.h"
-
+#include "llvm/ADT/ilist"
 namespace llvm {

 /// SparseBitVector is an implementation of a bitvector that is sparse by only
@@ -48,11 +47,35 @@
     BITWORDS_PER_ELEMENT = (ElementSize + BITWORD_SIZE - 1) / BITWORD_SIZE,
     BITS_PER_ELEMENT = ElementSize
   };
+
+  SparseBitVectorElement<ElementSize> *getNext() const {
+    return Next;
+  }
+  SparseBitVectorElement<ElementSize> *getPrev() const {
+    return Prev;
+  }
+
+  void setNext(SparseBitVectorElement<ElementSize> *RHS) {
+    Next = RHS;
+  }
+  void setPrev(SparseBitVectorElement<ElementSize> *RHS) {
+    Prev = RHS;
+  }
+
 private:
+  SparseBitVectorElement<ElementSize> *Next;
+  SparseBitVectorElement<ElementSize> *Prev;
   // Index of Element in terms of where first bit starts.
   unsigned ElementIndex;
   BitWord Bits[BITWORDS_PER_ELEMENT];
-  SparseBitVectorElement();
+  // Needed for sentinels
+  SparseBitVectorElement() {
+    ElementIndex = ~0UL;
+    memset(&Bits[0], 0, sizeof (BitWord) * BITWORDS_PER_ELEMENT);
+  }
+
+  friend struct ilist_traits<SparseBitVectorElement<ElementSize> >;
+
 public:
   explicit SparseBitVectorElement(unsigned Idx) {
     ElementIndex = Idx;
@@ -262,12 +285,11 @@
     }
     BecameZero = !allzero;
   }
-
 };

 template <unsigned ElementSize = 128>
 class SparseBitVector {
-  typedef std::list<SparseBitVectorElement<ElementSize> *> ElementList;
+  typedef ilist<SparseBitVectorElement<ElementSize> > ElementList;
   typedef typename ElementList::iterator ElementListIter;
   typedef typename ElementList::const_iterator ElementListConstIter;
   enum {
@@ -294,15 +316,15 @@
     // Search from our current iterator, either backwards or forwards,
     // depending on what element we are looking for.
     ElementListIter ElementIter = CurrElementIter;
-    if ((*CurrElementIter)->index() == ElementIndex) {
+    if (CurrElementIter->index() == ElementIndex) {
       return ElementIter;
-    } else if ((*CurrElementIter)->index() > ElementIndex) {
+    } else if (CurrElementIter->index() > ElementIndex) {
       while (ElementIter != Elements.begin()
-             && (*ElementIter)->index() > ElementIndex)
+             && ElementIter->index() > ElementIndex)
         --ElementIter;
     } else {
       while (ElementIter != Elements.end() &&
-             (*ElementIter)->index() <= ElementIndex)
+             ElementIter->index() <= ElementIndex)
         ++ElementIter;
       --ElementIter;
     }
@@ -339,11 +361,11 @@
         return;
       }
       Iter = BitVector->Elements.begin();
-      BitNumber = (*Iter)->index() * ElementSize;
-      unsigned BitPos = (*Iter)->find_first();
+      BitNumber = Iter->index() * ElementSize;
+      unsigned BitPos = Iter->find_first();
       BitNumber += BitPos;
       WordNumber = (BitNumber % ElementSize) / BITWORD_SIZE;
-      Bits = (*Iter)->word(WordNumber);
+      Bits = Iter->word(WordNumber);
       Bits >>= BitPos % BITWORD_SIZE;
     }

@@ -359,7 +381,7 @@

       // See if we ran out of Bits in this word.
       if (!Bits) {
-        int NextSetBitNumber = (*Iter)->find_next(BitNumber % ElementSize) ;
+        int NextSetBitNumber = Iter->find_next(BitNumber % ElementSize) ;
         // If we ran out of set bits in this element, move to next element.
         if (NextSetBitNumber == -1 || (BitNumber % ElementSize == 0)) {
           ++Iter;
@@ -371,15 +393,15 @@
             return;
           }
           // Set up for next non zero word in bitmap.
-          BitNumber = (*Iter)->index() * ElementSize;
-          NextSetBitNumber = (*Iter)->find_first();
+          BitNumber = Iter->index() * ElementSize;
+          NextSetBitNumber = Iter->find_first();
           BitNumber += NextSetBitNumber;
           WordNumber = (BitNumber % ElementSize) / BITWORD_SIZE;
-          Bits = (*Iter)->word(WordNumber);
+          Bits = Iter->word(WordNumber);
           Bits >>= NextSetBitNumber % BITWORD_SIZE;
         } else {
           WordNumber = (NextSetBitNumber % ElementSize) / BITWORD_SIZE;
-          Bits = (*Iter)->word(WordNumber);
+          Bits = Iter->word(WordNumber);
           Bits >>= NextSetBitNumber % BITWORD_SIZE;
         }
       }
@@ -438,17 +460,14 @@
   }

   ~SparseBitVector() {
-    for_each(Elements.begin(), Elements.end(),
-             deleter<SparseBitVectorElement<ElementSize> >);
   }

   // SparseBitVector copy ctor.
   SparseBitVector(const SparseBitVector &RHS) {
     ElementListConstIter ElementIter = RHS.Elements.begin();
     while (ElementIter != RHS.Elements.end()) {
-      SparseBitVectorElement<ElementSize> *ElementCopy;
-      ElementCopy = new SparseBitVectorElement<ElementSize>(*(*ElementIter));
-      Elements.push_back(ElementCopy);
+      Elements.push_back(SparseBitVectorElement<ElementSize>(*ElementIter));
+      ++ElementIter;
     }

     CurrElementIter = Elements.begin ();
@@ -465,9 +484,9 @@
     // If we can't find an element that is supposed to contain this bit, there
     // is nothing more to do.
     if (ElementIter == Elements.end() ||
-        (*ElementIter)->index() != ElementIndex)
+        ElementIter->index() != ElementIndex)
       return false;
-    return (*ElementIter)->test(Idx % ElementSize);
+    return ElementIter->test(Idx % ElementSize);
   }

   void reset(unsigned Idx) {
@@ -480,38 +499,36 @@
     // If we can't find an element that is supposed to contain this bit, there
     // is nothing more to do.
     if (ElementIter == Elements.end() ||
-        (*ElementIter)->index() != ElementIndex)
+        ElementIter->index() != ElementIndex)
       return;
-    (*ElementIter)->reset(Idx % ElementSize);
+    ElementIter->reset(Idx % ElementSize);

     // When the element is zeroed out, delete it.
-    if ((*ElementIter)->empty()) {
-      delete (*ElementIter);
+    if (ElementIter->empty()) {
       ++CurrElementIter;
       Elements.erase(ElementIter);
     }
   }

   void set(unsigned Idx) {
+    unsigned ElementIndex = Idx / ElementSize;
     SparseBitVectorElement<ElementSize> *Element;
-    unsigned ElementIndex = Idx / ElementSize;
-
+    ElementListIter ElementIter;
     if (Elements.empty()) {
       Element = new SparseBitVectorElement<ElementSize>(ElementIndex);
-      Elements.push_back(Element);
+      ElementIter = Elements.insert(Elements.end(), Element);
+
     } else {
-      ElementListIter ElementIter = FindLowerBound(ElementIndex);
-
-      if (ElementIter != Elements.end() &&
-          (*ElementIter)->index() == ElementIndex)
-        Element = *ElementIter;
-      else {
+      ElementIter = FindLowerBound(ElementIndex);
+
+      if (ElementIter == Elements.end() ||
+          ElementIter->index() != ElementIndex) {
         Element = new SparseBitVectorElement<ElementSize>(ElementIndex);
         // Insert does insert before, and lower bound gives the one before.
-        Elements.insert(++ElementIter, Element);
-      }
-    }
-    Element->set(Idx % ElementSize);
+        ElementIter = Elements.insert(++ElementIter, Element);
+      }
+    }
+    ElementIter->set(Idx % ElementSize);
   }

   bool test_and_set (unsigned Idx) {
@@ -527,8 +544,8 @@
     ElementListIter Iter1 = Elements.begin();
     ElementListConstIter Iter2 = RHS.Elements.begin();

-    // IE They may both be end
-    if (Iter1 == Iter2)
+    // Check if both bitmaps are empty
+    if (Elements.empty() && RHS.Elements.empty())
       return false;

     // See if the first bitmap element is the same in both.  This is only
@@ -538,15 +555,13 @@
         return false;

     while (Iter2 != RHS.Elements.end()) {
-      if (Iter1 == Elements.end() || (*Iter1)->index() > (*Iter2)->index()) {
-        SparseBitVectorElement<ElementSize> *NewElem;
-
-        NewElem = new SparseBitVectorElement<ElementSize>(*(*Iter2));
-        Elements.insert(Iter1, NewElem);
+      if (Iter1 == Elements.end() || Iter1->index() > Iter2->index()) {
+        Elements.insert(Iter1,
+                        new SparseBitVectorElement<ElementSize>(*Iter2));
         ++Iter2;
         changed = true;
-      } else if ((*Iter1)->index() == (*Iter2)->index()) {
-        changed |= (*Iter1)->unionWith(*(*Iter2));
+      } else if (Iter1->index() == Iter2->index()) {
+        changed |= Iter1->unionWith(*Iter2);
         ++Iter1;
         ++Iter2;
       } else {
@@ -563,8 +578,8 @@
     ElementListIter Iter1 = Elements.begin();
     ElementListConstIter Iter2 = RHS.Elements.begin();

-    // IE They may both be end.
-    if (Iter1 == Iter2)
+    // Check if both bitmaps are empty.
+    if (Elements.empty() && RHS.Elements.empty())
       return false;

     // See if the first bitmap element is the same in both.  This is only
@@ -578,14 +593,13 @@
       if (Iter1 == Elements.end())
         return changed;

-      if ((*Iter1)->index() > (*Iter2)->index()) {
-        ++Iter2;
-      } else if ((*Iter1)->index() == (*Iter2)->index()) {
+      if (Iter1->index() > Iter2->index()) {
+        ++Iter2;
+      } else if (Iter1->index() == Iter2->index()) {
         bool BecameZero;
-        changed |= (*Iter1)->intersectWith(*(*Iter2), BecameZero);
+        changed |= Iter1->intersectWith(*Iter2, BecameZero);
         if (BecameZero) {
           ElementListIter IterTmp = Iter1;
-          delete *IterTmp;
           Elements.erase(IterTmp);
         }
         ++Iter1;
@@ -593,12 +607,9 @@
       } else {
         ElementListIter IterTmp = Iter1;
         ++Iter1;
-        delete *IterTmp;
         Elements.erase(IterTmp);
       }
     }
-    for_each(Iter1, Elements.end(),
-             deleter<SparseBitVectorElement<ElementSize> >);
     Elements.erase(Iter1, Elements.end());
     CurrElementIter = Elements.begin();
     return changed;
@@ -611,16 +622,14 @@
     ElementListIter Iter1 = Elements.begin();
     ElementListConstIter Iter2 = RHS.Elements.begin();

-    // IE They may both be end.
-    if (Iter1 == Iter2)
+    // Check if they are both empty
+    if (Elements.empty() && RHS.Elements.empty())
       return false;

     // See if the first bitmap element is the same in both.  This is only
     // possible if they are the same bitmap.
     if (Iter1 != Elements.end() && Iter2 != RHS.Elements.end())
       if (*Iter1 == *Iter2) {
-        for_each(Elements.begin(), Elements.end(),
-                 deleter<SparseBitVectorElement<ElementSize> >);
         Elements.clear();
         return true;
       }
@@ -630,14 +639,13 @@
       if (Iter1 == Elements.end())
         return changed;

-      if ((*Iter1)->index() > (*Iter2)->index()) {
-        ++Iter2;
-      } else if ((*Iter1)->index() == (*Iter2)->index()) {
+      if (Iter1->index() > Iter2->index()) {
+        ++Iter2;
+      } else if (Iter1->index() == Iter2->index()) {
         bool BecameZero;
-        changed |= (*Iter1)->intersectWithComplement(*(*Iter2), BecameZero);
+        changed |= Iter1->intersectWithComplement(*Iter2, BecameZero);
         if (BecameZero) {
           ElementListIter IterTmp = Iter1;
-          delete *IterTmp;
           Elements.erase(IterTmp);
         }
         ++Iter1;
@@ -645,7 +653,6 @@
       } else {
         ElementListIter IterTmp = Iter1;
         ++Iter1;
-        delete *IterTmp;
         Elements.erase(IterTmp);
       }
     }
@@ -663,15 +670,12 @@
   void intersectWithComplement(const SparseBitVector<ElementSize> &RHS1,
                                const SparseBitVector<ElementSize> &RHS2)
   {
-    for_each(Elements.begin(), Elements.end(),
-             deleter<SparseBitVectorElement<ElementSize> >);
     Elements.clear();
-
     ElementListConstIter Iter1 = RHS1.Elements.begin();
     ElementListConstIter Iter2 = RHS2.Elements.begin();

-    // IE They may both be end.
-    if (Iter1 == Iter2)
+    // Check if they are both empty.
+    if (RHS1.empty() && RHS2.empty())
       return;

     // See if the first bitmap element is the same in both.  This is only
@@ -686,19 +690,18 @@
       if (Iter1 == RHS1.Elements.end())
         return;

-      if ((*Iter1)->index() > (*Iter2)->index()) {
-        ++Iter2;
-      } else if ((*Iter1)->index() == (*Iter2)->index()) {
+      if (Iter1->index() > Iter2->index()) {
+        ++Iter2;
+      } else if (Iter1->index() == Iter2->index()) {
         bool BecameZero = false;
         SparseBitVectorElement<ElementSize> *NewElement =
-          new SparseBitVectorElement<ElementSize>((*Iter1)->index());
-
-        NewElement->intersectWithComplement(*(*Iter1), *(*Iter2), BecameZero);
-        if (BecameZero) {
-          delete NewElement;
-        } else {
+          new SparseBitVectorElement<ElementSize>(Iter1->index());
+        NewElement->intersectWithComplement(*Iter1, *Iter2, BecameZero);
+        if (!BecameZero) {
           Elements.push_back(NewElement);
         }
+        else
+          delete NewElement;

         ++Iter1;
         ++Iter2;
@@ -706,14 +709,15 @@
         ++Iter1;
       }
     }
+
     // copy the remaining elements
-
     while (Iter1 != RHS1.Elements.end()) {
         SparseBitVectorElement<ElementSize> *NewElement =
-          new SparseBitVectorElement<ElementSize>(*(*Iter1));
+          new SparseBitVectorElement<ElementSize>(*Iter1);
         Elements.push_back(NewElement);
-      }
-
+        ++Iter1;
+      }
+
     CurrElementIter = Elements.begin();
     return;
   }
@@ -732,8 +736,8 @@
     ElementListConstIter Iter1 = Elements.begin();
     ElementListConstIter Iter2 = RHS.Elements.begin();

-    // IE They may both be end.
-    if (Iter1 == Iter2)
+    // Check if both bitmaps are empty.
+    if (Elements.empty() && RHS.Elements.empty())
       return false;

     // See if the first bitmap element is the same in both.  This is only
@@ -748,10 +752,10 @@
       if (Iter1 == Elements.end())
         return false;

-      if ((*Iter1)->index() > (*Iter2)->index()) {
-        ++Iter2;
-      } else if ((*Iter1)->index() == (*Iter2)->index()) {
-        if ((*Iter1)->intersects(*(*Iter2)))
+      if (Iter1->index() > Iter2->index()) {
+        ++Iter2;
+      } else if (Iter1->index() == Iter2->index()) {
+        if (Iter1->intersects(*Iter2))
           return true;
         ++Iter1;
         ++Iter2;
@@ -766,8 +770,8 @@
   int find_first() const {
     if (Elements.empty())
       return -1;
-    const SparseBitVectorElement<ElementSize> *First = *(Elements.begin());
-    return (First->index() * ElementSize) + First->find_first();
+    const SparseBitVectorElement<ElementSize> &First = *(Elements.begin());
+    return (First.index() * ElementSize) + First.find_first();
   }

   // Return true if the SparseBitVector is empty
@@ -780,7 +784,7 @@
     for (ElementListConstIter Iter = Elements.begin();
          Iter != Elements.end();
          ++Iter)
-      BitCount += (*Iter)->count();
+      BitCount += Iter->count();

     return BitCount;
   }
@@ -790,6 +794,17 @@

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