WIP for read_line slow

WIP for read_line slow

--- runtime.c
+++ runtime.c
@@ -7890,13 +7890,14 @@
 /* TODO: this function needs some work, but approximates what is needed */
 object Cyc_io_read_line(void *data, object cont, object port)
 {
-  FILE *stream = ((port_type *) port)->fp;
+  FILE *stream;
   char buf[1027];
   int len, num_cp, i = 0;
   char_type codepoint;
   uint32_t state;

   Cyc_check_port(data, port);
+  stream = ((port_type *) port)->fp;
   if (stream == NULL) {
     Cyc_rt_raise2(data, "Unable to read from closed port: ", port);
   }
@@ -7942,34 +7943,96 @@
   return NULL;
 }

-/*
-char *fgets_port(char *buf, int size, port_type *p)
-{
-  // TODO: keep reading until fgets conditions are true
-  // also ensure we read a full code point for the last char
-  do {
-    _read_next_char(data, NULL, p);
-    c = p->mem_buf[p->buf_idx++];
-    if (c == EOF) break;
-  } while(Cyc_utf8_decode(&state, &codepoint, (uint8_t)c));
-}
-*/
-
 // WIP - a version of read_line that uses our internal port buffer.
 // This will be compatible with other I/O function such as read-char
+//
+// TODO: instead of fgets, read up to 1023 chars from our port buffer. per fgets,
+// we stop when either (n-1) characters are read, the newline character is read,
+// or the end-of-file is reached, whichever comes first
+//
+// other difference is we read one char at a time until final code point is completely read
+//
+// development in 2 phases:
+// 1) build out so we can replace Cyc_io_read_line with this "slow" version, verifying everything works
+// 2) integrate slow back into fast such that we can revert to this function if
+//    the buffer contains chars, else we use the fast read_line function
+/*
 object Cyc_io_read_line_slow(void *data, object cont, object port)
 {
-  // TODO: instead of fgets, read up to 1023 chars from our port buffer. per fgets,
-  // we stop when either (n-1) characters are read, the newline character is read,
-  // or the end-of-file is reached, whichever comes first
-  //
-  // other difference is we read one char at a time until final code point is completely read
-  //
-  // development in 2 phases:
-  // 1) build out so we can replace Cyc_io_read_line with this "slow" version, verifying everything works
-  // 2) integrate slow back into fast such that we can revert to this function if
-  //    the buffer contains chars, else we use the fast read_line function
-}
+  FILE *stream;
+  port_type *p;
+  char buf[1027];
+  int i, limit = 1024; // Ensure last code point is fully-read
+
+  Cyc_check_port(data, port);
+  stream = ((port_type *) port)->fp;
+  if (stream == NULL) {
+    Cyc_rt_raise2(data, "Unable to read from closed port: ", port);
+  }
+  set_thread_blocked(data, cont);
+
+  p = (port_type *)port;
+  for (i = 0; i < limit; i++) {
+    //_read_next_char(data, NULL, p);
+    if (p->mem_buf_len == 0 || p->mem_buf_len == p->buf_idx) {
+      int rv = read_from_port(p);
+      if (!rv) {
+        if (i == 0) {
+          return_thread_runnable_with_obj(data, Cyc_EOF, p);
+        } else {
+          break; // Handle buf contents below
+        }
+      }
+    }
+    buf[i] = p->mem_buf[p->buf_idx++];
+    if (buf[i] == EOF) {
+      if (i == 0) {
+        return_thread_runnable_with_obj(data, Cyc_EOF, p);
+      } else {
+        break; // Handle buf contents below
+      }
+    }
+    if (buf[i] == '\n') {
+      break;
+    }
+  }
+
+  // ensure we fully-read last code point
+  {
+    int c, len, num_cp, ii = 0;
+    char_type codepoint;
+    uint32_t state;
+
+    state = Cyc_utf8_count_code_points_and_bytes((uint8_t *)buf, &codepoint, &num_cp, &len);
+    while (state != CYC_UTF8_ACCEPT && ii < 3) {
+      if (p->mem_buf_len == 0 || p->mem_buf_len == p->buf_idx) {
+        int rv = read_from_port(p);
+        if (!rv) {
+          break; // At EOF, return what we've got so far
+          // TODO: likely better to fall back to last fully-read codepoint.
+          //       in that case we might still return EOF
+        }
+      }
+      c = p->mem_buf[p->buf_idx++];
+
+      buf[len] = c;
+      len++;
+      Cyc_utf8_decode(&state, &codepoint, (uint8_t)c);
+      if (state == CYC_UTF8_ACCEPT) {
+        num_cp++;
+        break;
+      }
+      ii++;
+    }
+
+      // TODO: code section from read_line to
+      //
+      // Remove any trailing CR / newline chars
+      //
+      // this also returns the string to thread cont
+  }
+}
+*/

 /**
  * @brief Read next token from the input port.


ACPICA: Tables: Add full support for the DBG2 table.

Updates the DBG2 (Debug Port 2) table definition in the actbl2.h header.

Signed-off-by: Bob Moore <861d61e839a6c9cacf88c3a26b10371d2c9b211f@intel.com>
Signed-off-by: Lv Zheng <687b611ec106f085ac3db1fd0c8e91dc3509d58c@intel.com>
Signed-off-by: Rafael J. Wysocki <27ffc44a8ec6a212fba98cfc3246c6ce8ab131e0@intel.com>

--- include/acpi/actbl2.h
+++ include/acpi/actbl2.h
@@ -327,6 +327,11 @@
 	u32 info_count;
 };

+struct acpi_dbg2_header {
+	u32 info_offset;
+	u32 info_count;
+};
+
 /* Debug Device Information Subtable */

 struct acpi_dbg2_device {


Prefer 'this->f (...)' over 'BaseClass::f (...)' call style

--- software/src/master/src/kernel/Vxa_VCallAgent.h
+++ software/src/master/src/kernel/Vxa_VCallAgent.h
@@ -139,11 +139,11 @@
 	//  Callbacks
 	private:
 	    virtual bool createFromIntegers (i32_array_t const &rValues, VCallAgent *pAgent) OVERRIDE {
-		BaseClass::setResultTo (new VBooleanParameter<i32_array_t> (BaseClass::type (), rValues, pAgent->taskCursor ()));
+		this->setResultTo (new VBooleanParameter<i32_array_t> (this->type (), rValues, pAgent->taskCursor ()));
 		return true;
 	    }
 	    virtual bool createFromDoubles (f64_array_t const &rValues, VCallAgent *pAgent) OVERRIDE {
-		BaseClass::setResultTo (new VBooleanParameter<f64_array_t> (BaseClass::type (), rValues, pAgent->taskCursor ()));
+		this->setResultTo (new VBooleanParameter<f64_array_t> (this->type (), rValues, pAgent->taskCursor ()));
 		return true;
 	    }
 	};
@@ -171,11 +171,11 @@
 	//  Callbacks
 	private:
 	    virtual bool createFromIntegers (i32_array_t const &rValues, VCallAgent *pAgent) OVERRIDE {
-		BaseClass::setResultTo (new VParameter<scalar_return_t,i32_array_t> (BaseClass::type (), rValues, pAgent->taskCursor ()));
+		this->setResultTo (new VParameter<scalar_return_t,i32_array_t> (this->type (), rValues, pAgent->taskCursor ()));
 		return true;
 	    }
 	    virtual bool createFromDoubles (f64_array_t const &rValues, VCallAgent *pAgent) OVERRIDE {
-		BaseClass::setResultTo (new VParameter<scalar_return_t,f64_array_t> (BaseClass::type (), rValues, pAgent->taskCursor ()));
+		this->setResultTo (new VParameter<scalar_return_t,f64_array_t> (this->type (), rValues, pAgent->taskCursor ()));
 		return true;
 	    }
 	};
@@ -203,7 +203,7 @@
 	//  Callbacks
 	private:
 	    virtual bool createFromStrings (str_array_t const &rValues, VCallAgent *pAgent) OVERRIDE {
-		BaseClass::setResultTo (new VParameter<scalar_return_t,str_array_t> (BaseClass::type (), rValues, pAgent->taskCursor ()));
+		this->setResultTo (new VParameter<scalar_return_t,str_array_t> (this->type (), rValues, pAgent->taskCursor ()));
 		return true;
 	    }
 	};


switch cachefiles to kern_path()

switch cachefiles to kern_path()

Signed-off-by: Al Viro <de609eb4d5d70b1d38ec6642adbfc33a2781f63c@zeniv.linux.org.uk>

--- fs/cachefiles/bind.c
+++ fs/cachefiles/bind.c
@@ -84,7 +84,7 @@
 static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache)
 {
 	struct cachefiles_object *fsdef;
-	struct nameidata nd;
+	struct path path;
 	struct kstatfs stats;
 	struct dentry *graveyard, *cachedir, *root;
 	const struct cred *saved_cred;
@@ -114,15 +114,12 @@
 	_debug("- fsdef %p", fsdef);

 	/* look up the directory at the root of the cache */
-	memset(&nd, 0, sizeof(nd));
-
-	ret = path_lookup(cache->rootdirname, LOOKUP_DIRECTORY, &nd);
+	ret = kern_path(cache->rootdirname, LOOKUP_DIRECTORY, &path);
 	if (ret < 0)
 		goto error_open_root;

-	cache->mnt = mntget(nd.path.mnt);
-	root = dget(nd.path.dentry);
-	path_put(&nd.path);
+	cache->mnt = path.mnt;
+	root = path.dentry;

 	/* check parameters */
 	ret = -EOPNOTSUPP;


tests/dbus/call-cancellation: don't leak the proxy 'k'

Also, explicitly clear all the pointers so valgrind can give us better
diagnostics about reachability.

--- tests/dbus/call-cancellation.c
+++ tests/dbus/call-cancellation.c
@@ -438,16 +438,25 @@

   g_message ("Dereferencing remaining proxies");
   g_object_unref (a);
+  a = NULL;
   g_object_unref (b);
+  b = NULL;
   g_object_unref (c);
+  c = NULL;
   MYASSERT (d == NULL, "");
   g_object_unref (e);
+  e = NULL;
   g_object_unref (f);
+  f = NULL;
   MYASSERT (g == NULL, "");
   MYASSERT (h == NULL, "");
   MYASSERT (i == NULL, "");
   g_object_unref (j);
+  j = NULL;
+  g_object_unref (k);
+  k = NULL;
   g_object_unref (z);
+  z = NULL;

   /* we should already have checked each of these at least once, but just to
    * make sure we have a systematic test that all user data is freed... */


  * Added test code of the <a href> attribute 5 for au XHTML converter.

git-svn-id: 49a49bb4ff02f9bc3831727c456f68bda596f146@2144 1a406e8e-add9-4483-a2c8-d8cac5b7c224

--- test/chxj_xhtml_mobile_1_0/test_chxj_xhtml_mobile_1_0.c
+++ test/chxj_xhtml_mobile_1_0/test_chxj_xhtml_mobile_1_0.c
@@ -466,8 +466,8 @@
   CU_add_test(xhtml_suite, "test a tag href attr2 with other site link.",       test_xhtml_a_tag_href_attribute_002);
   CU_add_test(xhtml_suite, "test a tag href attr3 with local link.",            test_xhtml_a_tag_href_attribute_003);
   CU_add_test(xhtml_suite, "test a tag href attr4 with maker.",                 test_xhtml_a_tag_href_attribute_004);
+  CU_add_test(xhtml_suite, "test a tag href attr5 with void maker.",            test_xhtml_a_tag_href_attribute_005);
 #if 0
-  CU_add_test(xhtml_suite, "test a tag href attr5 with void maker.",            test_xhtml_a_tag_href_attribute_005);
   CU_add_test(xhtml_suite, "test a tag href attr6 with no cookie.",             test_xhtml_a_tag_href_attribute_006);
   CU_add_test(xhtml_suite, "test a tag accesskey attribute.",                   test_xhtml_a_tag_accesskey_attribute_001);
   CU_add_test(xhtml_suite, "test a tag accesskey attribute with void char.",    test_xhtml_a_tag_accesskey_attribute_002);
@@ -1261,24 +1261,25 @@
 }
 void test_xhtml_a_tag_href_attribute_005()
 {
-#define  TEST_STRING "abc"
-#define  RESULT_STRING "abc"
-  char  *ret;
-  char  *tmp;
-  device_table spec;
-  chxjconvrule_entry entry;
-  cookie_t cookie;
-  apr_size_t destlen;
-  APR_INIT;
-
-  COOKIE_INIT(cookie);
-
-  SPEC_INIT(spec);
-  destlen = sizeof(TEST_STRING)-1;
-
-  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
-  ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
-  ret = chxj_rencoding(&r, ret, &destlen);
+#define  TEST_STRING "abc"
+#define  RESULT_STRING "abc"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);


spiv: Fix -t for zip container.

spiv: Fix -t for zip container.

Signed-off-by: Cyril Hrubis <b1e90efd3b808b8e0bcf2a9a55fd8b9a779bfd81@ucw.cz>

--- demos/spiv/image_loader.c
+++ demos/spiv/image_loader.c
@@ -67,7 +67,9 @@
 		return cur_img;

 	if (cur_cont) {
+		cpu_timer_start(&timer, "Loading");
 		cur_img = GP_ContainerLoad(cur_cont, callback);
+		cpu_timer_stop(&timer);
 		return cur_img;
 	}

@@ -97,6 +99,7 @@

 			if (img) {
 				cur_img = img;
+				cpu_timer_stop(&timer);
 				return img;
 			}


Avoid usage of global variables with open_tty()

Signed-off-by: Johnothan King <a8ddc7217a18e572ca3c72013b682efc8914e2df@protonmail.com>

--- cmd/init.c
+++ cmd/init.c
@@ -30,7 +30,6 @@
 static unsigned int single_user = 1;
 static unsigned int zstatus     = 0;
 static int current_signal       = 0;
-static int tty_fd               = 0;

 // Shows usage for init
 static int usage(void)
@@ -59,20 +58,18 @@
 }

 // Open the tty
