Added check for empty commands.

Added check for empty commands.

--- src/control.c
+++ src/control.c
@@ -112,7 +112,7 @@
   // Wait for commands on the control fifo
   while(1) {
     char *cmd = readcmd(ctrl_fd, 255, '\n');
-    execute(cmd);
+    if(strlen(cmd)) execute(cmd);
     free(cmd);
   }
 }


Stylefix

Stylefix

--- src/cpl/cpl.h
+++ src/cpl/cpl.h
@@ -15,53 +15,53 @@
 typedef uint32_t permission_t;

 typedef enum {
-    IN_NOP = 0x0,	 /* Do nothing. */
-    IN_ADD = 0x1,	 /* Pops $0 and $1. Pushes $1   $0. */
-    IN_SUB = 0x2,	 /* Pops $0 and $1. Pushes $1 - $0. */
-    IN_MUL = 0x3,	 /* Pops $0 and $1. Pushes $1 * $0. */
-    IN_DIV = 0x4,	 /* Pops $0 and $1. Pushes $1 / $0. This is a signed division. */
-    IN_RICK = 0x5,	 /* nice */
-    IN_LD = 0x6,	 /* Pushes the value of the numeric variable. */
-    IN_LDS = 0x7,	 /* Pops $0. Pushes the numeric variable referenced by $0. */
-    IN_LDA = 0x8,	 /* Pops $0. Pushes the number at index $0 of the array. */
-    IN_LDAS = 0x9,	 /* Pops $0 and $1. Pushes the number at index $1 of the array referenced by $0. */
-    IN_LDC = 0xa,	 /* Pushes the constant. */
-    IN_ST = 0xb,	 /* Pops $0. Stores $0 in the numeric variable. */
-    IN_STS = 0xc,	 /* Pops $0 and $1. Stores $1 in the numeric variable referenced by $0. */
-    IN_STA = 0xd,	 /* Pops $0 and $1. Stores $1 at index $0 of the array. */
-    IN_STAS = 0xe,	 /* Pops $0, $1 and $2. Stores $2 at index $1 of the array referenced by $0. */
-    IN_DEL = 0xf,	 /* Pops $0. */
-    IN_SWP = 0x10,	 /* Pops $0 and $1. Pushes $0 and then $1. */
-    IN_DUP = 0x11,	 /* Pushes $0 to the stack. */
-    IN_VC = 0x12,	 /* Creates a new variable. */
-    IN_VCA = 0x13,	 /* Pops $0. Creates a new array with the size $0. */
-    IN_VPX = 0x14,	 /* Pushes the ID of the variable. */
-    IN_VPXS = 0x15,	 /* Pops $0. Pushes the ID of the variable referenced by the $0. */
-    IN_VPS = 0x16,	 /* Pushes the size of the array. */
-    IN_VPSS = 0x17,	 /* Pops $0. Pushes the size of the array referenced by $0. */
-    IN_VSWP = 0x18,	 /* Swaps two variables with each other. */
-    IN_VSWPS = 0x19,	 /* Swaps the variable referenced by $1 with $0. */
-    IN_VCPY = 0x1a,	 /* Copies the contents of the variable to another variable. */
-    IN_VCPYS = 0x1b,	 /* Copies the contents of the variable referenced by $1 to the variable referenced by $0 */
-    IN_VD = 0x1c,	 /* Destroys the last created variable. */
-    IN_VDR = 0x1d,	 /* Destroys multiple of the last created variables. */
-    IN_VDRS = 0x1e,	 /* Pops $0. Destroys $0 of the last created variables. */
-    IN_JP = 0x22,	 /*  */
-    IN_JPZ = 0x23,	 /*  */
-    IN_JPNZ = 0x24,	 /*  */
-    IN_RET = 0x25,	 /* Return to $0. If the bottom of the stack is reached, the program will halt. */
-    IN_CALL = 0x26,	 /* Push current location to stack, and call the function */
-    IN_SC = 0x27,	 /* Pops all required arguments. Calls a native function. */
-    IN_LAND = 0x29,	 /* Pops $0 and $1. Pushes $1 && $0. This is a locical function */
-    IN_LOR = 0x2a,	 /* Pops $0 and $1. Pushes $1 || $0. This is a logical function. */
-    IN_AND = 0x2b,	 /* Pops $0 and $1. Pushes $1 & $0. This is a bitwise function. */
-    IN_OR = 0x2c,	 /* Pops $0 and $1. Pushes $1 | $0. This is a bitwise function. */
-    IN_XOR = 0x2d,	 /* Pops $0 and $1. Pushes $1 ^ $0. This is a bitwise function. */
-    IN_NOT = 0x2e,	 /* Pops $0. Pushes !$0. This is a bitwise function. */
-    IN_BSL = 0x2f,	 /* Pops $0 and $1. Pushes $1 << $0. This is a bitwise function. */
-    IN_BSR = 0x30,	 /* Pops $0 and $1. Pushes $1 >> $0. This is a bitwise function. */
-    IN_INC = 0x32,	 /* Pops $0. Pushes $0   1. */
-    IN_DEC = 0x33	 /* Pops $0. Pushes $0 - 1. */
+	IN_NOP = 0x0,	 /* Do nothing. */
+	IN_ADD = 0x1,	 /* Pops $0 and $1. Pushes $1   $0. */
+	IN_SUB = 0x2,	 /* Pops $0 and $1. Pushes $1 - $0. */
+	IN_MUL = 0x3,	 /* Pops $0 and $1. Pushes $1 * $0. */
+	IN_DIV = 0x4,	 /* Pops $0 and $1. Pushes $1 / $0. This is a signed division. */
+	IN_RICK = 0x5,	 /* nice */
+	IN_LD = 0x6,	 /* Pushes the value of the numeric variable. */
+	IN_LDS = 0x7,	 /* Pops $0. Pushes the numeric variable referenced by $0. */
+	IN_LDA = 0x8,	 /* Pops $0. Pushes the number at index $0 of the array. */
+	IN_LDAS = 0x9,	 /* Pops $0 and $1. Pushes the number at index $1 of the array referenced by $0. */
+	IN_LDC = 0xa,	 /* Pushes the constant. */
+	IN_ST = 0xb,	 /* Pops $0. Stores $0 in the numeric variable. */
+	IN_STS = 0xc,	 /* Pops $0 and $1. Stores $1 in the numeric variable referenced by $0. */
+	IN_STA = 0xd,	 /* Pops $0 and $1. Stores $1 at index $0 of the array. */
+	IN_STAS = 0xe,	 /* Pops $0, $1 and $2. Stores $2 at index $1 of the array referenced by $0. */
+	IN_DEL = 0xf,	 /* Pops $0. */
+	IN_SWP = 0x10,	 /* Pops $0 and $1. Pushes $0 and then $1. */
+	IN_DUP = 0x11,	 /* Pushes $0 to the stack. */
+	IN_VC = 0x12,	 /* Creates a new variable. */
+	IN_VCA = 0x13,	 /* Pops $0. Creates a new array with the size $0. */
+	IN_VPX = 0x14,	 /* Pushes the ID of the variable. */
+	IN_VPXS = 0x15,	 /* Pops $0. Pushes the ID of the variable referenced by the $0. */
+	IN_VPS = 0x16,	 /* Pushes the size of the array. */
+	IN_VPSS = 0x17,	 /* Pops $0. Pushes the size of the array referenced by $0. */
+	IN_VSWP = 0x18,	 /* Swaps two variables with each other. */
+	IN_VSWPS = 0x19,	 /* Swaps the variable referenced by $1 with $0. */
+	IN_VCPY = 0x1a,	 /* Copies the contents of the variable to another variable. */
+	IN_VCPYS = 0x1b,	 /* Copies the contents of the variable referenced by $1 to the variable referenced by $0 */
+	IN_VD = 0x1c,	 /* Destroys the last created variable. */
+	IN_VDR = 0x1d,	 /* Destroys multiple of the last created variables. */
+	IN_VDRS = 0x1e,	 /* Pops $0. Destroys $0 of the last created variables. */
+	IN_JP = 0x22,	 /*  */
+	IN_JPZ = 0x23,	 /*  */
+	IN_JPNZ = 0x24,	 /*  */
+	IN_RET = 0x25,	 /* Return to $0. If the bottom of the stack is reached, the program will halt. */
+	IN_CALL = 0x26,	 /* Push current location to stack, and call the function */
+	IN_SC = 0x27,	 /* Pops all required arguments. Calls a native function. */
+	IN_LAND = 0x29,	 /* Pops $0 and $1. Pushes $1 && $0. This is a locical function */
+	IN_LOR = 0x2a,	 /* Pops $0 and $1. Pushes $1 || $0. This is a logical function. */
+	IN_AND = 0x2b,	 /* Pops $0 and $1. Pushes $1 & $0. This is a bitwise function. */
+	IN_OR = 0x2c,	 /* Pops $0 and $1. Pushes $1 | $0. This is a bitwise function. */
+	IN_XOR = 0x2d,	 /* Pops $0 and $1. Pushes $1 ^ $0. This is a bitwise function. */
+	IN_NOT = 0x2e,	 /* Pops $0. Pushes !$0. This is a bitwise function. */
+	IN_BSL = 0x2f,	 /* Pops $0 and $1. Pushes $1 << $0. This is a bitwise function. */
+	IN_BSR = 0x30,	 /* Pops $0 and $1. Pushes $1 >> $0. This is a bitwise function. */
+	IN_INC = 0x32,	 /* Pops $0. Pushes $0   1. */
+	IN_DEC = 0x33	 /* Pops $0. Pushes $0 - 1. */
 } Instruction;

 enum Version


delete unimplemented method

delete unimplemented method

--- src/cpp/dnn.h
+++ src/cpp/dnn.h
@@ -208,8 +208,6 @@

   BatchData *CalculateOutput();

-  void Test(const BatchData &input);
-
   BatchData *Calculate(const BatchData &input);

   float *LazyOutputActivations(size_t inputIndex, const char *outputNodes);


xprofile-md.h

xprofile-md.h

error: pathspec 'config/i386/freebsd2/xprofile-md.h' did not match any file(s) known to git

--- config/i386/freebsd2/xprofile-md.h
+++ config/i386/freebsd2/xprofile-md.h
@@ -0,0 +1,50 @@
+/*
+ * xprofile-md.h
+ * Interface functions to the profiling code
+ *
+ * Copyright (c) 2001 University of Utah and the Flux Group.
+ * All rights reserved.
+ *
+ * @JANOSVM_CONFIG_I386_FREEBSD2_LICENSE@
+ */
+
+#ifndef __i386_freebsd2_xprofile_md_h
+#define __i386_freebsd2_xprofile_md_h
+
+int kaffeStdProfRate(void);
+#define KAFFE_STD_PROF_RATE \
+int kaffeStdProfRate(void) \
+{ \
+	struct clockinfo clockinfo; \
+	int retval = 0; \
+	size_t size; \
+	int mib[2]; \
+	\
+	size = sizeof(clockinfo); \
+	mib[0] = CTL_KERN; \
+	mib[1] = KERN_CLOCKRATE; \
+	if (sysctl(mib, 2, &clockinfo, &size, NULL, 0) < 0) { \
+	} else if (clockinfo.profhz == 0) { \
+		retval = clockinfo.hz; \
+	} else { \
+		retval = clockinfo.profhz; \
+	} \
+	return( retval ); \
+}
+
+struct gmonparam;
+extern struct gmonparam _gmonparam;
+
+/* Return a pointer to the gmonparam structure defined by the compiler */
+static inline struct gmonparam *getGmonParam(void)
+{
+	return &_gmonparam;
+}
+
+/* Override the standard mcount with the xprofiling one */
+#include <machine/profile.h>
+
+#define _KAFFE_OVERRIDE_MCOUNT_DEF _MCOUNT_DECL __P((uintfptr_t frompc, uintfptr_t selfpc))
+#define _KAFFE_OVERRIDE_MCOUNT MCOUNT
+
+#endif


Added dns_c_view_getname.

Added dns_c_view_getname.

--- lib/dns/include/dns/confview.h
+++ lib/dns/include/dns/confview.h
@@ -95,6 +95,8 @@
 	isc_mem_t	       *mem;

 	char 		       *name;
+
+	dns_c_zonelist_t       *zonelist;

 	dns_c_forw_t		forward;

@@ -357,4 +359,13 @@
  */

+isc_result_t dns_c_view_getname(isc_log_t *lctx, dns_c_view_t *view,
+				const char **retval);
+
+/*
+ * Returns the name of the view. Caller must NOT free or touch the returned
+ * array.
+ */
+
+
 #endif /* DNS_CONFIG_CONFVIEW_H */


first try at comments

first try at comments

--- lib/dns/include/dns/resolver.h
+++ lib/dns/include/dns/resolver.h
@@ -57,6 +57,15 @@

 ISC_LANG_BEGINDECLS

+/*
+ * A dns_fetchevent_t is sent when a 'fetch' completes.  Any of 'db',
+ * 'node', 'rdataset', and 'sigrdataset' may be bound.  It is the
+ * receiver's responsibility to detach before freeing the event.
+ *
+ * 'rdataset' and 'sigrdataset' are the values that were supplied when
+ * dns_resolver_createfetch() was called.  They are returned to the
+ * caller so that they may be freed.
+ */
 typedef struct dns_fetchevent {
 	ISC_EVENT_COMMON(struct dns_fetchevent);
 	dns_fetch_t *			fetch;
@@ -69,10 +78,18 @@
 	dns_fixedname_t			foundname;
 } dns_fetchevent_t;

-#define DNS_FETCHOPT_TCP		0x01
-#define DNS_FETCHOPT_UNSHARED		0x02
-#define DNS_FETCHOPT_RECURSIVE		0x04
-#define DNS_FETCHOPT_NOEDNS0		0x08
+/*
+ * Options that modify how a 'fetch' is done.
+ */
+#define DNS_FETCHOPT_TCP		0x01		/* Use TCP. */
+#define DNS_FETCHOPT_UNSHARED		0x02		/* See below. */
+#define DNS_FETCHOPT_RECURSIVE		0x04		/* Set RD? */
+#define DNS_FETCHOPT_NOEDNS0		0x08		/* Do not use EDNS. */
+
+/*
+ * XXXRTH  Should this API be made semi-private?  (I.e.
+ * _dns_resolver_create()).
+ */

 dns_result_t
 dns_resolver_create(dns_view_t *view,
@@ -80,13 +97,74 @@
 		    isc_socketmgr_t *socketmgr,
 		    isc_timermgr_t *timermgr,
 		    dns_dispatch_t *dispatch, dns_resolver_t **resp);