-static void open_tty(unsigned int reopen)
-{
-	if(reopen == 0) {
-		close(tty_fd);
-#		ifdef FreeBSD
-		revoke(CONSOLE);
-#		endif
-	}
-	tty_fd = open(CONSOLE, O_RDWR | O_NOCTTY);
-	login_tty(tty_fd);
-	dup2(tty_fd, STDIN_FILENO);
-	dup2(tty_fd, STDOUT_FILENO);
-	dup2(tty_fd, STDERR_FILENO);
-	ioctl(tty_fd, TIOCSCTTY, 1);
+static int open_tty(void)
+{
+#	ifdef FreeBSD
+	revoke(CONSOLE);
+#	endif
+	int tty = open(CONSOLE, O_RDWR | O_NOCTTY);
+	login_tty(tty);
+	dup2(tty, STDIN_FILENO);
+	dup2(tty, STDOUT_FILENO);
+	dup2(tty, STDERR_FILENO);
+	ioctl(tty, TIOCSCTTY, 1);
+	return tty;
 }

 // Single user mode
@@ -103,7 +100,7 @@

 	// Fork the shell into a seperate process
 	if(fork() == 0) {
-		open_tty(1);
+		open_tty();
 		execl(shell, shell, NULL);
 	}
 }
@@ -169,7 +166,7 @@
 	if(getpid() == 1) {

 		// Open the console
-		open_tty(1);
+		int tty = open_tty();

 		// Login as root
 		setenv("HOME",    "/root", 1);
@@ -247,7 +244,8 @@
 				pthread_mutex_destroy(&mutex);

 				// Reopen the console
-				open_tty(0);
+				close(tty);
+				tty = open_tty();

 				// Synchronize file systems again (Pass 2)
 				printf(CYAN "* " WHITE "Synchronizing all file systems (Pass 2)..." RESET "\n");


Issue #211 - Initial char-ready implementation

--- runtime.c
+++ runtime.c
@@ -7725,6 +7725,39 @@
   }
 }

+object Cyc_io_char_ready(void *data, object port)
+{
+  FILE *stream;
+  port_type *p;
+
+  Cyc_check_port(data, port);
+  {
+    p = (port_type *)port;
+    stream = ((port_type *) port)->fp;
+    if (stream == NULL) {
+      Cyc_rt_raise2(data, "Unable to read from closed port: ", port);
+    }
+
+// TODO: this may be linux-specific
+// TODO: what about EOF?
+    if (p->mem_buf_len == 0 || p->mem_buf_len == p->buf_idx) {
+      // TODO: slow path, does stream have data ready?
+      int fd = fileno(stream);
+      fd_set rfds;
+      struct timeval tv;
+      int retval;
+      FD_ZERO(&rfds);
+      FD_SET(fd, &rfds);
+      tv.tv_sec = 0;
+      tv.tv_usec = 0;
+      retval = select(fd + 1, &rfds, NULL, NULL, &tv);
+      return (retval ? boolean_t : boolean_f);
+    } else {
+      return boolean_t;
+    }
+  }
+}
+
 /**
  * @brief Helper macro for Cyc_io_read_token
  */


btr0sea.c:
  Eliminate a gcc compiler bug in inlining

innobase/btr/btr0sea.c:
  Eliminate a gcc compiler bug in inlining

--- innobase/btr/btr0sea.c
+++ innobase/btr/btr0sea.c
@@ -452,7 +452,7 @@
 Checks if a guessed position for a tree cursor is right. Note that if
 mode is PAGE_CUR_LE, which is used in inserts, and the function returns
 TRUE, then cursor->up_match and cursor->low_match both have sensible values. */
-UNIV_INLINE
+static
 ibool
 btr_search_check_guess(
 /*===================*/


[PATCH] fs/hugetlbfs/inode.c: make a function static

This patch makes a needlessly global function static.

Signed-off-by: Adrian Bunk <0b86548ef377da0031a3ff3f0c4e06f016e20105@stusta.de>
Acked-by: William Irwin <a0134a7425f8f4963a56bfd98976a997d2d582b9@holomorphy.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- fs/hugetlbfs/inode.c
+++ fs/hugetlbfs/inode.c
@@ -63,7 +63,7 @@
  *
  * Result is in bytes to be compatible with is_hugepage_mem_enough()
  */
-unsigned long
+static unsigned long
 huge_pages_needed(struct address_space *mapping, struct vm_area_struct *vma)
 {
 	int i;


修复一些TCP数据包路由的错误

修复一些TCP数据包路由的错误

--- loader/driver/filter.c
+++ loader/driver/filter.c
@@ -2170,8 +2170,10 @@
 	case IM_IPV4:
 		//ptcp_header = (PTCP_HDR)((PUCHAR)pIPHeader + sizeof(IPV4_HEADER));
 		ptcp_header = (PTCP_HDR)((PUCHAR)pIPHeader + Ip4HeaderLengthInBytes((PIPV4_HEADER)pIPHeader));
+		break;
 	case IM_IPV6:
 		ptcp_header = (PTCP_HDR)((PUCHAR)pIPHeader + sizeof(IPV6_HEADER));
+		break;
 	default:
 		ASSERT(FALSE);
 		break;


XAIS-2678: Enable Rabid on XF3 .

XAIS-2678: Enable Rabid on XF3 .

Reason for change: This change is to enable Rabid
On XF3.

Test Procedure:
1. Enable Rabid

Risks: Low

Signed-off-by: Amit_Ghorpade@comcast.com
(cherry picked from commit a09f9ecf71aeb6acbf7b4acafe664ea260b67159)
(cherry picked from commit 8267db2c423f3a97177097460bc3ad6726d9a149)

Change-Id: I86ac99da8567e6cda328afc2e11a933e2488df6f

--- source/TR-181/middle_layer_src/cosa_rabid_dml.c
+++ source/TR-181/middle_layer_src/cosa_rabid_dml.c
@@ -76,13 +76,11 @@
     /* check the parameter name and return the corresponding value */
     PCOSA_DATAMODEL_RABID       pMyObject     = (PCOSA_DATAMODEL_RABID)g_pCosaBEManager->hRabid;

-#if !defined(_COSA_BCM_MIPS_)
     if( AnscEqualString(ParamName, "Enable", TRUE))
     {
         *pBool = pMyObject->bEnable;
         return TRUE;
     }
-#endif

     CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName));
     return FALSE;
@@ -132,7 +130,6 @@
     PCOSA_DATAMODEL_RABID       pMyObject     = (PCOSA_DATAMODEL_RABID)g_pCosaBEManager->hRabid;
     ANSC_STATUS  returnStatus = ANSC_STATUS_SUCCESS;

-#if !defined(_COSA_BCM_MIPS_)
     if( AnscEqualString(ParamName, "Enable", TRUE))
     {
         if(bValue == pMyObject->bEnable)
@@ -150,7 +147,6 @@

         return TRUE;
     }
-#endif

     CcspTraceWarning(("Unsupported parameter '%s'\n", ParamName));
     return FALSE;


  * Added test code of the <body> tag 4 for au XHTML converter.

git-svn-id: 49a49bb4ff02f9bc3831727c456f68bda596f146@2166 1a406e8e-add9-4483-a2c8-d8cac5b7c224

--- test/chxj_xhtml_mobile_1_0/test_chxj_xhtml_mobile_1_0.c
+++ test/chxj_xhtml_mobile_1_0/test_chxj_xhtml_mobile_1_0.c
@@ -486,8 +486,8 @@
   CU_add_test(xhtml_suite, "test  .",                                     test_xhtml_body_tag_001);
   CU_add_test(xhtml_suite, "test  with bgcolor attribute 1.",             test_xhtml_body_tag_002);
   CU_add_test(xhtml_suite, "test  with bgcolor attribute 2.",             test_xhtml_body_tag_003);
+  CU_add_test(xhtml_suite, "test  with bgcolor attribute 3.",             test_xhtml_body_tag_004);
 #if 0
-  CU_add_test(xhtml_suite, "test  with bgcolor attribute 3.",             test_xhtml_body_tag_004);
   CU_add_test(xhtml_suite, "test  with text attribute 1.",                test_xhtml_body_tag_005);
   CU_add_test(xhtml_suite, "test  with text attribute 2.",                test_xhtml_body_tag_006);
   CU_add_test(xhtml_suite, "test  with text attribute 3.",                test_xhtml_body_tag_007);
@@ -1723,6 +1723,7 @@
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -1751,6 +1752,36 @@
   tmp = chxj_encoding(&r, TEST_STRING, &destlen);
   ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
   ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_xhtml_body_tag_004()
+{
+#define  TEST_STRING ""
+#define  RESULT_STRING "\r\n\r\n"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
   CU_ASSERT(ret != NULL);
   CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
   CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
@@ -1760,34 +1791,6 @@
 #undef RESULT_STRING
 }
 /* KONNO */
-void test_xhtml_body_tag_004()
-{
-#define  TEST_STRING ""
-#define  RESULT_STRING ""
-  char  *ret;
-  char  *tmp;
-  device_table spec;
-  chxjconvrule_entry entry;
-  cookie_t cookie;
-  apr_size_t destlen;
-  APR_INIT;
-
-  COOKIE_INIT(cookie);
-
-  SPEC_INIT(spec);
-  destlen = sizeof(TEST_STRING)-1;
-
-  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
-  ret = chxj_exchange_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
-  ret = chxj_rencoding(&r, ret, &destlen);
-  CU_ASSERT(ret != NULL);
-  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
-  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
-
-  APR_TERM;
-#undef TEST_STRING
-#undef RESULT_STRING
-}
 void test_xhtml_body_tag_005()
 {
 #define  TEST_STRING ""


Slight improvement to the formatting of this section

Signed-off-by: Johnothan King <a8ddc7217a18e572ca3c72013b682efc8914e2df@protonmail.com>

--- cmd/init.c
+++ cmd/init.c
@@ -81,9 +81,9 @@
 	}

 	// Login as root
-	setenv("LOGNAME", "root", 1);
-	setenv("USER", "root", 1);
-	setenv("HOME", "/root", 1);
+	setenv("HOME",    "/root", 1);
+	setenv("LOGNAME", "root",  1);
+	setenv("USER",    "root",  1);

 	// Fork the shell into a seperate process
 	pid_t single = fork();


fsp0fsp.c	Fix a bug in freeing of a segment in the tablespace

innobase/fsp/fsp0fsp.c:
  Fix a bug in freeing of a segment in the tablespace

--- innobase/fsp/fsp0fsp.c
+++ innobase/fsp/fsp0fsp.c
@@ -127,11 +127,9 @@
 					page number within space, FIL_NULL
 					means that the slot is not in use */
 /*-------------------------------------*/
-#define FSEG_INODE_SIZE	(16 + 3 * FLST_BASE_NODE_SIZE +\
-				FSEG_FRAG_ARR_N_SLOTS * FSEG_FRAG_SLOT_SIZE)
-
-#define FSP_SEG_INODES_PER_PAGE	((UNIV_PAGE_SIZE - FSEG_ARR_OFFSET - 10)\
-				 / FSEG_INODE_SIZE)
+#define FSEG_INODE_SIZE	(16 + 3 * FLST_BASE_NODE_SIZE + FSEG_FRAG_ARR_N_SLOTS * FSEG_FRAG_SLOT_SIZE)
+
+#define FSP_SEG_INODES_PER_PAGE	((UNIV_PAGE_SIZE - FSEG_ARR_OFFSET - 10) / FSEG_INODE_SIZE)
 				/* Number of segment inodes which fit on a
 				single page */

@@ -198,8 +196,7 @@

 /* File extent data structure size in bytes. The "+ 7 ) / 8" part in the
 definition rounds the number of bytes upward. */
-#define	XDES_SIZE	(XDES_BITMAP +\
-			 (FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE + 7) / 8)
+#define	XDES_SIZE	(XDES_BITMAP + (FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE + 7) / 8)

 /* Offset of the descriptor array on a descriptor page */
 #define	XDES_ARR_OFFSET		(FSP_HEADER_OFFSET + FSP_HEADER_SIZE)
@@ -2633,6 +2630,14 @@
 							MTR_MEMO_X_LOCK));
 	mtr_x_lock(fil_space_get_latch(space), mtr);

+	descr = xdes_get_descriptor(space, buf_frame_get_page_no(header), mtr);
+
+	/* Check that the header resides on a page which has not been
+	freed yet */
+
+	ut_a(descr);
+	ut_a(xdes_get_bit(descr, XDES_FREE_BIT, buf_frame_get_page_no(header)
+					% FSP_EXTENT_SIZE, mtr) == FALSE);
 	inode = fseg_inode_get(header, mtr);

 	descr = fseg_get_first_extent(inode, mtr);
@@ -2647,7 +2652,6 @@
 	}

 	/* Free a frag page */
-
 	n = fseg_find_last_used_frag_page_slot(inode, mtr);

 	if (n == ULINT_UNDEFINED) {
@@ -2659,6 +2663,16 @@

 	fseg_free_page_low(inode, space,
 			fseg_get_nth_frag_page_no(inode, n, mtr), mtr);
+
+	n = fseg_find_last_used_frag_page_slot(inode, mtr);
+
+	if (n == ULINT_UNDEFINED) {
+		/* Freeing completed: free the segment inode */
+		fsp_free_seg_inode(space, inode, mtr);
+
+		return(TRUE);
+	}
+
 	return(FALSE);
 }


x86: __vdso_getcpu() warning fix

x86: __vdso_getcpu() warning fix

arch/x86/vdso/vgetcpu.c: In function '__vdso_getcpu':
arch/x86/vdso/vgetcpu.c:22: warning: pointer targets in passing argument 1 of 'native_read_tscp' differ in signedness

Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

--- include/asm-x86/msr.h
+++ include/asm-x86/msr.h
@@ -13,7 +13,7 @@
 #include <asm/asm.h>
 #include <asm/errno.h>