+/*
+ * Create a resolver.
+ *
+ * Notes:
+ *
+ *	Generally, applications should not create a resolver directly, but
+ *	should instead call dns_view_createresolver().
+ *
+ * Requires:
+ *
+ *	'view' is a valid view.
+ *
+ *	'taskmgr' is a valid task manager.
+ *
+ *	'ntasks' > 0.
+ *
+ *	'socketmgr' is a valid socket manager.
+ *
+ *	'timermgr' is a valid timer manager.
+ *
+ *	'dispatch' is a valid dispatcher, or is NULL.
+ *
+ *	*resp != NULL && *resp == NULL.
+ *
+ * Returns:
+ *
+ *	ISC_R_SUCCESS				On success.
+ *
+ *	Anything else				Failure.
+ */

 void
 dns_resolver_whenshutdown(dns_resolver_t *res, isc_task_t *task,
 			  isc_event_t **eventp);
+/*
+ * Send '*eventp' to 'task' when 'res' has completed shutdown.
+ *
+ * Notes:
+ *
+ *	It is not safe to detach the last reference to 'res' until
+ *	shutdown is complete.
+ *
+ * Requires:
+ *
+ *	'res' is a valid resolver.
+ *
+ *	'task' is a valid task.
+ *
+ *	*eventp is a valid event.
+ *
+ * Ensures:
+ *
+ *	*eventp == NULL.
+ */

 void
 dns_resolver_shutdown(dns_resolver_t *res);
+/*
+ * Start the shutdown process for 'res'.
+ *
+ * Notes:
+ *
+ *	This call has no effect if the resolver is already shutting down.
+ *
+ * Requires:
+ *
+ *	'res' is a valid resolver.
+ */

 void
 dns_resolver_attach(dns_resolver_t *source, dns_resolver_t **targetp);
@@ -104,12 +182,81 @@
 			 dns_rdataset_t *rdataset,
 			 dns_rdataset_t *sigrdataset,
 			 dns_fetch_t **fetchp);
+/*
+ * Recurse to answer a question.
+ *
+ * Notes:
+ *
+ *	This call starts a query for 'name', type 'type'.
+ *
+ *	XXXRTH  Explain query domain and nameservers.
+ *		Also, we should make them optional and have the resolver
+ *		do dns_view_findzonecut().
+ *		'forwarders' is unimplmented, and subject to change when
+ *		we figure out how selective forwarding will work.
+ *
+ *	When the fetch completes (successfully or otherwise), a
+ *	DNS_EVENT_FETCHDONE event with action 'action' and arg 'arg' will be
+ *	posted to 'task'.
+ *
+ *	The values of 'rdataset' and 'sigrdataset' will be returned in
+ *	the FETCHDONE event.
+ *
+ * Requires:
+ *
+ *	'res' is a valid resolver.
+ *
+ *	'name' is a valid name.
+ *
+ *	'type' is not a meta type other than ANY.
+ *
+ *	'domain' is a valid name.
+ *
+ *	'nameservers' is a valid NS rdataset (whose owner name is 'domain').
+ *
+ *	'forwarders' is NULL.
+ *
+ *	'options' contains valid options.
+ *
+ *	'rdataset' is a valid, disassociated rdataset.
+ *
+ *	'sigrdataset' is NULL, or is a valid, disassociated rdataset.
+ *
+ *	fetchp != NULL && *fetchp == NULL.
+ *
+ * Returns:
+ *
+ *	ISC_R_SUCCESS					Success
+ *
+ *	Many other values are possible, all of which indicate failure.
+ */
+

 void
 dns_resolver_cancelfetch(dns_resolver_t *res, dns_fetch_t *fetch);
+/*
+ * Cancel 'fetch'.
+ *
+ * Notes:
+ *
+ *	If 'fetch' has not completed, post its FETCHDONE event with a
+ *	result code of ISC_R_CANCELED.
+ */

 void
 dns_resolver_destroyfetch(dns_resolver_t *res, dns_fetch_t **fetchp);
+/*
+ * Destroy 'fetch'.
+ *
+ * Requires:
+ *
+ *	The caller has received the FETCHDONE event (either because the
+ *	fetch completed or because dns_resolver_cancelfetch() was called).
+ *
+ * Ensures:
+ *
+ *	*fetchp == NULL.
+ */

 ISC_LANG_ENDDECLS


Removed warnings about printing (char *) with "*p"

--- src/utl_mem.c
+++ src/utl_mem.c
@@ -73,7 +73,7 @@
   }
   if (memcmp(p->blk+p->size,utl_END_CHK,4)) {
     logprintf("TRC Boundary overflow %p [%lu] (%lu)\x09:%s:%d\x09",
-                              p->blk, (unsigned long)p->size, (unsigned long)utl_mem_allocated, file, line);
+                              (void *)(p->blk), (unsigned long)p->size, (unsigned long)utl_mem_allocated, file, line);
     return memOVERFLOW;
   }
   logprintf("TRC Valid pointer %p (%lu)\x09:%s:%d\x09",ptr, (unsigned long)utl_mem_allocated, file, line);
@@ -163,7 +163,7 @@
                        utl_mem_allocated -= p->size;
                        utl_mem_allocated += size;
                        logprintf("TRC realloc %p [%lu] -> %p [%lu] (%lu)\x09:%s:%d\x09",
-                                       ptr, (unsigned long)p->size, p->blk, (unsigned long)size,
+                                       (void *)ptr, (unsigned long)p->size, (void *)(p->blk), (unsigned long)size,
                                        (unsigned long)utl_mem_allocated, file, line);
                        p->size = size;
                        memcpy(p->chk,utl_BEG_CHK,4);


RJH: Inserted code to check that sequential access was only by process 0

--- src/rtdb/rtdb.c
+++ src/rtdb/rtdb.c
@@ -20,6 +20,7 @@
 #define INACTIVE  -1
 #define SEQUENTIAL 0
 #define PARALLEL   1
+
 /* Mode in which DB was opended */
 static int par_mode[MAX_RTDB] = {INACTIVE,INACTIVE,INACTIVE,INACTIVE,INACTIVE};
 static int parallel_mode=PARALLEL; /* Current mode SEQUENTIAL/PARALLEL */
@@ -38,6 +39,21 @@
     parallel_mode = SEQUENTIAL;

   return old;