-static inline unsigned long long native_read_tscp(int *aux)
+static inline unsigned long long native_read_tscp(unsigned int *aux)
 {
 	unsigned long low, high;
 	asm volatile (".byte 0x0f,0x01,0xf9"


[PATCH] uclinux: fix proc_task()/get_proc-task() naming

Fix changed name of proc_task() to get_proc_task().

Signed-off-by: Greg Ungerer <ed22c22dbde360207569092e60b4298397efb8da@uclinux.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- fs/proc/task_nommu.c
+++ fs/proc/task_nommu.c
@@ -107,7 +107,7 @@
 {
 	struct vm_list_struct *vml;
 	struct vm_area_struct *vma;
-	struct task_struct *task = proc_task(inode);
+	struct task_struct *task = get_proc_task(inode);
 	struct mm_struct *mm = get_task_mm(task);
 	int result = -ENOENT;


Fix errors.

Fix errors.

git-svn-id: bd2008fbba0f7d30fd6598b54f2cd88503fdd2e4@1352 95f4ed2b-212e-0410-8b90-d31948207fce

--- src/nvtt/cuda/CudaMath.h
+++ src/nvtt/cuda/CudaMath.h
@@ -193,6 +193,11 @@
     return dot(a, a);
 }

+inline __device__ __host__ float lengthSquared(float2 a)
+{
+    return dot(a, a);
+}
+

 // Use power method to find the first eigenvector.
 // http://www.miislita.com/information-retrieval-tutorial/matrix-tutorial-3-eigenvalues-eigenvectors.html
@@ -335,8 +340,8 @@
 {
     // @@ 8 iterations is probably more than enough.

-    const float3 row0 = make_float2(matrix[0], matrix[1]);
-    const float3 row1 = make_float2(matrix[1], matrix[2]);
+    const float2 row0 = make_float2(matrix[0], matrix[1]);
+    const float2 row1 = make_float2(matrix[1], matrix[2]);

     float r0 = lengthSquared(row0);
     float r1 = lengthSquared(row1);


Oh, and this one too.

Oh, and this one too.

--- iodev/slowdown_timer.h
+++ iodev/slowdown_timer.h
@@ -1,7 +1,5 @@

 #ifdef BX_USE_SLOWDOWN_TIMER
-
-#define BX_HAVE_USLEEP 1

 class bx_slowdown_timer_c {


  * Added test code of the <dir type> attribute for au XHTML converter.

git-svn-id: 4ec3457f076cc669589aef85c1dfbed86f312c92@2494 1a406e8e-add9-4483-a2c8-d8cac5b7c224

--- test/chxj_xhtml_mobile_1_0/test_chxj_xhtml_mobile_1_0.c
+++ test/chxj_xhtml_mobile_1_0/test_chxj_xhtml_mobile_1_0.c
@@ -94,6 +94,11 @@

 void test_xhtml_dir_tag_001();
 void test_xhtml_dir_tag_002();
+void test_xhtml_dir_tag_003();
+void test_xhtml_dir_tag_004();
+void test_xhtml_dir_tag_005();
+void test_xhtml_dir_tag_006();
+void test_xhtml_dir_tag_007();

 void test_xhtml_dl_tag_001();

@@ -528,6 +533,11 @@

   CU_add_test(xhtml_suite, "test <dir>.",                                       test_xhtml_dir_tag_001);
   CU_add_test(xhtml_suite, "test <dir> with no <li>.",                          test_xhtml_dir_tag_002);
+  CU_add_test(xhtml_suite, "test <dir type> 1.",                                test_xhtml_dir_tag_003);
+  CU_add_test(xhtml_suite, "test <dir type> 2.",                                test_xhtml_dir_tag_004);
+  CU_add_test(xhtml_suite, "test <dir type> 3.",                                test_xhtml_dir_tag_005);
+  CU_add_test(xhtml_suite, "test <dir type> 4.",                                test_xhtml_dir_tag_006);
+  CU_add_test(xhtml_suite, "test <dir type> 5.",                                test_xhtml_dir_tag_007);

   CU_add_test(xhtml_suite, "test <dl>.",                                        test_xhtml_dl_tag_001);

@@ -2523,6 +2533,152 @@
 #undef TEST_STRING
 #undef RESULT_STRING
 }
+/* 'disc'|'circle'|'square' */
+void test_xhtml_dir_tag_003()
+{
+#define  TEST_STRING "<dir type=\"disc\"></dir>"
+#define  RESULT_STRING "<dir type=\"disc\"></dir>"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_xhtml_dir_tag_004()
+{
+#define  TEST_STRING "<dir type=\"circle\"></dir>"
+#define  RESULT_STRING "<dir type=\"circle\"></dir>"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_xhtml_dir_tag_005()
+{
+#define  TEST_STRING "<dir type=\"square\"></dir>"
+#define  RESULT_STRING "<dir type=\"square\"></dir>"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_xhtml_dir_tag_006()
+{
+#define  TEST_STRING "<dir type=\"\"></dir>"
+#define  RESULT_STRING "<dir></dir>"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
+void test_xhtml_dir_tag_007()
+{
+#define  TEST_STRING "<dir type></dir>"
+#define  RESULT_STRING "<dir></dir>"
+  char  *ret;
+  char  *tmp;
+  device_table spec;
+  chxjconvrule_entry entry;
+  cookie_t cookie;
+  apr_size_t destlen;
+  APR_INIT;
+
+  COOKIE_INIT(cookie);
+
+  SPEC_INIT(spec);
+  destlen = sizeof(TEST_STRING)-1;
+
+  tmp = chxj_encoding(&r, TEST_STRING, &destlen);
+  ret = chxj_convert_xhtml_mobile_1_0(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
+  ret = chxj_rencoding(&r, ret, &destlen);
+  fprintf(stderr, "ret=[%s]",ret);
+  CU_ASSERT(ret != NULL);
+  CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
+  CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);
+
+  APR_TERM;
+#undef TEST_STRING
+#undef RESULT_STRING
+}
 /*============================================================================*/
 /* <DL>                                                                       */
 /*============================================================================*/


row0sel.c:
  Fix bug number 154: GROUP BY and DISTINCT could treat NULL values inequal

innobase/row/row0sel.c:
  Fix bug number 154: GROUP BY and DISTINCT could treat NULL values inequal

--- innobase/row/row0sel.c
+++ innobase/row/row0sel.c
@@ -2115,19 +2115,14 @@
 				extern_field_heap = NULL;
  			}
 		} else {
-			/* MySQL sometimes seems to copy the 'data'
-			pointed to by a BLOB field even if the field
-			has been marked to contain the SQL NULL value.
-			This caused seg faults reported by two users.
-			Set the BLOB length to 0 and the data pointer
-			to NULL to avoid a seg fault. */
-
-			if (templ->type == DATA_BLOB) {
-				row_sel_field_store_in_mysql_format(
-				mysql_rec + templ->mysql_col_offset,
-				templ->mysql_col_len, NULL,
-				0, templ->type, templ->is_unsigned);
-			}
+		        /* MySQL seems to assume the field for an SQL NULL
+		        value is set to zero. Not taking this into account
+		        caused seg faults with NULL BLOB fields, and
+		        bug number 154 in the MySQL bug database: GROUP BY
+		        and DISTINCT could treat NULL values inequal. */
+
+		        memset(mysql_rec + templ->mysql_col_offset, '\0',
+			       templ->mysql_col_len);

 			if (!templ->mysql_null_bit_mask) {
 				fprintf(stderr,


x86: get_cycles() fix

x86: get_cycles() fix

Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

--- include/asm-x86/tsc.h
+++ include/asm-x86/tsc.h
@@ -27,10 +27,8 @@
 	if (!cpu_has_tsc)
 		return 0;
 #endif
+	rdtscll(ret);

-#if defined(CONFIG_X86_GENERIC) || defined(CONFIG_X86_TSC)
-	rdtscll(ret);
-#endif
 	return ret;
 }


Create fsm_tool_simulator.c

Create fsm_tool_simulator.c

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

--- fsm_tool_simulator.c
+++ fsm_tool_simulator.c
@@ -0,0 +1,61 @@
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <ctype.h>
+#ifndef WIN32
+#include "ttypes.h"
+#endif
+#include "fsm_example.h"
+
+void FsmTrace(char* buf, int len);
+int  MlnxTmUnsched(void ** timer_handler);
+int  MLnxTmSched(int theTimeout, void *data, void ** timer_handler);
+
+void FsmTrace(char* buf, int len)
+{
+   printf("%s",buf);
+}
+
+int MlnxTmUnsched(void ** timer_handler)
+{
+	return 1;
+}
+
+int MLnxTmSched(int theTimeout, void *data, void ** timer_handler)
+{
+	return 1;
+}
+
+int main(void)
+{
+	int err = 0;
+	lag_fsm *pFsm = (lag_fsm *)malloc(sizeof(lag_fsm));
+
+	printf("********** Start FSM Simulator ************\n");
+
+	if (!pFsm) {
+		return err;
+	}
+
+	pFsm->base.fsm_type = 2;
+    err = lag_fsm_init (pFsm, FsmTrace, MLnxTmSched, MlnxTmUnsched);
+
+    lag_fsm_start_ev    (pFsm);
+	lag_fsm_start_ev    (pFsm);
+	lag_fsm_admin_on_ev  (pFsm);
+	lag_fsm_admin_off_ev (pFsm);
+	lag_fsm_admin_on_ev  (pFsm);
+	lag_fsm_lacp_up_ev   (pFsm,0);
+
+	lag_fsm_port_down_ev (pFsm);
+	lag_fsm_port_up_ev   (pFsm,1,0);
+	lag_fsm_lacp_up_ev   (pFsm,0);
+	lag_fsm_mismatch_ev (pFsm,0);
+
+	lag_fsm_lacp_down_ev (pFsm,0);
+	lag_fsm_port_up_ev   (pFsm,1,0);
+	fsm_timer_trigger_operation(&pFsm->base, 4);
+	getchar();
+	return err;
+}


Cleanup.

Cleanup.

--- include/bx/platform.h
+++ include/bx/platform.h
@@ -72,7 +72,7 @@
 #	elif defined(__MINGW32__) || defined(__MINGW64__)
 #		undef  BX_CRT_MINGW
 #		define BX_CRT_MINGW 1
-#	elif defined(__apple_build_version__) || defined(__ANDROID__)
+#	elif defined(__apple_build_version__) || defined(__ANDROID__) || defined(__ORBIS__)
 #		undef  BX_CRT_LIBCXX
 #		define BX_CRT_LIBCXX 1
 #	endif //


Fix return documentation for SkFont::measureText.

There seems to be a copy-paste issue with the documentation for the
return value of SkFont::countText. SkFont::countText returns the number
of glyphs, measureText returns the sum of the default advances.

Change-Id: Id3c9008c20e7b4b8ad4f1d834df19183a9b2bf1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/530046
Reviewed-by: Derek Sollenberger <d9b232705cad36bae5cfccf14f9650bb292e6c71@google.com>
Commit-Queue: Ben Wagner <53965154ffeecc4a10886eab9259e95965f2979a@google.com>

--- include/core/SkFont.h
+++ include/core/SkFont.h
@@ -331,7 +331,7 @@
         @param text        character storage encoded with SkTextEncoding
         @param byteLength  length of character storage in bytes
         @param bounds      returns bounding box relative to (0, 0) if not nullptr
-        @return            number of glyphs represented by text of length byteLength
+        @return            the sum of the default advance widths
     */
     SkScalar measureText(const void* text, size_t byteLength, SkTextEncoding encoding,
                          SkRect* bounds = nullptr) const {
@@ -347,7 +347,7 @@
         @param byteLength  length of character storage in bytes
         @param bounds      returns bounding box relative to (0, 0) if not nullptr
         @param paint       optional; may be nullptr
-        @return            number of glyphs represented by text of length byteLength
+        @return            the sum of the default advance widths
     */
     SkScalar measureText(const void* text, size_t byteLength, SkTextEncoding encoding,
                          SkRect* bounds, const SkPaint* paint) const;


corrected max for get interval

corrected max for get interval

--- include/cubicspline.h
+++ include/cubicspline.h
@@ -174,18 +174,19 @@
 inline double CubicSpline::Calculate(const double &r)
 {
     int n = _f.size()/2;
-    return -A(r)*_f[getInterval(r)] - B(r)*_f[getInterval(r) + 1] - C(r)*_f[n + getInterval(r)] - D(r)*_f[n + getInterval(r) + 1];
+    int interval =  getInterval(r);
+    return  -A(r)*_f[interval]
+            - B(r)*_f[interval + 1]
+            - C(r)*_f[n + interval]
+            - D(r)*_f[n + interval + 1];
 }

 template<typename vector_type1, typename vector_type2>
 inline void CubicSpline::Calculate(vector_type1 &x, vector_type2 &y)
 {
     int n = _r.size();
-    for(int i=0; i<x.size(); ++i)
-        y(i) =  - A(x(i))*_f[getInterval(x(i))]
-                - B(x(i))*_f[getInterval(x(i)) + 1]
-                - C(x(i))*_f[n + getInterval(x(i))]
-                - D(x(i))*_f[n + getInterval(x(i)) + 1];
+    for(int i=0; i<x.size(); ++i)
+        y(i) = Calculate(x(i));
 }

 inline void CubicSpline::Print(std::ostream &out, double interval)
@@ -285,7 +286,7 @@
 inline int CubicSpline::getInterval(const double &r)
 {
     if (r < _r[0]) return 0;
-    if(r > _r[_r.size() - 1]) return _r.size()-1;
+    if(r > _r[_r.size() - 2]) return _r.size()-2;
     int i;
     for(i=0; i<_r.size(); ++i)
         if(_r[i]>r) break;


Fix of the typo.

Fix of the typo.

--- include/ft/sock/uni.h
+++ include/ft/sock/uni.h
@@ -9,7 +9,7 @@
 };

-void ft_uni_socket_fini(union ft_uni_socket * this)
+static inline void ft_uni_socket_fini(union ft_uni_socket * this)
 {
 	assert(this != NULL);
 	if (this->socket_base.clazz == ft_dgram_class)


Redefined FS_SOUND_DEVICE_INFO_NAME_LENGTH to 96 (instead of 256).

--- include/fusionsound.h
+++ include/fusionsound.h
@@ -152,7 +152,7 @@
      char license[FS_SOUND_DRIVER_INFO_LICENSE_LENGTH]; /* Driver license. */
 } FSSoundDriverInfo;

-#define FS_SOUND_DEVICE_INFO_NAME_LENGTH    256
+#define FS_SOUND_DEVICE_INFO_NAME_LENGTH    96

 /*
  * Description of the sound device.


Revisited design t+

Revisited design t+

--- include/genericHash.h
+++ include/genericHash.h
@@ -94,18 +94,22 @@
 #define _GENERICHASH_COPY(hashName, userDatavp, keyType, keyVal, keyValCopy, valType, valVal, valValCopy) do { \
 									\
     if ((GENERICSTACKITEMTYPE_##keyType == GENERICSTACKITEMTYPE_PTR) && (hashName->keyCopyFunctionp != NULL)) { \
-      keyValCopy = hashName->keyCopyFunctionp((void *) userDatavp, (void *) &keyVal); \
-      if ((keyVal != NULL) && (keyValCopy == NULL)) {                   \
+      void *_p = hashName->keyCopyFunctionp((void *) userDatavp, (void *) &keyVal); \
+      if (((void *) keyVal != NULL) && (_p == NULL)) {                  \
 	hashName->error = 1;						\
-      }									\
+      } else {                                                          \
+        keyValCopy = (GENERICSTACKITEMTYPE2TYPE_##keyType) _p;          \
+      }                                                                 \
     } else {								\
       keyValCopy = keyVal;						\
     }									\
     if ((GENERICSTACKITEMTYPE_##valType == GENERICSTACKITEMTYPE_PTR) && (hashName->valCopyFunctionp != NULL)) { \
-      valValCopy = hashName->valCopyFunctionp((void *) userDatavp, (void *) &valVal); \
-      if ((valVal != NULL) && (valValCopy == NULL)) {                   \
+      void *_p = hashName->valCopyFunctionp((void *) userDatavp, (void *) &valVal); \
+      if (((void *) valVal != NULL) && (_p == NULL)) {                  \
 	hashName->error = 1;						\
-      }									\
+      } else {                                                          \
+        valValCopy = (GENERICSTACKITEMTYPE2TYPE_##valType) _p;          \
+      }                                                                 \
     } else {								\
       valValCopy = valVal;						\
     }									\
@@ -114,15 +118,15 @@
 /* ====================================================================== */
 /* Push internal variables in the hash                                    */
 /* ====================================================================== */
-#define _GENERICHASH_PUSH(hashName, userDatavp, keyType, keyVal, valType, valVal) do { \
+#define _GENERICHASH_PUSH(hashName, userDatavp, keyType, keyVal, valType, valVal, subKeyStackp, subValStackp) do { \
     GENERICSTACKITEMTYPE2TYPE_##keyType _keyValCopy;			\
     GENERICSTACKITEMTYPE2TYPE_##valType _valValCopy;			\
 									\
     _GENERICHASH_COPY(hashName, userDatavp, keyType, keyVal, _keyValCopy, valType, valVal, _valValCopy); \
     if (hashName->error == 0) {						\
-      GENERICSTACK_PUSH_##keyType(_subKeyStackp, _keyValCopy);		\
-      GENERICSTACK_PUSH_##valType(_subValStackp, _valValCopy);		\
-      if (GENERICSTACK_ERROR(_subKeyStackp) || GENERICSTACK_ERROR(_subValStackp)) { \
+      GENERICSTACK_PUSH_##keyType(subKeyStackp, _keyValCopy);		\
+      GENERICSTACK_PUSH_##valType(subValStackp, _valValCopy);		\
+      if (GENERICSTACK_ERROR(subKeyStackp) || GENERICSTACK_ERROR(subValStackp)) { \
 	hashName->error = 1;						\
       }									\
     }									\
@@ -131,15 +135,15 @@
 /* ====================================================================== */
 /* Set internal variables in the hash                                     */
 /* ====================================================================== */
-#define _GENERICHASH_SET(hashName, userDatavp, keyType, keyVal, valType, valVal, index) do { \
+#define _GENERICHASH_SET(hashName, userDatavp, keyType, keyVal, valType, valVal, subKeyStackp, subValStackp, index) do { \
     GENERICSTACKITEMTYPE2TYPE_##keyType _keyValCopy;			\
     GENERICSTACKITEMTYPE2TYPE_##valType _valValCopy;			\
 									\
     _GENERICHASH_COPY(hashName, userDatavp, keyType, keyVal, _keyValCopy, valType, valVal, _valValCopy); \
     if (hashName->error == 0) {						\
-      GENERICSTACK_SET_##keyType(_subKeyStackp, _keyValCopy, index);	\
-      GENERICSTACK_SET_##valType(_subValStackp, _valValCopy, index);	\
-      if (GENERICSTACK_ERROR(_subKeyStackp) || GENERICSTACK_ERROR(_subValStackp)) { \
+      GENERICSTACK_SET_##keyType(subKeyStackp, _keyValCopy, index);	\
+      GENERICSTACK_SET_##valType(subValStackp, _valValCopy, index);	\
+      if (GENERICSTACK_ERROR(subKeyStackp) || GENERICSTACK_ERROR(subValStackp)) { \
 	hashName->error = 1;						\
       }									\
     }									\
@@ -187,7 +191,7 @@
 	    GENERICSTACK_SET_NA(hashName->valStackp, subStackIndex);	\
 	    hashName->error = 1;					\
 	  } else {							\
-	    _GENERICHASH_PUSH(hashName, userDatavp, keyType, _keyVal, valType, _valVal); \
+	    _GENERICHASH_PUSH(hashName, userDatavp, keyType, _keyVal, valType, _valVal, _subKeyStackp, _subValStackp); \
 	  }								\
 	}								\
       } else {								\
@@ -227,11 +231,11 @@
 	      }								\
 	    }								\
 		    							\
-	    _GENERICHASH_SET(hashName, userDatavp, keyType, _keyVal, valType, _valVal, _i); \
+	    _GENERICHASH_SET(hashName, userDatavp, keyType, _keyVal, valType, _valVal, _subKeyStackp, _subValStackp, _i); \
 	    break;							\
 	  }								\
 	  if (_i >= _subStackused) {					\
-	    _GENERICHASH_PUSH(hashName, userDatavp, keyType, _keyVal, valType, _valVal); \
+	    _GENERICHASH_PUSH(hashName, userDatavp, keyType, _keyVal, valType, _valVal, _subKeyStackp, _subValStackp); \
 	  }								\
 	}								\
       }									\


Add init header file

Add init header file

error: pathspec 'include/kernel/init.h' did not match any file(s) known to git

--- include/kernel/init.h
+++ include/kernel/init.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2017 Jason Lu (PoisonNinja) and contributors
+ *
+ * This file is part of Strawberry. Strawberry is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation, version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 51
+ * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#pragma once
+
+typedef int (*initcall_t)(void);
+
+#define EARLY_INIT 1
+#define CORE_INIT 2
+#define ARCH_INIT 3
+#define SUBSYS_INIT 4
+#define FS_INIT 5
+#define DEVICE_INIT 6
+#define LATE_INIT 7
+
+// clang-format off
+#define __define_initcall(fn, id)   \
+    initcall_t __initcall_##id##fn  \
+        __attribute__((section(".initcall"#id), used)) = fn;
+// clang-format on
+
+#define EARLY_INITCALL(fn) __define_initcall(fn, 1)
+#define CORE_INITCALL(fn) __define_initcall(fn, 2)
+#define ARCH_INITCALL(fn) __define_initcall(fn, 3)
+#define SUBSYS_INITCALL(fn) __define_initcall(fn, 4)
+#define FS_INITCALL(fn) __define_initcall(fn, 5)
+#define DEVICE_INITCALL(fn) __define_initcall(fn, 6)
+#define LATE_INITCALL(fn) __define_initcall(fn, 7)
+
+extern void do_initcall(int);
+extern void setup_arch(void);


[PATCH] cdrom: use unsigned bitfields

[PATCH] cdrom: use unsigned bitfields

Fix 23 of these sparse warnings on x86_64 allmodconfig:
include/linux/cdrom.h:942:19: error: dubious bitfield without explicit
`signed' or `unsigned'

Signed-off-by: Randy Dunlap <e1d10faa7e2a0c027bf1ff1d20e7fd10154be7ea@oracle.com>
Cc: Jens Axboe <cd8c6775e60d6f67a6984377324e5290df3d5358@suse.de>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- include/linux/cdrom.h
+++ include/linux/cdrom.h
@@ -939,7 +939,7 @@
 	int speed;			/* maximum speed for reading data */
 	int capacity;			/* number of discs in jukebox */
 /* device-related storage */
-	int options		: 30;	/* options flags */
+	unsigned int options	: 30;	/* options flags */
 	unsigned mc_flags	: 2;	/* media change buffer flags */
     	int use_count;                  /* number of times device opened */
     	char name[20];                  /* name of the device type */


ktime: Use macro NSEC_PER_USEC where appropriate

We've got the macro NSEC_PER_USEC defined in header file
include/linux/time.h. To make the code decent, this patch
replaces the immediate number 1000 to convert bewteen a
time value in microseconds and one in nanoseconds with the
macro NSEC_PER_USEC.

Signed-off-by: Liu Ying <191e0e9d5f115a356402016ba9baf3cde5fcf568@freescale.com>
Cc: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
Cc: Daniel Borkmann <9ff04a02a69f376b2b9aeec27187017cbf3cf5f9@redhat.com>
Cc: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Cc: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>
Signed-off-by: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>

--- include/linux/ktime.h
+++ include/linux/ktime.h
@@ -229,7 +229,8 @@
 static inline ktime_t timeval_to_ktime(const struct timeval tv)
 {
 	return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec,
-				   .nsec = (s32)tv.tv_usec * 1000 } };
+				   .nsec = (s32)(tv.tv_usec *
+						 NSEC_PER_USEC) } };
 }

 /**
@@ -320,12 +321,12 @@

 static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec)
 {
-	return ktime_add_ns(kt, usec * 1000);
+	return ktime_add_ns(kt, usec * NSEC_PER_USEC);
 }

 static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
 {
-	return ktime_sub_ns(kt, usec * 1000);
+	return ktime_sub_ns(kt, usec * NSEC_PER_USEC);
 }

 extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);


Store tag separately, such that LEAV messages can be easily matched.

--- sql/src/backends/monet5/merovingian/merovingian.c
+++ sql/src/backends/monet5/merovingian/merovingian.c
@@ -1917,6 +1917,7 @@
 			/* ANNOUNCE message, register database */
 			char *sp = NULL;
 			char *dbname;
+			char *tag = NULL;
 			char *conn;
 			char *ttl;

@@ -1927,6 +1928,9 @@

 			if (dbname == NULL || conn == NULL || ttl == NULL)
 				continue;
+
+			if ((tag = strchr(dbname, '.')) != NULL)
+				*tag++ = '\0';

 			pthread_mutex_lock(&_mero_remotedb_lock);

@@ -1954,6 +1958,7 @@
 				rdb = prv->next = malloc(sizeof(struct _remotedb));
 			}
 			rdb->dbname = strdup(dbname);
+			rdb->tag = tag != NULL ? strdup(tag) : NULL;
 			rdb->conn = strdup(conn);
 			rdb->ttl = time(NULL) + atoi(ttl);
 			rdb->next = NULL;


define SWR_CH_MAX if it is not defined

define SWR_CH_MAX if it is not defined

--- ga/core/ga-avcodec.h
+++ ga/core/ga-avcodec.h
@@ -31,6 +31,10 @@
 }
 #endif

+#ifndef SWR_CH_MAX
+#define	SWR_CH_MAX	32
+#endif
+
 #include <map>
 #include <string>
 #include <vector>


Wait until both the reader and write are done before checking outcome

--- socket_test.c
+++ socket_test.c
@@ -22,7 +22,16 @@
 	size_t read_pos;
 	size_t read_capacity;
 	struct error read_err;
+
+	int stopped;
 };
+
+void tester_stop_1(struct tester *t, struct tasklet *tasklet)
+{
+	tasklet_stop(tasklet);
+	if (++t->stopped == 2)
+		application_stop();
+}

 void tester_write(void *v_t)
 {
@@ -32,7 +41,7 @@
 	for (;;) {
 		if (t->write_pos == t->write_len) {
 			socket_partial_close(t->socket, 1, 0, &t->write_err);
-			tasklet_stop(&t->write_tasklet);
+			tester_stop_1(t, &t->write_tasklet);
 			break;
 		}

@@ -46,10 +55,8 @@
 		t->write_pos += res;
 	}

-	if (!error_ok(&t->write_err)) {
-		tasklet_stop(&t->write_tasklet);
-		application_stop();
-	}
+	if (!error_ok(&t->write_err))
+		tester_stop_1(t, &t->write_tasklet);

 	mutex_unlock(&t->mutex);
 }
@@ -69,10 +76,8 @@
 				  t->read_capacity - t->read_pos,
 				  &t->read_tasklet, &t->read_err);
 		if (res <= 0) {
-			if (res == 0) {
-				tasklet_stop(&t->read_tasklet);
-				application_stop();
-			}
+			if (res == 0)
+				tester_stop_1(t, &t->read_tasklet);

 			break;
 		}
@@ -80,10 +85,8 @@
 		t->read_pos += res;
 	}

-	if (!error_ok(&t->read_err)) {
-		tasklet_stop(&t->read_tasklet);
-		application_stop();
-	}
+	if (!error_ok(&t->read_err))
+		tester_stop_1(t, &t->read_tasklet);

 	mutex_unlock(&t->mutex);
 }
@@ -93,6 +96,7 @@
 	struct tester *t = xalloc(sizeof *t);
 	mutex_init(&t->mutex);
 	t->socket = s;
+	t->stopped = 0;

 	tasklet_init(&t->write_tasklet, &t->mutex, t);
 	t->write_buf = "Hello";
@@ -153,16 +157,12 @@
 			     struct echo_server *es,
 			     struct socket *s)
 {
-	struct error err;
 	struct tester *t = tester_create(s);

-	error_init(&err);
 	application_run();
-	check_error(&err);
 	tester_check(t);
 	tester_destroy(t);
 	echo_server_destroy(es);
-	error_fini(&err);
 }

 static void test_echo_direct(void)
@@ -228,12 +228,11 @@

 	error_init(&err);

-	s = socket_factory_connect(sf, "localhost", "9998", &err);
+	s = socket_factory_connect(sf, "127.0.0.1", "9998", &err);
 	check_error(&err);

 	t = tester_create(s);
 	application_run();
-	check_error(&err);
 	assert(!error_ok(&t->write_err));
 	assert(strstr(error_message(&t->write_err), "Connection refused"));
 	assert(!error_ok(&t->read_err));


Fix typo: inverse -> invert.

Fix typo: inverse -> invert.