+}
+
+static int verify_parallel_access()
+/*
+  Return true if access mode / processor values are sensible
+*/
+{
+  if ((parallel_mode == SEQUENTIAL) && (me != 0)) {
+    (void) fflush(stdout);
+    (void) fprintf(stderr,"rtdb: sequential access only possible for process 0\n");
+    (void) fflush(stderr);
+    return 0;
+  }
+  else
+    return 1;
 }

 static void rtdb_broadcast(const int msg_type, const int ma_type,
@@ -59,6 +75,8 @@
   int status;
   me = NODEID_();

+  if (!verify_parallel_access()) return 0;
+
   if (parallel_mode == SEQUENTIAL || me == 0)
     status = rtdb_seq_open(filename, mode, handle);

@@ -77,6 +95,8 @@
 {
   int status;

+  if (!verify_parallel_access()) return 0;
+
   if (handle < 0 || handle >= MAX_RTDB) {
     (void) fprintf(stderr, "rtdb_close: handle out of range %d\n", handle);
     (void) fflush(stderr);
@@ -103,6 +123,8 @@
 {
   int status;

+  if (!verify_parallel_access()) return 0;
+
   if (handle < 0 || handle >= MAX_RTDB) {
     (void) fprintf(stderr, "rtdb_put: handle out of range %d\n", handle);
     (void) fflush(stderr);
@@ -129,6 +151,8 @@
 		 const int nelem, void *array)
 {
   int status;
+
+  if (!verify_parallel_access()) return 0;

   if (handle < 0 || handle >= MAX_RTDB) {
     (void) fprintf(stderr, "rtdb_get: handle out of range %d\n", handle);
@@ -164,6 +188,8 @@
 		  const char *name, int *ma_type, int *nelem, char date[26])
 {
   int status;
+
+  if (!verify_parallel_access()) return 0;

   if (handle < 0 || handle >= MAX_RTDB) {
     (void) fprintf(stderr, "rtdb_get_info: handle out of range %d\n", handle);
@@ -197,6 +223,8 @@
 		    int *nelem, int *ma_handle)
 {
   int status;
+
+  if (!verify_parallel_access()) return 0;

   if (handle < 0 || handle >= MAX_RTDB) {
     (void) fprintf(stderr, "rtdb_ma_put: handle out of range %d\n", handle);
@@ -253,6 +281,8 @@
 {
   int status;

+  if (!verify_parallel_access()) return 0;
+
   if (handle < 0 || handle >= MAX_RTDB) {
     (void) fprintf(stderr, "rtdb_first: handle out of range %d\n", handle);
     (void) fflush(stderr);
@@ -286,6 +316,8 @@
 {
   int status;

+  if (!verify_parallel_access()) return 0;
+
   if (handle < 0 || handle >= MAX_RTDB) {
     (void) fprintf(stderr, "rtdb_next: handle out of range %d\n", handle);
     (void) fflush(stderr);
@@ -320,6 +352,8 @@
 {
   int status;

+  if (!verify_parallel_access()) return 0;
+
   if (handle < 0 || handle >= MAX_RTDB) {
     (void) fprintf(stderr, "rtdb_print: handle out of range %d\n", handle);
     (void) fflush(stderr);
@@ -345,6 +379,8 @@
 {
   int status;

+  if (!verify_parallel_access()) return 0;
+
   if (handle < 0 || handle >= MAX_RTDB) {
     (void) fprintf(stderr, "rtdb_delete: handle out of range %d\n", handle);
     (void) fflush(stderr);


include libssh2_priv.h instead of libssh2.h in order to get LIBSSH2_API properly defined on LIBSSH2_WIN32 build targets

--- src/version.c
+++ src/version.c
@@ -35,7 +35,7 @@
  *
  */

-#include "libssh2.h"
+#include "libssh2_priv.h"

 /*
   libssh2_version() can be used like this:


XBLOCK MINED, Fully commit to the PLEASURE SAUCERS

--- src/version.h
+++ src/version.h
@@ -19,8 +19,7 @@
 static const int GETHEADERS_VERSION = 31800;

 //! disconnect from peers older than this proto version
-//! This will be cbanged after XDAY
-static const int MIN_PEER_PROTO_VERSION = GETHEADERS_VERSION;
+static const int MIN_PEER_PROTO_VERSION = PROTOCOL_VERSION;

 //! nTime field added to CAddress, starting with this version;
 //! if possible, avoid requesting addresses nodes older than this


Update version.h

Update version.h

--- src/version.h
+++ src/version.h
@@ -44,9 +44,9 @@
 // "mempool" command, enhanced "getdata" behavior starts with this version:
 static const int MEMPOOL_GD_VERSION = 60002;

-#define DISPLAY_VERSION_MAJOR       2
-#define DISPLAY_VERSION_MINOR       0
-#define DISPLAY_VERSION_REVISION    0
+#define DISPLAY_VERSION_MAJOR       1
+#define DISPLAY_VERSION_MINOR       9
+#define DISPLAY_VERSION_REVISION    5
 #define DISPLAY_VERSION_BUILD       1

 #endif


Update version.h

Update version.h

9.1.3.

--- src/version.h
+++ src/version.h
@@ -25,13 +25,15 @@
 // network protocol versioning
 //

-static const int PROTOCOL_VERSION = 70013;
+static const int PROTOCOL_VERSION = 70014;

 // intial proto version, to be increased after version/verack negotiation
 static const int INIT_PROTO_VERSION = 209;

 // disconnect from peers older than this proto version
-static const int MIN_PEER_PROTO_VERSION = 70012;
+static const int MIN_PEER_PROTO_VERSION = 70013;
+
+//9.1.1= 70012

 // nTime field added to CAddress, starting with this version;
 // if possible, avoid requesting addresses nodes older than this


increased version to 0.5a [after release]

--- src/version.h
+++ src/version.h
@@ -1 +1 @@
-#define SHMUX_VERSION "0.4a"
+#define SHMUX_VERSION "0.5a"


1.1.1

--- src/version.h
+++ src/version.h
@@ -1 +1 @@
-# define VERSION	"1.1"
+# define VERSION	"1.1.1"


Slave removal: scripting.c logs and other stuff fixed.

--- src/scripting.c
+++ src/scripting.c
@@ -777,7 +777,7 @@

     flags = lua_tonumber(lua,-1);
     if ((flags & ~(PROPAGATE_AOF|PROPAGATE_REPL)) != 0) {
-        lua_pushstring(lua, "Invalid replication flags. Use REPL_AOF, REPL_SLAVE, REPL_ALL or REPL_NONE.");
+        lua_pushstring(lua, "Invalid replication flags. Use REPL_AOF, REPL_REPLICA, REPL_ALL or REPL_NONE.");
         return lua_error(lua);
     }
     server.lua_repl = flags;
@@ -998,6 +998,10 @@
     lua_pushnumber(lua,PROPAGATE_REPL);
     lua_settable(lua,-3);

+    lua_pushstring(lua,"REPL_REPLICA");
+    lua_pushnumber(lua,PROPAGATE_REPL);
+    lua_settable(lua,-3);
+
     lua_pushstring(lua,"REPL_ALL");
     lua_pushnumber(lua,PROPAGATE_AOF|PROPAGATE_REPL);
     lua_settable(lua,-3);
@@ -1484,7 +1488,7 @@
         const char *help[] = {
 "DEBUG (yes|sync|no) -- Set the debug mode for subsequent scripts executed.",
 "EXISTS <sha1> [<sha1> ...] -- Return information about the existence of the scripts in the script cache.",
-"FLUSH -- Flush the Lua scripts cache. Very dangerous on slaves.",
+"FLUSH -- Flush the Lua scripts cache. Very dangerous on replicas.",
 "KILL -- Kill the currently executing Lua script.",
 "LOAD <script> -- Load a script into the scripts cache, without executing it.",
 NULL


Update V3 Protocol Version

Update V3 Protocol Version

--- src/version.h
+++ src/version.h
@@ -26,7 +26,7 @@
 // network protocol versioning
 //

-static const int PROTOCOL_VERSION = 60001;
+static const int PROTOCOL_VERSION = 3000000;

 // intial proto version, to be increased after version/verack negotiation
 static const int INIT_PROTO_VERSION = 209;


add 0-arg allocState()

add 0-arg allocState()

--- src/scsi/base.h
+++ src/scsi/base.h
@@ -149,6 +149,12 @@
      * @throws std::exception sub-classes for various errors, mostly incorrect Config.
      */
     StateBase* allocState(const Config& c) const;
+
+    //! Allocate new State with empty Config
+    inline StateBase* allocState() const {
+        Config defaults;
+        return allocState(defaults);
+    }

     void reconfigure(size_t idx, const Config& c);


up build version

up build version

--- src/version.h
+++ src/version.h
@@ -47,6 +47,6 @@
 #define DISPLAY_VERSION_MAJOR       0
 #define DISPLAY_VERSION_MINOR       4
 #define DISPLAY_VERSION_REVISION    4
-#define DISPLAY_VERSION_BUILD       002
+#define DISPLAY_VERSION_BUILD       003

 #endif


Fixed return value

Fixed return value

--- libs/uni-rtsp/src/rtsp_header.c
+++ libs/uni-rtsp/src/rtsp_header.c
@@ -330,7 +330,7 @@
 }

 /** Generate RTSP header field value */
-static apr_size_t rtsp_header_field_value_generate(const rtsp_header_t *header, rtsp_header_field_id id, apt_str_t *value, apr_pool_t *pool)
+static apt_bool_t rtsp_header_field_value_generate(const rtsp_header_t *header, rtsp_header_field_id id, apt_str_t *value, apr_pool_t *pool)
 {
 	switch(id) {
 		case RTSP_HEADER_FIELD_CSEQ:


Version incremented to 2.9.8 after major cluster progresses.

--- src/version.h
+++ src/version.h
@@ -1 +1 @@
-#define REDIS_VERSION "2.9.7"
+#define REDIS_VERSION "2.9.8"


Rewrote uas_check_session_content().

Rewrote uas_check_session_content().

Returning empty Accept-Encoding header in 415/406 responses.

darcs-hash:20051130121134-65a35-964a5c2bd23992435610114a2cdf4d48a84c6926.gz

--- libsofia-sip-ua/nua/nua_stack.c
+++ libsofia-sip-ua/nua/nua_stack.c
@@ -2710,42 +2710,59 @@
   return 405;
 }

-/* Check that we understand content. */
+/* Check that we understand (session) content. */
 static inline
-int uas_check_content(nta_incoming_t *irq,
-		      sip_t const *sip,
-		      tag_type_t tag, tag_value_t value, ...)
+int uas_check_session_content(nta_incoming_t *irq, sip_t const *sip,
+			      sip_accept_t const *session_accepts,
+			      tag_type_t tag, tag_value_t value, ...)
 {
   sip_content_type_t const *c = sip->sip_content_type;
   sip_content_disposition_t const *cd = sip->sip_content_disposition;
-  char const *accept = NULL, *accept_encoding = NULL;
+  int acceptable_type = 0, acceptable_encoding = 0;
   ta_list ta;

   if (sip->sip_payload == NULL)
     return 0;

-  if (cd) {
-    if (strcasecmp(cd->cd_type, "session") == 0) {
-      if (c && strcasecmp(c->c_type, application_sdp))
-	accept = application_sdp;
-    }
-  }
-
-  if (sip->sip_content_encoding) {
-    /* Missing Content-Encoding implies identity */
-    if (str0casecmp(sip->sip_content_encoding->g_value, "identity")) {
-      accept_encoding = "identity";
-    }
-  }
+  if (cd == NULL || strcasecmp(cd->cd_type, "session") == 0) {
+    sip_accept_t const *ab = session_accepts;
+    char const *c_type;
+
+    if (c)
+      c_type = c->c_type;
+    else if (sip->sip_payload->pl_len > 3 &&
+	     strncasecmp(sip->sip_payload->pl_data, "v=0", 3) == 0)
+      /* Missing Content-Type, but it looks like SDP  */
+      c_type = application_sdp;
+    else
+      /* No chance */
+      ab = NULL;
+
+    for (; ab; ab = ab->ac_next) {
+      if (strcasecmp(c_type, ab->ac_type) == 0)
+	break;
+    }
+
+    if (ab)
+      acceptable_type = 1;
+  }
+  else if (cd->cd_optional)
+    acceptable_type = 1;
+
+  /* Empty or missing Content-Encoding */
+  if (!sip->sip_content_encoding ||
+      !sip->sip_content_encoding->k_items ||
+      !sip->sip_content_encoding->k_items[0] ||
+      !sip->sip_content_encoding->k_items[0][0])
+    acceptable_encoding = 1;

-  if (!accept && !accept_encoding)
+  if (acceptable_type && acceptable_encoding)
     return 0;

   ta_start(ta, tag, value);
   nta_incoming_treply(irq,
 		      SIP_415_UNSUPPORTED_MEDIA,
-		      SIPTAG_ACCEPT_STR(accept),
-		      SIPTAG_ACCEPT_ENCODING_STR(accept_encoding),
+		      SIPTAG_ACCEPT(session_accepts),
 		      ta_tags(ta));
   ta_end(ta);

@@ -4122,15 +4139,18 @@

   if (nh0->nh_soa) {
     /* Make sure caller uses application/sdp without compression */
-    if (uas_check_content(irq, sip,
-			  SIPTAG_USER_AGENT(user_agent),
-			  TAG_END()))
+    if (uas_check_session_content(irq, sip,
+				  nua->nua_invite_accept,
+				  SIPTAG_USER_AGENT(user_agent),
+				  SIPTAG_ACCEPT_ENCODING_STR(""),
+				  TAG_END()))
       return 415;

     /* Make sure caller accepts application/sdp */
     if (uas_check_accept(irq, sip,
 			 nua->nua_invite_accept,
 			 SIPTAG_USER_AGENT(user_agent),
+			 SIPTAG_ACCEPT_ENCODING_STR(""),
 			 TAG_END()))
       return 406;
   }


Renamed STRICT() to PR_STRICT() in order to avoid redefinition in minwindef.h, when Windows SDK 10 is used.

--- libsofia-sip-ua/sdp/sdp_parse.c
+++ libsofia-sip-ua/sdp/sdp_parse.c
@@ -91,7 +91,7 @@
 #define pr_error   pr_output.pru_error
 #define pr_session pr_output.pru_session

-#define STRICT(pr) (pr->pr_strict)
+#define PR_STRICT(pr) (pr->pr_strict)

 /* Static parser object used when running out of memory */
 static const struct sdp_parser_s no_mem_error =
@@ -361,7 +361,7 @@
   sdp_zone_t **zones = NULL;
   sdp_attribute_t **attributes = &sdp->sdp_attributes;

-  if (!STRICT(p))
+  if (!PR_STRICT(p))
     strip = SPACE TAB;		/* skip initial whitespace */
   else
     strip = "";
@@ -917,7 +917,7 @@
   else
     modifier = sdp_bw_x;

-  if (STRICT(p))
+  if (PR_STRICT(p))
     PARSE_CHECK_REST(p, r, "b");

   {
@@ -964,7 +964,7 @@
   if (parse_ul(p, &r, &t->t_start, 0) ||
       parse_ul(p, &r, &t->t_stop, 0))
     parsing_error(p, "invalid time");
-  else if (STRICT(p)) {
+  else if (PR_STRICT(p)) {
     PARSE_CHECK_REST(p, r, "t");
   }
 }
@@ -996,7 +996,7 @@
   int n, N;
   char *s;
   sdp_repeat_t *r;
-  int strict = STRICT(p);
+  int strict = PR_STRICT(p);

   /** Count number of intervals */
   for (N = 0, s = d; *s; ) {
@@ -1073,19 +1073,19 @@

   /** Count number of timezones, check syntax */
   for (N = 0, s = r; *s;) {
-    if (!(is_posdigit(*s) || (!STRICT(p) && (*s) == '0')))
+    if (!(is_posdigit(*s) || (!PR_STRICT(p) && (*s) == '0')))
       break;
     do { s++; } while (is_digit(*s));
-    if (!(i = STRICT(p) ? is_space(*s) : strspn(s, SPACE TAB)))
+    if (!(i = PR_STRICT(p) ? is_space(*s) : strspn(s, SPACE TAB)))
       break;
     s += i;
-    if (!(*s == '-' || is_posdigit(*s) || (!STRICT(p) && (*s) == '0')))
+    if (!(*s == '-' || is_posdigit(*s) || (!PR_STRICT(p) && (*s) == '0')))
       break;
     do { s++; } while (is_digit(*s));
-    if (*s && strchr(STRICT(p) ? "dhms" : "dhmsDHMS", *s))
+    if (*s && strchr(PR_STRICT(p) ? "dhms" : "dhmsDHMS", *s))
       s++;
     N++;
-    if (!(i = STRICT(p) ? is_space(*s) : strspn(s, SPACE TAB)))
+    if (!(i = PR_STRICT(p) ? is_space(*s) : strspn(s, SPACE TAB)))
       break;
     s += i;
   }
@@ -1162,7 +1162,7 @@

     /* These are defined as key-sensitive in RFC 4566 */
 #define MATCH(s, tok) \
-    (STRICT(p) ? su_strmatch((s), (tok)) : su_casematch((s), (tok)))
+    (PR_STRICT(p) ? su_strmatch((s), (tok)) : su_casematch((s), (tok)))

     if (MATCH(s, "clear"))
       k->k_method = sdp_key_clear, k->k_method_name = "clear";
@@ -1172,7 +1172,7 @@
       k->k_method = sdp_key_uri, k->k_method_name = "uri";
     else if (MATCH(s, "prompt"))
       k->k_method = sdp_key_prompt, k->k_method_name = "prompt";
-    else if (!STRICT(p))
+    else if (!PR_STRICT(p))
       k->k_method = sdp_key_x, k->k_method_name = s;
     else {
       parsing_error(p, "invalid key method");
@@ -1327,7 +1327,7 @@
     return;
   }

-  if (!STRICT(p) && su_casematch(s, "RTP"))
+  if (!PR_STRICT(p) && su_casematch(s, "RTP"))
     m->m_proto = sdp_proto_rtp, m->m_proto_name = "RTP/AVP";
   else
     sdp_media_transport(m, s);
@@ -1627,7 +1627,7 @@
   char *encoding, *params;
   sdp_rtpmap_t *rm;

-  int strict = STRICT(p);
+  int strict = PR_STRICT(p);

   if (parse_ul(p, &r, &pt, 128)) {
     if (strict)
@@ -1677,7 +1677,7 @@
   unsigned long pt;
   sdp_rtpmap_t *rm;

-  int strict = STRICT(p);
+  int strict = PR_STRICT(p);

   if (parse_ul(p, &r, &pt, 128)) {
     if (strict)
@@ -1723,7 +1723,7 @@
   sdp_bandwidth_t **bandwidths = NULL;
   sdp_attribute_t **attributes = NULL;

-  if (!STRICT(p))
+  if (!PR_STRICT(p))
     strip = SPACE TAB;		/* skip initial whitespace */
   else
     strip = "";


edit web for use in summerdownloadtorrent

--- libsummer/summer-download-web.c
+++ libsummer/summer-download-web.c
@@ -192,13 +192,13 @@
 	// There are ridiculously many application/* mime types, and we want to
 	// download quite a few of them - I'm going for limited blacklisting
 	// for now.
-	gboolean application = g_str_has_prefix (mime, "application")
-		&& (strstr (mime, "xml") == NULL)
-		&& g_strcmp0 (mime, "application/x-bittorrent");
-	if ((application
+	if (mime == NULL || ((
+				(g_str_has_prefix (mime, "application")
+				&& (strstr (mime, "xml") == NULL)
+				&& g_strcmp0 (mime, "application/x-bittorrent"))
 			|| g_str_has_prefix (mime, "video")
 			|| g_str_has_prefix (mime, "audio"))
-		&& g_str_has_prefix (url, "http")) {
+		&& g_str_has_prefix (url, "http"))) {
 		return SUMMER_DOWNLOAD (g_object_new (SUMMER_TYPE_DOWNLOAD_WEB,
 			"url", url, NULL));
 	}


add bitwise operators

add bitwise operators

--- libswfdec/swfdec_as_interpret.c
+++ libswfdec/swfdec_as_interpret.c
@@ -1535,36 +1535,33 @@
   frame->pc += 3 + len + size;
 }

-#if 0
 static void
 swfdec_action_bitwise (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
 {
-  guint32 a, b;
-  double d;
-
-  if (!JS_ValueToECMAUint32 (cx, cx->fp->sp[-1], &a) ||
-      !JS_ValueToECMAUint32 (cx, cx->fp->sp[-2], &b))
-    return JS_FALSE;
+  int a, b;
+
+  a = swfdec_as_value_to_integer (cx, swfdec_as_stack_pop (cx->frame->stack));
+  b = swfdec_as_value_to_integer (cx, swfdec_as_stack_peek (cx->frame->stack, 1));

   switch (action) {
     case 0x60:
-      d = (int) (a & b);
+      a = (int) (a & b);
       break;
     case 0x61:
-      d = (int) (a | b);
+      a = (int) (a | b);
       break;
     case 0x62:
-      d = (int) (a ^ b);
+      a = (int) (a ^ b);
       break;
     default:
       g_assert_not_reached ();
-      return JS_FALSE;
-  }
-
-  cx->fp->sp--;
-  return JS_NewNumberValue (cx, d, &cx->fp->sp[-1]);
-}
-
+      break;
+  }
+
+  SWFDEC_AS_VALUE_SET_INT (swfdec_as_stack_peek (cx->frame->stack, 1), a);
+}
+
+#if 0
 static void
 swfdec_action_shift (SwfdecAsContext *cx, guint action, const guint8 *data, guint len)
 {
@@ -2256,10 +2253,10 @@
   [SWFDEC_AS_ACTION_INSTANCE_OF] = { "InstanceOf", NULL },
   [SWFDEC_AS_ACTION_ENUMERATE2] = { "Enumerate2", NULL, 1, -1, { NULL, NULL, NULL, swfdec_action_enumerate2, swfdec_action_enumerate2 } },
   /* version 5 */
+  [SWFDEC_AS_ACTION_BIT_AND] = { "BitAnd", NULL, 2, 1, { NULL, NULL, swfdec_action_bitwise, swfdec_action_bitwise, swfdec_action_bitwise } },
+  [SWFDEC_AS_ACTION_BIT_OR] = { "BitOr", NULL, 2, 1, { NULL, NULL, swfdec_action_bitwise, swfdec_action_bitwise, swfdec_action_bitwise } },
+  [SWFDEC_AS_ACTION_BIT_XOR] = { "BitXor", NULL, 2, 1, { NULL, NULL, swfdec_action_bitwise, swfdec_action_bitwise, swfdec_action_bitwise } },
 #if 0
-  [0x60] = { "BitAnd", NULL, 2, 1, { NULL, NULL, swfdec_action_bitwise, swfdec_action_bitwise, swfdec_action_bitwise } },
-  [0x61] = { "BitOr", NULL, 2, 1, { NULL, NULL, swfdec_action_bitwise, swfdec_action_bitwise, swfdec_action_bitwise } },
-  [0x62] = { "BitXor", NULL, 2, 1, { NULL, NULL, swfdec_action_bitwise, swfdec_action_bitwise, swfdec_action_bitwise } },
   [0x63] = { "BitLShift", NULL, 2, 1, { NULL, NULL, swfdec_action_shift, swfdec_action_shift, swfdec_action_shift } },
   [0x64] = { "BitRShift", NULL, 2, 1, { NULL, NULL, swfdec_action_shift, swfdec_action_shift, swfdec_action_shift } },
   [0x65] = { "BitURShift", NULL, 2, 1, { NULL, NULL, swfdec_action_shift, swfdec_action_shift, swfdec_action_shift } },


fix unaligned reads

fix unaligned reads

--- libswfdec/swfdec_as_interpret.c
+++ libswfdec/swfdec_as_interpret.c
@@ -1321,6 +1321,7 @@
       cond = strcmp (l, r) < 0;
       break;
     default:
+      cond = FALSE;
       g_assert_not_reached ();
       break;
   }


bump up the library version to 3.3.0 ready for next release

--- lib/include/config/stm32plus.h
+++ lib/include/config/stm32plus.h
@@ -62,7 +62,7 @@
  */

 #undef STM32PLUS_BUILD
-#define STM32PLUS_BUILD 0x030200
+#define STM32PLUS_BUILD 0x030300

 /**


Add flag for explicitly specifying that the legacy AEC2 should be used

This CL adds a temporary flag for specifying that the legacy AEC2 should
be used.

Bug: webrtc:10366
Change-Id: Ie3edaa1560cdc1282b62242beb67aa6fee7f2841
Reviewed-on: https://webrtc-review.googlesource.com/c/124980
Reviewed-by: Sam Zackrisson <b1a93beadfe1d2f7f0106ee02b6ffcdc950aa103@webrtc.org>
Commit-Queue: Per Åhgren <3616c2c8a2c30a769c5419f89b4a810ea6e2f079@webrtc.org>
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#26891}

--- modules/audio_processing/include/audio_processing.h
+++ modules/audio_processing/include/audio_processing.h
@@ -257,6 +257,8 @@
       // Recommended not to use. Will be removed in the future.
       // APM components are not fine-tuned for legacy suppression levels.
       bool legacy_moderate_suppression_level = false;
+      // Recommended not to use. Will be removed in the future.
+      bool use_legacy_aec = false;
     } echo_canceller;

     // Enables background noise suppression.


changed private to protected

changed private to protected

--- linbox/linbox/blackbox/sparse.h
+++ linbox/linbox/blackbox/sparse.h
@@ -265,7 +265,7 @@
 	 */
 	const Field& field () const { return _F;}

-    private:
+    protected:

 	const Field                             _F;      // Field used for all arithmetic
 	VectorDomain<Field>                     _VD;     // Vector domain for matrix operations


illegal token after #endif

illegal token after #endif

--- lib/isc/include/isc/resource.h
+++ lib/isc/include/isc/resource.h
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */

-/* $Id: resource.h,v 1.1 2000/11/14 23:39:15 tale Exp $ */
+/* $Id: resource.h,v 1.2 2000/11/15 01:31:45 gson Exp $ */

 #ifndef ISC_RESOURCE_H
 #define ISC_RESOURCE_H 1
@@ -77,4 +77,4 @@

 ISC_LANG_ENDDECLS

-#endif ISC_RESOURCE_H
+#endif /* ISC_RESOURCE_H */


common: fixes a typo in NS(ManagedBuffer) API signature

--- sixtracklib/common/buffer/managed_buffer_minimal.h
+++ sixtracklib/common/buffer/managed_buffer_minimal.h
@@ -173,12 +173,12 @@
 /* ------------------------------------------------------------------------- */

 SIXTRL_STATIC SIXTRL_FN NS(buffer_addr_t)
-NS(ManagdBuffer_get_stored_begin_addr)(
+NS(ManagedBuffer_get_stored_begin_addr)(
     SIXTRL_BUFFER_DATAPTR_DEC unsigned char const* SIXTRL_RESTRICT begin,
     NS(buffer_size_t) const slot_size );

 SIXTRL_STATIC SIXTRL_FN NS(buffer_addr_t)
-NS(ManagdBuffer_get_buffer_begin_addr)(
+NS(ManagedBuffer_get_buffer_begin_addr)(
     SIXTRL_BUFFER_DATAPTR_DEC unsigned char const* SIXTRL_RESTRICT begin,
     NS(buffer_size_t) const slot_size );

@@ -892,7 +892,7 @@

 /* ========================================================================= */

-SIXTRL_INLINE NS(buffer_addr_t) NS(ManagdBuffer_get_stored_begin_addr)(
+SIXTRL_INLINE NS(buffer_addr_t) NS(ManagedBuffer_get_stored_begin_addr)(
     SIXTRL_BUFFER_DATAPTR_DEC unsigned char const* SIXTRL_RESTRICT begin,
     NS(buffer_size_t) const slot_size )
 {
@@ -910,7 +910,7 @@
         ? ptr_header[ 0 ] : ( address_t )0u;
 }

-SIXTRL_INLINE NS(buffer_addr_t) NS(ManagdBuffer_get_buffer_begin_addr)(
+SIXTRL_INLINE NS(buffer_addr_t) NS(ManagedBuffer_get_buffer_begin_addr)(
     SIXTRL_BUFFER_DATAPTR_DEC unsigned char const* SIXTRL_RESTRICT begin,
     NS(buffer_size_t) const slot_size )
 {


Fix compile on WinXP.

Fix compile on WinXP.

git-svn-id: 606cd7bb7c4874b1f27fc28ef6a6d76dca18f877@2352 be551aaa-1e26-0410-a405-d3ace91eadb9

--- services/listen_dnsport.c
+++ services/listen_dnsport.c
@@ -446,7 +446,7 @@
 			wsa_strerror(WSAGetLastError()));
 		log_addr(0, "failed address",
 			(struct sockaddr_storage*)addr->ai_addr,
-			addr->ai_addrlen); }
+			addr->ai_addrlen);
 #endif
 		return -1;
 	}


fixup compile.

fixup compile.

--- services/listen_dnsport.c
+++ services/listen_dnsport.c
@@ -175,9 +175,9 @@
 #else /* USE_WINSOCK */
 		if(WSAGetLastError() != WSAEADDRINUSE &&
 			WSAGetLastError() != WSAEADDRNOTAVAIL)
-#endif
 			log_err("can't bind socket: %s",
 				wsa_strerror(WSAGetLastError()));
+#endif
 		close(s);
 		return -1;
 	}


Windows: ipv6 "any address" is ::0, not ::1

--- src/win/tcp.c
+++ src/win/tcp.c
@@ -177,7 +177,7 @@

   /* Set implicit binding address used by connectEx */
   uv_addr_ip4_any_ = uv_ip4_addr("0.0.0.0", 0);
-  uv_addr_ip6_any_ = uv_ip6_addr("::1", 0);
+  uv_addr_ip6_any_ = uv_ip6_addr("::", 0);

   /* Retrieve the needed winsock extension function pointers. */
   dummy = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);


Auto merged

Auto merged

2004/01/26 13:50:09-05:00 tresys.com!kcarr
another try at merging real time log button

2004/01/26 12:59:56-05:00 tresys.com!kcarr
SCCS merged

(Logical change 1.69)

--- setools/seaudit/seaudit.c
+++ setools/seaudit/seaudit.c
@@ -37,8 +37,7 @@
 	{"version", no_argument, NULL, 'v'},
 	{NULL, 0, NULL, 0}
 };
-
-static void seaudit_set_real_time_log_toggle_button_state(bool_t state);
+static void seaudit_set_real_time_log_button_state(bool_t state);
 static int seaudit_read_policy_conf(const char *fname);
 static void seaudit_print_version_info(void);
 static void seaudit_print_usage_info(const char *program_name, bool_t brief);
@@ -265,6 +264,7 @@

 	seaudit_set_recent_policys_submenu(&(seaudit_app->seaudit_conf));
 	seaudit_set_recent_logs_submenu(&(seaudit_app->seaudit_conf));
+	seaudit_set_real_time_log_button_state(seaudit_app->seaudit_conf.real_time_log);

 	/* if no files were given on the command line then use the
          * current user-saved default filenames */
@@ -285,10 +285,6 @@
 	log_filtered_callback_register(&seaudit_update_status_bar, NULL);
 	/* finish loading later */
 	g_idle_add(&delayed_main, &filenames);
-
-	/* must set the state of the button after signal autoconnect to catch the
-	 * toggled signal */
-	seaudit_set_real_time_log_toggle_button_state(seaudit_app->seaudit_conf.real_time_log);

 	/* go */
 	gtk_main();
@@ -484,25 +480,13 @@
 	query_window_create();
 }

-void seaudit_on_realtime_toggled(GtkToggleButton *toggle, gpointer user_data)
-{
-	GtkWidget *button;
-	gboolean active;
-
-	active = gtk_toggle_button_get_active(toggle);
-	button = glade_xml_get_widget(seaudit_app->window->xml, "RealTimeToggleButton");
-	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(button), active);
-	set_real_time_log_toggle_button_state(active);
-
-	/* set up a timeout function to update the log */
-	if (seaudit_app->timeout_key)
-		gtk_timeout_remove(seaudit_app->timeout_key);
-	if (active)
-		seaudit_app->timeout_key = gtk_timeout_add(LOG_UPDATE_INTERVAL,
-							   &seaudit_real_time_update_log, NULL);
-	else
-		seaudit_app->timeout_key = 0;
-}
+
+void seaudit_on_real_time_button_pressed(GtkButton *button, gpointer user_data)
+{
+	bool_t state = seaudit_app->real_time_state;
+	seaudit_set_real_time_log_button_state(!state);
+}
+
 /*
  * Gtk callbacks registered by seaudit_t object
  */
@@ -581,13 +565,26 @@
 /*
  * Helper functions for seaudit_t
  */
-static void seaudit_set_real_time_log_toggle_button_state(bool_t state)
-{
-	GtkWidget *widget;
-
-	widget = glade_xml_get_widget(seaudit_app->window->xml, "RealTimeToggleButton");
-	g_assert(widget);
-	gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(widget), state);
+static void seaudit_set_real_time_log_button_state(bool_t state)
+{
+	GtkWidget *label, *image;
+
+	label = glade_xml_get_widget(seaudit_app->window->xml, "RealTimeLabel");
+	g_assert(label);
+	image = glade_xml_get_widget(seaudit_app->window->xml, "RealTimeImage");
+	g_assert(image);
+	seaudit_app->real_time_state = state;
+	if (seaudit_app->timeout_key)
+		gtk_timeout_remove(seaudit_app->timeout_key);
+
+	if (state) {
+		gtk_label_set_text(GTK_LABEL(label), "Stop monitor");
+		gtk_image_set_from_stock(GTK_IMAGE(image), GTK_STOCK_STOP, GTK_ICON_SIZE_SMALL_TOOLBAR);
+		seaudit_app->timeout_key = g_timeout_add(LOG_UPDATE_INTERVAL, seaudit_real_time_update_log, NULL);
+	} else {
+		gtk_label_set_text(GTK_LABEL(label), "Start monitor");
+		gtk_image_set_from_stock(GTK_IMAGE(image), GTK_STOCK_REFRESH, GTK_ICON_SIZE_SMALL_TOOLBAR);
+	}
 }

 static int seaudit_read_policy_conf(const char *fname)


libxbps: fix a memleak when removing obsolete files in pkg upgrades.

--- lib/package_remove_obsoletes.c
+++ lib/package_remove_obsoletes.c
@@ -135,6 +135,7 @@
 		}
 		printf("Removed obsolete obj: %s\n",
 		    prop_string_cstring_nocopy(oldstr));
+		free(file);
 	}
 	if (!dolinks) {
 		/*


Working on parsing the csv

Working on parsing the csv

--- src/csvchop.c
+++ src/csvchop.c
@@ -24,9 +24,7 @@

 static Configuration parse_config(int argc, char** argv);
-static ProcessResult parse_cells(void* buffer, size_t buffer_read, size_t already_processed, Cell* cells, size_t max_cells, Configuration* config, Context* context);
 static void output_cells(Cell* cells, int number_of_cells, Configuration* config, Context* context);
-
 int main(int argc, char** argv) {
 	Configuration config = parse_config(argc, argv);
 	Context ctx;
@@ -184,11 +182,6 @@
 	return config;
 }

-static ProcessResult parse_cells(void* buffer, size_t buffer_read, size_t already_processed, Cell* cells, size_t max_cells, Configuration* config, Context* context) {
-	ProcessResult result;
-	return result;
-
-}
 static void output_cells(Cell* cells, int number_of_cells, Configuration* config, Context* context) {

 }


Removed need for specifying separator

Removed need for specifying separator

--- src/csvpipe.c
+++ src/csvpipe.c
@@ -16,7 +16,6 @@

 struct {
 	FILE* source;
-	char separator;
 	bool drop_header;
 } config;

@@ -36,8 +35,6 @@
 static void print_help() {
 	fprintf(stderr, "usage: csvpipe [OPTIONS] [FILE]");
 	fprintf(stderr, "options:");
-	fprintf(stderr, "-s character\n");
-	fprintf(stderr, "  Which character is used as separator (default is ,)\n");
 	fprintf(stderr, "-d\n");
 	fprintf(stderr, "  drop header row\n");
 }
@@ -47,14 +44,10 @@

 static void parse_config(int argc, char** argv) {
 	config.source = stdin;
-	config.separator = ',';
 	config.drop_header = false;
 	char c;
-	while ((c = getopt (argc, argv, "s:d")) != -1) {
+	while ((c = getopt (argc, argv, "d")) != -1) {
 		switch (c) {
-			case 's':
-				config.separator = optarg[0];
-				break;
 			case 'd':
 				config.drop_header = true;
 				break;


add check if pool is shutting down

add check if pool is shutting down

--- src/cxxpool.h
+++ src/cxxpool.h
@@ -341,8 +341,9 @@
   auto future = pack_task->get_future();
   {
       std::lock_guard<std::mutex> lock{task_mutex_};
-      ++task_counter_;
-      ++task_balance_;
+      if (done_)
+        throw thread_pool_error{"push called while pool is shutting down"};
+      ++task_counter_; ++task_balance_;
       tasks_.emplace([pack_task]{ (*pack_task)(); }, priority, task_counter_);
   }
   task_cond_var_.notify_one();


usocket.c: use LUASOCKET_PRIVATE

usocket.c: use LUASOCKET_PRIVATE


Revert "Revert "Revert "Added support for arbitrary strings for yes. Also, first commit in three years, jeez!"""

I need to stop reverting this crap.

--- src/yes/yes.c
+++ src/yes/yes.c
@@ -2,6 +2,8 @@

 #define PROGRAM_NAME "yes"
 #define AUTHORS "fauxm"
+
+//todo: add support for other strings

 int main( int argc, char** argv ) {
     if( argc == 1 ) {
@@ -9,22 +11,5 @@
             printf( "y\n" );
         }
     }
-
-    else if( argc > 1 ) {
-        int count;
-        while( 1 ) {
-            for( count = 1; count < argc; count++ ) {
-                if( count == argc - 1 ) {
-                    printf("%s", argv[count]);
-                }
-                else {
-                    printf( "%s ", argv[count] );
-                }
-            }
-
-            printf("\n");
-        }
-    }
-
     return 0;
 }


Don't trap errors on sendto, these aren't necessarily fatal

--- src/zbeacon.c
+++ src/zbeacon.c
@@ -758,8 +758,11 @@
         (char *) zframe_data (self->transmit), zframe_size (self->transmit),
         0,      //  Flags
         (struct sockaddr *) &self->broadcast, sizeof (inaddr_t));
-    if (size == SOCKET_ERROR)
-        s_handle_io_error ("sendto");
+    //  Sending can fail if the OS is blocking multicast. In such cases we
+    //  don't try to report the error. We might log this or send to an error
+    //  console at some point.
+        if (size == SOCKET_ERROR)
+            /* s_handle_io_error ("sendto") */ ;
 }

 //  Destroy agent instance


zconfig_chunk_save will now save the wole config (sub)tree instead of just one config entry

--- src/zconfig.c
+++ src/zconfig.c
@@ -82,6 +82,12 @@
 static int
     s_config_save_chunk (zconfig_t *self, void *arg, int level);

+// Helper structure for saving config tree to chunck.
+typedef struct chunk_save_helper_s {
+  zchunk_t	*chunk;
+  size_t	size;
+} chunk_save_helper_t;
+

 //  --------------------------------------------------------------------------
 //  Constructor
@@ -328,7 +334,7 @@

     //  Process all children in one go, as a list
     zconfig_t *child = self->child;
-    while (child && !rc) {
+    while (child) {
         rc = s_config_execute (child, handler, arg, level + 1);
         if (rc == -1)
             break;              //  -1 from callback means end execution
@@ -650,10 +656,17 @@
 zconfig_chunk_save (zconfig_t *self)
 {
     assert (self);
-    size_t out_count = (size_t) zconfig_execute (self, s_config_save_chunk, NULL);
-    printf ("OUT COUNT: %zd\n", out_count);
-    zchunk_t *chunk = zchunk_new (NULL, out_count);
-    zconfig_execute (self, s_config_save_chunk, zchunk_data (chunk));
+
+    chunk_save_helper_t param;
+    param.size = 0;
+    param.chunk = NULL;
+
+    zconfig_execute (self, s_config_save_chunk, &param);
+    zchunk_t *chunk = zchunk_new (NULL, param.size);
+    if (!chunk)
+      return NULL;
+    param.chunk = chunk;
+    zconfig_execute (self, s_config_save_chunk, &param);
     return chunk;
 }

@@ -669,7 +682,8 @@
     assert (arg);

     int out_count = 0;
-    zchunk_t *chunk = (zchunk_t *) arg;
+    chunk_save_helper_t *param = (chunk_save_helper_t *)arg;
+      zchunk_t *chunk = param->chunk;

     //  Store any comments on the item
     if (self->comments) {
@@ -701,6 +715,7 @@
         if (chunk)
             zchunk_append (chunk, curline, strlen (curline));
     }
+    param->size += out_count;
     return out_count;
 }


给 ziplist.c 模块的所有函数都添加算法复杂度

给 ziplist.c 模块的所有函数都添加算法复杂度

--- src/ziplist.c
+++ src/ziplist.c
@@ -200,6 +200,8 @@

 /*
  * 用于取出 zl 各部分值的宏
+ *
+ * 所有宏复杂度都为 O(1)
  */
 // 取出列表以字节计算的列表长度(内存的 0 - 31 位，整数)
 #define ZIPLIST_BYTES(zl)       (*((uint32_t*)(zl)))
@@ -222,6 +224,8 @@
  * 对 <zllen> 增一
  *
  * ZIPLIST_LENGTH(zl) 的最大值为 UINT16_MAX
+ *
+ * 复杂度：O(1)
  */
 #define ZIPLIST_INCR_LENGTH(zl,incr) { \
     if (ZIPLIST_LENGTH(zl) < UINT16_MAX) \
@@ -245,6 +249,8 @@
  * 'encoding'. */
 /*
  * 从 ptr 指针中取出编码类型，并将它保存到 encoding
+ *
+ * 复杂度：O(1)
  */
 #define ZIP_ENTRY_ENCODING(ptr, encoding) do {  \
     (encoding) = (ptr[0]); \
@@ -253,6 +259,8 @@

 /*
  * 返回 encoding 指定的整数编码方式所需的长度
+ *
+ * 复杂度：O(1)
  */
 static unsigned int zipIntSize(unsigned char encoding) {
     switch(encoding) {
@@ -273,6 +281,8 @@
  * 编码长度 l ，并将它写入到 p 。
  *
  * 如果 p 为 NULL ，那么返回编码 rawlen 所需的字节数
+ *
+ * 复杂度：O(1)
  */
 static unsigned int zipEncodeLength(unsigned char *p, unsigned char encoding, unsigned int rawlen) {
     unsigned char len = 1, buf[5];
@@ -319,6 +329,11 @@
  * entries length. */
 /*
  * 从 ptr 指针中取出节点的编码、保存节点长度所需的长度、以及节点的长度
+ *
+ * 复杂度：O(1)
+ *
+ * 返回值：
+ *  int 编码节点所需的长度
  */
 #define ZIP_DECODE_LENGTH(ptr, encoding, lensize, len) do {                    \
     /* 取出节点的编码 */                                                       \
@@ -353,6 +368,8 @@
  * 编码前置节点的长度，并将它写入 p 。
  *
  * 如果 p 为 NULL ，那么返回编码 len 所需的字节数。
+ *
+ * 复杂度：O(1)
  */
 static unsigned int zipPrevEncodeLength(unsigned char *p, unsigned int len) {
     if (p == NULL) {
@@ -372,6 +389,15 @@

 /* Encode the length of the previous entry and write it to "p". This only
  * uses the larger encoding (required in __ziplistCascadeUpdate). */
+/*
+ * 将前驱节点的长度 len 写入到 p 中
+ * 其中 p 的空间比保存 len 所需的实际空间要更大
+ *
+ * 这适用于将一个比原节点更短的新节点插入到某个节点时使用
+ * 具体参考 __ziplistCascadeUpdate 函数的头注释
+ *
+ * 复杂度：O(1)
+ */
 static void zipPrevEncodeLengthForceLarge(unsigned char *p, unsigned int len) {
     if (p == NULL) return;
     p[0] = ZIP_BIGLEN;
@@ -383,6 +409,11 @@
  * element, from the perspective of the entry pointed to by 'ptr'. */
 /*
  * 从指针 ptr 中取出保存前一个节点的长度所需的字节数
+ *
+ * 复杂度：O(1)
+ *
+ * 返回值：
+ *  unsigned int
  */
 #define ZIP_DECODE_PREVLENSIZE(ptr, prevlensize) do {                          \
     if ((ptr)[0] < ZIP_BIGLEN) {                                               \
@@ -394,9 +425,14 @@

 /* Decode the length of the previous element, from the perspective of the entry
  * pointed to by 'ptr'. */
- /*
-  * 从指针 ptr 中取出前一个节点的长度
-  */
+/*
+* 从指针 ptr 中取出前一个节点的长度
+*
+* 复杂度：O(1)
+*
+* 返回值：
+*   unsigned int
+*/
 #define ZIP_DECODE_PREVLEN(ptr, prevlensize, prevlen) do {                     \
     /* 取得保存前一个节点的长度所需的字节数 */                                 \
     ZIP_DECODE_PREVLENSIZE(ptr, prevlensize);                                  \
@@ -414,6 +450,8 @@
  * previous element 'len', in the entry pointed to by 'p'. */
 /*
  * 返回编码 len 所需的长度减去编码 p 的前一个节点的大小所需的长度之差
+ *
+ * 复杂度：O(1)
  */
 static int zipPrevLenByteDiff(unsigned char *p, unsigned int len) {
     // 获取编码前一节点所需的长度
@@ -426,30 +464,41 @@
 /* Return the total number of bytes used by the entry pointed to by 'p'. */
 /*
  * 返回 p 指向的节点的空间总长度
+ *
+ * 复杂度：O(1)
  */
 static unsigned int zipRawEntryLength(unsigned char *p) {
     unsigned int prevlensize, encoding, lensize, len;
-    // 前驱节点长度的空间长度
+
+    // 保存前驱节点长度的空间长度
     ZIP_DECODE_PREVLENSIZE(p, prevlensize);
-    // 本节点的空间长度
+
+    // 保存本节点的空间长度
     ZIP_DECODE_LENGTH(p + prevlensize, encoding, lensize, len);
+
     return prevlensize + lensize + len;
 }

 /* Check if string pointed to by 'entry' can be encoded as an integer.
  * Stores the integer value in 'v' and its encoding in 'encoding'. */
 /*
- * 检查 entry 所指向的字符串指针，能否编码为整数
- * 如果可以的话，返回 1 ，并将值保存在 v ，将编码保存在 encoding
- * 否则，返回 0
+ * 检查 entry 所保存的值，看它能否编码为整数
+ *
+ * 复杂度：O(N)，N 为 entry 所保存字符串值的长度
+ *
+ * 返回值：
+ *  如果可以的话，返回 1 ，并将值保存在 v ，将编码保存在 encoding
+ *  否则，返回 0
  */
 static int zipTryEncoding(unsigned char *entry, unsigned int entrylen, long long *v, unsigned char *encoding) {
     long long value;

     if (entrylen >= 32 || entrylen == 0) return 0;
+    // 尝试转换为整数
     if (string2ll((char*)entry,entrylen,&value)) {
         /* Great, the string can be encoded. Check what's the smallest
          * of our encoding types that can hold this value. */
+        // 选择整数编码
         if (value >= 0 && value <= 12) {
             *encoding = ZIP_INT_IMM_MIN+value;
         } else if (value >= INT8_MIN && value <= INT8_MAX) {
@@ -472,6 +521,8 @@
 /* Store integer 'value' at 'p', encoded as 'encoding' */
 /*
  * 将 value 保存到 p ，并设置编码为 encoding
+ *
+ * 复杂度：O(1)
  */
 static void zipSaveInteger(unsigned char *p, int64_t value, unsigned char encoding) {
     int16_t i16;
@@ -511,6 +562,8 @@
 /* Read integer encoded as 'encoding' from 'p' */
 /*
  * 根据 encoding ，从指针 p 中取出整数值
+ *
+ * 复杂度：O(1)
  */
 static int64_t zipLoadInteger(unsigned char *p, unsigned char encoding) {
     int16_t i16;
@@ -552,6 +605,8 @@
 /* Return a struct with all information about an entry. */
 /*
  * 从指针 p 中提取出节点的各个属性，并将属性保存到 zlentry 结构，然后返回
+ *
+ * 复杂度：O(1)
  */
 static zlentry zipEntry(unsigned char *p) {
     zlentry e;
@@ -573,6 +628,10 @@

 /*
  * 新创建一个空 ziplist
+ *
+ * 复杂度：O(1)
+ *
+ * 返回值：新创建的 ziplist
  */
 unsigned char *ziplistNew(void) {
     // 分配 2 个 32 bit，一个 16 bit，以及一个 8 bit
@@ -598,6 +657,10 @@
 /* Resize the ziplist. */
 /*
  * 对 zl 进行空间重非配，并更新相关属性
+ *
+ * 复杂度：O(N)
+ *
+ * 返回值：更新后的 ziplist
  */
 static unsigned char *ziplistResize(unsigned char *zl, unsigned int len) {
     // 重分配
@@ -641,8 +704,12 @@
  * 这个函数就用于处理这种连续扩展动作。
  *
  * 因为节点的长度变小而引起的连续缩小也是可能出现的，
- * 不过，为了避免扩展-缩小-扩展-缩小这样的情况反复出现（flapping），
+ * 不过，为了避免扩展-缩小-扩展-缩小这样的情况反复出现（flapping，抖动），
  * 我们不处理这种情况，而是任由 prevlen 比所需的长度更长
+ *
+ * 复杂度：O(N^2)
+ *
+ * 返回值：更新后的 ziplist
  */
 static unsigned char *__ziplistCascadeUpdate(unsigned char *zl, unsigned char *p) {
     size_t curlen = intrev32ifbe(ZIPLIST_BYTES(zl)), rawlen, rawlensize;
@@ -677,7 +744,7 @@
             offset = p-zl;
             // 需要多添加的长度
             extra = rawlensize-next.prevrawlensize;
-            // 重分配
+            // 重分配，复杂度为 O(N)
             zl = ziplistResize(zl,curlen+extra);
             p = zl+offset;

@@ -692,6 +759,7 @@
             }

             /* Move the tail to the back. */
+            // 为获得空间而进行数据移动，复杂度万恶 O(N)
             memmove(np+rawlensize,
                 np+next.prevrawlensize,
                 curlen-noffset-next.prevrawlensize-1);
@@ -701,7 +769,8 @@
             p += rawlen;
             curlen += extra;
         } else {
-            // 下一节点的长度编码空间有多余，进行收缩
+            // 下一节点的长度编码空间有多余，不进行收缩
+            // 只是将被编码的长度写入空间
             if (next.prevrawlensize > rawlensize) {
                 /* This would result in shrinking, which we want to avoid.
                  * So, set "rawlen" in the available bytes. */
@@ -721,6 +790,10 @@
 /* Delete "num" entries, starting at "p". Returns pointer to the ziplist. */
 /*
  * 从指针 p 开始，删除 num 个节点
+ *
+ * 复杂度：O(N^2)
+ *
+ * 返回值：删除元素后的 ziplist
  */
 static unsigned char *__ziplistDelete(unsigned char *zl, unsigned char *p, unsigned int num) {
     unsigned int i, totlen, deleted = 0;
@@ -732,6 +805,7 @@
     first = zipEntry(p);
     // 累积起所有删除目标（节点）的编码长度
     // 并移动指针 p
+    // 复杂度 O(N)
     for (i = 0; p[0] != ZIP_END && i < num; i++) {
         p += zipRawEntryLength(p);
         deleted++;
@@ -769,6 +843,7 @@

             /* Move tail to the front of the ziplist */
             // 前移内存中的数据，覆盖原本的被删除数据
+            // 复杂度 O(N)
             memmove(first.p,p,
                 intrev32ifbe(ZIPLIST_BYTES(zl))-(p-zl)-1);
         } else {
@@ -780,6 +855,7 @@

         /* Resize and update length */
         // 调整大小，并更新 ziplist 的长度
+        // 复杂度 O(N)
         offset = first.p-zl;
         zl = ziplistResize(zl, intrev32ifbe(ZIPLIST_BYTES(zl))-totlen+nextdiff);
         ZIPLIST_INCR_LENGTH(zl,-deleted);
@@ -789,6 +865,7 @@
          * we need to cascade the update throughout the ziplist */
         // 层级更新
         if (nextdiff != 0)
+            // 复杂度 O(N^2)
             zl = __ziplistCascadeUpdate(zl,p);
     }
     return zl;
@@ -796,7 +873,11 @@

 /* Insert item at "p". */
 /*
- * 添加新节点到地址 p
+ * 添加保存给定元素 s 的新节点到地址 p
+ *
+ * 复杂度：O(N^2)
+ *
+ * 返回值：删除元素后的 ziplist
  */
 static unsigned char *__ziplistInsert(unsigned char *zl, unsigned char *p, unsigned char *s, unsigned int slen) {
     size_t curlen = intrev32ifbe(ZIPLIST_BYTES(zl)),
@@ -863,6 +944,7 @@
     offset = p-zl;
     // 重分配空间，并更新长度属性和表尾
     // 新空间长度 = 现有长度 + 新节点所需长度 + 编码新节点长度所需的长度差
+    // O(N)
     zl = ziplistResize(zl,curlen+reqlen+nextdiff);
     // 更新 p 的指针
     p = zl+offset;
@@ -873,6 +955,7 @@
     if (p[0] != ZIP_END) {
         /* Subtract one because of the ZIP_END bytes */
         // 向右移动移原有数据，为新节点让出空间
+        // O(N)
         memmove(p+reqlen,p-nextdiff,curlen-offset-1+nextdiff);

         /* Encode this entry's raw length in the next entry. */
@@ -903,6 +986,7 @@
      * we need to cascade the update throughout the ziplist */
     if (nextdiff != 0) {
         offset = p-zl;
+        // O(N^2)
         zl = __ziplistCascadeUpdate(zl,p+reqlen);
         p = zl+offset;
     }
@@ -928,6 +1012,10 @@

 /*
  * 将新元素插入为列表的表头节点或者表尾节点
+ *
+ * 复杂度：O(N^2)
+ *
+ * 返回值：添加操作完成后的 ziplist
  */
 unsigned char *ziplistPush(unsigned char *zl, unsigned char *s, unsigned int slen, int where) {
     unsigned char *p;
@@ -939,9 +1027,13 @@
  * index is negative, the list is traversed back to front. When the list
  * doesn't contain an element at the provided index, NULL is returned. */
 /*
- * 返回一个偏移值，用于 ziplistNext 进行迭代
+ * 返回指向当前迭代节点的指针，用于 ziplistNext 进行迭代
  * 当偏移值是负数时，表示迭代是从表尾到表头进行的。
  * 当元素被遍历完时，返回 NULL
+ *
+ * 复杂度：O(1)
+ *
+ * 返回值：指向节点的指针
  */
 unsigned char *ziplistIndex(unsigned char *zl, int index) {

@@ -984,6 +1076,8 @@
 /*
  * 返回指向 p 的下一个节点的指针，
  * 如果 p 已经到达表尾，那么返回 NULL 。
+ *
+ * 复杂度：O(N)
  */
 unsigned char *ziplistNext(unsigned char *zl, unsigned char *p) {
     ((void) zl);
@@ -1007,6 +1101,8 @@
 /* Return pointer to previous entry in ziplist. */
 /*
  * 返回 p 的前一个节点
+ *
+ * 复杂度：O(1)
  */
 unsigned char *ziplistPrev(unsigned char *zl, unsigned char *p) {
     zlentry entry;
@@ -1034,6 +1130,8 @@
  * Return 0 if 'p' points to the end of the zipmap, 1 otherwise. */
 /*
  * 获取 p 所指向的节点，并将相关属性保存至指针
+ *
+ * 复杂度：O(1)
  */
 unsigned int ziplistGet(unsigned char *p, unsigned char **sstr, unsigned int *slen, long long *sval) {
     zlentry entry;
@@ -1061,6 +1159,10 @@
 /* Insert an entry at "p". */
 /*
  * 将节点插入到 p 之后
+ *
+ * 复杂度：O(N^2)
+ *
+ * 返回值：添加完成后的 ziplist
  */
 unsigned char *ziplistInsert(unsigned char *zl, unsigned char *p, unsigned char *s, unsigned int slen) {
     return __ziplistInsert(zl,p,s,slen);
@@ -1073,6 +1175,10 @@
  * 删除 p 所指向的节点，
  * 并原地更新 p 指针，让它指向被删除节点的后一个节点，
  * 使得可以迭代地进行删除
+ *
+ * 复杂度：O(N^2)
+ *
+ * 返回值：删除完成后的 ziplist
  */
 unsigned char *ziplistDelete(unsigned char *zl, unsigned char **p) {
     size_t offset = *p-zl;
@@ -1089,6 +1195,10 @@
 /* Delete a range of entries from the ziplist. */
 /*
  * 定位到索引 index ，并删除这之后的 num 个元素
+ *
+ * 复杂度：O(N^2)
+ *
+ * 返回值：删除完成后的 ziplist
  */
 unsigned char *ziplistDeleteRange(unsigned char *zl, unsigned int index, unsigned int num) {
     unsigned char *p = ziplistIndex(zl,index);
@@ -1099,6 +1209,8 @@
 /*
  * 将 p 所指向的节点的属性和 sstr 以及 slen 进行对比，
  * 如果相等则返回 1 。
+ *
+ * 复杂度：O(1)
  */
 unsigned int ziplistCompare(unsigned char *p, unsigned char *sstr, unsigned int slen) {
     zlentry entry;
@@ -1136,7 +1248,11 @@
 /*
  * 根据给定的 vstr 和 vlen ，查找和属性和它们相等的节点
  * 在每次比对之间，跳过 skip 个节点。
- * 查找失败返回 NULL 。
+ *
+ * 复杂度：O(N)
+ * 返回值：
+ *  查找失败返回 NULL 。
+ *  查找成功返回指向目标节点的指针
  */
 unsigned char *ziplistFind(unsigned char *p, unsigned char *vstr, unsigned int vlen, unsigned int skip) {
     int skipcnt = 0;
@@ -1208,6 +1324,8 @@
 /* Return length of ziplist. */
 /*
  * 返回 ziplist 的长度
+ *
+ * 复杂度：O(N)
  */
 unsigned int ziplistLen(unsigned char *zl) {
     unsigned int len = 0;
@@ -1233,6 +1351,8 @@
 /* Return ziplist blob size in bytes. */
 /*
  * 返回整个 ziplist 的空间大小
+ *
+ * 复杂度：O(1)
  */
 size_t ziplistBlobLen(unsigned char *zl) {
     return intrev32ifbe(ZIPLIST_BYTES(zl));


inconsistent declaration parameter names

function 'zobrist_init' in zobrist.h:27:6 has a definition with
different parameter names:

void zobrist_init(unsigned int longest);

whereas the definition in zobrist.cc:29:6 is:

void zobrist_init(unsigned int n)

--- src/zobrist.h
+++ src/zobrist.h
@@ -24,7 +24,7 @@
 extern uint64_t * zobrist_tab_base;
 extern uint64_t * zobrist_tab_byte_base;

-void zobrist_init(unsigned int longest);
+void zobrist_init(unsigned int n);

 void zobrist_exit();


Fixed reading of jump tables for SWITCH_LONG/STRING

--- srm_oparray.c
+++ srm_oparray.c
@@ -489,7 +489,7 @@
 			zval *val;

 #if PHP_VERSION_ID >= 70300
-			array_value = RT_CONSTANT((op_array->literals) + opline, node);
+			array_value = RT_CONSTANT((op_array->opcodes) + opline, node);
 #else
 			array_value = RT_CONSTANT_EX(op_array->literals, node);
 #endif
@@ -995,7 +995,7 @@
 		zval *val;

 #if PHP_VERSION_ID >= 70300
-		array_value = RT_CONSTANT((opa->literals) + position, opcode.op2);
+		array_value = RT_CONSTANT((opa->opcodes) + position, opcode.op2);
 #else
 		array_value = RT_CONSTANT_EX(opa->literals, opcode.op2);
 #endif


I can't find anything about field name and value length in RFCs about form data. so for now, let's just consider they are as long as one could need.

--- srq-request.c
+++ srq-request.c
@@ -4,15 +4,6 @@
 #include <ctype.h>

 #include "srq-request.h"
-
-#define FNAMESZ 256
-#define FVALUESZ 8192
-
-#define PAIRS_POOLSZ 4
-
-#define unhex(c) (((c) >= '0' && (c) <= '9') ? (c) - '0' : \
-        ((c) >= 'a' && (c) <= 'f') ? (c) - 'a' + 10 : \
-        ((c) >= 'A' && (c) <= 'F') ? (c) - 'A' + 10 : 0)

 #define MFD_STRING "multipart/form-data; boundary="
 #define MFD_CD_STRING "Content-Disposition: form-data; "
@@ -21,6 +12,15 @@
 #define MFD_CHUNKSIZE (32 * 1024)

 #define SRQ_MAXFILESIZE (8 * 1024 * 1024)
+
+#define FNAMESZ MFD_CHUNKSIZE
+#define FVALUESZ MFD_CHUNKSIZE
+
+#define PAIRS_POOLSZ 4
+
+#define unhex(c) (((c) >= '0' && (c) <= '9') ? (c) - '0' : \
+        ((c) >= 'a' && (c) <= 'f') ? (c) - 'a' + 10 : \
+        ((c) >= 'A' && (c) <= 'F') ? (c) - 'A' + 10 : 0)

 enum request_method {POST, GET, PUT};


Sync with main tree.

Sync with main tree.

--- KERN/nke/sctp_nke/SnowLeopard/netinet/sctp_output.c
+++ KERN/nke/sctp_nke/SnowLeopard/netinet/sctp_output.c
@@ -2195,11 +2195,6 @@
 			   sa_family_t fam)
 {
 	uint8_t dest_is_global=0;
-#if defined(__APPLE__)
-	struct timeval timenow;
-
-	getmicrotime(&timenow);
-#endif
 	/* dest_is_priv is true if destination is a private address */
         /* dest_is_loop is true if destination is a loopback addresses */

@@ -2296,12 +2291,6 @@
 			    sa_family_t fam)
 {
 	uint8_t dest_is_global=0;
-
-#if defined(__APPLE__)
-	struct timeval timenow;
-
-	getmicrotime(&timenow);
-#endif

 	/*
 	 * Here we determine if its a acceptable address. A acceptable


finished local assignment bytecode optimization - currently contains cases for all instructions which use an output register

--- src/sgs_bcg.c
+++ src/sgs_bcg.c
@@ -819,14 +819,19 @@
 	if( pos < 0 )
 		goto cannot;

-	switch( func->code.ptr[ ibeg ] )
+	switch( (uint8_t) func->code.ptr[ ibeg ] )
 	{
-	case SI_ADD:
-	case SI_SUB:
-	case SI_MUL:
-	case SI_DIV:
-	case SI_MOD:
+	case SI_POPR: case SI_GETVAR: case SI_GETPROP: case SI_GETINDEX:
+	case SI_SET: case SI_CONCAT: case SI_BOOL_AND: case SI_BOOL_OR:
+	case SI_NEGATE: case SI_BOOL_INV: case SI_INVERT: case SI_INC: case SI_DEC:
+	case SI_ADD: case SI_SUB: case SI_MUL: case SI_DIV: case SI_MOD:
+	case SI_AND: case SI_OR: case SI_XOR: case SI_LSH: case SI_RSH:
+	case SI_SEQ: case SI_EQ: case SI_LT: case SI_LTE:
+	case SI_SNEQ: case SI_NEQ: case SI_GT: case SI_GTE:
 		AS_INT16( func->code.ptr + ibeg + 1 ) = pos;
+		break;
+	case SI_ARRAY: case SI_DICT:
+		AS_INT16( func->code.ptr + ibeg + 2 ) = pos;
 		break;
 	default:
 		goto cannot;


r3824/sofa-dev : BUGFIX: in windows compilation

--- modules/sofa/component/mapping/BarycentricMapping.h
+++ modules/sofa/component/mapping/BarycentricMapping.h
@@ -461,20 +461,23 @@
         unsigned int size_vec;

         in >> size_vec;
-        b.map.clear();
+        sofa::helper::vector<MappingData> m = *(b.map.beginEdit());
+        m.clear();
+
         MappingData value;
         for (unsigned int i=0; i<size_vec; i++)
         {
             in >> value;
-            b.map.push_back(value);
-        }
+            m.push_back(value);
+        }
+        b.map.endEdit();
         return in;
     }

     inline friend std::ostream& operator << ( std::ostream& out, const BarycentricMapperEdgeSetTopology<In, Out> & b )
     {

-        out << b.map.size();
+        out << b.map.getValue().size();
         out << " " ;
         out << b.map;

@@ -533,20 +536,23 @@
         unsigned int size_vec;

         in >> size_vec;
-        b.map.clear();
+
+        sofa::helper::vector<MappingData> m = *(b.map.beginEdit());
+        m.clear();
         MappingData value;
         for (unsigned int i=0; i<size_vec; i++)
         {
             in >> value;
-            b.map.push_back(value);
-        }
+            m.push_back(value);
+        }
+        b.map.endEdit();
         return in;
     }

     inline friend std::ostream& operator << ( std::ostream& out, const BarycentricMapperTriangleSetTopology<In, Out> & b )
     {

-        out << b.map.size();
+        out << b.map.getValue().size();
         out << " " ;
         out << b.map;

@@ -605,20 +611,22 @@
         unsigned int size_vec;

         in >> size_vec;
-        b.map.clear();
+        sofa::helper::vector<MappingData> m = *(b.map.beginEdit());
+        m.clear();
         MappingData value;
         for (unsigned int i=0; i<size_vec; i++)
         {
             in >> value;
-            b.map.push_back(value);
-        }
+            m.push_back(value);
+        }
+        b.map.endEdit();
         return in;
     }

     inline friend std::ostream& operator << ( std::ostream& out, const BarycentricMapperQuadSetTopology<In, Out> & b )
     {

-        out << b.map.size();
+        out << b.map.getValue().size();
         out << " " ;
         out << b.map;

@@ -674,20 +682,22 @@
         unsigned int size_vec;

         in >> size_vec;
-        b.map.clear();
+        sofa::helper::vector<MappingData> m = *(b.map.beginEdit());
+        m.clear();
         MappingData value;
         for (unsigned int i=0; i<size_vec; i++)
         {
             in >> value;
-            b.map.push_back(value);
-        }
+            m.push_back(value);
+        }
+        b.map.endEdit();
         return in;
     }

     inline friend std::ostream& operator << ( std::ostream& out, const BarycentricMapperTetrahedronSetTopology<In, Out> & b )
     {

-        out << b.map.size();
+        out << b.map.getValue().size();
         out << " " ;
         out << b.map;

@@ -747,20 +757,22 @@
         unsigned int size_vec;

         in >> size_vec;
-        b.map.clear();
+        sofa::helper::vector<MappingData> m = *(b.map.beginEdit());
+        m.clear();
         MappingData value;
         for (unsigned int i=0; i<size_vec; i++)
         {
             in >> value;
-            b.map.push_back(value);
-        }
+            m.push_back(value);
+        }
+        b.map.endEdit();
         return in;
     }

     inline friend std::ostream& operator << ( std::ostream& out, const BarycentricMapperHexahedronSetTopology<In, Out> & b )
     {

-        out << b.map.size();
+        out << b.map.getValue().size();
         out << " " ;
         out << b.map;


Fix bug in md5 conversion.

Fix bug in md5 conversion.

--- src/burp2/hexmap.c
+++ src/burp2/hexmap.c
@@ -30,7 +30,7 @@
 	static uint8_t bpos;
 	static uint8_t spos;

-	for(bpos=0, spos=0; spos<MD5_DIGEST_LENGTH; spos+=2, bpos++)
+	for(bpos=0, spos=0; bpos<MD5_DIGEST_LENGTH; bpos++, spos+=2)
 		bytes[bpos] = hexmap1[(uint8_t)md5str[spos]]
 			| hexmap2[(uint8_t)md5str[spos+1]];
 }


strsep can return null

strsep can return null

--- src/buzz/buzzasm.c
+++ src/buzz/buzzasm.c
@@ -244,9 +244,15 @@
          char* line = strsep(&debuginfo, ",\n");
          char* col = strsep(&debuginfo, ",\n");
          char* srcfname = strsep(&debuginfo, ",\n");
-         uint64_t l = strtol(line, NULL, 10);
-         uint64_t c = strtol(col, NULL, 10);
-         buzzdebug_info_set(*dbg, *size, l, c,srcfname);
+         uint64_t l = 0;
+         uint64_t c = 0;
+         if (line) {
+           l = strtol(line, NULL, 10);
+         }
+         if (col) {
+           c = strtol(col, NULL, 10);
+         }
+         buzzdebug_info_set(*dbg, *size, l, c, srcfname);
       }
       /* Interpret the instruction */
       noarg_instr(BUZZVM_INSTR_NOP);


bugfix: multiple path entries were wrongly printed

--- src/c/src/driver.c
+++ src/c/src/driver.c
@@ -177,7 +177,7 @@
       lql_path_t *path = leela_lql_fetch_path(cursor);
       fprintf(stdout, "[[\"path\", [");
       for (int k=0; k<path->size; k+=1)
-      { fprintf(stdout, "[\"%s\",\"%s\"]", path->entries[k].fst, path->entries[k].snd); }
+      { fprintf(stdout, "%s[\"%s\",\"%s\"]", (k == 0 ? "" : ","), path->entries[k].fst, path->entries[k].snd); }
       fprintf(stdout, "]]]\n");
       fflush(stdout);
       leela_lql_path_free(path);
@@ -189,6 +189,7 @@
       fprintf(stdout, "[[\"fail\", %d, \"%s\"]]\n", fail->code, fail->message);
       fflush(stdout);
       leela_lql_fail_free(fail);
+      break;
     }
     }
   }


notes on experimental ComparerWithEquals_XXX I could use with some chagnes to how comparers used elsewhere - need experimentation - and then can use this style - and so lambdas for container instances

--- Library/Sources/Stroika/Foundation/Common/Compare.h
+++ Library/Sources/Stroika/Foundation/Common/Compare.h
@@ -6,6 +6,7 @@

 #include    "../StroikaPreComp.h"

+#include    <functional>
 #include    <memory>

 #include    "../Configuration/Common.h"
@@ -58,6 +59,26 @@
             };

+            // @todo - TRY CHANGING USE OF ComparerWithEquals so instance copied around. Verify no perofrmance (size/time)
+            //          costs!!!!
+            //
+            ///EXPERIMENTAL - MIMICS API/CONCEPT of ComparerWithEquals<T> - but without requirement on T
+            /// BUT - to make it it work - we need all places that use
+            // ComparerWithEquals to keep an instance - and we have t to test/verify that has no codesize/object
+            // size implications when used with the above default case (ok that this costs)
+            template <typename T>
+            struct  ComparerWithEquals_XXX  {
+                std::function<bool(T, T)> fEq;
+
+                ComparerWithEquals_XXX (std::function<bool(T, T)> e)
+                    : fEq (e) {
+                }
+                bool    Equals (T v1, T v2) {
+                    return fEq (v1, v2);
+                }
+            };
+
+
         }
     }
 }


wrap valgrind include macor exclusion with cplusplus or stdc - so not included for msvc RC compiler etc

--- Library/Sources/Stroika/Foundation/StroikaPreComp.h
+++ Library/Sources/Stroika/Foundation/StroikaPreComp.h
@@ -20,6 +20,8 @@
  *
  *  Must be included before libg++ stuff (e.g. <shared_ptr>)
  */
+#if     defined (__cplusplus) || defined (__STDC__)
 #include    "Debug/Valgrind.h"
+#endif

 #endif  /*_Stroika_Foundation_StroikaPreComp_h_*/


Removed [[nodiscard]] annotation

Removed [[nodiscard]] annotation

--- src/BabylonImGui/include/babylon/inspector/inspector.h
+++ src/BabylonImGui/include/babylon/inspector/inspector.h
@@ -25,7 +25,7 @@
   Inspector(GLFWwindow* glfwWindow = nullptr, Scene* scene = nullptr);
   ~Inspector(); // = default

-  [[nodiscard]] Scene* scene() const;
+  Scene* scene() const;
   void setScene(Scene* scene);
   void render();


Typo.

Typo.

--- ssl/ssl_err.c
+++ ssl/ssl_err.c
@@ -479,7 +479,7 @@
 {ERR_REASON(SSL_R_NULL_SSL_METHOD_PASSED),"null ssl method passed"},
 {ERR_REASON(SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED),"old session cipher not returned"},
 {ERR_REASON(SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED),"old session compression algorithm not returned"},
-{ERR_REASON(SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE),"only DTLS 1 2 allowed in suiteb mode"},
+{ERR_REASON(SSL_R_ONLY_DTLS_1_2_ALLOWED_IN_SUITEB_MODE),"only DTLS 1.2 allowed in Suite B mode"},
 {ERR_REASON(SSL_R_ONLY_TLS_1_2_ALLOWED_IN_SUITEB_MODE),"only TLS 1.2 allowed in Suite B mode"},
 {ERR_REASON(SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE),"only tls allowed in fips mode"},
 {ERR_REASON(SSL_R_OPAQUE_PRF_INPUT_TOO_LONG),"opaque PRF input too long"},


Did fix from VSK (consequence of having changed s1991() by not doing smoothing anymore) - caused error in memory accessing in call to newCurve().

--- src/shevalc.c
+++ src/shevalc.c
@@ -11,7 +11,7 @@

 /*
  *
- * $Id: shevalc.c,v 1.1 1994-04-21 12:10:42 boh Exp $
+ * $Id: shevalc.c,v 1.2 1994-09-21 09:06:22 pfu Exp $
  *
  */

@@ -22,7 +22,7 @@

 #if defined(SISLNEEDPROTOTYPES)
-void
+void
 shevalc(SISLCurve *pc1,int ider,double ax,double aepsge,int *ileft,
 	     double eder[],int *jstat)
 #else
@@ -39,7 +39,7 @@
 *********************************************************************
 *
 *********************************************************************
-*
+*
 * PURPOSE    : To compute the value and ider first derivatives of the
 *              B-spline curve pointed to by pc1, at the point with
 *              parameter value ax. Use the filtered coefficients of the
@@ -58,14 +58,14 @@
 *                       position and derivatives.
 *              aepsge - Geometry resolution.
 *
-*
+*
 *
 * INPUT/OUTPUT : ileft - Pointer to the interval in the knot vector
 *                        where ax is located. If et is the knot vector,
 *                        the relation
-*
+*
 *                          et[ileft] <= ax < et[ileft+1]
-*
+*
 *                        should hold. (If ax == et[in] then ileft should
 *                        be in-1. Here in is the number of B-spline
 *                        coefficients.)
@@ -87,13 +87,13 @@
 *                       vector, and so on.
 *                       (The C declaration of eder as a two dimensional array
 *                       would therefore be eder[ider+1,idim].)
-*              jstat  - Status messages
+*              jstat  - Status messages
 *                                         > 0      : Warning.
 *                                         = 0      : Ok.
 *                                         < 0      : Error.
 *
 *
-* METHOD     :
+* METHOD     :
 *
 * REFERENCES :
 *
@@ -101,27 +101,49 @@
 * CALLS      : s1221    - Evaluate curve.
 *              s1991    - Make the direction cone of a curve.
 *              newCurve - Create new curve object.
-*              freeCurve - Free scratch occupied by curve object.
+*              freeCurve - Free scratch occupied by curve object.
 *
 * WRITTEN BY :  Vibeke Skytt, SI, 04.91.
 * CORRECTED BY: UJK, SI, 06.91
+* Modified by : Paal Fugelli, SINTEF, Oslo, Norway, 09.94. Replaced
+*               code using 'pdir->esmooth' and s1991() with 'qc = pc1;'
+*               and modified the free'ing of 'qc'.
+*               Added check for 1D rationals.
 *********************************************************************
-*/
+*/
 {
   int kstat=0;        /* Local status variable.                          */
   int kdim = pc1->idim;  /* Dimension of geometry space.                 */
   double *scoef=NULL;    /* Array storing filtered coefficients.         */
   double *s1,*s2,*s3,*s4; /* Pointers into coefficient arrays.           */
   SISLCurve *qc = NULL;   /* Curve to evaluate.                          */
-
+
   /* Make sure that the filtered coefficients of the curve exist.  */
-
+
   if (kdim == 1)
   {
+
+    /*
+     * PFU 09-94.
+     * There should never be a rational 1D curve here according to UJK, but
+     * I (PFU) added a test just in case...
+     * A rational curve would have caused a memory usage error in newCurve
+     * when trying to divide out the weights from the coefs.
+     * This could result in a core dump (division by zero) since the data
+     * would be "garbage".
+     *
+     * If future changes requires this to handle rational 1D curves, this
+     * must be updated to use rcoef when input is rational.
+     *
+     */
+
+    if ( pc1->ikind == 2 || pc1->ikind == 4 )
+      goto err151;
+
      /* Create filtered coefficients. */
-
+
      if ((scoef = newarray(pc1->in,DOUBLE)) == NULL) goto err101;
-
+
      for (s1=pc1->ecoef, s2=scoef, s3=s1+pc1->in; s1<s3; s1=s4)
      {
 	*s2 = *s1;
@@ -131,53 +153,53 @@
 	   else break;
 	}
      }
-
+
      /* Create curve object.  */
-
+
      if ((qc = newCurve(pc1->in,pc1->ik,pc1->et,scoef,pc1->ikind,
 			kdim,0)) == NULL) goto err101;
   }
   else
-  {
-     /* Check if the cone of the curve exist. */
-
-     if (pc1->pdir == NULL)
-     {
-	/* Create cone.  */
-
-	s1991(pc1,aepsge,&kstat);
-	if (kstat < 0) goto error;
-     }
-
-     /* Create curve object.  */
-
-     if ((qc = newCurve(pc1->in,pc1->ik,pc1->et,pc1->pdir->esmooth,
-			pc1->ikind,kdim,0)) == NULL) goto err101;
-  }
-
+    qc = pc1;
+
+  /*
+   * This previously used AN ANACRONISM ('pdir->esmooth') - taken out
+   * (Confirmed by VSK).
+   */
+
+
+
   /* Evaluate curve.  */
-
+
   s1221(qc,ider,ax,ileft,eder,&kstat);
   if (kstat < 0) goto error;
-
+
   /* UJK Let's have a normal exit possibility !*/
   *jstat = 0;
   goto out;

+
+  /* Error in input (1D rationals is not handled) */
+ err151:
+  *jstat = -151;
+  goto out;
+
   /* Error in scratch allocation.  */
-  err101: *jstat = -101;
-  goto out;
-
+ err101:
+  *jstat = -101;
+  goto out;
+
   /* Error in lower level routine.  */
-
-  error : *jstat = kstat;
-  goto out;
-
-out:
+
+ error:
+  *jstat = kstat;
+  goto out;
+
+out:
    /* Free scratch occupied by local objects. */
-
+
    if (scoef != NULL) freearray(scoef);
-   if (qc != NULL) freeCurve(qc);
-
+   if (qc != NULL && qc != pc1 ) freeCurve(qc);
+
    return;
 }


shm mod REFACTOR formatting

shm mod REFACTOR formatting

--- src/shm_mod.c
+++ src/shm_mod.c
@@ -43,7 +43,7 @@
 sr_shmmod_open(sr_shm_t *shm, int zero)
 {
     sr_error_info_t *err_info = NULL;
-    char *shm_name = NULL, buf[8], *ret = NULL;;
+    char *shm_name = NULL, buf[8], *ret = NULL;
     FILE *f;

     err_info = sr_path_mod_shm(&shm_name);


shm sub BUGFIX wrong path being generated

--- src/shm_sub.c
+++ src/shm_sub.c
@@ -201,7 +201,7 @@
     assert(name && suffix1);

     /* get the path */
-    if ((err_info = sr_path_sub_shm(name, suffix1, suffix2, &path))) {
+    if ((err_info = sr_path_sub_data_shm(name, suffix1, suffix2, &path))) {
         goto cleanup;
     }


Nixed unused file

Nixed unused file

--- startup_gcc.c
+++ startup_gcc.c
@@ -1,350 +0,0 @@
-//*****************************************************************************
-//
-// startup_gcc.c - Startup code for use with GNU tools.
-//
-// Copyright (c) 2012 Texas Instruments Incorporated.  All rights reserved.
-// Software License Agreement
-//
-// Texas Instruments (TI) is supplying this software for use solely and
-// exclusively on TI's microcontroller products. The software is owned by
-// TI and/or its suppliers, and is protected under applicable copyright
-// laws. You may not combine this software with "viral" open-source
-// software in order to form a larger program.
-//
-// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
-// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
-// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
-// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
-// DAMAGES, FOR ANY REASON WHATSOEVER.
-//
-// This is part of revision 9453 of the EK-LM4F120XL Firmware Package.
-//
-//*****************************************************************************
-
-#include "inc/hw_nvic.h"
-#include "inc/hw_types.h"
-
-//*****************************************************************************
-//
-// Forward declaration of the default fault handlers.
-//
-//*****************************************************************************
-void ResetISR(void);
-static void NmiSR(void);
-static void FaultISR(void);
-static void IntDefaultHandler(void);
-
-//*****************************************************************************
-//
-// External declarations for the interrupt handlers used by the application.
-//
-//*****************************************************************************
-extern void SysTickIntHandler(void);
-extern void UARTStdioIntHandler(void);
-extern void GPIOPortEIntHandler(void);
-
-//*****************************************************************************
-//
-// The entry point for the application.
-//
-//*****************************************************************************
-extern int main(void);
-
-//*****************************************************************************
-//
-// Reserve space for the system stack.
-//
-//*****************************************************************************
-static unsigned long pulStack[512];
-
-//*****************************************************************************
-//
-// The vector table.  Note that the proper constructs must be placed on this to
-// ensure that it ends up at physical address 0x0000.0000.
-//
-//*****************************************************************************
-__attribute__ ((section(".isr_vector")))
-void (* const g_pfnVectors[])(void) =
-{
-    (void (*)(void))((unsigned long)pulStack + sizeof(pulStack)),
-                                            // The initial stack pointer
-    ResetISR,                               // The reset handler
-    NmiSR,                                  // The NMI handler
-    FaultISR,                               // The hard fault handler
-    IntDefaultHandler,                      // The MPU fault handler
-    IntDefaultHandler,                      // The bus fault handler
-    IntDefaultHandler,                      // The usage fault handler
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    IntDefaultHandler,                      // SVCall handler
-    IntDefaultHandler,                      // Debug monitor handler
-    0,                                      // Reserved
-    IntDefaultHandler,                      // The PendSV handler
-    SysTickIntHandler,                      // The SysTick handler
-    IntDefaultHandler,                      // GPIO Port A
-    IntDefaultHandler,                      // GPIO Port B
-    IntDefaultHandler,                      // GPIO Port C
-    IntDefaultHandler,                      // GPIO Port D
-    GPIOPortEIntHandler,                      // GPIO Port E
-    UARTStdioIntHandler,                    // UART0 Rx and Tx
-    IntDefaultHandler,                      // UART1 Rx and Tx
-    IntDefaultHandler,                      // SSI0 Rx and Tx
-    IntDefaultHandler,                      // I2C0 Master and Slave
-    IntDefaultHandler,                      // PWM Fault
-    IntDefaultHandler,                      // PWM Generator 0
-    IntDefaultHandler,                      // PWM Generator 1
-    IntDefaultHandler,                      // PWM Generator 2
-    IntDefaultHandler,                      // Quadrature Encoder 0
-    IntDefaultHandler,                      // ADC Sequence 0
-    IntDefaultHandler,                      // ADC Sequence 1
-    IntDefaultHandler,                      // ADC Sequence 2
-    IntDefaultHandler,                      // ADC Sequence 3
-    IntDefaultHandler,                      // Watchdog timer
-    IntDefaultHandler,                      // Timer 0 subtimer A
-    IntDefaultHandler,                      // Timer 0 subtimer B
-    IntDefaultHandler,                      // Timer 1 subtimer A
-    IntDefaultHandler,                      // Timer 1 subtimer B
-    IntDefaultHandler,                      // Timer 2 subtimer A
-    IntDefaultHandler,                      // Timer 2 subtimer B
-    IntDefaultHandler,                      // Analog Comparator 0
-    IntDefaultHandler,                      // Analog Comparator 1
-    IntDefaultHandler,                      // Analog Comparator 2
-    IntDefaultHandler,                      // System Control (PLL, OSC, BO)
-    IntDefaultHandler,                      // FLASH Control
-    IntDefaultHandler,                      // GPIO Port F
-    IntDefaultHandler,                      // GPIO Port G
-    IntDefaultHandler,                      // GPIO Port H
-    IntDefaultHandler,                      // UART2 Rx and Tx
-    IntDefaultHandler,                      // SSI1 Rx and Tx
-    IntDefaultHandler,                      // Timer 3 subtimer A
-    IntDefaultHandler,                      // Timer 3 subtimer B
-    IntDefaultHandler,                      // I2C1 Master and Slave
-    IntDefaultHandler,                      // Quadrature Encoder 1
-    IntDefaultHandler,                      // CAN0
-    IntDefaultHandler,                      // CAN1
-    IntDefaultHandler,                      // CAN2
-    IntDefaultHandler,                      // Ethernet
-    IntDefaultHandler,                      // Hibernate
-    IntDefaultHandler,                      // USB0
-    IntDefaultHandler,                      // PWM Generator 3
-    IntDefaultHandler,                      // uDMA Software Transfer
-    IntDefaultHandler,                      // uDMA Error
-    IntDefaultHandler,                      // ADC1 Sequence 0
-    IntDefaultHandler,                      // ADC1 Sequence 1
-    IntDefaultHandler,                      // ADC1 Sequence 2
-    IntDefaultHandler,                      // ADC1 Sequence 3
-    IntDefaultHandler,                      // I2S0
-    IntDefaultHandler,                      // External Bus Interface 0
-    IntDefaultHandler,                      // GPIO Port J
-    IntDefaultHandler,                      // GPIO Port K
-    IntDefaultHandler,                      // GPIO Port L
-    IntDefaultHandler,                      // SSI2 Rx and Tx
-    IntDefaultHandler,                      // SSI3 Rx and Tx
-    IntDefaultHandler,                      // UART3 Rx and Tx
-    IntDefaultHandler,                      // UART4 Rx and Tx
-    IntDefaultHandler,                      // UART5 Rx and Tx
-    IntDefaultHandler,                      // UART6 Rx and Tx
-    IntDefaultHandler,                      // UART7 Rx and Tx
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    IntDefaultHandler,                      // I2C2 Master and Slave
-    IntDefaultHandler,                      // I2C3 Master and Slave
-    IntDefaultHandler,                      // Timer 4 subtimer A
-    IntDefaultHandler,                      // Timer 4 subtimer B
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    0,                                      // Reserved
-    IntDefaultHandler,                      // Timer 5 subtimer A
-    IntDefaultHandler,                      // Timer 5 subtimer B
-    IntDefaultHandler,                      // Wide Timer 0 subtimer A
-    IntDefaultHandler,                      // Wide Timer 0 subtimer B
-    IntDefaultHandler,                      // Wide Timer 1 subtimer A
-    IntDefaultHandler,                      // Wide Timer 1 subtimer B
-    IntDefaultHandler,                      // Wide Timer 2 subtimer A
-    IntDefaultHandler,                      // Wide Timer 2 subtimer B
-    IntDefaultHandler,                      // Wide Timer 3 subtimer A
-    IntDefaultHandler,                      // Wide Timer 3 subtimer B
-    IntDefaultHandler,                      // Wide Timer 4 subtimer A
-    IntDefaultHandler,                      // Wide Timer 4 subtimer B
-    IntDefaultHandler,                      // Wide Timer 5 subtimer A
-    IntDefaultHandler,                      // Wide Timer 5 subtimer B
-    IntDefaultHandler,                      // FPU
-    IntDefaultHandler,                      // PECI 0
-    IntDefaultHandler,                      // LPC 0
-    IntDefaultHandler,                      // I2C4 Master and Slave
-    IntDefaultHandler,                      // I2C5 Master and Slave
-    IntDefaultHandler,                      // GPIO Port M
-    IntDefaultHandler,                      // GPIO Port N
-    IntDefaultHandler,                      // Quadrature Encoder 2
-    IntDefaultHandler,                      // Fan 0
-    0,                                      // Reserved
-    IntDefaultHandler,                      // GPIO Port P (Summary or P0)
-    IntDefaultHandler,                      // GPIO Port P1
-    IntDefaultHandler,                      // GPIO Port P2
-    IntDefaultHandler,                      // GPIO Port P3
-    IntDefaultHandler,                      // GPIO Port P4
-    IntDefaultHandler,                      // GPIO Port P5
-    IntDefaultHandler,                      // GPIO Port P6
-    IntDefaultHandler,                      // GPIO Port P7
-    IntDefaultHandler,                      // GPIO Port Q (Summary or Q0)
-    IntDefaultHandler,                      // GPIO Port Q1
-    IntDefaultHandler,                      // GPIO Port Q2
-    IntDefaultHandler,                      // GPIO Port Q3
-    IntDefaultHandler,                      // GPIO Port Q4
-    IntDefaultHandler,                      // GPIO Port Q5
-    IntDefaultHandler,                      // GPIO Port Q6
-    IntDefaultHandler,                      // GPIO Port Q7
-    IntDefaultHandler,                      // GPIO Port R
-    IntDefaultHandler,                      // GPIO Port S
-    IntDefaultHandler,                      // PWM 1 Generator 0
-    IntDefaultHandler,                      // PWM 1 Generator 1
-    IntDefaultHandler,                      // PWM 1 Generator 2
-    IntDefaultHandler,                      // PWM 1 Generator 3
-    IntDefaultHandler                       // PWM 1 Fault
-};
-
-//*****************************************************************************
-//
-// The following are constructs created by the linker, indicating where the
-// the "data" and "bss" segments reside in memory.  The initializers for the
-// for the "data" segment resides immediately following the "text" segment.
-//
-//*****************************************************************************
-extern unsigned long _etext;
-extern unsigned long _data;
-extern unsigned long _edata;
-extern unsigned long _bss;
-extern unsigned long _ebss;
-
-//*****************************************************************************
-//
-// This is the code that gets called when the processor first starts execution
-// following a reset event.  Only the absolutely necessary set is performed,
-// after which the application supplied entry() routine is called.  Any fancy
-// actions (such as making decisions based on the reset cause register, and
-// resetting the bits in that register) are left solely in the hands of the
-// application.
-//
-//*****************************************************************************
-void
-ResetISR(void)
-{
-    unsigned long *pulSrc, *pulDest;
-
-    //
-    // Copy the data segment initializers from flash to SRAM.
-    //
-    pulSrc = &_etext;
-    for(pulDest = &_data; pulDest < &_edata; )
-    {
-        *pulDest++ = *pulSrc++;
-    }
-
-    //
-    // Zero fill the bss segment.
-    //
-    __asm("    ldr     r0, =_bss\n"
-          "    ldr     r1, =_ebss\n"
-          "    mov     r2, #0\n"
-          "    .thumb_func\n"
-          "zero_loop:\n"
-          "        cmp     r0, r1\n"
-          "        it      lt\n"
-          "        strlt   r2, [r0], #4\n"
-          "        blt     zero_loop");
-
-    //
-    // Enable the floating-point unit.  This must be done here to handle the
-    // case where main() uses floating-point and the function prologue saves
-    // floating-point registers (which will fault if floating-point is not
-    // enabled).  Any configuration of the floating-point unit using DriverLib
-    // APIs must be done here prior to the floating-point unit being enabled.
-    //
-    // Note that this does not use DriverLib since it might not be included in
-    // this project.
-    //
-    HWREG(NVIC_CPAC) = ((HWREG(NVIC_CPAC) &
-                         ~(NVIC_CPAC_CP10_M | NVIC_CPAC_CP11_M)) |
-                        NVIC_CPAC_CP10_FULL | NVIC_CPAC_CP11_FULL);
-
-    //
-    // Call the application's entry point.
-    //
-    main();
-}
-
-//*****************************************************************************
-//
-// This is the code that gets called when the processor receives a NMI.  This
-// simply enters an infinite loop, preserving the system state for examination
-// by a debugger.
-//
-//*****************************************************************************
-static void
-NmiSR(void)
-{
-    //
-    // Enter an infinite loop.
-    //
-    while(1)
-    {
-    }
-}
-
-//*****************************************************************************
-//
-// This is the code that gets called when the processor receives a fault
-// interrupt.  This simply enters an infinite loop, preserving the system state
-// for examination by a debugger.
-//
-//*****************************************************************************
-static void
-FaultISR(void)
-{
-    //
-    // Enter an infinite loop.
-    //
-    while(1)
-    {
-    }
-}
-
-//*****************************************************************************
-//
-// This is the code that gets called when the processor receives an unexpected
-// interrupt.  This simply enters an infinite loop, preserving the system state
-// for examination by a debugger.
-//
-//*****************************************************************************
-static void
-IntDefaultHandler(void)
-{
-    //
-    // Go into an infinite loop.
-    //
-    while(1)
-    {
-    }
-}