--- main/mode-notification.c
+++ main/mode-notification.c
@@ -34,7 +34,7 @@
 }

 static void task_mode_notification(void* pvParameters) {
-  bool inverse_the_icon = false;
+  bool invert_the_icon = false;

   while (true) {
     mutex_lock(mode_notification_mutex);
@@ -42,11 +42,11 @@
     buffer_wipe(&buffer_draw);
     draw_notification(&buffer_draw);

-    if (inverse_the_icon) {
+    if (invert_the_icon) {
       buffer_inverse(&buffer_draw);
     }

-    inverse_the_icon = !inverse_the_icon;
+    invert_the_icon = !invert_the_icon;
     buffer_commit_drawing();

     // Release the lock, and wait until the next run is due.


Remove unused type and struct member for link annotations.

darcs-hash:20080814205717-f546f-2d26c16ef13ad8afb32129f79969a4a09f235327.gz

--- include/mupdf/annot.h
+++ include/mupdf/annot.h
@@ -7,15 +7,8 @@
 typedef struct pdf_widget_s pdf_widget;
 typedef struct pdf_outline_s pdf_outline;

-typedef enum pdf_linkkind_e
-{
-	PDF_LGOTO,
-	PDF_LURI
-} pdf_linkkind;
-
 struct pdf_link_s
 {
-	pdf_linkkind kind;
 	fz_rect rect;
 	fz_obj *dest;
 	pdf_link *next;


nfc: hci: Add comment to explain NFC_HCI_MAX_PIPES

According to specification etsi 102 622 chapter 4.4 pipes identifier
is 7 bits long giving a 127 possible pipes value.

Reported-by: Dan Carpenter <ff341aa343d564f9e53e9dcb6996be8c04859a66@oracle.com>
Signed-off-by: Christophe Ricard <7fc2cd33e78f60c767c0b054f476a876f109b675@st.com>
Signed-off-by: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>

--- include/net/nfc/hci.h
+++ include/net/nfc/hci.h
@@ -83,6 +83,10 @@
 };

 #define NFC_HCI_MAX_CUSTOM_GATES	50
+/*
+ * According to specification 102 622 chapter 4.4 Pipes,
+ * the pipe identifier is 7 bits long.
+ */
 #define NFC_HCI_MAX_PIPES		127
 struct nfc_hci_init_data {
 	u8 gate_count;


ERR: refactor global error codes

ERR: refactor global error codes

Some ERR_R_ codes overlapped other ERR_R_ codes:

- ERR_R_BUF_LIB vs ERR_R_PASSED_INVALID_ARGUMENT
- ERR_R_DSA_LIB vs ERR_R_INTERRUPTED_OR_CANCELLED

Looking back at history, this was originally not an issue, because
the ERR_R_ codes that weren't ERR_LIB_ aliases had bit 2**6 set.
However, new codes without that bit came in, and we got the overlap
that is mentioned above.

To get rid of the overlap, we repartition the codes as follows:

- ERR_R_{name}_LIB that are aliases for ERR_LIB_{name} are confined to
  the range 1..63.
- Other ERR_R_ codes are confined to 64..99

We also expand the reason codes to 24 bits of data, where the 4 top
bits are for reason code flags.  We also allocate a "fatal" flag
ERR_RFLAG_FATAL.  The reason code ERR_R_FATAL stops acting as a flag,
but is coded in such a way that it still serves as one for code that
happens to use it as such.

Reviewed-by: David von Oheimb <fbbca6c63636e78e7034aaf1b4aa3a9736383192@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/12343)

--- include/openssl/err.h
+++ include/openssl/err.h
@@ -163,14 +163,43 @@
 #  define X509err(f, r) ERR_raise_data(ERR_LIB_X509, (r), NULL)
 # endif

-# define ERR_PACK(l,f,r) ( \
-        (((unsigned int)(l) & 0x0FF) << 24L) | \
-        (((unsigned int)(f) & 0xFFF) << 12L) | \
-        (((unsigned int)(r) & 0xFFF)       ) )
-# define ERR_GET_LIB(l)          (int)(((l) >> 24L) & 0x0FFL)
-# define ERR_GET_FUNC(l)         (int)(((l) >> 12L) & 0xFFFL)
-# define ERR_GET_REASON(l)       (int)( (l)         & 0xFFFL)
-# define ERR_FATAL_ERROR(l)      (int)( (l)         & ERR_R_FATAL)
+/*
+ * The error code currently packs as follows (viewed as hex nibbles):
+ *
+ * LL rRRRRR
+ *
+ * Where LL is the library code, r is the reason flags, and rRRRRR is the
+ * reason code.
+ * Do note that the reason flags is part of the reason code, and could as
+ * well be seen as a section of all possible reason codes.  We do this for
+ * backward compatibility reasons, i.e. how ERR_R_FATAL was implemented.
+ *
+ * System errors (ERR_LIB_SYS) are structured the same way, except they
+ * don't have any reason flag.
+ *
+ * LL RRRRRR
+ */
+# define ERR_LIB_OFFSET     24L
+# define ERR_LIB_MASK       0xFF
+# define ERR_RFLAGS_OFFSET  20L
+# define ERR_RFLAGS_MASK    0xF
+# define ERR_REASON_MASK    0XFFFFFF
+
+/*
+ * Reason flags are defined pre-shifted to easily combine with the reason
+ * number.
+ */
+# define ERR_RFLAG_FATAL    (0x1 << ERR_RFLAGS_OFFSET)
+
+/* ERR_PACK takes reason flags and reason code combined in |r| */
+# define ERR_PACK(l,f,r)                                                \
+    ( (((unsigned int)(l) & ERR_LIB_MASK) << ERR_LIB_OFFSET) |          \
+      (((unsigned int)(r) & ERR_REASON_MASK)) )
+# define ERR_GET_LIB(l)     (int)(((l) >> ERR_LIB_OFFSET) & ERR_LIB_MASK)
+# define ERR_GET_FUNC(l)    0
+# define ERR_GET_RFLAGS(l)  (int)((l) & (ERR_RFLAGS_MASK << ERR_RFLAGS_OFFSET))
+# define ERR_GET_REASON(l)  (int)((l) & ERR_REASON_MASK)
+# define ERR_FATAL_ERROR(l) (int)((l) & ERR_RFLAG_FATAL)

 # ifndef OPENSSL_NO_DEPRECATED_3_0
 #  define SYS_F_FOPEN             0
@@ -200,7 +229,7 @@
 #  define SYS_F_SENDFILE          0
 # endif

-/* reasons */
+/* "we came from here" global reason codes, range 1..63 */
 # define ERR_R_SYS_LIB   ERR_LIB_SYS/* 2 */
 # define ERR_R_BN_LIB    ERR_LIB_BN/* 3 */
 # define ERR_R_RSA_LIB   ERR_LIB_RSA/* 4 */
@@ -221,21 +250,26 @@
 # define ERR_R_ECDSA_LIB ERR_LIB_ECDSA/* 42 */
 # define ERR_R_OSSL_STORE_LIB ERR_LIB_OSSL_STORE/* 44 */

-# define ERR_R_NESTED_ASN1_ERROR                 58
-# define ERR_R_MISSING_ASN1_EOS                  63
-
-/* fatal error */
-# define ERR_R_FATAL                             64
-# define ERR_R_MALLOC_FAILURE                    (1|ERR_R_FATAL)
-# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED       (2|ERR_R_FATAL)
-# define ERR_R_PASSED_NULL_PARAMETER             (3|ERR_R_FATAL)
-# define ERR_R_INTERNAL_ERROR                    (4|ERR_R_FATAL)
-# define ERR_R_DISABLED                          (5|ERR_R_FATAL)
-# define ERR_R_INIT_FAIL                         (6|ERR_R_FATAL)
-# define ERR_R_PASSED_INVALID_ARGUMENT           (7)
-# define ERR_R_OPERATION_FAIL                    (8|ERR_R_FATAL)
-# define ERR_R_INVALID_PROVIDER_FUNCTIONS        (9|ERR_R_FATAL)
-# define ERR_R_INTERRUPTED_OR_CANCELLED          (10)
+/*
+ * global reason codes, range 64..99 (sub-system specific codes start at 100)
+ *
+ * ERR_R_FATAL had dual purposes in pre-3.0 OpenSSL, as a standalone reason
+ * code as well as a fatal flag.  This is still possible to do, as 2**6 (64)
+ * is present in the whole range of global reason codes.
+ */
+# define ERR_R_FATAL                             (64|ERR_RFLAG_FATAL)
+# define ERR_R_MALLOC_FAILURE                    (65|ERR_RFLAG_FATAL)
+# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED       (66|ERR_RFLAG_FATAL)
+# define ERR_R_PASSED_NULL_PARAMETER             (67|ERR_RFLAG_FATAL)
+# define ERR_R_INTERNAL_ERROR                    (68|ERR_RFLAG_FATAL)
+# define ERR_R_DISABLED                          (69|ERR_RFLAG_FATAL)
+# define ERR_R_INIT_FAIL                         (70|ERR_RFLAG_FATAL)
+# define ERR_R_PASSED_INVALID_ARGUMENT           (71)
+# define ERR_R_OPERATION_FAIL                    (72|ERR_RFLAG_FATAL)
+# define ERR_R_INVALID_PROVIDER_FUNCTIONS        (73|ERR_RFLAG_FATAL)
+# define ERR_R_INTERRUPTED_OR_CANCELLED          (74)
+# define ERR_R_NESTED_ASN1_ERROR                 (76)
+# define ERR_R_MISSING_ASN1_EOS                  (77)

 /*
  * 99 is the maximum possible ERR_R_... code, higher values are reserved for


Fix compilation on VS2010 (#207)

Fix compilation on VS2010 (#207)

--- include/plog/Record.h
+++ include/plog/Record.h
@@ -27,6 +27,43 @@

             template<class T>
             struct enableIf<true, T> { typedef T type; };
+
+		    struct No  { char a[1]; };
+            struct Yes { char a[2]; };
+
+            template <class From, class To>
+            struct isConvertible
+            {
+                // `+ sizeof(U*)` is required for GCC 4.5-4.7
+                template<class U>
+                static typename enableIf<!!(sizeof(static_cast<To>(meta::declval<U>())) + sizeof(U*)), Yes>::type test(int);
+
+                template<class U>
+                static No test(...);
+
+                enum { value = sizeof(test<From>(0)) == sizeof(Yes) };
+            };
+
+            template <class T>
+            struct isConvertibleToNString : isConvertible<T, std::basic_string<util::nchar> > {};
+
+            template <class T>
+            struct isContainer
+            {
+                template<class U>
+                static typename meta::enableIf<!!(sizeof(
+#if defined(_MSC_VER) && _MSC_VER < 1700 // MSVC 2010 doesn't understand `typename T::const_iterator`
+                    meta::declval<U>().begin()) + sizeof(meta::declval<U>().end()
+#else
+                    typename U::const_iterator
+#endif
+                    )), Yes>::type test(int);
+
+                template<class U>
+                static No test(...);
+
+                enum { value = sizeof(test<T>(0)) == sizeof(Yes) };
+            };
         }

         //////////////////////////////////////////////////////////////////////////
@@ -88,20 +125,20 @@
         }

 #if defined(__clang__) || !defined(__GNUC__) || __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 4 // skip for GCC < 4.5 due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38600
-        // Print data that can be casted to `std::basic_string`. `+ sizeof(T*)` is required for GCC 4.5-4.7.
-        template<typename T>
-        inline typename meta::enableIf<!!(sizeof(static_cast<std::basic_string<util::nchar> >(meta::declval<T>())) + sizeof(T*)), void>::type operator<<(util::nostringstream& stream, const T& data)
+        // Print data that can be casted to `std::basic_string`.
+        template<class T>
+        inline typename meta::enableIf<meta::isConvertibleToNString<T>::value, void>::type operator<<(util::nostringstream& stream, const T& data)
         {
             plog::detail::operator<<(stream, static_cast<std::basic_string<util::nchar> >(data));
         }

         // Print std containers
-        template<class Container>
-        inline typename meta::enableIf<!!(sizeof(typename Container::const_iterator)), void>::type operator<<(util::nostringstream& stream, const Container& data)
+        template<class T>
+        inline typename meta::enableIf<meta::isContainer<T>::value && !meta::isConvertibleToNString<T>::value, void>::type operator<<(util::nostringstream& stream, const T& data)
         {
             stream << "[";

-            for (typename Container::const_iterator it = data.begin(); it != data.end();)
+            for (typename T::const_iterator it = data.begin(); it != data.end();)
             {
                 stream << *it;

@@ -129,12 +166,12 @@
         namespace meta
         {
             template<class T, class Stream>
-            inline char operator<<(Stream&, const T&);
+            inline No operator<<(Stream&, const T&);

             template <class T, class Stream>
             struct isStreamable
             {
-                enum { value = sizeof(operator<<(meta::declval<Stream>(), meta::declval<const T>())) != sizeof(char) };
+                enum { value = sizeof(operator<<(meta::declval<Stream>(), meta::declval<const T>())) != sizeof(No) };
             };

             template <class Stream>


'sat_eph' now outputs motion rate and position angle

--- sat_eph.c
+++ sat_eph.c
@@ -101,10 +101,46 @@
    return( rval);
 }

+/* 'obs_pos' = observer position relative to the geocenter, km
+   'topo_posn' = artsat position relative to the observer, km
+   'sat_vel' = artsat vel, km/minute (usual,  though somewhat oddball,  SxPx units)
+   '*motion_pa' = returned posn angle of motion,  degrees
+   apparent total angular motion is returned               */
+
+static double compute_angular_rates( const double *obs_pos, const double *topo_posn,
+              const double *sat_vel, double *motion_pa)
+{
+   double vel[3];         /* velocity of sat relative to observer */
+   double x_vect[3];    /* unit vector in equatorial plane perpendicular to topo_posn */
+   double y_vect[3];    /* unit vector perpendicular to topo_posn & x_vect */
+   double xmotion, ymotion, total_motion, dist;
+   const double omega_E = 1.00273790934;
+                   /* Earth rotations per sidereal day (non-constant) */
+   const double omega = omega_E * 2. * PI / minutes_per_day;
+                   /* Earth rotational rate in radians/minute */
+
+   vel[0] = sat_vel[0] - omega * obs_pos[1];
+   vel[1] = sat_vel[1] - omega * obs_pos[0];
+   vel[2] = sat_vel[2];
+   x_vect[0] = topo_posn[1];     /* approximate as rotating around the z axis */
+   x_vect[1] = -topo_posn[0];    /* (close enough to being true) */
+   x_vect[2] = 0.;
+   vector_cross_product( y_vect, topo_posn, x_vect);
+   normalize_vect3( x_vect);
+   normalize_vect3( y_vect);
+   dist = vector3_length( topo_posn);
+   xmotion = dot_product( vel, x_vect) / dist;      /* all in radians/minute */
+   ymotion = dot_product( vel, y_vect) / dist;
+   total_motion = hypot( xmotion, ymotion);
+   *motion_pa = PI + atan2( xmotion, ymotion);
+   *motion_pa *= 180. / PI;
+   return( total_motion * (180. / PI) * 60.);      /* cvt to arcmin/min = arcsec/sec */
+}
+
 static const char *header_text =
-           "Date (UTC)  Time       R.A. (J2000)  decl   Alt   Elong   Dist(km)";
+           "Date (UTC)  Time       R.A. (J2000)  decl   Alt   Elong   Dist(km)  \"/sec   PA";
 static const char *geo_header_text =
-           "Date (UTC)  Time       R.A. (J2000)  decl   Elong   Dist(km)";
+           "Date (UTC)  Time       R.A. (J2000)  decl   Elong   Dist(km)  \"/sec   PA";

 static int show_ephems_from( const char *path_to_tles, const ephem_t *e,
                                   const char *filename)
@@ -169,6 +205,8 @@
                double pos[3], vel[3], obs_pos[3], ra, dec, dist;
                const double t_since = (jd - tle.epoch) * minutes_per_day;
                double solar_xyzr[4], topo_posn[3], elong;
+               double motion_rate, motion_pa;
+               const char *format_string;

                if( !i)
                   {
@@ -177,7 +215,7 @@
                               (atoi( tle.intl_desig) > 57000) ? "19" : "20",
                               tle.intl_desig, tle.intl_desig + 2);
                   printf( "%s\n%s", line0, (is_geocentric ? geo_header_text : header_text));
-                  printf( abs_mag ? "   Mag\n" : "\n");
+                  printf( abs_mag ? "     Mag\n" : "\n");
                   }
                full_ctime( buff, jd, FULL_CTIME_YMD | FULL_CTIME_MONTHS_AS_DIGITS
                                  | FULL_CTIME_LEADING_ZEROES);
@@ -194,6 +232,7 @@
                ra_buff[10] = dec_buff[9] = '\0';
                for( j = 0; j < 3; j++)
                   topo_posn[j] = pos[j] - obs_pos[j];
+               motion_rate = compute_angular_rates( obs_pos, topo_posn, vel, &motion_pa);
                lunar_solar_position( jd, NULL, solar_xyzr);
                ecliptic_to_equatorial( solar_xyzr);
                if( !is_geocentric)
@@ -204,6 +243,13 @@
                elong = angle_between( topo_posn, solar_xyzr);
                printf( "%s  %s  %s%s %6.1f %8.0f", buff, ra_buff, dec_buff,
                      alt_buff, elong, dist);
+               if( motion_rate < 999.)
+                  format_string = "  %6.2f %6.1f";
+               else if( motion_rate < 9999.)
+                  format_string = "  %6.1f %6.1f";
+               else
+                  format_string = "  %6.0f %6.1f";
+               printf( format_string, motion_rate, motion_pa);
                if( !abs_mag)
                   printf( "\n");
                else


Added a comment to explain the signal used to stop parsing early.

2007-07-06  Michael J. Chudobiak  <mjc@cvs.gnome.org>

        * io-tiff.c: (tiff_image_parse): Added a comment to explain
        the signal used to stop parsing early.

svn path=/trunk/; revision=18385

--- gdk-pixbuf/io-tiff.c
+++ gdk-pixbuf/io-tiff.c
@@ -202,6 +202,11 @@
                 gint h = height;
 		(* context->size_func) (&w, &h, context->user_data);

+		/* This is a signal that this function is being called
+		   to support gdk_pixbuf_get_file_info, so we can stop
+		   parsing the tiff file at this point. It is not an
+		   error condition. */
+
                 if (w == 0 || h == 0)
                     return NULL;
         }


tiff: Flag multi-page TIFF files

tiff: Flag multi-page TIFF files

Add the "multipage" option to TIFF files with multiple pages. This will
allow applications that use gdk-pixbuf to display images to detect them,
and offer to open them in more capable readers (such as GIMP, or
Evince).

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

--- gdk-pixbuf/io-tiff.c
+++ gdk-pixbuf/io-tiff.c
@@ -237,6 +237,11 @@
 		g_object_unref (pixbuf);
 		return NULL;
 	}
+
+	/* Flag multi-page documents, because this loader only handles the
+	   first page. The client app may wish to warn the user. */
+        if (TIFFReadDirectory (tiff))
+                gdk_pixbuf_set_option (pixbuf, "multipage", "yes");

 #if G_BYTE_ORDER == G_BIG_ENDIAN
 	/* Turns out that the packing used by TIFFRGBAImage depends on


Added solution to the weird numbers problem using c

error: pathspec 'Weird_numbers/C/WeirdNumbers/WeirdNumbers/weird.c' did not match any file(s) known to git

--- Weird_numbers/C/WeirdNumbers/WeirdNumbers/weird.c
+++ Weird_numbers/C/WeirdNumbers/WeirdNumbers/weird.c
@@ -0,0 +1,113 @@
+#include "stdio.h"
+#include "stdlib.h"
+#include "stdbool.h"
+#include "string.h"
+
+struct int_a {
+    int *ptr;
+    size_t size;
+};
+
+struct int_a divisors(int n) {
+    int *divs, *divs2, *out;
+    int i, j, c1 = 0, c2 = 0;
+    struct int_a array;
+
+    divs = malloc(n * sizeof(int) / 2);
+    divs2 = malloc(n * sizeof(int) / 2);
+    divs[c1++] = 1;
+
+    for (i = 2; i * i <= n; i++) {
+        if (n % i == 0) {
+            j = n / i;
+            divs[c1++] = i;
+            if (i != j) {
+                divs2[c2++] = j;
+            }
+        }
+    }
+
+    out = malloc((c1 + c2) * sizeof(int));
+    for (int i = 0; i < c2; i++) {
+        out[i] = divs2[i];
+    }
+    for (int i = 0; i < c1; i++) {
+        out[c2 + i] = divs[c1 - i - 1];
+    }
+    array.ptr = out;
+    array.size = c1 + c2;
+
+    free(divs);
+    free(divs2);
+    return array;
+}
+
+bool abundant(int n, struct int_a divs) {
+    int sum = 0;
+    int i;
+    for (i = 0; i < divs.size; i++) {
+        sum += divs.ptr[i];
+    }
+    return sum > n;
+}
+
+bool semiperfect(int n, struct int_a divs) {
+    if (divs.size > 0) {
+        int h = *divs.ptr;
+        int *t = divs.ptr + 1;
+
+        struct int_a ta;
+        ta.ptr = t;
+        ta.size = divs.size - 1;
+
+        if (n < h) {
+            return semiperfect(n, ta);
+        } else {
+            return n == h
+                || semiperfect(n - h, ta)
+                || semiperfect(n, ta);
+        }
+    } else {
+        return false;
+    }
+}
+
+bool *sieve(int limit) {
+    bool *w = calloc(limit, sizeof(bool));
+    struct int_a divs;
+    int i, j;
+
+    for (i = 2; i < limit; i += 2) {
+        if (w[i]) continue;
+        divs = divisors(i);
+        if (!abundant(i, divs)) {
+            w[i] = true;
+        } else if (semiperfect(i, divs)) {
+            for (j = i; j < limit; j += i) {
+                w[j] = true;
+            }
+        }
+    }
+
+    free(divs.ptr);
+    return w;
+}
+
+int main() {
+    bool *w = sieve(17000);
+    int count = 0;
+    int max = 25;
+    int n;
+
+    printf("The first 25 weird numbers:\n");
+    for (n = 2; count < max; n += 2) {
+        if (!w[n]) {
+            printf("%d ", n);
+            count++;
+        }
+    }
+    printf("\n");
+
+    free(w);
+    return 0;
+}


Tegra210: SE: remove logic to enable atomic save/restore

This patch removes the logic to set the bit that enables atomic context
save/restore when we enter System suspend. The bootrom enables this bit
during cold boot and exit from System Suspend, so we can remove this
setting from the driver.

Change-Id: Id4e08d5048155c970f5e31d9c9dd676c07182ade
Signed-off-by: Samuel Payne <91c5ba82f7a6b6747087b6390750ffe3895ea67b@nvidia.com>

--- plat/nvidia/tegra/soc/t210/drivers/se/security_engine.c
+++ plat/nvidia/tegra/soc/t210/drivers/se/security_engine.c
@@ -186,33 +186,17 @@
 }

 /*
- * Verify the SE context save auto has been enabled.
- * SE_CTX_SAVE_AUTO.ENABLE == ENABLE
- * If the SE context save auto is not enabled, then set
- * the context save auto enable and lock the setting.
- * If the SE context save auto is not enabled and the
- * enable setting is locked, then return an error.
- */
-static inline int32_t tegra_se_ctx_save_auto_enable(const tegra_se_dev_t *se_dev)
+ * Returns true if the SE engine is configured to perform SE context save in
+ * hardware.
+ */
+static inline int32_t tegra_se_atomic_save_enabled(const tegra_se_dev_t *se_dev)
 {
 	uint32_t val;
 	int32_t ret = 0;

 	val = tegra_se_read_32(se_dev, SE_CTX_SAVE_AUTO_REG_OFFSET);
-	if (SE_CTX_SAVE_AUTO_ENABLE(val) == SE_CTX_SAVE_AUTO_DIS) {
-		if (SE_CTX_SAVE_AUTO_LOCK(val) == SE_CTX_SAVE_AUTO_LOCK_EN) {
-			ERROR("%s: ERR: Cannot enable atomic. Write locked!\n",
-					__func__);
-			ret = -EACCES;
-		}
-
-		/* Program SE_CTX_SAVE_AUTO */
-		if (ret == 0) {
-			tegra_se_write_32(se_dev, SE_CTX_SAVE_AUTO_REG_OFFSET,
-					SE_CTX_SAVE_AUTO_LOCK_EN |
-					SE_CTX_SAVE_AUTO_EN);
-		}
-	}
+	if (SE_CTX_SAVE_AUTO_ENABLE(val) == SE_CTX_SAVE_AUTO_EN)
+		ret = 1;

 	return ret;
 }
@@ -264,7 +248,7 @@
 	 * SE_CTX_SAVE_AUTO.ENABLE == ENABLE
 	 */
 	if (ret == 0) {
-		ret = tegra_se_ctx_save_auto_enable(se_dev);
+		ret = tegra_se_atomic_save_enabled(se_dev);
 	}

 	/* Read the context save progress counter: block_count
@@ -483,12 +467,6 @@
 		DRBG_RO_ENT_SRC_ENABLE;
 	tegra_se_write_32(se_dev, SE_RNG_SRC_CONFIG_REG_OFFSET, val);

-	/* Enable and lock the SE atomic context save setting */
-	if (tegra_se_ctx_save_auto_enable(se_dev) != 0) {
-		ERROR("%s: ERR: enable SE%d context save auto failed!\n",
-			__func__, se_dev->se_num);
-	}
-
 	/* Set a random value to SRK to initialize DRBG */
 	tegra_se_generate_srk(se_dev);
 }


documentation

documentation

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

--- seqan/projects/library/seqan/align/align_local_dynprog.h
+++ seqan/projects/library/seqan/align/align_local_dynprog.h
@@ -794,6 +794,7 @@
 ..signature:localAlignment(align, sw_finder, score, cutoff, tag)
 ..signature:localAlignment(align, sw_finder, score, cutoff, diagLow, diagHigh, tag)
 ..param.align:Alignment object to use.
+...type:Class.Align
 ..param.cutoff:Alignments with scores < cutoff will be discarded.
 ..param.diagLow:The lowest diagonal of the alignment matrix that will be computed for banded alignment.
 ..param.diagHigh:The highest diagonal of the alignment matrix that will be computed for banded alignment.


fixup warnings

fixup warnings

--- pam_yubico.c
+++ pam_yubico.c
@@ -277,7 +277,6 @@
 			   const char *user,
 			   const char *token_id)
 {
-  DBG(("called"));
   int retval = 0;
   int protocol;
 #ifdef HAVE_LIBLDAP
@@ -292,6 +291,9 @@
   int i, rc;

   char *find = NULL;
+#endif
+  DBG(("called"));
+#ifdef HAVE_LIBLDAP

   if (cfg->user_attr == NULL) {
     DBG (("Trying to look up user to YubiKey mapping in LDAP, but user_attr not set!"));
@@ -425,9 +427,10 @@

 #if HAVE_CR
 static int
-display_error(pam_handle_t *pamh, char *message) {
+display_error(pam_handle_t *pamh, const char *message) {
   struct pam_conv *conv;
-  struct pam_message *pmsg[1], msg[1];
+  const struct pam_message *pmsg[1];
+  struct pam_message msg[1];
   struct pam_response *resp = NULL;
   int retval;

@@ -440,8 +443,7 @@
   pmsg[0] = &msg[0];
   msg[0].msg = message;
   msg[0].msg_style = PAM_ERROR_MSG;
-  retval = conv->conv(1, (const struct pam_message **) pmsg,
-		      &resp, conv->appdata_ptr);
+  retval = conv->conv(1, pmsg, &resp, conv->appdata_ptr);

   if (retval != PAM_SUCCESS) {
     D(("conv returned error: %s", pam_strerror (pamh, retval)));
@@ -466,7 +468,7 @@
   YK_KEY *yk = NULL;
   CR_STATE state;

-  char *errstr = NULL;
+  const char *errstr = NULL;

   struct passwd *p;
   struct stat st;
@@ -556,8 +558,8 @@
   yubikey_hex_encode(response_hex, buf, response_len);
   if(state.salt_len > 0) { // the expected response has gone through pbkdf2
     YK_PRF_METHOD prf_method = {20, yk_hmac_sha1};
-    yk_pbkdf2(response_hex, state.salt, state.salt_len, state.iterations,
-        buf, response_len, &prf_method);
+    yk_pbkdf2(response_hex, (unsigned char*)state.salt, state.salt_len, state.iterations,
+        (unsigned char*)buf, response_len, &prf_method);
   }

   if (memcmp(buf, state.response, state.response_len) == 0) {
@@ -776,7 +778,8 @@
   int skip_bytes = 0;
   int valid_token = 0;
   struct pam_conv *conv;
-  struct pam_message *pmsg[1], msg[1];
+  const struct pam_message *pmsg[1];
+  struct pam_message msg[1];
   struct pam_response *resp;
   int nargs = 1;
   ykclient_t *ykc = NULL;
@@ -866,8 +869,8 @@

       pmsg[0] = &msg[0];
       {
-	const char *query_template = "Yubikey for `%s': ";
-	size_t len = strlen (query_template) + strlen (user);
+#define QUERY_TEMPLATE "YubiKey for `%s': "
+	size_t len = strlen (QUERY_TEMPLATE) + strlen (user);
 	int wrote;

 	msg[0].msg = malloc (len);
@@ -877,7 +880,7 @@
 	    goto done;
 	  }

-	wrote = snprintf ((char *) msg[0].msg, len, query_template, user);
+	wrote = snprintf ((char *) msg[0].msg, len, QUERY_TEMPLATE, user);
 	if (wrote < 0 || wrote >= len)
 	  {
 	    retval = PAM_BUF_ERR;
@@ -887,8 +890,7 @@
       msg[0].msg_style = cfg->verbose_otp ? PAM_PROMPT_ECHO_ON : PAM_PROMPT_ECHO_OFF;
       resp = NULL;

-      retval = conv->conv (nargs, (const struct pam_message **) pmsg,
-			   &resp, conv->appdata_ptr);
+      retval = conv->conv (nargs, pmsg, &resp, conv->appdata_ptr);

       free ((char *) msg[0].msg);


Check the return value of semantic_analysis.

--- source/main.c
+++ source/main.c
@@ -9,8 +9,8 @@
 extern FILE * yyin;
 // TODO: This method for showing more details about the file content
 // when encountering errors is not very neat and needed to be optimized
-extern char *file_content[1024];
-extern char file_name[1024];
+char *file_content[1024];
+char file_name[1024];
 extern int yyparse();

 Syntax * top_level;
@@ -48,12 +48,15 @@
     if(yyparse() != 0)
         return 0;

+    //print_syntax(top_level);
+
     // semantic analysis
-    semantic_analysis(top_level);
+    if(semantic_analysis(top_level) != 0)
+        return 0;

     // TODO: generate intermidiate code

-    // TODO: generate objective code from intermidiate code
+    // TODO: generate target code from intermidiate code

     printf("\033[1;32mCompile Success!\033[0m\n");
     return 0;


make_b() fixed

make_b() fixed

--- source/main.c
+++ source/main.c
@@ -27,52 +27,58 @@
 	return ret;
 }*/

-/* CRC-32, eg. ethernet */
-
-void make_b(char fg[],char g[])
- {       char af[]="/mk7se/backup";
-         char ad[400];
-		 puts("going to make a backup");
-		 char *ah=rfds(fg);
-		 char *gh=rfds(g);
-		 puts("File read successful");
-        if(!(mkdir(af , 0777)))
-			printf("backup path made with success\n");
-        else
-			printf("fail");
-	    time_t unixTime = time(NULL);
+
+void make_b(char *fg,int b)
+ {
+         FILE *fp1, *fp2;
+         char ch;
+         char az[1024];
+		 printf("%d",b);
+		 int pos;
+		 if(!(mkdir("/mk7se/backup", 0777)))
+		 {
+			 puts("backup folder created");
+		 }
+		time_t unixTime = time(NULL);
 		struct tm* timeStruct = gmtime((const time_t *)&unixTime);
-        char az[20];
+
 		int hours = timeStruct->tm_hour;
 		int minutes = timeStruct->tm_min;
         int day = timeStruct->tm_mday;
-		printf("/%i_%02i_%02i\n",day,hours, minutes);
-        sprintf(az,"/%i_%02i_%02i",day,hours, minutes);
-		puts(az);
-		strcat(af,az);
-		printf("path 1: %s\n",af);
-		puts(af);
-	    memmove (fg, fg+6, 11);
-		memmove (g,g+6,11);
-
-		 puts(fg);
-		 puts(g);
-		if(!(mkdir(af , 0777)))
-			printf("backup path2 created\n");
-
-	    strcpy(ad,af);
-		printf("ad:%s\n",ad);
-		strcat(ad,(const char*)fg);
-		puts(ad);
-		strcat(af,(const char*)g);
-		puts(af);
-		FILE *f = fopen(af, "wb+");
-           fwrite(ah, 1, strlen(ah), f);
-           fclose(f);
-        f = fopen(ad, "wb+");
-           fwrite(ah, 1, strlen(ah), f);
-           fclose(f);
-}
+
+       char ag[20];
+       sprintf(az,"/mk7se/backup/%i_%02i_%02i",day,hours, minutes);
+         if(!(mkdir(az, 0777)))
+		 {
+			 puts("backup folder created");
+		 }
+    sprintf(ag,"/system%d.dat",b);
+    strcat(az,ag);
+
+    fp1 = fopen(fg, "rb");
+    fp2 = fopen(az, "wb+");
+
+    fseek(fp1, 0, SEEK_END); // file pointer at end of file
+
+    pos = ftell(fp1);
+
+    fseek(fp1, 0, SEEK_SET); // file pointer set at start
+
+    while (pos--)
+
+    {
+
+        ch = fgetc(fp1);  // copying file character by character
+
+        fputc(ch, fp2);
+
+    }
+
+   printf("File copied Successfully!");
+   fclose(fp1);
+   fclose(fp2);
+}
+

 void draw(int curent, char *menu[], int N,PrintConsole *top,PrintConsole*bottom) {


removed AAC header from HLS handler

removed AAC header from HLS handler

--- hls/ngx_rtmp_hls_module.c
+++ hls/ngx_rtmp_hls_module.c
@@ -1479,7 +1479,7 @@
     }

     if (codec_ctx->audio_codec_id != NGX_RTMP_AUDIO_AAC ||
-        codec_ctx->aac_header == NULL)
+        codec_ctx->aac_header == NULL || ngx_rtmp_is_codec_header(in))
     {
         return NGX_OK;
     }


git-svn-id: https://www.imagemagick.org/subversion/ImageMagick/branches/ImageMagick-6@10802 aa41f4f7-0bf4-0310-aa73-e5a19afd5a74

--- magick/distribute-cache.c
+++ magick/distribute-cache.c
@@ -526,6 +526,8 @@
   p+=sizeof(image->columns);
   (void) memcpy(&image->rows,p,sizeof(image->rows));
   p+=sizeof(image->rows);
+  if (SyncImagePixelCache(image,exception) == MagickFalse)
+    return(MagickFalse);
   status=AddValueToSplayTree(registry,(const void *) session_key,image);
   return(status);
 }


No-code change to trigger the bots.

No-code change to trigger the bots.

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@49443 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

--- chrome/browser/cocoa/preferences_window_controller.h
+++ chrome/browser/cocoa/preferences_window_controller.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.


arm: Remove unnecessary assert()s.

arm: Remove unnecessary assert()s.

The verifiers for the checked nodes are at least as strict as these assert()s.

--- ir/be/arm/arm_transform.c
+++ ir/be/arm/arm_transform.c
@@ -712,7 +712,6 @@
 			panic("softfloat not lowered");
 		}
 	}
-	assert(mode_is_data(mode));
 	if (arm_cg_config.variant < ARM_VARIANT_6) {
 		return new_bd_arm_Mul_v5(dbg, block, new_op1, new_op2);
 	} else {
@@ -1092,7 +1091,6 @@
 			panic("softfloat not lowered");
 		}
 	}
-	assert(mode_is_data(mode));
 	return new_bd_arm_Rsb_imm(dbgi, block, new_op, 0, 0);
 }

@@ -1117,8 +1115,6 @@
 			panic("softfloat not lowered");
 		}
 	} else {
-		assert(mode_is_data(mode) && "unsupported mode for Load");
-
 		new_load = new_bd_arm_Ldr(dbgi, block, new_ptr, new_mem, mode, NULL, 0, 0, false);
 	}
 	set_irn_pinned(new_load, get_irn_pinned(node));
@@ -1149,7 +1145,6 @@
 			panic("softfloat not lowered");
 		}
 	} else {
-		assert(mode_is_data(mode) && "unsupported mode for Store");
 		new_store = new_bd_arm_Str(dbgi, block, new_ptr, new_val, new_mem, mode,
 		                           NULL, 0, 0, false);
 	}


Stop writing logs straight to kotaka

Stop writing logs straight to kotaka

--- mudlib/mud/home/Kotaka/sys/channeld.c
+++ mudlib/mud/home/Kotaka/sys/channeld.c
@@ -298,8 +298,6 @@

 	time = time();

-	write_file("log/log-" + (time - time % 86400) + "-" + channel, time + ": " + channel + ": " + (sender ? sender + ": " : "") + message + "\n");
-
 	stamp = ctime(time)[11 .. 18];

 	if (subscribers[channel]) {


refactored immediates:
 - now stored as long values (should be enough)
 - floating point values are emitted right

[r18089]

--- ir/be/arm/bearch_arm.c
+++ ir/be/arm/bearch_arm.c
@@ -947,8 +947,7 @@
 	arch_set_irn_register(env->arch_env, keep, &arm_gp_regs[REG_R12]);
 	be_set_constr_single_reg(keep, BE_OUT_POS(0), &arm_gp_regs[REG_R12] );

-	fp = new_rd_arm_Sub_i(NULL, irg, block, keep, get_irn_mode(fp),
-	                      new_tarval_from_long(4, get_irn_mode(fp)));
+	fp = new_rd_arm_Sub_i(NULL, irg, block, keep, get_irn_mode(fp), 4);
 	arch_set_irn_register(env->arch_env, fp, env->isa->bp);

 	be_abi_reg_map_set(reg_map, env->isa->bp, fp);
@@ -987,8 +986,7 @@
 	} else {
 		ir_node *sub12_node;
 		ir_node *load_node;
-		tarval *tv = new_tarval_from_long(12,mode_Iu);
-		sub12_node = new_rd_arm_Sub_i(NULL, env->irg, bl, curr_bp, mode_Iu, tv);
+		sub12_node = new_rd_arm_Sub_i(NULL, env->irg, bl, curr_bp, mode_Iu, 12);
 		// FIXME
 		//set_arm_req_out_all(sub12_node, sub12_req);
 		arch_set_irn_register(env->arch_env, sub12_node, env->isa->sp);